@prismicio/editor-fields 0.4.63 → 0.4.65

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 (62) hide show
  1. package/dist/EditorConfig.d.ts +12 -3
  2. package/dist/core/APIExplorer/APIExplorer.d.ts +2 -0
  3. package/dist/core/APIExplorer/components/APIExplorerContext.d.ts +54 -0
  4. package/dist/core/APIExplorer/components/APIExplorerRequest.d.ts +2 -0
  5. package/dist/core/APIExplorer/components/APIExplorerResponse.d.ts +2 -0
  6. package/dist/core/APIExplorer/components/Request/GetByTypeRequest.d.ts +1 -0
  7. package/dist/core/APIExplorer/components/Request/GetByUIDRequest.d.ts +1 -0
  8. package/dist/core/APIExplorer/components/Request/GetRepositoryRequest.d.ts +1 -0
  9. package/dist/core/APIExplorer/components/Request/GetRequest.d.ts +1 -0
  10. package/dist/core/APIExplorer/components/Request/GetSingleRequest.d.ts +1 -0
  11. package/dist/core/APIExplorer/components/Request/components/RequestFormInput.d.ts +4 -0
  12. package/dist/core/APIExplorer/components/Request/components/RequestFormInputBase.d.ts +6 -0
  13. package/dist/core/APIExplorer/components/Request/components/RequestFormSelect.d.ts +4 -0
  14. package/dist/core/APIExplorer/components/Request/components/RequestPaginationFieldset.d.ts +5 -0
  15. package/dist/core/APIExplorer/components/Request/components/RequestTypeFieldset.d.ts +7 -0
  16. package/dist/core/APIExplorer/components/Request/components/index.d.ts +3 -0
  17. package/dist/core/APIExplorer/components/Request/createRequest.d.ts +17 -0
  18. package/dist/core/APIExplorer/components/Request/index.d.ts +1 -0
  19. package/dist/core/APIExplorer/components/Request/types.d.ts +14 -0
  20. package/dist/core/APIExplorer/index.d.ts +1 -0
  21. package/dist/core/MediaLibrary/hooks/mediaLibraryData.d.ts +49 -49
  22. package/dist/core/MediaLibrary/hooks/tagData.d.ts +3 -3
  23. package/dist/core/MediaLibrary/hooks/useMediaLibraryUpload.d.ts +5 -5
  24. package/dist/core/MediaLibrary/hooks/useSelectedMedia.d.ts +5 -5
  25. package/dist/core/service/aiSeoMetadata.d.ts +2 -6
  26. package/dist/core/service/document.d.ts +89 -67
  27. package/dist/core/service/documentSearch.d.ts +10 -10
  28. package/dist/core/service/repository.d.ts +29 -21
  29. package/dist/core/service/role.d.ts +289 -46
  30. package/dist/core/service/user.d.ts +11 -7
  31. package/dist/fields/ImageField/useImageField.d.ts +5 -5
  32. package/dist/fields/ImageField/useImageFieldImageUpload.d.ts +5 -5
  33. package/dist/fields/LinkField/Documents/documentsData.d.ts +4 -4
  34. package/dist/fields/RichTextField/RichTextField.d.ts +7 -0
  35. package/dist/fields/RichTextField/extensions/Image/useImageView.d.ts +5 -5
  36. package/dist/fields/RichTextField/extensions/Table/Table.d.ts +4 -4
  37. package/dist/fields/RichTextField/extensions/Table/TableCell/TableCell.d.ts +10 -0
  38. package/dist/fields/RichTextField/extensions/Table/TableCell/TableHeaderCell.d.ts +10 -0
  39. package/dist/fields/RichTextField/extensions/Table/TableCell/index.d.ts +2 -0
  40. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/TableHandlesPlugin.d.ts +8 -0
  41. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/TableHandlesPluginView.d.ts +34 -0
  42. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/events.d.ts +19 -0
  43. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/index.d.ts +1 -0
  44. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/utils.d.ts +23 -0
  45. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/index.d.ts +1 -0
  46. package/dist/fields/RichTextField/extensions/Table/TableCell/types.d.ts +14 -0
  47. package/dist/fields/RichTextField/extensions/Table/TableCell/utils.d.ts +16 -0
  48. package/dist/fields/RichTextField/extensions/Table/TableRow.d.ts +9 -0
  49. package/dist/fields/RichTextField/extensions/Table/TableView.d.ts +20 -0
  50. package/dist/fields/RichTextField/extensions/Table/menus/TableColumnMenu.d.ts +11 -0
  51. package/dist/fields/RichTextField/extensions/Table/menus/TableFloatingMenus.d.ts +7 -0
  52. package/dist/fields/RichTextField/extensions/Table/menus/TableRowMenu.d.ts +10 -0
  53. package/dist/fields/RichTextField/extensions/Table/menus/TriggerAnchor.d.ts +11 -0
  54. package/dist/fields/RichTextField/extensions/Table/menus/index.d.ts +2 -0
  55. package/dist/fields/RichTextField/extensions/Table/menus/utils.d.ts +13 -0
  56. package/dist/fields/RichTextField/extensions/Table/utils.d.ts +14 -0
  57. package/dist/index.cjs.js +138 -38
  58. package/dist/index.d.ts +1 -0
  59. package/dist/index.es.js +59660 -10886
  60. package/dist/slices/utils.d.ts +4 -2
  61. package/package.json +7 -7
  62. package/dist/fields/RichTextField/extensions/Table/TableControlsWrapper.d.ts +0 -3
package/dist/index.cjs.js CHANGED
@@ -1,38 +1,138 @@
1
- "use strict";var Zi=Object.defineProperty;var Ji=(e,t,n)=>t in e?Zi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var W=(e,t,n)=>(Ji(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react/jsx-runtime"),r=require("@prismicio/editor-ui"),f=require("react"),te=require("@prismicio/editor-support/URL"),K=require("@prismicio/types-internal/lib/content"),w=require("@prismicio/types-internal/lib/customtypes"),oe=require("@tanstack/react-query"),Ge=require("@prismicio/editor-support/Object"),E=require("@prismicio/editor-support/React"),cn=require("@prismicio/editor-support/Date"),O=require("@prismicio/editor-support/Array"),R=require("@prismicio/editor-support/Suspense"),Ae=require("@prismicio/editor-support/String"),U=require("@prismicio/editor-support/Http"),p=require("zod"),ee=require("@prismicio/editor-support/Set"),ae=require("@prismicio/editor-support/Type"),Xi=require("@prismicio/editor-support/Map"),X=require("@tiptap/core"),$i=require("@tiptap/extension-history"),er=require("@tiptap/extension-list-keymap"),ne=require("@tiptap/react"),tr=require("@tiptap/extension-document"),aA=require("@tiptap/extension-hard-break"),nr=require("@tiptap/extension-list-item"),Ar=require("@tiptap/extension-paragraph"),or=require("@prismicio/richtext"),ir=require("@tiptap/extension-text"),rr=require("@tiptap/extension-bold"),sr=require("@tiptap/extension-bullet-list"),ar=require("@tiptap/extension-code-block"),lr=require("@tiptap/extension-heading"),cr=require("@prismicio/editor-support/DOM"),dr=require("@tiptap/extension-italic"),ur=require("@tiptap/extension-ordered-list"),gr=require("@tiptap/extension-table"),lA=require("@tiptap/extension-table-cell"),cA=require("@tiptap/extension-table-header"),dA=require("@tiptap/extension-table-row"),Se=require("@tiptap/pm/tables"),hr=require("@tiptap/extension-placeholder"),ce=require("@floating-ui/react-dom-interactions"),pr=require("@tiptap/suggestion"),mr=require("@prismicio/editor-support/Number"),Dn=require("@aws-sdk/client-bedrock-runtime"),fr=require("@prismicio/editor-support/Animation"),uA={next:"Next.js",nuxt:"Nuxt",sveltekit:"SvelteKit",other:"Other"},gA={next:"npx create-next-app@latest",nuxt:"npx nuxi@latest init",sveltekit:"npx sv create"},Cr=18,xr=41,yr=24;function Ot(e){const t=e.code.split(`
2
- `).length;return A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(r.Alert,{icon:"alert",title:"Oops! We couldn't load the Code Block",color:"error",noShadow:!0,footerButtons:{action:{onClick:()=>window.location.reload(),text:"Refresh page"}}}),children:A.jsx(f.Suspense,{fallback:A.jsx(r.Skeleton,{height:xr+yr+t*Cr,borderRadius:6}),children:A.jsx(r.LazyCodeBlock,{...e})})})}function hA(e){if(K.isRepeatableContent(e))return e;if(K.isLinkContent(e))return{__TYPE__:"RepeatableContent",type:"Link",value:[e]}}function pA(e){if(K.isLinkContent(e))return e;if(K.isRepeatableContent(e)){const[t]=e.value;if(K.isLinkContent(t))return t}}function Br(e,t){let n=Fr(e,t);return n=Ir(e,n),n=jr(e,n),K.fillDocumentWithDefaultValues(e,n)}function Ir(e,t){return w.flattenSections(e).reduce((o,[i,s])=>!t[i]&&s.type==="Group"?{...o,[i]:mA}:o,t)}function jr(e,t){return K.traverseDocument({document:t,customType:e})({transformWidget({model:n,content:o}){return n?o:void 0},transformSlice(n){return n.model?n.content:void 0}})}function Fr(e,t){return K.traverseDocument({document:t,customType:e})({transformWidget({model:n,content:o}){if((n==null?void 0:n.type)==="Link"){const{repeat:i}=n.config??{};switch(o.__TYPE__){case"LinkContent":return i?hA(o)??o:o;case"RepeatableContent":return i?o:pA(o)??o;default:return o}}return o}})}const mA={__TYPE__:"GroupContentType",value:[{__TYPE__:"GroupItemContent",value:[]}]},fA={unclassified:{title:"Draft",color:"amber"},published:{title:"Live",color:"green"},release:{title:"Planned",color:"purple"},archived:{title:"Archived",color:"grey"}},Vt={unclassified:["unclassified","published"],archived:["unclassified","published"],release:["release","published"],published:["published","unclassified"]};function dn(e){const{documentId:t,versionId:n,baseUrl:o,status:i,releaseId:s}=e,a={s:i,v:n,r:s},l=te.createRouteParams({params:a}),d=new URLSearchParams(l).toString();return new URL(`pages/${t}?${d}`,o)}function Sr(e){const{children:t,...n}=e;return A.jsx(oe.QueryErrorResetBoundary,{children:({reset:o})=>A.jsx(r.ErrorBoundary,{...n,onReset:o,children:t})})}const CA=f.createContext(void 0),br={selectedIds:new Set,excludedIds:new Set,isAllSelected:!1};function xA(e){const{children:t,initialState:n,initialTotalItemCount:o,isSelectAllEnabled:i=!1}=e,s=f.useRef(),a=f.useRef(o||0);function l(){if(n&&n.selectedIds){const F=[...n.selectedIds].pop();F&&(s.current=F)}return{...br,...n}}const[d,c]=f.useState(l),u=f.useMemo(()=>{const{selectedIds:F,excludedIds:T,isAllSelected:k}=d;return k?a.current-T.size:F.size},[d]),h=f.useCallback(F=>{const{isAllSelected:T,selectedIds:k,excludedIds:M}=d;return T?!M.has(F):k.has(F)},[d]),g=f.useCallback(()=>{const{isAllSelected:F,selectedIds:T,excludedIds:k}=d;return{selectedIds:[...T],excludedIds:[...k],isAllSelected:F,selectedCount:u}},[d,u]),m=E.useStableCallback(()=>{i&&c({isAllSelected:!0,selectedIds:new Set,excludedIds:new Set})}),C=E.useStableCallback(()=>{c({isAllSelected:!1,selectedIds:new Set,excludedIds:new Set})});f.useEffect(()=>{const{isAllSelected:F,selectedIds:T,excludedIds:k}=d,M=a.current;if(!(M===0||!i)){if(F&&k.size===M){C();return}if(!F&&T.size===M){m();return}}},[d,i,m,C]);const y=E.useStableCallback(F=>{const{id:T,isSingleSelection:k,metaKey:M,shiftKey:_,ids:ge}=F;return _&&ge&&ge.length>0&&s.current?I(T,ge,s.current):k&&!M?x(T):h(T)?S([T]):j([T]),s.current=T,h(T)});function x(F){h(F)&&u===1?c(T=>({...T,selectedIds:new Set})):c({isAllSelected:!1,selectedIds:new Set([F]),excludedIds:new Set})}function I(F,T,k){const M=Kr(T,k,F),_=h(F);return _?S(M):j(M),_}const B=E.useStableCallback(()=>{u>0?C():m()});function j(F){const{isAllSelected:T}=d;if(T){c(k=>({...k,excludedIds:Rn(k.excludedIds,F)}));return}c(k=>({...k,selectedIds:Qn(k.selectedIds,F)}))}function S(F){const{isAllSelected:T}=d;if(T){c(k=>({...k,excludedIds:Qn(k.excludedIds,F)}));return}c(k=>({...k,selectedIds:Rn(k.selectedIds,F)}))}function b(F){a.current=F}const v=f.useMemo(()=>({selectedCount:u,state:d,totalItemCount:a.current,isSelected:h,isSelectAllEnabled:i,getSelectionState:g,toggleSelection:y,toggleSelectAll:B,clearSelection:C,setTotalItemCount:b}),[d,C,g,i,h,u,B,y]);return A.jsx(CA.Provider,{value:v,children:t})}function je(e){const t=f.useContext(CA);if(t===void 0)throw new Error("useSelectionManagerContext must be used within a SelectionManagerProvider");const{totalItemCount:n,onChangeSelection:o}=e||{},{setTotalItemCount:i,totalItemCount:s,state:a,getSelectionState:l,...d}=t;n!==void 0&&n!==s&&i(n);const c=E.useStableCallback(o);return f.useEffect(()=>{c==null||c(l())},[l,c,a]),{...d,getSelectionState:l,isAllSelected:a.isAllSelected}}function Kr(e,t,n){const o=e.indexOf(t),i=e.indexOf(n);if(i===-1)throw new Error("targetId must be in the array");return o===-1?[n]:o<=i?e.slice(o,i+1):e.slice(i,o+1)}function Rn(e,t){const n=new Set(e);return t.forEach(o=>n.delete(o)),n}function Qn(e,t){return new Set([...e,...t])}const jt=f.createContext(void 0);function L(){const e=f.useContext(jt);if(!e)throw new Error("Missing EditorConfigContext.Provider");return e}class Yt extends Error{}function V(e){throw new Yt(`Missing EditorConfig.${e}`)}function Ur(){if(new URL(location.href).searchParams.has("debug"))return;const n=console.error.bind(console);console.error=(...o)=>{o[0]instanceof Yt||Tr(o)||n(...o)},window.addEventListener("error",o=>{o.error instanceof Yt&&o.preventDefault(),wr(o.error)&&o.preventDefault()})}function Tr(e){const t="Warning: flushSync was called from inside a lifecycle method",n=typeof e[0]=="string"&&e[0].includes(t),o=typeof e[1]=="string"&&e[1].includes("RichTextField");return n&&o}function wr(e){const t=/Invalid content for node document: <(bulletList|orderedList)\(listItem*/,n=e.message;return!!(typeof n=="string"&&n.match(t))}const le="meta_title",ue="meta_description",Lr=p.z.object({[le]:p.z.string(),[ue]:p.z.string()});async function yA(e){var s,a,l,d;const{pageTextContent:t,contentLocale:n,config:o}=e,i=new Dn.BedrockRuntimeClient({region:o.region,credentials:{accessKeyId:o.accessKeyId,secretAccessKey:o.secretAccessKey}});try{const c=new Dn.ConverseCommand({modelId:"anthropic.claude-3-5-sonnet-20240620-v1:0",system:[{text:vr(n)}],messages:[{role:"user",content:[{text:`Input:
3
- ${t}`}]}]}),u=await i.send(c);return Lr.parse(JSON.parse(((d=(l=(a=(s=u.output)==null?void 0:s.message)==null?void 0:a.content)==null?void 0:l[0])==null?void 0:d.text)||""))}catch(c){throw console.error("Failed to generate SEO metadata",c),c}}const He={min:50,max:60},_e={min:120,max:165};function vr(e="en-us"){return`
4
- You are an expert SEO specialist specializing in mobile-first optimization. Your task is to analyze the provided website content and generate a meta title and meta description optimized for mobile SEO. Follow these steps precisely:
5
-
6
- 1. Language Context:
7
- The language of the content is provided as ${e}. If ${e} is invalid, missing, or cannot be used, identify the language of the content directly and write the meta information in that language. Do not explicitly mention the language in the output.
8
-
9
- 2. Content Analysis:
10
- Examine the input text to identify the main topic, primary keywords, and core intent of the content. Focus on the most SEO-relevant sections, typically in headings, titles, and introductory paragraphs.
11
- - If the content is comparing two or more entities (e.g., "Prismic vs Contentful" or "Product A vs Product B"), ensure the meta title and description reflect both the comparison aspect and the conclusion (if any).
12
- - The meta title and description should highlight the core subject of the comparison (e.g., comparing CMS tools) while also acknowledging any key takeaways or recommendations (e.g., the superiority of one tool over the other).
13
- -For comparison content, do not focus solely on one of the entities or the conclusion—balance both the topic of the comparison and the outcome to provide clarity on what the page is addressing.
14
-
15
- 3.Meta Title Creation:
16
- - Write a concise, compelling meta title, it must be near ${He.min} characters. (never exceed this limit)
17
- - Place the most important keyword(s) at the beginning.
18
- - Ensure it is accurate, engaging, and click-worthy.
19
-
20
- 4. Meta Description Creation:
21
- - Write a clear, informative meta description, it must be near ${_e.min} characters. (never exceed this limit)
22
- - Prioritize key information in the first sentence.
23
- - Include primary keywords naturally, summarize the content, and use action-oriented language.
24
-
25
- 5. Best Practices:
26
- - Avoid keyword stuffing and write in a natural, user-friendly tone.
27
- - Adapt the meta information to align with language-specific nuances and SEO conventions.
28
- - Ensure both the meta title and description are unique, relevant, and aligned with the page’s content.
29
- - Do not reference or use any existing meta titles or descriptions already in the content. Be creative and generate unique meta information.
30
-
31
- 6. Output Requirements:
32
- - Return the results in JSON format with only two keys: "${le}" and "${ue}".
33
- - Do not include any additional text or explanations.
34
- `}function BA(e,t){const n=[];return K.traverseDocument({document:e,customType:t})({transformWidget:({content:i,model:s,apiId:a})=>{var l;if(!(a===le||a===ue)&&(K.isRichTextContent(i)&&(s==null?void 0:s.type)==="StructuredText"||K.isTextContent(i)&&(s==null?void 0:s.type)==="Text"||K.isUIDContent(i)&&(s==null?void 0:s.type)==="UID")){const d=gt(i);d&&n.push({label:((l=s.config)==null?void 0:l.label)||"",value:d})}}}),n.map(i=>JSON.stringify(i)).join(`
35
- `)}function gt(e){if(K.isWidgetContent(e)){if(e.__TYPE__==="UIDContent")return e.value;if(e.__TYPE__==="StructuredTextContent"){const[t]=e.value;return!t||t.type==="image"||t.type==="embed"?void 0:t.content.text}if(e.__TYPE__==="FieldContent"&&e.type==="Text")return e.value}}function IA(e){return e.length>=300}const kr=p.z.object({id:p.z.string(),label:p.z.string(),repeatable:p.z.boolean(),status:p.z.boolean()});function Er(e,t,n){return U.request(new URL("customtypes",e),{headers:{repository:t},credentials:U.getRequestCredentials(n),okType:p.z.array(kr)})}function $e(e){const{baseUrl:t,repository:n,authStrategy:o}=e;return oe.queryOptions({queryKey:["customTypes"],queryFn:()=>Er(t,n,o)})}function Dr(e,t){e.prefetchQuery($e(t))}function Rr(e,t){return e.fetchQuery($e(t))}function un(e){return oe.useSuspenseQuery($e(e))}function Qr(e){const{id:t,baseUrl:n,repository:o,authStrategy:i}=e,a=un({baseUrl:n,repository:o,authStrategy:i}).data.find(l=>l.id===t);if(!a)throw new Error(`Custom type "${t}" does not exist`);return a}function Mr(e,t){return e.invalidateQueries($e(t))}function qr(e){const{id:t,baseUrl:n,repository:o,authStrategy:i}=e,s=new URL(`customtypes/${t}`,n);return s.searchParams.set("static","true"),U.request(s,{headers:{repository:o},credentials:U.getRequestCredentials(i),okType:Pr})}const Pr=p.z.unknown().transform((e,t)=>{const n=w.StaticCustomType.decode(e);return n._tag==="Right"?n.right:(t.addIssue({code:p.z.ZodIssueCode.custom,message:"Invalid custom type."}),p.z.NEVER)});function jA(e){const{id:t}=e;return oe.queryOptions({queryKey:["customTypes","static",t],queryFn:()=>qr(e)})}function Or(e){return oe.useSuspenseQuery(jA(e))}function Vr(e,t){e.prefetchQuery(jA(t))}const Yr=p.z.object({id:p.z.string().optional(),first_name:p.z.string().optional(),last_name:p.z.string().optional(),email:p.z.string().optional(),uploadedAvatar:p.z.string().optional()}),gn=p.z.object({id:p.z.string(),name:p.z.string(),is_master:p.z.boolean().optional()}).transform(e=>({id:e.id,label:e.name,...e.is_master!==void 0?{isMaster:e.is_master}:{}})),FA=p.z.discriminatedUnion("status",[p.z.object({status:p.z.literal("unclassified")}),p.z.object({status:p.z.literal("published")}),p.z.object({status:p.z.literal("release"),release_id:p.z.string()}),p.z.object({status:p.z.literal("archived")})]),SA=p.z.object({version_id:p.z.string(),tags:p.z.array(p.z.string()),preview_image:p.z.string().optional(),last_modified_date:p.z.coerce.date(),uid:p.z.string().optional()}),bA=FA.and(SA.extend({custom_type_label:p.z.string(),preview_summary:p.z.string().optional(),author:Yr})),KA=FA.and(SA.extend({custom_type_id:p.z.string().optional(),summary:p.z.string().optional(),author_ids:p.z.array(p.z.string()).optional(),highlights:p.z.object({uid:p.z.string().optional()}).optional()}));function UA(e){return bA.safeParse(e).success}function Wt(e){return KA.safeParse(e).success}const TA=p.z.string().nullish().transform(e=>e??"Untitled"),hn=p.z.object({id:p.z.string(),title:TA,custom_type_id:p.z.string(),group_lang_id:p.z.string(),language:gn,versions:p.z.array(bA)}),Wr=p.z.object({total:p.z.number(),cursor:p.z.string().optional(),results:p.z.array(hn)}),Hr=p.z.object({id:p.z.string(),title:TA,custom_type_id:p.z.string(),group_lang_id:p.z.string(),interesting_versions:p.z.array(KA),locale_id:p.z.string().optional()}).transform(e=>{const{interesting_versions:t,...n}=e;return{versions:t,...n}}),_r=p.z.object({results:p.z.array(Hr)});function pn(e){const{baseUrl:t,authStrategy:n,limit:o,cursor:i,statuses:s,authors:a,language:l,groupLangIds:d,documentIds:c,customTypes:u,tags:h,term:g,uids:m,signal:C}=e,y=new URL("documents/search",t),x=Ge.filterValues({statuses:s,authors:a,language:l,groupLangIds:d,customTypes:u,tags:h,term:g,documentIds:c,limit:o,cursor:i,uids:m},I=>!(I===""||Array.isArray(I)&&I.length===0));return U.request(y,{credentials:U.getRequestCredentials(n),okType:Wr,signal:C,method:"POST",body:x})}function wA(e,t,n,o){const i=new URL(e);return i.search=n,U.request(i,{credentials:U.getRequestCredentials(t),okType:_r,...o})}function LA(e){const{repository:t,searchTerm:n,tags:o,authors:i,status:s,localeId:a,customTypesIds:l}=e,d=new URLSearchParams;return d.append("repository",t),n&&d.append("searchTerm",n),o!=null&&o.length&&d.append("tags",o.toString()),i!=null&&i.length&&d.append("authors",i.toString()),s!=null&&s.length&&d.append("status",s.toString()),a&&d.append("localeId",a),l!=null&&l.length&&d.append("customTypesIds",l.toString()),d.toString()}function vA(e){return e.reduce((t,n)=>{if(n.values.every(i=>i===""||i===void 0))return t;const o=n.values.map(i=>[n.name,i??""]);return t.concat(o)},[])}function et(e,t,n){return U.request(new URL(`documents/${n}`,e),{credentials:U.getRequestCredentials(t),okType:hn})}const zr=p.z.custom().transform((e,t)=>{const n=K.Document.decode(e);return n._tag==="Left"?(t.addIssue({code:p.z.ZodIssueCode.custom,message:"Invalid document."}),p.z.NEVER):n.right}),Nr=p.z.unknown().transform((e,t)=>{const n=K.SliceItemContent.decode(e);return n._tag==="Right"?n.right:(t.addIssue({code:p.z.ZodIssueCode.custom,message:"Invalid slice content."}),p.z.NEVER)}),de={all:()=>["documents"],lists:()=>[...de.all(),"list"],list:e=>[...de.lists(),e],infiniteLists:()=>[...de.all(),"list:infinite"],infiniteList:e=>[...de.infiniteLists(),e]};function Gr(e,t){e.setQueriesData({queryKey:de.lists()},n=>n&&Mn(n,t)),e.setQueriesData({queryKey:de.infiniteLists()},n=>n&&{...n,pages:n.pages.map(o=>Mn(o,t))})}function Mn(e,t){const n=e.results.flatMap(o=>{const i=t(o,e);return i?[i]:[]});return{...e,results:n,total:e.total+(n.length-e.results.length)}}async function Zr(e){await e.invalidateQueries({queryKey:de.lists()}),await e.invalidateQueries({queryKey:de.infiniteLists()})}function mn(e){return oe.useSuspenseQuery(kA(e))}function kA(e){return oe.queryOptions({queryKey:de.list(e),queryFn:({queryKey:[,,t]})=>pn(t)})}async function EA(e){const{coreApiBaseUrl:t,documentSearchBaseUrl:n,authStrategy:o,repository:i,searchTerm:s="",customTypes:a,tags:l,authors:d,status:c,locale:u,signal:h,storageVersion:g}=e;if(g&&g.major<=6){const I=c!=null&&c.length?c:["published","unclassified","release"];return{results:(await pn({baseUrl:t,authStrategy:o,tags:l,customTypes:a,language:u,term:s,authors:d,statuses:I,limit:200})).results}}const m=LA({repository:i,searchTerm:s,tags:l,authors:d,status:c,localeId:u,customTypesIds:a});return{results:(await wA(n,o,m,{signal:h})).results}}function DA(e){const{searchTerm:t,customTypes:n,tags:o,authors:i,status:s,locale:a,config:l,storageVersion:d}=e;l.searchDocuments||V("searchDocuments");const{coreApiBaseUrl:c,documentSearchBaseUrl:u,authStrategy:h,repository:g}=l;return oe.queryOptions({queryKey:["searchDocuments",{coreApiBaseUrl:c,documentSearchBaseUrl:u,authStrategy:h,repository:g,searchTerm:t,customTypes:n,tags:o,authors:i,status:s,locale:a,storageVersion:d}],queryFn:({queryKey:[,m],signal:C})=>EA({...m,signal:C})})}const Jr=p.z.object({id:p.z.string(),firstname:p.z.string().optional(),lastname:p.z.string().optional(),email:p.z.string(),uploadedAvatar:p.z.string().optional()}),RA=p.z.array(Jr),Xr=p.z.object({slicemachineEnabled:p.z.boolean()}),QA=["next","nuxt","sveltekit"];function $r(e){return QA.includes(e)}const Ft=p.z.preprocess(e=>typeof e=="string"&&$r(e)?e:"other",p.z.enum([...QA,"other"])),es=p.z.object({simulator_url:p.z.string().url().nullish(),languages:p.z.array(gn).transform(e=>O.sort(e,t=>t.label)),authors:RA.optional().default([]),quotas:Xr.optional().default({slicemachineEnabled:!1}),framework:Ft.optional().default("other"),starterId:p.z.string().optional(),storageVersion:p.z.object({major:p.z.number().int(),minor:p.z.number().int()}),uploadedAvatar:p.z.string().url().optional()}).transform(({simulator_url:e,framework:t,...n})=>{const o=e&&MA(e)?e:void 0;return{...n,framework:t,simulatorUrl:o,isSupportedFramework:t!=="other"}});function St(e,t){return U.request(new URL("repository",e),{credentials:U.getRequestCredentials(t),okType:es})}function MA(e){const t=te.toURL(e);return t?t.pathname.endsWith("/slice-simulator"):!1}const ts=p.z.object({results:p.z.array(p.z.string())});function qA(e,t){return U.request(new URL("repository/tags",e),{credentials:U.getRequestCredentials(t),okType:ts})}const ns=p.z.object({maxNbEnvironments:p.z.number(),integrationFieldsEnabled:p.z.boolean(),personalEnvironmentsEnabled:p.z.boolean(),sliceMachineEnabled:p.z.boolean()}),PA=p.z.object({_id:p.z.string(),name:p.z.string(),onboarding:p.z.object({completedSteps:p.z.array(p.z.string()),isDismissed:p.z.boolean()}),framework:Ft.optional().default("other"),quotas:ns.optional().default({maxNbEnvironments:0,integrationFieldsEnabled:!1,personalEnvironmentsEnabled:!1,sliceMachineEnabled:!1}),storageVersion:p.z.object({major:p.z.number().int(),minor:p.z.number().int()}),authors:RA.optional().default([])});function As(e,t,n){const o=new URL("",e);return o.searchParams.append("repository",t),U.request(o,{headers:{repository:t},credentials:U.getRequestCredentials(n),okType:PA})}const os=p.z.enum(["createPrismicProject","chooseLocale","createProject","setupSliceMachine","createPageType","codePage","createSlice","reviewAndPush","createContent","renderPage"]),OA=p.z.object({completedSteps:p.z.array(p.z.string()),isDismissed:p.z.boolean(),context:p.z.object({framework:Ft,starterId:p.z.string().nullable().optional()})}),VA=p.z.object({completedSteps:p.z.array(p.z.string())}),YA=p.z.object({isDismissed:p.z.boolean()});function is(e,t,n){const o=new URL("onboarding",e);return o.searchParams.append("repository",t),U.request(o,{headers:{repository:t},credentials:U.getRequestCredentials(n),okType:OA})}function rs(e,t,n,o){const i=new URL(`onboarding/${e}/toggle`,t);return i.searchParams.append("repository",n),U.request(i,{method:"PATCH",headers:{repository:n},credentials:U.getRequestCredentials(o),okType:VA})}function ss(e,t,n){const o=new URL("onboarding/toggle",e);return o.searchParams.append("repository",t),U.request(o,{method:"PATCH",headers:{repository:t},credentials:U.getRequestCredentials(n),okType:YA})}const WA=p.z.string(),HA=p.z.enum(["Manager","Writer","Readonly"]),bt=p.z.record(WA,HA),fn=p.z.record(p.z.string(),bt),Kt=p.z.object({id:p.z.string(),name:p.z.string(),customTypes:p.z.array(p.z.string()),rolesPerLocale:bt.optional(),rolesPerLocaleByUser:fn.optional()});p.z.object({name:p.z.string(),customTypes:p.z.array(p.z.string()),rolesPerLocale:bt.optional(),rolesPerLocaleByUser:fn.optional()});const as=p.z.object({results:p.z.array(Kt)});function _A(e){const{baseUrl:t,repository:n,authStrategy:o}=e,i=new URL("team-spaces",t);return i.searchParams.append("repository",n),U.request(i,{method:"GET",credentials:U.getRequestCredentials(o),okType:as})}function ls(e){return oe.queryOptions({queryKey:["teamSpaces",e],queryFn:()=>_A(e),select:t=>t.results})}function cs(){const e=oe.useQueryClient();return()=>e.invalidateQueries({queryKey:["teamSpaces"]})}function ds(e){const{baseUrl:t,repository:n,authStrategy:o,payload:i}=e,s=new URL("team-spaces",t);return s.searchParams.append("repository",n),U.request(s,{method:"POST",body:i,credentials:U.getRequestCredentials(o),okType:Kt})}function us(e){const{baseUrl:t,repository:n,authStrategy:o,payload:i,teamSpaceId:s}=e,a=new URL(`team-spaces/${s}`,t);return a.searchParams.append("repository",n),U.request(a,{method:"PUT",body:i,credentials:U.getRequestCredentials(o),okType:Kt})}function gs(e){const{baseUrl:t,repository:n,authStrategy:o,teamSpaceId:i}=e,s=new URL(`team-spaces/${i}`,t);return s.searchParams.append("repository",n),U.request(s,{method:"DELETE",credentials:U.getRequestCredentials(o),okType:p.z.unknown()})}const zA=p.z.enum(["Owner","Administrator","Writer","Manager","Readonly"]),hs=p.z.record(zA.optional()),ps=zA.or(hs),ms={SuperUser:"SuperUser",Owner:"Owner",Administrator:"Administrator",Manager:"Publisher",Writer:"Writer",Readonly:"Contributor"},NA=p.z.object({shortId:p.z.string(),intercomHash:p.z.string(),email:p.z.string(),firstName:p.z.string(),lastName:p.z.string(),superPower:p.z.boolean(),repositories:p.z.array(p.z.object({domain:p.z.string(),name:p.z.string().optional(),role:ps}))});async function GA(e,t){const n=new URL("profile",e);return await U.request(n,{credentials:U.getRequestCredentials(t),okType:NA})}function Cn(){const e=L();e.userServiceBaseUrl||V("userServiceBaseUrl");const{authStrategy:t,userServiceBaseUrl:n}=e;return R.useRequest(GA,[n,t])}const fs="https://prismic.io/docs/guides/manage-images#supported-media";function tt(){const e=L();e.mediaLibrary||V("mediaLibrary");const{assetsApiBaseUrl:t,authStrategy:n,repository:o}=e,{items:i}=R.useRequest(ZA,[t,o,n]);return{tags:i}}function ZA(e,t,n){return U.request(new URL("tags",e),{credentials:U.getRequestCredentials(n),okType:Cs,headers:{repository:t}})}const JA=1,XA=20,xn=p.z.string().min(JA).max(XA),yn=p.z.object({id:p.z.string(),name:xn,uploader_id:p.z.string().optional(),created_at:p.z.number(),last_modified:p.z.number(),count:p.z.number().optional().default(0)}),Cs=p.z.object({items:p.z.array(yn)});function nt(e){R.updateFetcherData(ZA,t=>{const{items:n}=t,o=e(n);if(o)return{items:o}})}function xs(e){const{assetType:t,keyword:n,mode:o,tagIds:i}=e,s=L();s.mediaLibrary||V("mediaLibrary");const{onAnalyticsEvent:a}=s,l=R.useFetcherData(ie),d=l[l.length-1],c=f.useRef(d);c.current=d,f.useEffect(()=>{if(!a||!n||!c.current||c.current.keyword!==n)return;const u=String(n.split(" ").length),h=String(c.current.total),g=i.join(",");a("Media Library Search",{searchQuery:n,numberOfWords:u,numberOfResults:h,timeToGetResults:c.current.time,assetType:t,mode:o,tags:g})},[n,t,o,a,i])}function ys(e){const{assetType:t,mediaDialogOpen:n}=e,o=L(),i=R.useFetcherData(ie),s=f.useRef(0);f.useEffect(()=>{n&&(s.current=performance.now())},[n]);function a(l){if(!o.onAnalyticsEvent||!o.mediaLibrary)return;const d=i[i.length-1];if(!d)return;const{keyword:c,uploaderId:u,tags:h}=d,g=to(i,c,t,u,h),m=String(c.split(" ").length),C=String(d.total),y=g.findIndex(j=>j.id===l),x=String(y+1),I=[l].join(","),B=(performance.now()-s.current).toFixed(0);o.onAnalyticsEvent("Media Added To Page",{assetType:t,searchQuery:c,numberOfWords:m,numberOfResults:C,searchPosition:x,mediaIds:I,timeToAddMediaToPage:B,tags:h})}return a}const rt=p.z.array(p.z.string()).optional().transform(e=>e==null?void 0:e[0]),Ut=p.z.object({id:p.z.string(),kind:p.z.string(),extension:p.z.string().optional(),filename:p.z.string(),width:p.z.number().optional(),height:p.z.number().optional(),last_modified:p.z.number(),url:p.z.string(),alt:p.z.string().optional(),uploader_id:p.z.string().optional(),size:p.z.number(),notes:p.z.string().optional(),credits:p.z.string().optional(),search_highlight:p.z.object({filename:rt,alt:rt,notes:rt,credits:rt}).optional(),tags:p.z.array(yn)}),$A={"X-Prismic-Source":"Wroom"},Bs=p.z.object({total:p.z.number(),cursor:p.z.string().optional(),items:p.z.array(Ut)}),eo=30;function ie(e,t,n,o,i,s,a,l,d){const c=e?new URL("assets",e):void 0,u=new URLSearchParams(vA([{name:"limit",values:[`${eo}`]},{name:"cursor",values:[d]},{name:"keyword",values:[o]},{name:"assetType",values:[i]},{name:"uploaderId",values:[s]},{name:"tags",values:a.split(",")}])).toString(),h=Bs.transform(m=>({...m,keyword:o,assetType:i,uploaderId:s,tags:a,page:l})),g=performance.now();return U.request(`${(c==null?void 0:c.href)??""}?${u}`,{headers:{repository:t,...$A},credentials:U.getRequestCredentials(n),okType:h}).then(m=>({...m,time:(performance.now()-g).toFixed(0)}))}R.cache.registerFetcherConfig(ie,{revalidationStrategy:{type:"never"}});const G={keyword:"",assetType:"all",uploaderId:void 0,tagIds:[]};function Is(e){const{initialAssetType:t=G.assetType,mode:n}=e,o=L(),[i,s]=f.useState({...G,assetType:t,page:0});o.mediaLibrary||V("mediaLibrary");const{assetsApiBaseUrl:a,authStrategy:l,repository:d}=o,{page:c,cursor:u,keyword:h,assetType:g,uploaderId:m,tagIds:C}=i,y=R.useRequest(ie,Xe({assetsApiBaseUrl:a,authStrategy:l,repository:d,keyword:h,assetType:g,uploaderId:m,tagIds:C,page:c,cursor:u}));xs({assetType:g,keyword:h,tagIds:C,mode:n});const x=bs(h,g,m,C),I=y.total!==x.length;function B(){y.cursor!==void 0&&s(v=>({...v,page:v.page+1,cursor:y.cursor}))}function j(v){s(F=>({...F,page:0,cursor:void 0})),Le((F,T)=>{if(T.page===0)return[...v,...F]})}function S(v){s(F=>({...F,...v,page:0,cursor:void 0}))}function b(){s(v=>({...v,...G,assetType:t==="all"?G.assetType:v.assetType,page:0,cursor:void 0}))}return{keyword:h,assetType:g,uploaderId:m,tagIds:C,setFilters:S,resetFilters:b,media:x,mediaTotal:y.total,limit:eo,hasNextPage:I,fetchNextPage:B,updateMedia:js,unshiftMedia:j,deleteMedia:Fs,deleteSearchData:Ss,revalidateFirstPage:no}}function js(e){Le(t=>t.flatMap(n=>{const o=e.find(i=>i.id===n.id);return o?o.response===void 0?[]:{...n,...o.response}:n}))}function Fs(e){Le(t=>t.filter(n=>!e.includes(n.id)))}function Ss(e){const{keyword:t,assetType:n,uploaderId:o,tagIds:i}=e,s=i==null?void 0:i.join(",");R.updateFetcherData(ie,a=>{if(!(a.keyword===t&&a.assetType===n&&a.uploaderId===o&&a.tags===s))return a})}function to(e,t,n,o,i){const s=e.filter(d=>d.keyword===t&&d.assetType===n&&d.uploaderId===o&&d.tags===i),l=O.sort(s,d=>d.page).flatMap(d=>d.items);return t?O.uniqBy(l,d=>d.id):l}function bs(e,t,n,o){const i=R.useFetcherData(ie);return to(i,e,t,n,o.join(","))}function Le(e){R.updateFetcherData(ie,t=>{const{items:n,total:o}=t,i=e(n,t);if(i)return{...t,total:o+(i.length-n.length),items:i}})}function no(e){const{config:t,keyword:n=G.keyword,assetType:o=G.assetType,tagIds:i=G.tagIds}=e;if(!t.mediaLibrary)throw new Error("media library is not configured");const{assetsApiBaseUrl:s,authStrategy:a,repository:l}=t;R.revalidateData(ie,Xe({assetsApiBaseUrl:s,repository:l,authStrategy:a,keyword:n,assetType:o,tagIds:i,page:0}))}function Ao(e){const{config:t,keyword:n=G.keyword,assetType:o=G.assetType,tagIds:i=G.tagIds}=e;if(!t.mediaLibrary)throw new Error("media library is not configured");R.updateFetcherData(ie,s=>s.page===0?s:void 0),no({config:t,keyword:n,assetType:o,tagIds:i})}function Xe(e){return[e.assetsApiBaseUrl,e.repository,e.authStrategy,e.keyword,e.assetType,e.uploaderId,e.tagIds.join(","),e.page,e.cursor]}function oo(){const e=L();e.mediaLibrary||V("mediaLibrary");const{assetsApiBaseUrl:t,coreApiBaseUrl:n,authStrategy:o,repository:i}=e,{authors:s}=R.useRequest(St,[n,o]),{items:a}=R.useRequest(io,[t,i,o]),{shortId:l}=Cn(),d=new Map(s.map(h=>[h.id,h])),c=[];for(const h of a){if(h.id==="ghost"){c.push({id:h.id,name:"Ghost",uploadedAvatar:"https://images.prismic.io/page-builder-assets/ZuAXWBoQrfVKl5sD_ghost_user.png?auto=format,compress&w=64"});continue}const g=d.get(h.id);if(!g)continue;let m;if(g.uploadedAvatar){const C=new URL(g.uploadedAvatar);C.searchParams.set("w","64"),m=C.toString()}c.push({id:h.id,name:[g.firstname,g.lastname].filter(Boolean).join(" "),firstName:g.firstname,lastName:g.lastname,email:g.email,uploadedAvatar:m})}const u=new Map(c.map(h=>[h.id,h]));return{uploaders:O.sort(c,h=>h.id===l?0:1,h=>h.name),uploadersById:u}}function io(e,t,n){return U.request(new URL("uploaders",e),{credentials:U.getRequestCredentials(n),okType:Us,headers:{repository:t}})}const Ks=p.z.object({id:p.z.string()}),Us=p.z.object({items:p.z.array(Ks)});function ro(){const e=L();e.mediaLibrary||V("mediaLibrary");const{assetsApiBaseUrl:t,authStrategy:n,repository:o}=e;return()=>{R.revalidateData(io,[t,o,n])}}function Ts(e){const{revalidate:t,config:n,keyword:o,assetType:i,uploaderId:s,tagIds:a}=e,{assetsApiBaseUrl:l=void 0,repository:d="",authStrategy:c="token"}=n.mediaLibrary?n:{},[u,h]=f.useState(!1),[g,m]=f.useState(!1),C={assetsApiBaseUrl:l,repository:d,authStrategy:c,keyword:o,assetType:i,uploaderId:s,tagIds:a,page:0},{revalidateData:y}=R.useCacheRevalidation({fetcher:ie,requestParams:Xe(C),validator:(B,j)=>{var v,F;const S=((v=B.items[0])==null?void 0:v.id)??"",b=((F=j.items[0])==null?void 0:F.id)??"";return S!==b||B.total!==(j==null?void 0:j.total)},onCacheInvalidated:()=>m(!0),every:6e4}),x=B=>{y(Xe({...C,...B}))};f.useEffect(()=>{u&&(m(!1),h(!1))},[u]);function I(){h(!0),t()}return{isMediaRevalidationInProgress:u,isMediaCacheInvalid:g,revalidateMedia:I,revalidateWithParams:x}}function ws(e){const{onBeforeUpload:t,onComplete:n}=e,[o,i]=f.useState([]),s=o.some(u=>u.status==="idle"||u.status==="uploading"),a=L();function l(){if(!o.length||o.some(m=>m.status==="uploading")||o.every(m=>m.status==="error"))return;const u=o.find(m=>m.status==="idle");if(!u)return;let h=o;function g(m){h=m(h),i(h),h.every(y=>y.status==="success"||y.status==="error")&&setTimeout(()=>{i([]),n==null||n(h)},1500)}g(m=>m.map(C=>C.id===u.id?{...C,status:"uploading"}:C)),so({file:u.file,config:a}).then(m=>{g(C=>C.map(y=>y.id===u.id?{...y,status:"success",response:m}:y))}).catch(()=>{g(m=>m.map(C=>C.id===u.id?{...C,status:"error"}:C))})}function d(u){const h=u.map(g=>({id:`temp-${crypto.randomUUID()}`,file:g,status:"idle"}));i(h),t(h)}const c=f.useCallback(u=>{const h=[{...u,status:"idle"},...o.filter(g=>g.id!==u.id)];i(h),t(h)},[t,o]);return f.useEffect(l,[a,o,n]),{isUploading:s,uploadingFiles:o,onFilesSelected:d,onRetry:c}}async function so(e){const{file:t,config:n}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:o,repository:i,authStrategy:s}=n,a=new FormData;return a.append(t.name,t),U.request(new URL("assets",o),{headers:{repository:i,"Content-Type":"multipart/form-data",...$A},method:"POST",body:a,credentials:U.getRequestCredentials(s),okType:Ut})}const ao=f.createContext(void 0);function Ls(e){const{children:t,assetType:n=G.assetType,onSelectedChange:o,actionContainer:i}=e,s=o?"select":"browse",[a,l]=f.useTransition(),[d,c]=f.useTransition(),u=L(),{showAlert:h}=r.useAlert(),g=Cn(),m=ro(),{keyword:C,assetType:y,uploaderId:x,tagIds:I,setFilters:B,resetFilters:j,media:S,fetchNextPage:b,hasNextPage:v,updateMedia:F,unshiftMedia:T,deleteMedia:k,mediaTotal:M,deleteSearchData:_,revalidateFirstPage:ge}=Is({initialAssetType:n,mode:s}),[he,Qe]=f.useState();function Me(){Ao({config:u,keyword:C,assetType:y,uploaderId:x,tagIds:I})}const{isMediaRevalidationInProgress:D,isMediaCacheInvalid:Q,revalidateMedia:z,revalidateWithParams:pe}=Ts({config:u,revalidate:Me,keyword:C,assetType:y,uploaderId:x,tagIds:I});function ot(q){const N=q.keyword===G.keyword,re=q.assetType===n,$=q.uploaderId===G.uploaderId,me=q.tagIds.length===G.tagIds.length&&q.tagIds.every((Ni,Gi)=>Ni===G.tagIds[Gi]);return N&&re&&$&&me}function H(q){const N={keyword:C,assetType:y,tagIds:I,uploaderId:x,...q};ot(N)?pe(q):_(N),c(()=>{B(q),it.clearSelection()})}const{isUploading:qe,onFilesSelected:Oi,uploadingFiles:kn,onRetry:Vi}=ws({onBeforeUpload:q=>{j();const N=q.filter($=>$.status==="idle").map($=>({id:$.id,url:URL.createObjectURL($.file),filename:$.file.name,size:$.file.size,extension:$.file.type,kind:$.file.type,last_modified:$.file.lastModified,tags:[],uploader_id:g.shortId}));T(N);const[re]=N??[];re&&it.toggleSelection({id:re.id,isSingleSelection:!0})},onComplete:q=>{const N=q.flatMap(me=>me.status==="success"?me:(_i(me),{id:me.id,response:void 0}));F(N),ge({config:u,assetType:y,tagIds:I}),m();const re=N[0];!re||!re.response||!it.isSelected(re.id)||it.toggleSelection({id:re.response.id,isSingleSelection:!0})}}),it=je({totalItemCount:M,onChangeSelection:({selectedIds:q,selectedCount:N})=>{if(En(!1),!!o){if(N===1){const[re]=[...q];if(kn.some(me=>me.id===re&&me.status!=="success")){o(new Set);return}}o(new Set(q))}}});function Yi(q){qe||Oi(q)}function Wi(){v&&l(b)}function Hi(q,N){F([{id:q,response:N}])}function _i(q){const N=Ae.overflow(q.file.name,30);h({id:q.id,title:`The specified file "${N}" could not be uploaded.`,subtitle:A.jsxs(r.Text,{color:"inherit",children:["Read more about our"," ",A.jsx(r.Text,{color:"tomato11",href:fs,underline:!0,children:"supported media"}),"."]}),buttons:{action:{text:"Retry upload",icon:"cloudUpload",onClick:()=>Vi(q)}}})}const[zi,En]=f.useState(!1);return A.jsx(ao.Provider,{value:{isFetchingMedia:a,media:S,mediaTotal:M,onScrollToBottom:Wi,actionContainer:i,onFilesUpload:Yi,isUploading:qe,uploadingFiles:kn,isMediaRevalidationInProgress:D,isMediaCacheInvalid:Q,revalidateMedia:z,deleteMedia:k,updateMedia:Hi,keyword:C,isSearchingMedia:d,assetType:y,initialAssetType:n,uploaderId:x,tagManagerOpen:zi,setTagManagerOpen:En,tagIds:I,onFilterChange:H,openMediaSection:he,setOpenMediaSection:Qe},children:t})}function P(){const e=f.useContext(ao);if(!e)throw new Error("useMediaLibrary must be used within a MediaLibraryProvider");return e}function vs(){const e=L(),{initialAssetType:t}=P(),{assetsApiBaseUrl:n=void 0,repository:o="",authStrategy:i="token"}=e.mediaLibrary?e:{},{total:s}=R.useRequest(ie,Xe({assetsApiBaseUrl:n,authStrategy:i,repository:o,assetType:t,keyword:"",tagIds:[],page:0}));return s}function lo(){return vs()===0}function ks(){return lo()?A.jsx(Es,{}):A.jsx(uo,{})}function co(e){const{children:t}=e;return A.jsx(r.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:t})}function uo(){return A.jsx(co,{children:A.jsxs(r.BlankSlate,{children:[A.jsx(r.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),A.jsx(r.BlankSlateTitle,{size:"big",children:"Oops!"}),A.jsx(r.BlankSlateDescription,{width:360,children:"No items found matching your search"})]})})}function Es(){const{onFilesUpload:e}=P();return A.jsx(co,{children:A.jsxs(r.Box,{gap:20,flexDirection:"column",alignItems:"center",children:[A.jsx(r.Box,{maxWidth:375,children:A.jsx(r.BlankSlateTitle,{size:"big",children:"Start by uploading your files!"})}),A.jsx(r.Box,{border:!0,borderStyle:"dashed",borderRadius:4,justifyContent:"center",children:A.jsxs(r.BlankSlate,{sx:{marginBlock:80,marginInline:48},children:[A.jsx(r.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),A.jsx(r.BlankSlateTitle,{children:"Drop your files anywhere to upload or ..."}),A.jsx(r.FileUploadButton,{onFilesSelected:e,renderButton:t=>A.jsx(r.Box,{display:"inline-flex",as:"span",children:A.jsx(r.Button,{onClick:t,color:"grey",children:"Upload media"})})}),A.jsx(r.BlankSlateDescription,{children:"Maximum upload size file: 128 MB"})]})})]})})}const ze={warning:{uploadWhileUploading:{title:"Hang tight!",description:"Your current images are still being uploaded. Once they're all set, you'll be free to upload more."}}};function Ds(){const{actionContainer:e,isUploading:t,onFilesUpload:n,assetType:o}=P();return A.jsx(go,{actionContainer:e,children:A.jsxs(r.Box,{width:"100%",gap:16,children:[A.jsx(Rs,{}),A.jsx(r.Tooltip,{title:ze.warning.uploadWhileUploading.title,content:ze.warning.uploadWhileUploading.description,visible:t,stableMount:!0,children:A.jsx(r.FileUploadButton,{disabled:t,onFilesSelected:n,startIcon:"cloudUpload",color:e?"purple":"grey",size:"large",assetType:o,children:"Upload media"})})]})})}function Rs(){const{keyword:e,onFilterChange:t,isFetchingMedia:n}=P(),[o,i]=f.useState(e);return E.useOnChange(e,()=>{e===""&&i("")}),E.useDebounce(o,300,E.useStableCallback(s=>t({keyword:s}))),A.jsx(r.Box,{width:"100%",flexDirection:"column",children:A.jsx(r.FormSearchInput,{value:o,placeholder:"Search",onValueChange:i,maxLength:200,isLoading:n&&e!==o})})}function go(e){const{children:t,actionContainer:n}=e;return n?A.jsx(r.Portal,{container:n,asChild:!0,children:t}):A.jsx(A.Fragment,{children:t})}function Qs(e){const{children:t}=e,{onFilesUpload:n,assetType:o}=P();return A.jsx(r.FileDropZone,{overlay:A.jsx(Ms,{}),onFilesSelected:n,assetType:o,children:t})}function Ms(){const{isUploading:e}=P(),t=e?ze.warning.uploadWhileUploading.title:"Drop files here",n=e?ze.warning.uploadWhileUploading.description:"Drop your files to upload them instantly to the media library.";return A.jsx(r.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:A.jsxs(r.BlankSlate,{children:[A.jsx(r.BlankSlateIcon,{name:e?"block":"cloudUpload",lineColor:e?"tomato11":"purple10",backgroundColor:e?"tomato2":"purple3",borderColor:e?"tomato6":"purple6",borderStyle:"dashed",size:"xlarge"}),A.jsx(r.BlankSlateTitle,{size:"big",children:t}),A.jsx(r.BlankSlateDescription,{width:360,children:n})]})})}function ho(){return A.jsx(r.DefaultErrorMessage,{title:"Oops! Something went wrong",description:"An error occurred while searching for your image.",errorImageSrc:r.dialogErrorImage,sx:{marginBlock:"auto",marginInline:"auto"}})}function po(e){const{mediaList:t,mediaActions:n,mediaToolbar:o,sidePane:i}=e,s=r.useMediaQuery({min:"medium"}),a=i&&s;return A.jsxs(r.Box,{display:"grid",gridTemplateRows:"auto auto 1fr",gridTemplateColumns:a?"1fr 380px":"1fr",width:"100%",height:"100%",children:[A.jsxs(r.Box,{position:"relative",display:"grid",gap:16,gridColumn:"1",gridRow:"1",padding:{right:16,bottom:16},children:[n,o]}),A.jsx(r.Box,{position:"relative",display:"grid",gridColumn:"1",gridRow:"2 / -1",children:t}),a&&i]})}function qs(){var g;const{onScrollToBottom:e,media:t,isUploading:n,uploadingFiles:o,isSearchingMedia:i,isMediaRevalidationInProgress:s,setOpenMediaSection:a,isFetchingMedia:l}=P(),d=je(),c=f.useRef(null);function u(m){d.toggleSelection({id:m,isSingleSelection:!0}),a("tags")}(n||i||s)&&((g=c.current)==null||g.scrollTo({top:0,behavior:"instant"}));function h(m,C,y){const x=C.shiftKey?t.map(({id:I})=>I):void 0;d.toggleSelection({id:m,isSingleSelection:y==="single",metaKey:C.metaKey,shiftKey:C.shiftKey,ids:x})}return A.jsxs(mo,{onScrollToBottom:e,scrollAreaRef:c,children:[t.map(m=>{var C,y;return A.jsx(r.MediaCard,{"aria-label":"media item",...m,filenameHighlight:(C=m.search_highlight)==null?void 0:C.filename,loading:i,status:(y=o.find(x=>x.id===m.id))==null?void 0:y.status,selected:d.isSelected(m.id),onCardClick:x=>h(m.id,x,"single"),onCheckedChange:(x,I)=>h(m.id,I,"multi"),onAddTagClick:()=>u(m.id)},m.id)}),A.jsx(r.Box,{gridColumn:"1 / -1",justifyContent:"center",children:A.jsx(r.AnimatedElement,{animation:{name:"fade"},children:l&&A.jsx(r.Text,{align:"center",color:"grey11",sx:{marginBlock:8},children:"Loading more items ..."})})})]})}function mo(e){const{children:t,scrollAreaRef:n,onScrollToBottom:o}=e,i=16,s=4,a="250px",l=`calc((100% - ${i*(s-1)}px) / ${s})`;return A.jsx(r.ScrollArea,{"aria-label":"Media list",ref:n,style:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(max(${a}, ${l}), 1fr))`,gridTemplateRows:"1fr 1fr 1fr ",gap:i,padding:2,paddingBottom:16,position:"relative"},onScrollToBottom:o,threshold:500,children:t})}function fo(e){const{children:t,hasSelectedMedia:n}=e;return A.jsx(r.Box,{overflow:"hidden",gridColumn:"2 / -1",gridRow:"1 / -1",children:A.jsx(r.ScrollArea,{style:{display:"grid",height:"100%"},children:A.jsx(r.Box,{flexGrow:1,borderRadius:{topRight:8,topLeft:8},borderStyle:n?"solid":"dashed",border:{top:!0,right:!0,left:!0,bottom:!1},minWidth:0,children:t})})})}function Co(e){const{onFilesUpload:t,isUploading:n,isInitialLoad:o=!1}=e,i=o||n;return A.jsxs(r.Box,{flexDirection:"column",justifyContent:"center",alignItems:"center",padding:16,gap:16,width:"100%",children:[A.jsx(r.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),A.jsx(r.Box,{flexDirection:"column",gap:4,children:A.jsxs(r.Text,{align:"center",children:["Select or"," ",A.jsx(r.FileUploadButton,{disabled:i,onFilesSelected:t,renderButton:s=>A.jsx(r.Tooltip,{title:ze.warning.uploadWhileUploading.title,content:ze.warning.uploadWhileUploading.description,visible:n,children:A.jsx(r.Box,{display:"inline-flex",as:"span",children:A.jsx(r.Button,{disabled:i,onClick:s,invisible:!0,children:"upload"})})})})," ","media."]})}),A.jsx(r.FileUploadButton,{disabled:i,onFilesSelected:t,color:"grey",children:"Upload media"})]})}function xo(e){const{count:t}=e;return A.jsxs(r.Text,{variant:"bold",children:[t," item",t==1?"":"s"]})}function Ps(e){const{actionContainer:t}=e;return A.jsx(po,{sidePane:A.jsx(Ys,{}),mediaActions:A.jsx(Vs,{actionContainer:t}),mediaToolbar:A.jsx(r.Skeleton,{color:"grey5",borderRadius:12,children:A.jsx(xo,{count:888})}),mediaList:A.jsx(Os,{})})}function Os(){return A.jsx(mo,{children:O.range(1,24).map(e=>A.jsx(yo,{},e))})}function Vs(e){const{actionContainer:t}=e;return A.jsx(go,{actionContainer:t,children:A.jsxs(r.Box,{width:"100%",gap:16,children:[A.jsx(r.Box,{width:"100%",flexDirection:"column",children:A.jsx(r.FormSearchInput,{placeholder:"Search",maxLength:200,value:"",disabled:!0,onValueChange:()=>{}})}),A.jsx(r.FileUploadButton,{disabled:!0,onFilesSelected:()=>{},startIcon:"cloudUpload",color:t?"purple":"grey",size:"large",children:"Upload media"})]})})}function Ys(){return A.jsx(fo,{hasSelectedMedia:!1,children:A.jsx(Co,{onFilesUpload:()=>{},isUploading:!1,isInitialLoad:!0})})}function yo(){return A.jsx(r.Card,{variant:"outlined",padding:16,children:A.jsxs(r.CardContent,{gap:0,children:[A.jsx(r.Skeleton,{height:185,width:"100%"}),A.jsx(r.Skeleton,{height:16,width:"100%",sx:{marginTop:12}}),A.jsx(r.Skeleton,{height:10,width:100,sx:{marginTop:8}}),A.jsx(r.Skeleton,{height:1,width:"100%",sx:{marginTop:20,marginBottom:16}}),A.jsxs(r.Box,{flexDirection:"row",gap:8,children:[A.jsx(r.Skeleton,{height:24,width:54}),A.jsx(r.Skeleton,{height:24,width:45}),A.jsx(r.Skeleton,{height:24,width:62})]})]})})}const Bo=f.createContext({showToast:()=>{}});function Ws(e){const{children:t}=e,[n,o]=f.useState({title:"",seconds:5}),[i,s]=f.useState(!1),{title:a,action:l,seconds:d=1,icon:c="check"}=n,u=f.useMemo(()=>({showToast:h=>{o({seconds:d,...h}),s(!0)}}),[d]);return A.jsxs(A.Fragment,{children:[A.jsx(Hs,{}),A.jsx(r.Toast,{anchor:A.jsx(r.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:i,onOpenChange:s,title:a,action:l,seconds:d,icon:c}),A.jsx(Bo.Provider,{value:u,children:t})]})}function Io(){return f.useContext(Bo)}function Hs(){const{revalidateMedia:e,isMediaCacheInvalid:t}=P(),[n,o]=f.useState(t);return E.useOnChange(t,o),A.jsx(r.Toast,{anchor:A.jsx(r.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:n,title:"There have been changes to your media library",action:{title:"Update",onClick:e},cancel:{onClick:()=>o(!1)}})}function Ee(){const{media:e}=P(),t=je();return e.filter(({id:n})=>t.isSelected(n))}function _s(){const[e,t]=f.useState(!1),n=Ee(),o=je(),i=f.useMemo(()=>n.some(({id:a})=>a.startsWith("temp")),[n]),[s]=n;return s?o.selectedCount>1?A.jsxs(r.Box,{gap:8,alignItems:"center",children:[A.jsxs(r.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:[o.selectedCount," media selected"]}),A.jsx(r.Tooltip,{content:"Open all selected media in new tabs",children:A.jsx(r.IconButton,{icon:"openInFull",variant:"solid",size:"small",onClick:()=>n.forEach(a=>window.open(a.url,"_blank"))})}),A.jsx(r.Tooltip,{content:"Remove selected media",children:A.jsx(r.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),A.jsx(qn,{open:e,onOpenChange:t,media:n})]}):A.jsxs(r.Box,{gap:8,alignItems:"center",children:[A.jsx(r.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:s.filename}),A.jsxs(r.Box,{gap:8,children:[A.jsx(r.Tooltip,{content:"Open media in new tab",children:A.jsx(r.IconButton,{icon:"openInFull",variant:"solid",size:"small",hiddenLabel:"Open media in new tab",onClick:()=>window.open(s.url,"_blank"),disabled:i})}),A.jsx(r.Tooltip,{content:"Copy media URL",children:A.jsx(r.IconButton,{icon:"link",variant:"solid",size:"small",hiddenLabel:"Copy media URL",onClick:()=>navigator.clipboard.writeText(s.url),disabled:i})}),A.jsx(r.Tooltip,{content:"Remove media",children:A.jsx(r.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),A.jsx(qn,{open:e,onOpenChange:t,media:s})]})]}):null}function qn(e){const{open:t,onOpenChange:n,media:o}=e,i=L(),{showAlert:s}=r.useAlert(),{deleteMedia:a}=P(),l=je(),d=ro(),[c,u]=f.useState(!1),h=Array.isArray(o),g=h?"these items":"this item";function m(){u(!0);const y=l.getSelectionState().selectedIds;Ns({ids:y,config:i}).then(()=>{n(!1),a(y),l.clearSelection(),d()}).catch(()=>{n(!1),s({title:"Error",subtitle:`Something went wrong when removing ${g}.`})}).finally(()=>{u(!1)})}return A.jsxs(r.Dialog,{onOpenChange:n,open:t,size:"small",children:[A.jsx(r.DialogHeader,{icon:"alert",title:`Remove ${g} from your media library?`}),A.jsx(r.DialogDescription,{asChild:!0,children:A.jsx(r.DialogContent,{children:A.jsxs(r.Box,{padding:16,flexDirection:"column",children:[A.jsxs(r.Text,{children:["You are about to delete ",g,":  ",!h&&A.jsx("b",{children:o.filename})]}),h&&A.jsx(zs,{media:o})]})})}),A.jsxs(r.DialogActions,{children:[A.jsx(r.DialogCancelButton,{}),A.jsxs(r.DialogActionButton,{onClick:m,color:"tomato",loading:c,children:["Yes, I want to remove ",g]})]})]})}const Et=15;function zs(e){const{media:t}=e,n=t.slice(0,Et),o=t.length>Et,i=o?t.length-Et:0,s=Ae.pluralize(i,"item");return A.jsxs(r.UnorderedList,{density:"compact",sx:{marginTop:8},children:[n.map((a,l)=>A.jsx(r.ListItem,{children:A.jsx("b",{children:a.filename})},l)),o&&A.jsxs(r.ListItem,{children:["And ",A.jsx("b",{children:i})," more ",s,"..."]})]})}function Ns(e){const{ids:t,config:n}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");if(t.length===0)throw new Error("No ids provided during media deletion");const{assetsApiBaseUrl:o,repository:i,authStrategy:s}=n;if(t.length===1){const[a]=t;return U.request(new URL(`assets/${a}`,o),{headers:{repository:i},method:"DELETE",credentials:U.getRequestCredentials(s),okType:p.z.unknown()})}return U.request(new URL("assets/bulk-delete",o),{headers:{repository:i},method:"POST",credentials:U.getRequestCredentials(s),okType:p.z.unknown(),body:{ids:t}})}const ye=2e3,Ze="__MAIN_THUMBNAIL__";function Ht(e,t,n){const o=e.name===Ze?void 0:e.name;let i;return t?ae.isDefined(n)?i=[n.width,n.height]:ae.isDefined(e.width)||ae.isDefined(e.height)?i=[e.width??void 0,e.height??void 0]:i=[t.origin.width,t.origin.height]:i=void 0,[o,i?`${i[0]??"auto"}×${i[1]??"auto"}px`:void 0]}function Gs(e){var t,n;return[{...(t=e.config)==null?void 0:t.constraint,name:Ze}].concat(((n=e.config)==null?void 0:n.thumbnails)??[])}function Zs(e,t){var a,l;const{__TYPE__:n,thumbnails:o,...i}=t,s=(l=(a=e.config)==null?void 0:a.thumbnails)==null?void 0:l.map(({name:d})=>o==null?void 0:o[d]);return[i,...s??[]]}function Js(e,t,n,o){const i=o.length===0?void 0:o;return e===Ze||!K.isImageContent(t)?{...t,alt:i}:{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}}function Xs(e,t){const{width:n,height:o}=t??{};return n&&o?[n,o]:n?[n,Math.round(e.height*(n/e.width))]:o?[Math.round(e.width*(o/e.height)),o]:[e.width,e.height]}function $s(e,t,n,o,i){if(ia(e)==="svg")return e;const s=new URL(e);if(i){const{x:a,y:l,width:d,height:c}=t,u=[...s.searchParams.entries(),["rect",[a,l,d,c].join(",")],["w",n],["h",o]];s.search=u.map(h=>h.join("=")).join("&")}return s.toString()}function Bn(e,t){const n=new URL(e.split("?")[0]??e);return t!=null&&t.width&&n.searchParams.set("w",t.width.toString()),t!=null&&t.height&&n.searchParams.set("h",t.height.toString()),(t!=null&&t.width||!(t!=null&&t.height))&&n.searchParams.set("dpr",Math.max(1,Math.min(window.devicePixelRatio,3)).toString()),t!=null&&t.width&&(t!=null&&t.height)&&n.searchParams.set("fit","max"),n.searchParams.set("auto","compress,format"),n.toString()}function ea(e){return Bn(e,{width:300})}function jo(e){return Bn(e,{width:800,height:800})}function ta(e){return e!=null&&e.url?jo(e.url):void 0}function na(e,t,n,o){var l,d,c,u,h;if(!n||e===Ze){const g=(l=t.config)==null?void 0:l.thumbnails,m=g&&Object.fromEntries(g.map(C=>[C.name,ct(o,C)]));return{__TYPE__:"ImageContent",...ct(o,(d=t.config)==null?void 0:d.constraint),thumbnails:m}}const i=(u=(c=t.config)==null?void 0:c.thumbnails)==null?void 0:u.find(g=>g.name===e);if(!i)return n;const s=(h=n.thumbnails)==null?void 0:h[e],a=ct(o,i);return a.url===(s==null?void 0:s.url)?n:{...n,thumbnails:Ge.mapValues(n.thumbnails??{},(g,m)=>m===e?a:g)}}function Aa(e){return"kind"in e&&"extension"in e}function ct(e,t){const{width:n,height:o,rect:i}=oa({...e,width:(e==null?void 0:e.width)??ye,height:(e==null?void 0:e.height)??ye},t),s=!!(t!=null&&t.width||t!=null&&t.height);return{provider:"imgix",url:$s(e.url,i,n,o,s),alt:e.alt,...Aa(e)?{credits:e.credits}:{},origin:{id:e.id,url:e.url,width:e.width??ye,height:e.height??ye},width:n,height:o,edit:{background:"transparent",zoom:1,crop:{x:i.x,y:i.y}}}}function oa(e,t){const[n,o]=Xs(e,t),i=Math.max(n/e.width,o/e.height),s=Math.round((e.width-n/i)/2),a=Math.round((e.height-o/i)/2),l=Math.round(n/i),d=Math.round(o/i);return{width:n,height:o,rect:{x:s,y:a,width:l,height:d}}}function ia(e){const{pathname:t}=new URL(e),n=t.lastIndexOf(".");if(n!==-1)return t.substring(n).slice(1).toLowerCase()}function ra(e){if(!e)return"";const{filename:t,extension:n}=e;return!n||!t.endsWith(`.${n}`)?t:t.slice(0,-n.length-1)}function sa(){var s;const e=Ee(),{uploadingFiles:t}=P(),[n]=e;if(!n)return null;if(e.length===2)return A.jsx(Dt,{children:e.map((a,l)=>A.jsx("div",{style:{position:"absolute",transform:l===0?"translateX(25%) rotate(15deg) ":"translateX(-25%) rotate(-15deg) "},children:A.jsx(Pn,{media:a})},a.id))});if(e.length>2)return A.jsx(Dt,{children:e.slice(-4).map((a,l)=>A.jsx("div",{style:{position:"absolute",paddingRight:l*16},children:A.jsx(Pn,{media:a})},a.id))});const o=(s=t.find(a=>a.id===n.id))==null?void 0:s.status,i=n.kind.startsWith("image");return A.jsx(r.Box,{flexDirection:"column",children:A.jsx(r.CheckerBoard,{children:A.jsx(Dt,{uploadStatus:o,hasImage:i,children:i?A.jsx(r.Image,{src:n.url,alt:n.alt,sizing:"contain"}):A.jsx(r.MediaCardPlaceholder,{kind:n.kind,filename:n.filename})})})})}function Dt(e){const{children:t,uploadStatus:n,hasImage:o}=e;return A.jsxs(r.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:200,width:"100%",backgroundColor:o?"transparent":"purple2",children:[t,n&&A.jsx(aa,{uploadStatus:n})]})}function aa(e){const{uploadStatus:t}=e,{value:n,color:o,height:i,transition:s}=la(t);return A.jsx(r.Box,{position:"absolute",backgroundColor:"greyAlpha1",width:"100%",height:"100%",padding:{inline:16},justifyContent:"end",flexDirection:"column",children:A.jsx(r.ProgressBar,{value:n,color:o,height:i,transition:s})})}function la(e){switch(e){case"idle":return{value:0,height:"collapsed",color:"grey4"};case"uploading":return{value:90,transition:"slow",color:"purple9"};case"success":return{value:100,height:"collapsed",color:"purple9"};case"error":return{value:100,color:"tomato11"}}}function Pn(e){const{media:t}=e;return A.jsx(r.Box,{width:111,height:152,children:t.kind==="image"?A.jsx(r.Image,{borderRadius:8,src:Bn(t.url,{width:111,height:152}),alt:t.alt,sizing:"cover"}):A.jsx(r.MediaCardPlaceholder,{kind:t.kind,filename:t.filename})})}function ca(e){const t=e.length,n={},o=[];return e.forEach(s=>{s.tags.forEach(a=>{n[a.id]||(n[a.id]=0,o.push(a)),n[a.id]++})}),o.filter(s=>n[s.id]===t)}function Fo(e){const{tags:t,toggleAssetTag:n,getTagsLabel:o}=e,{setTagManagerOpen:i}=P(),{showToast:s}=Io(),{showAlert:a}=r.useAlert(),[l,d]=f.useState("");async function c(u,h){d("");try{await n(u,h),s({title:"Media tags were updated",seconds:3})}catch{a({title:"Error",subtitle:"Something went wrong when updating media tags"})}}return A.jsxs(r.Box,{flexDirection:"column",children:[A.jsxs(r.Box,{justifyContent:"space-between",children:[A.jsx(r.Text,{color:"grey12",variant:"bold",children:o()}),A.jsx(r.Button,{startIcon:"edit",invisible:!0,color:"dark",onClick:()=>i(!0),children:"Manage tags"})]}),A.jsxs(r.ComboBox,{sx:{marginTop:4,marginBottom:8},children:[A.jsx(da,{searchTerm:l,setSearchTerm:d}),A.jsx(r.ComboBoxContent,{children:A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(r.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:A.jsx(f.Suspense,{fallback:A.jsx(r.Box,{padding:8,flexDirection:"column",gap:8,children:O.range(1,6).map(u=>A.jsx(r.Skeleton,{height:24,width:85},u))}),children:A.jsx(ua,{searchTerm:l,assignedTags:t,onToggleAssetTag:c})})})})]}),A.jsx(r.Box,{flexDirection:"column",alignItems:"flex-start",gap:8,children:t.map(u=>A.jsx(r.Badge,{title:u.name,size:"medium",color:"purple",selected:!0,onClose:()=>c(u,"remove")},u.id))})]})}function da(e){const{searchTerm:t,setSearchTerm:n}=e,o=f.useRef(null),{openMediaSection:i,setOpenMediaSection:s}=P();return f.useEffect(()=>{var a;i==="tags"&&((a=o.current)==null||a.focus(),s(void 0))},[i,s]),A.jsx(r.ComboBoxInput,{value:t,onValueChange:n,placeholder:"Add or create a new tag",ref:o})}function ua(e){const{searchTerm:t,assignedTags:n,onToggleAssetTag:o}=e,[i]=Ee(),s=L(),{showAlert:a}=r.useAlert(),{tags:l}=tt(),d=f.useMemo(()=>{const g=t.toLowerCase();return l.filter(m=>m.name.toLowerCase().includes(g))},[l,t]),u=xn.safeParse(t).success&&l.every(g=>g.name!==t);async function h(){if(!t||!i)return;let g;try{g=await ga({name:t,config:s}),nt(m=>[g,...m])}catch{a({title:"Error",subtitle:`Something went wrong when creating the tag ${t}`});return}await o(g,"add")}return i?A.jsxs(A.Fragment,{children:[!d.length&&A.jsx(r.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),d.map((g,m)=>A.jsx(r.ComboBoxItem,{value:g.id,onCheckedChange:C=>o(g,C?"add":"remove"),checked:n.some(C=>C.id===g.id),children:A.jsx(r.Badge,{title:g.name,color:"purple",size:"medium",sx:{marginInline:8,marginBottom:m===d.length-1?8:4,marginTop:m===0?8:4}})},g.id)),u&&A.jsx(r.ComboBoxItem,{value:"new",onCheckedChange:h,children:A.jsxs(r.Box,{padding:8,flexDirection:"row",alignItems:"center",gap:4,children:[A.jsx(r.Icon,{name:"add",size:"small",color:"grey11"}),A.jsxs(r.Text,{color:"grey12",children:['Create tag "',t,'"']})]})})]}):null}function ga(e){const{name:t,config:n}=e;n.mediaLibrary||V("mediaLibrary");const{assetsApiBaseUrl:o,repository:i,authStrategy:s}=n;return U.request(new URL("tags",o),{headers:{repository:i},body:{name:t},method:"POST",credentials:U.getRequestCredentials(s),okType:yn})}function ha(e){const{selectedMedia:t}=e,n=L(),o=f.useMemo(()=>ca(t),[t]);async function i(a,l){const d=l==="remove",c=t.map(h=>h.id);let u=[];Le(h=>(u=h,h.map(g=>c.includes(g.id)?d?fa(g,a):ma(g,a):g)));try{await pa({tagId:a.id,assetIds:c,operation:d?"remove":"add",config:n});const h=t.length*(d?-1:1);nt(g=>g.map(m=>m.id===a.id?{...m,count:m.count+h}:m))}catch(h){throw Le(()=>u),h}}function s(){const a=o.length;return a>1?`${a} tags in common`:a===1?"1 tag in common":"Common tags"}return A.jsx(Fo,{tags:o,getTagsLabel:s,toggleAssetTag:i})}function pa(e){const{tagId:t,assetIds:n,config:o,operation:i}=e;if(!o.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:s,repository:a,authStrategy:l}=o;return U.request(new URL(`tags/${t}/assets`,s),{headers:{repository:a},body:{assetIds:n},method:i==="add"?"POST":"DELETE",credentials:U.getRequestCredentials(l),okType:p.z.unknown()})}function ma(e,t){return e.tags.some(({id:o})=>o===t.id)?e:{...e,tags:[...e.tags,t]}}function fa(e,t){const n=e.tags.filter(o=>o.id!==t.id);return{...e,tags:n}}function Ca(e){const{selectedMedia:t}=e,n=t.tags,o=L(),{updateMedia:i}=P();async function s(l,d){const c=t.tags,u=d==="remove",h=u?c.filter(g=>g.id!==l.id):[...c,l];i(t.id,{tags:h});try{await xa({mediaId:t.id,config:o,tags:h.map(g=>g.id)}),nt(g=>g.map(m=>m.id===l.id?{...m,count:m.count+(u?-1:1)}:m))}catch(g){throw i(t.id,{tags:c}),g}}function a(){const l=n.length;return l>1?`${l} tags`:l===1?"1 tag":"Tags"}return A.jsx(Fo,{tags:n,getTagsLabel:a,toggleAssetTag:s})}function xa(e){const{mediaId:t,config:n,tags:o}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:s,authStrategy:a}=n;return U.request(new URL(`assets/${t}`,i),{headers:{repository:s},body:{tags:o},method:"PATCH",credentials:U.getRequestCredentials(a),okType:Ut})}function ya(){const[e,t]=f.useState("description");if(Ee().length!==1)return A.jsx(Sa,{});const o=e==="description",i=e==="more-info";return A.jsxs(A.Fragment,{children:[A.jsxs(r.Box,{display:"grid",gridTemplateColumns:"1fr 1fr",backgroundColor:"grey2",border:!0,borderStyle:"solid",borderRadius:8,children:[A.jsx(r.Tab,{selected:o,outline:o,transparent:!0,onClick:()=>t("description"),children:"Description"}),A.jsx(r.Tab,{selected:i,outline:i,transparent:!0,onClick:()=>t("more-info"),children:"More info"})]}),A.jsx(Ba,{tab:e})]})}function Ba(e){const{tab:t}=e;switch(t){case"description":return A.jsx(Ia,{});case"more-info":return A.jsx(ja,{})}}function Ia(){const{title:e,alt:t,onBlur:n,isUploading:o,selectedMedia:i}=bo();if(!i)return null;const{extension:s}=i;return A.jsxs(r.Box,{flexDirection:"column",gap:16,children:[A.jsx(r.FormInput,{value:e.value,onValueChange:e.set,label:"Media title",placeholder:"Media title",onBlur:n,disabled:o,suffix:s?`.${s}`:void 0}),A.jsx(r.FormInputField,{label:"Alternative text",children:A.jsx(r.ContentEditable,{content:t.displayValue,contentVersion:t.version,readOnly:o,placeholder:"A short description of the media for accessibility",multiline:!0,decorations:{em:"highlight"},onChange:t.onChange,onBlur:n})}),!o&&A.jsx(Ca,{selectedMedia:i})]})}function ja(){const{credits:e,notes:t,onBlur:n,isUploading:o,selectedMedia:i}=bo();if(!i)return null;const{uploader_id:s}=i,a=Ua(i);return A.jsxs(r.Box,{gap:8,flexDirection:"column",children:[a.map(l=>A.jsxs(r.Box,{gap:8,children:[A.jsxs(r.Text,{color:"grey11",children:[l.label,":"]}),A.jsx(r.Text,{children:l.value})]},l.label)),A.jsxs(r.Box,{gap:8,children:[A.jsx(r.Text,{color:"grey11",children:"Uploaded by:"}),A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(r.Text,{color:"grey11",children:"Error getting uploader"}),children:A.jsx(f.Suspense,{fallback:A.jsx(So,{}),children:A.jsx(Fa,{uploaderId:s})})})]}),A.jsx(r.FormInputField,{label:"Copyright",children:A.jsx(r.ContentEditable,{content:e.displayValue,contentVersion:e.version,readOnly:o,placeholder:"Media copyrights or credits",multiline:!0,decorations:{em:"highlight"},onChange:e.onChange,onBlur:n})}),A.jsx(r.FormInputField,{label:"Private notes",children:A.jsx(r.ContentEditable,{content:t.displayValue,contentVersion:t.version,readOnly:o,placeholder:"Private notes are never shared publicly",multiline:!0,decorations:{em:"highlight"},onChange:t.onChange,onBlur:n})})]})}function Fa(e){const{uploaderId:t}=e,{uploadersById:n}=oo(),o=n.get(t??"ghost");return t&&!o?A.jsx(So,{}):o?A.jsxs(A.Fragment,{children:[A.jsx(r.Avatar,{size:24,firstName:o.firstName,lastName:o.lastName,imageUrl:o.uploadedAvatar,hasBorder:!1}),A.jsx(r.Text,{children:o.name})]}):null}function So(){return A.jsx(r.Skeleton,{width:128})}function Sa(){const e=Ee(),{uploadingFiles:t}=P(),n=f.useMemo(()=>t.some(o=>e.some(i=>o.id===i.id)&&o.status!=="success"),[e,t]);return A.jsx(A.Fragment,{children:!n&&A.jsx(ha,{selectedMedia:e})})}function bo(){const[e]=Ee(),{updateMedia:t,uploadingFiles:n}=P(),o=L(),{showToast:i}=Io(),s=(e==null?void 0:e.id)??"",a=st(e,"alt"),l=st(e,"notes"),d=st(e,"credits"),c=st(e,"filename",ra),u=n.some(g=>g.id===(e==null?void 0:e.id)&&g.status!=="success");async function h(){if(!e||!c.changed&&!a.changed&&!d.changed&&!l.changed)return;const{extension:g,search_highlight:m}=e,C=g?`${c.value}.${g}`:c.value;t(s,{filename:C,alt:a.value,credits:d.value,notes:l.value,search_highlight:{alt:a.changed||m==null?void 0:m.alt,credits:d.changed||m==null?void 0:m.credits,filename:c.changed||m==null?void 0:m.filename,notes:l.changed||m==null?void 0:m.notes}}),await Ka({id:s,config:o,metadata:{filename:C,alt:a.value,credits:d.value,notes:l.value}}),i({title:"Media metadata has been saved.",seconds:3})}return{selectedMedia:e,onBlur:h,isUploading:u,title:c,alt:a,credits:d,notes:l,extension:e==null?void 0:e.extension}}function st(e,t,n=o=>o==null?void 0:o[t]){var c;const o=n(e)??"",[i,s]=f.useState(o);E.useOnChange(e==null?void 0:e.id,()=>s(o));const a=(c=e==null?void 0:e.search_highlight)==null?void 0:c[t],l=!!a;function d(u){const{from:h,to:g}=u.state.selection;u.commands.selectAll(),u.commands.unsetAllMarks(),u.commands.setTextSelection({from:h,to:g}),s(u.getText())}return{value:i,set:s,displayValue:ba(a??i)??"",onChange:d,version:`${(e==null?void 0:e.id)??""}_${l}`,changed:i!==o}}function ba(e){return e==null?void 0:e.replace(/\n/g,"<br>")}function Ka(e){const{id:t,config:n,metadata:o}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:s,authStrategy:a}=n;return U.request(new URL(`assets/${t}`,i),{headers:{repository:s},body:{...o},method:"PATCH",credentials:U.getRequestCredentials(a),okType:Ut})}function Ua(e){const{width:t,height:n,last_modified:o,size:i,extension:s}=e,a=t&&n,l={label:"Date",value:cn.prettyPrintDate(new Date(o))},d={label:"File size",value:Ae.formatBytes(i)},c=a?{label:"Dimensions",value:`${t}×${n}`}:void 0,u=a?{label:"Ratio",value:((t??0)/(n??0)).toFixed(1)}:void 0,h=s?{label:"Extension",value:s.toUpperCase()}:void 0;return[l,d,c,u,h].filter(ae.isDefined)}function Ta(){const{setTagManagerOpen:e}=P(),[t,n]=f.useState("");return A.jsxs(r.Box,{gap:20,flexDirection:"column",height:"100%",children:[A.jsxs(r.Box,{alignItems:"center",gap:4,children:[A.jsx(r.IconButton,{icon:"close",size:"small",hasPadding:!1,onClick:()=>e(!1)}),A.jsx(r.Text,{variant:"bold",children:"Tags management"})]}),A.jsxs(r.Box,{gap:16,flexDirection:"column",height:"100%",children:[A.jsx(r.FormSearchInput,{value:t,onValueChange:n,placeholder:"Search for tags",endAdornment:!1,autoFocus:!0}),A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(ka,{}),children:A.jsx(f.Suspense,{fallback:A.jsx(Ra,{}),children:A.jsx(wa,{searchTerm:t})})})]})]})}function wa(e){const{searchTerm:t}=e,{tags:n}=tt(),o=n.filter(i=>i.name.toLowerCase().includes(t.toLowerCase()));return o.length===0?A.jsx(r.Text,{color:"grey9",variant:"small",children:"No tags found"}):A.jsx(r.AnimatedList,{ariaLabel:"Tags list",getItemKey:i=>i.id,gap:16,items:o,children:i=>A.jsx(La,{tag:i})})}function La(e){const{tag:t}=e,[n,o]=f.useState(!1),i=L(),{showAlert:s}=r.useAlert(),{showToast:a}=r.useToast(),{tags:l}=tt();async function d(c){if(!xn.safeParse(c).success){s({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${c}". Tag name must be at least ${JA} and at maximum ${XA} characters long.`});return}if(l.some(g=>g.name===c)){s({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${c}". Tag with name "${c}" already exists.`});return}try{await Da({id:t.id,name:c,config:i}),nt(g=>g.map(m=>m.id===t.id?{...m,name:c}:m)),Le(g=>g.map(m=>{if(m.tags.findIndex(y=>y.id===t.id)!==-1){const y=m.tags.map(x=>x.id===t.id?{...x,name:c}:x);return{...m,tags:y}}return m})),a({title:`Tag "${t.name}" renamed to "${c}"`,seconds:3})}catch{s({title:"Error",subtitle:"Something went wrong when renaming the tag."})}}return A.jsxs(A.Fragment,{children:[A.jsxs(r.Box,{justifyContent:"space-between",children:[A.jsx(r.Badge,{title:t.name,color:"purple",size:"medium",onEdit:d}),A.jsx(r.Button,{invisible:!0,color:"tomato",textWeight:"normal",onClick:()=>o(!0),children:"Delete"})]}),A.jsx(va,{open:n,onOpenChange:o,tag:t})]})}function va(e){const{open:t,onOpenChange:n,tag:o}=e,{id:i,name:s,count:a}=o,l=L(),{showAlert:d}=r.useAlert(),[c,u]=f.useState(!1);async function h(){u(!0);try{await Ea({id:i,config:l}),nt(g=>g.filter(m=>m.id!==i)),Le(g=>g.map(m=>{if(m.tags.findIndex(y=>y.id===i)!==-1){const y=m.tags.filter(x=>x.id!==i);return{...m,tags:y}}return m}))}catch{d({title:"Error",subtitle:"Something went wrong when removing the tag."})}finally{u(!1),n(!1)}}return A.jsxs(r.Dialog,{onOpenChange:n,open:t,size:"small",children:[A.jsx(r.DialogHeader,{title:`This tag is being used on ${a} media ${Ae.pluralize(a,"item")}`}),A.jsx(r.DialogDescription,{asChild:!0,children:A.jsx(r.DialogContent,{padding:16,children:A.jsxs(r.Text,{children:["You are about to delete the tag name ",A.jsx("b",{children:s}),"."," ",a>0&&`This tag is being used on ${a} media ${Ae.pluralize(a,"item")} and will be deleted from ${Ae.pluralize(a,"it","them")}.`]})})}),A.jsxs(r.DialogActions,{children:[A.jsx(r.DialogCancelButton,{}),A.jsx(r.DialogActionButton,{onClick:h,color:"tomato",loading:c,children:"Yes, I want to delete"})]})]})}function ka(){const e=f.useContext(R.ErrorBoundaryContext);return A.jsx(r.Box,{flexDirection:"column",children:A.jsxs(r.BlankSlate,{children:[A.jsx(r.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed"}),A.jsx(r.BlankSlateTitle,{size:"big",children:"Oops!"}),A.jsx(r.BlankSlateDescription,{width:360,children:"We couldn't load your media tags."}),A.jsx(r.BlankSlateActions,{children:A.jsx(r.Button,{onClick:e==null?void 0:e.reset,size:"medium",children:"Try again"})})]})})}function Ea(e){const{id:t,config:n}=e;n.mediaLibrary||V("mediaLibrary");const{assetsApiBaseUrl:o,repository:i,authStrategy:s}=n;return U.request(new URL(`tags/${t}`,o),{headers:{repository:i},method:"DELETE",credentials:U.getRequestCredentials(s),okType:p.z.unknown()})}function Da(e){const{id:t,name:n,config:o}=e;o.mediaLibrary||V("mediaLibrary");const{assetsApiBaseUrl:i,repository:s,authStrategy:a}=o;return U.request(new URL(`tags/${t}`,i),{headers:{repository:s},method:"PATCH",credentials:U.getRequestCredentials(a),body:{name:n},okType:p.z.unknown()})}function Ra(){return A.jsx(r.Box,{flexDirection:"column",gap:16,children:O.range(1,6).map(e=>A.jsxs(r.Box,{justifyContent:"space-between",children:[A.jsx(r.Skeleton,{height:24,width:85}),A.jsx(r.Skeleton,{height:24,width:45})]},e))})}function Qa(){const e=Ee(),{onFilesUpload:t,isUploading:n,tagManagerOpen:o}=P();return e.length===0&&o===!1?A.jsx(Co,{onFilesUpload:t,isUploading:n}):A.jsx(r.Box,{flexDirection:"column",backgroundColor:"grey1",width:"100%",padding:16,gap:16,borderRadius:{topLeft:8,topRight:8},children:o?A.jsx(Ta,{}):A.jsxs(A.Fragment,{children:[A.jsx(_s,{}),A.jsx(sa,{}),A.jsx(ya,{})]})})}function Ma(){const e=je();return A.jsx(fo,{hasSelectedMedia:e.selectedCount!==0,children:A.jsx(Qa,{})})}const _t={all:{name:"All media",icon:"public"},image:{name:"Images",icon:"image"},video:{name:"Videos",icon:"videocam"},document:{name:"Documents",icon:"insertDriveFile"},audio:{name:"Audio files",icon:"musicNote"}},qa=Object.entries(_t);function Pa(){const{assetType:e,initialAssetType:t,onFilterChange:n}=P(),[o,i]=f.useState(e);E.useOnChange(e,()=>{i(e)});const[s,a]=f.useState(!1);function l(g){a(!1),i(g),n({assetType:g})}const{icon:d,name:c}=_t[o],u=_t[t].name,h=t!=="all";return A.jsxs(r.DropdownMenu,{open:s,onOpenChange:a,children:[A.jsx(r.DropdownMenuTrigger,{disabled:h,children:A.jsx(Oa,{icon:d,isDropdownDisabled:h,buttonName:c,tooltipAssetTypeName:u})}),A.jsx(r.DropdownMenuContent,{minWidth:256,align:"start",childrenFocusScope:!0,children:A.jsx(A.Fragment,{children:qa.filter(([g])=>g!==o).map(([g,{icon:m,name:C}])=>A.jsx(r.DropdownMenuItem,{startIcon:A.jsx(r.Icon,{name:m}),onSelect:()=>l(g),children:C},g))})})]})}const Oa=f.forwardRef(function(t,n){const{icon:o,isDropdownDisabled:i,buttonName:s,tooltipAssetTypeName:a,...l}=t;return A.jsx(r.Tooltip,{content:`You can only pick ${(a==null?void 0:a.toLocaleLowerCase())??"this type of media"}`,visible:i,children:A.jsx(r.Button,{startIcon:o,endIcon:"arrowDropDown",size:"small",color:"grey",disabled:i,ref:n,...l,children:s})})});function Va(e){const{optimisticTagIds:t,setOptimisticTagIds:n}=e,{onFilterChange:o}=P(),{tags:i}=tt(),s=f.useMemo(()=>Xi.groupBy(i,l=>l.id),[i]);function a(l){const d=t.filter(c=>c!==l.id);n(d),o({tagIds:d})}return A.jsx(A.Fragment,{children:t.map(l=>{var c;const d=(c=s.get(l))==null?void 0:c[0];return d?A.jsx(r.Badge,{title:d.name,size:"medium",color:"purple",onClose:()=>a(d),selected:!0},d.id):null})})}function Ya(){const{setTagManagerOpen:e,tagIds:t,onFilterChange:n}=P(),[o,i]=f.useState(""),[s,a]=f.useState(!1),[l,d]=f.useState(t);E.useOnChange(JSON.stringify(t),()=>{d(t)});function c(g){a(g),g||i("")}function u(g){const m=l.includes(g.id)?t.filter(C=>C!==g.id):[...t,g.id];d(m),n({tagIds:m}),a(!1)}function h(){a(!1),e(!0)}return A.jsxs(A.Fragment,{children:[A.jsxs(r.DropdownMenu,{open:s,onOpenChange:c,children:[A.jsx(r.DropdownMenuTrigger,{children:A.jsx(r.Button,{startIcon:"label",endIcon:"arrowDropDown",size:"small",color:"grey",children:"Tags"})}),A.jsx(r.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:A.jsxs(r.ComboBox,{variant:"attached",children:[A.jsx(r.ComboBoxInput,{value:o,onValueChange:i,placeholder:"Search for a tag",autoFocus:!0}),A.jsx(r.ComboBoxContent,{paddingBlock:4,children:A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(r.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:A.jsx(f.Suspense,{fallback:A.jsx(r.Box,{padding:8,flexDirection:"column",gap:8,children:O.range(1,6).map(g=>A.jsx(r.Skeleton,{height:24,width:85},g))}),children:A.jsx(Wa,{searchTerm:o,setSearchTerm:i,onTagToggle:u,optimisticTagIds:l})})})}),A.jsx(r.ComboboxAction,{children:A.jsx(r.Button,{invisible:!0,startIcon:"edit",textWeight:"normal",color:"dark",onClick:h,children:"Manage tags"})})]})})]}),l.length>0&&A.jsx(r.ErrorBoundary,{children:A.jsx(f.Suspense,{children:A.jsx(Va,{optimisticTagIds:l,setOptimisticTagIds:d})})})]})}function Wa(e){const{onTagToggle:t,searchTerm:n,optimisticTagIds:o}=e,{tags:i}=tt(),s=f.useMemo(()=>{const a=n.toLowerCase();return i.filter(l=>l.name.toLowerCase().includes(a))},[i,n]);return A.jsxs(A.Fragment,{children:[!s.length&&A.jsx(r.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),s.map(a=>{const l=o.includes(a.id);return A.jsx(r.ComboBoxItem,{value:a.id,onCheckedChange:()=>t(a),checked:l,children:A.jsx(r.Badge,{title:a.name,color:"purple",sx:{marginLeft:8,marginBottom:4,marginTop:4},size:"medium"})},a.id)})]})}function Ha(){const{uploaderId:e,onFilterChange:t}=P(),[n,o]=f.useState(""),[i,s]=f.useState(!1),[a,l]=f.useState();E.useOnChange(e,()=>{e||l(void 0)});function d(u){s(u),u||o("")}function c(u){l(u),t({uploaderId:u==null?void 0:u.id}),s(!1)}return A.jsxs(r.DropdownMenu,{open:i,onOpenChange:d,children:[A.jsx(r.DropdownMenuTrigger,{children:A.jsx(r.Button,{startIcon:"people",renderStartIcon:u=>a?A.jsx(r.Avatar,{imageUrl:a==null?void 0:a.uploadedAvatar,firstName:a.firstName,lastName:a.lastName,size:16,hasBorder:!1}):u,endIcon:"arrowDropDown",size:"small",color:"grey",children:(a==null?void 0:a.name)??"All uploaders"})}),A.jsx(r.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:A.jsxs(r.ComboBox,{variant:"attached",children:[A.jsx(r.ComboBoxInput,{value:n,onValueChange:o,placeholder:"Search for uploaders",autoFocus:!0}),A.jsx(r.ComboBoxContent,{paddingBlock:4,children:A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(r.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting uploaders"}),children:A.jsx(f.Suspense,{fallback:A.jsx(za,{}),children:A.jsx(_a,{searchTerm:n,setSearchTerm:o,onUploaderToggle:c,optimisticUploader:a})})})})]})})]})}function _a(e){const{searchTerm:t,optimisticUploader:n,onUploaderToggle:o}=e,{uploaders:i}=oo(),s=f.useMemo(()=>{const a=t.toLowerCase();return O.sort(i.filter(l=>{var d;return l.name.toLowerCase().includes(a)||((d=l.email)==null?void 0:d.toLowerCase().includes(a))}),l=>(n==null?void 0:n.id)===(l==null?void 0:l.id)?0:1)},[i,n,t]);return s.length?A.jsx(A.Fragment,{children:s.map(a=>{const l=a.id===(n==null?void 0:n.id);return A.jsx(r.ComboBoxItem,{value:a.id,onCheckedChange:()=>l?o():o(a),checked:l,children:A.jsxs(r.Box,{alignItems:"center",padding:{top:8,bottom:8,left:16,right:16},gap:8,children:[A.jsx(r.Avatar,{firstName:a.firstName,lastName:a.lastName,imageUrl:a.uploadedAvatar,hasBorder:!1}),A.jsxs(r.Box,{display:"flex",flexDirection:"column",children:[A.jsx(r.Text,{color:"grey12",variant:"normal",children:a.name}),a.email&&A.jsx(r.Text,{color:"grey10",variant:"small",children:a.email})]})]})},a.id)})}):A.jsx(r.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No uploaders found"})}function za(){return A.jsx(r.Box,{padding:8,flexDirection:"column",gap:8,children:O.range(1,4).map(e=>A.jsx(r.Skeleton,{height:48,width:"full"},e))})}function Na(){const{media:e,mediaTotal:t}=P(),n=je();return A.jsxs(r.Box,{alignItems:"center",gap:16,children:[n.isSelectAllEnabled&&A.jsx(r.Checkbox,{onCheckedChange:n.toggleSelectAll,checked:n.selectedCount>0,indeterminate:n.selectedCount!==t,onClick:o=>o.stopPropagation(),disabled:e.length===0}),e.length!==0&&A.jsx(xo,{count:t}),A.jsxs(r.Box,{gap:8,alignItems:"center",children:[A.jsx(r.Text,{children:"Filter:"}),A.jsx(Pa,{}),A.jsx(Ha,{}),A.jsx(Ya,{})]})]})}function Ko(e){const{assetType:t,onSelectedChange:n,actionContainer:o}=e;return A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(ho,{}),children:A.jsx(f.Suspense,{fallback:A.jsx(Ps,{actionContainer:o}),children:A.jsx(xA,{children:A.jsx(Ls,{assetType:t,actionContainer:o,onSelectedChange:n,children:A.jsx(Qs,{children:A.jsx(Ga,{})})})})})})}function Ga(){const{media:e}=P(),t=lo();return A.jsx(Ws,{children:A.jsx(po,{sidePane:t?void 0:A.jsx(Ma,{}),mediaActions:A.jsx(Ds,{}),mediaToolbar:A.jsx(Na,{}),mediaList:e.length===0?A.jsx(ks,{}):A.jsx(qs,{})})})}function Za(e){const{href:t,tracking:n}=e;return A.jsx(r.Box,{justifyContent:"center",padding:{block:6},children:A.jsxs(r.Text,{href:t,variant:"smallBold",color:"grey11",onClick:()=>void n.track({event:"shared-onboarding:follow-tutorial",source:n.source}),children:["Or watch our in-depth course",A.jsx(r.Icon,{name:"playCircle",color:"grey11",size:"small",sx:{marginLeft:4}})]})})}function Ja(e){const{step:t,stepIndex:n,isOpen:o,onActionClick:i,onClose:s,contentRef:a}=e,[l,d]=f.useState(!1),[c,u]=f.useState(e.isStepComplete);f.useEffect(()=>{o&&u(e.isStepComplete)},[e.isStepComplete,o]);async function h(){if(o)try{d(!0),await i(c)}finally{d(!1)}}return A.jsxs(r.Dialog,{open:o,onOpenChange:s,size:"small",children:[A.jsx(r.DialogHeader,{title:"Onboarding"}),A.jsxs(r.DialogContent,{children:[A.jsx(r.ScrollArea,{children:A.jsxs(r.Box,{ref:a,as:"article",flexDirection:"column",padding:16,gap:16,children:[A.jsx(r.DialogDescription,{asChild:!0,children:A.jsxs("section",{children:[A.jsxs(r.Text,{sx:{marginBottom:4},color:"purple9",variant:"bold",children:["Step ",n+1]}),A.jsx(r.Text,{variant:"h3",children:t.title}),t.content]})}),t.videoUrl&&A.jsx(r.Video,{src:t.videoUrl,sizing:"contain",borderRadius:4,autoPlay:!0,loop:!0})]})}),A.jsxs(r.DialogActions,{children:[A.jsx(r.DialogCancelButton,{size:"medium",children:"Close"}),!t.defaultCompleted&&A.jsx(r.DialogActionButton,{size:"medium",onClick:h,loading:l,color:c?"darkGrey":"purple",children:c?"Undo step":"Complete step"})]})]})]})}function Xa(e){const{steps:t,completedSteps:n,onToggleStep:o,tracking:i,stepOverrides:s}=e,[a,l]=f.useState(!1),[d,c]=f.useState(t[0]),u=f.useRef(null);if(!d)return null;const h=t.findIndex(({id:x})=>x===d.id);function g(x){return n.includes(x.id)}function m(x){c(x),l(!0),i.track({event:"shared-onboarding:step-opened",stepId:x.id,stepTitle:x.title,source:i.source})}async function C(x=!1){var I;if(d&&(await o(d),!x)){(I=u.current)==null||I.animate([{opacity:0},{opacity:1}],{duration:400});const B=y();B?m(B):l(!1)}}function y(){let x=h+1;for(;x<t.length;){const I=t[x];if(I&&!g(I))return I;x++}}return A.jsxs(A.Fragment,{children:[A.jsx(Ja,{contentRef:u,isOpen:a,step:d,stepIndex:h,isStepComplete:g(d),onClose:()=>l(!1),onActionClick:C}),A.jsxs(r.DropdownMenu,{children:[A.jsx(r.DropdownMenuTrigger,{children:A.jsx(r.Button,{size:"large",color:"grey",sx:{width:"100%"},renderStartIcon:$a,children:n.length>0?"Continue":"Start now"})}),A.jsxs(r.DropdownMenuContent,{side:"right",minWidth:256,collisionPadding:8,children:[A.jsx(r.DropdownMenuLabel,{children:A.jsx(r.Text,{variant:"small",color:"grey11",sx:{marginInline:8},children:"Progress"})}),t.map((x,I)=>{const B=g(x);return A.jsx(r.DropdownMenuItem,{onSelect:(s==null?void 0:s[x.id])??(()=>m(x)),description:x.description,completed:B,endAdornment:A.jsx(r.Icon,{name:"chevronRight",size:"small",color:"grey11"}),children:`${I+1} ${x.title}`},x.id)})]})]})]})}function $a(){return A.jsx(r.Icon,{name:"arrowForward",size:"small",color:"grey11"})}function el(e){const{steps:t,completedSteps:n,tutorialLink:o,tracking:i,onToggleStep:s,onClose:a,stepOverrides:l}=e,d=n.length===t.length;return A.jsx(r.Card,{variant:d?"elevated":"animated-light",paddingBlock:16,onClose:a,children:A.jsxs(r.CardContent,{children:[A.jsxs("div",{children:[A.jsx(r.Text,{variant:"bold",children:`Build your first page in ${t.length.toString()} simple steps`}),A.jsx(r.Text,{color:"grey11",variant:"small",children:"Render a live page with content coming from Prismic."})]}),A.jsx(r.ProgressBar,{value:n.length,max:t.length,displayLabel:!0,getValueLabel:(c,u)=>`${c}/${u}`}),A.jsx(Xa,{steps:t,completedSteps:n,onToggleStep:s,tracking:i,stepOverrides:l}),o&&A.jsx(Za,{href:o,tracking:i})]})})}function tl(e){const{framework:t,projectName:n,starterId:o,repositoryName:i}=e,{frameworkNameLabel:s,createProjectCodeSnippet:a}=nl(e),l=[{id:"createPrismicProject",title:"Create your Prismic project",description:"Create and set up your project",defaultCompleted:!0,content:A.jsx(r.Text,{children:"A Prismic project is a space for managing and organizing the content of your website."})},{id:"chooseLocale",title:"Select your main locale",description:"Choose your first locale",defaultCompleted:!!o,content:A.jsx(r.Text,{children:"Locales allow you to create and manage multilingual versions of your content within a single Prismic project."})},{id:"createProject",title:`Create a ${s}project`,description:"Create and set up your project",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1727768069/DEV_TOOLS/ONBOARDING_GUIDE/Pagebuilder_onboarding_step_3_puh6fx.mp4",content:A.jsxs(A.Fragment,{children:[A.jsx(r.Text,{sx:{marginBottom:16},children:"Now that you have a Prismic project to manage the content of your website, let's create the code project that will be querying your content."}),!!a&&A.jsx(Ot,{code:`${a} ${i??"<my-project>"}`,language:"bash"}),A.jsx(r.Text,{variant:"small",sx:{marginTop:16},children:"(example for Next.js below)"})]})},{id:"setupSliceMachine",title:"Set up & run Slice Machine",description:"Prepare the code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1727768069/DEV_TOOLS/ONBOARDING_GUIDE/page_builder_onboarding_step_4_yl8fb8.mp4",content:A.jsxs(A.Fragment,{children:[A.jsx(r.Text,{sx:{marginBottom:16},children:`Slice Machine is the Prismic tool for creating your content models.
36
- Install it in your ${s}project by running these commands:`}),A.jsx(Ot,{code:`cd ${n??"<your project name>"}
37
- npx @slicemachine/init@latest --repository ${i??"<my-project>"}`,language:"bash",title:"Terminal",showLineNumbers:!1})]})},{id:"createPageType",title:"Create a Page Type",description:"Build the structure of your page",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Create_page_type_xdn13j.mp4",content:A.jsx(r.Text,{children:"A page type is a base content structure editors will use to create pages in the Page Builder (Prismic's content creation UI). A page type can be reusable (e.g., for multiple blog posts) or single (e.g., for a one-time page like the homepage)."})},{id:"codePage",title:"Code Your Page Type",description:"Prepare code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Step2_code_your_page_jatiur.mp4",content:A.jsx(r.Text,{children:"Prepare your code to query the content from the Prismic API."})},{id:"createSlice",title:"Create a Slice",description:"Build a reusable website section",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918322/DEV_TOOLS/ONBOARDING_GUIDE/Step3_add_slice_qzmvxf.mp4",content:A.jsx(r.Text,{children:"Slices are website sections that can be reused on different pages with different content. Each slice has a code component automatically generated by Slice Machine. Start with a template and look at your code to see how it's structured."})},{id:"reviewAndPush",title:"Review and Push changes",description:"Enable editors to create content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/DevTools_Squad_push_changes_ovvmul.mp4",content:A.jsx(r.Text,{children:"Your page types and slices currently exist only in your local project. Push them to your repository to make them available for your content editors."})},{id:"createContent",title:"Create Content",description:"Publish a page to the Prismic API",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1732631905/DEV_TOOLS/ONBOARDING_GUIDE/step_9_create_content_y8m3m0.mp4",content:A.jsx(r.Text,{children:"In Prismic, content creation takes place in the Prismic Page Builder UI. Open the Page Builder and start creating your first page."})},{id:"renderPage",title:"Render Your Page",description:"View your page in the browser",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918321/DEV_TOOLS/ONBOARDING_GUIDE/Step_6_Render_Page_tnauh9.mp4",content:A.jsxs(r.Text,{children:["Now that your content is published, you can run your project in your terminal and visit the page on your local server (e.g.,"," ",A.jsx(r.Text,{component:"code",children:"localhost:3000/example-page"}),"). Your content should now be visible!"]})}],d={next:"https://prismic.dev/course/next",nuxt:"https://prismic.dev/course/nuxt",sveltekit:"https://prismic.dev/course/sveltekit"};return{steps:l,defaultCompletedStepIds:l.flatMap(c=>c.defaultCompleted?[c.id]:[]),tutorialLink:t?d[t]:void 0}}function nl(e){const{framework:t}=e;if(!t||t==="other")return{frameworkNameLabel:"",createProjectCodeSnippet:""};const n=uA[t];return{frameworkNameLabel:n?`${n} `:"",createProjectCodeSnippet:gA[t]}}const Rt=3e3,On=400;function Al(e){const{onboardingState:t,tracking:n,onToggleStep:o,onToggleGuide:i,fallback:s=null,stepOverrides:a,repositoryName:l,projectName:d}=e,{context:c,isDismissed:u}=t,{steps:h,defaultCompletedStepIds:g,tutorialLink:m}=tl({...c,repositoryName:l,projectName:d}),C=B(t.completedSteps),y=ol(x,On);if(E.useOnChange(u,()=>!u&&y.reset()),c.framework==="other")return A.jsx(A.Fragment,{children:s});function x(){i()}async function I(j){const S=await o(j.id);S.includes(j.id)&&n.track({event:"shared-onboarding:step-completed",stepId:j.id,stepTitle:j.title,source:n.source}),B(S).length===h.length&&(n.track({event:"shared-onboarding:completed",source:n.source}),y.start())}function B(j){const S=h.map(({id:b})=>b);return Array.from(new Set([...j.filter(b=>S.includes(b)),...g]))}return u?null:A.jsx(r.AnimatedElement,{enterDuration:0,exitDuration:On,children:y.status!=="hidden"&&A.jsxs("div",{ref:y.refs.container,style:{position:"relative"},children:[A.jsx(el,{steps:h,completedSteps:C,tutorialLink:m,tracking:n,onToggleStep:I,onClose:y.status!=="animating"?x:void 0,stepOverrides:a}),A.jsx("div",{ref:y.refs.cannon,style:{position:"absolute",bottom:0,left:0}})]})})}function ol(e,t=400){const n=fr.useConfetti({config:{duration:Rt}}),[o,i]=f.useState("visible"),s=f.useRef(!1),a=f.useCallback(()=>{i("animating"),setTimeout(()=>i("hidden"),Rt-t),s.current||(setTimeout(e,Rt),s.current=!0)},[e,t]),l=()=>{n.throwConfetti(),a()},d=f.useCallback(()=>{i("visible"),s.current=!1},[]);return{refs:{container:n.confettiContainerRef,cannon:n.confettiCannonRef},status:o,start:l,reset:d}}function Uo(e){const{type:t,value:n}=e,o=t===le?He.max:_e.max;return A.jsx(r.Box,{alignItems:"center",children:A.jsx(r.Tooltip,{title:il[t],content:al[t],stableMount:!0,children:A.jsx(r.Badge,{title:`${n.length} characters`,size:"medium",color:n.length>o?"tomato":"green",sx:{alignSelf:"center"}})})})}const il={[le]:"Meta title length",[ue]:"Meta description length"},rl=`${He.min}-${He.max}`,sl=`${_e.min}-${_e.max}`,al={[le]:`For optimal mobile SEO, keep your meta title within ${rl} characters to prevent it from being cut off in search results.`,[ue]:`To ensure your meta description isn’t truncated in mobile search results, aim for ${sl} characters. This helps improve visibility and click-through rates.`};function To(e){const{title:t,description:n}=e;return A.jsx(r.Card,{paddingBlock:8,paddingInline:8,variant:"highlighted",children:A.jsxs(r.CardContent,{gap:4,children:[A.jsx(r.Text,{color:"indigo11",variant:"h4",noSelect:!0,children:Ae.overflow(t,He.max)}),A.jsx(r.Text,{color:"green11",noSelect:!0,children:"https://www.yourdomain.com/"}),A.jsx(r.Text,{variant:"small",color:"grey11",noSelect:!0,children:Ae.overflow(n,_e.max)})]})})}const wo=f.createContext({editedUID:{current:!1},onEditUID:()=>{}});function Lo(e){return Object.values(e.json).some(t=>{var n;return((n=t.uid)==null?void 0:n.type)==="UID"})}function ll(e){const{content:t,customType:n}=e;return Lo(n)&&!t.uid}function vo(e){const{documentId:t,documentsWithUid:n,uid:o}=e;return n.filter(i=>t!==i.id&&dl({document:i,uid:o})&&cl({...e,document:i}))}function cl(e){const{customTypeId:t,languageId:n,document:o}=e,i=t===o.custom_type_id,s=n===o.language.id;return i&&s}function dl(e){const{document:t,uid:n}=e,o=t.versions.filter(i=>i.uid===n);return o.length===0?!0:o.some(i=>i.status!=="archived")}const Be=f.createContext(void 0);function ul(e){const{customTypeFormat:t,children:n}=e,o=f.useMemo(()=>({customTypeFormat:t,isInSlice:!1,isInGroup:!1,isInRepeatable:!1}),[t]);return A.jsx(Be.Provider,{value:o,children:n})}function gl(e){const{children:t}=e,n=f.useContext(Be),o=f.useMemo(()=>n&&{...n,isInSlice:!0},[n]);return A.jsx(Be.Provider,{value:o,children:t})}function hl(e){const{children:t}=e,n=f.useContext(Be),o=f.useMemo(()=>n&&{...n,isInGroup:!0},[n]);return A.jsx(Be.Provider,{value:o,children:t})}function pl(e){const{children:t}=e,n=f.useContext(Be),o=f.useMemo(()=>n&&{...n,isInRepeatable:!0},[n]);return A.jsx(Be.Provider,{value:o,children:t})}function ml(){return f.useContext(Be)}function Tt(e,t){return`${e}___${t}`}const ko=f.createContext({ids:[],isSelected:()=>!1,update:()=>{}});function wt(){return f.useContext(ko)}function Z(e){var t;return(t=e.config)!=null&&t.label?e.config.label:e.type!=="Boolean"&&e.type!=="Separator"&&e.type!=="Table"&&e.fieldset?e.fieldset:e.type}const In="...";function fl(e,t,n=In){var o,i;return(t?(o=e.config)==null?void 0:o.placeholder_true:(i=e.config)==null?void 0:i.placeholder_false)||n}function De(e,t=In){var n;return((n=e.config)==null?void 0:n.placeholder)||t}function Cl(e){var l;const{content:t,field:n,id:o,readOnly:i,onContentChange:s}=e,a=(t==null?void 0:t.value)??((l=n.config)==null?void 0:l.default_value)??!1;return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"biToggle"}),A.jsx(r.FieldLabel,{htmlFor:o,children:Z(n)}),A.jsxs(r.FieldControl,{children:[A.jsx(r.Box,{padding:4,alignItems:"center",children:A.jsx(r.Text,{children:fl(n,a)})}),A.jsx(r.Switch,{id:o,sx:{alignSelf:"center",marginLeft:"auto",marginRight:12},checked:a,onCheckedChange:d=>{i||s(xl(d))}})]})]})}function xl(e){return{__TYPE__:"BooleanContent",value:e}}function yl(e){const{id:t,field:n,content:o,onContentChange:i}=e;return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"colorLens"}),A.jsx(r.FieldLabel,{id:t,children:Z(n)}),A.jsx(r.FieldControl,{children:A.jsx(r.Box,{padding:{left:4},alignItems:"center",children:A.jsx(r.ColorInput,{onValueChange:s=>i(Bl(s)),value:o==null?void 0:o.value,"aria-labelledby":t,placeholder:De(n)})})})]})}function Bl(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Color",value:e}}function Il(e){const{id:t,readOnly:n,field:o,content:i,onContentChange:s}=e,a=i!=null&&i.value?cn.dateFromISOString(i.value):void 0;return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"dateRange"}),A.jsx(r.FieldLabel,{id:t,children:Z(o)}),A.jsx(r.FieldControl,{children:A.jsx(r.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:A.jsx(r.DateInput,{mode:"date","aria-labelledby":t,disabled:n,value:a,onValueChange:l=>s(jl(l))})})})]})}function jl(e){if(e)return{__TYPE__:"FieldContent",type:"Date",value:Fl(e)}}function Fl(e){const t=`${e.getFullYear()}`.padStart(4,"0"),n=`${e.getMonth()+1}`.padStart(2,"0"),o=`${e.getDate()}`.padStart(2,"0");return`${t}-${n}-${o}`}const Fe=f.forwardRef(function(t,n){const{padding:o=Eo,...i}=t;return A.jsx(r.TextInput,{...i,padding:o,ref:n,sx:{...t.sx,alignSelf:"stretch"}})}),Eo={input:{inline:4},adornment:{inline:12}},Sl=({provider:e})=>bl[e.toLowerCase()]??A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("g",{clipPath:"url(#clip0_6524_22412)",children:A.jsx("path",{d:"M7.99992 1.33333C4.31992 1.33333 1.33325 4.32 1.33325 8C1.33325 11.68 4.31992 14.6667 7.99992 14.6667C11.6799 14.6667 14.6666 11.68 14.6666 8C14.6666 4.32 11.6799 1.33333 7.99992 1.33333ZM2.66659 8C2.66659 7.59333 2.71992 7.19333 2.80659 6.81333L5.99325 10V10.6667C5.99325 11.4 6.59325 12 7.32658 12V13.2867C4.70658 12.9533 2.66659 10.7133 2.66659 8ZM11.9266 11.6C11.7533 11.06 11.2599 10.6667 10.6599 10.6667H9.99325V8.66667C9.99325 8.3 9.69325 8 9.32658 8H5.32658V6.66667H6.65992C7.02658 6.66667 7.32658 6.36667 7.32658 6V4.66667H8.65992C9.39325 4.66667 9.99325 4.06667 9.99325 3.33333V3.06C11.9466 3.84667 13.3333 5.76667 13.3333 8C13.3333 9.38667 12.7933 10.6533 11.9266 11.6Z",fill:"#6F6E77"})}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_6524_22412",children:A.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),bl={codepen:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("g",{clipPath:"url(#clip0_6523_22409)",children:A.jsx("path",{d:"M15.9879 5.44292C15.9843 5.42352 15.981 5.40413 15.9759 5.38517C15.9726 5.37375 15.9688 5.36298 15.9651 5.35177C15.9597 5.33497 15.9541 5.31816 15.9474 5.30179C15.9427 5.29037 15.9373 5.27938 15.9321 5.26839C15.9248 5.25288 15.9173 5.23758 15.9086 5.22271C15.9026 5.21172 15.8957 5.20138 15.889 5.19082C15.8798 5.1766 15.8703 5.1626 15.8599 5.14902C15.8524 5.13889 15.8446 5.1292 15.8365 5.1195C15.8257 5.10657 15.8141 5.09429 15.8024 5.08223C15.7934 5.07318 15.7843 5.06413 15.7748 5.05529C15.7623 5.04387 15.7494 5.0331 15.7358 5.02276C15.7255 5.01479 15.7154 5.0066 15.7046 4.99927C15.7007 4.99647 15.6973 4.99324 15.6932 4.99065L8.38116 0.115543C8.15039 -0.0385144 7.84939 -0.0385144 7.61863 0.115543L0.306176 4.99044C0.302082 4.99302 0.29885 4.99626 0.294756 4.99906C0.283983 5.0066 0.273856 5.01457 0.263514 5.02254C0.250155 5.0331 0.237011 5.04387 0.224515 5.05486C0.215034 5.06348 0.205985 5.07253 0.19715 5.0818C0.185084 5.09386 0.17388 5.10614 0.162892 5.11907C0.154704 5.12877 0.146947 5.13846 0.139406 5.14924C0.129064 5.16281 0.119583 5.1766 0.110318 5.19104C0.103639 5.20159 0.0969593 5.21194 0.0907108 5.22293C0.0820922 5.23779 0.0745509 5.25309 0.0674405 5.26817C0.0622694 5.27916 0.0566673 5.29037 0.0521425 5.30157C0.0454631 5.31795 0.0396456 5.33475 0.0342589 5.35156C0.030596 5.36276 0.0267177 5.37375 0.0237011 5.38388C0.0187455 5.40284 0.0150825 5.42201 0.0116351 5.44162C0.00969592 5.45153 0.00732581 5.46123 0.00603302 5.47136C0.00215465 5.50109 0 5.53082 0 5.56121V10.4372C0 10.4673 0.00215465 10.4975 0.00646395 10.527C0.00797221 10.5378 0.0107733 10.5464 0.0129279 10.5568C0.0163753 10.5762 0.0193919 10.5955 0.0258558 10.6149C0.0288723 10.6257 0.0323198 10.6365 0.0366291 10.6483C0.0420157 10.6656 0.0474023 10.6828 0.0538662 10.6985C0.058391 10.7093 0.0646395 10.7201 0.0689488 10.7309C0.0760591 10.7459 0.0840314 10.761 0.09265 10.7768C0.098683 10.7875 0.105578 10.7983 0.112042 10.8082C0.121307 10.8233 0.131434 10.8362 0.142207 10.8491C0.149748 10.8599 0.157289 10.8685 0.165908 10.8789C0.176897 10.8918 0.187455 10.9047 0.200382 10.9162C0.209217 10.9248 0.21762 10.9355 0.228393 10.942C0.24089 10.9528 0.254249 10.9636 0.267177 10.9748C0.277519 10.9834 0.288723 10.9898 0.297342 10.9982C0.301436 11.0004 0.303806 11.0047 0.308115 11.0067L7.61863 15.8841C7.73412 15.9617 7.86641 16.0005 8 15.9998C8.13359 15.9992 8.26588 15.9611 8.38137 15.8841L15.6938 11.0092C15.6979 11.0067 15.7014 11.0036 15.7052 11.0008C15.716 10.9933 15.7261 10.9853 15.7365 10.9773C15.7498 10.9668 15.763 10.9558 15.7755 10.9446C15.785 10.9362 15.794 10.9269 15.8031 10.9179C15.8149 10.9058 15.8263 10.8935 15.8371 10.8806C15.8453 10.8709 15.8531 10.8612 15.8606 10.8509C15.8709 10.8373 15.8804 10.8233 15.8897 10.8091C15.8964 10.7987 15.903 10.7882 15.9093 10.7776C15.9179 10.7625 15.9254 10.7472 15.9328 10.7317C15.9379 10.7207 15.9433 10.7097 15.9481 10.6985C15.9548 10.6819 15.9604 10.6651 15.9657 10.6483C15.9694 10.6371 15.9733 10.6261 15.9765 10.6149C15.9815 10.596 15.9849 10.5766 15.9886 10.5572C15.9903 10.5473 15.9929 10.5376 15.994 10.5275C15.9978 10.4977 16 10.468 16 10.4376V5.5625C16 5.53212 15.9976 5.50238 15.994 5.47265C15.9922 5.46209 15.989 5.45347 15.9869 5.44292H15.9879ZM7.99978 9.62638L5.56826 8.00005L7.99978 6.37351L10.4315 8.00005L7.99978 9.62638ZM7.31245 5.17919L4.33171 7.17288L1.92561 5.56336L7.31245 1.97221V5.17919ZM3.09515 7.99984L1.37531 9.15021V6.84947L3.09515 7.99984ZM4.33171 8.82765L7.31245 10.8211V14.0281L1.92561 10.4365L4.33171 8.82722V8.82765ZM8.68733 10.8207L11.6681 8.82722L14.0744 10.4365L8.68733 14.0277V10.8207ZM12.9046 8.00027L14.6247 6.84969V9.15064L12.9046 7.99984V8.00027ZM11.6681 7.17288L8.68733 5.1794V1.97221L14.0744 5.56336L11.6681 7.17288Z",fill:"black"})}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_6523_22409",children:A.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),codesandbox:A.jsxs("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("g",{clipPath:"url(#clip0_6523_22406)",children:A.jsx("path",{d:"M6.24312 14.1129V8.35021L1.28724 5.49888V8.78388L3.55732 10.0999V12.5702L6.24312 14.1129ZM7.53036 14.1468L10.2658 12.571V10.0422L12.5506 8.71812V5.47426L7.53036 8.3727V14.1468ZM11.8904 4.36906L9.25164 2.83995L6.93472 4.18436L4.60022 2.8386L1.93795 4.38817L6.90626 7.24665L11.8904 4.36906ZM0 12.0115V4.02675L6.91821 0L13.8378 4.00984V11.9988L6.91805 15.985L0 12.0115Z",fill:"black"})}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_6523_22406",children:A.jsx("rect",{width:"13.8378",height:"16",fill:"white"})})})]}),dailymotion:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsxs("g",{clipPath:"url(#clip0_6523_22345)",children:[A.jsx("path",{d:"M16 0H0V16H16V0Z",fill:"white"}),A.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.73038 10.3003C8.40789 10.6268 8.00377 10.7901 7.51804 10.7901C7.04025 10.7901 6.64411 10.6308 6.32956 10.3122C6.01503 9.99367 5.85776 9.58351 5.85776 9.08176C5.85776 8.60389 6.01901 8.20766 6.3415 7.89306C6.66401 7.57847 7.06016 7.42118 7.52998 7.42118C7.84849 7.42118 8.13715 7.49484 8.39594 7.64219C8.65474 7.78953 8.8558 7.99063 8.99913 8.2455C9.14246 8.50034 9.21412 8.77908 9.21412 9.08176C9.21412 9.56757 9.05287 9.97376 8.73038 10.3003ZM9.10662 3.58632V6.35792C8.82791 6.07918 8.53131 5.87808 8.21678 5.75463C7.90223 5.63118 7.54988 5.56946 7.1597 5.56946C6.53062 5.56946 5.96527 5.72476 5.4636 6.03538C4.96193 6.34597 4.57176 6.77007 4.29305 7.30768C4.01435 7.84528 3.875 8.44062 3.875 9.09369C3.875 9.76269 4.01236 10.366 4.28708 10.9036C4.5618 11.4412 4.95197 11.8653 5.45763 12.1759C5.96328 12.4865 6.54258 12.6418 7.19553 12.6418C8.14312 12.6418 8.80403 12.3312 9.17831 11.71H9.20218V12.5595H11.0894V3.15625L9.10662 3.58632Z",fill:"#232323"})]}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_6523_22345",children:A.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),flickr:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{width:"16",height:"16",fill:"white"}),A.jsxs("g",{clipPath:"url(#clip0_6523_22379)",children:[A.jsx("path",{d:"M8.43286 7.78387C8.43286 9.321 9.67925 10.5674 11.2166 10.5674C12.7538 10.5674 13.9999 9.321 13.9999 7.78387C13.9999 6.24675 12.7538 5.00061 11.2166 5.00061C9.67925 5.00061 8.43286 6.24675 8.43286 7.78387Z",fill:"#FF0084"}),A.jsx("path",{d:"M2 7.78408C2 9.32121 3.24614 10.5676 4.78352 10.5676C6.32089 10.5676 7.56703 9.32121 7.56703 7.78408C7.56703 6.24695 6.32089 5.00081 4.78352 5.00081C3.24614 5.00081 2 6.24695 2 7.78408Z",fill:"#0063DC"})]}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_6523_22379",children:A.jsx("rect",{width:"12",height:"5.568",fill:"white",transform:"translate(2 5)"})})})]}),giphy:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{width:"16",height:"16",fill:"#121212"}),A.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3.38889V12.2778H5.11111V3.38889H4Z",fill:"#00FF99"}),A.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6663 5.61111V12.2778H11.7774V5.61111H10.6663Z",fill:"#9933FF"}),A.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.75 3H4V4.11111H8.83333V3H7.75Z",fill:"#FFF35C"}),A.jsx("path",{d:"M9.00041 4.11111H7.33374H8.83374V3.77778L9.00041 4.11111Z",fill:"#999999"}),A.jsx("path",{d:"M8.83374 4.11111H7.33374L8.44485 3L8.83374 3.77778V4.11111Z",fill:"#999237"}),A.jsx("path",{d:"M10.6663 7.44444V5.77778L11.7774 6.33333L10.6663 7.44444Z",fill:"#5C1F99"}),A.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6667 11.8889H4V13H11.7778V11.8889H10.6667Z",fill:"#00CCFF"}),A.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6668 5.22222V4.11111H9.55569V3H8.44458V3.90739V5.0185V6.33333H9.55569H10.6668H11.7779V5.22222H10.6668Z",fill:"#FF6666"})]}),instagram:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[A.jsxs("g",{clipPath:"url(#clip0_6523_22356)",children:[A.jsx("mask",{id:"mask0_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:A.jsx("path",{d:"M4.70325 0.0949238C3.85627 0.1349 3.27778 0.270564 2.77227 0.468642C2.24897 0.672648 1.80537 0.946046 1.36408 1.38914C0.922279 1.83249 0.650958 2.27688 0.448504 2.8007C0.252489 3.3075 0.119662 3.88627 0.0822604 4.73377C0.045126 5.58283 0.0366102 5.85363 0.0407495 8.01522C0.0448729 10.1765 0.0544124 10.4479 0.0949012 11.2972C0.135388 12.1439 0.270546 12.7222 0.468623 13.2279C0.672886 13.7512 0.946004 14.1946 1.38935 14.6361C1.83245 15.0777 2.27708 15.3487 2.80115 15.5515C3.30744 15.7472 3.88644 15.8806 4.73369 15.9177C5.58273 15.9551 5.85379 15.9634 8.01483 15.9592C10.1769 15.9551 10.448 15.9456 11.297 15.9053C12.144 15.8648 12.722 15.7292 13.228 15.5316C13.7513 15.3268 14.1949 15.0542 14.6362 14.6109C15.0775 14.1678 15.3488 13.7231 15.5512 13.199C15.7473 12.6927 15.8806 12.1137 15.9175 11.267C15.9546 10.4174 15.9634 10.1461 15.9593 7.98478C15.9551 5.8232 15.9453 5.55239 15.9051 4.7036C15.8649 3.85609 15.7292 3.27811 15.5314 2.77208C15.3269 2.24877 15.054 1.80567 14.6109 1.36387C14.1678 0.922574 13.7232 0.650729 13.1991 0.448785C12.6926 0.252768 12.1138 0.119166 11.2666 0.0825425C10.4175 0.0448876 10.1465 0.0366393 7.98465 0.0407642C5.82336 0.0448892 5.5523 0.0541772 4.70325 0.0949238ZM4.79611 14.485C4.02004 14.4512 3.59863 14.3222 3.31776 14.2142C2.94585 14.0703 2.68046 13.8977 2.40114 13.6205C2.12234 13.3422 1.94928 13.0776 1.80408 12.7064C1.69497 12.4255 1.5637 12.0046 1.52734 11.2286C1.48788 10.3896 1.47886 10.1378 1.47498 8.01237C1.47086 5.88742 1.47859 5.63569 1.51522 4.79593C1.54848 4.02038 1.67822 3.59843 1.78602 3.31782C1.92993 2.94539 2.10196 2.68051 2.37973 2.4012C2.65801 2.12187 2.92263 1.94933 3.29402 1.80412C3.57463 1.69451 3.99555 1.56426 4.77134 1.52738C5.61084 1.48766 5.8623 1.47915 7.98723 1.47502C10.1127 1.47089 10.3644 1.47838 11.2042 1.51526C11.9797 1.54904 12.4016 1.67749 12.682 1.78607C13.0541 1.92998 13.3195 2.1015 13.5986 2.37979C13.8777 2.65808 14.0507 2.92218 14.1959 3.29435C14.3055 3.57418 14.4358 3.99562 14.4724 4.77117C14.5124 5.61068 14.5214 5.8624 14.5253 7.98736C14.5294 10.1128 14.5217 10.3646 14.4848 11.2038C14.451 11.9799 14.3223 12.4016 14.214 12.6827C14.0701 13.0543 13.898 13.3197 13.62 13.5991C13.342 13.8773 13.0774 14.0509 12.7057 14.1961C12.4256 14.3055 12.0042 14.436 11.2289 14.4729C10.3894 14.5123 10.1379 14.5214 8.01225 14.5252C5.88732 14.5294 5.63586 14.5214 4.79611 14.485ZM11.2854 3.74493C11.2864 4.27211 11.7151 4.69896 12.2422 4.69792C12.7697 4.69689 13.1965 4.2685 13.1957 3.74132C13.1947 3.21414 12.7661 2.78704 12.2386 2.78807C11.7112 2.7891 11.2844 3.21775 11.2854 3.74493ZM3.91277 8.00773C3.91714 10.2653 5.75063 12.0913 8.0076 12.0869C10.2648 12.0825 12.0919 10.2495 12.0875 7.99201C12.0831 5.73526 10.2494 3.90819 7.99188 3.91257C5.73489 3.91696 3.90837 5.75073 3.91277 8.00773ZM5.34648 8.0049C5.3439 6.53969 6.52978 5.34942 7.99471 5.34683C9.45991 5.344 10.6504 6.52937 10.6533 7.99484C10.6561 9.46031 9.47022 10.6503 8.00477 10.6532C6.53984 10.656 5.34932 9.47037 5.34648 8.0049Z",fill:"white"})}),A.jsxs("g",{mask:"url(#mask0_6523_22356)",children:[A.jsx("mask",{id:"mask1_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:A.jsx("path",{d:"M16.5905 -0.583628H-0.603516V16.6106H16.5905V-0.583628Z",fill:"white"})}),A.jsxs("g",{mask:"url(#mask1_6523_22356)",children:[A.jsx("mask",{id:"mask2_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:A.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),A.jsxs("g",{mask:"url(#mask2_6523_22356)",children:[A.jsx("mask",{id:"mask3_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:A.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),A.jsx("g",{mask:"url(#mask3_6523_22356)",children:A.jsx("rect",{x:"-0.688721",y:"-0.665792",width:"17.3622",height:"17.3622",fill:"url(#pattern0)"})})]})]})]})]}),A.jsxs("defs",{children:[A.jsx("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:A.jsx("use",{xlinkHref:"#image0_6523_22356",transform:"scale(0.000439947)"})}),A.jsx("clipPath",{id:"clip0_6523_22356",children:A.jsx("rect",{width:"16",height:"16",fill:"white"})}),A.jsx("image",{id:"image0_6523_22356",width:"2273",height:"2275",xlinkHref:"data:image/jpeg;base64,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Hbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfw5h277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3XY/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26j+GHbqP4Yduo38MO3Ub+GHbqP4Yduo/hh26j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmNh25jYduY2HbmNh25jYduY2HbmNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh0+Nh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jhz+j7fweHn/AFd+fp9v6v8Ape79DDf1JLc930/LnmGfj9H0+v7/APAf6c32/wAQ/wCR+n/5f9383/iNaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca0415xrzjXnGvONeca8415xrzjXnGvONeca8415xrzjXnGvONeca8415xrzjXnGvONeYa8w15hrzDXmGvMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMNeYa8w15hrzDXnGvONeca8415xrzjXnGvONeca041pxrTjWnGtONaca041pxrTjWnGtONacas41ZxqzjVnGrONWcas41ZxqzjVnGrONScak41JxqTjUUGooNRQaig1FBqKDTUGmoNNQaag01BpqDTUGmoNNQaag0lBpKDSUGkoNJQaSg0lBpKDSUGioNFQaKg0VBoqDRVGiqNFUaKo0FRoKjQVGgqNBUaCo0FRoKjQVGgqPXqj16o9eqPXqj16o9eqPXqj16o9eqPXqj1yo9cqPXKj1yo9cqPXLD1yw9csPXLD1yw9csPWrD1qw9asPWrD1qw9asPWrD1qw9asPWrD1qw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1aw9WsPVrD1aw9WsPVrD1aw9WsPVrD1aw9WsPVrB34/8Ay/z/AH/53yHY/wDU/E/0v+P7/wCz/9k="})]})]}),pinterest:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsxs("g",{clipPath:"url(#clip0_6570_25513)",children:[A.jsx("rect",{width:"15.996",height:"16",rx:"2",fill:"#CC2127"}),A.jsx("path",{d:"M7.999 2C4.68555 2 2 4.68555 2 7.999C2 10.5406 3.58174 12.7102 5.81336 13.5861C5.76137 13.1121 5.71338 12.3843 5.83336 11.8644C5.94134 11.3964 6.53724 8.88285 6.53724 8.88285C6.53724 8.88285 6.35727 8.52291 6.35727 7.993C6.35727 7.15914 6.84119 6.53524 7.44309 6.53524C7.95501 6.53524 8.20297 6.91918 8.20297 7.3811C8.20297 7.89502 7.87502 8.66489 7.70705 9.37877C7.56507 9.97667 8.007 10.4626 8.5949 10.4626C9.66072 10.4626 10.4806 9.33878 10.4806 7.71505C10.4806 6.27929 9.44876 5.27345 7.975 5.27345C6.26729 5.27345 5.26546 6.55324 5.26546 7.87702C5.26546 8.39293 5.46342 8.94484 5.71138 9.24679C5.75937 9.30678 5.76737 9.35877 5.75337 9.41876C5.70738 9.60873 5.6074 10.0167 5.5874 10.0987C5.56141 10.2086 5.50142 10.2326 5.38743 10.1786C4.63756 9.83069 4.16964 8.73488 4.16964 7.85502C4.16964 5.96334 5.54541 4.22563 8.13298 4.22563C10.2146 4.22563 11.8304 5.70938 11.8304 7.69105C11.8304 9.75871 10.5266 11.4224 8.71688 11.4224C8.10898 11.4224 7.53708 11.1065 7.34111 10.7345C7.34111 10.7345 7.04116 11.8804 6.96717 12.1603C6.83119 12.6822 6.46526 13.3341 6.2213 13.732C6.7832 13.906 7.3791 14 7.997 14C11.3104 14 13.996 11.3144 13.996 8.001C13.998 4.68555 11.3124 2 7.999 2Z",fill:"white"})]}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_6570_25513",children:A.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),spotify:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("g",{clipPath:"url(#clip0_6523_22402)",children:A.jsx("path",{d:"M12.6609 7.10585C10.121 5.59751 5.93158 5.45882 3.50697 6.1947C3.11759 6.31287 2.70584 6.09298 2.5879 5.70373C2.46988 5.31411 2.68945 4.90265 3.07911 4.78429C5.86241 3.93945 10.4892 4.1026 13.4132 5.83828C13.7634 6.04622 13.8782 6.49851 13.6707 6.84813C13.4629 7.19833 13.0103 7.31376 12.6609 7.10585ZM12.5777 9.33993C12.3995 9.62908 12.0215 9.71979 11.7327 9.54223C9.61522 8.24063 6.38637 7.86357 3.88123 8.624C3.55636 8.72218 3.21323 8.53899 3.11455 8.21475C3.01666 7.88989 3.19992 7.54738 3.5242 7.44859C6.38597 6.58018 9.9436 7.00081 12.3756 8.49536C12.6644 8.67322 12.7553 9.05146 12.5777 9.33993ZM11.6136 11.4855C11.472 11.7177 11.1697 11.7904 10.9383 11.6489C9.08801 10.518 6.75909 10.2627 4.01637 10.8891C3.75207 10.9497 3.48866 10.7841 3.42838 10.5198C3.36785 10.2556 3.53284 9.99217 3.79772 9.93186C6.79916 9.2457 9.37381 9.54101 11.4506 10.8101C11.6822 10.9515 11.7551 11.254 11.6136 11.4855ZM8.00002 0.120623C3.64839 0.120623 0.120605 3.64834 0.120605 7.99989C0.120605 12.352 3.64839 15.8794 8.00002 15.8794C12.3517 15.8794 15.8794 12.352 15.8794 7.99989C15.8794 3.64834 12.3517 0.120623 8.00002 0.120623Z",fill:"#1ED760"})}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_6523_22402",children:A.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),twitter:A.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("path",{d:"M14.3193 4.31285C14.329 4.45301 14.329 4.59317 14.329 4.73462C14.329 9.04475 11.0516 14.0156 5.05865 14.0156V14.0131C3.28832 14.0156 1.55478 13.508 0.0644531 12.5507C0.321873 12.5817 0.580582 12.5972 0.839937 12.5979C2.30703 12.5992 3.7322 12.1063 4.88639 11.1988C3.4922 11.1724 2.26961 10.2623 1.84252 8.93366C2.3309 9.02796 2.83413 9.00858 3.31349 8.87746C1.79349 8.57001 0.699937 7.23299 0.699937 5.68023C0.699937 5.66602 0.699937 5.65246 0.699937 5.63889C1.15284 5.89144 1.65994 6.0316 2.17865 6.0471C0.747034 5.08923 0.305743 3.18251 1.17026 1.69176C2.82445 3.7296 5.2651 4.96844 7.8851 5.09956C7.62252 3.96664 7.98123 2.77947 8.82768 1.98307C10.1399 0.748096 12.2038 0.811395 13.4374 2.12452C14.167 1.98048 14.8664 1.71243 15.5064 1.33264C15.2632 2.0877 14.7541 2.72909 14.0741 3.13665C14.7199 3.06044 15.3509 2.88734 15.9451 2.62316C15.5077 3.2794 14.9567 3.85103 14.3193 4.31285Z",fill:"#1D9BF0"})}),vimeo:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsxs("g",{clipPath:"url(#clip0_6523_22340)",children:[A.jsx("path",{d:"M16 14.4C16 15.28 15.28 16 14.4 16H1.6C0.72 16 0 15.28 0 14.4V1.6C0 0.72 0.72 0 1.6 0H14.4C15.28 0 16 0.72 16 1.6V14.4Z",fill:"#1AB7EA"}),A.jsx("path",{d:"M13.9945 5.3084C13.9391 6.42815 13.1229 7.97447 11.5458 9.93402C9.91331 11.9736 8.52987 13 7.40928 13C6.70372 13 6.12267 12.3735 5.63846 11.1338C5.32027 9.98735 4.98824 8.85427 4.67005 7.70786C4.31036 6.46814 3.92299 5.84161 3.50796 5.84161C3.42495 5.84161 3.10676 6.02824 2.56721 6.38816L2 5.68165C2.59488 5.1751 3.17593 4.68187 3.75698 4.17532C4.54554 3.52214 5.14042 3.17555 5.54162 3.13556C6.46853 3.05557 7.04958 3.66877 7.27093 4.97514C7.50612 6.40149 7.67213 7.28129 7.75514 7.62788C8.01799 8.80095 8.32235 9.40081 8.64054 9.40081C8.88956 9.40081 9.26309 9.01423 9.77497 8.2544C10.273 7.49457 10.5497 6.90804 10.5774 6.50813C10.6465 5.85494 10.3837 5.52169 9.77497 5.52169C9.48444 5.52169 9.19392 5.58834 8.88956 5.70831C9.48444 3.84206 10.605 2.94893 12.2652 3.00225C13.4826 3.02891 14.0637 3.80207 13.9945 5.3084Z",fill:"white"})]}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_6523_22340",children:A.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),youtube:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("path",{d:"M15.6656 3.75817C15.4816 3.06609 14.9395 2.5211 14.2511 2.33614C13.0034 2 8 2 8 2C8 2 2.99666 2 1.7489 2.33614C1.06051 2.5211 0.518324 3.06609 0.334339 3.75817C0 5.01251 0 7.62963 0 7.62963C0 7.62963 0 10.2467 0.334339 11.5012C0.518324 12.1932 1.06051 12.7381 1.7489 12.9232C2.99666 13.2593 8 13.2593 8 13.2593C8 13.2593 13.0034 13.2593 14.2511 12.9232C14.9395 12.7381 15.4816 12.1932 15.6656 11.5012C16 10.2467 16 7.62963 16 7.62963C16 7.62963 16 5.01251 15.6656 3.75817Z",fill:"#ED1D24"}),A.jsx("path",{d:"M6.36353 10.0058L10.5453 7.62974L6.36353 5.25349V10.0058Z",fill:"white"})]})};function Do(e){const{debouncedUrl:t,content:n,onContentChange:o,selected:i}=e,s=f.useRef(null),[a,l]=f.useState(!1);E.useOnChange(t,()=>{var c;a&&(l(!1),(c=s.current)==null||c.reset())});function d(){l(!0),o(void 0)}return te.toURL(t)?t===(n==null?void 0:n.embed_url)?A.jsx(zt,{content:n,selected:i}):A.jsx(r.ErrorBoundary,{ref:s,renderError:Kl,onError:d,children:A.jsx(f.Suspense,{fallback:n&&A.jsx(zt,{content:n,selected:i}),children:A.jsx(Ul,{url:t,selected:i,onContentChange:o})})}):null}function Kl(){return A.jsxs(r.Box,{backgroundColor:"grey2",borderRadius:6,padding:16,gap:4,children:[A.jsx(r.Icon,{name:"alert",size:"small",color:"grey11"}),A.jsx(r.Text,{variant:"smallBold",color:"grey11",children:"There is no embed data available."})]})}function zt(e){const{content:t,selected:n}=e,{thumbnail:o,provider:i,author:s,url:a,subtitle:l}=vl(t);return A.jsxs(r.PreviewCard,{selected:n,children:[A.jsx(r.PreviewImage,{src:o.url,aspectRatio:o.aspectRatio}),A.jsxs(r.PreviewContent,{children:[A.jsxs(r.Box,{display:"flex",alignItems:"center",gap:4,children:[A.jsx(Sl,{provider:i}),A.jsx(r.Text,{variant:"smallBold",color:"grey12",noWrap:!0,children:i}),s&&A.jsx(r.Text,{variant:"small",color:"grey11",noWrap:!0,children:s})]}),A.jsx(r.Text,{variant:"smallBold",href:a,children:l})]})]})}function Ul(e){const{url:t,onContentChange:n,selected:o}=e,i=Tl({url:t,onContentChange:n});return A.jsx(zt,{content:i,selected:o})}function Tl(e){const{url:t,onContentChange:n}=e,{embedApiEndpoint:o}=L(),i=R.useRequest(wl,[t,o]),s=E.useStableCallback(n);return f.useEffect(()=>{const a=r.handleEditorFlushSyncError(()=>s(i));return()=>{clearTimeout(a)}},[i,s]),i}function wl(e,t){const n=new URL(t);return n.searchParams.set("url",e),U.request(n,{okType:Ll(e)})}function Ll(e){return p.z.object({type:p.z.string(),version:p.z.string().or(p.z.number()).nullish(),title:p.z.string().nullish(),author_name:p.z.string().nullish(),author_url:p.z.string().nullish(),provider_name:p.z.string().nullish(),provider_url:p.z.string().nullish(),cache_age:p.z.string().or(p.z.number()).nullish(),thumbnail_url:p.z.string().nullish(),thumbnail_width:p.z.number().nullish(),thumbnail_height:p.z.number().nullish(),html:p.z.string().nullish()}).passthrough().transform(t=>{const n={embed_url:e};return{...n,__TYPE__:"EmbedContent",type:t.type,version:t.version,title:t.title,author_name:t.author_name,author_url:t.author_url,provider_name:t.provider_name,provider_url:t.provider_url,cache_age:t.cache_age,thumbnail_url:t.thumbnail_url,thumbnail_width:t.thumbnail_width,thumbnail_height:t.thumbnail_height,html:t.html,all:{...n,...t}}})}function vl(e){let t="";switch(e.type){case"video":t=e.title??"";break;case"photo":t=`View this post${e.provider_name?` on ${e.provider_name}`:""}`;break;default:t=`Open${e.provider_name?` on ${e.provider_name}`:""}`}return{url:e.embed_url,thumbnail:{url:e.thumbnail_url??"",aspectRatio:e.type==="video"?"16:9":"1:1"},provider:e.provider_name??"",author:e.author_name??"",subtitle:t}}function kl(e){const{id:t,readOnly:n,field:o,content:i,onContentChange:s}=e,a=E.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:f.startTransition});function l(d){a.set(d),te.toURL(d)||s(void 0)}return A.jsxs(r.Field,{footer:te.toURL(a.value)&&A.jsx(r.FieldFooter,{children:A.jsx(Do,{debouncedUrl:a.debouncedValue,content:i,onContentChange:s})}),children:[A.jsx(r.FieldIcon,{name:"cloud"}),A.jsx(r.FieldLabel,{htmlFor:t,children:Z(o)}),A.jsx(r.FieldControl,{children:A.jsx(Fe,{id:t,readOnly:n,placeholder:De(o),value:a.value,onValueChange:l,variant:te.toURL(a.value)?"link":"normal",endAdornment:A.jsx(r.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:()=>l("")})})})]})}function Ro(e){return!(e.lat>85||e.lat<-85||e.lng>180||e.lng<-180)}function Qt(e){const t=/^.*@(-?\d+.\d+),(-?\d+.\d+).*$/,n=e.match(t);if(!n)return;const o=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(o)||isNaN(i))return;const s={lat:o,lng:i};if(Ro(s))return s}function Vn(e){return e?`${e.lat}, ${e.lng}`:""}function Yn(e){const t=/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/,n=e.match(t);if(!n)return Qt(e);const o=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(o)||isNaN(i))return Qt(e);const s={lat:o,lng:i};return Ro(s)?s:Qt(e)}function El(e){const{field:t,id:n,readOnly:o,...i}=e,{onValueChange:s,displayedValue:a,onBlur:l,clearValue:d,isValidCoordinates:c}=Dl(i);return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"place"}),A.jsx(r.FieldLabel,{htmlFor:n,children:Z(t)}),A.jsx(r.FieldControl,{children:A.jsx(Fe,{id:n,onValueChange:s,placeholder:In,readOnly:o,value:a,onBlur:l,variant:c?"link":"normal",endAdornment:A.jsx(r.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:d})})})]})}function Dl(e){const{content:t,onContentChange:n}=e,o=Vn(t==null?void 0:t.position),[i,s]=f.useState(o);function a(){const c=Yn(i);if(!c)return s(""),n(void 0);const{lat:u,lng:h}=c;s(Vn({lat:u,lng:h})),n({__TYPE__:"GeoPointContent",position:{lat:u,lng:h}})}function l(){s(""),n(void 0)}const d=!!Yn(i);return{displayedValue:i,isValidCoordinates:d,onValueChange:s,onBlur:a,clearValue:l}}function Qo(e){const{fieldLabel:t,imageLabel:n=[]}=e;return A.jsxs(r.CardHeaderTitle,{children:[A.jsx(r.Text,{variant:"bold",noWrap:!0,children:Ae.overflow(t,30)}),n.length!==0&&A.jsx(r.Text,{color:"grey11",noSelect:!0,children:` • ${n.join(" • ")}`})]})}function Mo(e){const{fieldLabel:t,isUpdating:n,readOnly:o,onMediaDialogOpenChange:i}=e;return A.jsxs(A.Fragment,{children:[A.jsx(r.CardHeader,{sx:{flexWrap:"wrap"},children:A.jsx(Qo,{fieldLabel:t})}),A.jsx(r.CardContent,{children:A.jsx(r.Card,{color:"grey2",variant:"dashed",paddingBlock:12,radius:4,sx:{width:"100%"},children:A.jsx(r.CardContent,{children:A.jsxs(r.BlankSlate,{variant:"horizontal",children:[A.jsx(r.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple9",backgroundColor:"purple4",size:"small"}),A.jsx(r.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!o&&A.jsx(r.BlankSlateActions,{children:A.jsx(r.Button,{disabled:n,onClick:()=>i(!0),size:"medium",children:"Select image"})})]})})})})]})}const Rl=p.object({id:p.string(),width:p.number(),height:p.number(),urls:p.object({full:p.string(),small:p.string().transform(ea)}),alt_description:p.string().optional(),description:p.string().nullable()}),Ql=p.object({results:p.array(Rl)}).transform(e=>e.results);function qo(e,t){const n=new URL("search/photos",e);return n.searchParams.set("page","1"),n.searchParams.set("per_page","28"),n.searchParams.set("query",t),U.request(n,{okType:Ql})}R.cache.registerFetcherConfig(qo,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function Ml(e,t){const n=f.useRef(),o=L(),i=R.useRequest(qo,[e,t]);return E.useDebounce(t,1e3,()=>{var s;n.current&&t!==n.current&&((s=o.onAnalyticsEvent)==null||s.call(o,"Unsplash Image Searched")),n.current=t}),i}function ql(e){const{onSelectedChange:t}=e,[n,o]=f.useTransition(),i=E.useDebounceState({initialState:"",ms:300,startTransition:o});return A.jsxs(r.Box,{flexDirection:"column",gap:16,width:"100%",position:"relative",children:[A.jsx(r.FormSearchInput,{value:i.value,placeholder:"Search on Unsplash.com",onValueChange:i.set}),A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(ho,{}),children:A.jsx(f.Suspense,{fallback:A.jsx(Ol,{}),children:A.jsx(Pl,{term:i.debouncedValue,loading:n,onSelectedChange:t})})})]})}function Pl(e){const{term:t,onSelectedChange:n,loading:o}=e,{media:i,toggleSelected:s,selectedImageId:a}=Vl({term:t,onSelectedChange:n});return A.jsxs(A.Fragment,{children:[i.length>0&&A.jsx(Po,{children:i==null?void 0:i.map(l=>{const c=new URL(l.urls.full).searchParams.get("fm")??"jpg";return A.jsx(r.MediaCard,{url:l.urls.small,filename:l.description??"Unsplash Image",selected:a===l.id,onCardClick:()=>s(l),onCheckedChange:()=>s(l),extension:c,kind:"image",width:l.width,height:l.height,loading:o},l.id)})}),i.length===0&&A.jsx(uo,{})]})}function Po(e){const{children:t}=e;return A.jsx(r.ScrollArea,{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,padding:2,paddingBottom:16,position:"relative",width:"100%"},children:t})}function Ol(){return A.jsx(Po,{children:O.range(1,24).map(e=>A.jsx(yo,{},e))})}function Vl(e){var c;const{term:t,onSelectedChange:n}=e,{unsplashApiBaseUrl:o}=L(),i=Ml(o,t||"citrus fruit"),s=(c=i==null?void 0:i[0])==null?void 0:c.id,[a,l]=f.useState();f.useEffect(()=>{n==null||n([]),l(void 0)},[s,n]);function d(u){if(u.id===a)return l(void 0),n==null?void 0:n([]);l(u.id),n==null||n([{...u,url:u.urls.full,alt:u.alt_description}])}return{media:i,toggleSelected:d,selectedImageId:a}}function jn(e){const{open:t,onOpenChange:n,onMediaSelected:o,assetType:i}=e,s=L(),a=s.mediaLibrary,[l,d]=f.useState(()=>a?"media":"unsplash"),[c,u]=f.useState(new Set),[h,g]=f.useState([]),m=c.size+h.length,C=R.useFetcherData(ie);f.useEffect(()=>{!t||!a||Ao({config:s,assetType:i})},[t,s,i,a]);function y(b){if(b!=="media"&&b!=="unsplash")throw new Error(`Invalid option ${b}.`);d(b)}function x(b){b||u(new Set),n(b)}const I=ys({assetType:i,mediaDialogOpen:t});function B(){var b;switch(l){case"unsplash":{const v=h[0];if(!v)return;o(v),(b=s.onAnalyticsEvent)==null||b.call(s,"Unsplash Image Added");break}case"media":{const T=C.flatMap(k=>k.items).filter(k=>c.has(k.id))[0];if(!T)return;o(T),I(T.id);break}}}function j(){if(m===0)return"Select a media item to add to the page";if(m>1)return"Only one media item can be added to the page"}const{containerRef:S}=r.useAlert();return A.jsxs(r.Dialog,{open:t,onOpenChange:x,size:{width:"min(calc(100% - 48px), 2000px)",height:"calc(100% - 30px)"},position:"center",onPointerDownOutside:b=>{S&&E.refContainsTarget(S,b.target)&&b.preventDefault()},children:[A.jsx(r.DialogHeader,{icon:"image",title:"Media library"}),A.jsx(r.DialogDescription,{hidden:!0,children:"Select a media item to add to the page"}),A.jsxs(r.DialogOptions,{value:l,onValueChange:y,padding:"small",width:"auto",children:[a&&A.jsx(r.DialogOptionsItem,{value:"media",icon:"photo"}),A.jsx(r.DialogOptionsItem,{value:"unsplash",icon:"unsplash"})]}),A.jsx(r.DialogContent,{children:A.jsx(r.Box,{flexDirection:"column",flexGrow:1,overflow:"hidden",children:A.jsxs(r.Box,{overflow:"hidden",backgroundColor:"grey2",padding:{top:16,inline:16},flexGrow:1,children:[l==="media"&&A.jsx(Ko,{assetType:i,onSelectedChange:u}),l==="unsplash"&&A.jsx(ql,{onSelectedChange:g})]})})}),A.jsxs(r.DialogActions,{children:[A.jsx(r.DialogCancelButton,{}),A.jsx(r.DialogActionButton,{onClick:B,disabled:m!==1,tooltipLabel:j(),children:"Add to page"})]})]})}const Oo=f.forwardRef(function(t,n){const{isMediaDialogOpen:o,selected:i,children:s,onMediaSelected:a,onMediaDialogOpenChange:l}=t;function d(c){a(c),l(!1)}return A.jsxs(r.Card,{ref:n,color:i?"indigo2":"grey2",variant:i?"selected":"dashed",paddingBlock:12,radius:4,children:[s,A.jsx(jn,{open:o,onOpenChange:l,onMediaSelected:d,assetType:"image"})]})});function Vo(e){const{uploadImage:t,children:n,isUploading:o,disabled:i}=e;if(i)return A.jsx(A.Fragment,{children:n});function s(a){if(o)return;const l=a[0];l&&t(l)}return A.jsx(r.FileDropZone,{assetType:"image",maxFiles:1,onFilesSelected:s,overlay:A.jsx(Yl,{isUploading:o}),children:n})}function Yl(e){const{isUploading:t}=e,n=t?"You can't upload while the upload is ongoing":"Drop image to instantly upload";return A.jsx(r.Box,{justifyContent:"center",flexDirection:"column",height:"100%",padding:8,children:A.jsxs(r.BlankSlate,{children:[A.jsx(r.BlankSlateIcon,{name:t?"block":"cloudUpload",lineColor:t?"tomato11":"purple10",backgroundColor:t?"tomato2":"purple3",borderColor:t?"tomato6":"purple6",borderStyle:"dashed",size:"small"}),A.jsx(r.BlankSlateTitle,{size:"regular",children:n})]})})}function Yo(e){const{contentView:t,croppedImage:n}=e,{width:o,height:i,x:s,y:a,zoom:l}=n,d=Hl({origin:t.origin,croppedImage:n});return{...t,width:o,height:i,url:d,edit:{...t.edit,zoom:l,crop:{x:s,y:a}}}}function Wl(e){var c,u,h;const{field:t,content:n,thumbnail:o,croppedImage:i}=e;if(o===Ze)return Wo({content:n,croppedImage:i});const s=K.isImageContent(n),a=(u=(c=t==null?void 0:t.config)==null?void 0:c.thumbnails)==null?void 0:u.find(g=>g.name===o),l=s?(h=n.thumbnails)==null?void 0:h[o]:void 0;if(!a||!l)return n;const d=Yo({contentView:l,croppedImage:i});return d.url===l.url?n:{...n,thumbnails:s?{...n.thumbnails,[o]:d}:void 0}}function Wo(e){const{content:t,croppedImage:n}=e,o=Yo({contentView:t,croppedImage:n});return o.url===t.url?t:{...t,...o}}function Hl(e){const{origin:t,croppedImage:n}=e,{x:o,y:i,width:s,height:a,cropHeight:l,cropWidth:d}=n,c=new URL(t.url),u=t.height!==a||t.width!==s;if(o!==0||i!==0||l!==t.height||d!==t.width){const g=[o,i,d,l].map(Math.round).join(",");c.searchParams.set("rect",g),c.searchParams.set("w",s.toString()),c.searchParams.set("h",a.toString())}return u&&(c.searchParams.set("w",s.toString()),c.searchParams.set("h",a.toString())),c.toString()}function _l(e){const{edit:{crop:{x:t,y:n},zoom:o},width:i,height:s,origin:{width:a,height:l}}=e;let d,c;const u=a/l,h=i/s;return h>=u?(d=a/o,c=d/h):(c=l/o,d=c*h),{x:t,y:n,width:i,height:s,zoom:o,cropWidth:d,cropHeight:c}}function zl(e){const{selectedImage:t,imageCrop:n,setImageCrop:o}=e,{width:i,height:s,zoom:a,cropHeight:l,cropWidth:d}=n,c=t.contentView,u={x:n.x,y:n.y,width:d,height:l},[h,g]=f.useState(),m=(c==null?void 0:c.origin.url)??"",C=!(t!=null&&t.thumbnail.height&&(t!=null&&t.thumbnail.width));function y(S,b){const v=parseInt(b);isNaN(v)||v<=0||!C||o({...n,[S]:v})}function x(S){o({...n,cropWidth:S.width,cropHeight:S.height,x:S.x,y:S.y})}function I(S){o({...n,zoom:S})}function B(){g(at),o({...n,...at})}function j(){c&&(g(at),o({...n,...at,zoom:1,cropWidth:c.width,cropHeight:c.height}))}return A.jsxs(r.Box,{padding:{inline:24,block:16},flexDirection:"column",gap:16,height:"100%",overflowY:"auto",alignItems:"center",children:[A.jsxs(r.Box,{gap:8,height:32,alignItems:"flex-start",width:"100%",children:[A.jsx(r.Tooltip,{content:"Center",children:A.jsx(r.Button,{color:"grey",size:"medium",startIcon:"centerFocusWeak",onClick:B})}),A.jsx(r.Tooltip,{content:"Cover",children:A.jsx(r.Button,{color:"grey",size:"medium",startIcon:"zoomOutMap",onClick:j})}),A.jsx(r.Separator,{orientation:"vertical"}),A.jsx(r.FormInput,{prefix:"W",prefixTooltip:"Width",placeholder:"width",type:"number",size:"medium",value:String(i),onValueChange:S=>y("width",S),sx:{width:100},disabled:!C}),A.jsx(r.FormInput,{prefix:"H",prefixTooltip:"Height",placeholder:"height",type:"number",size:"medium",value:String(s),onValueChange:S=>y("height",S),sx:{width:100},disabled:!C})]}),A.jsx(r.Cropper,{image:m,aspect:i/s,crop:h??{x:0,y:0},onCropChange:g,zoom:a,onZoomChange:I,onCropAreaChange:(S,b)=>x(b),initialCroppedAreaPixels:u}),A.jsx(r.Box,{width:"100%",maxWidth:320,children:A.jsx(r.Slider,{min:1,max:3,step:.01,value:[a],onValueChange:([S])=>I(S??1)})})]})}const at={x:0,y:0};function Nl(e){const{trigger:t,initialImages:n,renderTooltip:o}=e,{open:i,onOpenChange:s,ready:a,option:l,selectedImage:d,croppedImage:c,setCroppedImage:u,setReady:h,setOption:g}=Gl(e);return A.jsxs(r.Dialog,{trigger:t,onAnimationEnd:()=>h(!0),open:i,onOpenChange:s,renderTooltip:o,children:[A.jsx(r.DialogHeader,{icon:"photo",title:"Image editor"}),A.jsx(r.DialogDescription,{hidden:!0,children:"Crop your image to the desired size."}),A.jsx(r.DialogOptions,{value:String(l),onValueChange:m=>g(Number(m)),children:n.map((m,C)=>A.jsx(r.DialogOptionsItem,{value:String(C),icon:"photo",title:m.labels[0]??"Main",subtitle:m.labels[1]??""},m.thumbnail.name))}),d&&A.jsx(r.DialogContent,{children:a&&c&&A.jsx(zl,{selectedImage:d,imageCrop:c,setImageCrop:u},d.thumbnail.name)})]})}function Gl(e){const{initialImages:t,initialOption:n,onClose:o}=e,[i,s]=f.useState(x),[a,l]=f.useState(!1),[d,c]=f.useState(!1),[u,h]=f.useState(n);function g(I){I?(h(n),s(x())):(c(!1),o({option:u,croppedImages:i})),l(I)}const m=t[u],C=i[(m==null?void 0:m.thumbnail.name)??""];function y(I){if(!m)return;const B=m.thumbnail.name;s({...i,[B]:I})}function x(){return t.reduce((I,B)=>(B.contentView&&(I[B.thumbnail.name]=_l(B.contentView)),I),{})}return{open:a,ready:d,option:u,selectedImage:m,croppedImage:C,setCroppedImage:y,setReady:c,setOption:h,onClose:o,onOpenChange:g}}function Zl(e){const{readOnly:t,altText:n,selected:o,onValueChange:i}=e,s=f.useId();return A.jsxs(r.Field,{selected:o,children:[A.jsx(r.FieldLabel,{htmlFor:s,children:"Alt text"}),A.jsx(r.FieldControl,{children:A.jsx(r.Box,{flexGrow:1,height:40,children:A.jsx(Fe,{id:s,placeholder:"Short description for the visually impaired",readOnly:t,value:n,padding:{input:{inline:12}},onValueChange:i})})})]})}function Jl(e){const{fieldLabel:t,imageLabel:n,initialImages:o,page:i,displaySeparator:s=!0,isSVGContentView:a,visibility:l,onClear:d,onCropperDialogClose:c,onMediaDialogOpenChange:u}=e;return A.jsxs(r.Box,{display:"flex",flexDirection:"column",gap:12,children:[A.jsxs(r.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:4,children:[A.jsx(Qo,{fieldLabel:t,imageLabel:n}),A.jsxs(r.CardHeaderActions,{sx:{visibility:l},children:[A.jsx(Nl,{trigger:A.jsx(r.Button,{startIcon:"crop",disabled:a,hiddenLabel:"Crop & Resize"}),renderTooltip:h=>A.jsx(r.Tooltip,{content:"Crop & Resize",children:h}),initialImages:o,initialOption:i,onClose:c}),A.jsx(r.Tooltip,{content:"Replace",children:A.jsx(r.Button,{startIcon:"imageSearch",hiddenLabel:"Replace",onClick:()=>u(!0)})}),A.jsx(r.Tooltip,{content:"Clear",children:A.jsx(r.Button,{onClick:d,startIcon:"delete",hiddenLabel:"Clear"})})]})]}),s&&A.jsx(r.Separator,{style:"dashed",decorative:!0})]})}function ve(e){const{description:t,largeIconName:n="public",loading:o,error:i,onEdit:s,onUnlink:a}=e,l=i?A.jsx(nc,{}):A.jsx(tc,{...e,largeIconName:n,loading:o});return A.jsx(r.Card,{sx:{width:420},children:A.jsxs(r.CardContent,{gap:12,children:[A.jsxs(r.Box,{display:"grid",gridTemplateColumns:"max-content 1fr min-content",gridTemplateRows:"1fr",gap:8,children:[l,A.jsxs(r.ButtonGroup,{size:"medium",color:"grey",sx:{justifySelf:"end"},children:[s&&A.jsx(r.Button,{startIcon:"edit",onClick:s}),a&&A.jsx(r.Button,{startIcon:"linkOff",onClick:a})]})]}),!i&&A.jsx(ec,{description:t,loading:o})]})})}function Xl(e){const{url:t,title:n,loading:o}=e;return o?A.jsx(Ho,{height:16,width:80}):n?A.jsx(r.Text,{variant:"smallBold",href:t==null?void 0:t.toString(),children:n}):null}function $l(e){const{subTitle:t,loading:n}=e;return n?A.jsx(r.Box,{padding:{block:2},children:A.jsx(Ho,{height:12,width:60})}):t?A.jsx(r.Text,{variant:"small",color:"grey11",noWrap:!0,children:t}):null}function ec(e){const{description:t,loading:n}=e;return!t||n?null:A.jsx(r.Text,{variant:"small",color:"grey11",children:t})}function tc(e){const{largeIconName:t,title:n,url:o,loading:i,subTitle:s}=e;return A.jsxs(A.Fragment,{children:[A.jsx(r.ConjoinedIcons,{largeIconName:t,smallIconName:"link"}),A.jsxs(r.Box,{flexDirection:"column",minWidth:0,children:[A.jsx(Xl,{title:n,url:o,loading:i}),A.jsx($l,{subTitle:s,loading:i})]})]})}function nc(){return A.jsxs(r.Box,{alignItems:"center",gap:8,children:[A.jsx(r.BackgroundIcon,{name:"alert",color:"tomato",size:"small"}),A.jsx(r.Text,{color:"tomato11",children:"Failed to load linked document data"})]})}function Ho(e){const{width:t,height:n}=e;return A.jsx(r.Skeleton,{color:"grey5",borderRadius:6,width:t,height:n})}function Wn(){const e=L();e.searchDocuments||V("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,o=R.useRequest(St,[t,n]);return new Set(o.languages.map(i=>({id:i.id,label:i.label})))}function Ac(){const e=L();e.searchDocuments||V("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,o=R.useRequest(qA,[t,n]);return new Set(o.results.map(i=>({id:i,label:i})))}function _o(){const e=L();e.searchDocuments||V("searchDocuments");const{customTypesApiBaseUrl:t,repository:n,authStrategy:o}=e,i=un({baseUrl:t,repository:n,authStrategy:o});return new Set(i.data)}function oc(e){const{documentTypeId:t,documentUrl:n,title:o,statusColor:i,description:s,tags:a,tagsFilter:l,previewImageUrl:d,highlighted:c,highlightedUID:u,searchTerm:h,onSelect:g}=e;function m(C){return C.nativeEvent instanceof MouseEvent&&(C.metaKey||C.ctrlKey)?window.open(n,"_blank"):g()}return A.jsxs(r.Card,{paddingBlock:16,onSelect:m,variant:c?"highlighted":void 0,color:c?"purple2":void 0,sx:{marginBlock:c?4:0,marginInline:4,flexShrink:0},children:[A.jsx(r.CardContent,{children:A.jsxs(r.Box,{justifyContent:"space-between",gap:6,children:[A.jsxs(r.Box,{flexDirection:"column",gap:4,alignItems:"flex-start",flexGrow:1,children:[A.jsx(ic,{documentTypeId:t}),A.jsx(sc,{title:o,statusColor:i,searchTerm:h}),u&&h&&A.jsx(dc,{uid:u,searchTerm:h}),A.jsx(ac,{description:s})]}),A.jsx(lc,{previewImageUrl:d})]})}),a.length>0&&A.jsx(cc,{tags:a,tagsFilter:l})]})}function ic(e){const{documentTypeId:t}=e;return A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(r.Badge,{maxWidth:150,size:"medium",title:"Type: error",icon:"description"}),children:A.jsx(f.Suspense,{fallback:A.jsx(r.Skeleton,{width:150,height:24}),children:A.jsx(rc,{documentTypeId:t})})})}function rc(e){const{documentTypeId:t}=e,o=[..._o()].find(i=>i.id===t);return A.jsx(r.Badge,{size:"medium",title:`Type: ${(o==null?void 0:o.label)??"Unknown"}`,icon:"description"})}function sc(e){const{title:t,statusColor:n,searchTerm:o}=e;return A.jsxs(r.Box,{gap:8,alignItems:"center",children:[A.jsx(r.Dot,{color:n}),A.jsx(zo,{text:t,highlight:o})]})}function ac(e){const{description:t}=e,n=t==null?void 0:t.substring(0,150);return n?A.jsx(r.Text,{variant:"small",color:"grey11",children:`${n}${n!==t?"...":""}`}):A.jsx(r.Text,{variant:"smallItalic",color:"grey11",children:"No description available"})}function lc(e){const{previewImageUrl:t}=e;return A.jsx(r.Box,{width:142,height:90,backgroundColor:"grey2",border:!0,borderRadius:6,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,flexShrink:0,padding:8,children:t?A.jsx(r.Image,{src:t,sizing:"cover"}):A.jsxs(A.Fragment,{children:[A.jsx(r.Icon,{name:"hideImage",size:"large",color:"grey11"}),A.jsx(r.Text,{color:"grey11",variant:"small",children:"No preview available"})]})})}function cc(e){const{tags:t}=e;return A.jsxs(r.CardFooter,{children:[A.jsxs(r.Box,{gap:4,alignItems:"center",children:[A.jsx(r.Icon,{name:"label",size:"small",color:"grey11"}),A.jsx(r.Text,{variant:"small",color:"grey11",children:"Tags:"})]}),A.jsx(r.TextOverflow,{children:t.map(n=>A.jsx(r.Badge,{size:"medium",title:n,sx:{marginRight:8}},n))})]})}function dc(e){const{uid:t,searchTerm:n}=e;return A.jsxs(r.Box,{alignItems:"flex-start",children:[A.jsx(r.Icon,{name:"tag",color:"green11",sx:{width:12,height:12}}),A.jsx(zo,{variant:"uid",highlight:n,text:t})]})}function zo(e){const{text:t,highlight:n,variant:o="title"}=e,i=uc[o],s=n?t.split(new RegExp(`(${Ae.escapeStringRegexp(n)})`,"gi")):[t];return A.jsx(r.Text,{variant:i.textVariants.text,color:i.colors.text,hyphens:!0,overflowWrap:"anywhere",children:s.map((a,l)=>a.toLowerCase()===(n==null?void 0:n.toLowerCase())?A.jsx(r.Text,{variant:i.textVariants.highlight,hyphens:!0,overflowWrap:"anywhere",highlight:!0,highlightColor:i.colors.highlight,highlightBorderRadius:2,color:i.colors.highlightText,children:a},l):a)})}const uc={title:{colors:{text:void 0,highlight:void 0,highlightText:"purple11"},textVariants:{text:"bold",highlight:"bold"}},uid:{colors:{text:"green11",highlight:"green3",highlightText:"green11"},textVariants:{text:"extraSmall",highlight:"extraSmall"}}};function gc(e){const{searchTerm:t,tagsFilter:n,typesFilter:o,localesFilter:i}=e,s=L();s.searchDocuments||V("searchDocuments");const{storageVersion:a}=R.useRequest(St,[s.coreApiBaseUrl,s.authStrategy]);s.searchDocuments||V("searchDocuments");const{status:l}=s,{data:d}=oe.useSuspenseQuery({...DA({searchTerm:t,tags:[...ee.map(n,c=>c.id)],customTypes:[...ee.map(o,c=>c.id)],locale:[...ee.map(i,c=>c.id)][0]??"",status:Vt[l],storageVersion:a,config:s}),select:c=>hc(c.results,Vt[l]),staleTime:300});return{documents:d.results}}function hc(e,t){return{results:e.flatMap(o=>{const s=o.versions.filter(a=>t.includes(a.status));return s.length===0?[]:{...o,versions:s}})}}function pc(e,t){const n=L(),o=E.useDebounceState({initialState:""}),[i,s]=f.useState(new Set),[a,l]=f.useState(new Set);function d(){return!n.searchDocuments||!n.localeId?new Set:new Set([{id:n.localeId,label:n.localeId}])}const[c,u]=f.useState(d),h=ee.union(a,ht(e)),g=ee.union(i,ht(t));return{searchTerm:o,filteredTags:i,setFilteredTags:s,filteredCustomTypes:a,setFilteredCustomTypes:l,filteredLocales:c,setFilteredLocales:u,typesFilter:h,tagsFilter:g}}function ht(e){return e?ee.map(e,t=>({id:t,label:t})):new Set}function mc(e){const{filteredLocales:t,setFilteredLocales:n,filteredTags:o,setFilteredTags:i,filteredCustomTypes:s,setFilteredCustomTypes:a,fixedTags:l,fixedCustomTypes:d}=e;return A.jsxs(A.Fragment,{children:[A.jsx(Cc,{selectedValues:t,onSelectedValuesChange:n}),A.jsx(Nt,{selectedValues:o,fixedSelectedValues:ht(l),onSelectedValuesChange:i,label:"Tags",icon:"label",fetchFilters:Ac}),A.jsx(Nt,{selectedValues:s,fixedSelectedValues:ht(d),onSelectedValuesChange:a,label:"Type",icon:"description",fetchFilters:_o})]})}function Nt(e){const[t,n]=f.useState(!1),o=f.useRef(null);return A.jsx(r.ErrorBoundary,{ref:o,renderError:()=>{var i;return A.jsx(r.FilterField,{mode:"error",onErrorRetry:(i=o.current)==null?void 0:i.reset,open:t,setOpen:n,values:new Set,...e})},children:A.jsx(f.Suspense,{fallback:A.jsx(r.FilterField,{mode:"loading",open:t,setOpen:n,values:new Set,...e}),children:A.jsx(fc,{open:t,setOpen:n,...e})})})}function fc(e){const{open:t,setOpen:n,onSelectedValuesChange:o,fixedSelectedValues:i,selectedValues:s,label:a,icon:l,fetchFilters:d,multiple:c}=e,u=d();return A.jsx(r.FilterField,{open:t,setOpen:n,label:a,icon:l,selectedValues:s,values:new Set(u),fixedSelectedValues:i,onSelectedValuesChange:o,multiple:c})}function Cc(e){const{selectedValues:t,onSelectedValuesChange:n}=e,[o,i]=f.useState(ee.first(t));function s(l){n(l),i(ee.first(l))}const a=ee.find(Wn(),l=>{var d;return l.id===((d=ee.first(t))==null?void 0:d.id)});return(a==null?void 0:a.label)!==(o==null?void 0:o.label)&&i(a),A.jsx(Nt,{selectedValues:new Set(o?[o]:[]),onSelectedValuesChange:s,label:"Locale",icon:"public",fetchFilters:Wn,multiple:!1})}function No(e){const{onSelectDocument:t,fixedCustomTypes:n,fixedTags:o,linkedDocumentId:i,...s}=e,a=L(),{searchTerm:l,filteredTags:d,setFilteredTags:c,filteredCustomTypes:u,setFilteredCustomTypes:h,filteredLocales:g,setFilteredLocales:m,typesFilter:C,tagsFilter:y}=pc(n,o);return A.jsxs(r.Dialog,{size:{height:727,width:656},hasClose:!1,...s,children:[A.jsx(r.DialogTitle,{hidden:!0,children:"Link to a page"}),A.jsx(r.DialogDescription,{hidden:!0,children:"Search and select a page to link to"}),A.jsx(r.DialogContent,{children:A.jsxs(r.Box,{flexDirection:"column",height:"100%",children:[A.jsxs(r.Box,{padding:{top:16,inline:16,bottom:8},flexDirection:"column",gap:12,children:[A.jsx(r.FormInput,{value:l.value,onValueChange:l.set,placeholder:"Search a page",icon:"search"}),a.searchDocuments&&A.jsx(mc,{filteredTags:d,setFilteredTags:c,filteredCustomTypes:u,setFilteredCustomTypes:h,filteredLocales:g,setFilteredLocales:m,fixedTags:o,fixedCustomTypes:n})]}),a.searchDocuments?A.jsx(xc,{searchTerm:l.debouncedValue,tagsFilter:y,typesFilter:C,localesFilter:g,onSelectDocument:t,linkedDocumentId:i}):A.jsx(Zo,{title:"Oops!",message:"Slice Machine does not yet support mock data for linked documents in the simulator."})]})})]})}function xc(e){const{searchTerm:t,tagsFilter:n,typesFilter:o,localesFilter:i,linkedDocumentId:s,onSelectDocument:a}=e;return A.jsxs(r.ScrollArea,{style:{flexGrow:1,paddingBottom:r.theme.space[16],paddingInline:r.theme.space[12],display:"flex",flexDirection:"column"},children:[s&&A.jsxs(A.Fragment,{children:[A.jsx(_n,{children:"Linked page"}),A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(Hn,{description:"An error occurred while fetching the linked page."}),children:A.jsx(f.Suspense,{fallback:Sc,children:A.jsx(Ic,{linkedDocumentId:s,tagsFilter:n,onSelectDocument:a})})})]}),A.jsx(_n,{children:"Link to a page"}),A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(Hn,{description:"An error occurred while fetching pages."}),children:A.jsx(f.Suspense,{fallback:Bc,children:A.jsx(yc,{searchTerm:t,tagsFilter:n,localesFilter:i,typesFilter:o,linkedDocumentId:s,onSelectDocument:a})})})]})}function yc(e){const{searchTerm:t,tagsFilter:n,localesFilter:o,typesFilter:i,linkedDocumentId:s,onSelectDocument:a}=e,{documents:l}=gc({searchTerm:t,tagsFilter:n,localesFilter:o,typesFilter:i}),d=l.filter(c=>c.id!==s);return d.length===0?A.jsx(Zo,{title:l.length===1?"No other pages found!":void 0}):A.jsx(r.Box,{flexDirection:"column",gap:12,children:d.map(c=>{const u=c==null?void 0:c.versions[0];return u?A.jsx(Go,{document:c,version:u,tagsFilter:n,searchTerm:t,onSelectDocument:a},`${c.id}-${u.status}`):null})})}const Bc=A.jsx(r.Box,{flexDirection:"column",gap:12,children:O.range(1,3).map(e=>A.jsx(r.Skeleton,{height:124,sx:{marginInline:4},zIndex:-1},e))});function Hn(e){const{description:t}=e;return A.jsx(r.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",children:A.jsx(r.DefaultErrorMessage,{title:"Request failed",description:t,errorImageSrc:r.dialogErrorImage})})}function Ic(e){const{linkedDocumentId:t,tagsFilter:n,onSelectDocument:o}=e,i=bc(t),s=jc(i);return A.jsx(Go,{document:i,version:s,tagsFilter:n,onSelectDocument:o,highlighted:!0})}function jc(e){return f.useMemo(()=>Fc(e),[e])}function Fc(e){return O.sort(e.versions,t=>t.status==="unclassified"||t.status==="published"?-1:0,t=>t.status==="release"?-1:0,t=>-t.last_modified_date.getTime())[0]}const Sc=A.jsx(r.Skeleton,{height:124,sx:{marginBlock:4,marginInline:4},zIndex:-1});function bc(e){const t=L();t.searchDocuments||V("searchDocuments");const{coreApiBaseUrl:n,authStrategy:o}=t;return R.useRequest(et,[n,o,e])}function Go(e){var g;const{document:t,version:n,tagsFilter:o,highlighted:i,onSelectDocument:s,searchTerm:a}=e,l=L();if(!t||!n)return null;const d=dn({documentId:t.id,versionId:n.status==="archived"?n.version_id:void 0,releaseId:n.status==="release"?n.release_id:void 0,status:n.status,baseUrl:l.baseUrl}),c=Kc({tags:n.tags,tagsFilter:o}),u=Wt(n)&&n.summary||UA(n)&&n.preview_summary||"",h=Wt(n)?(g=n.highlights)==null?void 0:g.uid:void 0;return A.jsx(oc,{documentTypeId:t.custom_type_id,documentUrl:d,description:u,tags:c,title:t.title,previewImageUrl:n.preview_image,onSelect:()=>s(t.id),statusColor:fA[n.status].color,highlighted:i,highlightedUID:h,searchTerm:a})}function _n(e){const{children:t}=e;return A.jsx(r.Box,{position:"sticky",top:0,backgroundColor:"white",padding:{block:6,inline:4},children:A.jsx(r.Text,{variant:"smallBold",color:"grey11",children:t})})}function Zo(e){const{title:t="No pages found!",message:n="Consider using different keywords or tweaking your filters to find what you need."}=e;return A.jsx(r.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:A.jsxs(r.BlankSlate,{children:[A.jsx(r.BlankSlateIcon,{name:"close",lineColor:"tomato11",backgroundColor:"tomato4",size:48}),A.jsx(r.BlankSlateTitle,{size:"big",children:t}),A.jsx(r.BlankSlateDescription,{width:360,children:n})]})})}function Kc(e){const{tags:t,tagsFilter:n}=e,o=[...n].map(s=>s.label).reverse();return O.sort(t,s=>-o.indexOf(s))}function Jo(e){const{hasLink:t,onUnlink:n,selectEnabled:o,selectedType:i,value:s,onOpenLinkModal:a,onValueChange:l,openInNewTab:d=!0,condensedButtons:c=!1,showNewTabButton:u=!1,displayTextEnabled:h,variants:g,variant:m,onVariantChange:C}=e;return A.jsxs(A.Fragment,{children:[!h&&u&&d&&A.jsx(r.Badge,{title:"Open in a new tab",color:"indigo",size:"small",icon:"openInNew",onClick:a}),!t&&o&&A.jsxs(r.Select,{value:i==="any"?void 0:i,color:"grey",size:"small",boldTriggerText:!0,position:"popper",sideOffset:4,startIcon:We({selectType:i}),disabled:!o,onValueChange:l,placeholder:c?"":Pe("any"),onlyStartIcon:c&&i!==void 0,renderTrigger:({button:y})=>A.jsx(r.Tooltip,{content:Pe(i),visible:c,children:y}),children:[A.jsx(r.SelectItem,{value:"web",icon:"public",children:Pe("web")}),A.jsx(r.SelectItem,{value:"document",icon:"description",children:Pe("document")}),A.jsx(r.SelectItem,{value:"media",icon:"image",children:Pe("media")})]},i===void 0?"unlinked":"linked"),!t&&!o&&A.jsx(r.Button,{startIcon:We({selectType:i}),color:"grey",textColor:"link",textWeight:"normal",size:"small",onClick:a,children:Pe(i)}),t&&!h&&A.jsx(r.Button,{startIcon:"close",color:"grey",size:"small",onClick:n,"aria-label":"Close"}),t&&h&&A.jsxs(r.ButtonGroup,{density:"compact",children:[A.jsx(r.Button,{startIcon:We({selectType:i}),renderEndIcon:()=>d&&i==="web"?A.jsx(r.Icon,{name:"openInNew",size:"extraSmall",color:"indigo11"}):null,color:"grey",textColor:"link",textWeight:"normal",size:"small",disabled:!t,onClick:a,children:s.length>30?`${s.slice(0,30)}...`:s}),A.jsx(r.Button,{startIcon:"close",color:"grey",size:"small",onClick:n})]}),g.length>1&&A.jsx(r.Select,{value:m,color:"grey",size:"small",boldTriggerText:!0,position:"popper",sideOffset:4,startIcon:"colorLens",onValueChange:C,children:g.map((y,x)=>A.jsx(r.SelectItem,{value:y,children:y},`${y}-${x}`))})]})}function Pe(e){if(!e||e==="any")return"Choose link type";switch(e){case"document":return"Link to Prismic page";case"web":return"Link to web page";case"media":return"Link to media"}}function Xo(e){const{onEdit:t,onUnlink:n,url:o,title:i,subTitle:s}=e,[a,l]=f.useState(null);return A.jsx(r.Card,{paddingBlock:16,ref:l,children:A.jsxs(r.CardContent,{children:[A.jsx(Tc,{url:o,title:i,subTitle:s,onEdit:t,onUnlink:n,container:a}),o&&A.jsx(r.CheckerBoard,{children:A.jsx(Uc,{children:A.jsx(r.Image,{src:o,alt:i,sizing:"contain"})})})]})})}function Uc(e){const{children:t}=e;return A.jsx(r.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:327,children:t})}function Tc(e){const{url:t,title:n,subTitle:o,onEdit:i,onUnlink:s,container:a}=e;return A.jsxs(r.Box,{flexDirection:"row",justifyContent:"space-between",gap:8,children:[A.jsxs(r.Box,{gap:8,minWidth:0,children:[A.jsx(r.ConjoinedIcons,{largeIconName:"image",smallIconName:"link"}),A.jsxs(r.Box,{flexDirection:"column",minWidth:0,children:[A.jsx(r.Text,{noWrap:!0,variant:"smallBold",href:t,inline:!0,children:n}),A.jsx(r.Text,{variant:"small",color:"grey11",children:o})]})]}),A.jsxs(r.ButtonGroup,{size:"medium",color:"grey",children:[i&&A.jsx(r.Tooltip,{content:"Edit link",side:"top",container:a,children:A.jsx(r.Button,{startIcon:"edit",onClick:i})}),s&&A.jsx(r.Tooltip,{content:"Remove link",side:"top",container:a,children:A.jsx(r.Button,{startIcon:"linkOff",onClick:s})})]})]})}function wc(e){var he,Qe,Me;const{field:t,content:n,onContentChange:o}=e,i=B(),s=((he=t.config)==null?void 0:he.allowText)??!1,a=s&&(n==null?void 0:n.value.text)||void 0,l=((Qe=t.config)==null?void 0:Qe.variants)??[],c=(n==null?void 0:n.value.variant)&&l.includes(n==null?void 0:n.value.variant)?n==null?void 0:n.value.variant:l[0],[u,h]=f.useState(I),g=K.FilledExternalLinkContent.is(n==null?void 0:n.value)&&(n==null?void 0:n.value.target)||void 0,[m,C]=f.useState(!1),y=f.useRef(null);E.useOnChange(i,_);const x=u?Lc[u]:void 0;function I(){var D,Q;return!((D=t.config)!=null&&D.select)||n!=null&&n.value.__TYPE__?n==null?void 0:n.value.__TYPE__:zn[(Q=t.config)==null?void 0:Q.select]}function B(){return n?K.FilledDocumentLinkContent.is(n.value)?n.value.id:K.FilledExternalLinkContent.is(n.value)?n.value.url:K.FilledFileLinkContent.is(n.value)||K.FilledImageLinkContent.is(n.value)?n.value.name:"":""}function j(D){var pe;const{displayText:Q,variant:z}=D;if(!Q&&!z)return o(void 0);switch((pe=t.config)==null?void 0:pe.select){case"web":return o({__TYPE__:"LinkContent",key:Oe(n),value:{__TYPE__:"ExternalLink",kind:"web",...Q&&{text:Q},...z&&{variant:z}}});case"document":return o({__TYPE__:"LinkContent",key:Oe(n),value:{__TYPE__:"DocumentLink",kind:"document",...Q&&{text:Q},...z&&{variant:z}}});case"media":return o({__TYPE__:"LinkContent",key:Oe(n),value:{__TYPE__:"MediaLink",kind:"media",...Q&&{text:Q},...z&&{variant:z}}});default:return o({__TYPE__:"LinkContent",key:Oe(n),value:{__TYPE__:"AnyLink",kind:"any",...Q&&{text:Q},...z&&{variant:z}}})}}function S(D,Q){if(!D)return j({displayText:a,variant:c});const{newTab:z=!1}=Q??{},pe=z?"_blank":void 0;switch(u){case"ExternalLink":return o({__TYPE__:"LinkContent",key:Oe(n),value:{__TYPE__:"ExternalLink",url:D,target:pe,...a&&{text:a},...c&&{variant:c}}});case"DocumentLink":return o({__TYPE__:"LinkContent",key:Oe(n),value:{__TYPE__:"DocumentLink",id:D,...a&&{text:a},...c&&{variant:c}}});default:return o(void 0)}}function b(D){return n?o({__TYPE__:n.__TYPE__,key:n.key,value:{...n.value,text:D}}):j({displayText:D})}function v(D){return n?o({__TYPE__:n.__TYPE__,key:n.key,value:{...n.value,variant:D}}):j({variant:D})}const F=kc();function T(D){h(D?zn[D]:void 0),S(""),D&&D!=="any"&&F(D)}function k(D){S(D)}function M(){C(!0)}function _(){var D;m&&(C(!1),(D=y.current)==null||D.reset())}function ge(D){const Q=$o({media:D});switch(Q.value.__TYPE__){case"ImageLink":return o({__TYPE__:Q.__TYPE__,key:Q.key,value:{...Q.value,...a&&{text:a},...c&&{variant:c}}});case"FileLink":return o({__TYPE__:Q.__TYPE__,key:Q.key,value:{...Q.value,...a&&{text:a},...c&&{variant:c}}})}}return{contentType:u,selectType:x,fieldValue:i,onDisplayTextChange:b,onValueChange:S,onTypeChange:T,placeholder:De(t),isTypeSelectEnabled:!((Me=t.config)!=null&&Me.select),onDocumentSelected:k,onError:M,errorBoundaryRef:y,isTargetNewTab:g==="_blank",onMediaSelected:ge,displayTextEnabled:s,displayText:a??"",variants:l,variant:c,onVariantChange:v}}function Oe(e){return e?e.key:crypto.randomUUID()}const Lc={AnyLink:"any",DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media",MediaLink:"media"},zn={any:"AnyLink",document:"DocumentLink",web:"ExternalLink",media:"FileLink"};function vc(e){const t=L();t.searchDocuments||V("searchDocuments");const{coreApiBaseUrl:n,authStrategy:o}=t;return R.useRequest(et,[n,o,e]).title}R.cache.registerFetcherConfig(et,{concurrency:50});function $o(e){var i,s,a,l,d,c;const{media:t}=e,n="kind"in t;return n&&t.kind==="image"?{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"ImageLink",id:t.id,name:t.filename,url:t.url,kind:"image",size:t.size.toString(),height:((i=t.height)==null?void 0:i.toString())??`${ye}`,width:((s=t.width)==null?void 0:s.toString())??`${ye}`,date:((a=t.last_modified)==null?void 0:a.toString())??""}}:n?{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"FileLink",id:t.id,name:t.filename,kind:"file",url:t.url,size:t.size.toString(),date:((l=t.last_modified)==null?void 0:l.toString())??""}}:{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"ImageLink",id:t.id,name:(t==null?void 0:t.alt)??t.url,kind:"image",url:t.url,size:"0",height:((d=t.height)==null?void 0:d.toString())??`${ye}`,width:((c=t.width)==null?void 0:c.toString())??`${ye}`}}}const kc=()=>{const e=ml(),{onAnalyticsEvent:t}=L();function n(o){e&&t&&t("Generic Link Added",{type:o,isInSlice:String(e.isInSlice),isInGroup:String(e.isInGroup),isInRepeatable:String(e.isInRepeatable),customTypeFormat:e.customTypeFormat??"custom"})}return n};function Ec(e){const{open:t,onOpenChange:n,showNewTabButton:o}=e,{url:i,setUrl:s,openInNewTab:a,setOpenInNewTab:l,disabled:d,onUpdate:c}=Dc(e);return A.jsxs(r.Dialog,{open:t,onOpenChange:n,size:"small",noDescription:!0,children:[A.jsx(r.DialogHeader,{title:"Set Link URL"}),A.jsxs(r.DialogContent,{padding:16,children:[A.jsx(r.FormInput,{value:i,onValueChange:s,placeholder:"Paste URL",icon:"public"}),o&&A.jsx(r.InlineLabel,{value:"Open in a new tab",children:A.jsx(r.Checkbox,{checked:a,onCheckedChange:l})})]}),A.jsxs(r.DialogActions,{children:[A.jsx(r.DialogCancelButton,{}),A.jsx(r.DialogActionButton,{onClick:c,disabled:d,children:"Update"})]})]})}function Dc(e){const{url:t,openInNewTab:n,onUpdate:o,open:i}=e,[s,a]=f.useState(t),[l,d]=f.useState(n);E.useOnChange(i,()=>{i&&(a(t),d(n))});const c=!s||s===t&&l===n;function u(){o(s,{newTab:l})}return{url:s,setUrl:a,openInNewTab:l,disabled:c,setOpenInNewTab:d,onUpdate:u}}function Fn(e){var Q,z,pe,ot;const{content:t,field:n,id:o,onContentChange:i,appearance:s="normal",backgroundColor:a="grey1"}=e,l=E.useDebounceState({initialState:!1}),[d,c]=f.useState(),{contentType:u,fieldValue:h,errorBoundaryRef:g,onDocumentSelected:m,onError:C,onMediaSelected:y,onValueChange:x,selectType:I,onTypeChange:B,isTypeSelectEnabled:j,displayTextEnabled:S,...b}=wc({content:t,field:n,onContentChange:i}),v=u==="DocumentLink"&&h!=="",T=u==="ExternalLink"&&te.toURL(h),k=!!((Q=n.config)!=null&&Q.allowTargetBlank);function M(){switch(u){case"DocumentLink":return c("document");case"ExternalLink":return c("web");case"FileLink":case"ImageLink":case"MediaLink":return c("media");default:return c(void 0)}}const _={...b,id:o,onFocus:()=>l.set(!0),onBlur:()=>l.set(!1),onOpenLinkModal:M,onUnlink:()=>{j?B(void 0):x("")},onSelectValueChange:H=>{B(H),c(H)},value:h,allowTargetBlank:k,selectType:I,onValueChange:x,isTypeSelectEnabled:j,displayTextEnabled:S,onKeyDown(H){S||(H.key==="Enter"||H.key===" ")&&(M(),H.preventDefault())},onClick:()=>{S||M()},appearance:s},{searchDocuments:ge}=L();function he(H){if(H)return;const qe=t&&t.value.__TYPE__!=="AnyLink";!H&&!qe&&j&&B(void 0),c(void 0)}function Qe(H,qe){x(H,qe),c(void 0)}function Me(H){y(H),c(void 0)}function D(H){m(H),c(void 0)}return A.jsxs(A.Fragment,{children:[A.jsxs(r.Popover,{align:"start",sideOffset:-3,focusOnEnter:!1,open:l.debouncedValue,anchor:A.jsxs(r.Field,{variant:Rc(s),color:a,children:[v?A.jsx(qc,{documentId:h,displayTextEnabled:S}):A.jsx(r.FieldIcon,{name:We({selectType:I,displayTextEnabled:S})}),s!=="compact"&&A.jsx(r.FieldLabel,{htmlFor:o,children:Z(n)}),A.jsx(r.FieldControl,{children:v&&ge?A.jsx(Oc,{errorBoundaryRef:g,onError:C,fallback:A.jsx(Gt,{..._,value:"..."}),renderError:()=>Qc(_),children:A.jsx(Mc,{..._,documentId:h})}):A.jsx(Gt,{..._})})]}),children:[T&&A.jsx(ve,{url:T,title:te.getUrlTitle(T)??"",subTitle:T.toString()}),t&&K.FilledImageLinkContent.is(t.value)&&A.jsx(Xo,{url:t.value.url,title:t.value.name,subTitle:`${t.value.width} x ${t.value.height} pixels`})]}),A.jsx(Ec,{open:d==="web",onOpenChange:he,onUpdate:Qe,url:h,openInNewTab:b.isTargetNewTab,showNewTabButton:!!((z=n.config)!=null&&z.allowTargetBlank)}),A.jsx(jn,{open:d==="media",onOpenChange:he,onMediaSelected:Me,assetType:"all"}),A.jsx(No,{open:d==="document",onOpenChange:he,onSelectDocument:D,fixedCustomTypes:new Set((pe=n.config)==null?void 0:pe.customtypes),fixedTags:new Set((ot=n.config)==null?void 0:ot.tags),linkedDocumentId:t&&K.FilledDocumentLinkContent.is(t.value)?t.value.id:void 0})]})}function Rc(e){switch(e){case"compact":return"compact";case"normal":return"normal";default:return}}function Qc(e){return A.jsx(Gt,{...e})}function Gt(e){const{id:t,value:n,onOpenLinkModal:o,onBlur:i,isTypeSelectEnabled:s,selectType:a,onSelectValueChange:l,onUnlink:d,isTargetNewTab:c,allowTargetBlank:u,displayTextEnabled:h,displayText:g,onFocus:m,onClick:C,onKeyDown:y,appearance:x,placeholder:I,variants:B,variant:j,onVariantChange:S,onDisplayTextChange:b,onValueChange:v}=e;return A.jsx(r.Box,{padding:{block:4},width:"100%",children:A.jsx(Fe,{id:t,textOverflow:"ellipsis",variant:h?"normal":"link",readOnly:!h,placeholder:h?"Add your display text":I,padding:ei(x),value:h?g:n,cursor:ti({value:n,displayTextEnabled:h,isTypeSelectEnabled:s}),onBlur:i,onFocus:m,onClick:C,onKeyDown:y,onValueChange:h?b:v,endAdornment:A.jsx(Jo,{hasLink:!!(n&&a),onUnlink:d,selectEnabled:s,selectedType:a,value:n,onOpenLinkModal:o,onValueChange:l,openInNewTab:c,condensedButtons:x==="condensedButtons",showNewTabButton:u&&a==="web",displayTextEnabled:h,variants:B,variant:j,onVariantChange:S})})})}function Mc(e){const{id:t,documentId:n,onOpenLinkModal:o,isTypeSelectEnabled:i,selectType:s,displayTextEnabled:a,onSelectValueChange:l,onUnlink:d,onFocus:c,onClick:u,onKeyDown:h,appearance:g,variants:m,variant:C,displayText:y,onVariantChange:x,onDisplayTextChange:I}=e,B=vc(n),j=ni(n);return A.jsx(Fe,{id:t,textOverflow:"ellipsis",padding:ei(g),placeholder:a?"Add your display text":void 0,readOnly:!a,value:a?y:B,variant:a?"normal":"link",cursor:ti({value:B,displayTextEnabled:a,isTypeSelectEnabled:i}),onFocus:c,onClick:u,onKeyDown:h,onValueChange:a?I:void 0,endAdornment:A.jsxs(r.Box,{gap:4,children:[j&&A.jsx(r.Badge,{title:"Broken Link",color:"tomato"}),A.jsx(Jo,{hasLink:!0,onUnlink:d,selectEnabled:i,selectedType:s,value:B,onOpenLinkModal:o,condensedButtons:g==="condensedButtons",onValueChange:l,displayTextEnabled:a,variants:m,variant:C,onVariantChange:x})]})})}function qc(e){const{documentId:t,displayTextEnabled:n}=e;return A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(r.FieldIcon,{name:"warning"}),children:A.jsx(f.Suspense,{fallback:A.jsx(r.FieldIcon,{name:We({selectType:"document",displayTextEnabled:n})}),children:A.jsx(Pc,{documentId:t,displayTextEnabled:n})})})}function Pc(e){const{displayTextEnabled:t,documentId:n}=e;return ni(n)?A.jsx(r.FieldIcon,{name:"linkOff"}):A.jsx(r.FieldIcon,{name:We({selectType:"document",displayTextEnabled:t})})}function ei(e){switch(e){case"compact":return{input:{inline:4}};default:return}}function Oc(e){const{errorBoundaryRef:t,onError:n,children:o,fallback:i,renderError:s}=e;return A.jsx(r.ErrorBoundary,{ref:t,onError:n,renderError:s,children:A.jsx(f.Suspense,{fallback:i,children:o})})}function We(e){const{selectType:t,displayTextEnabled:n}=e;if(n)return"notes";switch(t){case"document":return"description";case"web":return"public";case"media":return"image";default:return"link"}}function ti(e){const{value:t,displayTextEnabled:n,isTypeSelectEnabled:o}=e;return n?"text":o&&!t?"default":"pointer"}function Vc(e){const{onContentChange:t,...n}=e;function o(i){const s=K.FilledLinkContent.is(i)?i:void 0;t(s)}return A.jsx(Fn,{...n,onContentChange:o})}function ni(e){const t=L();t.uidField||V("uidField");const{coreApiBaseUrl:n,authStrategy:o}=t,{data:i}=mn({baseUrl:n,authStrategy:o,documentIds:[e],statuses:["archived","unclassified","published"]});if(i.results.length===0||i.results.length>1)return!1;const s=i.results[0];return s==null?void 0:s.versions.every(a=>a.status==="archived")}function Yc(e){const{onDelete:t,isDeleteEnabled:n,onMoveUp:o,onMoveDown:i,isMoveUpEnabled:s,isMoveDownEnabled:a}=e;return A.jsxs(r.DropdownMenu,{children:[A.jsx(r.DropdownMenuTrigger,{children:A.jsx(r.IconButton,{hiddenLabel:"Link actions",icon:"moreVert",size:"small",variant:"solid"})}),A.jsxs(r.DropdownMenuContent,{children:[A.jsx(r.DropdownMenuLabel,{children:A.jsx(r.Text,{variant:"small",color:"grey11",children:"Item options"})}),A.jsx(r.DropdownMenuItem,{onSelect:o,startIcon:A.jsx(r.Icon,{name:"arrowUpward"}),disabled:!s,children:"Move up"}),A.jsx(r.DropdownMenuItem,{onSelect:i,startIcon:A.jsx(r.Icon,{name:"arrowDownward"}),disabled:!a,children:"Move down"}),A.jsx(r.DropdownMenuItem,{color:"tomato",onSelect:t,startIcon:A.jsx(r.Icon,{name:"delete",color:"tomato9"}),disabled:!n,children:"Delete"})]})]})}function Wc(e){const{field:t,content:n,onContentChange:o}=e,{config:i}=t,s=f.useMemo(()=>Mt({config:i}),[i]),a=n!=null&&n.value.length?n.value:[s];function l(g){const m=O.insertAtIndex(a,g,Mt({config:i}));o(Je(m))}function d(g,m){var x;const C=[...a],y=Mt({config:i,key:(x=C[m])==null?void 0:x.key});C[m]=g??y,o(Je(C))}function c(g){o(Je(g))}function u(g){const m=O.removeIndex(a,g);o(Je(m))}function h(g,m){const C=O.move(a,m,m+Hc(g));o(Je(C))}return{links:a,updateLink:d,updateLinks:c,addLink:l,deleteLink:u,moveLink:h}}function Hc(e){switch(e){case"up":return-1;case"down":return 1}}function Mt(e){const{config:t,key:n=crypto.randomUUID()}=e,o=_c(t==null?void 0:t.select);return t!=null&&t.allowText&&(o.text=""),{__TYPE__:"LinkContent",key:n,value:o}}function _c(e){switch(e){case"web":return{__TYPE__:"ExternalLink",kind:"web"};case"document":return{__TYPE__:"DocumentLink",kind:"document"};case"media":return{__TYPE__:"MediaLink",kind:"media"};default:return{__TYPE__:"AnyLink",kind:"any"}}}function Je(e){return{__TYPE__:"RepeatableContent",type:"Link",value:e}}function zc(e){const{id:t,field:n}=e,o=Wc(e),[i,s]=f.useState(!1),{links:a}=o;return A.jsx(pl,{children:A.jsxs(r.FieldSet,{id:t,legend:Nc(n.config),variant:"compact",selected:i,children:[A.jsx(Gc,{field:n,items:a,onItemDelete:o.deleteLink,onItemChange:o.updateLink,onItemMove:o.moveLink,onItemAdd:o.addLink,onItemReorder:o.updateLinks,onDragStatusChange:s}),A.jsx(r.Button,{startIcon:"add",color:"grey",onClick:()=>o.addLink(a.length),sx:{marginInline:4,marginBlock:4},children:"Add"})]})})}function Nc(e){return e!=null&&e.label?`Multiple • ${e.label}`:"Multiple"}function Gc(e){const{field:t,items:n,onItemChange:o,onItemDelete:i,onItemMove:s}=e,a=n.length>1,l=Zc(e);return A.jsx(r.AnimatedList,{items:n,getItemKey:d=>d.key,ariaLabel:"Link list",dnd:l,children:(d,c)=>A.jsxs(r.Draggable,{disabled:!a,children:[A.jsx(Fn,{appearance:"compact",content:d,field:t,onContentChange:u=>o(u,c),backgroundColor:"transparent"}),A.jsx(Yc,{onDelete:()=>i(c),isDeleteEnabled:n.length>1,onMoveUp:()=>s("up",c),isMoveUpEnabled:c>0,onMoveDown:()=>s("down",c),isMoveDownEnabled:c<n.length-1})]})})}function Zc(e){const{onDragStatusChange:t,onItemReorder:n,onItemAdd:o}=e,{scrollOffsetTop:i}=L(),s=E.useStableCallback(o);return{renderDropIndicator:l=>A.jsx(Jc,{...l,onItemAdd:s}),scrollOffsetTop:i,onDragChange:t,onReorder:n}}function Jc(e){const{isDropTarget:t,itemIndex:n,position:o,itemCount:i,onItemAdd:s}=e;return n===0&&o==="before"?A.jsx(Nn,{isDropTarget:t,position:"before"}):n===i-1&&o==="after"?A.jsx(Nn,{isDropTarget:t,position:"after"}):A.jsx(Xc,{index:n,isDropTarget:t,onItemAdd:s})}function Xc(e){const{index:t,onItemAdd:n,isDropTarget:o}=e,[i,s]=f.useState(0);function a(){n(t+1),s(l=>l+1)}return A.jsx(r.HairlineButton,{icon:"add",size:"small",variant:"rightDashed",tooltip:{content:"Add item below"},onClick:a,dropMode:o,sx:{marginInline:4}},i)}function Nn(e){const{isDropTarget:t,position:n}=e;return A.jsx(r.AnimatedElement,{enterDuration:150,animation:{name:"expand-vertical"},children:t&&A.jsx(r.Box,{children:A.jsx(r.Line,{color:"purple",thickness:2,sx:{width:"100%",marginBottom:n==="before"?4:void 0,marginTop:n==="after"?4:void 0}},"line")})})}function $c(e){const{linkTo:t,onLinkToChange:n}=e,o=ed(t);return A.jsx(Vc,{content:o,onContentChange:i=>n(td(i)),field:{type:"Link",config:{label:"Link",allowTargetBlank:!0,allowText:!1}},appearance:"condensedButtons"})}function ed(e){const[t]=f.useState(()=>crypto.randomUUID());if(e)return{__TYPE__:"LinkContent",key:t,value:e}}function td(e){return e==null?void 0:e.value}function Ai(e){var j,S;const{allContentViews:t,content:n,contentView:o,fieldLabel:i,imageLabel:s,initialImages:a,isUpdating:l,page:d=0,readOnly:c,thumbnailName:u,onClear:h,onContentChange:g,onCropperDialogClose:m,onPageChange:C,onMediaDialogOpenChange:y}=e,x=((S=(j=n==null?void 0:n.url)==null?void 0:j.split("?")[0])==null?void 0:S.slice(-4))===".svg",I=n!=null&&n.url&&!c?"visible":"hidden",B=!K.isImageContent(n);return A.jsxs(r.Box,{display:"flex",gap:12,padding:{inline:12},children:[A.jsx(r.Box,{children:A.jsx(r.Carousel,{getItemSource:ta,items:t,onPageChange:C,page:d,buttonSize:"small",renderPrevTooltip:b=>A.jsx(r.Tooltip,{content:"Previous",children:b}),renderNextTooltip:b=>A.jsx(r.Tooltip,{content:"Next",children:b}),style:B?{width:181,height:142}:{width:123,height:93},children:b=>(b==null?void 0:b.url)&&A.jsx(r.CarouselItem,{"aria-label":"Image Field Item",src:jo(b.url),alt:b.alt??void 0,isUpdating:l,disableAnimation:B},`${u}_${b.url}`)})}),A.jsxs(r.Box,{width:"100%",display:"flex",flexDirection:"column",gap:B?16:12,children:[A.jsx(Jl,{fieldLabel:i,imageLabel:s,initialImages:a,page:d,displaySeparator:!B,isSVGContentView:x,visibility:I,onClear:h,onCropperDialogClose:m,onMediaDialogOpenChange:y}),A.jsx(Zl,{readOnly:c||!o,altText:(o==null?void 0:o.alt)??"",onValueChange:b=>{o&&g(Js(u,n,o,b))}}),B&&A.jsx($c,{linkTo:n.linkTo,onLinkToChange:b=>{g({...n,linkTo:b})}})]})]})}function oi(e){const{onMediaSelected:t}=e,n=L(),{showAlert:o}=r.useAlert(),{mutate:i,isPending:s}=oe.useMutation({mutationFn:a=>so({file:a,config:n}),onSuccess:a=>{t(a)},onError:()=>{o({title:"Error uploading image",subtitle:"Please try again"})}});return{uploadImage:i,isUploadingImage:s}}function nd(e){const{content:t,onContentChange:n,field:o}=e,[i,s]=f.useState(0),[a,l]=f.useTransition(),d=Gs(o),c=d[i],u=t?Zs(o,t):void 0,h=u==null?void 0:u[i];function g(B){if(!c)return;const j=na(c.name,o,t,B);j!==t&&l(()=>n(j))}function m(B){l(()=>s(B))}function C({option:B,croppedImages:j}){if(s(B),!t)return;const S=Object.entries(j).reduce((b,[v,F])=>Wl({field:o,content:b,thumbnail:v,croppedImage:F}),t);S!==t&&l(()=>n(S))}function y(){s==null||s(0),n(void 0)}const{uploadImage:x,isUploadingImage:I}=oi({onMediaSelected:g});return{onCropperDialogClose:C,onPageChange:m,onMediaSelected:g,isUpdating:a,page:i,thumbnail:c,allThumbnails:d,allContentViews:u,contentView:h,onClear:y,uploadImage:x,isUploadingImage:I}}function Ad(e){const{content:t,field:n,readOnly:o,onContentChange:i}=e,s=t&&t.origin.url.length>0,{onCropperDialogClose:a,onPageChange:l,isUpdating:d,page:c,onMediaSelected:u,thumbnail:h,allThumbnails:g,allContentViews:m,contentView:C,onClear:y,uploadImage:x,isUploadingImage:I}=nd({field:n,content:t,onContentChange:i}),[B,j]=f.useState(!1),S=Z(n),b=g.map((k,M)=>{const _=m==null?void 0:m[M];return{thumbnail:k,contentView:_,labels:Ht(k,t,_)}}),v=h&&s?Ht(h,t,C).filter(ae.isDefined):[],F=h&&t&&s&&m,T=I||d;return A.jsx(Oo,{isMediaDialogOpen:B,onMediaSelected:u,onMediaDialogOpenChange:j,children:A.jsx(f.Suspense,{fallback:A.jsx("div",{style:{height:95}}),children:F?A.jsx(Ai,{allContentViews:m,content:t,contentView:C,fieldLabel:S,imageLabel:v,initialImages:b,isUpdating:T,page:c,readOnly:o,thumbnailName:h.name,onClear:y,onContentChange:i,onCropperDialogClose:a,onMediaDialogOpenChange:j,onPageChange:l}):A.jsx(Vo,{uploadImage:x,isUploading:I,disabled:o||B,children:A.jsx(Mo,{fieldLabel:S,isUpdating:T,readOnly:o,onMediaDialogOpenChange:j})})})})}function od(e){var x,I;const{searchTerm:t,catalogId:n}=e,o=L();o.integrationFields||V("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:s,authStrategy:a}=o,[l,d]=f.useState(1),[c,u]=f.useState([]),[h,g]=f.useState(""),m=R.useRequest(id,[i,a,s,n,t,t===h?l:1]);t!==h?(g(t),d(1),u(m.items)):m.items.length>0&&((x=O.last(c))==null?void 0:x.id)!==((I=O.last(m.items))==null?void 0:I.id)&&u(B=>B.concat(m.items));const C=l<m.totalPages;function y(){C&&d(B=>B+1)}return{items:c,response:m,fetchNextPage:y,hasNextPage:C}}function id(e,t,n,o,i,s=1,a=30){const l=new URL(`if/search/${o}`,e);return l.searchParams.set("searchTerm",i),l.searchParams.set("limit",a.toString()),l.searchParams.set("page",s.toString()),U.request(l,{headers:{repository:n},credentials:U.getRequestCredentials(t),okType:rd})}const ii=p.z.object({id:p.z.string(),title:p.z.string(),imageURL:p.z.string().optional(),description:p.z.string().optional()}),rd=p.z.object({items:p.z.array(ii),totalPages:p.z.number(),page:p.z.number()});function ri(e){const{itemId:t,catalogId:n}=e,o=L();o.integrationFields||V("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:s,authStrategy:a}=o,d=R.useRequest(sd,[i,a,s,n,t]).items[0];if(!d)throw new Error("Item not found");return{item:d}}function sd(e,t,n,o,i){const s=new URL(`if/read/${o}`,e);return s.searchParams.set("ids",[i].toString()),U.request(s,{headers:{repository:n},credentials:U.getRequestCredentials(t),okType:ad})}const ad=p.z.object({items:p.z.array(ii)});function Sn(e){const{item:t,onClick:n,catalogId:o}=e;return A.jsxs(r.PreviewCard,{variant:"large",onClick:n,children:[A.jsx(ld,{src:t.imageURL??"",alt:t.title}),A.jsxs(r.PreviewContent,{children:[A.jsx(r.Badge,{title:`Catalog: ${o}`,icon:"multipleStop",size:"medium"}),A.jsx(r.Text,{variant:"bold",color:"grey12",sx:{marginTop:4},children:t.title}),A.jsx(r.Text,{variant:"small",color:"grey11",children:t.description??t.id})]})]})}const lt=76;function ld(e){const{src:t,alt:n}=e;return t?A.jsx(r.PreviewImage,{src:t,alt:n,width:lt,height:lt,framed:!0}):A.jsxs(r.Box,{borderRadius:6,backgroundColor:"grey2",height:lt,width:lt,flexDirection:"column",alignItems:"center",justifyContent:"center",border:!0,padding:{inline:4,block:8},children:[A.jsx(r.Icon,{name:"hideImage",size:"large",color:"grey11"}),A.jsx(r.Text,{color:"grey11",variant:"small",noSelect:!0,align:"center",children:"No preview image"})]})}function Ve(){return A.jsxs(r.PreviewCard,{variant:"large",children:[A.jsx(r.Skeleton,{height:76,width:76}),A.jsxs(r.PreviewContent,{children:[A.jsx(r.Skeleton,{height:24,width:168}),A.jsx(r.Skeleton,{height:24,width:240,sx:{marginTop:4}}),A.jsx(r.Skeleton,{height:16,width:144})]})]})}function cd(e){const{open:t,onOpenChange:n,catalogId:o,onSelectItem:i}=e,s=E.useDebounceState({initialState:""}),a=L();return A.jsx(r.Dialog,{open:t,onOpenChange:n,hasClose:!1,size:{width:612,height:724},noDescription:!0,children:A.jsx(r.DialogContent,{children:A.jsxs(r.Box,{flexDirection:"column",height:"100%",children:[A.jsxs(r.Box,{padding:{top:16,inline:16},flexDirection:"column",gap:8,children:[A.jsx(r.FormSearchInput,{value:s.value,onValueChange:s.set,placeholder:"Search in your catalog"}),A.jsx(r.DialogTitle,{asChild:!0,children:A.jsx(r.Text,{variant:"smallBold",color:"grey11",children:"Select an item"})})]}),a.integrationFields?A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(Zt,{message:"There was an error while fetching your catalog items."}),children:A.jsx(f.Suspense,{fallback:A.jsxs(r.Box,{flexDirection:"column",gap:12,padding:{top:10,inline:16,bottom:16},children:[A.jsx(Ve,{}),A.jsx(Ve,{}),A.jsx(Ve,{}),A.jsx(Ve,{}),A.jsx(Ve,{})]}),children:A.jsx(dd,{searchTerm:s.debouncedValue,catalogId:o,onItemClick:i})})}):A.jsx(Zt,{message:"Slice Machine does not yet support mock data for integration field in the simulator."})]})})})}function dd(e){const{catalogId:t,searchTerm:n,onItemClick:o}=e,[i,s]=f.useTransition(),{items:a,hasNextPage:l,fetchNextPage:d}=od({catalogId:t,searchTerm:n});return A.jsx(A.Fragment,{children:A.jsxs(r.ScrollArea,{onScrollToBottom:()=>l&&s(d),style:{flexGrow:1,paddingTop:r.theme.space[10],paddingBottom:r.theme.space[16],paddingInline:r.theme.space[16],display:"flex",flexDirection:"column",gap:r.theme.space[12]},threshold:252,children:[a.length===0?A.jsx(Zt,{}):a.map(c=>A.jsx(Sn,{item:c,catalogId:t,onClick:()=>o(c)},c.id)),A.jsx(r.AnimatedElement,{animation:{name:"fade"},children:i&&A.jsx(r.Text,{color:"grey11",align:"center",sx:{marginBlock:8},children:"Loading more results ..."})})]})})}function Zt(e){const{message:t="We can't find any items matching your search"}=e,n="Oops!";return A.jsx(r.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:A.jsxs(r.BlankSlate,{children:[A.jsx(r.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),A.jsx(r.BlankSlateTitle,{size:"big",children:n}),A.jsx(r.BlankSlateDescription,{width:360,children:t})]})})}function ud(e){const{itemId:t,item:n}=e,o=L();return t&&n&&n.id===t?A.jsx(Ye,{...e,value:n.title}):t&&o.integrationFields?A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(Ye,{...e,value:t}),children:A.jsx(f.Suspense,{fallback:A.jsx(Ye,{...e,value:t}),children:A.jsx(pd,{...e,itemId:t})},t)},t):t&&!o.integrationFields?A.jsx(Ye,{...e,value:t}):A.jsx(Ye,{...e,value:""})}function gd(e){const{catalogId:t,itemId:n,item:o}=e,i=L();return n&&o&&o.id===n?A.jsx(r.FieldFooter,{children:A.jsx(Sn,{catalogId:t,item:o})}):n&&i.integrationFields?A.jsx(r.ErrorBoundary,{renderError:()=>null,children:A.jsx(r.FieldFooter,{children:A.jsx(f.Suspense,{fallback:A.jsx(Ve,{}),children:A.jsx(hd,{catalogId:t,itemId:n})},n)})},n):null}function hd(e){const{itemId:t,catalogId:n}=e,{item:o}=ri({catalogId:n,itemId:t});return A.jsx(Sn,{catalogId:n,item:o})}function Ye(e){const{id:t,field:n,readOnly:o,value:i,onFocus:s,onClearItem:a}=e;return A.jsx(Fe,{id:t,placeholder:De(n),readOnly:!0,variant:"link",value:i,...!o&&{cursor:"pointer",onFocus:s},endAdornment:A.jsx(r.Button,{startIcon:"close",color:"grey",size:"small",disabled:!i,onClick:a})})}function pd(e){const{itemId:t,catalogId:n}=e,{item:o}=ri({catalogId:n,itemId:t});return A.jsx(Ye,{...e,value:o.title})}function md(e){var m;const{id:t,field:n,content:o,readOnly:i,onContentChange:s}=e,[a,l]=f.useState(!1),[d,c]=f.useState(),u=(m=n.config)==null?void 0:m.catalog;if(!u)return null;function h(C){s({value:C.id,__TYPE__:"IntegrationFieldsContent"}),c(C),l(!1)}function g(){s(void 0),c(void 0)}return A.jsxs(A.Fragment,{children:[A.jsxs(r.Field,{footer:A.jsx(gd,{catalogId:u,item:d,itemId:o==null?void 0:o.value}),children:[A.jsx(r.FieldIcon,{name:"multipleStop"}),A.jsx(r.FieldLabel,{htmlFor:t,children:Z(n)}),A.jsx(r.FieldControl,{children:A.jsx(ud,{id:t,field:n,readOnly:i,catalogId:u,item:d,itemId:o==null?void 0:o.value,onFocus:()=>l(!0),onClearItem:g})})]}),A.jsx(cd,{open:a,onOpenChange:l,catalogId:u,onSelectItem:h})]})}function si(e){const{content:t,field:n,id:o,onContentChange:i,readOnly:s,endAdornment:a,placeholder:l}=e;return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"notes"}),A.jsx(r.FieldLabel,{htmlFor:o,children:Z(n)}),A.jsxs(r.FieldControl,{children:[A.jsx(r.TextArea,{id:o,placeholder:l||De(n),readOnly:s,paddingLeft:4,paddingRight:12,sx:{flexGrow:1},value:(t==null?void 0:t.value)??"",onChange:d=>{i(fd(d))}}),a]})]})}function fd(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}function Cd(e){var l;const{content:t,id:n,field:o,onContentChange:i,readOnly:s}=e,a={id:n,readOnly:s,onContentChange:i};return(l=o.config)!=null&&l.repeat?A.jsx(zc,{...a,field:o,content:hA(t)}):A.jsx(Fn,{...a,field:o,content:pA(t)})}const xd=({content:e,field:t,id:n,onContentChange:o,readOnly:i})=>{var l,d;const s=Number(e==null?void 0:e.value),a=Number.isFinite(s)?s:void 0;return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"pin"}),A.jsx(r.FieldLabel,{htmlFor:n,children:Z(t)}),A.jsx(r.FieldControl,{children:A.jsx(r.NumberInput,{id:n,value:a,min:(l=t.config)==null?void 0:l.min,max:(d=t.config)==null?void 0:d.max,padding:Eo,placeholder:De(t),readOnly:i,onValueChange:c=>o(yd(c))})})]})};function yd(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function Bd(e){return e.type==="table"}const Te={...w.RichTextNodeType,table:"table"};function Id(e){return!!(e&&e.has(Te.table))}var Re=(e=>(e.Document="document",e.Mark="mark",e.Node="node",e))(Re||{}),Ke=(e=>(e.Text="text",e.Embed="embed",e.Image="image",e.Table="table",e))(Ke||{});class jd{constructor(t,n,o){W(this,"extType","document");this.name=t,this.component=n,this.converter=o}}class At{constructor(t,n,o,i,s,a=!1){W(this,"extType","node");W(this,"nodeType","text");this.richTextNodeTypes=t,this.name=n,this.component=o,this.converter=i,this.placeholder=s,this.lockedFormat=a}}function ai(e){return e instanceof At}class Fd{constructor(t,n,o,i){W(this,"extType","node");W(this,"nodeType","embed");this.richTextNodeTypes=t,this.name=n,this.component=o,this.converter=i}}class Sd{constructor(t,n,o,i){W(this,"extType","node");W(this,"nodeType","image");this.richTextNodeTypes=t,this.name=n,this.component=o,this.converter=i}}class bd extends At{constructor(t,n,o,i,s){super(t,"heading",n,i,s),this.levels=o}}class bn extends At{constructor(t,n,o,i){super(t,n,o,i)}}class Kd{constructor(t,n,o,i){W(this,"extType","node");W(this,"nodeType","table");this.richTextNodeTypes=t,this.name=n,this.component=o,this.converter=i}}function Ud(e){return e instanceof bn}const Ie={isHardBreak(e){return e.type.name===aA.name},children:{reduce(e,t,n){let o=n;return e.forEach((i,s,a)=>{o=t(o,i,a)}),o},map(e,t){return this.reduce(e,(n,o)=>[...n,t(o)],[])},exists(e,t){return this.reduce(e,(n,o)=>n||t(o),!1)},filter(e,t){return this.reduce(e,(n,o)=>[...n,...t(o)?[o]:[]],[])}},marks:{reduce(e,t,n){let o=n;return e.marks.forEach((i,s)=>{o=t(o,i,s)}),o},map(e,t){return this.reduce(e,(n,o)=>[...n,t(o)],[])},filter(e,t){return this.reduce(e,(n,o)=>[...n,...t(o)?[o]:[]],[])}}};function Td(e){if(!e||!(e!=null&&e.single)&&!(e!=null&&e.multi))return Gn();const t=wd(e);if(!t.size)return Gn();const n=Ld(t),o=vd(n,e);return{nodeTypes:t,extensions:o}}function wd(e){const n=(e.single||e.multi||"").split(/\s*,\s*/).map(o=>{if(o==="table")return o;const i=w.RichTextNodeTypeCodec.decode(o);return i._tag==="Right"?i.right:void 0}).filter(ae.isDefined);return new Set(n)}function Ld(e){return Di(e).filter(n=>ee.some(e,o=>n.richTextNodeTypes.includes(o)))}function vd(e,t){var o;const n=new Set(e);return ee.some(n,Ud)&&n.add(J),ee.some(n,ai)||n.add(J),(o=t==null?void 0:t.labels)!=null&&o.length&&n.add(wn),[...n]}function Gn(){return{extensions:Di(),nodeTypes:new Set(Ge.keys(w.RichTextNodeTypeCodec.keys))}}class kd{constructor(t,n,o){W(this,"extType",Re.Mark);W(this,"richTextNodeTypes",[w.RichTextNodeType.strong]);this.name=t,this.component=n,this.converter=o}}const li="bold",ci=rr.extend({name:li}),Ed={fromPrismic(e){return function(){var t;return(t=e.marks[ci.name])==null?void 0:t.create()}},toPrismic(){}},Dd=new kd(li,ci,Ed),Kn=Dd,di=nr.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),Rd={fromPrismic(e){return function(t){var o;const n=J.converter.fromPrismic(e)(t);if(n)return(o=e.nodes[di.name])==null?void 0:o.create({},n)}},toPrismic(e,t){return Ie.children.reduce(e,(n,o)=>{const i=J.converter.toPrismic(o),s=(()=>i instanceof Array?i.map(a=>({...a,type:t})):i?[{...i,type:t}]:[])();return[...n,...s]},[])}},Ne={component:di,converter:Rd,placeholder:"List"};function Qd(e,t){return e.copy(e.content.append(t.content))}function Md(e){return e.reduce((t,n)=>{const o=(t[n.type]||[]).concat(n);return{...t,[n.type]:o}},{})}function Zn(e){return e.sort((t,n)=>t.start-n.start)}function qd(e){const t=Md(e),n=Object.entries(t).map(([o,i])=>Zn(i).reduce((a,l)=>{if(!a.length)return[l];const d=a.length-1,c=a[d];return c?c.end<l.start?[...a,l]:c.end>=l.end?a:[...a.slice(0,d),{...c,end:l.end}]:a},[])).flat();return Zn(n)}const pt=aA.extend({name:"hard_break"}),mt=`
38
- `,ui={fromPrismic(e){return function(t){var n;if(t===mt)return(n=e.nodes[pt.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===pt.name)return mt}},qt={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function Pd(e,t){return function(n){const o=ui.fromPrismic(e)(mt);if(!o)return[n(t)];const i=t.split(mt);return i.length===1?t.length?[n(t)]:[o]:i.reduce((s,a,l)=>qt.isFirst(l)?qt.isEmptyLine(a)?s:[...s,n(a)]:qt.isEmptyLine(a)?[...s,o]:[...s,o,n(a)],[])}}const Od={name:pt.name,component:pt,converter:ui,splitTextToNodes:Pd},ft=Od,gi={fromPrismic(e){return t=>{switch(t.type){case"hyperlink":return Ti.converter.fromPrismic(e)(t);case"em":return Tn.converter.fromPrismic(e)(t);case"strong":return Kn.converter.fromPrismic(e)(t);case"label":return wn.converter.fromPrismic(e)(t);case"list-item":return}}},toPrismic(e,t,n){const o=Ei.find(i=>e.type.name===i.name);if(!o)throw new Error(`Invalid mark extension '${e.type.name}'.`);switch(o.name){case"bold":return{type:"strong",start:t,end:n};case"em":return{type:o.name,start:t,end:n};case"hyperlink":return{type:o.name,start:t,end:n,data:o.converter.toPrismic(e)};case"label":return{type:o.name,start:t,end:n,data:o.converter.toPrismic(e)}}}},Vd={strong:"bold",label:"label",em:"em",hyperlink:"hyperlink","list-item":void 0},Jn=ir.extend({name:"text"}),Yd={fromPrismic(e){return function(t,n,o=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return or.serialize([i],Wd(e,o)).flat()}},toPrismic(e,t,n){const o=Ie.children.reduce(e,(i,s)=>{const a=(()=>s.type.name===ft.name?ft.converter.toPrismic(s):s.textContent)(),l=a?i.text+a:i.text,d=i.text.length,c=l.length,u=(()=>s.marks.length?Ie.marks.map(s,g=>gi.toPrismic(g,d,c)):void 0)();return{...i,text:l,spans:u?[...i.spans,...u]:i.spans}},{text:"",spans:[]});return{type:t,content:{text:o.text,spans:[...qd(o.spans)].sort((i,s)=>i.type.localeCompare(s.type))},...n}}};function Wd(e,t=!1){return(n,o,i,s)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:ft.splitTextToNodes(e,i)(d=>e.text(d));const a=gi.fromPrismic(e)(o);return a?Hd(a,s):s.flat()}}function Hd(e,t){return t.flat().map(o=>{const s=[...o.marks,e].sort((a,l)=>a.type.name.localeCompare(l.type.name));return o.mark(s)})}const _d={name:Jn.name,component:Jn,converter:Yd},ke=_d,Un="document";function zd(e){return tr.extend({name:Un,content:e?"block+":"block"})}function Nd(e){return{fromPrismic(t,n,o){var s;const i=o.value.reduce((a,l)=>{const{extension:d,block:c}=Xd(e,l,t,n),u=Zd({extension:d,block:c,schema:t}),h=a.slice(0,a.length-1),g=O.last(a),m=Jd({node:u,previousNode:g});return m.updatedNode?[...m.merged?h:a,m.updatedNode]:a},[]);return(s=t.nodes[Un])==null?void 0:s.create({},i)},toPrismic(t){return{__TYPE__:"StructuredTextContent",value:[...Ie.children.reduce(t,(o,i)=>{const s=Object.values(e).find(l=>i.type.name===l.name),a=s==null?void 0:s.converter.toPrismic(i);return a||console.warn(`Cannot convert node of type '${i.type.name}'.`),a?[...o,...a instanceof Array?a:[a]]:o},[])]}}}}const Gd=new jd(Un,zd,Nd),Jt=Gd;function Zd(e){const{extension:t,block:n,schema:o}=e;if(t)switch(t.nodeType){case Ke.Embed:return K.EmbedBlock.is(n)?t.converter.fromPrismic(o)(n):void 0;case Ke.Text:return K.TextBlock.is(n)?t.converter.fromPrismic(o)(n):void 0;case Ke.Image:return K.ImageBlock.is(n)?t.converter.fromPrismic(o)(n):void 0;case Ke.Table:return Bd(n)?t.converter.fromPrismic(o)(n):void 0}}function Jd(e){const{node:t,previousNode:n}=e;return!t||!n?{merged:!1,updatedNode:t}:t.type.name===n.type.name&&(t.type.name===xt.name||t.type.name===Bt.name)?{merged:!0,updatedNode:Qd(n,t)}:{merged:!1,updatedNode:t}}function Xd(e,t,n,o){var l;const i=e.find(d=>d.richTextNodeTypes.includes(t.type)&&o.has(t.type));if(i)return{extension:i,block:t};if(!K.TextBlock.is(t))return{extension:void 0,block:t};const s=e.find(d=>ai(d)&&d.name in n.nodes),a=(l=t.content.spans)==null?void 0:l.filter(d=>{const c=Vd[d.type];return c&&c in n.marks});return{extension:s,block:{...t,content:{text:t.content.text,spans:a}}}}const dt="ltr",Ue="rtl",Ce="dir",Xn=w.RichTextNodeType.rtl,$d=X.Extension.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[Ce]:{default:dt,parseHTML:e=>e.getAttribute(Ce),renderHTML:e=>({[Ce]:Xt(e[Ce])})}}}]},addCommands(){return{setDirection:e=>({commands:t})=>{switch(e){case dt:return t.setLeftToRight();case Ue:return t.setRightToLeft()}},toggleDirection:e=>({commands:t})=>{const n=e===Ue?dt:Ue;return t.setDirection(n)},setRightToLeft:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.updateAttributes(t,{[Ce]:Ue})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,Ce))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),xe={parseNodeAttrsDirection(e){return Xt(e[Ce])},fromPrismic(e){return{[Ce]:Xt(e.direction)}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}};function Xt(e){return e===Ue?Ue:dt}const Ct=Ar.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",X.mergeAttributes(this.options.HTMLAttributes,e),0]}}),eu={fromPrismic(e){return function(t){var o;const n=ke.converter.fromPrismic(e)(Ct.name,t);return(o=e.nodes[Ct.name])==null?void 0:o.create(xe.fromPrismic(t),n)}},toPrismic(e){return ke.converter.toPrismic(e,w.RichTextNodeType.paragraph,xe.toPrismic(e))}},tu=new At([w.RichTextNodeType.paragraph],Ct.name,Ct,eu,"Type '/' for commands"),J=tu,nu=e=>hr.configure({includeChildren:!0,placeholder:t=>Au(t,e),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function Au(e,t){const{editor:n,hasAnchor:o,pos:i,node:s}=e,{placeholderByNodeType:a,unfocusedPlaceholder:l,nodeExtensions:d}=t,c=!Ie.children.exists(n.state.doc,B=>B===s),u=n.isEditable;if(l&&!n.isFocused&&n.isEmpty&&i===0)return l;const h=s.type.name!==J.name,g=n.isFocused&&o||h||c,m=d.filter(B=>B!==J).length>1;function C(B){return B===J.placeholder?u&&g&&m:u&&g}function y(){if(c)return Ne.placeholder;const B=a[s.type.name];return typeof B=="string"?B:B==null?void 0:B(s.attrs)}const x=y();return C(x)&&x||""}const hi=["ArrowDown","ArrowUp","End","Home"],pi=["Enter"],ou=["Escape",...hi,...pi],iu=X.Extension.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=ut(Ri,this.options.nodeTypes);return e.length>1?[pr.Suggestion({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===J.name&&n.depth===1},command:({editor:t,props:n,range:o})=>{n.runCommands(t,{deleteRange:o})},items:({query:t})=>{const n=t.toLocaleLowerCase().trim();return e.filter(o=>{var i,s;return((i=o.shortText)==null?void 0:i.toLocaleLowerCase().includes(n))||((s=o.text)==null?void 0:s.toLocaleLowerCase().includes(n))})},render:()=>{let t;return{onStart:n=>{t=new ne.ReactRenderer(ru,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var o;return!!(ou.includes(n.key)&&((o=t==null?void 0:t.ref)!=null&&o.handleKeyDown(n)))},onExit:()=>{t==null||t.destroy(),t==null||t.element.remove()}}}})]:[]}}),ru=f.forwardRef(function(t,n){const{command:o,decorationNode:i,editor:s,items:a}=t,[l,d]=f.useState(!0),{context:c,floating:u,reference:h,x:g,y:m}=ce.useFloating({middleware:[ce.offset(0),ce.flip(),ce.shift({limiter:ce.limitShift()})],onOpenChange:d,open:l,placement:"top-start",strategy:"fixed",whileElementsMounted:ce.autoUpdate});f.useLayoutEffect(()=>{h(i)},[h,i]),f.useEffect(()=>{let F;const T=()=>{F=window.setTimeout(()=>{d(!0)})},k=()=>{d(!1)};return s.on("focus",T).on("blur",k),()=>{s.off("focus",T).off("blur",k),clearTimeout(F)}},[s]);const[C,y]=f.useState(0),x=f.useRef([]);E.useOnChange(a,()=>{y(0),x.current=[]});const{getFloatingProps:I,getItemProps:B,getReferenceProps:j}=ce.useInteractions([ce.useDismiss(c,{outsidePointerDown:!1}),ce.useListNavigation(c,{activeIndex:C,listRef:x,onNavigate:F=>{y(T=>F??T)},openOnArrowKeyDown:!1,virtual:!0}),ce.useRole(c,{role:"menu"})]),b=j().onKeyDown;f.useImperativeHandle(n,()=>({handleKeyDown:F=>{if(l){if(hi.includes(F.key)&&b(F),pi.includes(F.key)){const T=a[C];T!==void 0&&o(T)}return!0}else return!1}}),[C,o,a,b,l]);const v=g!==null&&m!==null;return l?A.jsxs(r.Box,{...I(),minWidth:256,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,flexDirection:"column",ref:u,top:0,left:0,position:"fixed",transform:v?`translate3d(${Math.round(g)}px, ${Math.round(m)}px, 0)`:"translate3d(0, -200%, 0)",overflow:"hidden",children:[a.map((F,T)=>{const k=B({onClick:()=>{o(F)},onPointerDown:M=>{M.preventDefault()}});return f.createElement($n,{...k,key:F.nodeType,ref:M=>{x.current[T]=M},active:T===C,isFirstItem:T===0,isLastItem:T===a.length-1,shortcut:`/${F.shortText??""}`},F.text)}),a.length===0&&A.jsx($n,{...B({onPointerDown:F=>{F.preventDefault()}}),disabled:!0,ref:F=>{x.current[0]=F},children:"No results"})]}):null}),$n=f.forwardRef(function(t,n){const{children:o,disabled:i=!1,shortcut:s,active:a=!1,isFirstItem:l=!1,isLastItem:d=!1,...c}=t;return A.jsx("div",{...c,role:"button",style:{cursor:i?"default":"pointer"},ref:n,children:A.jsxs(r.Box,{alignItems:"center",height:32,flexDirection:"row",gap:8,padding:8,backgroundColor:a?"grey4":"inherit",justifyContent:"space-between",opacity:i?.5:1,children:[A.jsx(r.Text,{color:"grey12",component:"span",children:o}),s&&A.jsx(r.Text,{color:"inherit",component:"span",variant:"small",children:s})]})})});function su(e,t){var d,c;const n=t.map(u=>u.richTextNodeTypes).flat(),i={placeholderByNodeType:au(t),unfocusedPlaceholder:(d=e.config)==null?void 0:d.placeholder,nodeExtensions:t},s=n.includes(Te.orderedList)||n.includes(Te.list),a=!n.includes(Te.table);return[Jt.component(((c=e.config)==null?void 0:c.single)===void 0),ke.component,ft.component,a?nu(i):void 0,s?Ne.component:void 0,iu.configure({nodeTypes:n})].filter(ae.isDefined)}function au(e){return e.reduce((t,n)=>(n.nodeType===Ke.Text&&(t[n.name]=n.placeholder),t),{})}const $t=sr.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",X.mergeAttributes(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),lu={fromPrismic(e){return function(t){var o;const n=Ne.converter.fromPrismic(e)(t);if(n)return(o=e.nodes[$t.name])==null?void 0:o.create(xe.fromPrismic(t),n)}},toPrismic(e){return Ie.children.map(e,t=>Ne.converter.toPrismic(t,w.RichTextNodeType.list).filter(ae.isDefined)).flat()}},cu=new bn([w.RichTextNodeType.list],$t.name,$t,lu),xt=cu,yt=ar.extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:e=>{var s;const{languageClassPrefix:t}=this.options,i=[...((s=e.firstElementChild)==null?void 0:s.classList)||[]].filter(a=>a.startsWith(t)).map(a=>a.replace(t,""))[0];return i||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){return["pre",X.mergeAttributes(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),du={fromPrismic(e){return function(t){var o;const n=ke.converter.fromPrismic(e)(yt.name,t,!0);return(o=e.nodes[yt.name])==null?void 0:o.create(xe.fromPrismic(t),n)}},toPrismic(e){return ke.converter.toPrismic(e,w.RichTextNodeType.preformatted,xe.toPrismic(e))}},uu=new At([w.RichTextNodeType.preformatted],yt.name,yt,du,"",!0),mi=uu;function fi(e){const{editor:t,getPos:n,node:o}=e,[i,s]=f.useState(!1);return f.useEffect(()=>{function a(){const{from:d,to:c}=t.state.selection,u=n(),h=n()+o.nodeSize,g=d<=u&&c>=h;s(g)}function l(){s(!1)}return t.on("blur",l),t.on("selectionUpdate",a),()=>{t.off("blur",l),t.off("selectionUpdate",a)}},[t,n,o.nodeSize]),{selected:i}}function gu(e,t,n){const{node:o}=e,i=o.attrs.content,s=E.useStableCallback(e.updateAttributes),a=E.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:f.startTransition});function l(u){s({content:u})}function d(u){a.set(u),te.toURL(u)||l(void 0)}const{onKeyDown:c}=hu(e,a.value,t,n);return{inputRef:t,containerRef:n,onKeyDown:c,url:a.value,urlChanged:d,onContentChange:l,debouncedUrl:a.debouncedValue,content:e.node.attrs.content}}function hu(e,t,n,o){const{editor:i,getPos:s,node:a}=e,[l,d]=f.useState(!0);f.useEffect(()=>{!l||!e.editor.isFocused||r.handleEditorFlushSyncError(()=>{var u;return(u=n.current)==null?void 0:u.focus()})},[n,l,e.editor.isFocused]);function c(u){const h=s(),g=s()+a.nodeSize;u.code==="Enter"&&(d(!1),i.chain().insertContentAt(g,{type:"paragraph"}).focus(g+1).run()),u.code==="Backspace"&&t===""&&i.chain().deleteRange({from:h,to:g}).focus(g+1).run(),u.code==="ArrowUp"&&(d(!1),i.chain().focus(h-1).run()),u.code==="ArrowDown"&&(d(!1),i.chain().focus(g+1).run())}return{containerRef:o,inputRef:n,onKeyDown:c}}function pu(e){const t=f.useRef(null),n=f.useRef(null),{onKeyDown:o,url:i,urlChanged:s,onContentChange:a,debouncedUrl:l,content:d}=gu(e,t,n),{selected:c}=fi(e);return A.jsx(ne.NodeViewWrapper,{className:"custom-embed",children:A.jsxs("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:[A.jsxs(r.Box,{flexGrow:1,alignItems:"center",children:[A.jsx(r.Icon,{size:"small",name:"cloud",color:"grey11"}),A.jsx(r.Box,{flexGrow:1,height:40,ref:n,children:A.jsx(Fe,{id:"id",ref:t,value:i,variant:te.toURL(i)?"link":"normal",placeholder:"Paste your link here",onValueChange:s,onKeyDown:o})})]}),te.toURL(i)&&A.jsx(Do,{selected:c,debouncedUrl:l,onContentChange:a,content:d})]})})}const en=X.Node.create({name:"embed",group:"block",atom:!0,content:"block*",marks:"",addAttributes(){return{content:{default:void 0}}},addCommands(){return{setEmbed:()=>({tr:e,dispatch:t})=>{const n=this.type.create();return t&&e.replaceSelectionWith(n),!0}}},parseHTML(){return[{tag:"embed"}]},renderHTML(){return["embed"]},addNodeView(){return ne.ReactNodeViewRenderer(pu)}}),mu={fromPrismic(e){return function(t){var n;return(n=e.nodes[en.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){return e.attrs.content===void 0?{type:"embed",data:{type:"embed",embed_url:"",__TYPE__:"EmbedContent",all:[]}}:{type:"embed",data:{...e.attrs.content}}}},Ci=new Fd([w.RichTextNodeType.embed],en.name,en,mu),tn="heading";function Lt(e){switch(e){case 1:return w.RichTextNodeType.heading1;case 2:return w.RichTextNodeType.heading2;case 3:return w.RichTextNodeType.heading3;case 4:return w.RichTextNodeType.heading4;case 5:return w.RichTextNodeType.heading5;case 6:return w.RichTextNodeType.heading6}}function eA(e){return{fullName:Lt(e),level:e}}const xi=[1,2,3,4,5,6];function yi(e,t=xi){const n=new RegExp(`^heading([${t.join(",")}]){1}$`),o=e.match(n);if(!o||!o[1])return;const i=parseInt(o[1]);return{fullName:Lt(i),level:i}}function Bi(e,t){const n=e.level;if(t.includes(n))return{fullName:Lt(n),level:n}}const fu=e=>{const t=e[0]??1;return{fromPrismic(n){return function(o){var a;const i=ke.converter.fromPrismic(n)(tn,o),s=yi(o.type,e)||eA(t);return(a=n.nodes[tn])==null?void 0:a.create({level:s.level,...xe.fromPrismic(o)},i)}},toPrismic(n){const{fullName:o}=Bi(n.attrs,e)||eA(t);return ke.converter.toPrismic(n,o,xe.toPrismic(n))}}};function Cu(e){return e?e.size?Array.from(e.values()).reduce((n,o)=>{const i=yi(o);return i?[...n,i.level]:n},[]).sort((n,o)=>n-o):[]:xi}function xu(e){return lr.extend({name:"heading"}).configure({levels:e})}const be={name:tn,build:e=>{const t=Cu(e);if(!t)return;const n=t.map(o=>Lt(o));return new bd(n,xu(t),t,fu(t),o=>{const i=Bi(o,t);return i&&`Heading ${i.level}`})}};function yu(e){const{content:t,thumbnail:n,imageViewProps:{getPos:o,updateAttributes:i,editor:s,node:a}}=e,[l,d]=f.useTransition();function c(y){d(()=>i({content:y}))}function u(y){const x=ct(y),I=o()+a.nodeSize;c({...t,...x}),s.chain().focus(I+1).run()}function h({croppedImages:y}){if(!t)return;const x=y[n.name];if(!x)return;const I=Wo({content:t,croppedImage:x});I!==t&&c(I)}function g(){const y=o(),x=o()+a.nodeSize;s.chain().deleteRange({from:y,to:x}).focus(x).run()}const{uploadImage:m,isUploadingImage:C}=oi({onMediaSelected:u});return{onMediaSelected:u,onCropperDialogClose:h,isUpdating:l,updateContent:c,onClear:g,uploadImage:m,isUploadingImage:C}}function Bu(e){const{node:t}=e,n=t.attrs.content,{selected:o}=fi(e),i=f.useRef(null),s={width:void 0,height:void 0,name:Ze},{onMediaSelected:a,onCropperDialogClose:l,isUpdating:d,updateContent:c,onClear:u,uploadImage:h,isUploadingImage:g}=yu({content:n,thumbnail:s,imageViewProps:e}),[m,C]=f.useState(!1),y="Feature image",x=(n==null?void 0:n.width)===0&&(n==null?void 0:n.height)===0,I=n&&!x?[`${n.width}×${n.height}px`]:[],B={thumbnail:s,contentView:n,labels:Ht(s,n,n)};f.useLayoutEffect(()=>{var b;const S=(b=i==null?void 0:i.current)==null?void 0:b.closest(`.${Ii}`);cr.isHTMLElement(S)&&S.style.removeProperty("min-height")},[]);const j=g||d;return A.jsx(ne.NodeViewWrapper,{children:A.jsx(Oo,{ref:i,isMediaDialogOpen:m,selected:o,onMediaSelected:a,onMediaDialogOpenChange:C,children:A.jsx(f.Suspense,{fallback:Fu,children:n!=null&&n.url?A.jsx(Ai,{allContentViews:[n],content:n,contentView:n,fieldLabel:y,imageLabel:I,initialImages:[B],isUpdating:j,readOnly:!1,thumbnailName:s.name,onClear:u,onContentChange:c,onCropperDialogClose:l,onMediaDialogOpenChange:C}):A.jsx(Vo,{uploadImage:h,isUploading:g,disabled:m,children:A.jsx(Mo,{fieldLabel:y,isUpdating:j,readOnly:!1,onMediaDialogOpenChange:C})})})})})}const Ii="imageViewNodeWrapper",ji=144,Iu=94;function ju(e){return(e?Iu:ji)+12+12+1+1}const Fu=A.jsx("div",{style:{height:ji}}),nn=X.Node.create({name:"image",group:"block",atom:!0,addAttributes(){return{content:{default:void 0}}},addCommands(){return{setImage:()=>e=>{const{dispatch:t,tr:n}=e,o=this.type.create();return t&&n.replaceSelectionWith(o),!0}}},parseHTML(){return[{tag:"image"}]},renderHTML({HTMLAttributes:e}){return["image",e]},addNodeView(){return function(t){const n=t.node.attrs.content===void 0;return ne.ReactNodeViewRenderer(Bu,{attrs:{style:`min-height: ${ju(n)}px`,class:Ii}})(t)}}}),Su={fromPrismic(e){return function(t){var n;return(n=e.nodes[nn.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){if(e.attrs.content!==void 0)return{type:"image",data:{...e.attrs.content}}}},Fi=new Sd([w.RichTextNodeType.image],nn.name,nn,Su);class bu{constructor(t,n,o){W(this,"extType",Re.Mark);W(this,"richTextNodeTypes",[w.RichTextNodeType.em]);this.name=t,this.component=n,this.converter=o}}const Si="em",bi=dr.extend({name:Si}),Ku={fromPrismic(e){return function(){var t;return(t=e.marks[bi.name])==null?void 0:t.create()}},toPrismic(){}},Uu=new bu(Si,bi,Ku),Tn=Uu;class Tu{constructor(t,n,o){W(this,"extType",Re.Mark);W(this,"richTextNodeTypes",[]);this.name=t,this.component=n,this.converter=o}}const Ki="label",An=X.Mark.create({name:Ki,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{htmlAttributes:{style:"background-color: hsl(251, 89%, 96%); border: 1px dashed rgba(68, 53, 146, 0.4); border-radius: 0px 2px 2px 2px"}}},addAttributes(){return{label:{default:""}}},addCommands(){return{setLabel:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).run(),unsetLabel:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},renderHTML({HTMLAttributes:e}){return["span",X.mergeAttributes(this.options.htmlAttributes,e),0]}}),wu={fromPrismic(e){return function(t){var i;const n=t.data,o={type:An.name,label:n};return(i=e.marks[An.name])==null?void 0:i.create(o)}},toPrismic(e){return e.attrs.label}},wn=new Tu(Ki,An,wu);class Lu{constructor(t,n,o){W(this,"extType",Re.Mark);W(this,"richTextNodeTypes",[w.RichTextNodeType.hyperlink]);this.name=t,this.component=n,this.converter=o}}const Ui="hyperlink",fe=X.Mark.create({name:Ui,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{openOnClick:!1,linkOnPaste:!0,autolink:!0,protocols:[],htmlAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null,id:""},validate:void 0}},addAttributes(){return{href:{default:""},id:{default:""},target:{default:"_blank"},rel:{default:"noopener noreferrer nofollow"},class:{default:null},media:{default:null}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:e}){return["a",X.mergeAttributes(this.options.htmlAttributes,e),0]},addCommands(){return{setWebLink:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).setMeta("preventAutolink",!0).run(),setDocumentLink:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).setMeta("preventAutolink",!0).run(),setMediaLink:e=>({chain:t})=>{const n=on($o({media:e.media}).value);return t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,{media:n}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}),vu={fromPrismic(e){return function(t){var o,i,s,a;const n=t.data;if(n.__TYPE__==="DocumentLink"){const l={type:fe.name,id:n.id};return(o=e.marks[fe.name])==null?void 0:o.create(l)}if(n.__TYPE__==="ImageLink"){const l={type:fe.name,media:on(n)};return(i=e.marks[fe.name])==null?void 0:i.create(l)}if(n.__TYPE__==="FileLink"){const l={type:fe.name,media:on(n)};return(s=e.marks[fe.name])==null?void 0:s.create(l)}if(n.__TYPE__==="ExternalLink"){const l={type:fe.name,url:n.url,href:n.url,target:n.target};return(a=e.marks[fe.name])==null?void 0:a.create(l)}}},toPrismic(e){return e.attrs.media?wi(e.attrs.media):e.attrs.id?{__TYPE__:"DocumentLink",id:e.attrs.id}:{__TYPE__:"ExternalLink",url:e.attrs.href,target:e.attrs.target}}},Ti=new Lu(Ui,fe,vu);function on(e){return JSON.stringify(e)}function wi(e){return JSON.parse(e)}const rn=ur.extend({name:"orderedList",addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",X.mergeAttributes(this.options.HTMLAttributes,n),0]:["ol",X.mergeAttributes(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}}).configure({itemTypeName:"listItem"}),ku={fromPrismic(e){return function(t){var o;const n=Ne.converter.fromPrismic(e)(t);if(n)return(o=e.nodes[rn.name])==null?void 0:o.create(xe.fromPrismic(t),n)}},toPrismic(e){return Ie.children.map(e,t=>Ne.converter.toPrismic(t,w.RichTextNodeType.orderedList).filter(ae.isDefined)).flat()}},Eu=new bn([w.RichTextNodeType.orderedList],rn.name,rn,ku),Bt=Eu;function Du({editor:e}){const t=e.isActive("table")&&e.isActive("innerTable");return A.jsxs(ne.NodeViewWrapper,{className:r.tableFieldStyles.tableWithControls,children:[A.jsx(ne.NodeViewContent,{className:r.tableFieldStyles.tableContent}),A.jsx("button",{type:"button",className:r.tableFieldStyles.addTableRowButton,onClick:e.commands.addRowEnd,"aria-disabled":!t,"aria-label":"Add row",title:"Add row",children:A.jsx(r.Icon,{name:"add",size:"small"})}),A.jsx("button",{type:"button",className:r.tableFieldStyles.addTableColumnButton,onClick:e.commands.addColumnEnd,"aria-disabled":!t,"aria-label":"Add column",title:"Add column",children:A.jsx(r.Icon,{name:"add",size:"small"})})]})}function vt(e,t){const n=e.nodes[t];if(!n)throw new Error(`Unwanted state: ${t} not found in schema.`);return n}function Li(e){return t=>{switch(t.type){case"hyperlink":case"paragraph":case"strong":case"em":return J.converter.fromPrismic(e)(t)||[];default:return[]}}}const tA={fromPrismic(e){return function(t){return vt(e,lA.TableCell.name).create({colspan:1,rowspan:1,colwidth:null},t.content.value.flatMap(Li(e)))}},toPrismic(e){const t=[];return e.content.forEach(n=>{const o=J.converter.toPrismic(n);K.TextBlock.is(o)&&t.push(o)}),{type:"tableCell",content:{__TYPE__:"StructuredTextContent",value:t}}}},nA={fromPrismic(e){return function(t){return vt(e,cA.TableHeader.name).create({colspan:1,rowspan:1,colwidth:null},t.content.value.flatMap(Li(e)))}},toPrismic(e){const t=[];return e.content.forEach(n=>{const o=J.converter.toPrismic(n);K.TextBlock.is(o)&&t.push(o)}),{type:"tableHeader",content:{__TYPE__:"StructuredTextContent",value:t}}}},AA={fromPrismic(e){return function(t){return vt(e,dA.TableRow.name).create({},t.content.map(o=>{switch(o.type){case"tableHeader":return nA.fromPrismic(e)(o);case"tableCell":return tA.fromPrismic(e)(o)}}))}},toPrismic(e){const t=[];return e.content.forEach(n=>{switch(n.type.name){case"tableHeader":{t.push(nA.toPrismic(n));break}case"tableCell":{t.push(tA.toPrismic(n));break}}}),{type:"tableRow",content:t}}},sn=gr.Table.extend({name:"innerTable",group:"table",addNodeView(){return({node:e})=>new Se.TableView(e,120)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),addRowEnd:()=>({dispatch:t,state:n})=>{if(!Se.isInTable(n))return!1;if(t){const o=Se.selectedRect(n),i=o.map.height;t(Se.addRow(n.tr,o,i))}return!0},addColumnEnd:()=>({dispatch:t,state:n})=>{if(!Se.isInTable(n))return!1;if(t){const o=Se.selectedRect(n),i=o.map.width;t(Se.addColumn(n.tr,o,i))}return!0}}}}),Ru={fromPrismic(e){return function(t){const o=vt(e,sn.name).create({},t.content.map(AA.fromPrismic(e))),i=e.nodes[vi.name];return i?i.create({},o):o}},toPrismic(e){var n;const t=((n=e.content.firstChild)==null?void 0:n.type.name)===sn.name?e.content.firstChild:e;return{type:"table",content:Ie.children.map(t,o=>AA.toPrismic(o))}}},vi=ne.Node.create({name:"table",group:"block",content:"innerTable",selectable:!1,parseHTML(){return[{tag:"div"}]},renderHTML({HTMLAttributes:e}){return["div",e,0]},addNodeView(){return ne.ReactNodeViewRenderer(Du)}}),Qu=new Kd([Te.table],Te.table,[vi,sn,dA.TableRow,cA.TableHeader,lA.TableCell],Ru),ki=[Kn,Tn,Ti],Ei=[...ki,wn];function Di(e){return Id(e)?[...ki,J,Qu].filter(ae.isDefined):[J,xt,Bt,be.build(e),mi,Ci,Fi,...Ei].filter(ae.isDefined)}const Ri=[{nodeType:w.RichTextNodeType.paragraph,icon:"textFields",isActive:e=>e.isActive(J.name)&&!e.isActive(xt.name)&&!e.isActive(Bt.name),runCommands:Y((e,t)=>e.clearNodes().setDirection(se(t))),shortText:"par",text:"Paragraph"},{nodeType:w.RichTextNodeType.heading1,icon:"looks1",isActive:e=>e.isActive(be.name,{level:1}),runCommands:Y((e,t)=>e.setHeading({level:1}).setDirection(se(t))),shortText:"h1",text:"Heading 1"},{nodeType:w.RichTextNodeType.heading2,icon:"looks2",isActive:e=>e.isActive(be.name,{level:2}),runCommands:Y((e,t)=>e.setHeading({level:2}).setDirection(se(t))),shortText:"h2",text:"Heading 2"},{nodeType:w.RichTextNodeType.heading3,icon:"looks3",isActive:e=>e.isActive(be.name,{level:3}),runCommands:Y((e,t)=>e.setHeading({level:3}).setDirection(se(t))),shortText:"h3",text:"Heading 3"},{nodeType:w.RichTextNodeType.heading4,icon:"looks4",isActive:e=>e.isActive(be.name,{level:4}),runCommands:Y((e,t)=>e.setHeading({level:4}).setDirection(se(t))),shortText:"h4",text:"Heading 4"},{nodeType:w.RichTextNodeType.heading5,icon:"looks5",isActive:e=>e.isActive(be.name,{level:5}),runCommands:Y((e,t)=>e.setHeading({level:5}).setDirection(se(t))),shortText:"h5",text:"Heading 5"},{nodeType:w.RichTextNodeType.heading6,icon:"looks6",isActive:e=>e.isActive(be.name,{level:6}),runCommands:Y((e,t)=>e.setHeading({level:6}).setDirection(se(t))),shortText:"h6",text:"Heading 6"},{nodeType:w.RichTextNodeType.list,icon:"formatListBulleted",isActive:e=>e.isActive(xt.name),runCommands:Y((e,t)=>e.toggleBulletList().setDirection(se(t))),shortText:"bull",text:"Bulleted list"},{nodeType:w.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:e=>e.isActive(Bt.name),runCommands:Y((e,t)=>e.toggleOrderedList().setDirection(se(t))),shortText:"num",text:"Numbered list"},{nodeType:w.RichTextNodeType.preformatted,icon:"dataObject",isActive:e=>e.isActive(mi.name),runCommands:Y((e,t)=>e.setCodeBlock().setDirection(se(t))),shortText:"code",text:"Code"},{nodeType:w.RichTextNodeType.embed,icon:"cloud",isActive:e=>e.isActive(Ci.name),runCommands:Y(e=>e.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:w.RichTextNodeType.image,icon:"image",isActive:e=>e.isActive(Fi.name),runCommands:Y(e=>e.setImage()),shortText:"img",text:"Image"}],Mu=[{nodeType:w.RichTextNodeType.strong,icon:"formatBold",isActive:e=>e.isActive(Kn.name),runCommands:Y(e=>e.toggleBold())},{nodeType:w.RichTextNodeType.em,icon:"formatItalic",isActive:e=>e.isActive(Tn.name),runCommands:Y(e=>e.toggleItalic())}],qu=[{nodeType:w.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:e=>e.isActive({[Ce]:Ue}),runCommands:Y((e,t)=>e.toggleDirection(se(t)))}];function Y(e){return(t,n={})=>{let o=n.can===!0?t.can().chain():t.chain().focus();return n.deleteRange!==void 0&&(o=o.deleteRange(n.deleteRange)),n.can?Pu(t,o,e):e(o,t).run()}}function se(e){const t=e.state.selection.$from.parent.attrs;return xe.parseNodeAttrsDirection(t)}function ut(e,t){return e.filter(n=>t.includes(n.nodeType))}function Pu(e,t,n){try{return n(t,e).run()}catch{return!1}}function Ou(e){const{items:t,editor:n}=e;return t.length===0?null:A.jsxs(A.Fragment,{children:[t.map(o=>A.jsx(r.ToolbarToggleButton,{disabled:!o.runCommands(n,{can:!0}),onPressedChange:()=>{o.runCommands(n)},pressed:o.isActive(n),startIcon:o.icon},o.nodeType)),A.jsx(r.ToolbarSeparator,{})]})}function Vu(e){const{labels:t,editor:n}=e,o=n.getAttributes("label").label;return A.jsxs(A.Fragment,{children:[A.jsxs(r.DropdownMenu,{children:[A.jsx(r.DropdownMenuTrigger,{disabled:t.length===0,children:A.jsx(r.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:oA(o??"Labels")})}),A.jsx(r.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map((i,s)=>{const a=o===i;return A.jsx(r.DropdownMenuItem,{onSelect:()=>a?n.commands.unsetLabel():Yu(n,i),endIcon:a&&A.jsx(r.Icon,{name:"check",size:"extraSmall"}),children:oA(i)},`${i}-${s}`)})})]}),A.jsx(r.ToolbarSeparator,{})]})}function Yu(e,t){Y(o=>o.setLabel({label:t}))(e)}function oA(e){return Ae.overflow(e,20)}function Wu(e){const{editor:t}=e,n=t.getAttributes("label");if(!n.label)return null;const o=n.label;return A.jsx(r.Box,{backgroundColor:"purple9",padding:{block:2,inline:4},alignItems:"center",borderRadius:{topLeft:2,topRight:2,bottomRight:2},maxWidth:125,children:A.jsx(r.Text,{color:"white",variant:"small",noWrap:!0,children:o})})}function Hu(e){const{disabled:t,showWebLinkModal:n,showDocumentsLinkModal:o,showMediaLinkModal:i}=_u(e);return A.jsxs(A.Fragment,{children:[A.jsxs(r.ToolbarButtonGroup,{density:"compact",children:[A.jsx(r.ToolbarButton,{disabled:t,startIcon:"link",onClick:n},w.RichTextNodeType.hyperlink),A.jsxs(r.DropdownMenu,{children:[A.jsx(r.DropdownMenuTrigger,{children:A.jsx(r.ToolbarButton,{startIcon:"arrowDropDown"})}),A.jsxs(r.DropdownMenuContent,{align:"end",asPortal:!1,children:[A.jsx(r.DropdownMenuItem,{startIcon:A.jsx(r.Icon,{name:"public"}),onSelect:n,children:"Link to web page"}),A.jsx(r.DropdownMenuItem,{startIcon:A.jsx(r.Icon,{name:"description"}),onSelect:o,children:"Link to document"}),A.jsx(r.DropdownMenuItem,{startIcon:A.jsx(r.Icon,{name:"image"}),onSelect:i,children:"Link to media"})]})]})]}),A.jsx(r.ToolbarSeparator,{})]})}function _u(e){const{editor:t,setModal:n}=e;function o(){n("webLink")}function i(){n("documentLink")}function s(){n("mediaLink")}return{disabled:!Y(l=>l.setWebLink({href:""}))(t,{can:!0}),showWebLinkModal:o,showDocumentsLinkModal:i,showMediaLinkModal:s}}function zu(e){const{docId:t,onEdit:n,onUnlink:o}=e,i=Nu(t),s=L();if(!i)return null;const a=i.versions[0],l=dn({status:a==null?void 0:a.status,releaseId:(a==null?void 0:a.status)==="release"?a.release_id:void 0,documentId:i.id,versionId:a==null?void 0:a.version_id,baseUrl:s.baseUrl}),d=(a==null?void 0:a.preview_summary)??"",c=(a==null?void 0:a.custom_type_label)??"";return A.jsx(ve,{url:l,title:i.title,subTitle:c,description:d,onEdit:n,onUnlink:o,largeIconName:"description"})}function Nu(e){const t=L();t.searchDocuments||V("searchDocuments");const{coreApiBaseUrl:n,authStrategy:o}=t;return R.useRequest(et,[n,o,e])}function Gu(e){const{editor:t}=e,{searchDocuments:n}=L(),o=t.getAttributes(w.RichTextNodeType.hyperlink);if(o.id&&n){const i=o.id;return A.jsx(Zu,{docId:i,...e})}if(o.href){const i=o.href;return A.jsx(Ju,{url:i,...e})}if(o.media){const i=wi(o.media);return A.jsx(Xu,{media:i,...e})}return null}function Zu(e){const{editor:t,onEditDocumentLink:n,docId:o}=e;return A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(ve,{title:"Failed to Load Linked Document Data",error:!0,onEdit:n,onUnlink:()=>we(t)}),children:A.jsx(f.Suspense,{fallback:A.jsx(ve,{loading:!0,onEdit:n,onUnlink:()=>we(t)}),children:A.jsx(zu,{docId:o,onEdit:n,onUnlink:()=>we(t)})})})}function Ju(e){const{url:t,editor:n,onEditWebLink:o}=e,i=te.toURL(t);return i?A.jsx(ve,{url:t,title:te.getUrlTitle(i),subTitle:t,onEdit:o,onUnlink:()=>we(n)}):A.jsx(ve,{url:t,subTitle:t,onEdit:o,onUnlink:()=>we(n)})}function Xu(e){const{media:t,editor:n,onEditMediaLink:o}=e;return K.FilledImageLinkContent.is(t)?A.jsx(Xo,{url:t.url,title:t.name,subTitle:`${t.width} x ${t.height} pixels`,onEdit:o,onUnlink:()=>we(n)}):K.FilledFileLinkContent.is(t)?A.jsx(ve,{url:t.url,title:t.name,subTitle:$u({filename:t.name}),largeIconName:"insertDriveFile",onEdit:o,onUnlink:()=>we(n)}):null}function we(e){Y(n=>n.unsetLink())(e)}function $u(e){const{filename:t}=e,n=t.split(".").pop();return n?n.toLowerCase():""}function eg(e){const{open:t}=e,{onOpenChange:n,onSelectDocument:o}=tg(e);return A.jsx(No,{open:t,onOpenChange:n,onSelectDocument:o})}function tg(e){const{editor:t,setOpen:n}=e;function o(s){Y(l=>l.extendMarkRange(w.RichTextNodeType.hyperlink).setDocumentLink({id:s}))(t),n(!1)}function i(s){n(s)}return{onSelectDocument:o,onOpenChange:i}}function ng(e){const{open:t}=e,{onOpenChange:n,onMediaSelected:o}=Ag(e);return A.jsx(jn,{open:t,onOpenChange:n,onMediaSelected:o,assetType:"all"})}function Ag(e){const{editor:t,setOpen:n}=e;function o(i){Y(a=>a.extendMarkRange(w.RichTextNodeType.hyperlink).setMediaLink({media:i}))(t),n(!1)}return{onMediaSelected:o,onOpenChange:n}}function og(e){const{open:t,setOpen:n}=e,{url:o,setUrl:i,openInNewTab:s,setOpenInNewTab:a,disabled:l,onUpdate:d}=ig(e);return A.jsxs(r.Dialog,{open:t,onOpenChange:n,size:"small",noDescription:!0,children:[A.jsx(r.DialogHeader,{title:"Set Link URL"}),A.jsxs(r.DialogContent,{padding:16,children:[A.jsx(r.FormInput,{value:o,onValueChange:i,placeholder:"Paste URL",icon:"public"}),o&&A.jsx(r.InlineLabel,{value:"Open in new tab",children:A.jsx(r.Checkbox,{checked:s,onCheckedChange:a})})]}),A.jsxs(r.DialogActions,{children:[A.jsx(r.DialogCancelButton,{}),A.jsx(r.DialogActionButton,{onClick:d,disabled:l,children:"Update"})]})]})}function ig(e){const{editor:t,open:n,setOpen:o}=e,i=rg(t),[s,a]=f.useState(i.url),[l,d]=f.useState(i.openInNewTab);E.useOnChange(n,()=>{n&&(a(i.url),d(i.openInNewTab))});const c=!s||s===i.url&&l===i.openInNewTab;function u(){const h=l?"_blank":"_self";Y(g=>g.extendMarkRange(w.RichTextNodeType.hyperlink).setWebLink({href:s,target:h}))(t),o(!1)}return{url:s,setUrl:a,openInNewTab:l,disabled:c,setOpenInNewTab:d,onUpdate:u}}function rg(e){const t=e.getAttributes(w.RichTextNodeType.hyperlink);return{url:t.href??"",openInNewTab:t.target==="_blank"}}function sg(e){const{items:t,editor:n}=e;return t.length===0?null:A.jsxs(A.Fragment,{children:[A.jsx(r.ToolbarToggleButtonGroup,{onValueChange:o=>{t.forEach(i=>{(i.isActive(n)&&!o.includes(i.nodeType)||!i.isActive(n)&&o.includes(i.nodeType))&&i.runCommands(n)})},type:"multiple",value:t.filter(o=>o.isActive(n)).map(o=>o.nodeType),children:t.map(o=>A.jsx(r.ToolbarToggleButtonGroupItem,{disabled:!o.runCommands(n,{can:!0}),startIcon:o.icon,value:o.nodeType},o.nodeType))},"mark"),A.jsx(r.ToolbarSeparator,{})]})}function ag(e){var o;const{items:t,editor:n}=e;return t.length===0?null:A.jsxs(A.Fragment,{children:[A.jsxs(r.DropdownMenu,{children:[A.jsx(r.DropdownMenuTrigger,{disabled:t.length===1,children:A.jsx(r.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:((o=t.find(i=>i.isActive(n)))==null?void 0:o.text)??""})}),A.jsx(r.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map(i=>A.jsx(r.DropdownMenuItem,{onSelect:()=>{i.runCommands(n)},children:i.text},i.nodeType))})]}),A.jsx(r.ToolbarSeparator,{})]})}function Pt(e){return{duration:100,hideOnClick:!0,offset:e,placement:"top-start",appendTo:document.querySelector("body > div")??"parent"}}function lg(e){const{editor:t,nodeTypes:n,labels:o,hideDisabledOptions:i=!1}=e,[s,a]=f.useState(),l=n.includes(w.RichTextNodeType.hyperlink),d=!s,{shouldShowBubbleMenu:c,shouldshowPopover:u}=dg({editor:t}),[h,g]=f.useState(!0);f.useEffect(()=>{g(!1)},[]);function m(x){a(x?"webLink":void 0)}function C(x){a(x?"documentLink":void 0)}function y(x){a(x?"mediaLink":void 0)}return h?null:A.jsxs(A.Fragment,{children:[A.jsx(ne.BubbleMenu,{editor:t,tippyOptions:Pt([-48,0]),shouldShow:c,children:d&&A.jsx(cg,{editor:t,nodeTypes:n,labels:o,setModal:a,hideDisabledOptions:i})}),A.jsx(ne.BubbleMenu,{editor:t,tippyOptions:Pt([-48,0]),shouldShow:x=>u(x,"hyperlink"),children:d&&A.jsx(Gu,{editor:t,onEditWebLink:()=>a("webLink"),onEditDocumentLink:()=>a("documentLink"),onEditMediaLink:()=>a("mediaLink")})}),A.jsx(ne.BubbleMenu,{editor:t,tippyOptions:Pt([0,0]),shouldShow:x=>u(x,"label"),children:A.jsx(Wu,{editor:t})}),l&&A.jsxs(A.Fragment,{children:[A.jsx(og,{open:s==="webLink",setOpen:m,editor:t}),A.jsx(eg,{open:s==="documentLink",setOpen:C,editor:t}),A.jsx(ng,{open:s==="mediaLink",setOpen:y,editor:t})]})]})}function cg(e){const{editor:t,nodeTypes:n,labels:o,setModal:i,hideDisabledOptions:s}=e,a=n.includes("hyperlink"),l=o.length>0,d=ut(Ri,n),c=ut(Mu,n),u=ut(qu,n),h=s&&d.length===1?0:d.length,g=h+c.length+u.length+Number(a);return g===0?null:A.jsxs(r.Toolbar,{children:[h>0&&A.jsx(ag,{items:d,editor:t}),l&&A.jsx(Vu,{labels:o,editor:t}),A.jsx(sg,{items:c,editor:t}),a&&A.jsx(Hu,{editor:t,setModal:i}),A.jsx(Ou,{items:u,editor:t}),g>1&&A.jsx(r.ToolbarButton,{onClick:()=>{t.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})}function dg(e){const{editor:t}=e;function n(i){const{view:s,state:a,from:l,to:d}=i;if(!s.hasFocus())return!1;const{doc:c,selection:u}=a;return!(t.isActive(w.RichTextNodeType.preformatted)||u.empty||c.textBetween(l,d).length===0)}function o(i,s){const{view:a,state:l,from:d,to:c}=i,u=a.state.doc.nodeAt(d),{doc:h,selection:g}=l;return!g.empty||h.textBetween(d,c).length>0?!1:!!(u!=null&&u.marks.some(C=>C.type.name===s))}return{shouldShowBubbleMenu:n,shouldshowPopover:o}}function Qi(e){const{content:t,field:n,id:o,readOnly:i}=e,s=ug(n),a=t&&Jt.converter(s.nodeExtensions).fromPrismic(s.schema,s.nodeTypes,t),l=E.useStableCallback(e.onContentChange),d=r.useEditor({content:a==null?void 0:a.toJSON(),editable:!i,editorProps:{attributes:{class:`${r.contentEditableClass} ${r.contentEditableMultilinePlaceholderClass}`,id:o,tabIndex:"0"}},extensions:s.allComponents,injectCSS:!1,onUpdate({editor:c}){if(c.isEmpty)return l(void 0);const u=Jt.converter(s.nodeExtensions).toPrismic(c.state.doc);l(u)}},[s,i]);return A.jsxs(r.Field,{children:[A.jsx(r.FieldLabel,{htmlFor:o,children:Z(n)}),A.jsxs(r.FieldControl,{children:[d.isEditable&&A.jsx(lg,{editor:d,nodeTypes:s.names,labels:s.labels,hideDisabledOptions:!0}),A.jsx(ne.EditorContent,{editor:d,style:{flexGrow:1}})]})]})}function ug(e){var n,o;const t=`${((n=e.config)==null?void 0:n.multi)??""}-${((o=e.config)==null?void 0:o.single)??""}`;return f.useMemo(()=>{var C;const{extensions:i,nodeTypes:s}=Td(e.config),a=i.filter(gg),l=i.flatMap(y=>y.richTextNodeTypes);s.has(Xn)&&l.push(Xn);const d=i.flatMap(y=>y.component),c=i.filter(hg).map(y=>y.name),u=[...d,...su(e,a),$d.configure({supportedExtensionNames:c}),er,$i.History],h=u.map(y=>y.name),g=X.getSchema(u),m=pg((C=e.config)==null?void 0:C.labels);return{allComponents:u,extensionNames:h,nodeTypes:s,nodeExtensions:a,names:l,schema:g,labels:m}},[t])}function gg(e){return e.extType===Re.Node}function hg(e){return!(e.extType!==Re.Node||e.nodeType!==Ke.Text||e.lockedFormat)}function pg(e){return Array.from(e??[])}function mg(e){const{content:t,field:n,id:o,readOnly:i,onContentChange:s}=e,{placeholder:a,options:l}=n.config??{},d=!!(l!=null&&l.includes("")),c=xg(n),u=fg({content:t,placeholder:a,defaultValue:c,canHaveEmptyValue:d}),h=a&&c===void 0||a===void 0&&!d;return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"arrowDropDownCircle"}),A.jsx(r.FieldLabel,{htmlFor:o,children:Z(n)}),A.jsx(r.FieldControl,{children:A.jsxs(r.Select,{id:o,size:"large",color:"grey",value:u,disabled:i,renderTrigger:()=>A.jsx(r.SelectGhostTrigger,{id:o}),onValueChange:g=>{s(Cg({value:g,placeholder:a}))},children:[h&&A.jsx(r.SelectItem,{value:a||It,children:a||""}),l==null?void 0:l.map(g=>A.jsx(r.SelectItem,{value:g||It,children:g},g))]})})]})}function fg(e){const{content:t,placeholder:n,defaultValue:o,canHaveEmptyValue:i}=e;let{value:s}=t??{};return s===""&&i?It:(s===""&&(s=void 0),s??o??n??"")}function Cg(e){const{placeholder:t}=e;let{value:n}=e;if(n!==t)return n===It&&(n=""),{__TYPE__:"FieldContent",type:"Select",value:n}}function xg(e){var t,n;return((t=e.config)==null?void 0:t.default_value)===void 0||(n=e.config.options)==null?void 0:n[0]}const It=" ";function yg(e){const{field:t,content:n,onContentChange:o,...i}=e;function s(a){if(!a)return o(void 0);e.onContentChange(Fg(a))}return A.jsx(Qi,{...i,field:Sg(t),content:Ig(n),onContentChange:s})}const Bg={__TYPE__:"StructuredTextContent",value:[{type:"paragraph",content:{text:""}}]},iA=Array.from({length:3},()=>({type:"tableRow",content:Array.from({length:2},()=>({type:"tableCell",content:Bg}))}));function Ig(e){return{__TYPE__:"StructuredTextContent",value:[{type:"table",content:jg(e)}]}}function jg(e){const t=K.TableContent.decode(e);return t._tag==="Left"||!t.right.content.some(o=>o.content.some(i=>i.content.value.some(({type:s})=>s)))?iA:t.right.content}function Fg(e){return{__TYPE__:"TableContent",content:e.value.flatMap(t=>t.type==="table"?t.content:[])}}function Sg(e){var t;return{...w.TableCell,config:{...w.TableCell.config,label:(t=e.config)==null?void 0:t.label,allowTargetBlank:!0,multi:[w.TableCell.config.multi,Te.table].join(",")}}}function bg(e){const{id:t,readOnly:n,field:o,content:i,onContentChange:s}=e,a=i!=null&&i.value?cn.dateFromISOString(i.value):void 0;return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"event"}),A.jsx(r.FieldLabel,{id:t,children:Z(o)}),A.jsx(r.FieldControl,{children:A.jsx(r.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:A.jsx(r.DateInput,{mode:"date-time","aria-labelledby":t,disabled:n,value:a,onValueChange:l=>s(Kg(l))})})})]})}function Kg(e){if(e)return{__TYPE__:"FieldContent",type:"Timestamp",value:Ug(e)}}function Ug(e){const t=`${e.getUTCFullYear()}`.padStart(4,"0"),n=`${e.getUTCMonth()+1}`.padStart(2,"0"),o=`${e.getUTCDate()}`.padStart(2,"0"),i=`${e.getUTCHours()}`.padStart(2,"0"),s=`${e.getUTCMinutes()}`.padStart(2,"0");return`${t}-${n}-${o}T${i}:${s}:00+00:00`}function kt(e){const{id:t,readOnly:n,content:o,nestableWidget:i}=e,s=E.useStableCallback(e.onContentChange);return f.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:s};return i.type==="Boolean"?A.jsx(Cl,{...a,field:i,content:K.isBooleanContent(o)?o:void 0}):i.type==="Date"?A.jsx(Il,{...a,field:i,content:K.isDateContent(o)?o:void 0}):i.type==="Timestamp"?A.jsx(bg,{...a,field:i,content:K.isTimestampContent(o)?o:void 0}):i.type==="Image"?A.jsx(Ad,{...a,field:i,content:K.isImageContent(o)?o:void 0}):i.type==="Link"?A.jsx(Cd,{...a,field:i,content:o}):i.type==="Number"?A.jsx(xd,{...a,field:i,content:K.isNumberContent(o)?o:void 0}):i.type==="StructuredText"?A.jsx(Qi,{...a,field:i,content:K.isRichTextContent(o)?o:void 0}):i.type==="Select"?A.jsx(mg,{...a,field:i,content:K.isSelectContent(o)?o:void 0}):i.type==="Text"?A.jsx(si,{...a,field:i,content:K.isTextContent(o)?o:void 0}):i.type==="Embed"?A.jsx(kl,{...a,field:i,content:K.isEmbedContent(o)?o:void 0}):i.type==="Color"?A.jsx(yl,{...a,field:i,content:K.isColorContent(o)?o:void 0}):i.type==="GeoPoint"?A.jsx(El,{...a,field:i,content:K.isGeoPointContent(o)?o:void 0}):i.type==="IntegrationFields"?A.jsx(md,{...a,field:i,content:K.isIntegrationFieldContent(o)?o:void 0}):i.type==="Table"?A.jsx(yg,{...a,field:i,content:K.isTableContent(o)?o:void 0}):null},[o,t,i,s,n])}function Tg(e){const{content:t,id:n,nonRepeatableZone:o,onContentChange:i,readOnly:s}=e,a=f.useMemo(()=>Object.entries(o),[o]);return A.jsx(A.Fragment,{children:a.map(([l,d])=>{const c=t[l];return A.jsx(kt,{id:`${n}.${l}`,readOnly:s,nestableWidget:d,content:K.isNestableContent(c)?c:void 0,onContentChange:u=>{i(wg(t,l,u))}},l)})})}function wg(e,t,n){return n?{...e,[t]:n}:Ge.removeKey(e,t)}function Ln(e){var s,a;const{group:t,content:n,onContentChange:o,...i}=e;return A.jsx(hl,{children:A.jsx(vn,{...i,title:an(t),addItemButtonTitle:`Add item in "${an(t)}"`,repeatable:((s=t.config)==null?void 0:s.repeat)!==!1,repeatableZone:((a=t.config)==null?void 0:a.fields)??{},content:n==null?void 0:n.value,onContentChange:l=>{o({__TYPE__:"GroupContentType",value:l})}})})}function an(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}function Mi(e){const{id:t,readOnly:n,content:o,widget:i}=e,s=E.useStableCallback(e.onContentChange);return f.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:s};return i.type==="Group"?A.jsx(Ln,{...a,group:i,content:K.isGroupContent(o)?o:void 0}):A.jsx(kt,{...a,nestableWidget:i,content:K.isNestableContent(o)?o:void 0})},[o,t,i,s,n])}function vn(e){const{id:t,title:n,addItemButtonTitle:o,content:i,onContentChange:s,readOnly:a,repeatable:l=!0,repeatableZone:d}=e,c=Object.entries(d);let u=i??[kg];!l&&u.length>1&&(u=u.slice(0,1));const{scrollOffsetTop:h}=L(),g=f.useRef(new WeakMap);Lg(g.current,u);function m(B){return g.current.get(B)??"!bugged!"}function C(B){const j=ln();s(O.insertAtIndex(u,B,j))}function y(B){const{index:j,offset:S}=B;s(O.move(u,j,j+S))}function x(B){s(O.removeIndex(u,B))}function I(B,j,S,b){const v=Dg(B,[S,b]),F=Eg(u,[j,v]);vg(g.current,B,v),s(F)}return Object.keys(d).length===0?null:A.jsx(r.Group,{title:n??"Repeatable zone",addItemButtonTitle:o??"Add item in repeatable zone",items:u,maxItems:l?void 0:1,getItemKey:m,onAddItem:C,dnd:{scrollOffsetTop:h,onReorder:s,renderDragPreview:({index:B})=>A.jsx(Rg,{title:n??"Repeatable zone",index:B}),renderDropIndicator:Qg},children:(B,j)=>{const S=new Map(B.value),b=m(B);return A.jsx(r.LazyRender,{keepLoaded:!0,loadWhenSearching:!0,children:A.jsx(r.GroupItem,{index:j,title:`${j+1} • Item`,onMove:y,onDelete:x,children:c.map(([v,F])=>A.jsx(Mi,{id:`${t}[${b}].${v}`,content:S.get(v),widget:F,onContentChange:T=>I(B,j,v,T),readOnly:a},v))})})}})}function Lg(e,t){t.forEach(n=>{e.has(n)||e.set(n,mr.uniqueNumber())})}function vg(e,t,n){const o=e.get(t);o!==void 0&&e.set(n,o)}const kg={__TYPE__:"GroupItemContent",value:[]};function Eg(e,t){const[n,o]=t;return o?e.map((i,s)=>s===n?o:i):e.filter((i,s)=>s!==n)}function Dg(e,t){const[n,o]=t;if(!o){const s=e.value.filter(([a])=>a!==n);return ln(s)}const i=Array.from(new Map(e.value).set(n,o));return ln(i)}function ln(e=[]){return{__TYPE__:"GroupItemContent",value:e}}function Rg(e){const{title:t,index:n}=e;return A.jsxs(r.Box,{padding:{block:8,inline:12},backgroundColor:"grey3",border:!0,borderRadius:6,alignItems:"center",justifyContent:"space-between",width:"100%",children:[A.jsxs("div",{children:[A.jsx(r.Text,{variant:"smallBold",color:"grey11",children:t??"Repeatable zone"}),A.jsxs(r.Text,{variant:"small",color:"grey11",children:[n+1," • Item"]})]}),A.jsx(r.Icon,{name:"dragIndicator",size:"small",color:"grey8"})]})}function Qg(e){const{isDropTarget:t,itemIndex:n,position:o}=e,i=t?A.jsx(r.Line,{color:"purple",thickness:2,sx:{position:"absolute",left:0,right:0,bottom:n===0&&o==="before"?0:void 0}},"line"):void 0;return A.jsx(r.AnimatedElement,{enterDuration:150,children:i})}function Mg(e){const{compositeSlice:t,content:n,onContentChange:o,sliceKey:i,id:s,readOnly:a,header:l}=e,d=wt();function c(){i&&d.update({id:i,requestedFrom:"sliceFieldSet"})}return A.jsxs(r.FieldSet,{id:i&&Tt("sliceFieldSet",i),selected:i?d.isSelected(i):!1,onFocus:c,legend:qg(t),header:l,children:[A.jsx(Tg,{id:s,readOnly:a,nonRepeatableZone:t["non-repeat"]??{},content:n.nonRepeat,onContentChange:u=>{o({...n,nonRepeat:u})}}),A.jsx(vn,{id:s,readOnly:a,repeatableZone:t.repeat??{},content:n.repeat,onContentChange:u=>{o({...n,repeat:u})}})]})}function qg(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const qi={__TYPE__:"ImageContent",edit:{background:"",crop:{x:0,y:0},zoom:0},height:0,width:0,origin:{height:0,width:0,id:"",url:""},url:""};function Pg(e){const{field:t}=e;if(t.type==="Image")return qi}function Og(e){const{content:t,legacySlice:n,sliceKey:o,id:i,readOnly:s,onContentChange:a,header:l}=e,d=wt();function c(){o&&d.update({id:o,requestedFrom:"sliceFieldSet"})}const u=n.type==="Group"?an(n):Z(n);return A.jsx(r.FieldSet,{id:o&&Tt("sliceFieldSet",o),selected:o?d.isSelected(o):!1,onFocus:c,legend:u,header:l,children:n.type==="Group"?A.jsx(Ln,{id:i,readOnly:s,onContentChange:a,group:n,content:K.isGroupContent(t)?t:void 0}):A.jsx(kt,{id:i,readOnly:s,nestableWidget:n,content:K.isNestableContent(t)?t:void 0,onContentChange:h=>{const g=Pg({field:n});!h&&g&&a(g),h&&a(h)}})})}function Vg(e){const{content:t,id:n,slicePrimaryZone:o,onContentChange:i,readOnly:s}=e,a=f.useMemo(()=>Object.entries(o),[o]);return A.jsx(A.Fragment,{children:a.map(([l,d])=>{const c=t[l];return A.jsx(Mi,{id:`${n}.${l}`,readOnly:s,widget:d,content:K.isSlicePrimaryContent(c)?c:void 0,onContentChange:u=>{i(Yg(t,l,u))}},l)})})}function Yg(e,t,n){return n?{...e,[t]:n}:Ge.removeKey(e,t)}function Pi(e){const{config:t,content:n,sliceKey:o,readOnly:i=!1,sharedSlice:s,onContentChange:a,...l}=e,d=Wg(s,n.variation),c=f.useId(),h={id:l.id??c,readOnly:i},g=wt();function m(){o&&g.update({id:o,requestedFrom:"sliceFieldSet"})}return d===void 0?null:A.jsx(jt.Provider,{value:t,children:A.jsx(gl,{children:A.jsxs(r.FieldSet,{id:o&&Tt("sliceFieldSet",o),selected:o?g.isSelected(o):!1,onFocus:m,legend:Hg(s,d),children:[A.jsx(r.LazyRender,{heightEstimate:400,gap:16,keepLoaded:!0,loadWhenSearching:!0,children:A.jsx(Vg,{...h,slicePrimaryZone:d.primary??{},content:n.primary,onContentChange:C=>{a({...n,primary:C})}})}),A.jsx(vn,{...h,repeatableZone:d.items??{},content:n.items,onContentChange:C=>{a({...n,items:C})}})]})})})}function Wg(e,t){return f.useMemo(()=>e.variations.find(n=>n.id===t),[e,t])}function Hg(e,t){return[e.name,t.name].join(" • ")}function rA(e){var d,c;const{sliceZone:t,onChange:n,slices:o,sliceContent:i}=e,s=(c=(d=t.config)==null?void 0:d.labels)==null?void 0:c[i.name];if(!s)return null;const a=s.find(u=>u.name===i.maybeLabel);function l(u){const h=o.value.map(g=>g.key===i.key?{...g,maybeLabel:u}:g);n({...o,value:h})}return A.jsxs(A.Fragment,{children:[A.jsx(r.Text,{component:"span",variant:"smallBold",children:"•"}),A.jsxs(r.DropdownMenu,{children:[A.jsx(r.DropdownMenuTrigger,{children:A.jsx(r.Button,{color:"grey",size:"small",endIcon:"arrowDropDown",invisible:!0,children:(a==null?void 0:a.display)??"Slice variation"})}),A.jsxs(r.DropdownMenuContent,{align:"start",maxHeight:256,children:[A.jsx(r.DropdownMenuItem,{onSelect:()=>l(void 0),endIcon:i.maybeLabel===void 0?A.jsx(r.Icon,{name:"check"}):void 0,children:"..."}),s==null?void 0:s.map(u=>A.jsx(r.DropdownMenuItem,{onSelect:()=>l(u.name),endIcon:u.name===i.maybeLabel?A.jsx(r.Icon,{name:"check"}):void 0,children:u.display??"[Missing display value]"},u.name))]})]})]})}function _g(e){const{content:t,id:n,onContentChange:o,readOnly:i,sliceZone:s}=e,a=L();return A.jsx(A.Fragment,{children:t==null?void 0:t.value.map((l,d)=>{var g,m;const c=(m=(g=s.config)==null?void 0:g.choices)==null?void 0:m[l.name];if(c===void 0)return null;const u=l.widget,h={id:`${n}[${l.key}]`,key:l.key,sliceKey:l.key,onContentChange:C=>{const y={...l,widget:C},x=zg(t,[d,y]);o(x)},readOnly:i};return c.type==="SharedSlice"?K.isSharedSliceContent(u)?A.jsx(Pi,{...h,config:a,sharedSlice:c,content:u}):null:c.type==="Slice"?K.isCompositeSliceContent(u)?A.jsx(Mg,{...h,compositeSlice:c,content:u,header:A.jsx(rA,{sliceContent:l,sliceZone:s,slices:t,onChange:o})}):null:K.isSimpleSliceContent(u)?A.jsx(Og,{...h,legacySlice:c,content:u,header:A.jsx(rA,{sliceContent:l,sliceZone:s,slices:t,onChange:o})}):null})})}function zg(e,[t,n]){return{__TYPE__:"SliceContentType",value:e.value.map((o,i)=>i===t?n:o)}}function Ng(e){const{content:t,metadataFieldType:n,documentId:o,documentContent:i,documentCustomType:s,documentLocale:a,...l}=e,{showAlert:d}=r.useAlert(),[c,u]=f.useState(!1),h=L(),g=f.useMemo(()=>BA(i,s),[i,s]),m=IA(g);async function C(){if(!h.aiSeoMetadataEnabled)return;const{awsBedrockRegion:y,awsBedrockAccessKeyId:x,awsBedrockSecretAccessKey:I,trackMetadataGeneration:B}=h;u(!0);try{const j=await yA({pageTextContent:g,contentLocale:a,config:{region:y,accessKeyId:x,secretAccessKey:I}});e.onContentChange({__TYPE__:"FieldContent",type:"Text",value:j[n]}),B({documentId:o,locale:a,suggestion:j[n],type:n})}catch{d({id:n,title:"Error",subtitle:`Failed to generate SEO metadata for ${sA[n]}`})}u(!1)}return A.jsx(si,{...l,content:t,placeholder:`${sA[n]}..`,endAdornment:A.jsxs(A.Fragment,{children:[A.jsx(Uo,{type:n,value:(t==null?void 0:t.value)||""}),A.jsx(r.Tooltip,{content:m?"Generate SEO metadata from your page content.":"Your page content is too short to generate SEO metadata.",children:A.jsx(r.Button,{disabled:!m,onClick:C,size:"small",color:"grey",startIcon:"autoFixHigh",loading:c,sx:{alignSelf:"center",marginInline:8},children:"Generate"})})]})})}const sA={[le]:"Meta title",[ue]:"Meta description"};function Gg(e){const{id:t,field:n,content:o,onContentChange:i}=e,s=E.useDebounceState({state:(o==null?void 0:o.value)??"",synchronize:!0}),{onEditUID:a}=f.useContext(wo);function l(c){a();const u=Ae.slugify(c);i(Xg(u)),s.set(u)}function d(c){l(c.clipboardData.getData("Text").trim()),c.preventDefault()}return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"tag"}),A.jsx(r.FieldLabel,{htmlFor:t,children:Z(n)}),A.jsx(r.FieldControl,{children:A.jsx(Fe,{id:t,variant:"success",placeholder:De(n,"Enter a unique identifier"),value:s.value,onPaste:d,onValueChange:l,endAdornment:A.jsx(r.AnimatedElement,{enterDuration:150,children:A.jsx(Zg,{uid:s.debouncedValue})})})})]})}function Zg(e){const{uid:t}=e,n=L();return t?n.uidField?A.jsx(r.ErrorBoundary,{children:A.jsx(f.Suspense,{children:A.jsx(Jg,{uid:t})})}):null:A.jsx(r.Badge,{color:"tomato",title:"Required",size:"medium"})}function Jg(e){const t=$g(e),n=L();if(!t.documentId)return null;const o=dn({status:t.status,releaseId:t.releaseId,documentId:t.documentId,versionId:t.versionId,baseUrl:n.baseUrl});return A.jsx("a",{href:o.href,target:"_blank",rel:"noreferrer",children:A.jsx(r.Badge,{color:"tomato",size:"medium",title:A.jsxs(r.Text,{color:"tomato11",variant:"small",children:["Value already used in"," ",A.jsx(r.Text,{color:"tomato11",variant:"small",underline:!0,children:"another document"})]})})})}function Xg(e){return e===""?void 0:{__TYPE__:"UIDContent",value:e}}function $g(e){var g,m,C,y;const{uid:t}=e,n=L();n.uidField||V("uidField");const{coreApiBaseUrl:o,authStrategy:i,customTypeId:s,localeId:a,documentId:l}=n,{data:d}=mn({baseUrl:o,authStrategy:i,uids:[t]}),c=d.results,h=vo({customTypeId:s,languageId:a,documentsWithUid:c,documentId:l,uid:t})[0];return h?{documentId:h.id,versionId:(g=h.versions[0])==null?void 0:g.version_id,status:(m=h.versions[0])==null?void 0:m.status,releaseId:((C=h.versions[0])==null?void 0:C.status)==="release"?(y=h.versions[0])==null?void 0:y.release_id:void 0}:{}}function eh(e){const{id:t,readOnly:n,staticZone:o,content:i,onContentChange:s,documentId:a,documentContent:l,documentCustomType:d,documentLocale:c}=e,u=L(),h=f.useMemo(()=>Object.entries(o),[o]),g=f.useRef(i);if(f.useEffect(()=>{g.current=i},[i]),h.length===0)return null;const m=nh(h),C=gt(i[le])||"Meta title..",y=gt(i[ue])||"Meta description..";return A.jsxs(r.FieldSet,{legend:"Page data",children:[m&&A.jsx(To,{title:C,description:y}),h.map(([x,I])=>{const B={id:`${t}.${x}`,onContentChange:S=>{const{[x]:b,...v}=g.current;s({...v,...S!==void 0&&{[x]:S}})},readOnly:n},j=i[x];return I.type==="UID"?f.createElement(Gg,{...B,content:K.isUIDContent(j)?j:void 0,key:x,field:I}):I.type==="Group"?f.createElement(Ln,{...B,content:K.isGroupContent(j)?j:void 0,group:I,key:x}):u.aiSeoMetadataEnabled&&th(x)&&I.type==="Text"?f.createElement(Ng,{...B,content:K.isTextContent(j)?j:void 0,field:I,key:x,metadataFieldType:x,documentId:a,documentContent:l,documentCustomType:d,documentLocale:c}):f.createElement(kt,{...B,content:K.isNestableContent(j)?j:void 0,key:x,nestableWidget:I})})]})}function th(e){return e===le||e===ue}const nh=e=>{var t,n;return((t=e[0])==null?void 0:t[0])===le&&((n=e[1])==null?void 0:n[0])===ue};function Ah(e){const{id:t,readOnly:n,section:o,content:i,onContentChange:s,documentId:a,documentContent:l,documentCustomType:d,documentLocale:c}=e,[u,h]=ih(o),[g,m]=rh(i);return A.jsxs("div",{style:{display:"flex",flexDirection:"column",position:"relative",zIndex:0},children:[A.jsx(eh,{id:t,readOnly:n,staticZone:u,documentId:a,content:g,onContentChange:C=>s({...m,...C}),documentContent:l,documentCustomType:d,documentLocale:c}),h.map(([C,y])=>{const x=m[C];return A.jsx(_g,{id:`${t}.${C}`,readOnly:n,sliceZone:y,content:x,onContentChange:I=>s({...g,...m,[C]:I})},C)})]})}function oh(e){return e.type==="Choice"||e.type==="Slices"}function ih(e){return Object.entries(e).reduce(([t,n],[o,i])=>(oh(i)?n.push([o,i]):Object.assign(t,{[o]:i}),[t,n]),[{},[]])}function rh(e){return Object.entries(e).reduce(([t,n],[o,i])=>{const s={[o]:i};return Object.assign(K.isSlicesContent(i)?n:t,s),[t,n]},[{},{}])}function sh(e){const{config:t,readOnly:n=!1,customType:o,sectionName:i,documentId:s,content:a,locale:l,onContentChange:d}=e,c=f.useId();if(Ge.isEmpty(o.json))return null;const u=ah(o,i),[h,g]=lh(u,a);return A.jsx(jt.Provider,{value:t,children:A.jsx(ul,{customTypeFormat:o.format,children:A.jsx(Ah,{id:c,readOnly:n,section:u,documentId:s,content:h,onContentChange:m=>d({...g,...m}),documentContent:a,documentCustomType:o,documentLocale:l})})})}function ah(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function lh(e,t){return Object.entries(t).reduce(([n,o],[i,s])=>{const a=e[i]!==void 0,l={[i]:s};return[{...n,...a?l:{}},{...o,...a?{}:l}]},[{},{}])}exports.BasicRole=HA;exports.DeferredCodeBlock=Ot;exports.DocumentEditor=sh;exports.EditorConfigContext=jt;exports.EditorErrorBoundary=Sr;exports.LocaleId=WA;exports.MediaLibrary=Ko;exports.MetadataBadge=Uo;exports.MetadataPreview=To;exports.OnboardingGuide=Al;exports.OnboardingStepId=os;exports.RolesPerLocale=bt;exports.RolesPerLocaleByUser=fn;exports.SelectionManagerProvider=xA;exports.SharedSliceEditor=Pi;exports.SliceSelectionContext=ko;exports.TeamSpace=Kt;exports.UIDContext=wo;exports.createSearchParams=vA;exports.createTeamSpace=ds;exports.defaultGroupContentWithOneItem=mA;exports.defaultImageContentWidget=qi;exports.deleteTeamSpace=gs;exports.documentKeys=de;exports.documentMetaSchema=hn;exports.documentSchema=zr;exports.documentStatus=fA;exports.extractTextFromField=gt;exports.fetchCustomTypes=Rr;exports.frameworkCreateProjectCodeSnippet=gA;exports.frameworkLabels=uA;exports.generateSEOMetadata=yA;exports.getConflictingUidDocuments=vo;exports.getCustomTypesOptions=$e;exports.getDocumentById=et;exports.getDocumentList=pn;exports.getDocumentListOptions=kA;exports.getOnboarding=is;exports.getPageTextContent=BA;exports.getProfile=GA;exports.getRepository=St;exports.getRepositoryTags=qA;exports.getRepositoryV2=As;exports.getSliceSelectionDOMId=Tt;exports.getTeamSpaces=_A;exports.getTeamSpacesOptions=ls;exports.hasUIDField=Lo;exports.invalidateCustomTypes=Mr;exports.invalidateDocumentListData=Zr;exports.isDocumentSearchVersion=Wt;exports.isDocumentVersion=UA;exports.isMissingUID=ll;exports.isPageContentRelevantForAISeo=IA;exports.isValidSimulatorURL=MA;exports.languageSchema=gn;exports.makeSearchFullTextDocumentsQueryString=LA;exports.metaDescriptionConfig=_e;exports.metaDescriptionProperty=ue;exports.metaTitleConfig=He;exports.metaTitleProperty=le;exports.onboardingStateSchema=OA;exports.onboardingToggleResultSchema=YA;exports.onboardingToggleStepResultSchema=VA;exports.prefetchCustomTypes=Dr;exports.prefetchStaticCustomType=Vr;exports.prepareDocumentForSave=Br;exports.profileResponse=NA;exports.repositoryFramework=Ft;exports.repositorySchemaV2=PA;exports.roleMap=ms;exports.searchDocumentStatus=Vt;exports.searchDocuments=EA;exports.searchDocumentsQueryOptions=DA;exports.searchFullTextDocuments=wA;exports.sliceItemContentSchema=Nr;exports.suppressErrors=Ur;exports.throwConfigError=V;exports.toggleOnboarding=ss;exports.toggleOnboardingStep=rs;exports.updateDocumentListData=Gr;exports.updateTeamSpace=us;exports.useCustomType=Qr;exports.useCustomTypes=un;exports.useDocumentList=mn;exports.useInvalidateTeamSpaces=cs;exports.useProfile=Cn;exports.useSelectionManager=je;exports.useSliceSelection=wt;exports.useStaticCustomType=Or;
1
+ "use strict";var OX=Object.defineProperty;var MX=(e,t,n)=>t in e?OX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $t=(e,t,n)=>(MX(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),A=require("@prismicio/editor-ui"),I=require("react"),ii=require("@prismicio/editor-support/URL"),Dr=require("@tanstack/react-query"),Nd=require("@prismicio/editor-support/Object"),ze=require("@prismicio/editor-support/React"),u_=require("@prismicio/editor-support/Date"),_t=require("@prismicio/editor-support/Array"),et=require("@prismicio/editor-support/Suspense"),Zn=require("@prismicio/editor-support/String"),se=require("@prismicio/editor-support/Http"),ni=require("@prismicio/editor-support/Set"),Qi=require("@prismicio/editor-support/Type"),FX=require("@prismicio/editor-support/Map"),d_=require("react-dom"),Wg=require("@prismicio/editor-support/DOM"),jX=require("@prismicio/editor-support/Number"),LX=require("@prismicio/editor-support/Animation");function AU(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Fe=AU(I),DX=AU(d_),mU={next:"Next.js",nuxt:"Nuxt",sveltekit:"SvelteKit",other:"Other"},gU={next:"npx create-next-app@latest",nuxt:"npx nuxi@latest init",sveltekit:"npx sv create"},vU=e=>Array.isArray(e)?`[${e.map(vU).join(", ")}]`:typeof e=="string"?`"${e}"`:e instanceof Date?`${e.getTime()}`:`${e}`,ut=e=>(n,...r)=>{const i=r.map(vU).join(", "),o=n&&r.length?", ":"";return`[${e}(${n}${o}${i})]`},pj=e=>{const t=ut(e);return r=>t(r)},UX=e=>{const t=ut(e);return(...r)=>t("",...r)},ma={at:ut("at"),not:ut("not"),any:ut("any"),in:ut("in"),fulltext:ut("fulltext"),has:pj("has"),missing:pj("missing"),similar:UX("similar"),geopointNear:ut("geopoint.near"),numberLessThan:ut("number.lt"),numberGreaterThan:ut("number.gt"),numberInRange:ut("number.inRange"),dateAfter:ut("date.after"),dateBefore:ut("date.before"),dateBetween:ut("date.between"),dateDayOfMonth:ut("date.day-of-month"),dateDayOfMonthAfter:ut("date.day-of-month-after"),dateDayOfMonthBefore:ut("date.day-of-month-before"),dateDayOfWeek:ut("date.day-of-week"),dateDayOfWeekAfter:ut("date.day-of-week-after"),dateDayOfWeekBefore:ut("date.day-of-week-before"),dateMonth:ut("date.month"),dateMonthAfter:ut("date.month-after"),dateMonthBefore:ut("date.month-before"),dateYear:ut("date.year"),dateHour:ut("date.hour"),dateHourAfter:ut("date.hour-after"),dateHourBefore:ut("date.hour-before")},bs=e=>Array.isArray(e)?e:[e],cr=(e={},t)=>({...e,filters:[...e.filters||[],...bs(t)]}),BX=e=>typeof e=="function"?e:()=>e,yU="7.15.1",ql=e=>`https://prismic.dev/msg/client/v${yU}/${e}`,hj=e=>ma.at("document.tags",bs(e));var PX=Object.defineProperty,WX=(e,t,n)=>t in e?PX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Aj=(e,t,n)=>WX(e,typeof t!="symbol"?t+"":t,n);class Si extends Error{constructor(t="An invalid API response was returned",n,r){super(t),Aj(this,"url"),Aj(this,"response"),this.url=n,this.response=r}}const f_=(e,t)=>{const n=e.find(r=>t(r));if(!n)throw new Si("Ref could not be found.",void 0,void 0);return n},mj=e=>f_(e,t=>t.isMasterRef),WC=(e,t)=>f_(e,n=>n.id===t),NC=(e,t)=>f_(e,n=>n.label===t),NX="io.prismic.preview",gj=e=>e.replace(/%3B/g,";"),KX=e=>{const t=e.split("; ");let n;for(const r of t){const i=r.split("=");if(gj(i[0]).replace(/%3D/g,"=")===NX){n=gj(i.slice(1).join("="));break}}return n},qX=e=>e.replace(/(\n| )*( |{|})(\n| )*/gm,(t,n,r)=>r),fg=e=>ma.any("document.tags",bs(e)),Du=e=>ma.at("document.type",e);class vy extends Si{}class Rw extends Si{}class VX extends Si{}class zX extends vy{}class vj extends vy{}class KC extends vy{}class QX extends Rw{}const Tp={Any:"Any",Document:"Document",Media:"Media",Web:"Web"},HX=e=>{var t;return{link_type:Tp.Document,id:e.id,uid:e.uid||void 0,type:e.type,tags:e.tags,lang:e.lang,url:e.url==null?void 0:e.url,slug:(t=e.slugs)==null?void 0:t[0],...e.data&&Object.keys(e.data).length>0?{data:e.data}:{}}},YX=(e,...t)=>{if(!e)return null;const n="link_type"in e?e:HX(e),[r]=t;let i;switch(typeof r=="function"||r==null?i={linkResolver:r}:i={...r},n.link_type){case Tp.Media:case Tp.Web:return"url"in n?n.url:null;case Tp.Document:{if("id"in n&&i.linkResolver){const o=i.linkResolver(n);if(o!=null)return o}return"url"in n&&n.url?n.url:null}case Tp.Any:default:return null}},GX=e=>new Promise(t=>setTimeout(t,e)),JX=({interval:e}={})=>{const t=[];let n=!1,r=0;const i=()=>{var l;!n&&t.length>0&&((l=t.shift())==null||l(),n=!0)},o=()=>{n=!1,i()},a=async(l,c,u)=>{const f=Date.now()-r;e&&f<e&&await GX(e-f);const p=(async()=>l(...u))();c(p);try{await p}catch{}r=Date.now(),o()},s=(l,c,u)=>{new Promise(f=>{t.push(f)}).then(a.bind(void 0,l,c,u)),(async()=>(await Promise.resolve(),n||i()))()};return(l,...c)=>new Promise(u=>{s(l,u,c)})};var ZX=Object.defineProperty,XX=(e,t,n)=>t in e?ZX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pg=(e,t,n)=>XX(e,typeof t!="symbol"?t+"":t,n);const eee=1500;class tee{constructor(t){if(pg(this,"fetchFn"),pg(this,"fetchOptions"),pg(this,"queuedFetchJobs",{}),pg(this,"dedupedFetchJobs",{}),this.fetchOptions=t.fetchOptions,typeof t.fetch=="function")this.fetchFn=t.fetch;else if(typeof globalThis.fetch=="function")this.fetchFn=globalThis.fetch;else throw new Si("A valid fetch implementation was not provided. In environments where fetch is not available (including Node.js), a fetch implementation must be provided via a polyfill or the `fetch` option.",void 0,void 0);this.fetchFn===globalThis.fetch&&(this.fetchFn=this.fetchFn.bind(globalThis))}async fetch(t,n={}){var r,i,o,a,s;const l={...this.fetchOptions,...n.fetchOptions,headers:{...(r=this.fetchOptions)==null?void 0:r.headers,...(i=n.fetchOptions)==null?void 0:i.headers},signal:((o=n.fetchOptions)==null?void 0:o.signal)||n.signal||((a=this.fetchOptions)==null?void 0:a.signal)};return(s=n.fetchOptions)!=null&&s.body?this.queueFetch(t,l):this.dedupeFetch(t,l)}queueFetch(t,n={}){const r=new URL(t).hostname;return this.queuedFetchJobs[r]||(this.queuedFetchJobs[r]=JX({interval:eee})),this.queuedFetchJobs[r](()=>this.createFetchJob(t,n))}dedupeFetch(t,n={}){let r;return this.dedupedFetchJobs[t]&&this.dedupedFetchJobs[t].has(n.signal)?r=this.dedupedFetchJobs[t].get(n.signal):(this.dedupedFetchJobs[t]=this.dedupedFetchJobs[t]||new Map,r=this.createFetchJob(t,n).finally(()=>{var i,o;(i=this.dedupedFetchJobs[t])==null||i.delete(n.signal),((o=this.dedupedFetchJobs[t])==null?void 0:o.size)===0&&delete this.dedupedFetchJobs[t]}),this.dedupedFetchJobs[t].set(n.signal,r)),r}createFetchJob(t,n={}){return this.fetchFn(t,n).then(async r=>{let i,o;if(r.ok)try{i=await r.json()}catch{}else try{o=await r.text(),i=JSON.parse(o)}catch{}return{status:r.status,headers:r.headers,json:i,text:o}})}}const nee="x-d",ree="x-c",iee={accessToken:"access_token"},oee=e=>{if(typeof e=="string"){if(process.env.NODE_ENV==="development"){const[t,n]=e.split(" "),r=n==="desc"?`{ field: "${t}", direction: "desc" }`:`{ field: "${t}" }`;console.warn(`[@prismicio/client] A string value was provided to the \`orderings\` query parameter. Strings are deprecated. Please convert it to the object form: ${r}. For more details, see ${ql("orderings-must-be-an-array-of-objects")}`)}return e}return e.direction==="desc"?`${e.field} desc`:e.field},aee=(e,t)=>{const{filters:n,predicates:r,...i}=t,o=new URL("documents/search",`${e}/`);if(n){process.env.NODE_ENV==="development"&&!Array.isArray(n)&&console.warn(`[@prismicio/client] A non-array value was provided to the \`filters\` query parameter (\`${n}\`). Non-array values are deprecated. Please convert it to an array. For more details, see ${ql("filters-must-be-an-array")}`);for(const a of bs(n))o.searchParams.append("q",`[${a}]`)}if(r)for(const a of bs(r))o.searchParams.append("q",`[${a}]`);for(const a in i){const s=iee[a]||a;let l=i[a];if(s==="orderings"){const c=i[s];c!=null&&(process.env.NODE_ENV==="development"&&typeof c=="string"&&console.warn(`[@prismicio/client] A string value was provided to the \`orderings\` query parameter. Strings are deprecated. Please convert it to an array of objects. For more details, see ${ql("orderings-must-be-an-array-of-objects")}`),l=`[${bs(c).map(f=>oee(f)).join(",")}]`)}else s==="routes"&&typeof i[s]=="object"&&(l=JSON.stringify(bs(i[s])));l!=null&&o.searchParams.set(s,bs(l).join(","))}return o.searchParams.set(ree,`js-${yU}`),process.env.NODE_ENV==="development"&&o.searchParams.set(nee,"1"),o.toString()},see=e=>/^[a-zA-Z0-9][-a-zA-Z0-9]{2,}[a-zA-Z0-9]$/.test(e),lee=e=>{if(see(e))return`https://${e}.cdn.prismic.io/api/v2`;throw new Si(`An invalid Prismic repository name was given: ${e}`,void 0,void 0)},cee=e=>{try{const t=new URL(e).hostname;if(t.endsWith("prismic.io")||t.endsWith("wroom.io")||t.endsWith("wroom.test"))return t.split(".")[0]}catch{}throw new Si(`An invalid Prismic Document API endpoint was provided: ${e}`,void 0,void 0)},qC=e=>{try{return new URL(e),!0}catch{return!1}};var uee=Object.defineProperty,bU=e=>{throw TypeError(e)},dee=(e,t,n)=>t in e?uee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ms=(e,t,n)=>dee(e,typeof t!="symbol"?t+"":t,n),CU=(e,t,n)=>t.has(e)||bU("Cannot "+n),yj=(e,t,n)=>(CU(e,t,"read from private field"),n?n.call(e):t.get(e)),fee=(e,t,n)=>t.has(e)?bU("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),pee=(e,t,n,r)=>(CU(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ip;const hee=100,Aee=5e3,mee=500,gee=1e3,vee=3;var So;(function(e){e.Master="Master",e.ReleaseID="ReleaseID",e.ReleaseLabel="ReleaseLabel",e.Manual="Manual"})(So||(So={}));class yee extends tee{constructor(t,n={}){if(super(n),fee(this,Ip),ms(this,"documentAPIEndpoint"),ms(this,"accessToken"),ms(this,"routes"),ms(this,"brokenRoute"),ms(this,"defaultParams"),ms(this,"refState",{mode:So.Master,autoPreviewsEnabled:!0}),ms(this,"cachedRepository"),ms(this,"cachedRepositoryExpiration",0),(n.documentAPIEndpoint||qC(t))&&process.env.NODE_ENV==="development"){const r=n.documentAPIEndpoint||t;if(/\.prismic\.io\/(?!api\/v2\/?)/i.test(r))throw new Si("@prismicio/client only supports Prismic Rest API V2. Please provide only the repository name to the first createClient() parameter or use the getRepositoryEndpoint() helper to generate a valid Rest API V2 endpoint URL.",void 0,void 0);const i=new URL(r).hostname.toLowerCase();i.endsWith(".prismic.io")&&!i.endsWith(".cdn.prismic.io")&&console.warn(`[@prismicio/client] The client was created with a non-CDN endpoint. Convert it to the CDN endpoint for better performance. For more details, see ${ql("endpoint-must-use-cdn")}`),n.documentAPIEndpoint&&qC(t)&&t!==n.documentAPIEndpoint&&console.warn(`[@prismicio/client] Multiple incompatible endpoints were provided. Create the client using a repository name to prevent this error. For more details, see ${ql("prefer-repository-name")}`)}if(qC(t)){this.documentAPIEndpoint=t;try{this.repositoryName=cee(t)}catch{console.warn(`[@prismicio/client] A repository name could not be inferred from the provided endpoint (\`${t}\`). Some methods will be disabled. Create the client using a repository name to prevent this warning. For more details, see ${ql("prefer-repository-name")}`)}}else this.documentAPIEndpoint=n.documentAPIEndpoint||lee(t),this.repositoryName=t;this.accessToken=n.accessToken,this.routes=n.routes,this.brokenRoute=n.brokenRoute,this.defaultParams=n.defaultParams,n.ref&&this.queryContentFromRef(n.ref),this.graphQLFetch=this.graphQLFetch.bind(this)}set repositoryName(t){pee(this,Ip,t)}get repositoryName(){if(!yj(this,Ip))throw new Si(`A repository name is required for this method but one could not be inferred from the provided API endpoint (\`${this.documentAPIEndpoint}\`). To fix this error, provide a repository name when creating the client. For more details, see ${ql("prefer-repository-name")}`,void 0,void 0);return yj(this,Ip)}set endpoint(t){this.documentAPIEndpoint=t}get endpoint(){return this.documentAPIEndpoint}enableAutoPreviews(){this.refState.autoPreviewsEnabled=!0}enableAutoPreviewsFromReq(t){this.refState.httpRequest=t,this.refState.autoPreviewsEnabled=!0}disableAutoPreviews(){this.refState.autoPreviewsEnabled=!1}async get(t){const{data:n}=await this._get(t);return n}async getFirst(t){var n;const r={...t};!(t&&t.page)&&!(t!=null&&t.pageSize)&&(r.pageSize=((n=this.defaultParams)==null?void 0:n.pageSize)??1);const{data:i,url:o}=await this._get(r),a=i.results[0];if(a)return a;throw new Rw("No documents were returned",o,void 0)}async dangerouslyGetAll(t={}){var n;const{limit:r=1/0,...i}=t,o={...i,pageSize:Math.min(r,i.pageSize||((n=this.defaultParams)==null?void 0:n.pageSize)||hee)},a=[];let s;for(;(!s||s.next_page)&&a.length<r;){const l=s?s.page+1:void 0;s=await this.get({...o,page:l}),a.push(...s.results),s.next_page&&await new Promise(c=>setTimeout(c,mee))}return a.slice(0,r)}async getByID(t,n){return await this.getFirst(cr(n,ma.at("document.id",t)))}async getByIDs(t,n){return await this.get(cr(n,ma.in("document.id",t)))}async getAllByIDs(t,n){return await this.dangerouslyGetAll(cr(n,ma.in("document.id",t)))}async getByUID(t,n,r){return await this.getFirst(cr(r,[Du(t),ma.at(`my.${t}.uid`,n)]))}async getByUIDs(t,n,r){return await this.get(cr(r,[Du(t),ma.in(`my.${t}.uid`,n)]))}async getAllByUIDs(t,n,r){return await this.dangerouslyGetAll(cr(r,[Du(t),ma.in(`my.${t}.uid`,n)]))}async getSingle(t,n){return await this.getFirst(cr(n,Du(t)))}async getByType(t,n){return await this.get(cr(n,Du(t)))}async getAllByType(t,n){return await this.dangerouslyGetAll(cr(n,Du(t)))}async getByTag(t,n){return await this.get(cr(n,fg(t)))}async getAllByTag(t,n){return await this.dangerouslyGetAll(cr(n,fg(t)))}async getByEveryTag(t,n){return await this.get(cr(n,hj(t)))}async getAllByEveryTag(t,n){return await this.dangerouslyGetAll(cr(n,hj(t)))}async getBySomeTags(t,n){return await this.get(cr(n,fg(t)))}async getAllBySomeTags(t,n){return await this.dangerouslyGetAll(cr(n,fg(t)))}async getRepository(t){const n=new URL(this.documentAPIEndpoint);return this.accessToken&&n.searchParams.set("access_token",this.accessToken),await this.fetch(n.toString(),t)}async getRefs(t){return(await this.getRepository(t)).refs}async getRefByID(t,n){const r=await this.getRefs(n);return WC(r,t)}async getRefByLabel(t,n){const r=await this.getRefs(n);return NC(r,t)}async getMasterRef(t){const n=await this.getRefs(t);return mj(n)}async getReleases(t){return(await this.getRefs(t)).filter(r=>!r.isMasterRef)}async getReleaseByID(t,n){const r=await this.getReleases(n);return WC(r,t)}async getReleaseByLabel(t,n){const r=await this.getReleases(n);return NC(r,t)}async getTags(t){try{const n=await this.getCachedRepositoryForm("tags",t),r=new URL(n.action);return this.accessToken&&r.searchParams.set("access_token",this.accessToken),await this.fetch(r.toString(),t)}catch{return(await this.getRepository(t)).tags}}async buildQueryURL({signal:t,fetchOptions:n,...r}={}){const i=r.ref||await this.getResolvedRefString({signal:t,fetchOptions:n}),o=r.integrationFieldsRef||(await this.getCachedRepository({signal:t,fetchOptions:n})).integrationFieldsRef||void 0;return aee(this.documentAPIEndpoint,{...this.defaultParams,...r,ref:i,integrationFieldsRef:o,routes:r.routes||this.routes,brokenRoute:r.brokenRoute||this.brokenRoute,accessToken:r.accessToken||this.accessToken})}async resolvePreviewURL(t){var n,r;let i=t.documentID,o=t.previewToken;if(typeof globalThis.location<"u"){const a=new URLSearchParams(globalThis.location.search);i=i||a.get("documentId"),o=o||a.get("token")}else if(this.refState.httpRequest){if("query"in this.refState.httpRequest)i=i||((n=this.refState.httpRequest.query)==null?void 0:n.documentId),o=o||((r=this.refState.httpRequest.query)==null?void 0:r.token);else if("url"in this.refState.httpRequest&&this.refState.httpRequest.url){const a=new URL(this.refState.httpRequest.url,"missing-host://").searchParams;i=i||a.get("documentId"),o=o||a.get("token")}}if(i!=null&&o!=null){const a=await this.getByID(i,{ref:o,lang:"*",signal:t.signal,fetchOptions:t.fetchOptions}),s=YX(a,{linkResolver:t.linkResolver});if(typeof s=="string")return s}return t.defaultURL}queryLatestContent(){this.refState.mode=So.Master}queryContentFromReleaseByID(t){this.refState={...this.refState,mode:So.ReleaseID,releaseID:t}}queryContentFromReleaseByLabel(t){this.refState={...this.refState,mode:So.ReleaseLabel,releaseLabel:t}}queryContentFromRef(t){this.refState={...this.refState,mode:So.Manual,ref:t}}async graphQLFetch(t,n){const r=await this.getCachedRepository(),i=await this.getResolvedRefString(),o={"Prismic-ref":i,Authorization:this.accessToken?`Token ${this.accessToken}`:"",...n?n.headers:{}};r.integrationFieldsRef&&(o["Prismic-integration-field-ref"]=r.integrationFieldsRef);const a={};for(const c in o)o[c]&&(a[c.toLowerCase()]=o[c]);const s=new URL(t);s.searchParams.set("ref",i);const l=s.searchParams.get("query");return l&&s.searchParams.set("query",qX(l)),await this.fetchFn(s.toString(),{...n,headers:a})}async getCachedRepository(t){return(!this.cachedRepository||Date.now()>=this.cachedRepositoryExpiration)&&(this.cachedRepositoryExpiration=Date.now()+Aee,this.cachedRepository=await this.getRepository(t)),this.cachedRepository}async getCachedRepositoryForm(t,n){const i=(await this.getCachedRepository(n)).forms[t];if(!i)throw new Si(`Form with name "${t}" could not be found`,void 0,void 0);return i}async getResolvedRefString(t){var n,r;if(this.refState.autoPreviewsEnabled){let a,s;if((n=this.refState.httpRequest)!=null&&n.headers?"get"in this.refState.httpRequest.headers&&typeof this.refState.httpRequest.headers.get=="function"?s=this.refState.httpRequest.headers.get("cookie"):"cookie"in this.refState.httpRequest.headers&&(s=this.refState.httpRequest.headers.cookie):(r=globalThis.document)!=null&&r.cookie&&(s=globalThis.document.cookie),s&&(a=KX(s)),a)return a}const i=await this.getCachedRepository(t),o=this.refState.mode;if(o===So.ReleaseID)return WC(i.refs,this.refState.releaseID).ref;if(o===So.ReleaseLabel)return NC(i.refs,this.refState.releaseLabel).ref;if(o===So.Manual){const a=await BX(this.refState.ref)();if(typeof a=="string")return a}return mj(i.refs).ref}async _get(t,n=0){var r,i;const o=await this.buildQueryURL(t);try{return{data:await this.fetch(o,t),url:o}}catch(a){if(!(a instanceof KC||a instanceof vj)||n>=vee-1)throw a;t!=null&&t.ref||(this.cachedRepository=void 0);const s=(i=(r=a.message.match(/Master ref is: (?<ref>.*)$/))==null?void 0:r.groups)==null?void 0:i.ref;if(!s)throw a;const l=new URL(o).searchParams.get("ref"),c=a instanceof KC?"invalid":"expired";return console.warn(`The ref (${l}) was ${c}. Now retrying with the latest master ref (${s}). If you were previewing content, the response will not include draft content.`),await this._get({...t,ref:s},n+1)}}async fetch(t,n={}){const r=await super.fetch(t,n);if(r.status!==404&&r.status!==429&&r.json==null)throw new Si(void 0,t,r.json||r.text);switch(r.status){case 200:case 201:return r.json;case 400:throw new VX(r.json.message,t,r.json);case 401:case 403:throw new vy(r.json.error||r.json.message,t,r.json);case 404:throw r.json===void 0?new QX(`Prismic repository not found. Check that "${this.documentAPIEndpoint}" is pointing to the correct repository.`,t,t.startsWith(this.documentAPIEndpoint)?void 0:r.text):r.json.type==="api_notfound_error"?new KC(r.json.message,t,r.json):r.json.type==="api_security_error"&&/preview token.*expired/i.test(r.json.message)?new zX(r.json.message,t,r.json):new Rw(r.json.message,t,r.json);case 410:throw new vj(r.json.message,t,r.json);case 429:{const i=Number(r.headers.get("retry-after")),o=Number.isNaN(i)?gee:i;return await new Promise((a,s)=>{setTimeout(async()=>{try{a(await this.fetch(t,n))}catch(l){s(l)}},o)})}}throw new Si(void 0,t,r.json)}}Ip=new WeakMap;const bee=(e,t)=>new yee(e,t);var Ve;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(const s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Ve||(Ve={}));var $w;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})($w||($w={}));const oe=Ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Cs=e=>{switch(typeof e){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(e)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(e)?oe.array:e===null?oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?oe.promise:typeof Map<"u"&&e instanceof Map?oe.map:typeof Set<"u"&&e instanceof Set?oe.set:typeof Date<"u"&&e instanceof Date?oe.date:oe.object;default:return oe.unknown}},J=Ve.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Cee=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class oi extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,l=0;for(;l<a.path.length;){const c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return i(this),r}static assert(t){if(!(t instanceof oi))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ve.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}oi.create=e=>new oi(e);const dd=(e,t)=>{let n;switch(e.code){case J.invalid_type:e.received===oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case J.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ve.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ve.joinValues(e.keys,", ")}`;break;case J.invalid_union:n="Invalid input";break;case J.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ve.joinValues(e.options)}`;break;case J.invalid_enum_value:n=`Invalid enum value. Expected ${Ve.joinValues(e.options)}, received '${e.received}'`;break;case J.invalid_arguments:n="Invalid function arguments";break;case J.invalid_return_type:n="Invalid function return type";break;case J.invalid_date:n="Invalid date";break;case J.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ve.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case J.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case J.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case J.custom:n="Invalid input";break;case J.invalid_intersection_types:n="Intersection results could not be merged";break;case J.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case J.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ve.assertNever(e)}return{message:n}};let SU=dd;function See(e){SU=e}function fv(){return SU}const pv=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let s="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)s=c(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}},wee=[];function ie(e,t){const n=fv(),r=pv({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===dd?void 0:dd].filter(i=>!!i)});e.common.issues.push(r)}class Xn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Ee;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const o=await i.key,a=await i.value;r.push({key:o,value:a})}return Xn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return Ee;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const Ee=Object.freeze({status:"aborted"}),nd=e=>({status:"dirty",value:e}),mr=e=>({status:"valid",value:e}),kw=e=>e.status==="aborted",Ow=e=>e.status==="dirty",rh=e=>e.status==="valid",ih=e=>typeof Promise<"u"&&e instanceof Promise;function hv(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function wU(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n}var Ae;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ae||(Ae={}));var Ep,Rp;class Oo{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const bj=(e,t)=>{if(rh(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new oi(e.common.issues);return this._error=n,this._error}}};function Le(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>{var l,c;const{message:u}=e;return a.code==="invalid_enum_value"?{message:u??s.defaultError}:typeof s.data>"u"?{message:(l=u??r)!==null&&l!==void 0?l:s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:(c=u??n)!==null&&c!==void 0?c:s.defaultError}},description:i}}class Pe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Cs(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Cs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Xn,ctx:{common:t.parent.common,data:t.data,parsedType:Cs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(ih(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Cs(t)},o=this._parseSync({data:t,path:i.path,parent:i});return bj(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Cs(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(ih(i)?i:Promise.resolve(i));return bj(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),s=()=>o.addIssue({code:J.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Gi({schema:this,typeName:Te.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Io.create(this,this._def)}nullable(){return Bs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Hi.create(this,this._def)}promise(){return pd.create(this,this._def)}or(t){return lh.create([this,t],this._def)}and(t){return ch.create(this,t,this._def)}transform(t){return new Gi({...Le(this._def),schema:this,typeName:Te.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new hh({...Le(this._def),innerType:this,defaultValue:n,typeName:Te.ZodDefault})}brand(){return new p_({typeName:Te.ZodBranded,type:this,...Le(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Ah({...Le(this._def),innerType:this,catchValue:n,typeName:Te.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Jh.create(this,t)}readonly(){return mh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const xee=/^c[^\s-]{8,}$/i,_ee=/^[0-9a-z]+$/,Tee=/^[0-9A-HJKMNP-TV-Z]{26}$/,Iee=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Eee=/^[a-z0-9_-]{21}$/i,Ree=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,$ee=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kee="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let VC;const Oee=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Mee=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Fee=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xU="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",jee=new RegExp(`^${xU}$`);function _U(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function Lee(e){return new RegExp(`^${_U(e)}$`)}function TU(e){let t=`${xU}T${_U(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Dee(e,t){return!!((t==="v4"||!t)&&Oee.test(e)||(t==="v6"||!t)&&Mee.test(e))}class Vi extends Pe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==oe.string){const o=this._getOrReturnCtx(t);return ie(o,{code:J.invalid_type,expected:oe.string,received:o.parsedType}),Ee}const r=new Xn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),ie(i,{code:J.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),ie(i,{code:J.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(t,i),a?ie(i,{code:J.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&ie(i,{code:J.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")$ee.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"email",code:J.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")VC||(VC=new RegExp(kee,"u")),VC.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"emoji",code:J.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Iee.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"uuid",code:J.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")Eee.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"nanoid",code:J.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")xee.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"cuid",code:J.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")_ee.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"cuid2",code:J.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Tee.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"ulid",code:J.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),ie(i,{validation:"url",code:J.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"regex",code:J.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),ie(i,{code:J.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),ie(i,{code:J.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),ie(i,{code:J.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?TU(o).test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{code:J.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?jee.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{code:J.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?Lee(o).test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{code:J.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?Ree.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"duration",code:J.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?Dee(t.data,o.version)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"ip",code:J.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?Fee.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"base64",code:J.invalid_string,message:o.message}),r.dirty()):Ve.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:J.invalid_string,...Ae.errToObj(r)})}_addCheck(t){return new Vi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ae.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ae.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ae.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ae.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ae.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ae.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ae.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ae.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ae.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ae.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...Ae.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Ae.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ae.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ae.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ae.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ae.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ae.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ae.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ae.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ae.errToObj(n)})}nonempty(t){return this.min(1,Ae.errToObj(t))}trim(){return new Vi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Vi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Vi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Vi.create=e=>{var t;return new Vi({checks:[],typeName:Te.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Le(e)})};function Uee(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class Ls extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==oe.number){const o=this._getOrReturnCtx(t);return ie(o,{code:J.invalid_type,expected:oe.number,received:o.parsedType}),Ee}let r;const i=new Xn;for(const o of this._def.checks)o.kind==="int"?Ve.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ie(r,{code:J.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ie(r,{code:J.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ie(r,{code:J.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Uee(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),ie(r,{code:J.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ie(r,{code:J.not_finite,message:o.message}),i.dirty()):Ve.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ae.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ae.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ae.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ae.toString(n))}setLimit(t,n,r,i){return new Ls({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ae.toString(i)}]})}_addCheck(t){return new Ls({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ae.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ae.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ae.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ae.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ae.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ae.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ve.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Ls.create=e=>new Ls({checks:[],typeName:Te.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Le(e)});class Ds extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==oe.bigint){const o=this._getOrReturnCtx(t);return ie(o,{code:J.invalid_type,expected:oe.bigint,received:o.parsedType}),Ee}let r;const i=new Xn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ie(r,{code:J.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ie(r,{code:J.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ie(r,{code:J.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Ve.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ae.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ae.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ae.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ae.toString(n))}setLimit(t,n,r,i){return new Ds({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ae.toString(i)}]})}_addCheck(t){return new Ds({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ae.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ae.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ds.create=e=>{var t;return new Ds({checks:[],typeName:Te.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Le(e)})};class oh extends Pe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==oe.boolean){const r=this._getOrReturnCtx(t);return ie(r,{code:J.invalid_type,expected:oe.boolean,received:r.parsedType}),Ee}return mr(t.data)}}oh.create=e=>new oh({typeName:Te.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Le(e)});class dc extends Pe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==oe.date){const o=this._getOrReturnCtx(t);return ie(o,{code:J.invalid_type,expected:oe.date,received:o.parsedType}),Ee}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ie(o,{code:J.invalid_date}),Ee}const r=new Xn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),ie(i,{code:J.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),ie(i,{code:J.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ve.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new dc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ae.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ae.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}dc.create=e=>new dc({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Te.ZodDate,...Le(e)});class Av extends Pe{_parse(t){if(this._getType(t)!==oe.symbol){const r=this._getOrReturnCtx(t);return ie(r,{code:J.invalid_type,expected:oe.symbol,received:r.parsedType}),Ee}return mr(t.data)}}Av.create=e=>new Av({typeName:Te.ZodSymbol,...Le(e)});class ah extends Pe{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ie(r,{code:J.invalid_type,expected:oe.undefined,received:r.parsedType}),Ee}return mr(t.data)}}ah.create=e=>new ah({typeName:Te.ZodUndefined,...Le(e)});class sh extends Pe{_parse(t){if(this._getType(t)!==oe.null){const r=this._getOrReturnCtx(t);return ie(r,{code:J.invalid_type,expected:oe.null,received:r.parsedType}),Ee}return mr(t.data)}}sh.create=e=>new sh({typeName:Te.ZodNull,...Le(e)});class fd extends Pe{constructor(){super(...arguments),this._any=!0}_parse(t){return mr(t.data)}}fd.create=e=>new fd({typeName:Te.ZodAny,...Le(e)});class Gl extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return mr(t.data)}}Gl.create=e=>new Gl({typeName:Te.ZodUnknown,...Le(e)});class Ca extends Pe{_parse(t){const n=this._getOrReturnCtx(t);return ie(n,{code:J.invalid_type,expected:oe.never,received:n.parsedType}),Ee}}Ca.create=e=>new Ca({typeName:Te.ZodNever,...Le(e)});class mv extends Pe{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ie(r,{code:J.invalid_type,expected:oe.void,received:r.parsedType}),Ee}return mr(t.data)}}mv.create=e=>new mv({typeName:Te.ZodVoid,...Le(e)});class Hi extends Pe{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==oe.array)return ie(n,{code:J.invalid_type,expected:oe.array,received:n.parsedType}),Ee;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(a||s)&&(ie(n,{code:a?J.too_big:J.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ie(n,{code:J.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ie(n,{code:J.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>i.type._parseAsync(new Oo(n,a,n.path,s)))).then(a=>Xn.mergeArray(r,a));const o=[...n.data].map((a,s)=>i.type._parseSync(new Oo(n,a,n.path,s)));return Xn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Hi({...this._def,minLength:{value:t,message:Ae.toString(n)}})}max(t,n){return new Hi({...this._def,maxLength:{value:t,message:Ae.toString(n)}})}length(t,n){return new Hi({...this._def,exactLength:{value:t,message:Ae.toString(n)}})}nonempty(t){return this.min(1,t)}}Hi.create=(e,t)=>new Hi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Te.ZodArray,...Le(t)});function qu(e){if(e instanceof kt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Io.create(qu(r))}return new kt({...e._def,shape:()=>t})}else return e instanceof Hi?new Hi({...e._def,type:qu(e.element)}):e instanceof Io?Io.create(qu(e.unwrap())):e instanceof Bs?Bs.create(qu(e.unwrap())):e instanceof Mo?Mo.create(e.items.map(t=>qu(t))):e}class kt extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ve.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==oe.object){const c=this._getOrReturnCtx(t);return ie(c,{code:J.invalid_type,expected:oe.object,received:c.parsedType}),Ee}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Ca&&this._def.unknownKeys==="strip"))for(const c in i.data)a.includes(c)||s.push(c);const l=[];for(const c of a){const u=o[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Oo(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Ca){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")s.length>0&&(ie(i,{code:J.unrecognized_keys,keys:s}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of s){const f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Oo(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const f=await u.key,p=await u.value;c.push({key:f,value:p,alwaysSet:u.alwaysSet})}return c}).then(c=>Xn.mergeObjectSync(r,c)):Xn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Ae.errToObj,new kt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,s;const l=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=Ae.errToObj(t).message)!==null&&s!==void 0?s:l}:{message:l}}}:{}})}strip(){return new kt({...this._def,unknownKeys:"strip"})}passthrough(){return new kt({...this._def,unknownKeys:"passthrough"})}extend(t){return new kt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new kt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Te.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new kt({...this._def,catchall:t})}pick(t){const n={};return Ve.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new kt({...this._def,shape:()=>n})}omit(t){const n={};return Ve.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new kt({...this._def,shape:()=>n})}deepPartial(){return qu(this)}partial(t){const n={};return Ve.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new kt({...this._def,shape:()=>n})}required(t){const n={};return Ve.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Io;)o=o._def.innerType;n[r]=o}}),new kt({...this._def,shape:()=>n})}keyof(){return IU(Ve.objectKeys(this.shape))}}kt.create=(e,t)=>new kt({shape:()=>e,unknownKeys:"strip",catchall:Ca.create(),typeName:Te.ZodObject,...Le(t)});kt.strictCreate=(e,t)=>new kt({shape:()=>e,unknownKeys:"strict",catchall:Ca.create(),typeName:Te.ZodObject,...Le(t)});kt.lazycreate=(e,t)=>new kt({shape:e,unknownKeys:"strip",catchall:Ca.create(),typeName:Te.ZodObject,...Le(t)});class lh extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new oi(s.ctx.common.issues));return ie(n,{code:J.invalid_union,unionErrors:a}),Ee}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(l=>new oi(l));return ie(n,{code:J.invalid_union,unionErrors:s}),Ee}}get options(){return this._def.options}}lh.create=(e,t)=>new lh({options:e,typeName:Te.ZodUnion,...Le(t)});const da=e=>e instanceof dh?da(e.schema):e instanceof Gi?da(e.innerType()):e instanceof fh?[e.value]:e instanceof Us?e.options:e instanceof ph?Ve.objectValues(e.enum):e instanceof hh?da(e._def.innerType):e instanceof ah?[void 0]:e instanceof sh?[null]:e instanceof Io?[void 0,...da(e.unwrap())]:e instanceof Bs?[null,...da(e.unwrap())]:e instanceof p_||e instanceof mh?da(e.unwrap()):e instanceof Ah?da(e._def.innerType):[];class yy extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.object)return ie(n,{code:J.invalid_type,expected:oe.object,received:n.parsedType}),Ee;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:J.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ee)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=da(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new yy({typeName:Te.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Le(r)})}}function Mw(e,t){const n=Cs(e),r=Cs(t);if(e===t)return{valid:!0,data:e};if(n===oe.object&&r===oe.object){const i=Ve.objectKeys(t),o=Ve.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const l=Mw(e[s],t[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===oe.array&&r===oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],s=t[o],l=Mw(a,s);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===oe.date&&r===oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ch extends Pe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(kw(o)||kw(a))return Ee;const s=Mw(o.value,a.value);return s.valid?((Ow(o)||Ow(a))&&n.dirty(),{status:n.value,value:s.data}):(ie(r,{code:J.invalid_intersection_types}),Ee)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ch.create=(e,t,n)=>new ch({left:e,right:t,typeName:Te.ZodIntersection,...Le(n)});class Mo extends Pe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.array)return ie(r,{code:J.invalid_type,expected:oe.array,received:r.parsedType}),Ee;if(r.data.length<this._def.items.length)return ie(r,{code:J.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ee;!this._def.rest&&r.data.length>this._def.items.length&&(ie(r,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Oo(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Xn.mergeArray(n,a)):Xn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Mo({...this._def,rest:t})}}Mo.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Mo({items:e,typeName:Te.ZodTuple,rest:null,...Le(t)})};class uh extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.object)return ie(r,{code:J.invalid_type,expected:oe.object,received:r.parsedType}),Ee;const i=[],o=this._def.keyType,a=this._def.valueType;for(const s in r.data)i.push({key:o._parse(new Oo(r,s,r.path,s)),value:a._parse(new Oo(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?Xn.mergeObjectAsync(n,i):Xn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Pe?new uh({keyType:t,valueType:n,typeName:Te.ZodRecord,...Le(r)}):new uh({keyType:Vi.create(),valueType:t,typeName:Te.ZodRecord,...Le(n)})}}class gv extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.map)return ie(r,{code:J.invalid_type,expected:oe.map,received:r.parsedType}),Ee;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,l],c)=>({key:i._parse(new Oo(r,s,r.path,[c,"key"])),value:o._parse(new Oo(r,l,r.path,[c,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of a){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Ee;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const l of a){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Ee;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}}}}gv.create=(e,t,n)=>new gv({valueType:t,keyType:e,typeName:Te.ZodMap,...Le(n)});class fc extends Pe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.set)return ie(r,{code:J.invalid_type,expected:oe.set,received:r.parsedType}),Ee;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ie(r,{code:J.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ie(r,{code:J.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Ee;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const s=[...r.data.values()].map((l,c)=>o._parse(new Oo(r,l,r.path,c)));return r.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(t,n){return new fc({...this._def,minSize:{value:t,message:Ae.toString(n)}})}max(t,n){return new fc({...this._def,maxSize:{value:t,message:Ae.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}fc.create=(e,t)=>new fc({valueType:e,minSize:null,maxSize:null,typeName:Te.ZodSet,...Le(t)});class od extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.function)return ie(n,{code:J.invalid_type,expected:oe.function,received:n.parsedType}),Ee;function r(s,l){return pv({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fv(),dd].filter(c=>!!c),issueData:{code:J.invalid_arguments,argumentsError:l}})}function i(s,l){return pv({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,fv(),dd].filter(c=>!!c),issueData:{code:J.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof pd){const s=this;return mr(async function(...l){const c=new oi([]),u=await s._def.args.parseAsync(l,o).catch(h=>{throw c.addIssue(r(l,h)),c}),f=await Reflect.apply(a,this,u);return await s._def.returns._def.type.parseAsync(f,o).catch(h=>{throw c.addIssue(i(f,h)),c})})}else{const s=this;return mr(function(...l){const c=s._def.args.safeParse(l,o);if(!c.success)throw new oi([r(l,c.error)]);const u=Reflect.apply(a,this,c.data),f=s._def.returns.safeParse(u,o);if(!f.success)throw new oi([i(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new od({...this._def,args:Mo.create(t).rest(Gl.create())})}returns(t){return new od({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new od({args:t||Mo.create([]).rest(Gl.create()),returns:n||Gl.create(),typeName:Te.ZodFunction,...Le(r)})}}class dh extends Pe{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}dh.create=(e,t)=>new dh({getter:e,typeName:Te.ZodLazy,...Le(t)});class fh extends Pe{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ie(n,{received:n.data,code:J.invalid_literal,expected:this._def.value}),Ee}return{status:"valid",value:t.data}}get value(){return this._def.value}}fh.create=(e,t)=>new fh({value:e,typeName:Te.ZodLiteral,...Le(t)});function IU(e,t){return new Us({values:e,typeName:Te.ZodEnum,...Le(t)})}class Us extends Pe{constructor(){super(...arguments),Ep.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ie(n,{expected:Ve.joinValues(r),received:n.parsedType,code:J.invalid_type}),Ee}if(hv(this,Ep,"f")||wU(this,Ep,new Set(this._def.values),"f"),!hv(this,Ep,"f").has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ie(n,{received:n.data,code:J.invalid_enum_value,options:r}),Ee}return mr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Us.create(t,{...this._def,...n})}exclude(t,n=this._def){return Us.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Ep=new WeakMap;Us.create=IU;class ph extends Pe{constructor(){super(...arguments),Rp.set(this,void 0)}_parse(t){const n=Ve.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==oe.string&&r.parsedType!==oe.number){const i=Ve.objectValues(n);return ie(r,{expected:Ve.joinValues(i),received:r.parsedType,code:J.invalid_type}),Ee}if(hv(this,Rp,"f")||wU(this,Rp,new Set(Ve.getValidEnumValues(this._def.values)),"f"),!hv(this,Rp,"f").has(t.data)){const i=Ve.objectValues(n);return ie(r,{received:r.data,code:J.invalid_enum_value,options:i}),Ee}return mr(t.data)}get enum(){return this._def.values}}Rp=new WeakMap;ph.create=(e,t)=>new ph({values:e,typeName:Te.ZodNativeEnum,...Le(t)});class pd extends Pe{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.promise&&n.common.async===!1)return ie(n,{code:J.invalid_type,expected:oe.promise,received:n.parsedType}),Ee;const r=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return mr(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}pd.create=(e,t)=>new pd({type:e,typeName:Te.ZodPromise,...Le(t)});class Gi extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{ie(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const a=i.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return Ee;const l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?Ee:l.status==="dirty"||n.value==="dirty"?nd(l.value):l});{if(n.value==="aborted")return Ee;const s=this._def.schema._parseSync({data:a,path:r.path,parent:r});return s.status==="aborted"?Ee:s.status==="dirty"||n.value==="dirty"?nd(s.value):s}}if(i.type==="refinement"){const a=s=>{const l=i.refinement(s,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ee:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?Ee:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!rh(a))return a;const s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>rh(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):a);Ve.assertNever(i)}}Gi.create=(e,t,n)=>new Gi({schema:e,typeName:Te.ZodEffects,effect:t,...Le(n)});Gi.createWithPreprocess=(e,t,n)=>new Gi({schema:t,effect:{type:"preprocess",transform:e},typeName:Te.ZodEffects,...Le(n)});class Io extends Pe{_parse(t){return this._getType(t)===oe.undefined?mr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Io.create=(e,t)=>new Io({innerType:e,typeName:Te.ZodOptional,...Le(t)});class Bs extends Pe{_parse(t){return this._getType(t)===oe.null?mr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Bs.create=(e,t)=>new Bs({innerType:e,typeName:Te.ZodNullable,...Le(t)});class hh extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}hh.create=(e,t)=>new hh({innerType:e,typeName:Te.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Le(t)});class Ah extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ih(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new oi(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new oi(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Ah.create=(e,t)=>new Ah({innerType:e,typeName:Te.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Le(t)});class vv extends Pe{_parse(t){if(this._getType(t)!==oe.nan){const r=this._getOrReturnCtx(t);return ie(r,{code:J.invalid_type,expected:oe.nan,received:r.parsedType}),Ee}return{status:"valid",value:t.data}}}vv.create=e=>new vv({typeName:Te.ZodNaN,...Le(e)});const Bee=Symbol("zod_brand");class p_ extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Jh extends Pe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ee:o.status==="dirty"?(n.dirty(),nd(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Ee:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new Jh({in:t,out:n,typeName:Te.ZodPipeline})}}class mh extends Pe{_parse(t){const n=this._def.innerType._parse(t),r=i=>(rh(i)&&(i.value=Object.freeze(i.value)),i);return ih(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}mh.create=(e,t)=>new mh({innerType:e,typeName:Te.ZodReadonly,...Le(t)});function EU(e,t={},n){return e?fd.create().superRefine((r,i)=>{var o,a;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(a=(o=s.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,c=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...c,fatal:l})}}):fd.create()}const Pee={object:kt.lazycreate};var Te;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Te||(Te={}));const Wee=(e,t={message:`Input not instance of ${e.name}`})=>EU(n=>n instanceof e,t),Nl=Vi.create,yv=Ls.create,Nee=vv.create,Kee=Ds.create,RU=oh.create,qee=dc.create,Vee=Av.create,zee=ah.create,Qee=sh.create,Hee=fd.create,Yee=Gl.create,Gee=Ca.create,Jee=mv.create,$U=Hi.create,bv=kt.create,Zee=kt.strictCreate,Xee=lh.create,ete=yy.create,tte=ch.create,nte=Mo.create,rte=uh.create,ite=gv.create,ote=fc.create,ate=od.create,ste=dh.create,lte=fh.create,cte=Us.create,ute=ph.create,dte=pd.create,Cj=Gi.create,fte=Io.create,pte=Bs.create,hte=Gi.createWithPreprocess,Ate=Jh.create,mte=()=>Nl().optional(),gte=()=>yv().optional(),vte=()=>RU().optional(),yte={string:e=>Vi.create({...e,coerce:!0}),number:e=>Ls.create({...e,coerce:!0}),boolean:e=>oh.create({...e,coerce:!0}),bigint:e=>Ds.create({...e,coerce:!0}),date:e=>dc.create({...e,coerce:!0})},bte=Ee;var $=Object.freeze({__proto__:null,defaultErrorMap:dd,setErrorMap:See,getErrorMap:fv,makeIssue:pv,EMPTY_PATH:wee,addIssueToContext:ie,ParseStatus:Xn,INVALID:Ee,DIRTY:nd,OK:mr,isAborted:kw,isDirty:Ow,isValid:rh,isAsync:ih,get util(){return Ve},get objectUtil(){return $w},ZodParsedType:oe,getParsedType:Cs,ZodType:Pe,datetimeRegex:TU,ZodString:Vi,ZodNumber:Ls,ZodBigInt:Ds,ZodBoolean:oh,ZodDate:dc,ZodSymbol:Av,ZodUndefined:ah,ZodNull:sh,ZodAny:fd,ZodUnknown:Gl,ZodNever:Ca,ZodVoid:mv,ZodArray:Hi,ZodObject:kt,ZodUnion:lh,ZodDiscriminatedUnion:yy,ZodIntersection:ch,ZodTuple:Mo,ZodRecord:uh,ZodMap:gv,ZodSet:fc,ZodFunction:od,ZodLazy:dh,ZodLiteral:fh,ZodEnum:Us,ZodNativeEnum:ph,ZodPromise:pd,ZodEffects:Gi,ZodTransformer:Gi,ZodOptional:Io,ZodNullable:Bs,ZodDefault:hh,ZodCatch:Ah,ZodNaN:vv,BRAND:Bee,ZodBranded:p_,ZodPipeline:Jh,ZodReadonly:mh,custom:EU,Schema:Pe,ZodSchema:Pe,late:Pee,get ZodFirstPartyTypeKind(){return Te},coerce:yte,any:Hee,array:$U,bigint:Kee,boolean:RU,date:qee,discriminatedUnion:ete,effect:Cj,enum:cte,function:ate,instanceof:Wee,intersection:tte,lazy:ste,literal:lte,map:ite,nan:Nee,nativeEnum:ute,never:Gee,null:Qee,nullable:pte,number:yv,object:bv,oboolean:vte,onumber:gte,optional:fte,ostring:mte,pipeline:Ate,preprocess:hte,promise:dte,record:rte,set:ote,strictObject:Zee,string:Nl,symbol:Vee,transformer:Cj,tuple:nte,undefined:zee,union:Xee,unknown:Yee,void:Jee,NEVER:bte,ZodIssueCode:J,quotelessJson:Cee,ZodError:oi});const by=I.createContext(void 0);function we(){const e=I.useContext(by);if(!e)throw new Error("Missing EditorConfigContext.Provider");return e}class Fw extends Error{}function mt(e){throw new Fw(`Missing EditorConfig.${e}`)}function Cte(){if(new URL(location.href).searchParams.has("debug"))return;const n=console.error.bind(console);console.error=(...r)=>{r[0]instanceof Fw||Ste(r)||n(...r)},window.addEventListener("error",r=>{r.error instanceof Fw&&r.preventDefault(),wte(r.error)&&r.preventDefault()})}function Ste(e){const t="Warning: flushSync was called from inside a lifecycle method",n=typeof e[0]=="string"&&e[0].includes(t),r=typeof e[1]=="string"&&e[1].includes("RichTextField");return n&&r}function wte(e){const t=/Invalid content for node document: <(bulletList|orderedList)\(listItem*/,n=e.message;return!!(typeof n=="string"&&n.match(t))}function kU(e){const{label:t,children:n}=e;return d.jsxs(A.Box,{display:"grid",gap:8,gridTemplateColumns:"1fr 1fr",children:[d.jsx(A.Box,{borderRadius:6,backgroundColor:"grey2",border:!0,alignItems:"center",padding:{inline:12},children:d.jsx(A.Text,{variant:"normal",component:"label",color:"grey10",children:t})}),n]})}function Cv(e){const{label:t,...n}=e;return d.jsx(kU,{label:t,children:d.jsx(A.FormInput,{...n,size:"medium"})})}function OU(){var r,i;const e=xl();function t(o){e.setPagination({...e.pagination,page:o?Math.max(1,parseInt(o)):void 0})}function n(o){e.setPagination({...e.pagination,pageSize:o?Math.min(Math.max(1,parseInt(o)),100):void 0})}return d.jsxs(d.Fragment,{children:[d.jsx(Cv,{type:"number",value:((r=e.pagination.page)==null?void 0:r.toString())??"",onValueChange:t,label:"PAGE",placeholder:"1"}),d.jsx(Cv,{type:"number",value:((i=e.pagination.pageSize)==null?void 0:i.toString())??"",onValueChange:n,label:"PAGE SIZE",placeholder:"20"})]})}var Se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mc(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var fe={},jw=function(e,t){return jw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},jw(e,t)};function xte(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");jw(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Lw=function(){return Lw=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Lw.apply(this,arguments)};function _te(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Tte(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function Ite(e,t){return function(n,r){t(n,r,e)}}function Ete(e,t,n,r,i,o){function a(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var s=r.kind,l=s==="getter"?"get":s==="setter"?"set":"value",c=!t&&e?r.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),f,p=!1,h=n.length-1;h>=0;h--){var m={};for(var g in r)m[g]=g==="access"?{}:r[g];for(var g in r.access)m.access[g]=r.access[g];m.addInitializer=function(C){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(C||null))};var y=(0,n[h])(s==="accessor"?{get:u.get,set:u.set}:u[l],m);if(s==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(f=a(y.get))&&(u.get=f),(f=a(y.set))&&(u.set=f),(f=a(y.init))&&i.push(f)}else(f=a(y))&&(s==="field"?i.push(f):u[l]=f)}c&&Object.defineProperty(c,r.name,u),p=!0}function Rte(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0}function $te(e){return typeof e=="symbol"?e:"".concat(e)}function kte(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function Ote(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Mte(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(e,t||[])).next())})}function Fte(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}var h_=Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]};function jte(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&h_(t,e,n)}function Dw(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function MU(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Lte(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(MU(arguments[t]));return e}function Dte(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function Ute(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function gh(e){return this instanceof gh?(this.v=e,this):new gh(e)}function Bte(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,o=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(p){r[p]&&(i[p]=function(h){return new Promise(function(m,g){o.push([p,h,m,g])>1||s(p,h)})})}function s(p,h){try{l(r[p](h))}catch(m){f(o[0][3],m)}}function l(p){p.value instanceof gh?Promise.resolve(p.value.v).then(c,u):f(o[0][2],p)}function c(p){s("next",p)}function u(p){s("throw",p)}function f(p,h){p(h),o.shift(),o.length&&s(o[0][0],o[0][1])}}function Pte(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,o){t[i]=e[i]?function(a){return(n=!n)?{value:gh(e[i](a)),done:!1}:o?o(a):a}:o}}function Wte(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Dw=="function"?Dw(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(a){return new Promise(function(s,l){a=e[o](a),i(s,l,a.done,a.value)})}}function i(o,a,s,l){Promise.resolve(l).then(function(c){o({value:c,done:s})},a)}}function Nte(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Kte=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function qte(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&h_(t,e,n);return Kte(t,e),t}function Vte(e){return e&&e.__esModule?e:{default:e}}function zte(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function Qte(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n}function Hte(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}const Yte=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Lw},__asyncDelegator:Pte,__asyncGenerator:Bte,__asyncValues:Wte,__await:gh,__awaiter:Mte,__classPrivateFieldGet:zte,__classPrivateFieldIn:Hte,__classPrivateFieldSet:Qte,__createBinding:h_,__decorate:Tte,__esDecorate:Ete,__exportStar:jte,__extends:xte,__generator:Fte,__importDefault:Vte,__importStar:qte,__makeTemplateObject:Nte,__metadata:Ote,__param:Ite,__propKey:$te,__read:MU,__rest:_te,__runInitializers:Rte,__setFunctionName:kte,__spread:Lte,__spreadArray:Ute,__spreadArrays:Dte,__values:Dw},Symbol.toStringTag,{value:"Module"})),G=Mc(Yte);var Rr={};function FU(e){return function(t){return function(n){return n.reduce(function(r,i){return e.alt(r,function(){return i})},t)}}}const Gte=Object.freeze(Object.defineProperty({__proto__:null,altAll:FU},Symbol.toStringTag,{value:"Module"}));function Jte(e){return FU(e)(e.zero())}const Zte=Object.freeze(Object.defineProperty({__proto__:null,altAll:Jte},Symbol.toStringTag,{value:"Module"}));var jU=function(e){return function(){return{meet:function(t,n){return function(r){return e.meet(t(r),n(r))}},join:function(t,n){return function(r){return e.join(t(r),n(r))}},zero:function(){return e.zero},one:function(){return e.one},implies:function(t,n){return function(r){return e.implies(t(r),n(r))}},not:function(t){return function(n){return e.not(t(n))}}}}},A_=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},LU=function(e){var t=A_(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}},m_=function(e){return{add:function(t,n){return function(r){return e.add(t(r),n(r))}},zero:function(){return e.zero},mul:function(t,n){return function(r){return e.mul(t(r),n(r))}},one:function(){return e.one}}},DU=function(e){var t=m_(e);return{add:t.add,mul:t.mul,one:t.one,zero:t.zero,sub:function(n,r){return function(i){return e.sub(n(i),r(i))}}}},Xte=function(e){return function(t){return t(e)}};function Q(e){return e}var hd=Q;function Ur(e){return function(){return e}}var g_=Ur(!0),UU=Ur(!1),BU=Ur(null),v_=Ur(void 0),ene=v_;function tne(e){return function(t,n){return e(n,t)}}function X(e,t,n,r,i,o,a,s,l){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return l(s(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function PU(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function nne(e){return e+1}function rne(e){return e-1}function WU(e){throw new Error("Called `absurd` function which should be uncallable")}function ine(e){return function(t){return e.apply(void 0,t)}}function one(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(t)}}function _(e,t,n,r,i,o,a,s,l){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return s(a(o(i(r(n(t(e)))))));case 9:return l(s(a(o(i(r(n(t(e))))))));default:{for(var c=arguments[0],u=1;u<arguments.length;u++)c=arguments[u](c);return c}}}var ane=WU,Br=function(e,t){return t};function sne(e){return function(t){return!e(t)}}var lne=function(){return{concat:function(e,t){return X(e,t)},empty:Q}};const NU=Object.freeze(Object.defineProperty({__proto__:null,SK:Br,absurd:WU,apply:Xte,constFalse:UU,constNull:BU,constTrue:g_,constUndefined:v_,constVoid:ene,constant:Ur,decrement:rne,flip:tne,flow:X,getBooleanAlgebra:jU,getEndomorphismMonoid:lne,getMonoid:LU,getRing:DU,getSemigroup:A_,getSemiring:m_,hole:ane,identity:Q,increment:nne,not:sne,pipe:_,tuple:PU,tupled:ine,unsafeCoerce:hd,untupled:one},Symbol.toStringTag,{value:"Module"}));var cne=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},tn=function(e){return e._tag==="None"},Mt=function(e){return e._tag==="Some"},Re={_tag:"None"},ye=function(e){return{_tag:"Some",value:e}},An=function(e){return e._tag==="Left"},y_=function(e){return e._tag==="Right"},Sa=function(e){return{_tag:"Left",left:e}},Hs=function(e){return{_tag:"Right",right:e}},Zh=function(e){return[e]},Tt=function(e){return e.length>0},ui=function(e){return e[0]},Kd=function(e){return e.slice(1)},Ln=[],vn={},yt=Object.prototype.hasOwnProperty,Cy=function(e){return cne([e[0]],e.slice(1),!0)};function Ea(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}function qt(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function Vt(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function zt(e){return function(t,n){return function(r){return e.ap(e.map(r,function(i){return function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))}}),n)}}}function yn(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}function b_(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):b_(e,t-1,i)}}var zC={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};function une(e){return yt.call(zC,e)||(zC[e]=b_(PU,e-1,[])),zC[e]}function dne(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=une(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}function fne(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var s;return s={},s[e[0]]=n,s[e[1]]=r,s[e[2]]=i,s[e[3]]=o,s[e[4]]=a,s}}}}};default:return b_(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function pne(e){return function(t){for(var n=Object.keys(t),r=n.length,i=fne(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}const hne=Object.freeze(Object.defineProperty({__proto__:null,ap:Ea,apFirst:qt,apS:zt,apSecond:Vt,getApplySemigroup:yn,sequenceS:pne,sequenceT:dne},Symbol.toStringTag,{value:"Module"}));function qd(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function He(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}function Qt(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}function Vd(e,t){var n=qd(e,t);return{map:function(r,i){return _(r,n(i))}}}const Ane=Object.freeze(Object.defineProperty({__proto__:null,bindTo:Qt,flap:He,getFunctorComposition:Vd,map:qd},Symbol.toStringTag,{value:"Module"}));function $i(e){var t=yn(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function KU(e,t){var n=Vd(e,t).map,r=Ea(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return _(i,r(o))}}}const mne=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:KU,getApplicativeMonoid:$i},Symbol.toStringTag,{value:"Module"}));function bt(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}function Ht(e){return function(t,n){return function(r){return e.chain(r,function(i){return e.map(n(i),function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))})})}}}const gne=Object.freeze(Object.defineProperty({__proto__:null,bind:Ht,chainFirst:bt},Symbol.toStringTag,{value:"Module"}));function Bo(e){return function(t){return function(n){return e.fromEither(tn(n)?Sa(t()):Hs(n.value))}}}function Ys(e){return function(t,n){return function(r){return e.fromEither(t(r)?Hs(r):Sa(n(r)))}}}function Po(e){var t=Bo(e);return function(n){var r=t(n);return function(i){return X(i,r)}}}function Fc(e,t){var n=Po(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}function di(e){return function(t){return X(t,e.fromEither)}}function Ra(e,t){var n=di(e);return function(r){return function(i){return t.chain(i,n(r))}}}function $a(e,t){return X(di(e),bt(t))}function jc(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Hs(o):Sa(r(o)))})}}}const vne=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:Ra,chainFirstEitherK:$a,chainOptionK:Fc,filterOrElse:jc,fromEitherK:di,fromOption:Bo,fromOptionK:Po,fromPredicate:Ys},Symbol.toStringTag,{value:"Module"}));var ki=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},qU=function(e){return ki(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},VU=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ki(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},yne=function(e,t){return _(e,zU(t))},zU=function(e){return function(t){return ki(function(n,r){return t.equals(e(n),e(r))})}},QU="Eq",zd={equals:function(e,t){return e===t}},bne={equals:function(){return!0}},HU=function(){return{concat:function(e,t){return ki(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}},Cne=function(){return{concat:HU().concat,empty:bne}},YU={URI:QU,contramap:yne},Sne=VU,wne=qU,xne=zd.equals,_ne=YU,Tne=zd,Ine=zd,Ene=zd,Rne={equals:function(e,t){return e.valueOf()===t.valueOf()}};const $ne=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:YU,URI:QU,contramap:zU,eq:_ne,eqBoolean:Tne,eqDate:Rne,eqNumber:Ene,eqStrict:zd,eqString:Ine,fromEquals:ki,getMonoid:Cne,getSemigroup:HU,getStructEq:wne,getTupleEq:Sne,strictEqual:xne,struct:qU,tuple:VU},Symbol.toStringTag,{value:"Module"}));var GU=function(e){return function(t,n){return t===n||e(t,n)===0}},Lc=function(e){return{equals:GU(e),compare:function(t,n){return t===n?0:e(t,n)}}},JU=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Lc(function(n,r){for(var i=0;i<e.length-1;i++){var o=e[i].compare(n[i],r[i]);if(o!==0)return o}return e[i].compare(n[i],r[i])})},C_=function(e){return Lc(function(t,n){return e.compare(n,t)})},kne=function(e,t){return _(e,Sy(t))},Sy=function(e){return function(t){return Lc(function(n,r){return t.compare(e(n),e(r))})}},ZU="Ord",XU=function(){return{concat:function(e,t){return Lc(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},S_=function(){return{concat:XU().concat,empty:Lc(function(){return 0})}},eB={URI:ZU,contramap:kne},One={equals:g_,compare:Ur(0)},Mne=function(e){return function(t){return function(n){return n===t||e.compare(n,t)===0}}},tB=function(e){return function(t,n){return e.compare(t,n)===-1}},nB=function(e){return function(t,n){return e.compare(t,n)===1}},Fne=function(e){return function(t,n){return e.compare(t,n)!==1}},jne=function(e){return function(t,n){return e.compare(t,n)!==-1}},wy=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}},xy=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}},rB=function(e){var t=wy(e),n=xy(e);return function(r,i){return function(o){return n(t(o,i),r)}}},Lne=function(e){var t=tB(e),n=nB(e);return function(r,i){return function(o){return!(t(o,r)||n(o,i))}}},Dne=JU,Une=C_,Bne=eB;function Pne(e,t){return e<t?-1:e>t?1:0}var w_={equals:zd.equals,compare:Pne},Wne=w_,Nne=w_,Sv=w_,Kne=_(Sv,Sy(function(e){return e.valueOf()}));const qne=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:eB,URI:ZU,between:Lne,clamp:rB,contramap:Sy,equals:Mne,equalsDefault:GU,fromCompare:Lc,geq:jne,getDualOrd:Une,getMonoid:S_,getSemigroup:XU,getTupleOrd:Dne,gt:nB,leq:Fne,lt:tB,max:xy,min:wy,ord:Bne,ordBoolean:Wne,ordDate:Kne,ordNumber:Sv,ordString:Nne,reverse:C_,trivial:One,tuple:JU},Symbol.toStringTag,{value:"Module"}));var iB=function(e){return{concat:function(t,n){return e.concat(n,t)}}},Vne=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}},zne=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}},Qne=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}},oB=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}};const Hne=Object.freeze(Object.defineProperty({__proto__:null,concatAll:oB,endo:Qne,filterFirst:Vne,filterSecond:zne,reverse:iB},Symbol.toStringTag,{value:"Module"}));var _y=function(e){return{concat:wy(e)}},Ty=function(e){return{concat:xy(e)}},x_=function(e){return{concat:function(){return e}}},__=iB,T_=function(e){return{concat:function(t,n){var r={};for(var i in e)yt.call(e,i)&&(r[i]=e[i].concat(t[i],n[i]));return r}}},I_=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:function(n,r){return e.map(function(i,o){return i.concat(n[o],r[o])})}}},aB=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}},E_=function(){return{concat:Q}},Iy=function(){return{concat:function(e,t){return t}}},R_=oB,sB=x_(void 0),Yne=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},Gne=Iy,Jne=E_,Zne=I_,Xne=T_,ere=__,tre=Ty,nre=_y,rre=aB;function ire(e){var t=R_(e);return function(n,r){return r===void 0?t(n):t(n)(r)}}var lB={concat:function(e,t){return e&&t}},cB={concat:function(e,t){return e||t}},ore=A_,uB={concat:function(e,t){return e+t}},dB={concat:function(e,t){return e+t}},fB={concat:function(e,t){return e*t}};const pB=Object.freeze(Object.defineProperty({__proto__:null,concatAll:R_,constant:x_,first:E_,fold:ire,getDualSemigroup:ere,getFirstSemigroup:Jne,getFunctionSemigroup:ore,getIntercalateSemigroup:rre,getJoinSemigroup:tre,getLastSemigroup:Gne,getMeetSemigroup:nre,getObjectSemigroup:Yne,getStructSemigroup:Xne,getTupleSemigroup:Zne,intercalate:aB,last:Iy,max:Ty,min:_y,reverse:__,semigroupAll:lB,semigroupAny:cB,semigroupProduct:fB,semigroupString:uB,semigroupSum:dB,semigroupVoid:sB,struct:T_,tuple:I_},Symbol.toStringTag,{value:"Module"}));var vh=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Xh=Ln,Wo=Tt,Ey=function(e,t){return e<0||e>=t.length},$_=function(e){return function(t){return vh([e],t,!0)}},Ad=$_,k_=function(e){return function(t){return vh(vh([],t,!0),[e],!1)}},Ry=k_,$y=function(e,t,n){if(Wo(n)){var r=Cy(n);return r.splice(e,0,t),r}return[t]},O_=function(e,t,n){if(n[e]===t)return n;var r=Cy(n);return r[e]=t,r},M_=function(e){return function(t){if(t.length===1)return t;for(var n=[yr(t)],r=Ji(t),i=function(l){n.every(function(c){return!e.equals(c,l)})&&n.push(l)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},hB=function(e){if(Wo(e)){var t=S_();return D_(e.reduce(t.concat,t.empty))}return Q},F_=function(e){var t=M_(e);return function(n){return function(r){return t(_(r,eA(n)))}}},j_=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(Ey(Math.abs(r),t)||r===0)return t;if(r<0){var i=My(-r)(t),o=i[0],a=i[1];return _(a,eA(o))}else return j_(r-n)(t)}},L_=function(e){return Wo(e)?ye(e):Re},ky=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},are=function(e){return ky(function(){return e})},AB=function(e,t){return e<=t?ky(function(n){return e+n})(t-e+1):[e]},mB=function(e){return[yr(e),Ji(e)]},gB=function(e){return[Qd(e),Js(e)]},sre=function(e){return L_(e.slice())};function vB(e){return function(t){return t.concat(e)}}function eA(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var lre=function(e){return e.length===1?e:vh([Js(e)],e.slice(0,-1).reverse(),!0)};function yB(e){return function(t){var n=t.length;if(n===0)return Xh;for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var s=t[a];e.equals(s,i)?o.push(s):(r.push(o),i=s,o=[i])}return r.push(o),r}}var cre=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);yt.call(n,a)?n[a].push(o):n[a]=[o]}return n}},D_=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},ure=function(e,t){return bB(e,function(){return t})},bB=function(e,t){return function(n){return Ey(e,n)?Re:ye(O_(e,t(n[e]),n))}},CB=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};function SB(e,t){return t===void 0?function(n){return SB(n,e)}:CB(e,t,function(n,r){return[n,r]})}var dre=function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},Oy=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},U_=function(e){return function(t){var n=Ji(t);return Wo(n)?_(n,Oy(e),Ad(yr(t))):t}},wB=function(e){return function(t){for(var n=Cy(e(0,yr(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},B_=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;Wo(a);){var s=e(a),l=s[0],c=s[1];o.push(l),a=c}return o}},My=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[t,Xh]:[_(t.slice(1,n),Ad(yr(t))),t.slice(n)]}},xB=function(e){return B_(My(e))},eo=function(e,t){return _(e,Q_(t))},P_=function(e,t){return _(e,H_(t))},tA=function(e,t){return _(e,$B(t))},W_=function(e,t){return _(e,Fy(t))},_B=function(e,t){return _(e,z_(t))},nA=function(e,t,n){return _(e,Y_(t,n))},rA=function(e){var t=G_(e);return function(n,r){return _(n,t(r))}},iA=function(e,t,n){return _(e,J_(t,n))},N_=function(e){var t=kB(e);return function(n,r){return _(n,t(r))}},TB=function(e,t){return _(e,RB(t))},K_=function(e,t,n){return _(e,jy(t,n))},q_=function(e){var t=Z_(e);return function(n,r){return _(n,t(r))}},V_=function(e,t,n){return _(e,Ly(t,n))},IB=function(e){var t=Uy(e);return function(n,r){return _(n,t(r))}},Gs=Zh,EB=function(e){return function(t){return _(t,vB(e()))}},RB=EB,$B=function(e){return Fy(function(t){return _(e,Q_(t))})},Fy=function(e){return wB(function(t,n){return e(n)})},z_=function(e){return function(t){for(var n=Ji(t),r=[e(t)];Wo(n);)r.push(e(n)),n=Ji(n);return r}},fre=z_(Q),pre=Fy(Q),Q_=function(e){return H_(function(t,n){return e(n)})},H_=function(e){return function(t){for(var n=[e(0,yr(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},Y_=function(e,t){return jy(e,function(n,r,i){return t(r,i)})},G_=function(e){return function(t){return function(n){return n.slice(1).reduce(function(r,i){return e.concat(r,t(i))},t(n[0]))}}},J_=function(e,t){return Ly(e,function(n,r,i){return t(r,i)})},jy=function(e,t){return function(n){return n.reduce(function(r,i,o){return t(o,r,i)},e)}},Z_=function(e){return function(t){return function(n){return n.slice(1).reduce(function(r,i,o){return e.concat(r,t(o+1,i))},t(0,n[0]))}}},Ly=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},kB=function(e){var t=Uy(e);return function(n){return t(function(r,i){return n(i)})}},Dy=function(e){return Uy(e)(Br)},Uy=function(e){return function(t){return function(n){for(var r=e.map(t(0,yr(n)),Gs),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return _(o,Ry(a))}}),t(i,n[i]));return r}}},By=ui,vr="ReadonlyNonEmptyArray",OB=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},hre=function(){return{concat:eA}},MB=function(e){return ki(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},Are=function(e){var t=F_(e);return{concat:function(n,r){return t(r)(n)}}},X_={URI:vr,map:eo},mre=He(X_),gre={URI:vr,of:Gs},vre={URI:vr,map:eo,mapWithIndex:P_},Py={URI:vr,map:eo,ap:tA},yre=qt(Py),bre=Vt(Py),Cre={URI:vr,map:eo,ap:tA,of:Gs},eT={URI:vr,map:eo,ap:tA,chain:W_},Sre=bt(eT),wre={URI:vr,map:eo,ap:tA,of:Gs,chain:W_},xre={URI:vr,reduce:nA,foldMap:rA,reduceRight:iA},_re={URI:vr,reduce:nA,foldMap:rA,reduceRight:iA,reduceWithIndex:K_,foldMapWithIndex:q_,reduceRightWithIndex:V_},Tre={URI:vr,map:eo,reduce:nA,foldMap:rA,reduceRight:iA,traverse:N_,sequence:Dy},Ire={URI:vr,map:eo,mapWithIndex:P_,reduce:nA,foldMap:rA,reduceRight:iA,traverse:N_,sequence:Dy,reduceWithIndex:K_,foldMapWithIndex:q_,reduceRightWithIndex:V_,traverseWithIndex:IB},Ere={URI:vr,map:eo,alt:TB},Rre={URI:vr,map:eo,extend:_B,extract:By},$re=Gs(vn),kre=Qt(X_),Ore=Ht(eT),Mre=zt(Py),yr=By,Ji=Kd,Js=function(e){return e[e.length-1]},Qd=function(e){return e.slice(0,-1)},FB=function(e){var t=_y(e);return function(n){return n.reduce(t.concat)}},jB=function(e){var t=Ty(e);return function(n){return n.reduce(t.concat)}},Wy=function(e){return function(t){return t.reduce(e.concat)}},Fre=function(e){return function(t){return e(yr(t),Ji(t))}},jre=function(e){return function(t){return e(Qd(t),Js(t))}},LB=function(e){return function(t){return vh([e(yr(t))],Ji(t),!0)}},Lre=function(e){return LB(function(){return e})},DB=function(e){return function(t){return _(Qd(t),Ry(e(Js(t))))}},Dre=function(e){return DB(function(){return e})},tT=function(e){var t=Wy(e);return function(n){return X(U_(n),t)}};function Ure(e){var t=D_(e),n=yB(e);return function(r){return Wo(r)?n(t(r)):Xh}}function Bre(e){return UB(function(t,n){return e(n)})}var UB=function(e){return function(t){return L_(t.filter(function(n,r){return e(r,n)}))}},Pre=mB,Wre=gB;function BB(e,t){return t===void 0?Ad(e):_(t,Ad(e))}var PB=function(e,t){return _(e,eA([t]))},Nre=function(e,t){return function(n){return e<0||e>n.length?Re:ye($y(e,t,n))}},Kre=Oy,qre=Wy,Vre={URI:vr,of:Gs,map:eo,mapWithIndex:P_,ap:tA,chain:W_,extend:_B,extract:By,reduce:nA,foldMap:rA,reduceRight:iA,traverse:N_,sequence:Dy,reduceWithIndex:K_,foldMapWithIndex:q_,reduceRightWithIndex:V_,traverseWithIndex:IB,alt:TB};const zre=Object.freeze(Object.defineProperty({__proto__:null,Alt:Ere,Applicative:Cre,Apply:Py,Chain:eT,Comonad:Rre,Do:$re,Foldable:xre,FoldableWithIndex:_re,Functor:X_,FunctorWithIndex:vre,Monad:wre,Pointed:gre,Traversable:Tre,TraversableWithIndex:Ire,URI:vr,alt:RB,altW:EB,ap:$B,apFirst:yre,apS:Mre,apSecond:bre,append:Ry,appendW:k_,bind:Ore,bindTo:kre,chain:Fy,chainFirst:Sre,chainWithIndex:wB,chop:B_,chunksOf:xB,concat:eA,concatAll:Wy,concatW:vB,cons:BB,duplicate:fre,empty:Xh,extend:z_,extract:By,filter:Bre,filterWithIndex:UB,flap:mre,flatten:pre,fold:qre,foldMap:G_,foldMapWithIndex:Z_,fromArray:sre,fromReadonlyArray:L_,getEq:MB,getSemigroup:hre,getShow:OB,getUnionSemigroup:Are,group:yB,groupBy:cre,groupSort:Ure,head:yr,init:Qd,insertAt:Nre,intercalate:tT,intersperse:U_,isNonEmpty:Wo,isOutOfBound:Ey,last:Js,makeBy:ky,map:Q_,mapWithIndex:H_,matchLeft:Fre,matchRight:jre,max:jB,min:FB,modifyAt:bB,modifyHead:LB,modifyLast:DB,of:Gs,prepend:Ad,prependAll:Oy,prependToAll:Kre,prependW:$_,range:AB,readonlyNonEmptyArray:Vre,reduce:Y_,reduceRight:J_,reduceRightWithIndex:Ly,reduceWithIndex:jy,replicate:are,reverse:lre,rotate:j_,sequence:Dy,snoc:PB,sort:D_,sortBy:hB,splitAt:My,tail:Ji,traverse:kB,traverseWithIndex:Uy,unappend:gB,uncons:Pre,union:F_,uniq:M_,unprepend:mB,unsafeInsertAt:$y,unsafeUpdateAt:O_,unsnoc:Wre,unzip:dre,updateAt:ure,updateHead:Lre,updateLast:Dre,zip:SB,zipWith:CB},Symbol.toStringTag,{value:"Module"}));var yh=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},ka=function(e){return e.length>0},Ny=function(e,t){return e<0||e>=t.length},nT=function(e){return function(t){return yh([e],t,!0)}},md=nT,rT=function(e){return function(t){return yh(yh([],t,!0),[e],!1)}},oA=rT,iT=function(e,t,n){if(ka(n)){var r=aA(n);return r.splice(e,0,t),r}return[t]},oT=function(e,t,n){var r=aA(n);return r[e]=t,r},aT=function(e){return function(t){if(t.length===1)return Hd(t);for(var n=[Oi(t)],r=Zi(t),i=function(l){n.every(function(c){return!e.equals(c,l)})&&n.push(l)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},WB=function(e){if(ka(e)){var t=S_();return uT(e.reduce(t.concat,t.empty))}return Hd},sT=function(e){var t=aT(e);return function(n){return function(r){return t(_(r,qy(n)))}}},lT=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(Ny(Math.abs(r),t)||r===0)return Hd(t);if(r<0){var i=zy(-r)(t),o=i[0],a=i[1];return _(a,qy(o))}else return lT(r-n)(t)}},aA=Cy,cT=function(e){return ka(e)?ye(e):Re},Ky=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},Qre=function(e){return Ky(function(){return e})},NB=function(e,t){return e<=t?Ky(function(n){return e+n})(t-e+1):[e]},KB=function(e){return[Oi(e),Zi(e)]},qB=function(e){return[Gd(e),Yd(e)]};function VB(e){return function(t){return t.concat(e)}}function qy(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var Hre=function(e){return yh([Yd(e)],e.slice(0,-1).reverse(),!0)};function zB(e){return function(t){var n=t.length;if(n===0)return[];for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var s=t[a];e.equals(s,i)?o.push(s):(r.push(o),i=s,o=[i])}return r.push(o),r}}var Yre=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);yt.call(n,a)?n[a].push(o):n[a]=[o]}return n}},uT=function(e){return function(t){return t.slice().sort(e.compare)}},Gre=function(e,t){return function(n){return e<0||e>n.length?Re:ye(iT(e,t,n))}},Jre=function(e,t){return QB(e,function(){return t})},QB=function(e,t){return function(n){return Ny(e,n)?Re:ye(oT(e,t(n[e]),n))}},Hd=aA,Zs=function(e){return[e]},HB=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};function YB(e,t){return t===void 0?function(n){return YB(n,e)}:HB(e,t,function(n,r){return[n,r]})}var Zre=function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},Vy=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},GB=function(e){return function(t){var n=Zi(t);return ka(n)?_(n,Vy(e),md(Oi(t))):Hd(t)}},JB=Z_,ZB=G_,XB=function(e){return function(t){for(var n=aA(e(0,Oi(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},dT=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;ka(a);){var s=e(a),l=s[0],c=s[1];o.push(l),a=c}return o}},zy=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[Hd(t),[]]:[_(t.slice(1,n),md(Oi(t))),t.slice(n)]}},eP=function(e){return dT(zy(e))},to=function(e,t){return _(e,yT(t))},fT=function(e,t){return _(e,bT(t))},sA=function(e,t){return _(e,aP(t))},pT=function(e,t){return _(e,Qy(t))},tP=function(e,t){return _(e,vT(t))},lA=function(e,t,n){return _(e,sP(t,n))},cA=function(e){var t=ZB(e);return function(n,r){return _(n,t(r))}},uA=function(e,t,n){return _(e,cP(t,n))},hT=function(e){var t=dP(e);return function(n,r){return _(n,t(r))}},nP=function(e,t){return _(e,oP(t))},AT=function(e,t,n){return _(e,lP(t,n))},mT=function(e){var t=JB(e);return function(n,r){return _(n,t(r))}},gT=function(e,t,n){return _(e,uP(t,n))},rP=function(e){var t=Yy(e);return function(n,r){return _(n,t(r))}},iP=function(e){return function(t){return _(t,VB(e()))}},oP=iP,aP=function(e){return Qy(function(t){return _(e,yT(t))})},Qy=function(e){return XB(function(t,n){return e(n)})},vT=function(e){return function(t){for(var n=Zi(t),r=[e(t)];ka(n);)r.push(e(n)),n=Zi(n);return r}},Xre=vT(Q),eie=Qy(Q),yT=function(e){return bT(function(t,n){return e(n)})},bT=function(e){return function(t){for(var n=[e(0,Oi(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},sP=Y_,lP=jy,cP=J_,uP=Ly,dP=function(e){var t=Yy(e);return function(n){return t(function(r,i){return n(i)})}},Hy=function(e){return Yy(e)(function(t,n){return n})},Yy=function(e){return function(t){return function(n){for(var r=e.map(t(0,Oi(n)),Zs),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return _(o,oA(a))}}),t(i,n[i]));return r}}},CT=yr,br="NonEmptyArray",tie=OB,nie=function(){return{concat:qy}},rie=MB,iie=function(e){var t=sT(e);return{concat:function(n,r){return t(r)(n)}}},ST={URI:br,map:to},oie=He(ST),aie={URI:br,of:Zs},sie={URI:br,map:to,mapWithIndex:fT},Gy={URI:br,map:to,ap:sA},lie=qt(Gy),cie=Vt(Gy),uie={URI:br,map:to,ap:sA,of:Zs},wT={URI:br,map:to,ap:sA,chain:pT},die=bt(wT),fie={URI:br,map:to,ap:sA,of:Zs,chain:pT},pie={URI:br,reduce:lA,foldMap:cA,reduceRight:uA},hie={URI:br,reduce:lA,foldMap:cA,reduceRight:uA,reduceWithIndex:AT,foldMapWithIndex:mT,reduceRightWithIndex:gT},Aie={URI:br,map:to,reduce:lA,foldMap:cA,reduceRight:uA,traverse:hT,sequence:Hy},mie={URI:br,map:to,mapWithIndex:fT,reduce:lA,foldMap:cA,reduceRight:uA,traverse:hT,sequence:Hy,reduceWithIndex:AT,foldMapWithIndex:mT,reduceRightWithIndex:gT,traverseWithIndex:rP},gie={URI:br,map:to,alt:nP},vie={URI:br,map:to,extend:tP,extract:CT},yie=Zs(vn),bie=Qt(ST),Cie=Ht(wT),Sie=zt(Gy),Oi=yr,Zi=function(e){return e.slice(1)},Yd=Js,Gd=function(e){return e.slice(0,-1)},wie=FB,xie=jB,_ie=function(e){return function(t){return t.reduce(e.concat)}},Tie=function(e){return function(t){return e(Oi(t),Zi(t))}},Iie=function(e){return function(t){return e(Gd(t),Yd(t))}},fP=function(e){return function(t){return yh([e(Oi(t))],Zi(t),!0)}},Eie=function(e){return fP(function(){return e})},pP=function(e){return function(t){return _(Gd(t),oA(e(Yd(t))))}},Rie=function(e){return pP(function(){return e})},$ie=tT;function kie(e){var t=uT(e),n=zB(e);return function(r){return ka(r)?n(t(r)):[]}}function Oie(e){return hP(function(t,n){return e(n)})}var hP=function(e){return function(t){return cT(t.filter(function(n,r){return e(r,n)}))}},Mie=KB,Fie=qB;function AP(e,t){return t===void 0?md(e):_(t,md(e))}var mP=function(e,t){return _(e,oA(t))},jie=Vy,Lie=Wy,Die={URI:br,of:Zs,map:to,mapWithIndex:fT,ap:sA,chain:pT,extend:tP,extract:CT,reduce:lA,foldMap:cA,reduceRight:uA,traverse:hT,sequence:Hy,reduceWithIndex:AT,foldMapWithIndex:mT,reduceRightWithIndex:gT,traverseWithIndex:rP,alt:nP};const Uie=Object.freeze(Object.defineProperty({__proto__:null,Alt:gie,Applicative:uie,Apply:Gy,Chain:wT,Comonad:vie,Do:yie,Foldable:pie,FoldableWithIndex:hie,Functor:ST,FunctorWithIndex:sie,Monad:fie,Pointed:aie,Traversable:Aie,TraversableWithIndex:mie,URI:br,alt:oP,altW:iP,ap:aP,apFirst:lie,apS:Sie,apSecond:cie,append:oA,appendW:rT,bind:Cie,bindTo:bie,chain:Qy,chainFirst:die,chainWithIndex:XB,chop:dT,chunksOf:eP,concat:qy,concatAll:_ie,concatW:VB,cons:AP,copy:Hd,duplicate:Xre,extend:vT,extract:CT,filter:Oie,filterWithIndex:hP,flap:oie,flatten:eie,fold:Lie,foldMap:ZB,foldMapWithIndex:JB,fromArray:cT,fromReadonlyNonEmptyArray:aA,getEq:rie,getSemigroup:nie,getShow:tie,getUnionSemigroup:iie,group:zB,groupBy:Yre,groupSort:kie,head:Oi,init:Gd,insertAt:Gre,intercalate:$ie,intersperse:GB,isNonEmpty:ka,isOutOfBound:Ny,last:Yd,makeBy:Ky,map:yT,mapWithIndex:bT,matchLeft:Tie,matchRight:Iie,max:xie,min:wie,modifyAt:QB,modifyHead:fP,modifyLast:pP,nonEmptyArray:Die,of:Zs,prepend:md,prependAll:Vy,prependToAll:jie,prependW:nT,range:NB,reduce:sP,reduceRight:cP,reduceRightWithIndex:uP,reduceWithIndex:lP,replicate:Qre,reverse:Hre,rotate:lT,sequence:Hy,snoc:mP,sort:uT,sortBy:WB,splitAt:zy,tail:Zi,traverse:dP,traverseWithIndex:Yy,unappend:qB,uncons:Mie,union:sT,uniq:aT,unprepend:KB,unsafeInsertAt:iT,unsafeUpdateAt:oT,unsnoc:Fie,unzip:Zre,updateAt:Jre,updateHead:Eie,updateLast:Rie,zip:YB,zipWith:HB},Symbol.toStringTag,{value:"Module"}));var Bie=function(e){return typeof e=="number"},xT={equals:function(e,t){return e===t}},Jy={equals:xT.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},Pie={equals:xT.equals,compare:Jy.compare,top:1/0,bottom:-1/0},Wie={show:function(e){return JSON.stringify(e)}},gP={concat:function(e,t){return e-t}},_T={concat:function(e,t){return e+t}},TT={concat:function(e,t){return e*t}},Nie={concat:_T.concat,empty:0},Kie={concat:TT.concat,empty:1},qie={add:_T.concat,zero:0,mul:TT.concat,one:1,sub:gP.concat,degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const Vie=Object.freeze(Object.defineProperty({__proto__:null,Bounded:Pie,Eq:xT,Field:qie,MagmaSub:gP,MonoidProduct:Kie,MonoidSum:Nie,Ord:Jy,SemigroupProduct:TT,SemigroupSum:_T,Show:Wie,isNumber:Bie},Symbol.toStringTag,{value:"Module"}));var Be=function(e,t){return{left:e,right:t}},zie=function(e,t){return _(e,vP(t))},Qie=function(e,t){return _(e,yP(t))},Hie=function(e,t,n){return _(e,bP(t,n))},vP=function(e){return function(t){return Be(Zy(t),e(Xy(t)))}},yP=function(e){return function(t){return Be(e(Zy(t)),Xy(t))}},bP=function(e,t){return function(n){return Be(e(Zy(n)),t(Xy(n)))}},IT="Separated",Yie={URI:IT,mapLeft:Qie,bimap:Hie},CP={URI:IT,map:zie},Gie=He(CP),Zy=function(e){return e.left},Xy=function(e){return e.right};const Jie=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:Yie,Functor:CP,URI:IT,bimap:bP,flap:Gie,left:Zy,map:vP,mapLeft:yP,right:Xy,separated:Be},Symbol.toStringTag,{value:"Module"}));function no(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}function ro(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}function ET(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(o){return t.map(r(o),function(a){return a?ye(o):Re})})}}}}const Zie=Object.freeze(Object.defineProperty({__proto__:null,filterE:ET,wiltDefault:no,witherDefault:ro},Symbol.toStringTag,{value:"Module"}));function Jd(e,t){return function(n){return n?t.of(void 0):e.zero()}}const Xie=Object.freeze(Object.defineProperty({__proto__:null,guard:Jd},Symbol.toStringTag,{value:"Module"}));var eoe=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Fo=function(e){return e.length===0},Kt=Wo,toe=Ad,noe=$_,e0=Ry,roe=k_,SP=function(e,t){return e<=0?Lt:ky(t)(e)},ioe=function(e,t){return SP(e,function(){return t})};function ooe(e){return function(t){return e(t)?[t]:Lt}}var wP=function(e){return tn(e)?Lt:[e.value]},xP=function(e){return An(e)?Lt:[e.right]},_P=function(e,t){return function(n){return Kt(n)?t(n):e()}},TP=_P,IP=function(e,t){return function(n){return Kt(n)?t(yr(n),Ji(n)):e()}},EP=IP,aoe=EP,RP=function(e,t){return function(n){return Kt(n)?t(Qd(n),Js(n)):e()}},$P=RP,soe=$P,kP=function(e){return function(t){if(Fo(t))return Lt;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},loe=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},coe=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},uoe=function(e){return e.length},Zd=Ey;function pc(e,t){return t===void 0?function(n){return pc(e,n)}:Zd(e,t)?Re:ye(t[e])}var OP=function(e){return Kt(e)?ye(yr(e)):Re},MP=function(e){return Kt(e)?ye(Js(e)):Re},doe=function(e){return Kt(e)?ye(Ji(e)):Re},foe=function(e){return Kt(e)?ye(Qd(e)):Re},poe=function(e){return function(t){return Zd(e,t)?t:e===0?Lt:t.slice(0,e)}},hoe=function(e){return function(t){return Zd(e,t)?t:e===0?Lt:t.slice(-e)}};function Aoe(e){return function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];if(!e(o))break;n.push(o)}var a=n.length;return a===t.length?t:a===0?Lt:n}}var FP=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function moe(e){return function(t){var n=KP(FP(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var goe=function(e){return function(t){return e<=0||Fo(t)?t:e>=t.length?Lt:t.slice(e,t.length)}},voe=function(e){return function(t){return e<=0||Fo(t)?t:e>=t.length?Lt:t.slice(0,t.length-e)}};function yoe(e){return function(t){var n=FP(t,e);return n===0?t:n===t.length?Lt:t.slice(n)}}var t0=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return ye(n);return Re}};function n0(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return ye(t[n]);return Re}}var jP=function(e){return function(t){for(var n=0;n<t.length;n++){var r=e(t[n]);if(Mt(r))return r}return Re}};function LP(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return ye(t[n]);return Re}}var DP=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if(Mt(r))return r}return Re}},UP=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return ye(n);return Re}},boe=function(e,t){return function(n){return e<0||e>n.length?Re:ye($y(e,t,n))}},Coe=function(e,t){return BP(e,function(){return t})},Soe=function(e){return function(t){return Zd(e,t)?Re:ye(AW(e,t))}},BP=function(e,t){return function(n){return Zd(e,n)?Re:ye(f0(e,t(n[e]),n))}},woe=function(e){return e.length<=1?e:e.slice().reverse()},xoe=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},_oe=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},Toe=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}},PP=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function WP(e,t){return t===void 0?function(n){return WP(n,e)}:PP(e,t,function(n,r){return[n,r]})}var Ioe=function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},NP=function(e){var t=Oy(e);return function(n){return Kt(n)?t(n):n}},Eoe=function(e){var t=U_(e);return function(n){return Kt(n)?t(n):n}},Roe=function(e){var t=j_(e);return function(n){return Kt(n)?t(n):n}};function dA(e){return function(t,n){if(n===void 0){var r=dA(e);return function(a){return r(t,a)}}for(var i=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(i(n[o]))return!0;return!1}}var $oe=function(e){var t=M_(e);return function(n){return Kt(n)?t(n):n}},koe=function(e){var t=hB(e);return function(n){return Kt(n)?t(n):n}},Ooe=function(e){var t=B_(e);return function(n){return Kt(n)?t(n):Lt}},KP=function(e){return function(t){return e>=1&&Kt(t)?My(e)(t):Fo(t)?[t,Lt]:[Lt,t]}},Moe=function(e){var t=xB(e);return function(n){return Kt(n)?t(n):Lt}},Foe=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return wP(e.apply(void 0,t))}};function joe(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return Kt(o)?_(yr(o),pA(function(a){return r(_(i,e0(a)),Ji(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:Lt};return r(Lt,e)}var qP=function(e){return function(t){return Fo(t)?e:Fo(e)?t:t.concat(e)}},Loe=qP;function RT(e){var t=F_(e);return function(n,r){if(r===void 0){var i=RT(e);return function(o){return i(o,n)}}return Kt(n)&&Kt(r)?t(r)(n):Kt(n)?n:r}}function $T(e){var t=dA(e);return function(n,r){if(r===void 0){var i=$T(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function kT(e){var t=dA(e);return function(n,r){if(r===void 0){var i=kT(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Dn=function(e,t){return _(e,UT(t))},r0=function(e,t){return _(e,eW(t))},Xs=function(e,t){return _(e,XP(t))},fA=function(e,t){return _(e,pA(t))},i0=function(e,t){return _(e,tW(t))},o0=function(e,t){return _(e,PT(t))},a0=function(e,t){return _(e,nW(t))},s0=function(e,t){return _(e,rW(t))},VP=function(e,t){return _(e,WT(t))},zP=function(e,t){return _(e,NT(t))},OT=function(e,t){return _(e,ZP(t))},Dc=function(e,t,n){return _(e,qT(t,n))},Xd=function(e){var t=VT(e);return function(n,r){return _(n,t(r))}},ef=function(e,t,n){return _(e,zT(t,n))},MT=function(e,t,n){return _(e,hA(t,n))},FT=function(e){var t=c0(e);return function(n,r){return _(n,t(r))}},jT=function(e,t,n){return _(e,u0(t,n))},QP=function(e,t){return _(e,BT(t))},HP=function(e,t){return _(e,iW(t))},YP=function(e,t){return _(e,KT(t))},l0=function(e){var t=oW(e);return function(n,r){return _(n,t(r))}},GP=function(e){var t=QT(e);return function(n,r){return _(n,t(r))}},LT=function(e,t){return _(e,XT(t))},DT=function(e,t){return _(e,eI(t))},Uc=Gs,tf=function(){return Lt},JP=function(e){return function(t){return t.concat(e())}},ZP=JP,XP=function(e){return pA(function(t){return _(e,UT(t))})},pA=function(e){return function(t){return _(t,kP(function(n,r){return e(r)}))}},Doe=pA(Q),UT=function(e){return function(t){return t.map(function(n){return e(n)})}},eW=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},nf=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];o._tag==="Left"?t.push(o.left):n.push(o.right)}return Be(t,n)},tW=function(e){return function(t){return t.filter(e)}},BT=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Mt(i)&&n.push(i.value)}return n}},PT=function(e){return BT(function(t,n){return e(n)})},rf=PT(Q),nW=function(e){return WT(function(t,n){return e(n)})},WT=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Be(n,r)}},rW=function(e){return NT(function(t,n){return e(n)})},NT=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Be(n,r)}},iW=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},KT=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},Uoe=KT(Q),c0=function(e){return function(t){return function(n){return n.reduce(function(r,i,o){return e.concat(r,t(o,i))},e.empty)}}},qT=function(e,t){return hA(e,function(n,r,i){return t(r,i)})},VT=function(e){var t=c0(e);return function(n){return t(function(r,i){return n(i)})}},hA=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},zT=function(e,t){return u0(e,function(n,r,i){return t(r,i)})},u0=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},oW=function(e){var t=QT(e);return function(n){return t(function(r,i){return n(i)})}},AA=function(e){return function(t){return Dc(t,e.of(tf()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return _(i,e0(o))}}),r)})}},QT=function(e){return function(t){return hA(e.of(tf()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return _(o,e0(a))}}),t(n,i))})}},Boe=function(e){var t=tI(e);return function(n){return function(r){return t(r,n)}}},Poe=function(e){var t=nI(e);return function(n){return function(r){return t(r,n)}}},HT=function(e,t){for(var n=[],r=e;;){var i=t(r);if(Mt(i)){var o=i.value,a=o[0],s=o[1];n.push(a),r=s}else break}return n},Ct="ReadonlyArray",aW=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},sW=function(){return{concat:function(e,t){return Fo(e)?t:Fo(t)?e:e.concat(t)}}},Woe=function(){return{concat:sW().concat,empty:Lt}},lW=function(e){return ki(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},cW=function(e){return Lc(function(t,n){for(var r=t.length,i=n.length,o=Math.min(r,i),a=0;a<o;a++){var s=e.compare(t[a],n[a]);if(s!==0)return s}return Jy.compare(r,i)})},uW=function(e){var t=RT(e);return{concat:function(n,r){return t(r)(n)}}},Noe=function(e){return{concat:uW(e).concat,empty:Lt}},Koe=function(e){var t=$T(e);return{concat:function(n,r){return t(r)(n)}}},qoe=function(e){var t=kT(e);return{concat:function(n,r){return t(r)(n)}}},YT={URI:Ct,map:Dn},Voe=He(YT),dW={URI:Ct,of:Uc},zoe={URI:Ct,map:Dn,mapWithIndex:r0},d0={URI:Ct,map:Dn,ap:Xs},Qoe=qt(d0),Hoe=Vt(d0),Yoe={URI:Ct,map:Dn,ap:Xs,of:Uc},GT={URI:Ct,map:Dn,ap:Xs,chain:fA},Goe={URI:Ct,map:Dn,ap:Xs,of:Uc,chain:fA},Joe=bt(GT),Zoe={URI:Ct,unfold:HT},Xoe={URI:Ct,map:Dn,alt:OT},fW={URI:Ct,zero:tf},eae=Jd(fW,dW),tae={URI:Ct,map:Dn,ap:Xs,of:Uc,alt:OT,zero:tf},nae={URI:Ct,map:Dn,extend:YP},JT={URI:Ct,compact:rf,separate:nf},rae={URI:Ct,map:Dn,compact:rf,separate:nf,filter:i0,filterMap:o0,partition:a0,partitionMap:s0},iae={URI:Ct,map:Dn,mapWithIndex:r0,compact:rf,separate:nf,filter:i0,filterMap:o0,partition:a0,partitionMap:s0,partitionMapWithIndex:zP,partitionWithIndex:VP,filterMapWithIndex:QP,filterWithIndex:HP},oae={URI:Ct,reduce:Dc,foldMap:Xd,reduceRight:ef},aae={URI:Ct,reduce:Dc,foldMap:Xd,reduceRight:ef,reduceWithIndex:MT,foldMapWithIndex:FT,reduceRightWithIndex:jT},ZT={URI:Ct,map:Dn,reduce:Dc,foldMap:Xd,reduceRight:ef,traverse:l0,sequence:AA},sae={URI:Ct,map:Dn,mapWithIndex:r0,reduce:Dc,foldMap:Xd,reduceRight:ef,reduceWithIndex:MT,foldMapWithIndex:FT,reduceRightWithIndex:jT,traverse:l0,sequence:AA,traverseWithIndex:GP},XT=function(e){return function(t){for(var n=eoe([],e(t),!0),r=[];n.length>0;){var i=n.shift();An(i)?n.unshift.apply(n,e(i.left)):r.push(i.right)}return r}},lae={URI:Ct,map:Dn,ap:Xs,chain:fA,chainRec:LT},eI=function(e){return function(t){var n=e(t),r=[],i=[];function o(c){An(c)?e(c.left).forEach(function(u){return r.push(u)}):i.push(c.right)}for(var a=0,s=n;a<s.length;a++){var l=s[a];o(l)}for(;r.length>0;)o(r.shift());return i}},cae={URI:Ct,map:Dn,ap:Xs,chain:fA,chainRec:DT},tI=ro(ZT,JT),nI=no(ZT,JT),pW={URI:Ct,map:Dn,compact:rf,separate:nf,filter:i0,filterMap:o0,partition:a0,partitionMap:s0,reduce:Dc,foldMap:Xd,reduceRight:ef,traverse:l0,sequence:AA,wither:tI,wilt:nI},uae=ET(pW),hW={URI:Ct,fromEither:xP},dae=di(hW),fae=$y,f0=function(e,t,n){return Kt(n)?O_(e,t,n):n},AW=function(e,t){var n=t.slice();return n.splice(e,1),n},pae=function(e){return e.slice()},hae=function(e){return Fo(e)?Lt:e.slice()},Lt=Xh;function mW(e){return function(t){return t.every(e)}}var gW=function(e){return function(t){return t.some(e)}},Aae=gW,vW=function(e){var t=tT(e);return function(n){return TP(function(){return e.empty},t(n))}},mae=Uc(vn),gae=Qt(YT),vae=Ht(GT),yae=zt(d0),bae=AB,Cae=BB,Sae=PB,wae=NP,xae={URI:Ct,compact:rf,separate:nf,map:Dn,ap:Xs,of:Uc,chain:fA,filter:i0,filterMap:o0,partition:a0,partitionMap:s0,mapWithIndex:r0,partitionMapWithIndex:zP,partitionWithIndex:VP,filterMapWithIndex:QP,filterWithIndex:HP,alt:OT,zero:tf,unfold:HT,reduce:Dc,foldMap:Xd,reduceRight:ef,traverse:l0,sequence:AA,reduceWithIndex:MT,foldMapWithIndex:FT,reduceRightWithIndex:jT,traverseWithIndex:GP,extend:YP,wither:tI,wilt:nI};const _ae=Object.freeze(Object.defineProperty({__proto__:null,Alt:Xoe,Alternative:tae,Applicative:Yoe,Apply:d0,Chain:GT,ChainRecBreadthFirst:cae,ChainRecDepthFirst:lae,Compactable:JT,Do:mae,Extend:nae,Filterable:rae,FilterableWithIndex:iae,Foldable:oae,FoldableWithIndex:aae,FromEither:hW,Functor:YT,FunctorWithIndex:zoe,Monad:Goe,Pointed:dW,Traversable:ZT,TraversableWithIndex:sae,URI:Ct,Unfoldable:Zoe,Witherable:pW,Zero:fW,_chainRecBreadthFirst:DT,_chainRecDepthFirst:LT,alt:ZP,altW:JP,ap:XP,apFirst:Qoe,apS:yae,apSecond:Hoe,append:e0,appendW:roe,bind:vae,bindTo:gae,chain:pA,chainFirst:Joe,chainRecBreadthFirst:eI,chainRecDepthFirst:XT,chainWithIndex:kP,chop:Ooe,chunksOf:Moe,compact:rf,comprehension:joe,concat:Loe,concatW:qP,cons:Cae,deleteAt:Soe,difference:kT,dropLeft:goe,dropLeftWhile:yoe,dropRight:voe,duplicate:Uoe,elem:dA,empty:Lt,every:mW,exists:Aae,extend:KT,filter:tW,filterE:uae,filterMap:PT,filterMapWithIndex:BT,filterWithIndex:iW,findFirst:n0,findFirstMap:jP,findIndex:t0,findLast:LP,findLastIndex:UP,findLastMap:DP,flap:Voe,flatten:Doe,foldLeft:aoe,foldMap:VT,foldMapWithIndex:c0,foldRight:soe,fromArray:hae,fromEither:xP,fromEitherK:dae,fromOption:wP,fromOptionK:Foe,fromPredicate:ooe,getDifferenceMagma:qoe,getEq:lW,getIntersectionSemigroup:Koe,getMonoid:Woe,getOrd:cW,getSemigroup:sW,getShow:aW,getUnionMonoid:Noe,getUnionSemigroup:uW,guard:eae,head:OP,init:foe,insertAt:boe,intercalate:vW,intersection:$T,intersperse:Eoe,isEmpty:Fo,isNonEmpty:Kt,isOutOfBound:Zd,last:MP,lefts:_oe,lookup:pc,makeBy:SP,map:UT,mapWithIndex:eW,match:TP,matchLeft:EP,matchLeftW:IP,matchRight:$P,matchRightW:RP,matchW:_P,modifyAt:BP,of:Uc,partition:nW,partitionMap:rW,partitionMapWithIndex:NT,partitionWithIndex:WT,prepend:toe,prependAll:NP,prependToAll:wae,prependW:noe,range:bae,readonlyArray:xae,reduce:qT,reduceRight:zT,reduceRightWithIndex:u0,reduceWithIndex:hA,replicate:ioe,reverse:woe,rights:xoe,rotate:Roe,scanLeft:loe,scanRight:coe,separate:nf,sequence:AA,size:uoe,snoc:Sae,some:gW,sort:Toe,sortBy:koe,spanLeft:moe,splitAt:KP,tail:doe,takeLeft:poe,takeLeftWhile:Aoe,takeRight:hoe,toArray:pae,traverse:oW,traverseWithIndex:QT,unfold:HT,union:RT,uniq:$oe,unsafeDeleteAt:AW,unsafeInsertAt:fae,unsafeUpdateAt:f0,unzip:Ioe,updateAt:Coe,wilt:Poe,wither:Boe,zero:tf,zip:WP,zipWith:PP},Symbol.toStringTag,{value:"Module"}));var Ps=function(e){return e.length===0},nn=ka,Tae=md,Iae=nT,p0=oA,Eae=rT,yW=function(e,t){return e<=0?[]:Ky(t)(e)},Rae=function(e,t){return yW(e,function(){return t})};function $ae(e){return function(t){return e(t)?[t]:[]}}var bW=function(e){return tn(e)?[]:[e.value]},CW=function(e){return An(e)?[]:[e.right]},SW=function(e,t){return function(n){return nn(n)?t(n):e()}},kae=SW,wW=function(e,t){return function(n){return nn(n)?t(Oi(n),Zi(n)):e()}},xW=wW,Oae=xW,_W=function(e,t){return function(n){return nn(n)?t(Gd(n),Yd(n)):e()}},TW=_W,Mae=TW,IW=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},Fae=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},jae=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},Lae=function(e){return e.length},mA=Ny,Dae=pc,Uae=OP,Bae=MP,Pae=function(e){return nn(e)?ye(Zi(e)):Re},Wae=function(e){return nn(e)?ye(Gd(e)):Re},Nae=function(e){return function(t){return mA(e,t)?er(t):t.slice(0,e)}},Kae=function(e){return function(t){return mA(e,t)?er(t):e===0?[]:t.slice(-e)}};function qae(e){return function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];if(!e(o))break;n.push(o)}return n}}var EW=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function Vae(e){return function(t){var n=MW(EW(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var zae=function(e){return function(t){return e<=0||Ps(t)?er(t):e>=t.length?[]:t.slice(e,t.length)}},Qae=function(e){return function(t){return e<=0||Ps(t)?er(t):e>=t.length?[]:t.slice(0,t.length-e)}};function Hae(e){return function(t){return t.slice(EW(t,e))}}var Yae=t0;function Gae(e){return n0(e)}var Jae=jP;function Zae(e){return LP(e)}var Xae=DP,ese=UP,er=function(e){return e.slice()},tse=function(e,t){return function(n){return e<0||e>n.length?Re:ye(lN(e,t,n))}},nse=function(e,t){return RW(e,function(){return t})},rse=function(e){return function(t){return mA(e,t)?Re:ye(uN(e,t))}},RW=function(e,t){return function(n){return mA(e,n)?Re:ye(cN(e,t(n[e]),n))}},ise=function(e){return Ps(e)?[]:e.slice().reverse()},ose=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},ase=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},sse=function(e){return function(t){return t.length<=1?er(t):t.slice().sort(e.compare)}},$W=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function kW(e,t){return t===void 0?function(n){return kW(n,e)}:$W(e,t,function(n,r){return[n,r]})}var lse=function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},OW=function(e){var t=Vy(e);return function(n){return nn(n)?t(n):[]}},cse=function(e){var t=GB(e);return function(n){return nn(n)?t(n):er(n)}},use=function(e){var t=lT(e);return function(n){return nn(n)?t(n):er(n)}},rI=dA,dse=function(e){var t=aT(e);return function(n){return nn(n)?t(n):er(n)}},fse=function(e){var t=WB(e);return function(n){return nn(n)?t(n):er(n)}},pse=function(e){var t=dT(e);return function(n){return nn(n)?t(n):[]}},MW=function(e){return function(t){return e>=1&&nn(t)?zy(e)(t):Ps(t)?[er(t),[]]:[[],er(t)]}},hse=function(e){var t=eP(e);return function(n){return nn(n)?t(n):[]}},Ase=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return bW(e.apply(void 0,t))}};function mse(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return nn(o)?_(Oi(o),vA(function(a){return r(_(i,p0(a)),Zi(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:[]};return r([],e)}var FW=function(e){return function(t){return Ps(t)?er(e):Ps(e)?er(t):t.concat(e)}},gse=FW;function iI(e){var t=sT(e);return function(n,r){if(r===void 0){var i=iI(e);return function(o){return i(o,n)}}return nn(n)&&nn(r)?t(r)(n):nn(n)?er(n):er(r)}}function oI(e){var t=rI(e);return function(n,r){if(r===void 0){var i=oI(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function aI(e){var t=rI(e);return function(n,r){if(r===void 0){var i=aI(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Un=function(e,t){return _(e,dI(t))},h0=function(e,t){return _(e,NW(t))},el=function(e,t){return _(e,WW(t))},gA=function(e,t){return _(e,vA(t))},A0=function(e,t){return _(e,KW(t))},m0=function(e,t){return _(e,pI(t))},g0=function(e,t){return _(e,qW(t))},v0=function(e,t){return _(e,VW(t))},jW=function(e,t){return _(e,hI(t))},LW=function(e,t){return _(e,AI(t))},sI=function(e,t){return _(e,QW(t))},Bc=function(e,t,n){return _(e,JW(t,n))},of=function(e){var t=YW(e);return function(n,r){return _(n,t(r))}},af=function(e,t,n){return _(e,ZW(t,n))},lI=function(e,t,n){return _(e,gI(t,n))},cI=function(e){var t=GW(e);return function(n,r){return _(n,t(r))}},uI=function(e,t,n){return _(e,XW(t,n))},DW=function(e,t){return _(e,fI(t))},UW=function(e,t){return _(e,HW(t))},BW=function(e,t){return _(e,mI(t))},y0=function(e){var t=b0(e);return function(n,r){return _(n,t(r))}},PW=function(e){var t=vI(e);return function(n,r){return _(n,t(r))}},vse=LT,yse=DT,tl=Zs,sf=function(){return[]},dI=function(e){return function(t){return t.map(function(n){return e(n)})}},WW=function(e){return vA(function(t){return _(e,dI(t))})},vA=function(e){return function(t){return _(t,IW(function(n,r){return e(r)}))}},bse=vA(Q),NW=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},fI=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Mt(i)&&n.push(i.value)}return n}},pI=function(e){return fI(function(t,n){return e(n)})},lf=pI(Q),cf=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];o._tag==="Left"?t.push(o.left):n.push(o.right)}return Be(t,n)},KW=function(e){return function(t){return t.filter(e)}},qW=function(e){return hI(function(t,n){return e(n)})},hI=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Be(n,r)}},VW=function(e){return AI(function(t,n){return e(n)})},AI=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Be(n,r)}},zW=function(e){return function(t){return t.concat(e())}},QW=zW,HW=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},mI=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},Cse=mI(Q),YW=VT,GW=c0,JW=qT,gI=hA,ZW=zT,XW=u0,b0=function(e){var t=vI(e);return function(n){return t(function(r,i){return n(i)})}},yA=function(e){return function(t){return Bc(t,e.of(sf()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return _(i,p0(o))}}),r)})}},vI=function(e){return function(t){return gI(e.of(sf()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return _(o,p0(a))}}),t(n,i))})}},Sse=function(e){var t=_I(e);return function(n){return function(r){return t(r,n)}}},wse=function(e){var t=TI(e);return function(n){return function(r){return t(r,n)}}},yI=function(e,t){for(var n=[],r=e;;){var i=t(r);if(Mt(i)){var o=i.value,a=o[0],s=o[1];n.push(a),r=s}else break}return n},St="Array",xse=aW,eN=function(){return{concat:function(e,t){return e.concat(t)}}},bI=function(){return{concat:eN().concat,empty:[]}},tN=lW,_se=cW,nN=function(e){var t=iI(e);return{concat:function(n,r){return t(r)(n)}}},Tse=function(e){return{concat:nN(e).concat,empty:[]}},Ise=function(e){var t=oI(e);return{concat:function(n,r){return t(r)(n)}}},Ese=function(e){var t=aI(e);return{concat:function(n,r){return t(r)(n)}}},CI={URI:St,map:Un},Rse=He(CI),rN={URI:St,of:tl},$se={URI:St,map:Un,mapWithIndex:h0},C0={URI:St,map:Un,ap:el},kse=qt(C0),Ose=Vt(C0),Mse={URI:St,map:Un,ap:el,of:tl},SI={URI:St,map:Un,ap:el,chain:gA},Fse=bt(SI),jse={URI:St,map:Un,ap:el,of:tl,chain:gA},Lse={URI:St,unfold:yI},Dse={URI:St,map:Un,alt:sI},iN={URI:St,zero:sf},Use=Jd(iN,rN),Bse={URI:St,map:Un,ap:el,of:tl,alt:sI,zero:sf},Pse={URI:St,map:Un,extend:BW},wI={URI:St,compact:lf,separate:cf},Wse={URI:St,map:Un,compact:lf,separate:cf,filter:A0,filterMap:m0,partition:g0,partitionMap:v0},Nse={URI:St,map:Un,mapWithIndex:h0,compact:lf,separate:cf,filter:A0,filterMap:m0,partition:g0,partitionMap:v0,partitionMapWithIndex:LW,partitionWithIndex:jW,filterMapWithIndex:DW,filterWithIndex:UW},oN={URI:St,reduce:Bc,foldMap:of,reduceRight:af},Kse={URI:St,reduce:Bc,foldMap:of,reduceRight:af,reduceWithIndex:lI,foldMapWithIndex:cI,reduceRightWithIndex:uI},xI={URI:St,map:Un,reduce:Bc,foldMap:of,reduceRight:af,traverse:y0,sequence:yA},qse={URI:St,map:Un,mapWithIndex:h0,reduce:Bc,foldMap:of,reduceRight:af,reduceWithIndex:lI,foldMapWithIndex:cI,reduceRightWithIndex:uI,traverse:y0,sequence:yA,traverseWithIndex:PW},_I=ro(xI,wI),TI=no(xI,wI),aN={URI:St,map:Un,compact:lf,separate:cf,filter:A0,filterMap:m0,partition:g0,partitionMap:v0,reduce:Bc,foldMap:of,reduceRight:af,traverse:y0,sequence:yA,wither:_I,wilt:TI},Vse=XT,zse={URI:St,map:Un,ap:el,chain:gA,chainRec:vse},Qse=eI,Hse={URI:St,map:Un,ap:el,chain:gA,chainRec:yse},Yse=ET(aN),sN={URI:St,fromEither:CW},Gse=di(sN),lN=iT,cN=function(e,t,n){return nn(n)?oT(e,t,n):[]},uN=function(e,t){var n=t.slice();return n.splice(e,1),n},Jse=mW,dN=function(e){return function(t){return t.some(e)}},Zse=dN,Xse=vW,ele=tl(vn),tle=Qt(CI),nle=Ht(SI),rle=zt(C0),ile=NB,ole=[],ale=AP,sle=mP,lle=OW,cle={URI:St,compact:lf,separate:cf,map:Un,ap:el,of:tl,chain:gA,filter:A0,filterMap:m0,partition:g0,partitionMap:v0,mapWithIndex:h0,partitionMapWithIndex:LW,partitionWithIndex:jW,filterMapWithIndex:DW,filterWithIndex:UW,alt:sI,zero:sf,unfold:yI,reduce:Bc,foldMap:of,reduceRight:af,traverse:y0,sequence:yA,reduceWithIndex:lI,foldMapWithIndex:cI,reduceRightWithIndex:uI,traverseWithIndex:PW,extend:BW,wither:_I,wilt:TI};const ule=Object.freeze(Object.defineProperty({__proto__:null,Alt:Dse,Alternative:Bse,Applicative:Mse,Apply:C0,Chain:SI,ChainRecBreadthFirst:Hse,ChainRecDepthFirst:zse,Compactable:wI,Do:ele,Extend:Pse,Filterable:Wse,FilterableWithIndex:Nse,Foldable:oN,FoldableWithIndex:Kse,FromEither:sN,Functor:CI,FunctorWithIndex:$se,Monad:jse,Pointed:rN,Traversable:xI,TraversableWithIndex:qse,URI:St,Unfoldable:Lse,Witherable:aN,Zero:iN,alt:QW,altW:zW,ap:WW,apFirst:kse,apS:rle,apSecond:Ose,append:p0,appendW:Eae,array:cle,bind:nle,bindTo:tle,chain:vA,chainFirst:Fse,chainRecBreadthFirst:Qse,chainRecDepthFirst:Vse,chainWithIndex:IW,chop:pse,chunksOf:hse,compact:lf,comprehension:mse,concat:gse,concatW:FW,cons:ale,copy:er,deleteAt:rse,difference:aI,dropLeft:zae,dropLeftWhile:Hae,dropRight:Qae,duplicate:Cse,elem:rI,empty:ole,every:Jse,exists:Zse,extend:mI,filter:KW,filterE:Yse,filterMap:pI,filterMapWithIndex:fI,filterWithIndex:HW,findFirst:Gae,findFirstMap:Jae,findIndex:Yae,findLast:Zae,findLastIndex:ese,findLastMap:Xae,flap:Rse,flatten:bse,foldLeft:Oae,foldMap:YW,foldMapWithIndex:GW,foldRight:Mae,fromEither:CW,fromEitherK:Gse,fromOption:bW,fromOptionK:Ase,fromPredicate:$ae,getDifferenceMagma:Ese,getEq:tN,getIntersectionSemigroup:Ise,getMonoid:bI,getOrd:_se,getSemigroup:eN,getShow:xse,getUnionMonoid:Tse,getUnionSemigroup:nN,guard:Use,head:Uae,init:Wae,insertAt:tse,intercalate:Xse,intersection:oI,intersperse:cse,isEmpty:Ps,isNonEmpty:nn,isOutOfBound:mA,last:Bae,lefts:ase,lookup:Dae,makeBy:yW,map:dI,mapWithIndex:NW,match:kae,matchLeft:xW,matchLeftW:wW,matchRight:TW,matchRightW:_W,matchW:SW,modifyAt:RW,of:tl,partition:qW,partitionMap:VW,partitionMapWithIndex:AI,partitionWithIndex:hI,prepend:Tae,prependAll:OW,prependToAll:lle,prependW:Iae,range:ile,reduce:JW,reduceRight:ZW,reduceRightWithIndex:XW,reduceWithIndex:gI,replicate:Rae,reverse:ise,rights:ose,rotate:use,scanLeft:Fae,scanRight:jae,separate:cf,sequence:yA,size:Lae,snoc:sle,some:dN,sort:sse,sortBy:fse,spanLeft:Vae,splitAt:MW,tail:Pae,takeLeft:Nae,takeLeftWhile:qae,takeRight:Kae,traverse:b0,traverseWithIndex:vI,unfold:yI,union:iI,uniq:dse,unsafeDeleteAt:uN,unsafeInsertAt:lN,unsafeUpdateAt:cN,unzip:lse,updateAt:nse,wilt:wse,wither:Sse,zero:sf,zip:kW,zipWith:$W},Symbol.toStringTag,{value:"Module"})),dle=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var fle=function(e){return typeof e=="boolean"},fN=function(e,t){return function(n){return n?t():e()}},pN=fN,hN=pN,ple=hN,AN={equals:function(e,t){return e===t}},hle={meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},mN={concat:function(e,t){return e&&t}},gN={concat:function(e,t){return e||t}},Ale={concat:mN.concat,empty:!0},mle={concat:gN.concat,empty:!1},gle={equals:AN.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},vle={show:function(e){return JSON.stringify(e)}};const yle=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:hle,Eq:AN,MonoidAll:Ale,MonoidAny:mle,Ord:gle,SemigroupAll:mN,SemigroupAny:gN,Show:vle,fold:ple,foldW:pN,isBoolean:fle,match:hN,matchW:fN},Symbol.toStringTag,{value:"Module"}));var vN=function(e){return{meet:function(t,n){return e.join(t,n)},join:function(t,n){return e.meet(t,n)},zero:e.one,one:e.zero,implies:function(t,n){return e.join(e.not(t),n)},not:e.not}},ble={meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},Cle=vN,Sle={meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},wle=jU;const xle=Object.freeze(Object.defineProperty({__proto__:null,booleanAlgebraBoolean:Sle,booleanAlgebraVoid:ble,getDualBooleanAlgebra:Cle,getFunctionBooleanAlgebra:wle,reverse:vN},Symbol.toStringTag,{value:"Module"}));var _le=function(e){return rB(e)(e.bottom,e.top)},Tle=function(e){var t=C_(e);return{equals:t.equals,compare:t.compare,top:e.bottom,bottom:e.top}},Ile={equals:Sv.equals,compare:Sv.compare,top:1/0,bottom:-1/0};const Ele=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:Ile,clamp:_le,reverse:Tle},Symbol.toStringTag,{value:"Module"}));function yN(e){return{meet:wy(e),join:xy(e)}}const Rle=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:yN},Symbol.toStringTag,{value:"Module"}));function $le(e){var t=yN(e);return function(n,r){return{join:t.join,meet:t.meet,zero:n,one:r}}}const kle=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:$le},Symbol.toStringTag,{value:"Module"})),Ole=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Mle=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Fle=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),jle=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var II=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};const Lle=Object.freeze(Object.defineProperty({__proto__:null,tailRec:II},Symbol.toStringTag,{value:"Module"}));function EI(e,t){return function(n,r){return t.compose(e.right(r),e.left(n))}}function bN(e,t){var n=EI(e,t);return function(r,i){return t.compose(e.promap(t.id(),function(o){return o._tag==="Left"?o.left:o.right},Q),n(r,i))}}function Dle(e){return EI(e,e)}function Ule(e){return bN(e,e)}const Ble=Object.freeze(Object.defineProperty({__proto__:null,fanIn:bN,fanin:Ule,split:EI,splitChoice:Dle},Symbol.toStringTag,{value:"Module"})),Ple=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Wle=function(e,t){return _(e,CN(t))},CN=function(e){return function(t){return X(e,t)}},SN="Predicate",wN=function(){return{concat:function(e,t){return _(e,_N(t))}}},Nle=function(){return{concat:wN().concat,empty:UU}},xN=function(){return{concat:function(e,t){return _(e,TN(t))}}},Kle=function(){return{concat:xN().concat,empty:g_}},qle={URI:SN,contramap:Wle},bh=function(e){return function(t){return!e(t)}},_N=function(e){return function(t){return function(n){return t(n)||e(n)}}},TN=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const Vle=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:qle,URI:SN,and:TN,contramap:CN,getMonoidAll:Kle,getMonoidAny:Nle,getSemigroupAll:xN,getSemigroupAny:wN,not:bh,or:_N},Symbol.toStringTag,{value:"Module"}));var ft=Re,Ft=ye;function S0(e){return function(t){return e(t)?Ft(t):ft}}var w0=function(e){return e._tag==="Right"?ft:Ft(e.left)},bA=function(e){return e._tag==="Left"?ft:Ft(e.right)},fi=function(e,t){return _(e,No(t))},Pc=function(e,t){return _(e,$N(t))},x0=function(e,t){return _(e,CA(t))},_0=function(e,t,n){return _(e,ON(t,n))},T0=function(e){var t=MN(e);return function(n,r){return _(n,t(r))}},I0=function(e,t,n){return _(e,FN(t,n))},RI=function(e){var t=NN(e);return function(n,r){return _(n,t(r))}},$I=function(e,t){return _(e,LN(t))},Ch=function(e,t){return _(e,UN(t))},kI=function(e,t){return _(e,BN(t))},IN=function(e,t){return _(e,jI(t))},OI=function(e,t){return _(e,PN(t))},MI=function(e,t){return _(e,WN(t))},ln="Option",zle=function(e){return{show:function(t){return Qe(t)?"none":"some(".concat(e.show(t.value),")")}}},EN=function(e){return{equals:function(t,n){return t===n||(Qe(t)?Qe(n):Qe(n)?!1:e.equals(t.value,n.value))}}},Qle=function(e){return{equals:EN(e).equals,compare:function(t,n){return t===n?0:wv(t)?wv(n)?e.compare(t.value,n.value):1:-1}}},FI=function(e){return{concat:function(t,n){return Qe(t)?n:Qe(n)?t:Ft(e.concat(t.value,n.value))},empty:ft}},No=function(e){return function(t){return Qe(t)?ft:Ft(e(t.value))}},uf={URI:ln,map:fi},Oa=Ft,RN={URI:ln,of:Oa},$N=function(e){return function(t){return Qe(t)||Qe(e)?ft:Ft(t.value(e.value))}},df={URI:ln,map:fi,ap:Pc},kN={URI:ln,map:fi,ap:Pc,of:Oa},CA=function(e){return function(t){return Qe(t)?ft:e(t.value)}},SA={URI:ln,map:fi,ap:Pc,chain:x0},Hle={URI:ln,map:fi,ap:Pc,of:Oa,chain:x0},ON=function(e,t){return function(n){return Qe(n)?e:t(e,n.value)}},MN=function(e){return function(t){return function(n){return Qe(n)?e.empty:t(n.value)}}},FN=function(e,t){return function(n){return Qe(n)?e:t(n.value,e)}},Yle={URI:ln,reduce:_0,foldMap:T0,reduceRight:I0},jN=function(e){return function(t){return Qe(t)?e():t}},LN=jN,Gle={URI:ln,map:fi,alt:$I},E0=function(){return ft},DN={URI:ln,zero:E0},Jle=Jd(DN,RN),Zle={URI:ln,map:fi,ap:Pc,of:Oa,alt:$I,zero:E0},jI=function(e){return function(t){return Qe(t)?ft:Ft(e(t))}},Xle={URI:ln,map:fi,extend:IN},ff=CA(Q),ece=Be(ft,ft),pf=function(e){return Qe(e)?ece:Be(w0(e.value),bA(e.value))},Wc={URI:ln,compact:ff,separate:pf},UN=function(e){return function(t){return Qe(t)?ft:e(t.value)?t:ft}},BN=function(e){return function(t){return Qe(t)?ft:e(t.value)}},PN=function(e){return function(t){return Be(Ch(t,bh(e)),Ch(t,e))}},WN=function(e){return X(No(e),pf)},Ma={URI:ln,map:fi,compact:ff,separate:pf,filter:Ch,filterMap:kI,partition:OI,partitionMap:MI},NN=function(e){return function(t){return function(n){return Qe(n)?e.of(ft):e.map(t(n.value),Ft)}}},R0=function(e){return function(t){return Qe(t)?e.of(ft):e.map(t.value,Ft)}},LI={URI:ln,map:fi,reduce:_0,foldMap:T0,reduceRight:I0,traverse:RI,sequence:R0},DI=ro(LI,Wc),UI=no(LI,Wc),tce=function(e){var t=DI(e);return function(n){return function(r){return t(r,n)}}},nce=function(e){var t=UI(e);return function(n){return function(r){return t(r,n)}}},rce={URI:ln,map:fi,reduce:_0,foldMap:T0,reduceRight:I0,traverse:RI,sequence:R0,compact:ff,separate:pf,filter:Ch,filterMap:kI,partition:OI,partitionMap:MI,wither:DI,wilt:UI},BI=function(){return ft},ice={URI:ln,map:fi,ap:Pc,of:Oa,chain:x0,throwError:BI},hf=bA,$0={URI:ln,fromEither:hf},wv=Mt,Qe=function(e){return e._tag==="None"},PI=function(e,t){return function(n){return Qe(n)?e():t(n.value)}},oce=PI,Fa=PI,nl=Fa,KN=function(e){return function(t){return Qe(t)?e():t.value}},WI=KN,ace=He(uf),sce=qt(df),lce=Vt(df),cce=ff,uce=bt(SA),dce=jI(Q),fce=di($0),pce=Ra($0,SA),hce=$a($0,SA),Nc=function(e){return e==null?ft:Ft(e)},qN=function(e){try{return Ft(e())}catch{return ft}},Ace=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return qN(function(){return e.apply(void 0,t)})}},mce=function(e){return X(e,Nc)},VN=function(e){return function(t){return Qe(t)?ft:Nc(e(t.value))}},NI=Fa(BU,Q),zN=Fa(v_,Q);function QN(e){return function(t,n){if(n===void 0){var r=QN(e);return function(i){return r(t,i)}}return Qe(n)?!1:e.equals(t,n.value)}}var gce=function(e){return function(t){return Qe(t)?!1:e(t.value)}},vce=Oa(vn),yce=Qt(uf),bce=Ht(SA),Cce=zt(df),HN=Oa(Ln),k0=function(e){return function(t){var n=e(0,ui(t));if(Qe(n))return ft;for(var r=[n.value],i=1;i<t.length;i++){var o=e(i,t[i]);if(Qe(o))return ft;r.push(o.value)}return Ft(r)}},KI=function(e){var t=k0(e);return function(n){return Tt(n)?t(n):HN}},Sce=KI,YN=function(e){return KI(function(t,n){return e(n)})},wce=YN(Q);function xce(e){return function(t){return wv(e(t))}}var _ce=VN,GN={URI:ln,map:fi,of:Oa,ap:Pc,chain:x0,reduce:_0,foldMap:T0,reduceRight:I0,traverse:RI,sequence:R0,zero:E0,alt:$I,extend:IN,compact:ff,separate:pf,filter:Ch,filterMap:kI,partition:OI,partitionMap:MI,wither:DI,wilt:UI,throwError:BI},Tce=yn(df),Ice=$i(kN),JN=function(){return FI(E_())},Ece=function(){return FI(Iy())};const Rce=Object.freeze(Object.defineProperty({__proto__:null,Alt:Gle,Alternative:Zle,ApT:HN,Applicative:kN,Apply:df,Chain:SA,Compactable:Wc,Do:vce,Extend:Xle,Filterable:Ma,Foldable:Yle,FromEither:$0,Functor:uf,Monad:Hle,MonadThrow:ice,Pointed:RN,Traversable:LI,URI:ln,Witherable:rce,Zero:DN,alt:LN,altW:jN,ap:$N,apFirst:sce,apS:Cce,apSecond:lce,bind:bce,bindTo:yce,chain:CA,chainEitherK:pce,chainFirst:uce,chainFirstEitherK:hce,chainNullableK:VN,compact:ff,duplicate:dce,elem:QN,exists:gce,extend:jI,filter:UN,filterMap:BN,flap:ace,flatten:cce,fold:nl,foldMap:MN,foldW:oce,fromEither:hf,fromEitherK:fce,fromNullable:Nc,fromNullableK:mce,fromPredicate:S0,getApplyMonoid:Ice,getApplySemigroup:Tce,getEq:EN,getFirstMonoid:JN,getLastMonoid:Ece,getLeft:w0,getMonoid:FI,getOrElse:WI,getOrElseW:KN,getOrd:Qle,getRefinement:xce,getRight:bA,getShow:zle,guard:Jle,isNone:Qe,isSome:wv,map:No,mapNullable:_ce,match:Fa,matchW:PI,none:ft,of:Oa,option:GN,partition:PN,partitionMap:WN,reduce:ON,reduceRight:FN,separate:pf,sequence:R0,sequenceArray:wce,some:Ft,throwError:BI,toNullable:NI,toUndefined:zN,traverse:NN,traverseArray:YN,traverseArrayWithIndex:Sce,traverseReadonlyArrayWithIndex:KI,traverseReadonlyNonEmptyArrayWithIndex:k0,tryCatch:qN,tryCatchK:Ace,wilt:nce,wither:tce,zero:E0},Symbol.toStringTag,{value:"Module"}));function Ko(e,t){return function(n){return e.map(n,t.compact)}}function ja(e,t,n){var r=Ko(e,t),i=qd(e,n);return function(o){return Be(r(_(o,i(w0))),r(_(o,i(bA))))}}function $ce(e,t){var n=Vd(e,t).map;return{map:n,compact:Ko(e,t),separate:ja(e,t,t)}}const kce=Object.freeze(Object.defineProperty({__proto__:null,compact:Ko,getCompactableComposition:$ce,separate:ja},Symbol.toStringTag,{value:"Module"}));var Oce=function(e){return function(){return console.log(e)}},Mce=function(e){return function(){return console.warn(e)}},Fce=function(e){return function(){return console.error(e)}},jce=function(e){return function(){return console.info(e)}};const Lce=Object.freeze(Object.defineProperty({__proto__:null,error:Fce,info:jce,log:Oce,warn:Mce},Symbol.toStringTag,{value:"Module"}));var Af=hd;function Dce(e){return{show:function(t){return"make(".concat(e.show(t),")")}}}var Uce=Q,Bce=Q,Pce=Q,Wce=Q,Nce=Q,Kce=Q,qce=Q,Vce=Q,zce=Q;function ZN(e){return{URI:Kc,_E:void 0,map:qI,ap:function(t,n){return Af(e.concat(t,n))}}}function XN(e){var t=ZN(e);return{URI:Kc,_E:void 0,map:t.map,ap:t.ap,of:function(){return Af(e.empty)}}}var eK=function(e,t){return _(e,rK())},qI=function(e,t){return _(e,iK())},tK=function(e,t,n){return _(e,oK(t))},nK=function(e,t){return _(e,aK(t))},rK=function(){return hd},iK=function(){return hd},oK=function(e){return function(t){return Af(e(t))}},aK=function(e){return function(t){return Af(e(t))}},Kc="Const",sK={URI:Kc,map:qI},Qce=He(sK),Hce={URI:Kc,contramap:eK},Yce={URI:Kc,bimap:tK,mapLeft:nK},Gce={URI:Kc,map:qI,contramap:eK,bimap:tK,mapLeft:nK};const Jce=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:Yce,Contravariant:Hce,Functor:sK,URI:Kc,bimap:oK,const_:Gce,contramap:rK,flap:Qce,getApplicative:XN,getApply:ZN,getBooleanAlgebra:zce,getBounded:Pce,getEq:Uce,getHeytingAlgebra:Vce,getMonoid:Nce,getOrd:Bce,getRing:qce,getSemigroup:Wce,getSemiring:Kce,getShow:Dce,make:Af,map:iK,mapLeft:aK},Symbol.toStringTag,{value:"Module"})),Zce=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Xce={equals:function(e,t){return e.valueOf()===t.valueOf()}},eue={equals:function(e,t){return e.getDate()===t.getDate()}},tue={equals:function(e,t){return e.getMonth()===t.getMonth()}},nue={equals:function(e,t){return e.getFullYear()===t.getFullYear()}},rue=_(Jy,Sy(function(e){return e.valueOf()})),iue=function(){return new Date},oue=function(){return new Date().getTime()};const aue=Object.freeze(Object.defineProperty({__proto__:null,Eq:Xce,Ord:rue,create:iue,eqDate:eue,eqMonth:tue,eqYear:nue,now:oue},Symbol.toStringTag,{value:"Module"}));var Dt=Sa,Je=Hs,rr=function(e,t){return _(e,zc(t))},qc=function(e,t){return _(e,dK(t))},mf=function(e,t){return _(e,Mi(t))},wA=function(e,t,n){return _(e,pK(t,n))},xA=function(e){return function(t,n){var r=hK(e);return _(t,r(n))}},_A=function(e,t,n){return _(e,AK(t,n))},O0=function(e){var t=mK(e);return function(n,r){return _(n,t(r))}},VI=function(e,t,n){return _(e,GI(t,n))},zI=function(e,t){return _(e,RA(t))},lK=function(e,t){return _(e,vK(t))},QI=function(e,t){return _(e,JI(t))},HI=function(e,t){return II(t(e),function(n){return ce(n)?Je(Dt(n.left)):ce(n.right)?Dt(t(n.right.left)):Je(Je(n.right.right))})},Bt="Either",sue=function(e,t){return{show:function(n){return ce(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}},lue=function(e,t){return{equals:function(n,r){return n===r||(ce(n)?ce(r)&&e.equals(n.left,r.left):ZI(r)&&t.equals(n.right,r.right))}}},TA=function(e){return{concat:function(t,n){return ce(n)?t:ce(t)?n:Je(e.concat(t.right,n.right))}}},Vc=function(e){var t=Dt(e.empty);return{URI:Bt,_E:void 0,compact:function(n){return ce(n)?n:n.right._tag==="None"?t:Je(n.right.value)},separate:function(n){return ce(n)?Be(n,n):ce(n.right)?Be(Je(n.right.left),t):Be(t,Je(n.right.right))}}},gf=function(e){var t=Dt(e.empty),n=Vc(e),r=n.compact,i=n.separate,o=function(s,l){return ce(s)||l(s.right)?s:t},a=function(s,l){return ce(s)?Be(s,s):l(s.right)?Be(t,Je(s.right)):Be(Je(s.right),t)};return{URI:Bt,_E:void 0,map:rr,compact:r,separate:i,filter:o,filterMap:function(s,l){if(ce(s))return s;var c=l(s.right);return c._tag==="None"?t:Je(c.value)},partition:a,partitionMap:function(s,l){if(ce(s))return Be(s,s);var c=l(s.right);return ce(c)?Be(Je(c.left),t):Be(t,Je(c.right))}}},cue=function(e){var t=gf(e),n=Vc(e);return{URI:Bt,_E:void 0,map:rr,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:O0,sequence:EA,reduce:wA,foldMap:xA,reduceRight:_A,wither:ro(Uw,n),wilt:no(Uw,n)}},rl=function(e){return{URI:Bt,_E:void 0,map:rr,ap:function(t,n){return ce(t)?ce(n)?Dt(e.concat(t.left,n.left)):t:ce(n)?n:Je(t.right(n.right))},of:qo}},cK=function(e){return{URI:Bt,_E:void 0,map:rr,alt:function(t,n){if(ZI(t))return t;var r=n();return ce(r)?Dt(e.concat(t.left,r.left)):r}}},zc=function(e){return function(t){return ce(t)?t:Je(e(t.right))}},il={URI:Bt,map:rr},qo=Je,uue={URI:Bt,of:qo},uK=function(e){return function(t){return ce(t)?t:ce(e)?e:Je(t.right(e.right))}},dK=uK,vf={URI:Bt,map:rr,ap:qc},fK={URI:Bt,map:rr,ap:qc,of:qo},YI=function(e){return function(t){return ce(t)?t:e(t.right)}},Mi=YI,IA={URI:Bt,map:rr,ap:qc,chain:mf},due={URI:Bt,map:rr,ap:qc,of:qo,chain:mf},pK=function(e,t){return function(n){return ce(n)?e:t(e,n.right)}},hK=function(e){return function(t){return function(n){return ce(n)?e.empty:t(n.right)}}},AK=function(e,t){return function(n){return ce(n)?e:t(n.right,e)}},fue={URI:Bt,reduce:wA,foldMap:xA,reduceRight:_A},mK=function(e){return function(t){return function(n){return ce(n)?e.of(Dt(n.left)):e.map(t(n.right),Je)}}},EA=function(e){return function(t){return ce(t)?e.of(Dt(t.left)):e.map(t.right,Je)}},Uw={URI:Bt,map:rr,reduce:wA,foldMap:xA,reduceRight:_A,traverse:O0,sequence:EA},GI=function(e,t){return function(n){return ce(n)?Dt(e(n.left)):Je(t(n.right))}},RA=function(e){return function(t){return ce(t)?Dt(e(t.left)):t}},pue={URI:Bt,bimap:VI,mapLeft:zI},gK=function(e){return function(t){return ce(t)?e():t}},vK=gK,hue={URI:Bt,map:rr,alt:lK},JI=function(e){return function(t){return ce(t)?t:Je(e(t))}},Aue={URI:Bt,map:rr,extend:QI},mue={URI:Bt,map:rr,ap:qc,chain:mf,chainRec:HI},M0=Dt,gue={URI:Bt,map:rr,ap:qc,of:qo,chain:mf,throwError:M0},yf={URI:Bt,fromEither:Q},vue=Ys(yf),yK=Bo(yf),ce=An,ZI=y_,XI=function(e,t){return function(n){return ce(n)?e(n.left):t(n.right)}},bK=XI,ol=XI,eE=ol,CK=function(e){return function(t){return ce(t)?e(t.left):t.right}},yue=CK,bue=He(il),SK=qt(vf),Cue=SK,wK=Vt(vf),Sue=wK,xK=bt(IA),wue=xK,_K=YI(Q),xue=_K,_ue=JI(Q),Tue=Po(yf),Iue=Fc(yf,IA),TK=jc(yf,IA),Eue=TK,IK=function(e){return ce(e)?Je(e.left):Dt(e.right)},EK=function(e){return function(t){return ce(t)?e(t.left):t}},RK=EK,tE=function(e){return function(t){return t==null?Dt(e):Je(t)}},Qc=function(e,t){try{return Je(e())}catch(n){return Dt(t(n))}},Rue=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Qc(function(){return e.apply(void 0,n)},t)}},$K=function(e){var t=tE(e);return function(n){return X(n,t)}},$ue=function(e){var t=$K(e);return function(n){return Mi(t(n))}},kK=bK(Q,Q);function kue(e){return e instanceof Error?e:new Error(String(e))}function OK(e){return function(t,n){if(n===void 0){var r=OK(e);return function(i){return r(t,i)}}return ce(n)?!1:e.equals(t,n.right)}}var Oue=function(e){return function(t){return ce(t)?!1:e(t.right)}},Mue=qo(vn),Fue=Qt(il),MK=Ht(IA),jue=MK,FK=zt(vf),Lue=FK,jK=qo(Ln),$A=function(e){return function(t){var n=e(0,ui(t));if(ce(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i]);if(ce(o))return o;r.push(o.right)}return Je(r)}},nE=function(e){var t=$A(e);return function(n){return Tt(n)?t(n):jK}},Due=nE,LK=function(e){return nE(function(t,n){return e(n)})},Uue=LK(Q);function Bue(e,t){return Qc(function(){return JSON.parse(e)},t)}var Pue=function(e,t){return Qc(function(){var n=JSON.stringify(e);if(typeof n!="string")throw new Error("Converting unsupported structure to JSON");return n},t)},Wue={URI:Bt,map:rr,of:qo,ap:qc,chain:mf,reduce:wA,foldMap:xA,reduceRight:_A,traverse:O0,sequence:EA,bimap:VI,mapLeft:zI,alt:lK,extend:QI,chainRec:HI,throwError:M0},Nue=yn(vf),Kue=$i(fK),que=function(e,t){return yn(rl(e))(t)},Vue=function(e,t){return $i(rl(e))(t)};function zue(e){var t=rl(e).ap,n=cK(e).alt;return{URI:Bt,_E:void 0,map:rr,of:qo,chain:mf,bimap:VI,mapLeft:zI,reduce:wA,foldMap:xA,reduceRight:_A,extend:QI,traverse:O0,sequence:EA,chainRec:HI,throwError:M0,ap:t,alt:n}}const DK=Object.freeze(Object.defineProperty({__proto__:null,Alt:hue,ApT:jK,Applicative:fK,Apply:vf,Bifunctor:pue,Chain:IA,ChainRec:mue,Do:Mue,Extend:Aue,Foldable:fue,FromEither:yf,Functor:il,Monad:due,MonadThrow:gue,Pointed:uue,Traversable:Uw,URI:Bt,alt:vK,altW:gK,ap:dK,apFirst:SK,apFirstW:Cue,apS:FK,apSW:Lue,apSecond:wK,apSecondW:Sue,apW:uK,bimap:GI,bind:MK,bindTo:Fue,bindW:jue,chain:Mi,chainFirst:xK,chainFirstW:wue,chainNullableK:$ue,chainOptionK:Iue,chainW:YI,duplicate:_ue,either:Wue,elem:OK,exists:Oue,extend:JI,filterOrElse:TK,filterOrElseW:Eue,flap:bue,flatten:xue,flattenW:_K,fold:eE,foldMap:hK,foldW:bK,fromNullable:tE,fromNullableK:$K,fromOption:yK,fromOptionK:Tue,fromPredicate:vue,getAltValidation:cK,getApplicativeValidation:rl,getApplyMonoid:Kue,getApplySemigroup:Nue,getCompactable:Vc,getEq:lue,getFilterable:gf,getOrElse:yue,getOrElseW:CK,getSemigroup:TA,getShow:sue,getValidation:zue,getValidationMonoid:Vue,getValidationSemigroup:que,getWitherable:cue,isLeft:ce,isRight:ZI,left:Dt,map:zc,mapLeft:RA,match:ol,matchW:XI,of:qo,orElse:RK,orElseW:EK,parseJSON:Bue,reduce:pK,reduceRight:AK,right:Je,sequence:EA,sequenceArray:Uue,stringifyJSON:Pue,swap:IK,throwError:M0,toError:kue,toUnion:kK,traverse:mK,traverseArray:LK,traverseArrayWithIndex:Due,traverseReadonlyArrayWithIndex:nE,traverseReadonlyNonEmptyArrayWithIndex:$A,tryCatch:Qc,tryCatchK:Rue},Symbol.toStringTag,{value:"Module"}));function Hc(e){return X(Je,e.of)}function bf(e){return X(Dt,e.of)}function Cf(e){return function(t){return e.map(t,Je)}}function Sf(e){return function(t){return e.map(t,Dt)}}function F0(e){return function(t){return X(tE(t),e.of)}}function j0(e){var t=F0(e);return function(n){var r=t(n);return function(i){return X(i,r)}}}function rE(e){var t=Yc(e),n=j0(e);return function(r){var i=n(r);return function(o){return t(i(o))}}}function wf(e){return qd(e,il)}function xf(e){return Ea(e,vf)}function Yc(e){return function(t){return function(n){return e.chain(n,function(r){return ce(r)?e.of(r):t(r.right)})}}}function _f(e){return function(t){return function(n){return e.chain(n,function(r){return ce(r)?t():e.of(r)})}}}function Tf(e){return function(t,n){return function(r){return e.map(r,GI(t,n))}}}function If(e){return function(t){return function(n){return e.map(n,RA(t))}}}function kA(e,t){return function(n){return function(r){return e.chain(r,ol(function(i){return e.map(n(),RA(function(o){return t.concat(i,o)}))},Hc(e)))}}}function OA(e){return function(t,n){return function(r){return e.map(r,ol(t,n))}}}function Ef(e){return function(t,n){return function(r){return e.chain(r,ol(t,n))}}}function Rf(e){return function(t){return function(n){return e.chain(n,ol(t,e.of))}}}function Gc(e){return function(t){return function(n){return e.chain(n,function(r){return ce(r)?t(r.left):e.of(r)})}}}function MA(e){var t=Gc(e);return function(n){return t(function(r){return e.map(n(r),function(i){return ce(i)?i:Dt(r)})})}}function FA(e){return function(t){return function(n){return e.chain(n,ol(function(r){return e.map(t(r),Dt)},function(r){return e.of(Je(r))}))}}}function $f(e){return function(t){return e.map(t,IK)}}function jA(e){return function(t){return e.map(t,kK)}}function Que(e){var t=xf(e),n=wf(e),r=Yc(e),i=_f(e),o=Tf(e),a=If(e),s=Ef(e),l=Rf(e),c=Gc(e);return{map:function(u,f){return _(u,n(f))},ap:function(u,f){return _(u,t(f))},of:Hc(e),chain:function(u,f){return _(u,r(f))},alt:function(u,f){return _(u,i(f))},bimap:function(u,f,p){return _(u,o(f,p))},mapLeft:function(u,f){return _(u,a(f))},fold:function(u,f,p){return _(u,s(f,p))},getOrElse:function(u,f){return _(u,l(f))},orElse:function(u,f){return _(u,c(f))},swap:$f(e),rightM:Cf(e),leftM:Sf(e),left:bf(e)}}const Hue=Object.freeze(Object.defineProperty({__proto__:null,alt:_f,altValidation:kA,ap:xf,bimap:Tf,chain:Yc,chainNullableK:rE,fromNullable:F0,fromNullableK:j0,getEitherM:Que,getOrElse:Rf,left:bf,leftF:Sf,map:wf,mapLeft:If,match:OA,matchE:Ef,orElse:Gc,orElseFirst:MA,orLeft:FA,right:Hc,rightF:Cf,swap:$f,toUnion:jA},Symbol.toStringTag,{value:"Module"}));var Yue="Endomorphism",UK=function(){return{concat:function(e,t){return X(e,t)}}},BK=function(){return{concat:UK().concat,empty:Q}};const Gue=Object.freeze(Object.defineProperty({__proto__:null,URI:Yue,getMonoid:BK,getSemigroup:UK},Symbol.toStringTag,{value:"Module"})),Jue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function PK(e,t){var n=t.zero,r=function(i,o){return e.equals(o,n)?i:r(o,t.mod(i,o))};return r}function Zue(e,t){var n=t.zero,r=PK(e,t);return function(i,o){return e.equals(i,n)||e.equals(o,n)?n:t.div(t.mul(i,o),r(i,o))}}var Xue={add:function(e,t){return e+t},zero:0,mul:function(e,t){return e*t},one:1,sub:function(e,t){return e-t},degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const ede=Object.freeze(Object.defineProperty({__proto__:null,fieldNumber:Xue,gcd:PK,lcm:Zue},Symbol.toStringTag,{value:"Module"}));function La(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filter(i,n)})}}}function Da(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filterMap(i,n)})}}}function al(e,t){var n=La(e,t);return function(r){var i=n(bh(r)),o=n(r);return function(a){return Be(i(a),o(a))}}}function sl(e,t){var n=Da(e,t);return function(r){return function(i){return Be(_(i,n(function(o){return w0(r(o))})),_(i,n(function(o){return bA(r(o))})))}}}function tde(e,t){var n=Vd(e,t).map,r=Ko(e,t),i=ja(e,t,t),o=La(e,t),a=Da(e,t),s=al(e,t),l=sl(e,t);return{map:n,compact:r,separate:i,filter:function(c,u){return _(c,o(u))},filterMap:function(c,u){return _(c,a(u))},partition:function(c,u){return _(c,s(u))},partitionMap:function(c,u){return _(c,l(u))}}}const nde=Object.freeze(Object.defineProperty({__proto__:null,filter:La,filterMap:Da,getFilterableComposition:tde,partition:al,partitionMap:sl},Symbol.toStringTag,{value:"Module"})),rde=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function WK(e,t){return function(n,r){return function(i){return e.reduce(i,n,function(o,a){return t.reduce(a,o,r)})}}}function NK(e,t){return function(n){var r=e.foldMap(n),i=t.foldMap(n);return function(o){return function(a){return r(a,function(s){return i(s,o)})}}}}function KK(e,t){return function(n,r){return function(i){return e.reduceRight(i,n,function(o,a){return t.reduceRight(o,a,r)})}}}function ide(e,t){return function(n,r){return function(i){return t.reduce(i,e.of(n),function(o,a){return e.chain(o,function(s){return r(s,a)})})}}}function ode(e,t){return function(n,r){var i=function(o,a){var s=o.init,l=o.acc;return s?{init:!1,acc:a}:{init:!1,acc:e.concat(e.concat(l,n),a)}};return t.reduce(r,{init:!0,acc:e.empty},i).acc}}function qK(e){return function(t){return e.reduce(t,[],function(n,r){return n.push(r),n})}}function ade(e,t){var n=function(i,o){return e.ap(e.map(i,Ur),o)},r=e.of(void 0);return function(i,o){return t.reduce(i,r,function(a,s){return n(a,o(s))})}}function sde(e,t){return function(n,r,i){return t.reduce(n,e.of(r),function(o,a){return e.chain(o,function(s){return i(s,a)})})}}var lde=qK;function iE(e,t){var n=WK(e,t),r=NK(e,t),i=KK(e,t);return{reduce:function(o,a,s){return _(o,n(a,s))},foldMap:function(o){var a=r(o);return function(s,l){return _(s,a(l))}},reduceRight:function(o,a,s){return _(o,i(a,s))}}}const cde=Object.freeze(Object.defineProperty({__proto__:null,foldM:sde,foldMap:NK,getFoldableComposition:iE,intercalate:ode,reduce:WK,reduceM:ide,reduceRight:KK,toArray:lde,toReadonlyArray:qK,traverse_:ade},Symbol.toStringTag,{value:"Module"}));function VK(e,t){return function(n,r){return function(i){return e.reduceWithIndex(i,n,function(o,a,s){return t.reduceWithIndex(s,a,function(l,c,u){return r([o,l],c,u)})})}}}function zK(e,t){return function(n){var r=e.foldMapWithIndex(n),i=t.foldMapWithIndex(n);return function(o){return function(a){return r(a,function(s,l){return i(l,function(c,u){return o([s,c],u)})})}}}}function QK(e,t){return function(n,r){return function(i){return e.reduceRightWithIndex(i,n,function(o,a,s){return t.reduceRightWithIndex(a,s,function(l,c,u){return r([o,l],c,u)})})}}}function ude(e,t){var n=iE(e,t),r=VK(e,t),i=zK(e,t),o=QK(e,t);return{reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(a,s,l){return _(a,r(s,l))},foldMapWithIndex:function(a){var s=i(a);return function(l,c){return _(l,s(c))}},reduceRightWithIndex:function(a,s,l){return _(a,o(s,l))}}}const dde=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:zK,getFoldableWithIndexComposition:ude,reduceRightWithIndex:QK,reduceWithIndex:VK},Symbol.toStringTag,{value:"Module"}));function Vo(e){return function(t){return X(t,e.fromIO)}}function Ua(e,t){return function(n){var r=X(n,e.fromIO);return function(i){return t.chain(i,r)}}}function Ba(e,t){var n=bt(t);return function(r){return n(X(r,e.fromIO))}}const fde=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:Ba,chainIOK:Ua,fromIOK:Vo},Symbol.toStringTag,{value:"Module"}));var HK=function(){return Q},pde=Q,LA=function(e){return function(t){return function(n){return t(e(n))}}},DA=function(e){return function(t){return e(t)(t)}},hde=DA,Pa=function(e,t){return _(e,Jc(t))},UA=function(e,t){return _(e,JK(t))},oE=function(e,t){return _(e,ZK(t))},YK=function(e,t){return _(e,e3(t))},L0=function(e,t,n){return _(e,t3(t,n))},Jc=function(e){return function(t){return function(n){return e(t(n))}}},GK=function(e){return function(t){return function(n){return t(n)(e(n))}}},JK=GK,zo=Ur,aE=function(e){return function(t){return function(n){return e(t(n))(n)}}},ZK=aE,XK=aE(Q),Ade=XK,e3=function(e){return function(t){return X(e,t)}},t3=function(e,t){return function(n){return function(r){return t(n(e(r)))}}},sE=function(){return Q},lE=function(e){return function(t){var n=t[0],r=t[1];return[e(n),r]}},cE=function(e){return function(t){var n=t[0],r=t[1];return[n,e(r)]}},uE=function(e){return eE(function(t){return Sa(e(t))},Je)},dE=function(e){return eE(Dt,function(t){return Hs(e(t))})},Fi="Reader",On={URI:Fi,map:Pa},mde=He(On),fE={URI:Fi,of:zo},Wa={URI:Fi,map:Pa,ap:UA},n3=qt(Wa),gde=n3,r3=Vt(Wa),vde=r3,i3={URI:Fi,map:Pa,ap:UA,of:zo},pE={URI:Fi,map:Pa,ap:UA,chain:oE},Na={URI:Fi,map:Pa,of:zo,ap:UA,chain:oE},o3=bt(pE),yde=o3,bde={URI:Fi,map:Pa,promap:L0},Cde={URI:Fi,compose:YK,id:sE},Sde={URI:Fi,map:Pa,promap:L0,first:lE,second:cE},wde={URI:Fi,map:Pa,promap:L0,left:uE,right:dE},xde=Qt(On),a3=Ht(pE),_de=a3,Tde=zo(vn),s3=zt(Wa),Ide=s3,l3=zo(Ln),Zc=function(e){return function(t){return function(n){for(var r=[e(0,ui(t))(n)],i=1;i<t.length;i++)r.push(e(i,t[i])(n));return r}}},hE=function(e){var t=Zc(e);return function(n){return Tt(n)?t(n):l3}},Ede=hE,c3=function(e){return hE(function(t,n){return e(n)})},Rde=c3(Q),$de={URI:Fi,map:Pa,of:zo,ap:UA,chain:oE,promap:L0,compose:YK,id:sE,first:lE,second:cE,left:uE,right:dE},kde=yn(Wa),Ode=$i(i3);const Mde=Object.freeze(Object.defineProperty({__proto__:null,ApT:l3,Applicative:i3,Apply:Wa,Category:Cde,Chain:pE,Choice:wde,Do:Tde,Functor:On,Monad:Na,Pointed:fE,Profunctor:bde,Strong:Sde,URI:Fi,ap:JK,apFirst:n3,apFirstW:gde,apS:s3,apSW:Ide,apSecond:r3,apSecondW:vde,apW:GK,ask:HK,asks:pde,asksReader:hde,asksReaderW:DA,bind:a3,bindTo:xde,bindW:_de,chain:ZK,chainFirst:o3,chainFirstW:yde,chainW:aE,compose:e3,first:lE,flap:mde,flatten:Ade,flattenW:XK,getMonoid:Ode,getSemigroup:kde,id:sE,left:uE,local:LA,map:Jc,of:zo,promap:t3,reader:$de,right:dE,second:cE,sequenceArray:Rde,traverseArray:c3,traverseArrayWithIndex:Ede,traverseReadonlyArrayWithIndex:hE,traverseReadonlyNonEmptyArrayWithIndex:Zc},Symbol.toStringTag,{value:"Module"}));function BA(e){return function(){return e.fromReader(HK())}}function PA(e){return e.fromReader}function Xc(e){return function(t){return X(t,e.fromReader)}}function WA(e,t){var n=Xc(e);return function(r){return function(i){return t.chain(i,n(r))}}}function NA(e,t){return X(Xc(e),bt(t))}const Fde=Object.freeze(Object.defineProperty({__proto__:null,ask:BA,asks:PA,chainFirstReaderK:NA,chainReaderK:WA,fromReaderK:Xc},Symbol.toStringTag,{value:"Module"}));var u3=function(){return function(e){return[e,e]}},d3=function(e){return function(){return[void 0,e]}},f3=function(e){return function(t){return[void 0,e(t)]}},p3=function(e){return function(t){return[e(t),t]}},KA=function(e,t){return _(e,A3(t))},D0=function(e,t){return _(e,m3(t))},h3=function(e,t){return _(e,AE(t))},A3=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return[e(i),o]}}},m3=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1],a=e(o),s=a[0],l=a[1];return[i(s),l]}}},qA=function(e){return function(t){return[e,t]}},AE=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return e(i)(o)}}},jde=AE(Q),ll="State",mE={URI:ll,map:KA},Lde=He(mE),Dde={URI:ll,of:qA},U0={URI:ll,map:KA,ap:D0},Ude=qt(U0),Bde=Vt(U0),Pde={URI:ll,map:KA,ap:D0,of:qA},gE={URI:ll,map:KA,ap:D0,chain:h3},g3={URI:ll,map:KA,ap:D0,of:qA,chain:h3},Wde=bt(gE),Nde={URI:ll,fromState:Q},Kde=function(e){return function(t){return t(e)[0]}},qde=function(e){return function(t){return t(e)[1]}},Vde=Qt(mE),zde=Ht(gE),Qde=zt(U0),v3=function(e){return function(t){return function(n){for(var r=e(0,ui(t))(n),i=r[0],o=r[1],a=[i],s=o,l=1;l<t.length;l++){var c=e(l,t[l])(s),u=c[0],f=c[1];a.push(u),s=f}return[a,s]}}},vE=function(e){var t=v3(e);return function(n){return Tt(n)?t(n):qA(Ln)}},Hde=vE,y3=function(e){return vE(function(t,n){return e(n)})},Yde=y3(Q),Gde=function(e,t){return e(t)[0]},Jde=function(e,t){return e(t)[1]},Zde=g3;const Xde=Object.freeze(Object.defineProperty({__proto__:null,Applicative:Pde,Apply:U0,Chain:gE,FromState:Nde,Functor:mE,Monad:g3,Pointed:Dde,URI:ll,ap:m3,apFirst:Ude,apS:Qde,apSecond:Bde,bind:zde,bindTo:Vde,chain:AE,chainFirst:Wde,evalState:Gde,evaluate:Kde,execState:Jde,execute:qde,flap:Lde,flatten:jde,get:u3,gets:p3,map:A3,modify:f3,of:qA,put:d3,sequenceArray:Yde,state:Zde,traverseArray:y3,traverseArrayWithIndex:Hde,traverseReadonlyArrayWithIndex:vE,traverseReadonlyNonEmptyArrayWithIndex:v3},Symbol.toStringTag,{value:"Module"}));function b3(e){return function(){return e.fromState(u3())}}function C3(e){return function(t){return e.fromState(d3(t))}}function S3(e){return X(f3,e.fromState)}function w3(e){return X(p3,e.fromState)}function yE(e){return function(t){return X(t,e.fromState)}}function x3(e,t){var n=yE(e);return function(r){return function(i){return t.chain(i,n(r))}}}const efe=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:x3,fromStateK:yE,get:b3,gets:w3,modify:S3,put:C3},Symbol.toStringTag,{value:"Module"}));function eu(e){return function(t){return X(t,e.fromTask)}}function kf(e,t){return function(n){var r=X(n,e.fromTask);return function(i){return t.chain(i,r)}}}function Of(e,t){var n=bt(t);return function(r){return n(X(r,e.fromTask))}}const tfe=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:Of,chainTaskK:kf,fromTaskK:eu},Symbol.toStringTag,{value:"Module"}));function _3(e){return function(t){return X(t,e.fromThese)}}const nfe=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:_3},Symbol.toStringTag,{value:"Module"}));function T3(e,t){return function(n){return function(r){return e.mapWithIndex(r,function(i,o){return t.mapWithIndex(o,function(a,s){return n([i,a],s)})})}}}function rfe(e,t){var n=Vd(e,t).map,r=T3(e,t);return{map:n,mapWithIndex:function(i,o){return _(i,r(o))}}}const ife=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:rfe,mapWithIndex:T3},Symbol.toStringTag,{value:"Module"})),ofe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),afe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),sfe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Qo=function(e,t){return _(e,k3(t))},Mf=function(e,t){return _(e,O3(t))},B0=function(e,t){return _(e,wE(t))},bE=function(e,t,n){return _(e,M3(t,n))},CE=function(e){return function(t,n){return _(t,F3()(n))}},SE=function(e,t,n){return _(e,j3(t,n))},I3=function(e,t){return _(e,U3())},E3=function(e,t){return _(e,xE(t))},R3=function(e){var t=L3(e);return function(n,r){return _(n,t(r))}},$3=II,k3=function(e){return function(t){return e(t)}},O3=function(e){return function(t){return t(e)}},Ff=Q,wE=function(e){return function(t){return e(t)}},xE=function(e){return function(t){return e(t)}},_E=Q,lfe=xE(Q),cfe=wE(Q),M3=function(e,t){return function(n){return t(e,n)}},F3=function(){return function(e){return function(t){return e(t)}}},j3=function(e,t){return function(n){return t(n,e)}},L3=function(e){return function(t){return function(n){return e.map(t(n),Q)}}},TE=function(e){return function(t){return e.map(t,Q)}},D3=function(){return Q},U3=D3,pi="Identity",ufe=Q,dfe=Q,IE={URI:pi,map:Qo},ffe=He(IE),pfe={URI:pi,of:Ff},P0={URI:pi,map:Qo,ap:Mf},hfe=qt(P0),Afe=Vt(P0),mfe={URI:pi,map:Qo,ap:Mf,of:Ff},EE={URI:pi,map:Qo,ap:Mf,chain:B0},gfe={URI:pi,map:Qo,ap:Mf,of:Ff,chain:B0},vfe=bt(EE),yfe={URI:pi,reduce:bE,foldMap:CE,reduceRight:SE},bfe={URI:pi,map:Qo,reduce:bE,foldMap:CE,reduceRight:SE,traverse:R3,sequence:TE},Cfe={URI:pi,map:Qo,alt:I3},Sfe={URI:pi,map:Qo,extend:E3,extract:_E},wfe={URI:pi,map:Qo,ap:Mf,chain:B0,chainRec:$3},xfe=Ff(vn),_fe=Qt(IE),Tfe=Ht(EE),Ife=zt(P0),Efe={URI:pi,map:Qo,ap:Mf,of:Ff,chain:B0,reduce:bE,foldMap:CE,reduceRight:SE,traverse:R3,sequence:TE,alt:I3,extract:_E,extend:E3,chainRec:$3};const Rfe=Object.freeze(Object.defineProperty({__proto__:null,Alt:Cfe,Applicative:mfe,Apply:P0,Chain:EE,ChainRec:wfe,Comonad:Sfe,Do:xfe,Foldable:yfe,Functor:IE,Monad:gfe,Pointed:pfe,Traversable:bfe,URI:pi,alt:U3,altW:D3,ap:O3,apFirst:hfe,apS:Ife,apSecond:Afe,bind:Tfe,bindTo:_fe,chain:wE,chainFirst:vfe,duplicate:lfe,extend:xE,extract:_E,flap:ffe,flatten:cfe,foldMap:F3,getEq:dfe,getShow:ufe,identity:Efe,map:k3,of:Ff,reduce:M3,reduceRight:j3,sequence:TE,traverse:L3},Symbol.toStringTag,{value:"Module"})),$fe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Ka=function(e,t){return function(){return t(e())}},cl=function(e,t){return function(){return e()(t())}},jf=function(e,t){return function(){return t(e())()}},B3=function(e,t){return function(){for(var n=t(e)();n._tag==="Left";)n=t(n.left)();return n.right}},Ho=function(e){return function(t){return Ka(t,e)}},kfe=function(e){return function(t){return cl(t,e)}},io=Ur,RE=function(e){return function(t){return jf(t,e)}},Ofe=RE(Q),oo="IO",At={URI:oo,map:Ka},Mfe=He(At),Yo={URI:oo,of:io},qa={URI:oo,map:Ka,ap:cl},Ffe=qt(qa),jfe=Vt(qa),P3={URI:oo,map:Ka,ap:cl,of:io},W0={URI:oo,map:Ka,ap:cl,chain:jf},Pr={URI:oo,map:Ka,ap:cl,of:io,chain:jf},Lfe=bt(W0),$E=Q,Dfe={URI:oo,map:Ka,ap:cl,of:io,chain:jf,fromIO:$E},Ufe={URI:oo,map:Ka,ap:cl,chain:jf,chainRec:B3},Bfe={URI:oo,fromIO:Q},Pfe=io(vn),Wfe=Qt(At),Nfe=Ht(W0),Kfe=zt(qa),W3=io(Ln),N0=function(e){return function(t){return function(){for(var n=[e(0,ui(t))()],r=1;r<t.length;r++)n.push(e(r,t[r])());return n}}},kE=function(e){var t=N0(e);return function(n){return Tt(n)?t(n):W3}},qfe=kE,N3=function(e){return kE(function(t,n){return e(n)})},Vfe=N3(Q),zfe={URI:oo,map:Ka,of:io,ap:cl,chain:jf,fromIO:$E,chainRec:B3},Qfe=yn(qa),Hfe=$i(P3);const Yfe=Object.freeze(Object.defineProperty({__proto__:null,ApT:W3,Applicative:P3,Apply:qa,Chain:W0,ChainRec:Ufe,Do:Pfe,FromIO:Bfe,Functor:At,Monad:Pr,MonadIO:Dfe,Pointed:Yo,URI:oo,ap:kfe,apFirst:Ffe,apS:Kfe,apSecond:jfe,bind:Nfe,bindTo:Wfe,chain:RE,chainFirst:Lfe,flap:Mfe,flatten:Ofe,fromIO:$E,getMonoid:Hfe,getSemigroup:Qfe,io:zfe,map:Ho,of:io,sequenceArray:Vfe,traverseArray:N3,traverseArrayWithIndex:qfe,traverseReadonlyArrayWithIndex:kE,traverseReadonlyNonEmptyArrayWithIndex:N0},Symbol.toStringTag,{value:"Module"}));var K3=bf(Yo),q3=Hc(Yo),V3=Cf(At),Gfe=Sf(At),z3=io,VA=V3,Q3=OA(At),Jfe=Q3,OE=Ef(Pr),Zfe=OE,H3=OE,Xfe=H3,Y3=Rf(Pr),epe=Y3,G3=function(e,t){return function(){return Qc(e,t)}},tpe=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return G3(function(){return e.apply(void 0,n)},t)}},npe=jA(At),J3=Gc(Pr),rpe=J3,ME=MA(Pr),ipe=ME,ope=function(e){return ME(l5(e))},ape=FA(Pr),spe=$f(At),Wr=function(e,t){return _(e,LE(t))},tu=function(e,t){return _(e,DE(t))},lpe=function(e,t){return _(e,K0(function(n){return _(t,LE(n))}))},Lf=function(e,t){return _(e,K0(t))},FE=function(e,t,n){return _(e,X3(t,n))},jE=function(e,t){return _(e,e5(t))},Z3=function(e,t){return _(e,UE(t))},LE=wf(At),X3=Tf(At),e5=If(At),DE=xf(qa),cpe=DE,ji=q3,K0=Yc(Pr),xv=K0,t5=xv(Q),upe=t5,UE=_f(Pr),dpe=UE,q0=K3,rn="IOEither";function n5(e){var t=Ea(qa,rl(e));return{URI:rn,_E:void 0,map:Wr,ap:function(n,r){return _(n,t(r))},of:ji}}function r5(e){var t=kA(Pr,e);return{URI:rn,_E:void 0,map:Wr,alt:function(n,r){return _(n,t(r))}}}var i5=function(e){var t=Vc(e);return{URI:rn,_E:void 0,compact:Ko(At,t),separate:ja(At,t,il)}};function fpe(e){var t=gf(e),n=i5(e),r=La(At,t),i=Da(At,t),o=al(At,t),a=sl(At,t);return{URI:rn,_E:void 0,map:Wr,compact:n.compact,separate:n.separate,filter:function(s,l){return _(s,r(l))},filterMap:function(s,l){return _(s,i(l))},partition:function(s,l){return _(s,o(l))},partitionMap:function(s,l){return _(s,a(l))}}}var BE={URI:rn,map:Wr},ppe=He(BE),hpe={URI:rn,of:ji},Ape={URI:rn,bimap:FE,mapLeft:jE},zA={URI:rn,map:Wr,ap:tu},o5=qt(zA),mpe=o5,a5=Vt(zA),gpe=a5,PE={URI:rn,map:Wr,ap:tu,of:ji},vpe={URI:rn,map:Wr,ap:lpe,of:ji},Va={URI:rn,map:Wr,ap:tu,chain:Lf},ype={URI:rn,map:Wr,ap:tu,of:ji,chain:Lf},s5=bt(Va),bpe=s5,Cpe={URI:rn,map:Wr,alt:Z3},Spe={URI:rn,map:Wr,ap:tu,of:ji,chain:Lf,fromIO:VA},wpe={URI:rn,map:Wr,ap:tu,of:ji,chain:Lf,throwError:q0},V0={URI:rn,fromIO:VA},l5=Vo(V0),xpe=Ua(V0,Va),_pe=Ba(V0,Va),za={URI:rn,fromEither:z3},Tpe=Bo(za),Ipe=Po(za),Epe=Fc(za,Va),c5=Ra(za,Va),Rpe=c5,u5=$a(za,Va),$pe=u5,kpe=Ys(za),d5=jc(za,Va),Ope=d5,Mpe=di(za),Fpe=function(e,t,n){return f5(e,t,n)},f5=function(e,t,n){return _(e,xv(function(r){return _(t(r),RE(function(i){return _(n(r,i),xv(function(){return io(i)}))}))}))},jpe=ji(vn),Lpe=Qt(BE),p5=Ht(Va),Dpe=p5,h5=zt(zA),Upe=h5,WE=ji(Ln),A5=function(e){return X(N0(e),Ho($A(Br)))},NE=function(e){var t=A5(e);return function(n){return Tt(n)?t(n):WE}},m5=function(e){return function(t){return function(){var n=e(0,ui(t))();if(An(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i])();if(An(o))return o;r.push(o.right)}return Hs(r)}}},KE=function(e){var t=m5(e);return function(n){return Tt(n)?t(n):WE}},Bpe=NE,g5=function(e){return NE(function(t,n){return e(n)})},Ppe=g5(Q),Wpe=KE,v5=function(e){return KE(function(t,n){return e(n)})},Npe=v5(Q),Kpe=PE,qpe={URI:rn,bimap:FE,mapLeft:jE,map:Wr,of:ji,ap:tu,chain:Lf,alt:Z3,fromIO:VA,throwError:q0},Vpe=yn(zA),zpe=$i(PE),Qpe=function(e){return yn(qa)(TA(e))};function Hpe(e){var t=n5(e),n=r5(e);return{URI:rn,_E:void 0,map:Wr,ap:t.ap,of:ji,chain:Lf,bimap:FE,mapLeft:jE,alt:n.alt,fromIO:VA,throwError:q0}}const Ype=Object.freeze(Object.defineProperty({__proto__:null,Alt:Cpe,ApT:WE,Applicative:Kpe,ApplicativePar:PE,ApplicativeSeq:vpe,ApplyPar:zA,Bifunctor:Ape,Chain:Va,Do:jpe,FromEither:za,FromIO:V0,Functor:BE,Monad:ype,MonadIO:Spe,MonadThrow:wpe,Pointed:hpe,URI:rn,alt:UE,altW:dpe,ap:DE,apFirst:o5,apFirstW:mpe,apS:h5,apSW:Upe,apSecond:a5,apSecondW:gpe,apW:cpe,bimap:X3,bind:p5,bindTo:Lpe,bindW:Dpe,bracket:Fpe,bracketW:f5,chain:K0,chainEitherK:c5,chainEitherKW:Rpe,chainFirst:s5,chainFirstEitherK:u5,chainFirstEitherKW:$pe,chainFirstIOK:_pe,chainFirstW:bpe,chainIOK:xpe,chainOptionK:Epe,chainW:xv,filterOrElse:d5,filterOrElseW:Ope,flap:ppe,flatten:upe,flattenW:t5,fold:Zfe,foldW:Xfe,fromEither:z3,fromEitherK:Mpe,fromIO:VA,fromIOK:l5,fromOption:Tpe,fromOptionK:Ipe,fromPredicate:kpe,getAltIOValidation:r5,getApplicativeIOValidation:n5,getApplyMonoid:zpe,getApplySemigroup:Vpe,getCompactable:i5,getFilterable:fpe,getIOValidation:Hpe,getOrElse:Y3,getOrElseW:epe,getSemigroup:Qpe,ioEither:qpe,left:K3,leftIO:Gfe,map:LE,mapLeft:e5,match:Q3,matchE:OE,matchEW:H3,matchW:Jfe,of:ji,orElse:J3,orElseFirst:ME,orElseFirstIOK:ope,orElseFirstW:ipe,orElseW:rpe,orLeft:ape,right:q3,rightIO:V3,sequenceArray:Ppe,sequenceSeqArray:Npe,swap:spe,throwError:q0,toUnion:npe,traverseArray:g5,traverseArrayWithIndex:Bpe,traverseReadonlyArrayWithIndex:NE,traverseReadonlyArrayWithIndexSeq:KE,traverseReadonlyNonEmptyArrayWithIndex:A5,traverseReadonlyNonEmptyArrayWithIndexSeq:m5,traverseSeqArray:v5,traverseSeqArrayWithIndex:Wpe,tryCatch:G3,tryCatchK:tpe},Symbol.toStringTag,{value:"Module"}));function QA(e){return X(Ft,e.of)}function HA(e){return Ur(e.of(ft))}function z0(e){return function(t){return e.map(t,Ft)}}function Q0(e){return X(Nc,e.of)}function H0(e){var t=Q0(e);return function(n){return X(n,t)}}function qE(e){var t=Df(e),n=H0(e);return function(r){return t(n(r))}}function Y0(e){return function(t){return X(t,e.of)}}function VE(e){var t=Df(e),n=Y0(e);return function(r){return t(n(r))}}function zE(e){return function(t){return function(n){return e.of(S0(t)(n))}}}function QE(e){return X(hf,e.of)}function HE(e){return function(t,n){return function(r){return e.map(r,Fa(t,n))}}}function G0(e){return function(t,n){return function(r){return e.chain(r,Fa(t,n))}}}function J0(e){return function(t){return function(n){return e.chain(n,Fa(t,e.of))}}}function Z0(e){return qd(e,uf)}function X0(e){return Ea(e,df)}function Df(e){var t=HA(e);return function(n){return function(r){return e.chain(r,Fa(function(){return t()},n))}}}function eb(e){var t=QA(e);return function(n){return function(r){return e.chain(r,Fa(n,t))}}}function Gpe(e){var t=X0(e),n=Z0(e),r=Df(e),i=eb(e),o=G0(e),a=J0(e),s=HA(e);return{map:function(l,c){return _(l,n(c))},ap:function(l,c){return _(l,t(c))},of:QA(e),chain:function(l,c){return _(l,r(c))},alt:function(l,c){return _(l,i(c))},fold:function(l,c,u){return _(l,o(c,u))},getOrElse:function(l,c){return _(l,a(c))},fromM:z0(e),none:function(){return s()}}}const Jpe=Object.freeze(Object.defineProperty({__proto__:null,alt:eb,ap:X0,chain:Df,chainNullableK:qE,chainOptionK:VE,fromEither:QE,fromF:z0,fromNullable:Q0,fromNullableK:H0,fromOptionK:Y0,fromPredicate:zE,getOptionM:Gpe,getOrElse:J0,map:Z0,match:HE,matchE:G0,some:QA,zero:HA},Symbol.toStringTag,{value:"Module"}));var y5=QA(Yo),Zpe=zE(Yo),Xpe=io,b5=QE(Yo),YE=z0(At),ehe=Ho(hf),C5=HE(At),the=C5,GE=G0(W0),nhe=GE,rhe=GE,S5=J0(Pr),ihe=S5,ohe=Ho(zN),ahe=Ho(NI),she=Q0(Yo),lhe=H0(Yo),che=qE(Pr),uhe=Y0(Yo),dhe=VE(Pr),w5=Z0(At),x5=X0(qa),ul=y5,JE=Df(Pr),fhe=JE(Q),ZE=eb(Pr),phe=ZE,tb=HA(Yo),hhe=tb(),XE=Ko(At,Wc),eR=ja(At,Wc,uf),_5=La(At,Ma),T5=Da(At,Ma),I5=al(At,Ma),E5=sl(At,Ma),Qa=function(e,t){return _(e,w5(t))},Uf=function(e,t){return _(e,x5(t))},tR=function(e,t){return _(e,JE(t))},R5=function(e,t){return _(e,ZE(t))},Ahe=function(e,t){return _(e,_5(t))},mhe=function(e,t){return _(e,T5(t))},ghe=function(e,t){return _(e,I5(t))},vhe=function(e,t){return _(e,E5(t))},Nr="IOOption",nR={URI:Nr,map:Qa},yhe=He(nR),$5={URI:Nr,of:ul},nb={URI:Nr,map:Qa,ap:Uf},bhe=qt(nb),Che=Vt(nb),She={URI:Nr,map:Qa,ap:Uf,of:ul},nu={URI:Nr,map:Qa,ap:Uf,chain:tR},whe=bt(nu),xhe={URI:Nr,map:Qa,alt:R5},k5={URI:Nr,zero:tb},_he=Jd(k5,$5),The={URI:Nr,map:Qa,ap:Uf,of:ul,alt:R5,zero:tb},Ihe={URI:Nr,map:Qa,ap:Uf,of:ul,chain:tR},Ehe={URI:Nr,map:Qa,ap:Uf,of:ul,chain:tR,fromIO:YE},Rhe={URI:Nr,compact:XE,separate:eR},$he={URI:Nr,map:Qa,compact:XE,separate:eR,filter:Ahe,filterMap:mhe,partition:ghe,partitionMap:vhe},rb={URI:Nr,fromIO:YE},khe=Vo(rb),Ohe=Ua(rb,nu),Mhe=Ba(rb,nu),ib={URI:Nr,fromEither:b5},Fhe=di(ib),jhe=Ra(ib,nu),Lhe=$a(ib,nu),Dhe=ul(vn),Uhe=Qt(nR),Bhe=Ht(nu),Phe=zt(nb),O5=ul(Ln),M5=function(e){return X(N0(e),Ho(k0(Br)))},Whe=function(e){var t=M5(e);return function(n){return Tt(n)?t(n):O5}};const Nhe=Object.freeze(Object.defineProperty({__proto__:null,Alt:xhe,Alternative:The,ApT:O5,Applicative:She,Apply:nb,Chain:nu,Compactable:Rhe,Do:Dhe,Filterable:$he,FromEither:ib,FromIO:rb,Functor:nR,Monad:Ihe,MonadIO:Ehe,Pointed:$5,Zero:k5,alt:ZE,altW:phe,ap:x5,apFirst:bhe,apS:Phe,apSecond:Che,bind:Bhe,bindTo:Uhe,chain:JE,chainEitherK:jhe,chainFirst:whe,chainFirstEitherK:Lhe,chainFirstIOK:Mhe,chainIOK:Ohe,chainNullableK:che,chainOptionK:dhe,compact:XE,filter:_5,filterMap:T5,flap:yhe,flatten:fhe,fold:nhe,fromEither:b5,fromEitherK:Fhe,fromIO:YE,fromIOEither:ehe,fromIOK:khe,fromNullable:she,fromNullableK:lhe,fromOption:Xpe,fromOptionK:uhe,fromPredicate:Zpe,getOrElse:S5,getOrElseW:ihe,guard:_he,map:w5,match:C5,matchE:GE,matchEW:rhe,matchW:the,none:hhe,of:ul,partition:I5,partitionMap:E5,separate:eR,some:y5,toNullable:ahe,toUndefined:ohe,traverseReadonlyArrayWithIndex:Whe,traverseReadonlyNonEmptyArrayWithIndex:M5,zero:tb},Symbol.toStringTag,{value:"Module"}));var F5=function(){function e(t){var n=this;this.value=t,this.read=function(){return n.value},this.write=this.write.bind(this),this.modify=this.modify.bind(this)}return e.prototype.write=function(t){var n=this;return function(){n.value=t}},e.prototype.modify=function(t){var n=this;return function(){n.value=t(n.value)}},e}();function Khe(e){return function(){return new F5(e)}}const qhe=Object.freeze(Object.defineProperty({__proto__:null,IORef:F5,newIORef:Khe},Symbol.toStringTag,{value:"Module"})),Vhe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var zhe=function(e){return Qc(function(){return JSON.parse(e)},Q)},Qhe=function(e){return Qc(function(){var t=JSON.stringify(e);if(typeof t!="string")throw new Error("Converting unsupported structure to JSON");return t},Q)};const Hhe=Object.freeze(Object.defineProperty({__proto__:null,parse:zhe,stringify:Qhe},Symbol.toStringTag,{value:"Module"})),Yhe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Ghe=function(e){return new Map(e)};function Jhe(e){return new Map(e)}function j5(e,t){return{show:function(n){var r=[];return n.forEach(function(i,o){r.push("[".concat(e.show(o),", ").concat(t.show(i),"]"))}),"new Map([".concat(r.sort().join(", "),"])")}}}var L5=function(e){return e.size},jo=function(e){return e.size===0};function ob(e){var t=ru(e);return function(n,r){if(r===void 0){var i=ob(e);return function(o){return i(n,o)}}return Mt(t(n,r))}}function rR(e){return function(t,n){if(n===void 0){var r=rR(e);return function(s){return r(t,s)}}for(var i=n.values(),o;!(o=i.next()).done;){var a=o.value;if(e.equals(t,a))return!0}return!1}}var Bf=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},Zhe=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function D5(e){var t=Bf(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,s=o;a<s.length;a++){var l=s[a];i.push(n(l,r.get(l)))}return i}}}var U5=function(e){return D5(e)(function(t,n){return[t,n]})};function Xhe(e,t){var n=U5(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?ye([i[a],a+1]):Re})}}var B5=function(e){var t=Ha(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(tn(a)){var s=new Map(o);return s.set(n,r),s}else if(a.value[1]!==r){var s=new Map(o);return s.set(a.value[0],r),s}return o}}},P5=function(e){var t=Ha(e);return function(n){return function(r){var i=t(n,r);if(Mt(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},eAe=function(e){var t=W5(e);return function(n,r){return t(n,function(){return r})}},W5=function(e){var t=Ha(e);return function(n,r){return function(i){var o=t(n,i);if(tn(o))return Re;var a=o.value,s=a[0],l=a[1],c=r(l);if(c===l)return ye(i);var u=new Map(i);return u.set(s,c),ye(u)}}};function tAe(e){var t=ru(e),n=P5(e);return function(r){var i=n(r);return function(o){return _(t(r,o),No(function(a){return[a,i(o)]}))}}}function Ha(e){return function(t,n){if(n===void 0){var r=Ha(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,s=a[0],l=a[1];if(e.equals(s,t))return ye([s,l])}return Re}}function ru(e){var t=Ha(e);return function(n,r){if(r===void 0){var i=ru(e);return function(o){return i(n,o)}}return _(t(n,r),No(function(o){o[0];var a=o[1];return a}))}}function ab(e,t){var n=Ha(e);return function(r,i){if(i===void 0){var o=ab(e,t);return function(p){return o(p,r)}}for(var a=r.entries(),s;!(s=a.next()).done;){var l=s.value,c=l[0],u=l[1],f=n(c,i);if(tn(f)||!e.equals(c,f.value[0])||!t.equals(u,f.value[1]))return!1}return!0}}var sb=new Map;function N5(e,t){var n=ab(e,t);return ki(function(r,i){return n(r,i)&&n(i,r)})}function nAe(e,t){var n=Ha(e);return{concat:function(r,i){if(jo(r))return i;if(jo(i))return r;for(var o=new Map(r),a=i.entries(),s;!(s=a.next()).done;){var l=s.value,c=l[0],u=l[1],f=n(c,r);Mt(f)?o.set(f.value[0],t.concat(f.value[1],u)):o.set(c,u)}return o},empty:sb}}var rAe=function(e,t){return new Map([[e,t]])};function iAe(e,t,n){return function(r){var i=Ha(e);return n.reduce(r,new Map,function(o,a){var s=a[0],l=a[1],c=i(s,o);return Mt(c)?o.set(c.value[0],t.concat(c.value[1],l)):o.set(s,l),o})}}var Pf=function(e,t){for(var n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],s=o[1];n.set(a,t(a,s))}return n},K5=function(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,s=a[0],l=a[1],c=e(s,l);An(c)?n.set(s,c.left):r.set(s,c.right)}return Be(n,r)}};function q5(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,s=a[0],l=a[1];e(s,l)?r.set(s,l):n.set(s,l)}return Be(n,r)}}var V5=function(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],s=o[1],l=e(a,s);Mt(l)&&n.set(a,l.value)}return n}};function z5(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],s=o[1];e(a,s)&&n.set(a,s)}return n}}var Ya=function(e,t){return Pf(e,function(n,r){return t(r)})},YA=function(e,t){return Q5(e,function(n,r){return t(r)})},GA=function(e,t){return H5(e,function(n,r){return t(r)})},JA=function(e,t){return Y5(e,function(n,r){return t(r)})},ZA=function(e,t){return G5(e,function(n,r){return t(r)})},Q5=function(e,t){return _(e,z5(t))},H5=function(e,t){return _(e,V5(t))},Y5=function(e,t){return _(e,q5(t))},G5=function(e,t){return _(e,K5(t))},Wf=function(e){for(var t=new Map,n=e.entries(),r;!(r=n.next()).done;){var i=r.value,o=i[0],a=i[1];Mt(a)&&t.set(o,a.value)}return t},oAe=function(e){return function(t){return YA(t,e)}},aAe=function(e){return function(t){return GA(t,e)}},sAe=function(e){return function(t){return Ya(t,e)}},lAe=function(e){return function(t){return Pf(t,e)}},cAe=function(e){return function(t){return JA(t,e)}},uAe=function(e){return function(t){return ZA(t,e)}},Nf=function(e){for(var t=new Map,n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],s=o[1];An(s)?t.set(a,s.left):n.set(a,s.right)}return Be(t,n)},Li="ReadonlyMap",J5=function(e,t){var n=cR(e,t);return{concat:function(r,i){return n(i)(r)}}},dAe=function(e,t){return{concat:J5(e,t).concat,empty:sb}},fAe=function(e,t){var n=uR(e,t);return{concat:function(r,i){return n(i)(r)}}},pAe=function(e){return function(){var t=dR(e);return{concat:function(n,r){return t(r)(n)}}}};function hAe(){return{URI:Li,_E:void 0,map:Ya,mapWithIndex:Pf,compact:Wf,separate:Nf,filter:YA,filterMap:GA,partition:JA,partitionMap:ZA,partitionMapWithIndex:G5,partitionWithIndex:Y5,filterMapWithIndex:H5,filterWithIndex:Q5}}var Z5={URI:Li,map:Ya},AAe=He(Z5),mAe=function(){return{URI:Li,_E:void 0,map:Ya,mapWithIndex:Pf}},Bw={URI:Li,compact:Wf,separate:Nf},gAe={URI:Li,map:Ya,compact:Wf,separate:Nf,filter:YA,filterMap:GA,partition:JA,partitionMap:ZA},iR=function(e){var t=cb(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},oR=function(e){var t=ub(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}},aR=function(e){var t=db(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},lb=function(e){var t=iR(e),n=oR(e),r=aR(e);return{URI:Li,_E:void 0,reduce:function(i,o,a){return _(i,t(o,a))},foldMap:function(i){var o=n(i);return function(a,s){return _(a,o(s))}},reduceRight:function(i,o,a){return _(i,r(o,a))}}},cb=function(e){var t=Bf(e);return function(n,r){return function(i){for(var o=n,a=0,s=t(i);a<s.length;a++){var l=s[a];o=r(l,o,i.get(l))}return o}}},ub=function(e){var t=Bf(e);return function(n){return function(r){return function(i){for(var o=n.empty,a=0,s=t(i);a<s.length;a++){var l=s[a];o=n.concat(o,r(l,i.get(l)))}return o}}}},db=function(e){var t=Bf(e);return function(n,r){return function(i){for(var o=n,a=t(i),s=a.length,l=s-1;l>=0;l--){var c=a[l];o=r(c,i.get(c),o)}return o}}},sR=function(e){var t=lb(e),n=cb(e),r=ub(e),i=db(e);return{URI:Li,_E:void 0,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:function(o,a,s){return _(o,n(a,s))},foldMapWithIndex:function(o){var a=r(o);return function(s,l){return _(s,a(l))}},reduceRightWithIndex:function(o,a,s){return _(o,i(a,s))}}},vAe=function(e){var t=lR(e),n=lb(e);return{URI:Li,_E:void 0,map:Ya,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:t.traverse,sequence:t.sequence}},lR=function(e){var t=sR(e),n=Bf(e),r=function(a){return function(s,l){for(var c=a.of(new Map),u=n(s),f=u.length,p=function(m){var g=u[m],y=s.get(g);c=a.ap(a.map(c,function(C){return function(x){return C.set(g,x)}}),l(g,y))},h=0;h<f;h++)p(h);return c}},i=function(a){var s=r(a);return function(l,c){return s(l,function(u,f){return c(f)})}},o=function(a){var s=r(a);return function(l){return s(l,Br)}};return{URI:Li,_E:void 0,map:Ya,mapWithIndex:Pf,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}};function yAe(e){var t=lR(e);return{URI:Li,_E:void 0,map:Ya,compact:Wf,separate:Nf,filter:YA,filterMap:GA,partition:JA,partitionMap:ZA,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:Pf,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:no(t,Bw),wither:ro(t,Bw)}}var cR=function(e,t){var n=ru(e);return function(r){return function(i){if(jo(i))return r;if(jo(r))return i;for(var o=new Map,a=i.entries(),s;!(s=a.next()).done;){var l=s.value,c=l[0],u=l[1],f=n(c)(r);Mt(f)?o.set(c,t.concat(u,f.value)):o.set(c,u)}for(var p=r.entries();!(s=p.next()).done;){var h=s.value,c=h[0],u=h[1],f=n(c)(o);tn(f)&&o.set(c,u)}return o}}},uR=function(e,t){var n=ru(e);return function(r){return function(i){if(jo(i)||jo(r))return sb;for(var o=new Map,a=i.entries(),s;!(s=a.next()).done;){var l=s.value,c=l[0],u=l[1],f=n(c)(r);Mt(f)&&o.set(c,t.concat(u,f.value))}return o}}},dR=function(e){var t=ob(e);return function(n){return function(r){if(jo(r))return n;if(jo(n))return r;for(var i=new Map,o=r.entries(),a;!(a=o.next()).done;){var s=a.value,l=s[0],c=s[1];t(l)(n)||i.set(l,c)}for(var u=n.entries();!(a=u.next()).done;){var f=a.value,l=f[0],c=f[1];t(l)(r)||i.set(l,c)}return i}}},bAe=B5,CAe={URI:Li,map:Ya,compact:Wf,separate:Nf,filter:YA,filterMap:GA,partition:JA,partitionMap:ZA};const SAe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Bw,Filterable:gAe,Functor:Z5,URI:Li,collect:D5,compact:Wf,deleteAt:P5,difference:dR,elem:rR,empty:sb,filter:oAe,filterMap:aAe,filterMapWithIndex:V5,filterWithIndex:z5,flap:AAe,foldMap:oR,foldMapWithIndex:ub,fromFoldable:iAe,fromMap:Ghe,getDifferenceMagma:pAe,getEq:N5,getFilterableWithIndex:hAe,getFoldable:lb,getFoldableWithIndex:sR,getFunctorWithIndex:mAe,getIntersectionSemigroup:fAe,getMonoid:nAe,getShow:j5,getTraversable:vAe,getTraversableWithIndex:lR,getUnionMonoid:dAe,getUnionSemigroup:J5,getWitherable:yAe,insertAt:bAe,intersection:uR,isEmpty:jo,isSubmap:ab,keys:Bf,lookup:ru,lookupWithKey:Ha,map:sAe,mapWithIndex:lAe,member:ob,modifyAt:W5,partition:cAe,partitionMap:uAe,partitionMapWithIndex:K5,partitionWithIndex:q5,pop:tAe,readonlyMap:CAe,reduce:iR,reduceRight:aR,reduceRightWithIndex:db,reduceWithIndex:cb,separate:Nf,singleton:rAe,size:L5,toMap:Jhe,toReadonlyArray:U5,toUnfoldable:Xhe,union:cR,updateAt:eAe,upsertAt:B5,values:Zhe},Symbol.toStringTag,{value:"Module"}));var gd=function(){return gd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},gd.apply(this,arguments)},wAe=j5,xAe=L5,wa=jo,_Ae=ob,TAe=rR,fR=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},IAe=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function X5(e){var t=fR(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,s=o;a<s.length;a++){var l=s[a];i.push(n(l,r.get(l)))}return i}}}function e6(e){return X5(e)(function(t,n){return[t,n]})}function EAe(e,t){var n=e6(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?ye([i[a],a+1]):Re})}}var t6=function(e){var t=iu(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(tn(a)){var s=new Map(o);return s.set(n,r),s}else if(a.value[1]!==r){var s=new Map(o);return s.set(a.value[0],r),s}return o}}},n6=function(e){var t=iu(e);return function(n){return function(r){var i=t(n,r);if(Mt(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},RAe=function(e){var t=r6(e);return function(n,r){return t(n,function(){return r})}},r6=function(e){var t=iu(e);return function(n,r){return function(i){var o=t(n,i);if(tn(o))return Re;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),ye(a)}}};function $Ae(e){var t=i6(e),n=n6(e);return function(r){var i=n(r);return function(o){return _(t(r,o),No(function(a){return[a,i(o)]}))}}}function iu(e){return function(t,n){if(n===void 0){var r=iu(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,s=a[0],l=a[1];if(e.equals(s,t))return ye([s,l])}return Re}}var i6=ru,kAe=ab,OAe=N5;function MAe(e,t){var n=iu(e);return{concat:function(r,i){if(wa(r))return i;if(wa(i))return r;for(var o=new Map(r),a=i.entries(),s;!(s=a.next()).done;){var l=s.value,c=l[0],u=l[1],f=n(c,r);Mt(f)?o.set(f.value[0],t.concat(f.value[1],u)):o.set(c,u)}return o},empty:new Map}}var FAe=function(e,t){return new Map([[e,t]])};function jAe(e,t,n){return function(r){var i=iu(e);return n.reduce(r,new Map,function(o,a){var s=a[0],l=a[1],c=i(s,o);return Mt(c)?o.set(c.value[0],t.concat(c.value[1],l)):o.set(s,l),o})}}var XA=function(e,t){for(var n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],s=o[1];n.set(a,t(a,s))}return n},o6=function(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,s=a[0],l=a[1],c=e(s,l);An(c)?n.set(s,c.left):r.set(s,c.right)}return Be(n,r)}};function a6(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,s=a[0],l=a[1];e(s,l)?r.set(s,l):n.set(s,l)}return Be(n,r)}}var s6=function(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],s=o[1],l=e(a,s);Mt(l)&&n.set(a,l.value)}return n}};function l6(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],s=o[1];e(a,s)&&n.set(a,s)}return n}}var Kf=function(e,t){return XA(e,function(n,r){return t(r)})},fb=function(e,t){return c6(e,function(n,r){return t(r)})},pb=function(e,t){return u6(e,function(n,r){return t(r)})},hb=function(e,t){return d6(e,function(n,r){return t(r)})},Ab=function(e,t){return f6(e,function(n,r){return t(r)})},c6=function(e,t){return _(e,l6(t))},u6=function(e,t){return _(e,s6(t))},d6=function(e,t){return _(e,a6(t))},f6=function(e,t){return _(e,o6(t))},em=function(e){for(var t=new Map,n=e.entries(),r;!(r=n.next()).done;){var i=r.value,o=i[0],a=i[1];Mt(a)&&t.set(o,a.value)}return t},LAe=function(e){return function(t){return fb(t,e)}},DAe=function(e){return function(t){return pb(t,e)}},UAe=function(e){return function(t){return Kf(t,e)}},BAe=function(e){return function(t){return XA(t,e)}},PAe=function(e){return function(t){return hb(t,e)}},WAe=function(e){return function(t){return Ab(t,e)}},tm=function(e){for(var t=new Map,n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],s=o[1];An(s)?t.set(a,s.left):n.set(a,s.right)}return Be(t,n)},Ga="Map",p6=function(e,t){var n=v6(e,t);return{concat:function(r,i){return n(i)(r)}}},NAe=function(e,t){return{concat:p6(e,t).concat,empty:new Map}},KAe=function(e,t){var n=y6(e,t);return{concat:function(r,i){return n(i)(r)}}},qAe=function(e){return function(){var t=b6(e);return{concat:function(n,r){return t(r)(n)}}}};function VAe(){return{URI:Ga,_E:void 0,map:Kf,mapWithIndex:XA,compact:em,separate:tm,filter:fb,filterMap:pb,partition:hb,partitionMap:Ab,partitionMapWithIndex:f6,partitionWithIndex:d6,filterMapWithIndex:u6,filterWithIndex:c6}}function zAe(e){var t=A6(e);return{URI:Ga,_E:void 0,map:Kf,compact:em,separate:tm,filter:fb,filterMap:pb,partition:hb,partitionMap:Ab,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:XA,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:no(t,Pw),wither:ro(t,Pw)}}var QAe=iR,HAe=oR,YAe=aR,GAe=function(e){return gd(gd({},lb(e)),{URI:Ga})},JAe=cb,ZAe=ub,XAe=db,h6=function(e){return gd(gd({},sR(e)),{URI:Ga})},A6=function(e){var t=h6(e),n=fR(e),r=function(a){return function(s,l){for(var c=a.of(new Map),u=n(s),f=u.length,p=function(m){var g=u[m],y=s.get(g);c=a.ap(a.map(c,function(C){return function(x){return C.set(g,x)}}),l(g,y))},h=0;h<f;h++)p(h);return c}},i=function(a){var s=r(a);return function(l,c){return s(l,function(u,f){return c(f)})}},o=function(a){var s=r(a);return function(l){return s(l,function(c,u){return u})}};return{URI:Ga,_E:void 0,map:Kf,mapWithIndex:XA,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}},m6={URI:Ga,map:Kf},eme=He(m6),Pw={URI:Ga,compact:em,separate:tm},g6={URI:Ga,map:Kf,compact:em,separate:tm,filter:fb,filterMap:pb,partition:hb,partitionMap:Ab},_v=function(e){return new Map(e)},v6=function(e,t){var n=cR(e,t);return function(r){return function(i){return wa(i)?_v(r):wa(r)?_v(i):n(r)(i)}}},y6=function(e,t){var n=uR(e,t);return function(r){return function(i){return wa(i)||wa(r)?new Map:n(r)(i)}}},b6=function(e){var t=dR(e);return function(n){return function(r){return wa(r)?_v(n):wa(n)?_v(r):t(n)(r)}}},tme=new Map,nme=t6,rme=g6;const ime=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Pw,Filterable:g6,Functor:m6,URI:Ga,collect:X5,compact:em,deleteAt:n6,difference:b6,elem:TAe,empty:tme,filter:LAe,filterMap:DAe,filterMapWithIndex:s6,filterWithIndex:l6,flap:eme,foldMap:HAe,foldMapWithIndex:ZAe,fromFoldable:jAe,getDifferenceMagma:qAe,getEq:OAe,getFilterableWithIndex:VAe,getFoldable:GAe,getFoldableWithIndex:h6,getIntersectionSemigroup:KAe,getMonoid:MAe,getShow:wAe,getTraversableWithIndex:A6,getUnionMonoid:NAe,getUnionSemigroup:p6,getWitherable:zAe,insertAt:nme,intersection:y6,isEmpty:wa,isSubmap:kAe,keys:fR,lookup:i6,lookupWithKey:iu,map:UAe,mapWithIndex:BAe,map_:rme,member:_Ae,modifyAt:r6,partition:PAe,partitionMap:WAe,partitionMapWithIndex:o6,partitionWithIndex:a6,pop:$Ae,reduce:QAe,reduceRight:YAe,reduceRightWithIndex:XAe,reduceWithIndex:JAe,separate:tm,singleton:FAe,size:xAe,toArray:e6,toUnfoldable:EAe,union:v6,updateAt:RAe,upsertAt:t6,values:IAe},Symbol.toStringTag,{value:"Module"})),ome=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),ame=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),sme=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),lme=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),cme=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var C6=function(e){return{concat:_y(e).concat,empty:e.top}},S6=function(e){return{concat:Ty(e).concat,empty:e.bottom}},pR=function(e){return{concat:__(e).concat,empty:e.empty}},w6=function(e){var t={};for(var n in e)yt.call(e,n)&&(t[n]=e[n].empty);return{concat:T_(e).concat,empty:t}},x6=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:I_.apply(pB,e).concat,empty:e.map(function(n){return n.empty})}},_6=function(e){return R_(e)(e.empty)},ume={concat:sB.concat,empty:void 0},dme=x6,fme=w6,pme=pR,hme=S6,Ame=C6,mme=_6,T6={concat:lB.concat,empty:!0},I6={concat:cB.concat,empty:!1},gme=LU,vme=function(){return pR(BK())},yme={concat:uB.concat,empty:""},bme={concat:dB.concat,empty:0},Cme={concat:fB.concat,empty:1};const Sme=Object.freeze(Object.defineProperty({__proto__:null,concatAll:_6,fold:mme,getDualMonoid:pme,getEndomorphismMonoid:vme,getFunctionMonoid:gme,getJoinMonoid:hme,getMeetMonoid:Ame,getStructMonoid:fme,getTupleMonoid:dme,max:S6,min:C6,monoidAll:T6,monoidAny:I6,monoidProduct:Cme,monoidString:yme,monoidSum:bme,monoidVoid:ume,reverse:pR,struct:w6,tuple:x6},Symbol.toStringTag,{value:"Module"})),wme=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var E6=function(e,t,n){return function(r){return r===-1?e():r===0?t():n()}},xme=E6,R6=function(e){return e===-1?1:e===1?-1:0},$6={equals:function(e,t){return e===t}},hR={concat:function(e,t){return e!==0?e:t}},k6={concat:hR.concat,empty:0},_me=function(e){return e<=-1?-1:e>=1?1:0},Tme=R6,Ime=hR,Eme=$6,Rme=k6;const $me=Object.freeze(Object.defineProperty({__proto__:null,Eq:$6,Monoid:k6,Semigroup:hR,eqOrdering:Eme,invert:Tme,match:xme,matchW:E6,monoidOrdering:Rme,reverse:R6,semigroupOrdering:Ime,sign:_me},Symbol.toStringTag,{value:"Module"}));var kme=function(e){return typeof e.map=="function"},Ome=function(e){return typeof e.contramap=="function"},Mme=function(e){return typeof e.mapWithIndex=="function"},Fme=function(e){return typeof e.ap=="function"},jme=function(e){return typeof e.chain=="function"},Lme=function(e){return typeof e.bimap=="function"},Dme=function(e){return typeof e.extend=="function"},Ume=function(e){return typeof e.reduce=="function"},Bme=function(e){return typeof e.reduceWithIndex=="function"},Pme=function(e){return typeof e.alt=="function"},Wme=function(e){return typeof e.compact=="function"},Nme=function(e){return typeof e.filter=="function"},Kme=function(e){return typeof e.filterWithIndex=="function"},qme=function(e){return typeof e.promap=="function"},Vme=function(e){return typeof e.compose=="function"},zme=function(e){return typeof e.throwError=="function"};function Qme(e){var t={};if(kme(e)){var n=function(F){return function(M){return e.map(M,F)}};t.map=n}if(Ome(e)){var r=function(F){return function(M){return e.contramap(M,F)}};t.contramap=r}if(Mme(e)){var i=function(F){return function(M){return e.mapWithIndex(M,F)}};t.mapWithIndex=i}if(Fme(e)){var o=function(F){return function(M){return e.ap(M,F)}},a=function(F){return function(M){return e.ap(e.map(M,function(W){return function(){return W}}),F)}};t.ap=o,t.apFirst=a,t.apSecond=function(F){return function(M){return e.ap(e.map(M,function(){return function(W){return W}}),F)}}}if(jme(e)){var s=function(F){return function(M){return e.chain(M,F)}},l=function(F){return function(M){return e.chain(M,function(W){return e.map(F(W),function(){return W})})}},c=function(F){return e.chain(F,Q)};t.chain=s,t.chainFirst=l,t.flatten=c}if(Lme(e)){var u=function(F,M){return function(W){return e.bimap(W,F,M)}},f=function(F){return function(M){return e.mapLeft(M,F)}};t.bimap=u,t.mapLeft=f}if(Dme(e)){var p=function(F){return function(M){return e.extend(M,F)}},h=function(F){return e.extend(F,Q)};t.extend=p,t.duplicate=h}if(Ume(e)){var m=function(F,M){return function(W){return e.reduce(W,F,M)}},g=function(F){var M=e.foldMap(F);return function(W){return function(re){return M(re,W)}}},y=function(F,M){return function(W){return e.reduceRight(W,F,M)}};t.reduce=m,t.foldMap=g,t.reduceRight=y}if(Bme(e)){var C=function(F,M){return function(W){return e.reduceWithIndex(W,F,M)}},x=function(F){var M=e.foldMapWithIndex(F);return function(W){return function(re){return M(re,W)}}},b=function(F,M){return function(W){return e.reduceRightWithIndex(W,F,M)}};t.reduceWithIndex=C,t.foldMapWithIndex=x,t.reduceRightWithIndex=b}if(Pme(e)){var v=function(F){return function(M){return e.alt(M,F)}};t.alt=v}if(Wme(e)&&(t.compact=e.compact,t.separate=e.separate),Nme(e)){var S=function(F){return function(M){return e.filter(M,F)}},w=function(F){return function(M){return e.filterMap(M,F)}},T=function(F){return function(M){return e.partition(M,F)}},E=function(F){return function(M){return e.partitionMap(M,F)}};t.filter=S,t.filterMap=w,t.partition=T,t.partitionMap=E}if(Kme(e)){var R=function(F){return function(M){return e.filterWithIndex(M,F)}},O=function(F){return function(M){return e.filterMapWithIndex(M,F)}},k=function(F){return function(M){return e.partitionWithIndex(M,F)}},B=function(F){return function(M){return e.partitionMapWithIndex(M,F)}};t.filterWithIndex=R,t.filterMapWithIndex=O,t.partitionWithIndex=k,t.partitionMapWithIndex=B}if(qme(e)){var K=function(F,M){return function(W){return e.promap(W,F,M)}};t.promap=K}if(Vme(e)){var H=function(F){return function(M){return e.compose(M,F)}};t.compose=H}if(zme(e)){var z=function(F){return function(M){return M._tag==="None"?e.throwError(F()):e.of(M.value)}},N=function(F){return F._tag==="Left"?e.throwError(F.left):e.of(F.right)},Y=function(F,M){return function(W){return F(W)?e.of(W):e.throwError(M(W))}},ee=function(F,M){return function(W){return e.chain(W,function(re){return F(re)?e.of(re):e.throwError(M(re))})}};t.fromOption=z,t.fromEither=N,t.fromPredicate=Y,t.filterOrElse=ee}return t}var ge=_;const Hme=Object.freeze(Object.defineProperty({__proto__:null,pipe:ge,pipeable:Qme},Symbol.toStringTag,{value:"Module"})),Yme=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Gme=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var mb=function(){return Math.random()};function O6(e,t){return _(mb,Ho(function(n){return Math.floor((t-e+1)*n+e)}))}function Jme(e,t){return _(mb,Ho(function(n){return(t-e)*n+e}))}var Zme=_(mb,Ho(function(e){return e<.5})),Xme=function(e){return _(O6(0,e.length-1),Ho(function(t){return e[t]}))};const ege=Object.freeze(Object.defineProperty({__proto__:null,random:mb,randomBool:Zme,randomElem:Xme,randomInt:O6,randomRange:Jme},Symbol.toStringTag,{value:"Module"}));var AR=bf(fE),M6=Hc(fE),F6=Cf(On),tge=Sf(On),j6=zo,L6=F6,D6=OA(On),nge=D6,mR=Ef(Na),rge=mR,U6=mR,ige=U6,B6=Rf(Na),oge=B6,age=jA(On),sge=LA,P6=DA,lge=P6,W6=Gc(Na),cge=W6,N6=MA(Na),uge=N6,dge=FA(Na),fge=$f(On),Di=function(e,t){return _(e,q6(t))},gR=function(e,t,n){return _(e,V6(t,n))},vR=function(e,t){return _(e,z6(t))},qf=function(e,t){return _(e,yR(t))},nm=function(e,t){return _(e,bR(t))},K6=function(e,t){return _(e,CR(t))},q6=wf(On),V6=Tf(On),z6=If(On),yR=xf(Wa),pge=yR,Go=M6,bR=Yc(Na),Q6=bR,H6=Q6(Q),hge=H6,CR=_f(Na),Age=CR,SR=AR,bn="ReaderEither",Y6=function(e){var t=Vc(e);return{URI:bn,_E:void 0,compact:Ko(On,t),separate:ja(On,t,il)}};function mge(e){var t=gf(e),n=Y6(e),r=La(On,t),i=Da(On,t),o=al(On,t),a=sl(On,t);return{URI:bn,_E:void 0,map:Di,compact:n.compact,separate:n.separate,filter:function(s,l){return _(s,r(l))},filterMap:function(s,l){return _(s,i(l))},partition:function(s,l){return _(s,o(l))},partitionMap:function(s,l){return _(s,a(l))}}}function G6(e){var t=Ea(Wa,rl(e));return{URI:bn,_E:void 0,map:Di,ap:function(n,r){return _(n,t(r))},of:Go}}function J6(e){var t=kA(Na,e);return{URI:bn,_E:void 0,map:Di,alt:function(n,r){return _(n,t(r))}}}var wR={URI:bn,map:Di},gge=He(wR),vge={URI:bn,of:Go},rm={URI:bn,map:Di,ap:qf},Z6=qt(rm),yge=Z6,X6=Vt(rm),bge=X6,e4={URI:bn,map:Di,ap:qf,of:Go},Ja={URI:bn,map:Di,ap:qf,chain:nm},Cge={URI:bn,map:Di,ap:qf,of:Go,chain:nm},t4=bt(Ja),Sge=t4,wge={URI:bn,bimap:gR,mapLeft:vR},xge={URI:bn,map:Di,alt:K6},Vf={URI:bn,fromReader:L6},_ge=BA(Vf),Tge=PA(Vf),Ige=Xc(Vf),n4=WA(Vf,Ja),Ege=n4,r4=NA(Vf,Ja),Rge=r4,$ge={URI:bn,map:Di,ap:qf,of:Go,chain:nm,throwError:SR},Za={URI:bn,fromEither:j6},kge=Bo(Za),Oge=Po(Za),Mge=Fc(Za,Ja),i4=Ra(Za,Ja),Fge=i4,o4=$a(Za,Ja),jge=o4,Lge=Ys(Za),a4=jc(Za,Ja),Dge=a4,Uge=di(Za),Bge=Go(vn),Pge=Qt(wR),s4=Ht(Ja),Wge=s4,l4=zt(rm),Nge=l4,c4=Go(Ln),u4=function(e){return X(Zc(e),Jc($A(Br)))},xR=function(e){var t=u4(e);return function(n){return Tt(n)?t(n):c4}},Kge=xR,d4=function(e){return xR(function(t,n){return e(n)})},qge=d4(Q),Vge={URI:bn,bimap:gR,mapLeft:vR,map:Di,of:Go,ap:qf,chain:nm,alt:K6,throwError:AR},zge=yn(rm),Qge=$i(e4),Hge=function(e){return yn(Wa)(TA(e))};function Yge(e){var t=G6(e),n=J6(e);return{URI:bn,_E:void 0,map:Di,ap:t.ap,of:Go,chain:nm,bimap:gR,mapLeft:vR,alt:n.alt,throwError:SR}}const Gge=Object.freeze(Object.defineProperty({__proto__:null,Alt:xge,ApT:c4,Applicative:e4,Apply:rm,Bifunctor:wge,Chain:Ja,Do:Bge,FromEither:Za,FromReader:Vf,Functor:wR,Monad:Cge,MonadThrow:$ge,Pointed:vge,URI:bn,alt:CR,altW:Age,ap:yR,apFirst:Z6,apFirstW:yge,apS:l4,apSW:Nge,apSecond:X6,apSecondW:bge,apW:pge,ask:_ge,asks:Tge,asksReaderEither:lge,asksReaderEitherW:P6,bimap:V6,bind:s4,bindTo:Pge,bindW:Wge,chain:bR,chainEitherK:i4,chainEitherKW:Fge,chainFirst:t4,chainFirstEitherK:o4,chainFirstEitherKW:jge,chainFirstReaderK:r4,chainFirstReaderKW:Rge,chainFirstW:Sge,chainOptionK:Mge,chainReaderK:n4,chainReaderKW:Ege,chainW:Q6,filterOrElse:a4,filterOrElseW:Dge,flap:gge,flatten:hge,flattenW:H6,fold:rge,foldW:ige,fromEither:j6,fromEitherK:Uge,fromOption:kge,fromOptionK:Oge,fromPredicate:Lge,fromReader:L6,fromReaderK:Ige,getAltReaderValidation:J6,getApplicativeReaderValidation:G6,getApplyMonoid:Qge,getApplySemigroup:zge,getCompactable:Y6,getFilterable:mge,getOrElse:B6,getOrElseW:oge,getReaderValidation:Yge,getSemigroup:Hge,left:AR,leftReader:tge,local:sge,map:q6,mapLeft:z6,match:D6,matchE:mR,matchEW:U6,matchW:nge,of:Go,orElse:W6,orElseFirst:N6,orElseFirstW:uge,orElseW:cge,orLeft:dge,readerEither:Vge,right:M6,rightReader:F6,sequenceArray:qge,swap:fge,throwError:SR,toUnion:age,traverseArray:d4,traverseArrayWithIndex:Kge,traverseReadonlyArrayWithIndex:xR,traverseReadonlyNonEmptyArrayWithIndex:u4},Symbol.toStringTag,{value:"Module"}));function _R(e){return function(t){return function(){return e.of(t)}}}function TR(e){return function(t){return function(n){return function(r){return e.map(n(r),t)}}}}function IR(e){return function(t){return function(n){return function(r){return e.ap(n(r),t(r))}}}}function ER(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){return t(i)(r)})}}}}function RR(e){return function(t){return X(t,e.of)}}function Jge(e){return function(t){return X(t,e)}}function Zge(e){var t=IR(e),n=TR(e),r=ER(e);return{map:function(i,o){return _(i,n(o))},ap:function(i,o){return _(i,t(o))},of:_R(e),chain:function(i,o){return _(i,r(o))},ask:function(){return e.of},asks:function(i){return X(i,e.of)},local:function(i,o){return function(a){return i(o(a))}},fromReader:RR(e),fromM:function(i){return function(){return i}}}}const Xge=Object.freeze(Object.defineProperty({__proto__:null,ap:IR,chain:ER,fromNaturalTransformation:Jge,fromReader:RR,getReaderM:Zge,map:TR,of:_R},Symbol.toStringTag,{value:"Module"}));var Cr=function(e){return function(){return Promise.resolve().then(e)}};function eve(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var ao=function(e,t){return _(e,dl(t))},ou=function(e,t){return _(e,f4(t))},$R=function(e,t){return _(e,im(function(n){return _(t,dl(n))}))},zf=function(e,t){return _(e,im(t))},dl=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},f4=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},ir=function(e){return function(){return Promise.resolve(e)}},im=function(e){return function(t){return function(){return Promise.resolve().then(t).then(function(n){return e(n)()})}}},tve=im(Q),Sr="Task";function nve(){return{concat:function(e,t){return function(){return Promise.race([Promise.resolve().then(e),Promise.resolve().then(t)])}},empty:h4}}var Ke={URI:Sr,map:ao},rve=He(Ke),Bn={URI:Sr,of:ir},au={URI:Sr,map:ao,ap:ou},ive=qt(au),ove=Vt(au),om={URI:Sr,map:ao,ap:ou,of:ir},gb={URI:Sr,map:ao,ap:$R},p4={URI:Sr,map:ao,ap:$R,of:ir},Qf={URI:Sr,map:ao,ap:ou,chain:zf},Cn={URI:Sr,map:ao,of:ir,ap:ou,chain:zf},ave={URI:Sr,map:ao,of:ir,ap:ou,chain:zf,fromIO:Cr},am=Q,sve={URI:Sr,map:ao,of:ir,ap:ou,chain:zf,fromIO:Cr,fromTask:am},lve=bt(Qf),vb={URI:Sr,fromIO:Cr},cve=Vo(vb),uve=Ua(vb,Qf),dve=Ba(vb,Qf),fve={URI:Sr,fromIO:Cr,fromTask:am},h4=function(){return new Promise(function(e){})},pve=ir(vn),hve=Qt(Ke),Ave=Ht(Qf),mve=zt(au),kR=ir(Ln),Hf=function(e){return function(t){return function(){return Promise.all(t.map(function(n,r){return Promise.resolve().then(function(){return e(r,n)()})}))}}},OR=function(e){var t=Hf(e);return function(n){return Tt(n)?t(n):kR}},MR=function(e){return function(t){return function(){return Kd(t).reduce(function(n,r,i){return n.then(function(o){return Promise.resolve().then(e(i+1,r)).then(function(a){return o.push(a),o})})},Promise.resolve().then(e(0,ui(t))).then(Zh))}}},FR=function(e){var t=MR(e);return function(n){return Tt(n)?t(n):kR}},gve=OR,A4=function(e){return OR(function(t,n){return e(n)})},vve=A4(Q),yve=FR,m4=function(e){return FR(function(t,n){return e(n)})},bve=m4(Q),Cve={URI:Sr,map:ao,of:ir,ap:ou,chain:zf,fromIO:Cr,fromTask:am},Sve={URI:Sr,map:ao,of:ir,ap:$R,chain:zf,fromIO:Cr,fromTask:am},wve=yn(gb),xve=$i(p4);const _ve=Object.freeze(Object.defineProperty({__proto__:null,ApT:kR,ApplicativePar:om,ApplicativeSeq:p4,ApplyPar:au,ApplySeq:gb,Chain:Qf,Do:pve,FromIO:vb,FromTask:fve,Functor:Ke,Monad:Cn,MonadIO:ave,MonadTask:sve,Pointed:Bn,URI:Sr,ap:f4,apFirst:ive,apS:mve,apSecond:ove,bind:Ave,bindTo:hve,chain:im,chainFirst:lve,chainFirstIOK:dve,chainIOK:uve,delay:eve,flap:rve,flatten:tve,fromIO:Cr,fromIOK:cve,fromTask:am,getMonoid:xve,getRaceMonoid:nve,getSemigroup:wve,map:dl,never:h4,of:ir,sequenceArray:vve,sequenceSeqArray:bve,task:Cve,taskSeq:Sve,traverseArray:A4,traverseArrayWithIndex:gve,traverseReadonlyArrayWithIndex:OR,traverseReadonlyArrayWithIndexSeq:FR,traverseReadonlyNonEmptyArrayWithIndex:Hf,traverseReadonlyNonEmptyArrayWithIndexSeq:MR,traverseSeqArray:m4,traverseSeqArrayWithIndex:yve},Symbol.toStringTag,{value:"Module"}));var g4=RR(Bn),Yf=zo,su=X(Cr,Yf),Tve=LA,v4=DA,Ive=v4,so=function(e,t){return _(e,LR(t))},lu=function(e,t){return _(e,DR(t))},jR=function(e,t){return _(e,yb(function(n){return _(t,LR(n))}))},Gf=function(e,t){return _(e,yb(t))},LR=TR(Ke),DR=IR(au),Eve=DR,Ui=_R(Bn),yb=ER(Cn),y4=yb,b4=y4(Q),Rve=b4,or="ReaderTask",Mn={URI:or,map:so},$ve=He(Mn),sm={URI:or,of:Ui},lm={URI:or,map:so,ap:lu},kve=qt(lm),Ove=Vt(lm),Mve={URI:or,map:so,ap:lu,of:Ui},UR={URI:or,map:so,ap:jR},C4={URI:or,map:so,ap:jR,of:Ui},Jo={URI:or,map:so,ap:lu,chain:Gf},Xa={URI:or,map:so,of:Ui,ap:lu,chain:Gf},Fve={URI:or,map:so,of:Ui,ap:lu,chain:Gf,fromIO:su},jve={URI:or,map:so,of:Ui,ap:lu,chain:Gf,fromIO:su,fromTask:Yf},S4=bt(Jo),Lve=S4,bb={URI:or,fromIO:su},Dve=Vo(bb),Uve=Ua(bb,Jo),Bve=Ba(bb,Jo),Jf={URI:or,fromReader:g4},Pve=BA(Jf),Wve=PA(Jf),Nve=Xc(Jf),w4=WA(Jf,Jo),Kve=w4,x4=NA(Jf,Jo),qve=x4,Cb={URI:or,fromIO:su,fromTask:Yf},Vve=eu(Cb),zve=kf(Cb,Jo),Qve=Of(Cb,Jo),Hve=Ui(vn),Yve=Qt(Mn),_4=Ht(Jo),Gve=_4,T4=zt(lm),Jve=T4,BR=Ui(Ln),I4=function(e){return X(Zc(e),Jc(Hf(Br)))},PR=function(e){var t=I4(e);return function(n){return Tt(n)?t(n):BR}},E4=function(e){return X(Zc(e),Jc(MR(Br)))},WR=function(e){var t=E4(e);return function(n){return Tt(n)?t(n):BR}},Zve=PR,R4=function(e){return PR(function(t,n){return e(n)})},Xve=R4(Q),eye=WR,$4=function(e){return WR(function(t,n){return e(n)})},tye=$4(Q),nye={URI:or,map:so,of:Ui,ap:lu,chain:Gf,fromIO:su,fromTask:Yf},rye={URI:or,map:so,of:Ui,ap:jR,chain:Gf,fromIO:su,fromTask:Yf},iye=yn(UR),oye=$i(C4);function aye(e,t){return e(t)()}const sye=Object.freeze(Object.defineProperty({__proto__:null,ApT:BR,ApplicativePar:Mve,ApplicativeSeq:C4,ApplyPar:lm,ApplySeq:UR,Chain:Jo,Do:Hve,FromIO:bb,FromReader:Jf,FromTask:Cb,Functor:Mn,Monad:Xa,MonadIO:Fve,MonadTask:jve,Pointed:sm,URI:or,ap:DR,apFirst:kve,apS:T4,apSW:Jve,apSecond:Ove,apW:Eve,ask:Pve,asks:Wve,asksReaderTask:Ive,asksReaderTaskW:v4,bind:_4,bindTo:Yve,bindW:Gve,chain:yb,chainFirst:S4,chainFirstIOK:Bve,chainFirstReaderK:x4,chainFirstReaderKW:qve,chainFirstTaskK:Qve,chainFirstW:Lve,chainIOK:Uve,chainReaderK:w4,chainReaderKW:Kve,chainTaskK:zve,chainW:y4,flap:$ve,flatten:Rve,flattenW:b4,fromIO:su,fromIOK:Dve,fromReader:g4,fromReaderK:Nve,fromTask:Yf,fromTaskK:Vve,getMonoid:oye,getSemigroup:iye,local:Tve,map:LR,of:Ui,readerTask:nye,readerTaskSeq:rye,run:aye,sequenceArray:Xve,sequenceSeqArray:tye,traverseArray:R4,traverseArrayWithIndex:Zve,traverseReadonlyArrayWithIndex:PR,traverseReadonlyArrayWithIndexSeq:WR,traverseReadonlyNonEmptyArrayWithIndex:I4,traverseReadonlyNonEmptyArrayWithIndexSeq:E4,traverseSeqArray:$4,traverseSeqArrayWithIndex:eye},Symbol.toStringTag,{value:"Module"}));var lye=function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(e,t||[])).next())})},cye=function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},NR=bf(Bn),KR=Hc(Bn),Sb=Cf(Ke),qR=Sf(Ke),VR=X(Cr,Sb),k4=X(Cr,qR),fl=VR,Zf=Sb,zR=ir,QR=Cr,O4=function(e){return dl(yK(e))},M4=OA(Ke),uye=M4,HR=Ef(Cn),dye=HR,F4=HR,fye=F4,j4=Rf(Cn),pye=j4,L4=function(e,t){return function(){return lye(void 0,void 0,void 0,function(){var n;return cye(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(Hs)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,Sa(t(n))];case 3:return[2]}})})}},hye=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return L4(function(){return e.apply(void 0,n)},t)}},Aye=jA(Ke),mye=F0(Bn),gye=j0(Bn),vye=rE(Cn),D4=Gc(Cn),yye=D4,wb=MA(Cn),bye=wb,Cye=function(e){return wb(t9(e))},Sye=function(e){return wb(n9(e))},wye=FA(Cn),xye=$f(Ke),U4=function(e){var t=O4(e);return function(n){return X(n,t)}},B4=function(e){return function(t){return function(n){return _(n,cm(U4(e)(t)))}}},_ye=B4,P4=function(e){return X(e,QR)},W4=function(e){return Sh(P4(e))},Tye=W4,Pn=function(e,t){return _(e,JR(t))},pl=function(e,t){return _(e,ZR(t))},YR=function(e,t){return _(e,cm(function(n){return _(t,JR(n))}))},hl=function(e,t){return _(e,cm(t))},xb=function(e,t,n){return _(e,N4(t,n))},_b=function(e,t){return _(e,K4(t))},GR=function(e,t){return _(e,XR(t))},JR=wf(Ke),N4=Tf(Ke),K4=If(Ke),ZR=xf(au),Iye=ZR,cm=Yc(Cn),Sh=cm,q4=Sh(Q),Eye=q4,XR=_f(Cn),Rye=XR,Kr=KR,um=NR,It="TaskEither";function e$(e,t){var n=Ea(e,rl(t));return{URI:It,_E:void 0,map:Pn,ap:function(r,i){return _(r,n(i))},of:Kr}}function V4(e){var t=kA(Cn,e);return{URI:It,_E:void 0,map:Pn,alt:function(n,r){return _(n,t(r))}}}var z4=function(e){var t=Vc(e);return{URI:It,_E:void 0,compact:Ko(Ke,t),separate:ja(Ke,t,il)}};function $ye(e){var t=gf(e),n=z4(e),r=La(Ke,t),i=Da(Ke,t),o=al(Ke,t),a=sl(Ke,t);return{URI:It,_E:void 0,map:Pn,compact:n.compact,separate:n.separate,filter:function(s,l){return _(s,r(l))},filterMap:function(s,l){return _(s,i(l))},partition:function(s,l){return _(s,o(l))},partitionMap:function(s,l){return _(s,a(l))}}}var t$={URI:It,map:Pn},kye=He(t$),Oye={URI:It,of:Kr},Tb={URI:It,map:Pn,ap:pl},Q4=qt(Tb),Mye=Q4,H4=Vt(Tb),Fye=H4,jye={URI:It,map:Pn,ap:pl,of:Kr},Y4={URI:It,map:Pn,ap:YR},G4={URI:It,map:Pn,ap:YR,of:Kr},lo={URI:It,map:Pn,ap:pl,chain:hl},Lye={URI:It,map:Pn,ap:pl,chain:hl,of:Kr},Dye={URI:It,map:Pn,ap:pl,chain:hl,of:Kr,fromIO:fl},Uye={URI:It,map:Pn,ap:pl,chain:hl,of:Kr,fromIO:fl,fromTask:Zf},Bye={URI:It,map:Pn,ap:pl,chain:hl,of:Kr,throwError:um},J4=bt(lo),Pye=J4,Wye={URI:It,bimap:xb,mapLeft:_b},Nye={URI:It,map:Pn,alt:GR},es={URI:It,fromEither:zR},Kye=Bo(es),qye=Po(es),Vye=Fc(es,lo),Z4=Ra(es,lo),zye=Z4,X4=$a(es,lo),Qye=X4,Hye=Ys(es),e9=jc(es,lo),Yye=e9,Gye=di(es),Ib={URI:It,fromIO:fl},t9=Vo(Ib),Jye=Ua(Ib,lo),Zye=Ba(Ib,lo),Eb={URI:It,fromIO:fl,fromTask:Zf},n9=eu(Eb),Xye=kf(Eb,lo),e0e=Of(Eb,lo);function t0e(e){return function(){var t=Array.prototype.slice.call(arguments);return function(){return new Promise(function(n){var r=function(i,o){return i!=null?n(Sa(i)):n(Hs(o))};e.apply(null,t.concat(r))})}}}var n0e=function(e,t,n){return n$(e,t,n)},n$=function(e,t,n){return _(e,Sh(function(r){return _(t(r),im(function(i){return _(n(r,i),Sh(function(){return ir(i)}))}))}))},r0e=Kr(vn),i0e=Qt(t$),r9=Ht(lo),o0e=r9,i9=zt(Tb),a0e=i9,r$=Kr(Ln),i$=function(e){return X(Hf(e),dl($A(Br)))},o$=function(e){var t=i$(e);return function(n){return Tt(n)?t(n):r$}},a$=function(e){return function(t){return function(){return Kd(t).reduce(function(n,r,i){return n.then(function(o){return An(o)?n:e(i+1,r)().then(function(a){return An(a)?a:(o.right.push(a.right),o)})})},e(0,ui(t))().then(zc(Zh)))}}},s$=function(e){var t=a$(e);return function(n){return Tt(n)?t(n):r$}},s0e=o$,o9=function(e){return o$(function(t,n){return e(n)})},l0e=o9(Q),c0e=s$,a9=function(e){return s$(function(t,n){return e(n)})},u0e=a9(Q),d0e={URI:It,bimap:xb,mapLeft:_b,map:Pn,of:Kr,ap:pl,chain:hl,alt:GR,fromIO:fl,fromTask:Zf,throwError:um},f0e={URI:It,bimap:xb,mapLeft:_b,map:Pn,of:Kr,ap:YR,chain:hl,alt:GR,fromIO:fl,fromTask:Zf,throwError:um},p0e=yn(Y4),h0e=$i(G4),A0e=function(e){return yn(gb)(TA(e))};function m0e(e){var t=e$(om,e),n=V4(e);return{URI:It,_E:void 0,map:Pn,ap:t.ap,of:Kr,chain:hl,bimap:xb,mapLeft:_b,alt:n.alt,fromIO:fl,fromTask:Zf,throwError:um}}const g0e=Object.freeze(Object.defineProperty({__proto__:null,Alt:Nye,ApT:r$,ApplicativePar:jye,ApplicativeSeq:G4,ApplyPar:Tb,ApplySeq:Y4,Bifunctor:Wye,Chain:lo,Do:r0e,FromEither:es,FromIO:Ib,FromTask:Eb,Functor:t$,Monad:Lye,MonadIO:Dye,MonadTask:Uye,MonadThrow:Bye,Pointed:Oye,URI:It,alt:XR,altW:Rye,ap:ZR,apFirst:Q4,apFirstW:Mye,apS:i9,apSW:a0e,apSecond:H4,apSecondW:Fye,apW:Iye,bimap:N4,bind:r9,bindTo:i0e,bindW:o0e,bracket:n0e,bracketW:n$,chain:cm,chainEitherK:Z4,chainEitherKW:zye,chainFirst:J4,chainFirstEitherK:X4,chainFirstEitherKW:Qye,chainFirstIOK:Zye,chainFirstTaskK:e0e,chainFirstW:Pye,chainIOEitherK:Tye,chainIOEitherKW:W4,chainIOK:Jye,chainNullableK:vye,chainOptionK:Vye,chainTaskK:Xye,chainTaskOptionK:_ye,chainTaskOptionKW:B4,chainW:Sh,filterOrElse:e9,filterOrElseW:Yye,flap:kye,flatten:Eye,flattenW:q4,fold:dye,foldW:fye,fromEither:zR,fromEitherK:Gye,fromIO:fl,fromIOEither:QR,fromIOEitherK:P4,fromIOK:t9,fromNullable:mye,fromNullableK:gye,fromOption:Kye,fromOptionK:qye,fromPredicate:Hye,fromTask:Zf,fromTaskK:n9,fromTaskOption:O4,fromTaskOptionK:U4,getAltTaskValidation:V4,getApplicativeTaskValidation:e$,getApplyMonoid:h0e,getApplySemigroup:p0e,getCompactable:z4,getFilterable:$ye,getOrElse:j4,getOrElseW:pye,getSemigroup:A0e,getTaskValidation:m0e,left:NR,leftIO:k4,leftTask:qR,map:JR,mapLeft:K4,match:M4,matchE:HR,matchEW:F4,matchW:uye,of:Kr,orElse:D4,orElseFirst:wb,orElseFirstIOK:Cye,orElseFirstTaskK:Sye,orElseFirstW:bye,orElseW:yye,orLeft:wye,right:KR,rightIO:VR,rightTask:Sb,sequenceArray:l0e,sequenceSeqArray:u0e,swap:xye,taskEither:d0e,taskEitherSeq:f0e,taskify:t0e,throwError:um,toUnion:Aye,traverseArray:o9,traverseArrayWithIndex:s0e,traverseReadonlyArrayWithIndex:o$,traverseReadonlyArrayWithIndexSeq:s$,traverseReadonlyNonEmptyArrayWithIndex:i$,traverseReadonlyNonEmptyArrayWithIndexSeq:a$,traverseSeqArray:a9,traverseSeqArrayWithIndex:c0e,tryCatch:L4,tryCatchK:hye},Symbol.toStringTag,{value:"Module"}));var Al=zo,Rb=bf(sm),l$=Hc(sm),c$=X(Sb,Al),s9=X(qR,Al),u$=function(e){return X(e,KR)},l9=function(e){return X(e,NR)},c9=Cf(Mn),v0e=Sf(Mn),d$=X(VR,Al),u9=X(k4,Al),d9=Ui,f9=u$,ml=d$,Xf=c$,f$=X(QR,Al),p$=function(e){return X(e,zR)},p9=OA(Mn),y0e=p9,h$=Ef(Jo),b0e=h$,h9=h$,C0e=h9,A9=Rf(Xa),S0e=A9,w0e=jA(Mn),x0e=F0(sm),_0e=j0(sm),T0e=rE(Xa),I0e=LA,m9=DA,E0e=m9,g9=Gc(Xa),R0e=g9,v9=MA(Xa),$0e=v9,k0e=FA(Xa),O0e=$f(Mn),y9=function(e){return X(e,f$)},b9=function(e){return ep(y9(e))},M0e=b9,A$=function(e){return X(e,Al)},C9=function(e){return ep(A$(e))},F0e=C9,S9=function(e){return jb(A$(e))},j0e=S9,m$=function(e){return X(e,p$)},w9=function(e){return ep(m$(e))},L0e=w9,x9=function(e){return jb(m$(e))},D0e=x9,Wn=function(e,t){return _(e,dm(t))},gl=function(e,t){return _(e,C$(t))},g$=function(e,t){return _(e,Ob(function(n){return _(t,dm(n))}))},vl=function(e,t){return _(e,Ob(t))},v$=function(e,t){return _(e,Mb(t))},$b=function(e,t,n){return _(e,y$(t,n))},kb=function(e,t){return _(e,b$(t))},dm=wf(Mn),y$=Tf(Mn),b$=If(Mn),C$=xf(lm),U0e=C$,qr=l$,Ob=Yc(Xa),ep=Ob,_9=ep(Q),B0e=_9,Mb=_f(Xa),T9=Mb,fm=Rb,wt="ReaderTaskEither",I9=function(e){var t=Vc(e);return{URI:wt,_E:void 0,compact:Ko(Mn,t),separate:ja(Mn,t,il)}};function P0e(e){var t=gf(e),n=I9(e),r=La(Mn,t),i=Da(Mn,t),o=al(Mn,t),a=sl(Mn,t);return{URI:wt,_E:void 0,map:Wn,compact:n.compact,separate:n.separate,filter:function(s,l){return _(s,r(l))},filterMap:function(s,l){return _(s,i(l))},partition:function(s,l){return _(s,o(l))},partitionMap:function(s,l){return _(s,a(l))}}}function E9(e,t){var n=Ea(Wa,e$(e,t));return{URI:wt,_E:void 0,map:Wn,ap:function(r,i){return _(r,n(i))},of:qr}}function R9(e){var t=kA(Xa,e);return{URI:wt,_E:void 0,map:Wn,alt:function(n,r){return _(n,t(r))}}}var cu={URI:wt,map:Wn},W0e=He(cu),S$={URI:wt,of:qr},Fb={URI:wt,map:Wn,ap:gl},$9=qt(Fb),N0e=$9,k9=Vt(Fb),K0e=k9,q0e={URI:wt,map:Wn,ap:gl,of:qr},O9={URI:wt,map:Wn,ap:g$},M9={URI:wt,map:Wn,ap:g$,of:qr},wr={URI:wt,map:Wn,ap:gl,chain:vl},V0e={URI:wt,map:Wn,ap:gl,chain:vl,of:qr},z0e={URI:wt,map:Wn,ap:gl,chain:vl,of:qr,fromIO:ml},Q0e={URI:wt,map:Wn,ap:gl,chain:vl,of:qr,fromIO:ml,fromTask:Xf},H0e={URI:wt,map:Wn,ap:gl,chain:vl,of:qr,throwError:fm},F9=bt(wr),jb=F9,Y0e={URI:wt,bimap:$b,mapLeft:kb},G0e={URI:wt,map:Wn,alt:v$},tp={URI:wt,fromReader:f9},J0e=BA(tp),Z0e=PA(tp),X0e=Xc(tp),j9=WA(tp,wr),ebe=j9,L9=NA(tp,wr),tbe=L9,w$=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return c9(e.apply(void 0,t))}},D9=function(e){return ep(w$(e))},nbe=D9,U9=function(e){return jb(w$(e))},rbe=U9,ts={URI:wt,fromEither:d9},ibe=Bo(ts),obe=Po(ts),abe=Fc(ts,wr),B9=Ra(ts,wr),sbe=B9,P9=$a(ts,wr),lbe=P9,cbe=Ys(ts),W9=jc(ts,wr),ube=W9,dbe=di(ts),Lb={URI:wt,fromIO:ml},fbe=Vo(Lb),pbe=Ua(Lb,wr),hbe=Ba(Lb,wr),Db={URI:wt,fromIO:ml,fromTask:Xf},Abe=eu(Db),mbe=kf(Db,wr),gbe=Of(Db,wr);function vbe(e,t,n){return N9(e,t,n)}function N9(e,t,n){return function(r){return n$(e(r),function(i){return t(i)(r)},function(i,o){return n(i,o)(r)})}}var ybe=qr(vn),bbe=Qt(cu),K9=Ht(wr),Cbe=K9,q9=zt(Fb),Sbe=q9,x$=qr(Ln),V9=function(e){return X(Zc(e),Jc(i$(Br)))},_$=function(e){var t=V9(e);return function(n){return Tt(n)?t(n):x$}},z9=function(e){return X(Zc(e),Jc(a$(Br)))},T$=function(e){var t=z9(e);return function(n){return Tt(n)?t(n):x$}},wbe=_$,Q9=function(e){return _$(function(t,n){return e(n)})},xbe=Q9(Q),_be=T$,H9=function(e){return T$(function(t,n){return e(n)})},Tbe=H9(Q),Ibe={URI:wt,map:Wn,of:qr,ap:gl,chain:vl,alt:v$,bimap:$b,mapLeft:kb,fromIO:ml,fromTask:Xf,throwError:fm},Ebe={URI:wt,map:Wn,of:qr,ap:g$,chain:vl,alt:v$,bimap:$b,mapLeft:kb,fromIO:ml,fromTask:Xf,throwError:fm},Rbe=yn(O9),$be=$i(M9),kbe=function(e){return yn(UR)(TA(e))};function Obe(e){var t=E9(om,e),n=R9(e);return{URI:wt,_E:void 0,map:Wn,of:qr,chain:vl,bimap:$b,mapLeft:kb,ap:t.ap,alt:n.alt,fromIO:ml,fromTask:Xf,throwError:fm}}function Mbe(e,t){return e(t)()}const Fbe=Object.freeze(Object.defineProperty({__proto__:null,Alt:G0e,ApT:x$,ApplicativePar:q0e,ApplicativeSeq:M9,ApplyPar:Fb,ApplySeq:O9,Bifunctor:Y0e,Chain:wr,Do:ybe,FromEither:ts,FromIO:Lb,FromReader:tp,FromTask:Db,Functor:cu,Monad:V0e,MonadIO:z0e,MonadTask:Q0e,MonadThrow:H0e,Pointed:S$,URI:wt,alt:Mb,altW:T9,ap:C$,apFirst:$9,apFirstW:N0e,apS:q9,apSW:Sbe,apSecond:k9,apSecondW:K0e,apW:U0e,ask:J0e,asks:Z0e,asksReaderTaskEither:E0e,asksReaderTaskEitherW:m9,bimap:y$,bind:K9,bindTo:bbe,bindW:Cbe,bracket:vbe,bracketW:N9,chain:Ob,chainEitherK:B9,chainEitherKW:sbe,chainFirst:F9,chainFirstEitherK:P9,chainFirstEitherKW:lbe,chainFirstIOK:hbe,chainFirstReaderEitherK:D0e,chainFirstReaderEitherKW:x9,chainFirstReaderK:L9,chainFirstReaderKW:tbe,chainFirstReaderTaskK:rbe,chainFirstReaderTaskKW:U9,chainFirstTaskEitherK:j0e,chainFirstTaskEitherKW:S9,chainFirstTaskK:gbe,chainFirstW:jb,chainIOEitherK:M0e,chainIOEitherKW:b9,chainIOK:pbe,chainNullableK:T0e,chainOptionK:abe,chainReaderEitherK:L0e,chainReaderEitherKW:w9,chainReaderK:j9,chainReaderKW:ebe,chainReaderTaskK:nbe,chainReaderTaskKW:D9,chainTaskEitherK:F0e,chainTaskEitherKW:C9,chainTaskK:mbe,chainW:ep,filterOrElse:W9,filterOrElseW:ube,flap:W0e,flatten:B0e,flattenW:_9,fold:b0e,foldW:C0e,fromEither:d9,fromEitherK:dbe,fromIO:ml,fromIOEither:f$,fromIOEitherK:y9,fromIOK:fbe,fromNullable:x0e,fromNullableK:_0e,fromOption:ibe,fromOptionK:obe,fromPredicate:cbe,fromReader:f9,fromReaderEither:p$,fromReaderEitherK:m$,fromReaderK:X0e,fromReaderTaskK:w$,fromTask:Xf,fromTaskEither:Al,fromTaskEitherK:A$,fromTaskK:Abe,getAltReaderTaskValidation:R9,getApplicativeReaderTaskValidation:E9,getApplyMonoid:$be,getApplySemigroup:Rbe,getCompactable:I9,getFilterable:P0e,getOrElse:A9,getOrElseW:S0e,getReaderTaskValidation:Obe,getSemigroup:kbe,left:Rb,leftIO:u9,leftReader:l9,leftReaderTask:v0e,leftTask:s9,local:I0e,map:dm,mapLeft:b$,match:p9,matchE:h$,matchEW:h9,matchW:y0e,of:qr,orElse:g9,orElseFirst:v9,orElseFirstW:$0e,orElseW:R0e,orLeft:k0e,readerTaskEither:Ibe,readerTaskEitherSeq:Ebe,right:l$,rightIO:d$,rightReader:u$,rightReaderTask:c9,rightTask:c$,run:Mbe,sequenceArray:xbe,sequenceSeqArray:Tbe,swap:O0e,throwError:fm,toUnion:w0e,traverseArray:Q9,traverseArrayWithIndex:wbe,traverseReadonlyArrayWithIndex:_$,traverseReadonlyArrayWithIndexSeq:T$,traverseReadonlyNonEmptyArrayWithIndex:V9,traverseReadonlyNonEmptyArrayWithIndexSeq:z9,traverseSeqArray:H9,traverseSeqArrayWithIndex:_be},Symbol.toStringTag,{value:"Module"}));var Y9={equals:function(e,t){return e===t}},G9={concat:function(e,t){return e+t}},J9="",jbe={concat:G9.concat,empty:J9},Z={equals:Y9.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},Lbe={show:function(e){return JSON.stringify(e)}},Dbe=function(e){return typeof e=="string"},Ube=function(e){return e.toUpperCase()},Bbe=function(e){return e.toLowerCase()},Pbe=function(e,t){return function(n){return n.replace(e,t)}},Wbe=function(e){return e.trim()},Nbe=function(e){return e.trimLeft()},Kbe=function(e){return e.trimRight()},qbe=function(e,t){return function(n){return n.slice(e,t)}},Vbe=function(e){return e.length===0},zbe=function(e){return e.length},Qbe=function(e){return function(t){var n=t.split(e);return Wo(n)?n:[t]}},Hbe=function(e,t){return function(n){return n.includes(e,t)}},Ybe=function(e,t){return function(n){return n.startsWith(e,t)}},Gbe=function(e,t){return function(n){return n.endsWith(e,t)}};const Jbe=Object.freeze(Object.defineProperty({__proto__:null,Eq:Y9,Monoid:jbe,Ord:Z,Semigroup:G9,Show:Lbe,empty:J9,endsWith:Gbe,includes:Hbe,isEmpty:Vbe,isString:Dbe,replace:Pbe,size:zbe,slice:qbe,split:Qbe,startsWith:Ybe,toLowerCase:Bbe,toUpperCase:Ube,trim:Wbe,trimLeft:Nbe,trimRight:Kbe},Symbol.toStringTag,{value:"Module"}));var Zbe=function(e){return Object.assign({},e)},Xbe=function(e){return Object.assign({},e)},Z9=function(e){return Object.keys(e).length},Lo=function(e){for(var t in e)if(yt.call(e,t))return!1;return!0},np=function(e){return function(t){return Object.keys(t).sort(e.compare)}},e1e=np(Z);function Ub(e){if(typeof e=="function")return Ub(Z)(e);var t=np(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var s=a[o];i.push(n(s,r[s]))}return i}}}var I$=Ub(Z)(function(e,t){return[e,t]});function t1e(e){return function(t){var n=I$(t),r=n.length;return e.unfold(0,function(i){return i<r?ye([n[i],i+1]):Re})}}var E$=function(e,t){return function(n){if(yt.call(n,e)&&n[e]===t)return n;var r=Object.assign({},n);return r[e]=t,r}},xa=function(e,t){return yt.call(t,e)};function R$(e){return function(t){if(!yt.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var n1e=function(e,t){return function(n){if(!xa(e,n))return Re;if(n[e]===t)return ye(n);var r=Object.assign({},n);return r[e]=t,ye(r)}},r1e=function(e,t){return function(n){if(!xa(e,n))return Re;var r=t(n[e]);if(r===n[e])return ye(n);var i=Object.assign({},n);return i[e]=r,ye(i)}};function i1e(e){var t=R$(e);return function(n){var r=hc(e,n);return tn(r)?Re:ye([r.value,t(n)])}}function Bb(e){return function(t,n){if(n===void 0){var r=Bb(e);return function(o){return r(o,t)}}for(var i in t)if(!yt.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function hc(e,t){return t===void 0?function(n){return hc(e,n)}:yt.call(t,e)?ye(t[e]):Re}var pm={};function Pb(e){return function(t){var n={};for(var r in t)yt.call(t,r)&&(n[r]=e(r,t[r]));return n}}function $$(e){return Pb(function(t,n){return e(n)})}function vd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return vd(Z).apply(void 0,e);var n=np(e[0]);return function(r,i){return function(o){for(var a=r,s=n(o),l=s.length,c=0;c<l;c++){var u=s[c];a=i(u,a,o[u])}return a}}}function yd(e){if("compare"in e){var t=np(e);return function(n){return function(r){return function(i){for(var o=n.empty,a=t(i),s=a.length,l=0;l<s;l++){var c=a[l];o=n.concat(o,r(c,i[c]))}return o}}}}return yd(Z)(e)}function bd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return bd(Z).apply(void 0,e);var n=np(e[0]);return function(r,i){return function(o){for(var a=r,s=n(o),l=s.length,c=l-1;c>=0;c--){var u=s[c];a=i(u,o[u],a)}return a}}}var X9=function(e,t){var n;return n={},n[e]=t,n};function e8(e){var t=Am(Z)(e);return function(n){return function(r){return t(r,n)}}}function Wb(e){var t=Zo(Z)(e);return function(n){return function(r){return t(r,n)}}}function rp(e){return hm(Z)(e)}var o1e=function(e){var t=Wb(e);return function(n){return function(r){return e.map(_(r,t(n)),ns)}}},a1e=function(e){var t=Wb(e);return function(n){return function(r){return e.map(_(r,t(n)),rs)}}};function Nb(e){return function(t){var n={},r={};for(var i in t)if(yt.call(t,i)){var o=e(i,t[i]);switch(o._tag){case"Left":n[i]=o.left;break;case"Right":r[i]=o.right;break}}return Be(n,r)}}function Kb(e){return function(t){var n={},r={};for(var i in t)if(yt.call(t,i)){var o=t[i];e(i,o)?r[i]=o:n[i]=o}return Be(n,r)}}function qb(e){return function(t){var n={};for(var r in t)if(yt.call(t,r)){var i=e(r,t[r]);Mt(i)&&(n[r]=i.value)}return n}}function Vb(e){return function(t){var n={},r=!1;for(var i in t)if(yt.call(t,i)){var o=t[i];e(i,o)?n[i]=o:r=!0}return r?n:t}}function t8(e,t){var n=k$(e,t);return function(r){return n(r,Q)}}function k$(e,t){return function(n,r){return t.reduce(n,{},function(i,o){var a=r(o),s=a[0],l=a[1];return i[s]=yt.call(i,s)?e.concat(i[s],l):l,i})}}var s1e=I$,l1e=function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];t[i[0]]=i[1]}return t};function n8(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function r8(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function O$(e){return function(t,n){if(n===void 0){var r=O$(e);return function(o){return r(t,o)}}for(var i in n)if(e.equals(n[i],t))return!0;return!1}}var M$=function(e){return function(t){return function(n){if(Lo(n))return t;if(Lo(t))return n;var r={};for(var i in n)xa(i,t)?r[i]=e.concat(n[i],t[i]):r[i]=n[i];for(var i in t)xa(i,r)||(r[i]=t[i]);return r}}},F$=function(e){return function(t){return function(n){if(Lo(n)||Lo(t))return pm;var r={};for(var i in n)xa(i,t)&&(r[i]=e.concat(n[i],t[i]));return r}}},j$=function(e){return function(t){if(Lo(t))return e;if(Lo(e))return t;var n={};for(var r in t)xa(r,e)||(n[r]=t[r]);for(var r in e)xa(r,t)||(n[r]=e[r]);return n}},hi=function(e,t){return _(e,$$(t))},uu=function(e,t){return _(e,Pb(t))},Ai=function(e){var t=wh(e);return function(n,r,i){return _(n,t(r,i))}},mi=function(e){return function(t){var n=xh(e)(t);return function(r,i){return _(r,n(i))}}},gi=function(e){var t=_h(e);return function(n,r,i){return _(n,t(r,i))}},du=function(e,t){return _(e,L$(t))},fu=function(e,t){return _(e,D$(t))},pu=function(e,t){return _(e,U$(t))},hu=function(e,t){return _(e,B$(t))},Au=function(e){var t=vd(e);return function(n,r,i){return _(n,t(r,i))}},mu=function(e){var t=yd(e);return function(n){var r=t(n);return function(i,o){return _(i,r(o))}}},gu=function(e){var t=bd(e);return function(n,r,i){return _(n,t(r,i))}},zb=function(e,t){return _(e,Nb(t))},Qb=function(e,t){return _(e,Kb(t))},Hb=function(e,t){return _(e,qb(t))},Yb=function(e,t){return _(e,Vb(t))},Zo=function(e){var t=Am(e);return function(n){var r=t(n);return function(i,o){return r(i,X(Br,o))}}},hm=function(e){var t=Zo(e);return function(n){var r=t(n);return function(i){return r(i,Q)}}},Am=function(e){return function(t){var n=np(e);return function(r,i){var o=n(r);if(o.length===0)return t.of(pm);for(var a=t.of({}),s=function(f){a=t.ap(t.map(a,function(p){return function(h){var m;return Object.assign({},p,(m={},m[f]=h,m))}}),i(f,r[f]))},l=0,c=o;l<c.length;l++){var u=c[l];s(u)}return a}}},L$=function(e){return Vb(function(t,n){return e(n)})},D$=function(e){return qb(function(t,n){return e(n)})},U$=function(e){return Kb(function(t,n){return e(n)})},B$=function(e){return Nb(function(t,n){return e(n)})};function wh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=vd(e[0]);return function(r,i){return n(r,function(o,a,s){return i(a,s)})}}return wh(Z).apply(void 0,e)}function xh(e){if("compare"in e){var t=yd(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}}return xh(Z)(e)}function _h(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=bd(e[0]);return function(r,i){return n(r,function(o,a,s){return i(a,s)})}}return _h(Z).apply(void 0,e)}var ns=function(e){var t={};for(var n in e)if(yt.call(e,n)){var r=e[n];Mt(r)&&(t[n]=r.value)}return t},rs=function(e){var t={},n={};for(var r in e)if(yt.call(e,r)){var i=e[r];An(i)?t[r]=i.left:n[r]=i.right}return Be(t,n)},Nn="ReadonlyRecord";function Tv(e){return"compare"in e?function(t){return{show:function(n){var r=Ub(e)(function(i,o){return"".concat(JSON.stringify(i),": ").concat(t.show(o))})(n).join(", ");return r===""?"{}":"{ ".concat(r," }")}}}:Tv(Z)(e)}function i8(e){var t=Bb(e);return ki(function(n,r){return t(n)(r)&&t(r)(n)})}function o8(e){return{concat:function(t,n){if(Lo(t))return n;if(Lo(n))return t;var r=Object.assign({},t);for(var i in n)yt.call(n,i)&&(r[i]=yt.call(t,i)?e.concat(t[i],n[i]):n[i]);return r},empty:pm}}var a8={URI:Nn,map:hi},c1e=He(a8),u1e={URI:Nn,map:hi,mapWithIndex:uu},d1e=function(e){return{URI:Nn,reduce:Ai(e),foldMap:mi(e),reduceRight:gi(e)}},f1e=function(e){return{URI:Nn,reduce:Ai(e),foldMap:mi(e),reduceRight:gi(e),reduceWithIndex:Au(e),foldMapWithIndex:mu(e),reduceRightWithIndex:gu(e)}},Th={URI:Nn,compact:ns,separate:rs},p1e={URI:Nn,map:hi,compact:ns,separate:rs,filter:du,filterMap:fu,partition:pu,partitionMap:hu},h1e={URI:Nn,map:hi,mapWithIndex:uu,compact:ns,separate:rs,filter:du,filterMap:fu,partition:pu,partitionMap:hu,filterMapWithIndex:Hb,filterWithIndex:Yb,partitionMapWithIndex:zb,partitionWithIndex:Qb},s8=function(e){return{URI:Nn,map:hi,reduce:Ai(e),foldMap:mi(e),reduceRight:gi(e),traverse:Zo(e),sequence:hm(e)}},A1e=function(e){return{URI:Nn,map:hi,mapWithIndex:uu,reduce:Ai(e),foldMap:mi(e),reduceRight:gi(e),reduceWithIndex:Au(e),foldMapWithIndex:mu(e),reduceRightWithIndex:gu(e),traverse:Zo(e),sequence:hm(e),traverseWithIndex:Am(e)}},m1e=function(e){var t=s8(e);return{URI:Nn,map:hi,reduce:Ai(e),foldMap:mi(e),reduceRight:gi(e),traverse:t.traverse,sequence:t.sequence,compact:ns,separate:rs,filter:du,filterMap:fu,partition:pu,partitionMap:hu,wither:ro(t,Th),wilt:no(t,Th)}},l8=function(e){var t=M$(e);return{concat:function(n,r){return t(r)(n)}}},g1e=function(e){return{concat:l8(e).concat,empty:pm}},v1e=function(e){var t=F$(e);return{concat:function(n,r){return t(r)(n)}}},y1e=function(){return{concat:function(e,t){return j$(t)(e)}}},b1e={URI:Nn,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z)},C1e={URI:Nn,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z),reduceWithIndex:Au(Z),foldMapWithIndex:mu(Z),reduceRightWithIndex:gu(Z)},P$={URI:Nn,map:hi,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z),traverse:Zo(Z),sequence:rp},S1e={URI:Nn,map:hi,mapWithIndex:uu,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z),reduceWithIndex:Au(Z),foldMapWithIndex:mu(Z),reduceRightWithIndex:gu(Z),traverse:Zo(Z),sequence:rp,traverseWithIndex:Am(Z)},c8=ro(P$,Th),u8=no(P$,Th),w1e={URI:Nn,map:hi,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z),traverse:Zo(Z),sequence:rp,compact:ns,separate:rs,filter:du,filterMap:fu,partition:pu,partitionMap:hu,wither:c8,wilt:u8},W$=E$;function d8(e,t){return yt.call(t===void 0?this:t,e)}var x1e={URI:Nn,map:hi,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z),traverse:Zo(Z),sequence:rp,compact:ns,separate:rs,filter:du,filterMap:fu,partition:pu,partitionMap:hu,mapWithIndex:uu,reduceWithIndex:Au(Z),foldMapWithIndex:mu(Z),reduceRightWithIndex:gu(Z),filterMapWithIndex:Hb,filterWithIndex:Yb,partitionMapWithIndex:zb,partitionWithIndex:Qb,traverseWithIndex:Am(Z),wither:c8,wilt:u8};const _1e=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Th,Filterable:p1e,FilterableWithIndex:h1e,Foldable:b1e,FoldableWithIndex:C1e,Functor:a8,FunctorWithIndex:u1e,Traversable:P$,TraversableWithIndex:S1e,URI:Nn,Witherable:w1e,_filter:du,_filterMap:fu,_filterMapWithIndex:Hb,_filterWithIndex:Yb,_foldMap:mi,_foldMapWithIndex:mu,_map:hi,_mapWithIndex:uu,_partition:pu,_partitionMap:hu,_partitionMapWithIndex:zb,_partitionWithIndex:Qb,_reduce:Ai,_reduceRight:gi,_reduceRightWithIndex:gu,_reduceWithIndex:Au,_sequence:hm,_traverse:Zo,collect:Ub,compact:ns,deleteAt:R$,difference:j$,elem:O$,empty:pm,every:n8,filter:L$,filterMap:D$,filterMapWithIndex:qb,filterWithIndex:Vb,flap:c1e,foldMap:xh,foldMapWithIndex:yd,fromEntries:l1e,fromFoldable:t8,fromFoldableMap:k$,fromRecord:Zbe,getDifferenceMagma:y1e,getEq:i8,getFoldable:d1e,getFoldableWithIndex:f1e,getIntersectionSemigroup:v1e,getMonoid:o8,getShow:Tv,getTraversable:s8,getTraversableWithIndex:A1e,getUnionMonoid:g1e,getUnionSemigroup:l8,getWitherable:m1e,has:xa,hasOwnProperty:d8,insertAt:W$,intersection:F$,isEmpty:Lo,isSubrecord:Bb,keys:e1e,lookup:hc,map:$$,mapWithIndex:Pb,modifyAt:r1e,partition:U$,partitionMap:B$,partitionMapWithIndex:Nb,partitionWithIndex:Kb,pop:i1e,readonlyRecord:x1e,reduce:wh,reduceRight:_h,reduceRightWithIndex:bd,reduceWithIndex:vd,separate:rs,sequence:rp,singleton:X9,size:Z9,some:r8,toEntries:s1e,toReadonlyArray:I$,toRecord:Xbe,toUnfoldable:t1e,traverse:Wb,traverseWithIndex:e8,union:M$,updateAt:n1e,upsertAt:E$,wilt:a1e,wither:o1e},Symbol.toStringTag,{value:"Module"}));var T1e=function(e){return new Set(e)},I1e=function(e){return new Set([e])},f8=function(e){return function(t){for(var n=t.length,r=new Set,i=Fn(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}};function E1e(e){return new Set(e)}function R1e(e){var t=Fn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);t(a,i)||i.add(a)}),i}}}function $1e(e){var t=Fn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){n(o).forEach(function(a){t(a,i)||i.add(a)})}),i}}}function N$(e){return function(t){for(var n=t.values(),r,i=new Set;!(r=n.next()).done;){var o=r.value;e(o)&&i.add(o)}return i}}function k1e(e){return function(t){for(var n=t.values(),r,i=new Set,o=new Set;!(r=n.next()).done;){var a=r.value;e(a)?i.add(a):o.add(a)}return Be(o,i)}}function K$(e){var t=Fn(e);return function(n,r){if(r===void 0){var i=K$(e);return function(a){return i(n,a)}}if(Ih(n))return r;if(Ih(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function q$(e){var t=Fn(e);return function(n,r){if(r===void 0){var i=q$(e);return function(a){return i(a,n)}}if(Ih(n)||Ih(r))return z$;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function O1e(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,s=new Set,l=Fn(e),c=Fn(t);!(o=i.next()).done;){var u=n(o.value);switch(u._tag){case"Left":l(u.left,a)||a.add(u.left);break;case"Right":c(u.right,s)||s.add(u.right);break}}return Be(a,s)}}}function V$(e){var t=Fn(e);return function(n,r){if(r===void 0){var i=V$(e);return function(o){return i(o,n)}}return N$(function(o){return!t(o,r)})(n)}}function p8(e){var t=Gb(e);return function(n,r){return function(i){return t(i).reduce(r,n)}}}function h8(e,t){var n=Gb(e);return function(r){return function(i){return n(i).reduce(function(o,a){return t.concat(o,r(a))},t.empty)}}}var A8=function(e){var t=Gb(e);return function(n,r){return function(i){return t(i).reduceRight(function(o,a){return r(a,o)},n)}}};function m8(e){var t=Fn(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var g8=function(e){return function(t){return function(n){return N$(function(r){return!e.equals(t,r)})(n)}}},M1e=function(e){var t=Fn(e),n=g8(e),r=m8(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},F1e=function(e){return v8(e)(Q)};function j1e(e,t){return function(n){var r=Fn(e),i=Fn(t),o=new Set,a=new Set;return n.forEach(function(s){switch(s._tag){case"Left":r(s.left,o)||o.add(s.left);break;case"Right":i(s.right,a)||a.add(s.right);break}}),Be(o,a)}}function v8(e){var t=Fn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);a._tag==="Some"&&!t(a.value,i)&&i.add(a.value)}),i}}}var z$=new Set,Ih=function(e){return e.size===0},L1e=function(e){return e.size},Q$=function(e){return function(t){for(var n=t.values(),r,i=!1;!i&&!(r=n.next()).done;)i=e(r.value);return i}};function H$(e){return bh(Q$(bh(e)))}function mm(e){var t=Fn(e);return function(n,r){if(r===void 0){var i=mm(e);return function(o){return i(o,n)}}return H$(function(o){return t(o,r)})(n)}}function Fn(e){return function(t,n){if(n===void 0){var r=Fn(e);return function(s){return r(t,s)}}for(var i=n.values(),o,a=!1;!a&&!(o=i.next()).done;)a=e.equals(t,o.value);return a}}var Gb=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},D1e="ReadonlySet";function y8(e){return{show:function(t){var n=[];return t.forEach(function(r){n.push(e.show(r))}),"new Set([".concat(n.sort().join(", "),"])")}}}function b8(e){var t=mm(e);return ki(function(n,r){return t(n,r)&&t(r,n)})}var C8=function(e){return{concat:K$(e)}},U1e=function(e){return{concat:C8(e).concat,empty:z$}},B1e=function(e){return{concat:q$(e)}},P1e=function(e){return{concat:V$(e)}},W1e=f8;const N1e=Object.freeze(Object.defineProperty({__proto__:null,URI:D1e,chain:$1e,compact:F1e,difference:V$,elem:Fn,empty:z$,every:H$,filter:N$,filterMap:v8,foldMap:h8,fromArray:W1e,fromReadonlyArray:f8,fromSet:T1e,getDifferenceMagma:P1e,getEq:b8,getIntersectionSemigroup:B1e,getShow:y8,getUnionMonoid:U1e,getUnionSemigroup:C8,insert:m8,intersection:q$,isEmpty:Ih,isSubset:mm,map:R1e,partition:k1e,partitionMap:O1e,reduce:p8,reduceRight:A8,remove:g8,separate:j1e,singleton:I1e,size:L1e,some:Q$,toReadonlyArray:Gb,toSet:E1e,toggle:M1e,union:K$},Symbol.toStringTag,{value:"Module"}));function mn(e){return e[0]}function tr(e){return e[1]}var K1e=function(e){return[tr(e),mn(e)]};function Y$(e){return{URI:vi,_E:void 0,map:gm,ap:function(t,n){return[mn(t)(mn(n)),e.concat(tr(t),tr(n))]}}}var S8=function(e){return function(t){return[t,e.empty]}};function q1e(e){var t=Y$(e);return{URI:vi,_E:void 0,map:t.map,ap:t.ap,of:S8(e)}}function G$(e){var t=Y$(e);return{URI:vi,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(mn(n)),o=i[0],a=i[1];return[o,e.concat(tr(n),a)]}}}function V1e(e){var t=G$(e);return{URI:vi,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:S8(e)}}function z1e(e){var t=function(r,i){for(var o=i(r),a=e.empty,s=mn(o);s._tag==="Left";)a=e.concat(a,tr(o)),o=i(s.left),s=mn(o);return[s.right,e.concat(a,tr(o))]},n=G$(e);return{URI:vi,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var w8=function(e,t){return _(e,R8(t))},gm=function(e,t){return _(e,ek(t))},x8=function(e,t,n){return _(e,E8(t,n))},_8=function(e,t){return _(e,tk(t))},T8=function(e,t){return _(e,nk(t))},J$=function(e,t,n){return _(e,rk(t,n))},Z$=function(e){var t=ik();return function(n,r){return _(n,t(r))}},X$=function(e,t,n){return _(e,ok(t,n))},I8=function(e){var t=$8(e);return function(n,r){return _(n,t(r))}},E8=function(e,t){return function(n){return[t(mn(n)),e(tr(n))]}},ek=function(e){return function(t){return[e(mn(t)),tr(t)]}},tk=function(e){return function(t){return[mn(t),e(tr(t))]}},R8=function(e){return function(t){return[mn(t),tr(e)]}},nk=function(e){return function(t){return[e(t),tr(t)]}},Jb=mn,Q1e=nk(Q),rk=function(e,t){return function(n){return t(e,mn(n))}},ik=function(){return function(e){return function(t){return e(mn(t))}}},ok=function(e,t){return function(n){return t(mn(n),e)}},$8=function(e){return function(t){return function(n){return e.map(t(mn(n)),function(r){return[r,tr(n)]})}}},ak=function(e){return function(t){return e.map(mn(t),function(n){return[n,tr(t)]})}},vi="ReadonlyTuple",k8={URI:vi,map:gm},H1e=He(k8),Y1e={URI:vi,bimap:x8,mapLeft:_8},G1e={URI:vi,compose:w8},J1e={URI:vi,map:gm,extend:T8,extract:Jb},Z1e={URI:vi,reduce:J$,foldMap:Z$,reduceRight:X$},X1e={URI:vi,map:gm,reduce:J$,foldMap:Z$,reduceRight:X$,traverse:I8,sequence:ak},eCe=ek,tCe=tk,nCe={URI:vi,compose:w8,map:gm,bimap:x8,mapLeft:_8,extract:Jb,extend:T8,reduce:J$,foldMap:Z$,reduceRight:X$,traverse:I8,sequence:ak};const rCe=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:Y1e,Comonad:J1e,Foldable:Z1e,Functor:k8,Semigroupoid:G1e,Traversable:X1e,URI:vi,bimap:E8,compose:R8,duplicate:Q1e,extend:nk,extract:Jb,flap:H1e,foldMap:ik,fst:mn,getApplicative:q1e,getApply:Y$,getChain:G$,getChainRec:z1e,getMonad:V1e,map:eCe,mapFst:ek,mapLeft:tCe,mapSnd:tk,readonlyTuple:nCe,reduce:rk,reduceRight:ok,sequence:ak,snd:tr,swap:K1e,traverse:$8},Symbol.toStringTag,{value:"Module"}));var Cd=function(){return Cd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Cd.apply(this,arguments)},iCe=Z9,Ac=Lo,sk=function(e){return function(t){return Object.keys(t).sort(e.compare)}},oCe=sk(Z);function lk(e){if(typeof e=="function")return lk(Z)(e);var t=sk(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var s=a[o];i.push(n(s,r[s]))}return i}}}var ck=lk(Z)(function(e,t){return[e,t]});function aCe(e){return function(t){var n=ck(t),r=n.length;return e.unfold(0,function(i){return i<r?ye([n[i],i+1]):Re})}}var O8=E$,M8=xa;function F8(e){return function(t){if(!yt.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var sCe=function(e,t){return j8(e,function(){return t})},j8=function(e,t){return function(n){if(!M8(e,n))return Re;var r=Object.assign({},n);return r[e]=t(n[e]),ye(r)}};function lCe(e){var t=F8(e);return function(n){var r=L8(e,n);return tn(r)?Re:ye([r.value,t(n)])}}var cCe=Bb,L8=hc,uCe=Pb,dCe=$$;function fCe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?vd(e[0]):vd(Z).apply(void 0,e)}function pCe(e){return"compare"in e?yd(e):yd(Z)(e)}function hCe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?bd(e[0]):bd(Z).apply(void 0,e)}var ACe=X9;function mCe(e){return e8(e)}function uk(e){return Wb(e)}function vm(e){return rp(e)}var gCe=function(e){var t=uk(e);return function(n){return function(r){return e.map(_(r,t(n)),yl)}}},vCe=function(e){var t=uk(e);return function(n){return function(r){return e.map(_(r,t(n)),bl)}}},yCe=Nb;function bCe(e){return Kb(e)}var CCe=qb;function SCe(e){return Vb(e)}function D8(e,t){return t8(e,t)}var wCe=ck,xCe=function(e){return D8(Iy(),oN)(e)};function _Ce(e,t){return k$(e,t)}var TCe=n8,ICe=r8,ECe=O$,U8=function(e){var t=M$(e);return function(n){return function(r){return Ac(r)?Cd({},n):Ac(n)?Cd({},r):t(n)(r)}}},B8=function(e){return function(t){return function(n){return Ac(n)||Ac(t)?{}:F$(e)(t)(n)}}},P8=function(e){return function(t){return Ac(t)?Cd({},e):Ac(e)?Cd({},t):j$(e)(t)}},co=hi,ym=uu,uo=Ai,fo=mi,po=gi,bm=du,Cm=fu,Sm=pu,wm=hu,xm=Au,_m=mu,Tm=gu,W8=zb,N8=Qb,K8=Hb,q8=Yb,ip=Zo,V8=hm,dk=function(e){return function(t){var n=sk(e);return function(r,i){var o=n(r);if(o.length===0)return t.of({});for(var a=t.of({}),s=function(f){a=t.ap(t.map(a,function(p){return function(h){return p[f]=h,p}}),i(f,r[f]))},l=0,c=o;l<c.length;l++){var u=c[l];s(u)}return a}}},RCe=L$,$Ce=D$,kCe=U$,OCe=B$;function MCe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?wh(e[0]):wh(Z).apply(void 0,e)}function FCe(e){return"compare"in e?xh(e):xh(Z)(e)}function jCe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?_h(e[0]):_h(Z).apply(void 0,e)}var yl=ns,bl=rs,Kn="Record";function LCe(e){return"compare"in e?Tv(e):Tv(Z)(e)}var DCe=i8,UCe=o8,z8={URI:Kn,map:co},BCe=He(z8),PCe={URI:Kn,map:co,mapWithIndex:ym},WCe=function(e){return{URI:Kn,reduce:uo(e),foldMap:fo(e),reduceRight:po(e)}},NCe=function(e){return{URI:Kn,reduce:uo(e),foldMap:fo(e),reduceRight:po(e),reduceWithIndex:xm(e),foldMapWithIndex:_m(e),reduceRightWithIndex:Tm(e)}},Eh={URI:Kn,compact:yl,separate:bl},KCe={URI:Kn,map:co,compact:yl,separate:bl,filter:bm,filterMap:Cm,partition:Sm,partitionMap:wm},qCe={URI:Kn,map:co,mapWithIndex:ym,compact:yl,separate:bl,filter:bm,filterMap:Cm,partition:Sm,partitionMap:wm,filterMapWithIndex:K8,filterWithIndex:q8,partitionMapWithIndex:W8,partitionWithIndex:N8},Q8=function(e){return{URI:Kn,map:co,reduce:uo(e),foldMap:fo(e),reduceRight:po(e),traverse:ip(e),sequence:V8(e)}},VCe=function(e){return{URI:Kn,map:co,mapWithIndex:ym,reduce:uo(e),foldMap:fo(e),reduceRight:po(e),reduceWithIndex:xm(e),foldMapWithIndex:_m(e),reduceRightWithIndex:Tm(e),traverse:ip(e),sequence:V8(e),traverseWithIndex:dk(e)}},zCe=function(e){var t=Q8(e);return{URI:Kn,map:co,reduce:uo(e),foldMap:fo(e),reduceRight:po(e),traverse:t.traverse,sequence:t.sequence,compact:yl,separate:bl,filter:bm,filterMap:Cm,partition:Sm,partitionMap:wm,wither:ro(t,Eh),wilt:no(t,Eh)}},H8=function(e){var t=U8(e);return{concat:function(n,r){return t(r)(n)}}},QCe=function(e){return{concat:H8(e).concat,empty:{}}},HCe=function(e){var t=B8(e);return{concat:function(n,r){return t(r)(n)}}},YCe=function(){return{concat:function(e,t){return P8(t)(e)}}},GCe={URI:Kn,reduce:uo(Z),foldMap:fo(Z),reduceRight:po(Z)},JCe={URI:Kn,reduce:uo(Z),foldMap:fo(Z),reduceRight:po(Z),reduceWithIndex:xm(Z),foldMapWithIndex:_m(Z),reduceRightWithIndex:Tm(Z)},fk={URI:Kn,map:co,reduce:uo(Z),foldMap:fo(Z),reduceRight:po(Z),traverse:ip(Z),sequence:vm},ZCe={URI:Kn,map:co,mapWithIndex:ym,reduce:uo(Z),foldMap:fo(Z),reduceRight:po(Z),reduceWithIndex:xm(Z),foldMapWithIndex:_m(Z),reduceRightWithIndex:Tm(Z),traverse:ip(Z),sequence:vm,traverseWithIndex:dk(Z)},Y8=ro(fk,Eh),G8=no(fk,Eh),XCe={URI:Kn,map:co,reduce:uo(Z),foldMap:fo(Z),reduceRight:po(Z),traverse:ip(Z),sequence:vm,compact:yl,separate:bl,filter:bm,filterMap:Cm,partition:Sm,partitionMap:wm,wither:Y8,wilt:G8},eSe={},tSe=O8,nSe=d8,rSe={URI:Kn,map:co,reduce:uo(Z),foldMap:fo(Z),reduceRight:po(Z),traverse:ip(Z),sequence:vm,compact:yl,separate:bl,filter:bm,filterMap:Cm,partition:Sm,partitionMap:wm,mapWithIndex:ym,reduceWithIndex:xm(Z),foldMapWithIndex:_m(Z),reduceRightWithIndex:Tm(Z),filterMapWithIndex:K8,filterWithIndex:q8,partitionMapWithIndex:W8,partitionWithIndex:N8,traverseWithIndex:dk(Z),wither:Y8,wilt:G8};const iSe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Eh,Filterable:KCe,FilterableWithIndex:qCe,Foldable:GCe,FoldableWithIndex:JCe,Functor:z8,FunctorWithIndex:PCe,Traversable:fk,TraversableWithIndex:ZCe,URI:Kn,Witherable:XCe,collect:lk,compact:yl,deleteAt:F8,difference:P8,elem:ECe,empty:eSe,every:TCe,filter:RCe,filterMap:$Ce,filterMapWithIndex:CCe,filterWithIndex:SCe,flap:BCe,foldMap:FCe,foldMapWithIndex:pCe,fromEntries:xCe,fromFoldable:D8,fromFoldableMap:_Ce,getDifferenceMagma:YCe,getEq:DCe,getFoldable:WCe,getFoldableWithIndex:NCe,getIntersectionSemigroup:HCe,getMonoid:UCe,getShow:LCe,getTraversable:Q8,getTraversableWithIndex:VCe,getUnionMonoid:QCe,getUnionSemigroup:H8,getWitherable:zCe,has:M8,hasOwnProperty:nSe,insertAt:tSe,intersection:B8,isEmpty:Ac,isSubrecord:cCe,keys:oCe,lookup:L8,map:dCe,mapWithIndex:uCe,modifyAt:j8,partition:kCe,partitionMap:OCe,partitionMapWithIndex:yCe,partitionWithIndex:bCe,pop:lCe,record:rSe,reduce:MCe,reduceRight:jCe,reduceRightWithIndex:hCe,reduceWithIndex:fCe,separate:bl,sequence:vm,singleton:ACe,size:iCe,some:ICe,toArray:ck,toEntries:wCe,toUnfoldable:aCe,traverse:uk,traverseWithIndex:mCe,union:U8,updateAt:sCe,upsertAt:O8,wilt:vCe,wither:gCe},Symbol.toStringTag,{value:"Module"}));var oSe=function(e){return function(t){return Mt(e(t))}},aSe=function(e){return function(t){return y_(e(t))}},sSe=function(){return function(e){return!0}},lSe=function(e){return function(t){return!e(t)}},cSe=function(e){return function(t){return function(n){return t(n)||e(n)}}},uSe=function(e){return function(t){return function(n){return t(n)&&e(n)}}},dSe=function(){return function(e){return!1}},fSe=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const pSe=Object.freeze(Object.defineProperty({__proto__:null,and:uSe,compose:fSe,fromEitherK:aSe,fromOptionK:oSe,id:sSe,not:lSe,or:cSe,zero:dSe},Symbol.toStringTag,{value:"Module"}));var J8=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{add:function(n,r){return e.map(function(i,o){return i.add(n[o],r[o])})},zero:e.map(function(n){return n.zero}),mul:function(n,r){return e.map(function(i,o){return i.mul(n[o],r[o])})},one:e.map(function(n){return n.one}),sub:function(n,r){return e.map(function(i,o){return i.sub(n[o],r[o])})}}},hSe=function(e){return function(t){return e.sub(e.zero,t)}},ASe=J8,mSe=DU;const gSe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:mSe,getTupleRing:ASe,negate:hSe,tuple:J8},Symbol.toStringTag,{value:"Module"})),vSe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ySe=m_;const bSe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:ySe},Symbol.toStringTag,{value:"Module"}));var CSe=y8,SSe=b8;function wSe(e){var t=jr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);t(a,i)||i.add(a)}),i}}}function xSe(e){var t=jr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){n(o).forEach(function(a){t(a,i)||i.add(a)})}),i}}}function pk(e){return function(t){for(var n=t.values(),r,i=new Set;!(r=n.next()).done;){var o=r.value;e(o)&&i.add(o)}return i}}function _Se(e){return function(t){for(var n=t.values(),r,i=new Set,o=new Set;!(r=n.next()).done;){var a=r.value;e(a)?i.add(a):o.add(a)}return Be(o,i)}}function hk(e){var t=jr(e);return function(n,r){if(r===void 0){var i=hk(e);return function(a){return i(n,a)}}if(Rh(n))return r;if(Rh(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function Ak(e){var t=jr(e);return function(n,r){if(r===void 0){var i=Ak(e);return function(a){return i(a,n)}}if(Rh(n)||Rh(r))return new Set;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function TSe(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,s=new Set,l=jr(e),c=jr(t);!(o=i.next()).done;){var u=n(o.value);switch(u._tag){case"Left":l(u.left,a)||a.add(u.left);break;case"Right":c(u.right,s)||s.add(u.right);break}}return Be(a,s)}}}function mk(e){var t=jr(e);return function(n,r){if(r===void 0){var i=mk(e);return function(o){return i(o,n)}}return pk(function(o){return!t(o,r)})(n)}}var Z8=function(e){return{concat:hk(e)}},ISe=function(e){return{concat:Z8(e).concat,empty:new Set}},ESe=function(e){return{concat:Ak(e)}},RSe=function(e){return{concat:mk(e)}},$Se=p8,kSe=h8,OSe=A8,MSe=function(e){return new Set([e])};function X8(e){var t=jr(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var eq=function(e){return function(t){return function(n){return pk(function(r){return!e.equals(t,r)})(n)}}},FSe=function(e){var t=jr(e),n=eq(e),r=X8(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},tq=function(e){return function(t){for(var n=t.length,r=new Set,i=jr(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}},jSe=function(e){return nq(e)(Q)};function LSe(e,t){return function(n){var r=jr(e),i=jr(t),o=new Set,a=new Set;return n.forEach(function(s){switch(s._tag){case"Left":r(s.left,o)||o.add(s.left);break;case"Right":i(s.right,a)||a.add(s.right);break}}),Be(o,a)}}function nq(e){var t=jr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);a._tag==="Some"&&!t(a.value,i)&&i.add(a.value)}),i}}}var DSe=new Set,Rh=function(e){return e.size===0},USe=function(e){return e.size},BSe=Q$,rq=H$,PSe=mm,jr=Fn,iq=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},WSe=mm;const NSe=Object.freeze(Object.defineProperty({__proto__:null,chain:xSe,compact:jSe,difference:mk,elem:jr,empty:DSe,every:rq,filter:pk,filterMap:nq,foldMap:kSe,fromArray:tq,getDifferenceMagma:RSe,getEq:SSe,getIntersectionSemigroup:ESe,getShow:CSe,getUnionMonoid:ISe,getUnionSemigroup:Z8,insert:X8,intersection:Ak,isEmpty:Rh,isSubset:PSe,map:wSe,partition:_Se,partitionMap:TSe,reduce:$Se,reduceRight:OSe,remove:eq,separate:LSe,singleton:MSe,size:USe,some:BSe,subset:WSe,toArray:iq,toggle:FSe,union:hk},Symbol.toStringTag,{value:"Module"}));var oq=function(e){return{show:function(t){var n="{";for(var r in e)yt.call(e,r)&&(n+=" ".concat(r,": ").concat(e[r].show(t[r]),","));return n.length>1&&(n=n.slice(0,-1)+" "),n+="}",n}}},aq=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{show:function(n){return"[".concat(n.map(function(r,i){return e[i].show(r)}).join(", "),"]")}}},KSe=aq,qSe=oq,VSe={show:function(e){return JSON.stringify(e)}},zSe={show:function(e){return JSON.stringify(e)}},QSe={show:function(e){return JSON.stringify(e)}};const HSe=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:qSe,getTupleShow:KSe,showBoolean:VSe,showNumber:QSe,showString:zSe,struct:oq,tuple:aq},Symbol.toStringTag,{value:"Module"}));function gk(e){return function(t){return function(n){return e.of([t,n])}}}function vk(e){return function(t){return function(n){return function(r){return e.map(n(r),function(i){var o=i[0],a=i[1];return[t(o),a]})}}}}function yk(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){var o=i[0],a=i[1];return e.map(t(a),function(s){var l=s[0],c=s[1];return[o(l),c]})})}}}}function bk(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){var o=i[0],a=i[1];return t(o)(a)})}}}}function Ck(e){return function(t){return function(n){return e.of(t(n))}}}function Sk(e){return function(t){return function(n){return e.map(t,function(r){return[r,n]})}}}function wk(e){return function(t){return function(n){return e.map(n(t),function(r){var i=r[0];return i})}}}function xk(e){return function(t){return function(n){return e.map(n(t),tr)}}}function YSe(e){var t=yk(e),n=vk(e),r=bk(e),i=wk(e),o=xk(e);return{map:function(a,s){return _(a,n(s))},ap:function(a,s){return _(a,t(s))},of:gk(e),chain:function(a,s){return _(a,r(s))},get:function(){return function(a){return e.of([a,a])}},put:function(a){return function(){return e.of([void 0,a])}},modify:function(a){return function(s){return e.of([void 0,a(s)])}},gets:function(a){return function(s){return e.of([a(s),s])}},fromState:Ck(e),fromM:Sk(e),evalState:function(a,s){return _(a,i(s))},execState:function(a,s){return _(a,o(s))}}}const GSe=Object.freeze(Object.defineProperty({__proto__:null,ap:yk,chain:bk,evaluate:wk,execute:xk,fromF:Sk,fromState:Ck,getStateM:YSe,map:vk,of:gk},Symbol.toStringTag,{value:"Module"}));var _k=function(e){return function(){return Rb(e)}},Tk=gk(S$);function sq(e){return ho(c$(e))}function JSe(e){return ho(s9(e))}function lq(e){return ho(u$(e))}function ZSe(e){return ho(l9(e))}function cq(e){return ho(d$(e))}function XSe(e){return ho(u9(e))}var ewe=function(e){return X(e,l$)},twe=function(e){return function(t){return Rb(e(t)[0])}},uq=ol(function(e){return _k(e)},Tk),dq=lq,vu=cq,Im=sq,fq=Ck(S$),pq=function(e){return ho(Al(e))},hq=function(e){return ho(f$(e))},nwe=function(e){return ho(p$(e))},ho=Sk(cu),rwe=function(e){return function(t){return X(t,LA(e))}},Aq=function(e){return function(t){return function(n){return e(n)(t)(n)}}},iwe=Aq,mq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return hq(e.apply(void 0,t))}},gq=function(e){return function(t){return _(t,Em(mq(e)))}},owe=gq,vq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return pq(e.apply(void 0,t))}},yq=function(e){return function(t){return _(t,Em(vq(e)))}},awe=yq,bq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return ho(e.apply(void 0,t))}},Cq=function(e){return function(t){return _(t,Em(bq(e)))}},swe=Cq,Ao=function(e,t){return _(e,Sq(t))},is=function(e,t){return _(e,Ek(t))},yu=function(e,t){return _(e,Rk(t))},Ik=function(e,t){return function(n){return _(e(n),Mb(function(){return t()(n)}))}},Zb=function(e,t,n){return function(r){return _(e(r),y$(t,function(i){var o=i[0],a=i[1];return[n(o),a]}))}},Xb=function(e,t){return function(n){return _(e(n),b$(t))}},Sq=vk(cu),lwe=function(e,t){return function(n){return Zb(n,e,t)}},cwe=function(e){return function(t){return Xb(t,e)}},Ek=yk(wr),uwe=Ek,Xo=Tk,Rk=bk(wr),Em=Rk,wq=Em(Q),dwe=wq,xq=function(e){return function(t){return function(n){return _(t(n),T9(function(){return e()(n)}))}}},fwe=xq,e1=_k,cn="StateReaderTaskEither",$k={URI:cn,map:Ao},pwe=He($k),hwe={URI:cn,of:Xo},t1={URI:cn,map:Ao,ap:is},_q=qt(t1),Awe=_q,Tq=Vt(t1),mwe=Tq,gwe={URI:cn,map:Ao,ap:is,of:Xo},Vr={URI:cn,map:Ao,ap:is,chain:yu},bu={URI:cn,fromState:fq},vwe=b3(bu),ywe=C3(bu),bwe=S3(bu),Cwe=w3(bu),Swe=yE(bu),wwe=x3(bu,Vr),xwe={URI:cn,map:Ao,ap:is,of:Xo,chain:yu},_we={URI:cn,map:Ao,ap:is,of:Xo,chain:yu,fromIO:vu},Twe={URI:cn,map:Ao,ap:is,of:Xo,chain:yu,fromIO:vu,fromTask:Im},Iwe={URI:cn,map:Ao,ap:is,of:Xo,chain:yu,throwError:e1},Iq=bt(Vr),Ewe=Iq,Rwe={URI:cn,bimap:Zb,mapLeft:Xb},$we={URI:cn,map:Ao,alt:Ik},op={URI:cn,fromReader:dq},kwe=BA(op),Owe=PA(op),Mwe=Xc(op),Eq=WA(op,Vr),Fwe=Eq,Rq=NA(op,Vr),jwe=Rq,as={URI:cn,fromEither:uq},Lwe=Bo(as),Dwe=Po(as),Uwe=Fc(as,Vr),$q=Ra(as,Vr),Bwe=$q,kq=$a(as,Vr),Pwe=kq,Wwe=Ys(as),Oq=jc(as,Vr),Nwe=Oq,Kwe=di(as),n1={URI:cn,fromIO:vu},qwe=Vo(n1),Vwe=Ua(n1,Vr),zwe=Ba(n1,Vr),r1={URI:cn,fromIO:vu,fromTask:Im},Qwe=eu(r1),Hwe=kf(r1,Vr),Ywe=Of(r1,Vr),Gwe=wk(cu),Jwe=xk(cu),Zwe=Qt($k),Mq=Ht(Vr),Xwe=Mq,Fq=zt(t1),exe=Fq,jq=function(e){return function(t){return function(n){return function(r){return function(){return Kd(t).reduce(function(i,o,a){return i.then(function(s){return An(s)?i:e(a+1,o)(s.right[1])(r)().then(function(l){if(An(l))return l;var c=l.right,u=c[0],f=c[1];return s.right[0].push(u),s.right[1]=f,s})})},e(0,ui(t))(n)(r)().then(zc(function(i){var o=i[0],a=i[1];return[[o],a]})))}}}}},kk=function(e){var t=jq(e);return function(n){return Tt(n)?t(n):Xo(Ln)}},txe=kk,Lq=function(e){return kk(function(t,n){return e(n)})},nxe=Lq(Q),rxe={URI:cn,map:Ao,of:Xo,ap:is,chain:yu,bimap:Zb,mapLeft:Xb,alt:Ik,fromIO:vu,fromTask:Im,throwError:e1},ixe={URI:cn,map:Ao,of:Xo,ap:is,chain:yu,bimap:Zb,mapLeft:Xb,alt:Ik,fromIO:vu,fromTask:Im,throwError:e1},oxe=function(e,t){return _(e(t),dm(function(n){var r=n[0];return r}))},axe=function(e,t){return _(e(t),dm(function(n){n[0];var r=n[1];return r}))};function sxe(e,t,n){return e(t)(n)()}const lxe=Object.freeze(Object.defineProperty({__proto__:null,Alt:$we,Applicative:gwe,Apply:t1,Bifunctor:Rwe,Chain:Vr,FromEither:as,FromIO:n1,FromReader:op,FromState:bu,FromTask:r1,Functor:$k,Monad:xwe,MonadIO:_we,MonadTask:Twe,MonadThrow:Iwe,Pointed:hwe,URI:cn,alt:fwe,altW:xq,ap:Ek,apFirst:_q,apFirstW:Awe,apS:Fq,apSW:exe,apSecond:Tq,apSecondW:mwe,apW:uwe,ask:kwe,asks:Owe,asksStateReaderTaskEither:iwe,asksStateReaderTaskEitherW:Aq,bimap:lwe,bind:Mq,bindTo:Zwe,bindW:Xwe,chain:Rk,chainEitherK:$q,chainEitherKW:Bwe,chainFirst:Iq,chainFirstEitherK:kq,chainFirstEitherKW:Pwe,chainFirstIOK:zwe,chainFirstReaderK:Rq,chainFirstReaderKW:jwe,chainFirstTaskK:Ywe,chainFirstW:Ewe,chainIOEitherK:owe,chainIOEitherKW:gq,chainIOK:Vwe,chainOptionK:Uwe,chainReaderK:Eq,chainReaderKW:Fwe,chainReaderTaskEitherK:swe,chainReaderTaskEitherKW:Cq,chainStateK:wwe,chainTaskEitherK:awe,chainTaskEitherKW:yq,chainTaskK:Hwe,chainW:Em,evalState:oxe,evaluate:Gwe,execState:axe,execute:Jwe,filterOrElse:Oq,filterOrElseW:Nwe,flap:pwe,flatten:dwe,flattenW:wq,fromEither:uq,fromEitherK:Kwe,fromIO:vu,fromIOEither:hq,fromIOEitherK:mq,fromIOK:qwe,fromOption:Lwe,fromOptionK:Dwe,fromPredicate:Wwe,fromReader:dq,fromReaderEither:nwe,fromReaderK:Mwe,fromReaderTaskEither:ho,fromReaderTaskEitherK:bq,fromState:fq,fromStateK:Swe,fromTask:Im,fromTaskEither:pq,fromTaskEitherK:vq,fromTaskK:Qwe,get:vwe,gets:Cwe,left:_k,leftIO:XSe,leftReader:ZSe,leftState:twe,leftTask:JSe,local:rwe,map:Sq,mapLeft:cwe,modify:bwe,of:Xo,put:ywe,right:Tk,rightIO:cq,rightReader:lq,rightState:ewe,rightTask:sq,run:sxe,sequenceArray:nxe,stateReaderTaskEither:rxe,stateReaderTaskEitherSeq:ixe,throwError:e1,traverseArray:Lq,traverseArrayWithIndex:txe,traverseReadonlyArrayWithIndex:kk,traverseReadonlyNonEmptyArrayWithIndex:jq},Symbol.toStringTag,{value:"Module"}));function cxe(e){return function(t){return{peek:t.peek,pos:e}}}function uxe(e){return function(t){return{peek:t.peek,pos:e(t.pos)}}}function dxe(e){return function(t){return t.peek(e(t.pos))}}function fxe(e){return function(t){return function(n){return e.map(t(n.pos),function(r){return n.peek(r)})}}}var Dq=function(e,t){return _(e,Bq(t))},pxe=function(e,t){return _(e,Ok(t))},Ok=function(e){return function(t){return{peek:function(n){return e({peek:t.peek,pos:n})},pos:t.pos}}},Uq=function(e){return e.peek(e.pos)},hxe=Ok(Q),Bq=function(e){return function(t){return{peek:function(n){return e(t.peek(n))},pos:t.pos}}},Mk="Store",Pq={URI:Mk,map:Dq},Axe=He(Pq),Wq={URI:Mk,map:Dq,extend:pxe,extract:Uq},mxe=Wq;const gxe=Object.freeze(Object.defineProperty({__proto__:null,Comonad:Wq,Functor:Pq,URI:Mk,duplicate:hxe,experiment:fxe,extend:Ok,extract:Uq,flap:Axe,map:Bq,peeks:dxe,seek:cxe,seeks:uxe,store:mxe},Symbol.toStringTag,{value:"Module"}));function Fk(e,t){return function(n,r){return t.compose(e.second(r),e.first(n))}}function Nq(e,t){var n=Fk(e,t);return function(r,i){return t.compose(n(r,i),e.promap(t.id(),Q,function(o){return[o,o]}))}}function vxe(e){return Fk(e,e)}function yxe(e){return Nq(e,e)}const bxe=Object.freeze(Object.defineProperty({__proto__:null,fanOut:Nq,fanout:yxe,split:Fk,splitStrong:vxe},Symbol.toStringTag,{value:"Module"}));var Cxe=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},Sxe=function(e){return function(t){var n={};for(var r in t)yt.call(t,r)&&(n[r]=e[r](t[r]));return n}};const wxe=Object.freeze(Object.defineProperty({__proto__:null,evolve:Sxe,getAssignSemigroup:Cxe},Symbol.toStringTag,{value:"Module"}));var xxe=function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(e,t||[])).next())})},_xe=function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Kq=QA(Bn),Txe=zE(Bn),Ixe=ir,qq=QE(Bn),Rm=function(e){return i1(Cr(e))},i1=z0(Ke),Exe=dl(hf),Vq=HE(Ke),Rxe=Vq,jk=G0(Qf),$xe=jk,zq=jk,kxe=zq,Qq=J0(Cn),Oxe=Qq,Mxe=Q0(Bn),Hq=function(e){return function(){return xxe(void 0,void 0,void 0,function(){return _xe(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e().then(ye)];case 1:return[2,t.sent()];case 2:return t.sent(),[2,Re];case 3:return[2]}})})}},Fxe=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Hq(function(){return e.apply(void 0,t)})}},jxe=H0(Bn),Lxe=qE(Cn),Dxe=Y0(Bn),Uxe=VE(Cn),Lk=Z0(Ke),Yq=X0(au),ea=Kq,o1=Df(Cn),Bxe=o1(Q),Dk=eb(Cn),Pxe=Dk,a1=HA(Bn),Wxe=a1(),Uk=Ko(Ke,Wc),Bk=ja(Ke,Wc,uf),Gq=La(Ke,Ma),Jq=Da(Ke,Ma),Zq=al(Ke,Ma),Xq=sl(Ke,Ma),Bi=function(e,t){return _(e,Lk(t))},Cu=function(e,t){return _(e,Yq(t))},s1=function(e,t){return _(e,o1(t))},e7=function(e,t){return _(e,Dk(t))},Nxe=function(e,t){return _(e,Gq(t))},Kxe=function(e,t){return _(e,Jq(t))},qxe=function(e,t){return _(e,Zq(t))},Vxe=function(e,t){return _(e,Xq(t))},Sn="TaskOption",Pk={URI:Sn,map:Bi},zxe=He(Pk),t7={URI:Sn,of:ea},l1={URI:Sn,map:Bi,ap:Cu},Qxe=qt(l1),Hxe=Vt(l1),Yxe={URI:Sn,map:Bi,ap:Cu,of:ea},n7=function(e,t){return _(e,o1(function(n){return _(t,Lk(n))}))},Gxe={URI:Sn,map:Bi,ap:n7},Jxe={URI:Sn,map:Bi,ap:n7,of:ea},ss={URI:Sn,map:Bi,ap:Cu,chain:s1},Zxe=bt(ss),Xxe={URI:Sn,map:Bi,alt:e7},r7={URI:Sn,zero:a1},e_e=Jd(r7,t7),t_e={URI:Sn,map:Bi,ap:Cu,of:ea,alt:e7,zero:a1},n_e={URI:Sn,map:Bi,ap:Cu,of:ea,chain:s1},r_e={URI:Sn,map:Bi,ap:Cu,of:ea,chain:s1,fromIO:Rm},i_e={URI:Sn,map:Bi,ap:Cu,of:ea,chain:s1,fromIO:Rm,fromTask:i1},o_e={URI:Sn,compact:Uk,separate:Bk},a_e={URI:Sn,map:Bi,compact:Uk,separate:Bk,filter:Nxe,filterMap:Kxe,partition:qxe,partitionMap:Vxe},c1={URI:Sn,fromIO:Rm},s_e=Vo(c1),l_e=Ua(c1,ss),c_e=Ba(c1,ss),u1={URI:Sn,fromEither:qq},u_e=di(u1),d_e=Ra(u1,ss),f_e=$a(u1,ss),d1={URI:Sn,fromIO:Rm,fromTask:i1},p_e=eu(d1),h_e=kf(d1,ss),A_e=Of(d1,ss),m_e=ea(vn),g_e=Qt(Pk),v_e=Ht(ss),y_e=zt(l1),Wk=ea(Ln),i7=function(e){return X(Hf(e),dl(k0(Br)))},Nk=function(e){var t=i7(e);return function(n){return Tt(n)?t(n):Wk}},o7=function(e){return function(t){return function(){return Kd(t).reduce(function(n,r,i){return n.then(function(o){return tn(o)?n:e(i+1,r)().then(function(a){return tn(a)?a:(o.value.push(a.value),o)})})},e(0,ui(t))().then(No(Zh)))}}},Kk=function(e){var t=o7(e);return function(n){return Tt(n)?t(n):Wk}},b_e=Nk,a7=function(e){return Nk(function(t,n){return e(n)})},C_e=a7(Q),S_e=Kk,s7=function(e){return Kk(function(t,n){return e(n)})},w_e=s7(Q);const x_e=Object.freeze(Object.defineProperty({__proto__:null,Alt:Xxe,Alternative:t_e,ApT:Wk,ApplicativePar:Yxe,ApplicativeSeq:Jxe,ApplyPar:l1,ApplySeq:Gxe,Chain:ss,Compactable:o_e,Do:m_e,Filterable:a_e,FromEither:u1,FromIO:c1,FromTask:d1,Functor:Pk,Monad:n_e,MonadIO:r_e,MonadTask:i_e,Pointed:t7,Zero:r7,alt:Dk,altW:Pxe,ap:Yq,apFirst:Qxe,apS:y_e,apSecond:Hxe,bind:v_e,bindTo:g_e,chain:o1,chainEitherK:d_e,chainFirst:Zxe,chainFirstEitherK:f_e,chainFirstIOK:c_e,chainFirstTaskK:A_e,chainIOK:l_e,chainNullableK:Lxe,chainOptionK:Uxe,chainTaskK:h_e,compact:Uk,filter:Gq,filterMap:Jq,flap:zxe,flatten:Bxe,fold:$xe,foldW:kxe,fromEither:qq,fromEitherK:u_e,fromIO:Rm,fromIOK:s_e,fromNullable:Mxe,fromNullableK:jxe,fromOption:Ixe,fromOptionK:Dxe,fromPredicate:Txe,fromTask:i1,fromTaskEither:Exe,fromTaskK:p_e,getOrElse:Qq,getOrElseW:Oxe,guard:e_e,map:Lk,match:Vq,matchE:jk,matchEW:zq,matchW:Rxe,none:Wxe,of:ea,partition:Zq,partitionMap:Xq,separate:Bk,sequenceArray:C_e,sequenceSeqArray:w_e,some:Kq,traverseArray:a7,traverseArrayWithIndex:b_e,traverseReadonlyArrayWithIndex:Nk,traverseReadonlyArrayWithIndexSeq:Kk,traverseReadonlyNonEmptyArrayWithIndex:i7,traverseReadonlyNonEmptyArrayWithIndexSeq:o7,traverseSeqArray:s7,traverseSeqArrayWithIndex:S_e,tryCatch:Hq,tryCatchK:Fxe,zero:a1},Symbol.toStringTag,{value:"Module"}));var Xe=function(e){return e._tag==="Left"},Nt=function(e){return e._tag==="Right"};function mc(e){return e._tag==="Both"}function kn(e){return{_tag:"Left",left:e}}function zr(e){return{_tag:"Right",right:e}}function st(e,t){return{_tag:"Both",left:e,right:t}}var qk=function(e,t,n){return function(r){switch(r._tag){case"Left":return e(r.left);case"Right":return t(r.right);case"Both":return n(r.left,r.right)}}},__e=qk,Ws=qk,T_e=Ws,l7=Ws(zr,kn,function(e,t){return st(t,e)});function I_e(e,t){return{show:Ws(function(n){return"left(".concat(e.show(n),")")},function(n){return"right(".concat(t.show(n),")")},function(n,r){return"both(".concat(e.show(n),", ").concat(t.show(r),")")})}}function E_e(e,t){return ki(function(n,r){return Xe(n)?Xe(r)&&e.equals(n.left,r.left):Nt(n)?Nt(r)&&t.equals(n.right,r.right):mc(r)&&e.equals(n.left,r.left)&&t.equals(n.right,r.right)})}function c7(e,t){return{concat:function(n,r){return Xe(n)?Xe(r)?kn(e.concat(n.left,r.left)):Nt(r)?st(n.left,r.right):st(e.concat(n.left,r.left),r.right):Nt(n)?Xe(r)?st(r.left,n.right):Nt(r)?zr(t.concat(n.right,r.right)):st(r.left,t.concat(n.right,r.right)):Xe(r)?st(e.concat(n.left,r.left),n.right):Nt(r)?st(n.left,t.concat(n.right,r.right)):st(e.concat(n.left,r.left),t.concat(n.right,r.right))}}}var f1=function(e){return{URI:yi,_E:void 0,map:Su,ap:function(t,n){return Xe(t)?Xe(n)?kn(e.concat(t.left,n.left)):Nt(n)?kn(t.left):kn(e.concat(t.left,n.left)):Nt(t)?Xe(n)?kn(n.left):Nt(n)?zr(t.right(n.right)):st(n.left,t.right(n.right)):Xe(n)?kn(e.concat(t.left,n.left)):Nt(n)?st(t.left,t.right(n.right)):st(e.concat(t.left,n.left),t.right(n.right))}}};function R_e(e){var t=f1(e);return{URI:yi,_E:void 0,map:Su,ap:t.ap,of:$m}}function u7(e){var t=f1(e),n=function(r,i){if(Xe(r))return r;if(Nt(r))return i(r.right);var o=i(r.right);return Xe(o)?kn(e.concat(r.left,o.left)):Nt(o)?st(r.left,o.right):st(e.concat(r.left,o.left),o.right)};return{URI:yi,_E:void 0,map:Su,ap:t.ap,chain:n}}function $_e(e){var t=u7(e);return{URI:yi,_E:void 0,map:Su,of:$m,ap:t.ap,chain:t.chain,throwError:kn}}function k_e(e){return Xe(e)?ye(e.left):Nt(e)?Re:ye(e.left)}function O_e(e){return Xe(e)?Re:(Nt(e),ye(e.right))}function M_e(e){return function(t){return tn(t)?kn(e):st(e,t.value)}}function F_e(e){return function(t){return tn(t)?zr(e):st(t.value,e)}}function j_e(e){return Xe(e)?ye(e.left):Re}function L_e(e){return Nt(e)?ye(e.right):Re}var D_e=function(e,t){return tn(e)?tn(t)?Re:ye(zr(t.value)):tn(t)?ye(kn(e.value)):ye(st(e.value,t.value))},Su=function(e,t){return _(e,Gk(t))},d7=function(e,t,n){return _(e,Hk(t,n))},f7=function(e,t){return _(e,Yk(t))},Vk=function(e,t,n){return _(e,h7(t,n))},zk=function(e){var t=A7(e);return function(n,r){return _(n,t(r))}},Qk=function(e,t,n){return _(e,m7(t,n))},p7=function(e){var t=g7(e);return function(n,r){return _(n,t(r))}},Hk=function(e,t){return function(n){return Xe(n)?kn(e(n.left)):Nt(n)?zr(t(n.right)):st(e(n.left),t(n.right))}},Yk=function(e){return function(t){return Xe(t)?kn(e(t.left)):mc(t)?st(e(t.left),t.right):t}},Gk=function(e){return function(t){return Xe(t)?t:Nt(t)?zr(e(t.right)):st(t.left,e(t.right))}},h7=function(e,t){return function(n){return Xe(n)?e:t(e,n.right)}},A7=function(e){return function(t){return function(n){return Xe(n)?e.empty:t(n.right)}}},m7=function(e,t){return function(n){return Xe(n)?e:t(n.right,e)}},g7=function(e){return function(t){return function(n){return Xe(n)?e.of(n):Nt(n)?e.map(t(n.right),zr):e.map(t(n.right),function(r){return st(n.left,r)})}}},Jk=function(e){return function(t){return Xe(t)?e.of(t):Nt(t)?e.map(t.right,zr):e.map(t.right,function(n){return st(t.left,n)})}},$m=zr,yi="These",Zk={URI:yi,map:Su},U_e=He(Zk),B_e={URI:yi,of:$m},P_e={URI:yi,bimap:d7,mapLeft:f7},W_e={URI:yi,fromThese:Q},N_e={URI:yi,reduce:Vk,foldMap:zk,reduceRight:Qk},K_e={URI:yi,map:Su,reduce:Vk,foldMap:zk,reduceRight:Qk,traverse:p7,sequence:Jk},Xk={URI:yi,fromEither:Q},q_e=Bo(Xk),V_e=Po(Xk),z_e=function(e){return function(t){return function(n){return Xe(n)?!1:e.equals(t,n.right)}}},Q_e=function(e){return function(t){return Xe(t)?!1:e(t.right)}},eO=function(e,t){return function(n){return Xe(n)?[n.left,t()]:Nt(n)?[e(),n.right]:[n.left,n.right]}},H_e=function(e,t){return eO(function(){return e},function(){return t})},v7=$m(Ln),tO=function(e){return function(t){return function(n){var r=Re,i=t(0,ui(n));if(Xe(i))return i;mc(i)&&(r=ye(i.left));for(var o=[i.right],a=1;a<n.length;a++){var s=t(a,n[a]);if(Xe(s))return s;mc(s)&&(r=tn(r)?ye(s.left):ye(e.concat(r.value,s.left))),o.push(s.right)}return tn(r)?zr(o):st(r.value,o)}}},Y_e=function(e){return function(t){var n=tO(e)(t);return function(r){return Tt(r)?n(r):v7}}},G_e={URI:yi,map:Su,bimap:d7,mapLeft:f7,reduce:Vk,foldMap:zk,reduceRight:Qk,traverse:p7,sequence:Jk};const J_e=Object.freeze(Object.defineProperty({__proto__:null,ApT:v7,Bifunctor:P_e,Foldable:N_e,FromEither:Xk,FromThese:W_e,Functor:Zk,Pointed:B_e,Traversable:K_e,URI:yi,bimap:Hk,both:st,elem:z_e,exists:Q_e,flap:U_e,fold:T_e,foldMap:A7,foldW:__e,fromOption:q_e,fromOptionK:V_e,fromOptions:D_e,getApplicative:R_e,getApply:f1,getChain:u7,getEq:E_e,getLeft:k_e,getLeftOnly:j_e,getMonad:$_e,getRight:O_e,getRightOnly:L_e,getSemigroup:c7,getShow:I_e,isBoth:mc,isLeft:Xe,isRight:Nt,left:kn,leftOrBoth:M_e,map:Gk,mapLeft:Yk,match:Ws,matchW:qk,of:$m,reduce:h7,reduceRight:m7,right:zr,rightOrBoth:F_e,sequence:Jk,swap:l7,these:G_e,toTuple:H_e,toTuple2:eO,traverse:g7,traverseReadonlyArrayWithIndex:Y_e,traverseReadonlyNonEmptyArrayWithIndex:tO},Symbol.toStringTag,{value:"Module"}));function Iv(e){return X(zr,e.of)}function p1(e){return X(kn,e.of)}function nO(e){return X(st,e.of)}function rO(e){return function(t){return e.map(t,zr)}}function iO(e){return function(t){return e.map(t,kn)}}function oO(e){return qd(e,Zk)}function aO(e,t){return Ea(e,f1(t))}function sO(e,t){var n=p1(e);return function(r){return function(i){return e.chain(i,Ws(n,r,function(o,a){return e.map(r(a),Ws(function(s){return kn(t.concat(o,s))},function(s){return st(o,s)},function(s,l){return st(t.concat(o,s),l)}))}))}}}function lO(e){return function(t,n){return function(r){return e.map(r,Hk(t,n))}}}function cO(e){return function(t){return function(n){return e.map(n,Yk(t))}}}function y7(e){return function(t,n,r){return function(i){return e.map(i,Ws(t,n,r))}}}function uO(e){return function(t,n,r){return function(i){return e.chain(i,Ws(t,n,r))}}}function dO(e){return function(t){return e.map(t,l7)}}function fO(e){return function(t,n){return function(r){return e.map(r,eO(t,n))}}}function Z_e(e){var t=oO(e),n=lO(e),r=cO(e),i=uO(e),o=fO(e),a=Iv(e),s=function(l,c){return _(l,t(c))};return{map:s,bimap:function(l,c,u){return _(l,n(c,u))},mapLeft:function(l,c){return _(l,r(c))},fold:function(l,c,u,f){return _(l,i(c,u,f))},swap:dO(e),rightM:rO(e),leftM:iO(e),left:p1(e),right:Iv(e),both:nO(e),toTuple:function(l,c,u){return _(l,o(function(){return c},function(){return u}))},getMonad:function(l){var c=aO(e,l),u=sO(e,l);return{_E:void 0,map:s,of:a,ap:function(f,p){return _(f,c(p))},chain:function(f,p){return _(f,u(p))}}}}}const X_e=Object.freeze(Object.defineProperty({__proto__:null,ap:aO,bimap:lO,both:nO,chain:sO,getTheseM:Z_e,left:p1,leftF:iO,map:oO,mapLeft:cO,match:y7,matchE:uO,right:Iv,rightF:rO,swap:dO,toTuple2:fO},Symbol.toStringTag,{value:"Module"}));var eTe=p1(Bn),b7=Iv(Bn),tTe=nO(Bn),pO=rO(Ke),C7=iO(Ke),S7=X(Cr,pO),nTe=X(Cr,C7),w7=ir,x7=ir,h1=S7,rTe=Cr,hO=pO,_7=y7(Ke),iTe=_7,T7=uO(Cn),I7=T7,E7=I7,oTe=E7,aTe=dO(Ke),wu=function(e,t){return _(e,R7(t))},AO=function(e,t,n){return _(e,$7(t,n))},mO=function(e,t){return _(e,k7(t))},R7=oO(Ke),$7=lO(Ke),k7=cO(Ke),km=b7,xr="TaskThese",gO=function(e,t){var n=aO(e,t);return{URI:xr,_E:void 0,map:wu,ap:function(r,i){return _(r,n(i))}}};function O7(e,t){var n=gO(e,t).ap;return{URI:xr,_E:void 0,map:wu,ap:n,of:km}}function M7(e){var t=gO(om,e),n=sO(Cn,e);return{URI:xr,_E:void 0,map:wu,ap:t.ap,chain:function(r,i){return _(r,n(i))}}}function sTe(e){var t=O7(om,e),n=M7(e);return{URI:xr,_E:void 0,map:wu,ap:t.ap,of:km,chain:n.chain,fromIO:h1,fromTask:hO}}var F7={URI:xr,map:wu},lTe=He(F7),cTe={URI:xr,of:km},uTe={URI:xr,bimap:AO,mapLeft:mO},A1={URI:xr,fromEither:w7},dTe=Bo(A1),fTe=Po(A1),pTe=Ys(A1),j7={URI:xr,fromThese:x7},hTe=_3(j7),L7={URI:xr,fromIO:h1},ATe=Vo(L7),D7={URI:xr,fromIO:h1,fromTask:hO},mTe=eu(D7),U7=fO(Ke),vO=km(Ln),B7=function(e){var t=tO(e);return function(n){return X(Hf(n),dl(t(Br)))}},gTe=function(e){return function(t){var n=B7(e)(t);return function(r){return Tt(r)?n(r):vO}}},P7=function(e){return function(t){return function(n){return function(){return Kd(n).reduce(function(r,i,o){return r.then(function(a){return Xe(a)?r:t(o+1,i)().then(function(s){if(Xe(s))return s;if(mc(s)){var l=a.right;return l.push(s.right),mc(a)?st(e.concat(a.left,s.left),l):st(s.left,l)}return a.right.push(s.right),a})})},t(0,ui(n))().then(Gk(Zh)))}}}},vTe=function(e){return function(t){var n=P7(e)(t);return function(r){return Tt(r)?n(r):vO}}},yTe={URI:xr,map:wu},bTe={URI:xr,bimap:AO,mapLeft:mO},CTe=function(e,t){return U7(function(){return e},function(){return t})},STe={URI:xr,map:wu,bimap:AO,mapLeft:mO},wTe=function(e,t){return yn(gb)(c7(e,t))};const xTe=Object.freeze(Object.defineProperty({__proto__:null,ApT:vO,Bifunctor:uTe,FromEither:A1,FromIO:L7,FromTask:D7,FromThese:j7,Functor:F7,Pointed:cTe,URI:xr,bifunctorTaskThese:bTe,bimap:$7,both:tTe,flap:lTe,fold:I7,foldW:oTe,fromEither:w7,fromIO:h1,fromIOEither:rTe,fromIOK:ATe,fromOption:dTe,fromOptionK:fTe,fromPredicate:pTe,fromTask:hO,fromTaskK:mTe,fromThese:x7,fromTheseK:hTe,functorTaskThese:yTe,getApplicative:O7,getApply:gO,getChain:M7,getMonad:sTe,getSemigroup:wTe,left:eTe,leftIO:nTe,leftTask:C7,map:R7,mapLeft:k7,match:_7,matchE:T7,matchEW:E7,matchW:iTe,of:km,right:b7,rightIO:S7,rightTask:pO,swap:aTe,taskThese:STe,toTuple:CTe,toTuple2:U7,traverseReadonlyArrayWithIndex:gTe,traverseReadonlyArrayWithIndexSeq:vTe,traverseReadonlyNonEmptyArrayWithIndex:B7,traverseReadonlyNonEmptyArrayWithIndexSeq:P7},Symbol.toStringTag,{value:"Module"}));function _Te(e,t){return function(n){return n(t(n(e.empty)))}}function TTe(e){return function(t){return[e(t),t]}}function ITe(e){return function(t){return function(n){return[t(n),e(n)]}}}function ETe(e){return function(t){return function(n){return t(e(n))}}}function RTe(e){function t(r,i){return function(o){return i(function(a){return r(e.concat(o,a))})}}function n(r){return r(e.empty)}return{URI:yO,_E:void 0,map:W7,extend:t,extract:n}}var W7=function(e,t){return _(e,N7(t))},N7=function(e){return function(t){return function(n){return e(t(n))}}},yO="Traced",bO={URI:yO,map:W7},$Te=He(bO),kTe=bO;const OTe=Object.freeze(Object.defineProperty({__proto__:null,Functor:bO,URI:yO,censor:ETe,flap:$Te,getComonad:RTe,listen:TTe,listens:ITe,map:N7,traced:kTe,tracks:_Te},Symbol.toStringTag,{value:"Module"}));function K7(e,t){return function(n){var r=e.traverse(n),i=t.traverse(n);return function(o){return function(a){return r(a,function(s){return i(s,o)})}}}}function q7(e,t){return function(n){var r=e.sequence(n),i=t.sequence(n);return function(o){return r(e.map(o,i))}}}function MTe(e,t){var n=Vd(e,t).map,r=iE(e,t),i=K7(e,t),o=q7(e,t);return{map:n,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:function(a){var s=i(a);return function(l,c){return _(l,s(c))}},sequence:function(a){var s=o(a);return function(l){return _(l,s)}}}}const FTe=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:MTe,sequence:q7,traverse:K7},Symbol.toStringTag,{value:"Module"})),jTe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function V7(e,t){return t===void 0&&(t=[]),{value:e,forest:t}}function LTe(e){var t=function(n){return Ps(n.forest)?"make(".concat(e.show(n.value),")"):"make(".concat(e.show(n.value),", [").concat(n.forest.map(t).join(", "),"])")};return{show:t}}function DTe(e){var t,n=ki(function(r,i){return e.equals(r.value,i.value)&&t.equals(r.forest,i.forest)});return t=tN(n),n}var z7=function(e,t){for(var n="",r=t.length,i,o=0;o<r;o++){i=t[o];var a=o===r-1;n+=e+(a?"└":"├")+"─ "+i.value,n+=z7(e+(r>1&&!a?"│ ":" "),i.forest)}return n};function Q7(e){return z7(`
2
+ `,e)}function UTe(e){return e.value+Q7(e.forest)}function H7(e,t){var n=t(e),r=n[0],i=n[1];return{value:r,forest:Y7(i,t)}}function Y7(e,t){return e.map(function(n){return H7(n,t)})}function G7(e){var t=J7(e);return function(n,r){return e.chain(r(n),function(i){var o=i[0],a=i[1];return e.map(t(a,r),function(s){return{value:o,forest:s}})})}}function J7(e){var t=b0(e);return function(n,r){return _(n,t(function(i){return G7(e)(i,r)}))}}function BTe(e){var t=function(n){return e(n.value,n.forest.map(t))};return t}var Cl=function(e,t){return _(e,g1(t))},ap=function(e,t){return _(e,Om(function(n){return _(t,g1(n))}))},CO=function(e,t){return _(e,Om(t))},SO=function(e,t,n){return _(e,v1(t,n))},wO=function(e){var t=eV(e);return function(n,r){return _(n,t(r))}},xO=function(e,t,n){return _(e,_O(t,n))},Z7=function(e,t){return _(e,m1(t))},X7=function(e){var t=IO(e);return function(n,r){return _(n,t(r))}},PTe=function(e){return function(t){return ap(t,e)}},Om=function(e){return function(t){var n=e(t.value),r=n.value,i=n.forest,o=bI().concat;return{value:r,forest:o(i,t.forest.map(Om(e)))}}},m1=function(e){return function(t){return{value:e(t),forest:t.forest.map(m1(e))}}},WTe=m1(Q),NTe=Om(Q),g1=function(e){return function(t){return{value:e(t.value),forest:t.forest.map(g1(e))}}},v1=function(e,t){return function(n){for(var r=t(e,n.value),i=n.forest.length,o=0;o<i;o++)r=_(n.forest[o],v1(r,t));return r}},eV=function(e){return function(t){return v1(e.empty,function(n,r){return e.concat(n,t(r))})}},_O=function(e,t){return function(n){for(var r=e,i=n.forest.length,o=i-1;o>=0;o--)r=_(n.forest[o],_O(r,t));return t(n.value,r)}},TO=function(e){return e.value},IO=function(e){var t=b0(e),n=function(r){return function(i){return e.ap(e.map(r(i.value),function(o){return function(a){return{value:o,forest:a}}}),_(i.forest,t(n(r))))}};return n},EO=function(e){return IO(e)(Q)},sp=function(e){return V7(e)},mo="Tree",RO={URI:mo,map:Cl},KTe=He(RO),qTe={URI:mo,of:sp},y1={URI:mo,map:Cl,ap},VTe=qt(y1),zTe=Vt(y1),QTe={URI:mo,map:Cl,ap,of:sp},$O={URI:mo,map:Cl,ap,chain:CO},HTe={URI:mo,map:Cl,ap,of:sp,chain:CO},YTe=bt($O),GTe={URI:mo,reduce:SO,foldMap:wO,reduceRight:xO},JTe={URI:mo,map:Cl,reduce:SO,foldMap:wO,reduceRight:xO,traverse:X7,sequence:EO},ZTe={URI:mo,map:Cl,extend:Z7,extract:TO},XTe=sp(vn),eIe=Qt(RO),tIe=Ht($O),nIe=zt(y1);function rIe(e){var t=function(n,r){return e.equals(n,r.value)||r.forest.some(function(i){return t(n,i)})};return t}var tV=function(e){return function(t){return e(t.value)||t.forest.some(tV(e))}},iIe={URI:mo,map:Cl,of:sp,ap,chain:CO,reduce:SO,foldMap:wO,reduceRight:xO,traverse:X7,sequence:EO,extract:TO,extend:Z7};const oIe=Object.freeze(Object.defineProperty({__proto__:null,Applicative:QTe,Apply:y1,Chain:$O,Comonad:ZTe,Do:XTe,Foldable:GTe,Functor:RO,Monad:HTe,Pointed:qTe,Traversable:JTe,URI:mo,ap:PTe,apFirst:VTe,apS:nIe,apSecond:zTe,bind:tIe,bindTo:eIe,chain:Om,chainFirst:YTe,drawForest:Q7,drawTree:UTe,duplicate:WTe,elem:rIe,exists:tV,extend:m1,extract:TO,flap:KTe,flatten:NTe,fold:BTe,foldMap:eV,getEq:DTe,getShow:LTe,make:V7,map:g1,of:sp,reduce:v1,reduceRight:_O,sequence:EO,traverse:IO,tree:iIe,unfoldForest:Y7,unfoldForestM:J7,unfoldTree:H7,unfoldTreeM:G7},Symbol.toStringTag,{value:"Module"}));var ai=mn,Lr=tr,aIe=function(e){return[Lr(e),ai(e)]};function kO(e){return{URI:bi,_E:void 0,map:Mm,ap:function(t,n){return[ai(t)(ai(n)),e.concat(Lr(t),Lr(n))]}}}var nV=function(e){return function(t){return[t,e.empty]}};function sIe(e){var t=kO(e);return{URI:bi,_E:void 0,map:t.map,ap:t.ap,of:nV(e)}}function OO(e){var t=kO(e);return{URI:bi,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(ai(n)),o=i[0],a=i[1];return[o,e.concat(Lr(n),a)]}}}function lIe(e){var t=OO(e);return{URI:bi,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:nV(e)}}function cIe(e){var t=function(r,i){for(var o=i(r),a=e.empty,s=ai(o);s._tag==="Left";)a=e.concat(a,Lr(o)),o=i(s.left),s=ai(o);return[s.right,e.concat(a,Lr(o))]},n=OO(e);return{URI:bi,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var rV=function(e,t){return _(e,cV(t))},Mm=function(e,t){return _(e,LO(t))},iV=function(e,t,n){return _(e,lV(t,n))},oV=function(e,t){return _(e,DO(t))},aV=function(e,t){return _(e,UO(t))},MO=function(e,t,n){return _(e,dV(t,n))},FO=function(e){var t=uV();return function(n,r){return _(n,t(r))}},jO=function(e,t,n){return _(e,fV(t,n))};function sV(e){var t=pV(e);return function(n,r){return _(n,t(r))}}var lV=function(e,t){return function(n){return[t(ai(n)),e(Lr(n))]}},LO=function(e){return function(t){return[e(ai(t)),Lr(t)]}},DO=function(e){return function(t){return[ai(t),e(Lr(t))]}},cV=function(e){return function(t){return[ai(t),Lr(e)]}},UO=function(e){return function(t){return[e(t),Lr(t)]}},uIe=UO(Q),BO=Jb,uV=ik,dV=rk,fV=ok,pV=function(e){return function(t){return function(n){return e.map(t(ai(n)),function(r){return[r,Lr(n)]})}}},PO=function(e){return function(t){return e.map(ai(t),function(n){return[n,Lr(t)]})}},bi="Tuple",hV={URI:bi,map:Mm},dIe=He(hV),fIe={URI:bi,bimap:iV,mapLeft:oV},pIe={URI:bi,compose:rV},hIe={URI:bi,map:Mm,extend:aV,extract:BO},AIe={URI:bi,reduce:MO,foldMap:FO,reduceRight:jO},mIe={URI:bi,map:Mm,reduce:MO,foldMap:FO,reduceRight:jO,traverse:sV,sequence:PO},gIe=LO,vIe=DO,yIe={URI:bi,compose:rV,map:Mm,bimap:iV,mapLeft:oV,extract:BO,extend:aV,reduce:MO,foldMap:FO,reduceRight:jO,traverse:sV,sequence:PO};const bIe=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:fIe,Comonad:hIe,Foldable:AIe,Functor:hV,Semigroupoid:pIe,Traversable:mIe,URI:bi,bimap:lV,compose:cV,duplicate:uIe,extend:UO,extract:BO,flap:dIe,foldMap:uV,fst:ai,getApplicative:sIe,getApply:kO,getChain:OO,getChainRec:cIe,getMonad:lIe,map:gIe,mapFst:LO,mapLeft:vIe,mapSnd:DO,reduce:dV,reduceRight:fV,sequence:PO,snd:Lr,swap:aIe,traverse:pV,tuple:yIe},Symbol.toStringTag,{value:"Module"})),CIe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function SIe(e,t){var n=KU(t,rl(e));return{map:n.map,ap:n.ap,of:n.of,chain:function(r,i){return t.chain(r,function(o){return An(o)?t.of(Sa(o.left)):i(o.right)})},alt:function(r,i){return t.chain(r,function(o){return y_(o)?t.of(o):t.map(i(),function(a){return An(a)?Sa(e.concat(o.left,a.left)):a})})}}}const wIe=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:SIe},Symbol.toStringTag,{value:"Module"}));var AV=x_(void 0),xIe={concat:AV.concat,empty:void 0};const _Ie=Object.freeze(Object.defineProperty({__proto__:null,Monoid:xIe,Semigroup:AV},Symbol.toStringTag,{value:"Module"}));var TIe=function(e){return function(){return[void 0,e]}},IIe=function(e){return function(){var t=e(),n=t[0],r=t[1];return[[n,r],r]}},EIe=function(e){return function(){var t=e(),n=t[0],r=n[0],i=n[1],o=t[1];return[r,i(o)]}},RIe=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,e(i)],i]}}},$Ie=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[r,e(i)]}}},Fm=function(e,t){return _(e,mV(t))},mV=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[e(r),i]}}},xu="Writer",gV=function(e){return{URI:xu,_E:void 0,of:function(t){return function(){return[t,e.empty]}}}},WO=function(e){return{URI:xu,_E:void 0,map:Fm,ap:function(t,n){return function(){var r=t(),i=r[0],o=r[1],a=n(),s=a[0],l=a[1];return[i(s),e.concat(o,l)]}}}},vV=function(e){var t=WO(e),n=gV(e);return{URI:xu,_E:void 0,map:Fm,ap:t.ap,of:n.of}};function yV(e){var t=WO(e);return{URI:xu,_E:void 0,map:Fm,ap:t.ap,chain:function(n,r){return function(){var i=n(),o=i[0],a=i[1],s=r(o)(),l=s[0],c=s[1];return[l,e.concat(a,c)]}}}}function kIe(e){var t=vV(e),n=yV(e);return{URI:xu,_E:void 0,map:Fm,ap:t.ap,of:t.of,chain:n.chain}}var NO={URI:xu,map:Fm},OIe=He(NO),MIe=function(e){return e()[0]},FIe=function(e){return e()[1]},jIe=function(e){return e()[0]},LIe=function(e){return e()[1]},DIe=NO;const UIe=Object.freeze(Object.defineProperty({__proto__:null,Functor:NO,URI:xu,censor:$Ie,evalWriter:jIe,evaluate:MIe,execWriter:LIe,execute:FIe,flap:OIe,getApplicative:vV,getApply:WO,getChain:yV,getMonad:kIe,getPointed:gV,listen:IIe,listens:RIe,map:mV,pass:EIe,tell:TIe,writer:DIe},Symbol.toStringTag,{value:"Module"}));function BIe(e){var t=function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[r(o),a]})}};return{map:t,evalWriter:function(n){return e.map(n(),function(r){var i=r[0];return i})},execWriter:function(n){return e.map(n(),function(r){r[0];var i=r[1];return i})},tell:function(n){return function(){return e.of([void 0,n])}},listen:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=r[1];return[[i,o],o]})}},pass:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=i[0],a=i[1],s=r[1];return[o,a(s)]})}},listens:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[[o,r(a)],a]})}},censor:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[o,r(a)]})}},getMonad:function(n){return{_E:void 0,map:t,of:function(r){return function(){return e.of([r,n.empty])}},ap:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],s=o[1];return e.map(i(),function(l){var c=l[0],u=l[1];return[a(c),n.concat(s,u)]})})}},chain:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],s=o[1];return e.map(i(a)(),function(l){var c=l[0],u=l[1];return[c,n.concat(s,u)]})})}}}}}}const PIe=Object.freeze(Object.defineProperty({__proto__:null,getWriterM:BIe},Symbol.toStringTag,{value:"Module"})),WIe=Object.freeze(Object.defineProperty({__proto__:null,alt:Gte,alternative:Zte,applicative:mne,apply:hne,array:ule,bifunctor:dle,boolean:yle,booleanAlgebra:xle,bounded:Ele,boundedDistributiveLattice:kle,boundedJoinSemilattice:Ole,boundedLattice:Mle,boundedMeetSemilattice:Fle,category:jle,chain:gne,chainRec:Lle,choice:Ble,comonad:Ple,compactable:kce,console:Lce,const:Jce,contravariant:Zce,date:aue,distributiveLattice:Rle,either:DK,eitherT:Hue,endomorphism:Gue,eq:$ne,extend:Jue,field:ede,filterable:nde,filterableWithIndex:rde,foldable:cde,foldableWithIndex:dde,fromEither:vne,fromIO:fde,fromReader:Fde,fromState:efe,fromTask:tfe,fromThese:nfe,function:NU,functor:Ane,functorWithIndex:ife,group:ofe,heytingAlgebra:afe,hkt:sfe,identity:Rfe,invariant:$fe,io:Yfe,ioEither:Ype,ioOption:Nhe,ioRef:qhe,joinSemilattice:Vhe,json:Hhe,lattice:Yhe,magma:Hne,map:ime,meetSemilattice:ome,monad:ame,monadIO:sme,monadTask:lme,monadThrow:cme,monoid:Sme,naturalTransformation:wme,nonEmptyArray:Uie,number:Vie,option:Rce,optionT:Jpe,ord:qne,ordering:$me,pipeable:Hme,pointed:Yme,predicate:Vle,profunctor:Gme,random:ege,reader:Mde,readerEither:Gge,readerT:Xge,readerTask:sye,readerTaskEither:Fbe,readonlyArray:_ae,readonlyMap:SAe,readonlyNonEmptyArray:zre,readonlyRecord:_1e,readonlySet:N1e,readonlyTuple:rCe,record:iSe,refinement:pSe,ring:gSe,semigroup:pB,semigroupoid:vSe,semiring:bSe,separated:Jie,set:NSe,show:HSe,state:Xde,stateReaderTaskEither:lxe,stateT:GSe,store:gxe,string:Jbe,strong:bxe,struct:wxe,task:_ve,taskEither:g0e,taskOption:x_e,taskThese:xTe,these:J_e,theseT:X_e,traced:OTe,traversable:FTe,traversableWithIndex:jTe,tree:oIe,tuple:bIe,unfoldable:CIe,validationT:wIe,void:_Ie,witherable:Zie,writer:UIe,writerT:PIe,zero:Xie},Symbol.toStringTag,{value:"Module"})),lt=Mc(WIe);var un={},Sd={},Rn={},Ye={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getEndomorphismMonoid=e.not=e.SK=e.hole=e.pipe=e.untupled=e.tupled=e.absurd=e.decrement=e.increment=e.tuple=e.flow=e.flip=e.constVoid=e.constUndefined=e.constNull=e.constFalse=e.constTrue=e.constant=e.unsafeCoerce=e.identity=e.apply=e.getRing=e.getSemiring=e.getMonoid=e.getSemigroup=e.getBooleanAlgebra=void 0;var t=function(S){return function(){return{meet:function(w,T){return function(E){return S.meet(w(E),T(E))}},join:function(w,T){return function(E){return S.join(w(E),T(E))}},zero:function(){return S.zero},one:function(){return S.one},implies:function(w,T){return function(E){return S.implies(w(E),T(E))}},not:function(w){return function(T){return S.not(w(T))}}}}};e.getBooleanAlgebra=t;var n=function(S){return function(){return{concat:function(w,T){return function(E){return S.concat(w(E),T(E))}}}}};e.getSemigroup=n;var r=function(S){var w=(0,e.getSemigroup)(S);return function(){return{concat:w().concat,empty:function(){return S.empty}}}};e.getMonoid=r;var i=function(S){return{add:function(w,T){return function(E){return S.add(w(E),T(E))}},zero:function(){return S.zero},mul:function(w,T){return function(E){return S.mul(w(E),T(E))}},one:function(){return S.one}}};e.getSemiring=i;var o=function(S){var w=(0,e.getSemiring)(S);return{add:w.add,mul:w.mul,one:w.one,zero:w.zero,sub:function(T,E){return function(R){return S.sub(T(R),E(R))}}}};e.getRing=o;var a=function(S){return function(w){return w(S)}};e.apply=a;function s(S){return S}e.identity=s,e.unsafeCoerce=s;function l(S){return function(){return S}}e.constant=l,e.constTrue=l(!0),e.constFalse=l(!1),e.constNull=l(null),e.constUndefined=l(void 0),e.constVoid=e.constUndefined;function c(S){return function(w,T){return S(T,w)}}e.flip=c;function u(S,w,T,E,R,O,k,B,K){switch(arguments.length){case 1:return S;case 2:return function(){return w(S.apply(this,arguments))};case 3:return function(){return T(w(S.apply(this,arguments)))};case 4:return function(){return E(T(w(S.apply(this,arguments))))};case 5:return function(){return R(E(T(w(S.apply(this,arguments)))))};case 6:return function(){return O(R(E(T(w(S.apply(this,arguments))))))};case 7:return function(){return k(O(R(E(T(w(S.apply(this,arguments)))))))};case 8:return function(){return B(k(O(R(E(T(w(S.apply(this,arguments))))))))};case 9:return function(){return K(B(k(O(R(E(T(w(S.apply(this,arguments)))))))))}}}e.flow=u;function f(){for(var S=[],w=0;w<arguments.length;w++)S[w]=arguments[w];return S}e.tuple=f;function p(S){return S+1}e.increment=p;function h(S){return S-1}e.decrement=h;function m(S){throw new Error("Called `absurd` function which should be uncallable")}e.absurd=m;function g(S){return function(w){return S.apply(void 0,w)}}e.tupled=g;function y(S){return function(){for(var w=[],T=0;T<arguments.length;T++)w[T]=arguments[T];return S(w)}}e.untupled=y;function C(S,w,T,E,R,O,k,B,K){switch(arguments.length){case 1:return S;case 2:return w(S);case 3:return T(w(S));case 4:return E(T(w(S)));case 5:return R(E(T(w(S))));case 6:return O(R(E(T(w(S)))));case 7:return k(O(R(E(T(w(S))))));case 8:return B(k(O(R(E(T(w(S)))))));case 9:return K(B(k(O(R(E(T(w(S))))))));default:{for(var H=arguments[0],z=1;z<arguments.length;z++)H=arguments[z](H);return H}}}e.pipe=C,e.hole=m;var x=function(S,w){return w};e.SK=x;function b(S){return function(w){return!S(w)}}e.not=b;var v=function(){return{concat:function(S,w){return u(S,w)},empty:s}};e.getEndomorphismMonoid=v})(Ye);var Ne={},NIe=Se&&Se.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.fromReadonlyNonEmptyArray=Ne.has=Ne.emptyRecord=Ne.emptyReadonlyArray=Ne.tail=Ne.head=Ne.isNonEmpty=Ne.singleton=Ne.right=Ne.left=Ne.isRight=Ne.isLeft=Ne.some=Ne.none=Ne.isSome=Ne.isNone=void 0;var KIe=function(e){return e._tag==="None"};Ne.isNone=KIe;var qIe=function(e){return e._tag==="Some"};Ne.isSome=qIe;Ne.none={_tag:"None"};var VIe=function(e){return{_tag:"Some",value:e}};Ne.some=VIe;var zIe=function(e){return e._tag==="Left"};Ne.isLeft=zIe;var QIe=function(e){return e._tag==="Right"};Ne.isRight=QIe;var HIe=function(e){return{_tag:"Left",left:e}};Ne.left=HIe;var YIe=function(e){return{_tag:"Right",right:e}};Ne.right=YIe;var GIe=function(e){return[e]};Ne.singleton=GIe;var JIe=function(e){return e.length>0};Ne.isNonEmpty=JIe;var ZIe=function(e){return e[0]};Ne.head=ZIe;var XIe=function(e){return e.slice(1)};Ne.tail=XIe;Ne.emptyReadonlyArray=[];Ne.emptyRecord={};Ne.has=Object.prototype.hasOwnProperty;var eEe=function(e){return NIe([e[0]],e.slice(1),!0)};Ne.fromReadonlyNonEmptyArray=eEe;var tEe=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),nEe=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),rEe=Se&&Se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&tEe(t,e,n);return nEe(t,e),t};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.sequenceS=Rn.sequenceT=Rn.getApplySemigroup=Rn.apS=Rn.apSecond=Rn.apFirst=Rn.ap=void 0;var iEe=Ye,oEe=rEe(Ne);function aEe(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}Rn.ap=aEe;function sEe(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}Rn.apFirst=sEe;function lEe(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}Rn.apSecond=lEe;function cEe(e){return function(t,n){return function(r){return e.ap(e.map(r,function(i){return function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))}}),n)}}}Rn.apS=cEe;function uEe(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}Rn.getApplySemigroup=uEe;function KO(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):KO(e,t-1,i)}}var QC={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};function dEe(e){return oEe.has.call(QC,e)||(QC[e]=KO(iEe.tuple,e-1,[])),QC[e]}function fEe(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=dEe(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}Rn.sequenceT=fEe;function pEe(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var s;return s={},s[e[0]]=n,s[e[1]]=r,s[e[2]]=i,s[e[3]]=o,s[e[4]]=a,s}}}}};default:return KO(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function hEe(e){return function(t){for(var n=Object.keys(t),r=n.length,i=pEe(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}Rn.sequenceS=hEe;var wi={};Object.defineProperty(wi,"__esModule",{value:!0});wi.getFunctorComposition=wi.bindTo=wi.flap=wi.map=void 0;var AEe=Ye;function bV(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}wi.map=bV;function mEe(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}wi.flap=mEe;function gEe(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}wi.bindTo=gEe;function vEe(e,t){var n=bV(e,t);return{map:function(r,i){return(0,AEe.pipe)(r,n(i))}}}wi.getFunctorComposition=vEe;Object.defineProperty(Sd,"__esModule",{value:!0});Sd.getApplicativeComposition=Sd.getApplicativeMonoid=void 0;var CV=Rn,yEe=Ye,bEe=wi;function CEe(e){var t=(0,CV.getApplySemigroup)(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}Sd.getApplicativeMonoid=CEe;function SEe(e,t){var n=(0,bEe.getFunctorComposition)(e,t).map,r=(0,CV.ap)(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return(0,yEe.pipe)(i,r(o))}}}Sd.getApplicativeComposition=SEe;var gc={};Object.defineProperty(gc,"__esModule",{value:!0});gc.bind=gc.chainFirst=void 0;function wEe(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}gc.chainFirst=wEe;function xEe(e){return function(t,n){return function(r){return e.chain(r,function(i){return e.map(n(i),function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))})})}}}gc.bind=xEe;var b1={};Object.defineProperty(b1,"__esModule",{value:!0});b1.tailRec=void 0;var _Ee=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};b1.tailRec=_Ee;var fn={},TEe=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),IEe=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),EEe=Se&&Se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&TEe(t,e,n);return IEe(t,e),t};Object.defineProperty(fn,"__esModule",{value:!0});fn.filterOrElse=fn.chainFirstEitherK=fn.chainEitherK=fn.fromEitherK=fn.chainOptionK=fn.fromOptionK=fn.fromPredicate=fn.fromOption=void 0;var REe=gc,qO=Ye,Jl=EEe(Ne);function SV(e){return function(t){return function(n){return e.fromEither(Jl.isNone(n)?Jl.left(t()):Jl.right(n.value))}}}fn.fromOption=SV;function $Ee(e){return function(t,n){return function(r){return e.fromEither(t(r)?Jl.right(r):Jl.left(n(r)))}}}fn.fromPredicate=$Ee;function wV(e){var t=SV(e);return function(n){var r=t(n);return function(i){return(0,qO.flow)(i,r)}}}fn.fromOptionK=wV;function kEe(e,t){var n=wV(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}fn.chainOptionK=kEe;function VO(e){return function(t){return(0,qO.flow)(t,e.fromEither)}}fn.fromEitherK=VO;function OEe(e,t){var n=VO(e);return function(r){return function(i){return t.chain(i,n(r))}}}fn.chainEitherK=OEe;function MEe(e,t){return(0,qO.flow)(VO(e),(0,REe.chainFirst)(t))}fn.chainFirstEitherK=MEe;function FEe(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Jl.right(o):Jl.left(r(o)))})}}}fn.filterOrElse=FEe;var xV={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.right=e.left=e.flap=e.Functor=e.Bifunctor=e.URI=e.bimap=e.mapLeft=e.map=e.separated=void 0;var t=Ye,n=wi,r=function(p,h){return{left:p,right:h}};e.separated=r;var i=function(p,h){return(0,t.pipe)(p,(0,e.map)(h))},o=function(p,h){return(0,t.pipe)(p,(0,e.mapLeft)(h))},a=function(p,h,m){return(0,t.pipe)(p,(0,e.bimap)(h,m))},s=function(p){return function(h){return(0,e.separated)((0,e.left)(h),p((0,e.right)(h)))}};e.map=s;var l=function(p){return function(h){return(0,e.separated)(p((0,e.left)(h)),(0,e.right)(h))}};e.mapLeft=l;var c=function(p,h){return function(m){return(0,e.separated)(p((0,e.left)(m)),h((0,e.right)(m)))}};e.bimap=c,e.URI="Separated",e.Bifunctor={URI:e.URI,mapLeft:o,bimap:a},e.Functor={URI:e.URI,map:i},e.flap=(0,n.flap)(e.Functor);var u=function(p){return p.left};e.left=u;var f=function(p){return p.right};e.right=f})(xV);var Os={},jEe=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),LEe=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),DEe=Se&&Se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&jEe(t,e,n);return LEe(t,e),t};Object.defineProperty(Os,"__esModule",{value:!0});Os.filterE=Os.witherDefault=Os.wiltDefault=void 0;var Sj=DEe(Ne);function UEe(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}Os.wiltDefault=UEe;function BEe(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}Os.witherDefault=BEe;function PEe(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(o){return t.map(r(o),function(a){return a?Sj.some(o):Sj.none})})}}}}Os.filterE=PEe;(function(e){var t=Se&&Se.__createBinding||(Object.create?function(D,L,U,ue){ue===void 0&&(ue=U);var j=Object.getOwnPropertyDescriptor(L,U);(!j||("get"in j?!L.__esModule:j.writable||j.configurable))&&(j={enumerable:!0,get:function(){return L[U]}}),Object.defineProperty(D,ue,j)}:function(D,L,U,ue){ue===void 0&&(ue=U),D[ue]=L[U]}),n=Se&&Se.__setModuleDefault||(Object.create?function(D,L){Object.defineProperty(D,"default",{enumerable:!0,value:L})}:function(D,L){D.default=L}),r=Se&&Se.__importStar||function(D){if(D&&D.__esModule)return D;var L={};if(D!=null)for(var U in D)U!=="default"&&Object.prototype.hasOwnProperty.call(D,U)&&t(L,D,U);return n(L,D),L};Object.defineProperty(e,"__esModule",{value:!0}),e.fold=e.match=e.foldW=e.matchW=e.isRight=e.isLeft=e.fromOption=e.fromPredicate=e.FromEither=e.MonadThrow=e.throwError=e.ChainRec=e.Extend=e.extend=e.Alt=e.alt=e.altW=e.Bifunctor=e.mapLeft=e.bimap=e.Traversable=e.sequence=e.traverse=e.Foldable=e.reduceRight=e.foldMap=e.reduce=e.Monad=e.Chain=e.chain=e.chainW=e.Applicative=e.Apply=e.ap=e.apW=e.Pointed=e.of=e.Functor=e.map=e.getAltValidation=e.getApplicativeValidation=e.getWitherable=e.getFilterable=e.getCompactable=e.getSemigroup=e.getEq=e.getShow=e.URI=e.right=e.left=void 0,e.getValidation=e.getValidationMonoid=e.getValidationSemigroup=e.getApplyMonoid=e.getApplySemigroup=e.either=e.stringifyJSON=e.parseJSON=e.sequenceArray=e.traverseArray=e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex=e.traverseReadonlyNonEmptyArrayWithIndex=e.ApT=e.apSW=e.apS=e.bindW=e.bind=e.bindTo=e.Do=e.exists=e.elem=e.toError=e.toUnion=e.chainNullableK=e.fromNullableK=e.tryCatchK=e.tryCatch=e.fromNullable=e.orElse=e.orElseW=e.swap=e.filterOrElseW=e.filterOrElse=e.chainOptionK=e.fromOptionK=e.duplicate=e.flatten=e.flattenW=e.chainFirstW=e.chainFirst=e.apSecondW=e.apSecond=e.apFirstW=e.apFirst=e.flap=e.getOrElse=e.getOrElseW=void 0;var i=Sd,o=Rn,a=gc,s=b1,l=fn,c=Ye,u=wi,f=r(Ne),p=xV,h=Os;e.left=f.left,e.right=f.right;var m=function(D,L){return(0,c.pipe)(D,(0,e.map)(L))},g=function(D,L){return(0,c.pipe)(D,(0,e.ap)(L))},y=function(D,L){return(0,c.pipe)(D,(0,e.chain)(L))},C=function(D,L,U){return(0,c.pipe)(D,(0,e.reduce)(L,U))},x=function(D){return function(L,U){var ue=(0,e.foldMap)(D);return(0,c.pipe)(L,ue(U))}},b=function(D,L,U){return(0,c.pipe)(D,(0,e.reduceRight)(L,U))},v=function(D){var L=(0,e.traverse)(D);return function(U,ue){return(0,c.pipe)(U,L(ue))}},S=function(D,L,U){return(0,c.pipe)(D,(0,e.bimap)(L,U))},w=function(D,L){return(0,c.pipe)(D,(0,e.mapLeft)(L))},T=function(D,L){return(0,c.pipe)(D,(0,e.alt)(L))},E=function(D,L){return(0,c.pipe)(D,(0,e.extend)(L))},R=function(D,L){return(0,s.tailRec)(L(D),function(U){return(0,e.isLeft)(U)?(0,e.right)((0,e.left)(U.left)):(0,e.isLeft)(U.right)?(0,e.left)(L(U.right.left)):(0,e.right)((0,e.right)(U.right.right))})};e.URI="Either";var O=function(D,L){return{show:function(U){return(0,e.isLeft)(U)?"left(".concat(D.show(U.left),")"):"right(".concat(L.show(U.right),")")}}};e.getShow=O;var k=function(D,L){return{equals:function(U,ue){return U===ue||((0,e.isLeft)(U)?(0,e.isLeft)(ue)&&D.equals(U.left,ue.left):(0,e.isRight)(ue)&&L.equals(U.right,ue.right))}}};e.getEq=k;var B=function(D){return{concat:function(L,U){return(0,e.isLeft)(U)?L:(0,e.isLeft)(L)?U:(0,e.right)(D.concat(L.right,U.right))}}};e.getSemigroup=B;var K=function(D){var L=(0,e.left)(D.empty);return{URI:e.URI,_E:void 0,compact:function(U){return(0,e.isLeft)(U)?U:U.right._tag==="None"?L:(0,e.right)(U.right.value)},separate:function(U){return(0,e.isLeft)(U)?(0,p.separated)(U,U):(0,e.isLeft)(U.right)?(0,p.separated)((0,e.right)(U.right.left),L):(0,p.separated)(L,(0,e.right)(U.right.right))}}};e.getCompactable=K;var H=function(D){var L=(0,e.left)(D.empty),U=(0,e.getCompactable)(D),ue=U.compact,j=U.separate,te=function(le,be){return(0,e.isLeft)(le)||be(le.right)?le:L},pe=function(le,be){return(0,e.isLeft)(le)?(0,p.separated)(le,le):be(le.right)?(0,p.separated)(L,(0,e.right)(le.right)):(0,p.separated)((0,e.right)(le.right),L)};return{URI:e.URI,_E:void 0,map:m,compact:ue,separate:j,filter:te,filterMap:function(le,be){if((0,e.isLeft)(le))return le;var ot=be(le.right);return ot._tag==="None"?L:(0,e.right)(ot.value)},partition:pe,partitionMap:function(le,be){if((0,e.isLeft)(le))return(0,p.separated)(le,le);var ot=be(le.right);return(0,e.isLeft)(ot)?(0,p.separated)((0,e.right)(ot.left),L):(0,p.separated)(L,(0,e.right)(ot.right))}}};e.getFilterable=H;var z=function(D){var L=(0,e.getFilterable)(D),U=(0,e.getCompactable)(D);return{URI:e.URI,_E:void 0,map:m,compact:L.compact,separate:L.separate,filter:L.filter,filterMap:L.filterMap,partition:L.partition,partitionMap:L.partitionMap,traverse:v,sequence:e.sequence,reduce:C,foldMap:x,reduceRight:b,wither:(0,h.witherDefault)(e.Traversable,U),wilt:(0,h.wiltDefault)(e.Traversable,U)}};e.getWitherable=z;var N=function(D){return{URI:e.URI,_E:void 0,map:m,ap:function(L,U){return(0,e.isLeft)(L)?(0,e.isLeft)(U)?(0,e.left)(D.concat(L.left,U.left)):L:(0,e.isLeft)(U)?U:(0,e.right)(L.right(U.right))},of:e.of}};e.getApplicativeValidation=N;var Y=function(D){return{URI:e.URI,_E:void 0,map:m,alt:function(L,U){if((0,e.isRight)(L))return L;var ue=U();return(0,e.isLeft)(ue)?(0,e.left)(D.concat(L.left,ue.left)):ue}}};e.getAltValidation=Y;var ee=function(D){return function(L){return(0,e.isLeft)(L)?L:(0,e.right)(D(L.right))}};e.map=ee,e.Functor={URI:e.URI,map:m},e.of=e.right,e.Pointed={URI:e.URI,of:e.of};var F=function(D){return function(L){return(0,e.isLeft)(L)?L:(0,e.isLeft)(D)?D:(0,e.right)(L.right(D.right))}};e.apW=F,e.ap=e.apW,e.Apply={URI:e.URI,map:m,ap:g},e.Applicative={URI:e.URI,map:m,ap:g,of:e.of};var M=function(D){return function(L){return(0,e.isLeft)(L)?L:D(L.right)}};e.chainW=M,e.chain=e.chainW,e.Chain={URI:e.URI,map:m,ap:g,chain:y},e.Monad={URI:e.URI,map:m,ap:g,of:e.of,chain:y};var W=function(D,L){return function(U){return(0,e.isLeft)(U)?D:L(D,U.right)}};e.reduce=W;var re=function(D){return function(L){return function(U){return(0,e.isLeft)(U)?D.empty:L(U.right)}}};e.foldMap=re;var Ie=function(D,L){return function(U){return(0,e.isLeft)(U)?D:L(U.right,D)}};e.reduceRight=Ie,e.Foldable={URI:e.URI,reduce:C,foldMap:x,reduceRight:b};var Ce=function(D){return function(L){return function(U){return(0,e.isLeft)(U)?D.of((0,e.left)(U.left)):D.map(L(U.right),e.right)}}};e.traverse=Ce;var P=function(D){return function(L){return(0,e.isLeft)(L)?D.of((0,e.left)(L.left)):D.map(L.right,e.right)}};e.sequence=P,e.Traversable={URI:e.URI,map:m,reduce:C,foldMap:x,reduceRight:b,traverse:v,sequence:e.sequence};var ae=function(D,L){return function(U){return(0,e.isLeft)(U)?(0,e.left)(D(U.left)):(0,e.right)(L(U.right))}};e.bimap=ae;var Ge=function(D){return function(L){return(0,e.isLeft)(L)?(0,e.left)(D(L.left)):L}};e.mapLeft=Ge,e.Bifunctor={URI:e.URI,bimap:S,mapLeft:w};var ve=function(D){return function(L){return(0,e.isLeft)(L)?D():L}};e.altW=ve,e.alt=e.altW,e.Alt={URI:e.URI,map:m,alt:T};var De=function(D){return function(L){return(0,e.isLeft)(L)?L:(0,e.right)(D(L))}};e.extend=De,e.Extend={URI:e.URI,map:m,extend:E},e.ChainRec={URI:e.URI,map:m,ap:g,chain:y,chainRec:R},e.throwError=e.left,e.MonadThrow={URI:e.URI,map:m,ap:g,of:e.of,chain:y,throwError:e.throwError},e.FromEither={URI:e.URI,fromEither:c.identity},e.fromPredicate=(0,l.fromPredicate)(e.FromEither),e.fromOption=(0,l.fromOption)(e.FromEither),e.isLeft=f.isLeft,e.isRight=f.isRight;var gt=function(D,L){return function(U){return(0,e.isLeft)(U)?D(U.left):L(U.right)}};e.matchW=gt,e.foldW=e.matchW,e.match=e.matchW,e.fold=e.match;var on=function(D){return function(L){return(0,e.isLeft)(L)?D(L.left):L.right}};e.getOrElseW=on,e.getOrElse=e.getOrElseW,e.flap=(0,u.flap)(e.Functor),e.apFirst=(0,o.apFirst)(e.Apply),e.apFirstW=e.apFirst,e.apSecond=(0,o.apSecond)(e.Apply),e.apSecondW=e.apSecond,e.chainFirst=(0,a.chainFirst)(e.Chain),e.chainFirstW=e.chainFirst,e.flattenW=(0,e.chainW)(c.identity),e.flatten=e.flattenW,e.duplicate=(0,e.extend)(c.identity),e.fromOptionK=(0,l.fromOptionK)(e.FromEither),e.chainOptionK=(0,l.chainOptionK)(e.FromEither,e.Chain),e.filterOrElse=(0,l.filterOrElse)(e.FromEither,e.Chain),e.filterOrElseW=e.filterOrElse;var Yt=function(D){return(0,e.isLeft)(D)?(0,e.right)(D.left):(0,e.left)(D.right)};e.swap=Yt;var xe=function(D){return function(L){return(0,e.isLeft)(L)?D(L.left):L}};e.orElseW=xe,e.orElse=e.orElseW;var Ze=function(D){return function(L){return L==null?(0,e.left)(D):(0,e.right)(L)}};e.fromNullable=Ze;var ht=function(D,L){try{return(0,e.right)(D())}catch(U){return(0,e.left)(L(U))}};e.tryCatch=ht;var tt=function(D,L){return function(){for(var U=[],ue=0;ue<arguments.length;ue++)U[ue]=arguments[ue];return(0,e.tryCatch)(function(){return D.apply(void 0,U)},L)}};e.tryCatchK=tt;var ct=function(D){var L=(0,e.fromNullable)(D);return function(U){return(0,c.flow)(U,L)}};e.fromNullableK=ct;var Gt=function(D){var L=(0,e.fromNullableK)(D);return function(U){return(0,e.chain)(L(U))}};e.chainNullableK=Gt,e.toUnion=(0,e.foldW)(c.identity,c.identity);function wn(D){return D instanceof Error?D:new Error(String(D))}e.toError=wn;function Jt(D){return function(L,U){if(U===void 0){var ue=Jt(D);return function(j){return ue(L,j)}}return(0,e.isLeft)(U)?!1:D.equals(L,U.right)}}e.elem=Jt;var Rt=function(D){return function(L){return(0,e.isLeft)(L)?!1:D(L.right)}};e.exists=Rt,e.Do=(0,e.of)(f.emptyRecord),e.bindTo=(0,u.bindTo)(e.Functor),e.bind=(0,a.bind)(e.Chain),e.bindW=e.bind,e.apS=(0,o.apS)(e.Apply),e.apSW=e.apS,e.ApT=(0,e.of)(f.emptyReadonlyArray);var Tr=function(D){return function(L){var U=D(0,f.head(L));if((0,e.isLeft)(U))return U;for(var ue=[U.right],j=1;j<L.length;j++){var te=D(j,L[j]);if((0,e.isLeft)(te))return te;ue.push(te.right)}return(0,e.right)(ue)}};e.traverseReadonlyNonEmptyArrayWithIndex=Tr;var Pt=function(D){var L=(0,e.traverseReadonlyNonEmptyArrayWithIndex)(D);return function(U){return f.isNonEmpty(U)?L(U):e.ApT}};e.traverseReadonlyArrayWithIndex=Pt,e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex;var Zt=function(D){return(0,e.traverseReadonlyArrayWithIndex)(function(L,U){return D(U)})};e.traverseArray=Zt,e.sequenceArray=(0,e.traverseArray)(c.identity);function an(D,L){return(0,e.tryCatch)(function(){return JSON.parse(D)},L)}e.parseJSON=an;var Ir=function(D,L){return(0,e.tryCatch)(function(){var U=JSON.stringify(D);if(typeof U!="string")throw new Error("Converting unsupported structure to JSON");return U},L)};e.stringifyJSON=Ir,e.either={URI:e.URI,map:m,of:e.of,ap:g,chain:y,reduce:C,foldMap:x,reduceRight:b,traverse:v,sequence:e.sequence,bimap:S,mapLeft:w,alt:T,extend:E,chainRec:R,throwError:e.throwError},e.getApplySemigroup=(0,o.getApplySemigroup)(e.Apply),e.getApplyMonoid=(0,i.getApplicativeMonoid)(e.Applicative);var Er=function(D,L){return(0,o.getApplySemigroup)((0,e.getApplicativeValidation)(D))(L)};e.getValidationSemigroup=Er;var Me=function(D,L){return(0,i.getApplicativeMonoid)((0,e.getApplicativeValidation)(D))(L)};e.getValidationMonoid=Me;function $e(D){var L=(0,e.getApplicativeValidation)(D).ap,U=(0,e.getAltValidation)(D).alt;return{URI:e.URI,_E:void 0,map:m,of:e.of,chain:y,bimap:S,mapLeft:w,reduce:C,foldMap:x,reduceRight:b,extend:E,traverse:v,sequence:e.sequence,chainRec:R,throwError:e.throwError,ap:L,alt:U}}e.getValidation=$e})(un);var rt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wd=function(){return wd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},wd.apply(this,arguments)},WEe=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},ta=Dt,it=function(e,t,n){return ta([{value:e,context:t,message:n}])},Ue=Je,ke=function(){function e(t,n,r,i){this.name=t,this.is=n,this.validate=r,this.encode=i,this.decode=this.decode.bind(this)}return e.prototype.pipe=function(t,n){var r=this;return n===void 0&&(n="pipe(".concat(this.name,", ").concat(t.name,")")),new e(n,t.is,function(i,o){var a=r.validate(i,o);return ce(a)?a:t.validate(a.right,o)},this.encode===qe&&t.encode===qe?qe:function(i){return r.encode(t.encode(i))})},e.prototype.asDecoder=function(){return this},e.prototype.asEncoder=function(){return this},e.prototype.decode=function(t){return this.validate(t,[{key:"",type:this,actual:t}])},e}(),qe=function(e){return e};function _V(e){return e.displayName||e.name||"<function".concat(e.length,">")}function NEe(e,t){return{key:e,type:t}}function Xi(e,t,n,r){for(var i=e.length,o=Array(i+1),a=0;a<i;a++)o[a]=e[a];return o[i]={key:t,type:n,actual:r},o}function _a(e,t){for(var n=t.length,r=0;r<n;r++)e.push(t[r])}var vc=Object.prototype.hasOwnProperty;function Ww(e){return Object.keys(e).map(function(t){return"".concat(t,": ").concat(e[t].name)}).join(", ")}function $h(e){for(var t=0;t<e.length;t++)if(e[t].encode!==qe)return!1;return!0}function TV(e){return"{ ".concat(Ww(e)," }")}function IV(e){return"Partial<".concat(e,">")}function KEe(e,t,n,r){r===void 0&&(r="{ [K in ".concat(t.name,"]: ").concat(n.name," }"));var i=e.length;return new YO(r,function(o){return gr.is(o)&&e.every(function(a){return n.is(o[a])})},function(o,a){var s=gr.validate(o,a);if(ce(s))return s;for(var l=s.right,c={},u=[],f=!1,p=0;p<i;p++){var h=e[p],m=l[h],g=n.validate(m,Xi(a,h,n,m));if(ce(g))_a(u,g.left);else{var y=g.right;f=f||y!==m,c[h]=y}}return u.length>0?ta(u):Ue(f||Object.keys(l).length!==i?c:l)},n.encode===qe?qe:function(o){for(var a={},s=0;s<i;s++){var l=e[s];a[l]=n.encode(o[l])}return a},t,n)}function zO(e){var t;if($V(e)){var n=e.value;if(go.is(n))return t={},t[n]=null,t}else{if(YEe(e))return e.keys;if(OV(e)){var r=e.types.map(function(i){return zO(i)});return r.some(Ev.is)?void 0:Object.assign.apply(Object,WEe([{}],r,!1))}}}function qEe(e,t,n){return n===void 0&&(n="{ [K in ".concat(e.name,"]: ").concat(t.name," }")),new YO(n,function(r){return gr.is(r)?Object.keys(r).every(function(i){return e.is(i)&&t.is(r[i])}):xj(t)&&Array.isArray(r)},function(r,i){if(gr.is(r)){for(var o={},a=[],s=Object.keys(r),l=s.length,c=!1,u=0;u<l;u++){var f=s[u],p=r[f],h=e.validate(f,Xi(i,f,e,f));if(ce(h))_a(a,h.left);else{var m=h.right;c=c||m!==f,f=m;var g=t.validate(p,Xi(i,f,t,p));if(ce(g))_a(a,g.left);else{var y=g.right;c=c||y!==p,o[f]=y}}}return a.length>0?ta(a):Ue(c?o:r)}return xj(t)&&Array.isArray(r)?Ue(r):it(r,i)},e.encode===qe&&t.encode===qe?qe:function(r){for(var i={},o=Object.keys(r),a=o.length,s=0;s<a;s++){var l=o[s];i[String(e.encode(l))]=t.encode(r[l])}return i},e,t)}function EV(e){return"("+e.map(function(t){return t.name}).join(" | ")+")"}function Nw(e,t){for(var n=!0,r=!0,i=!gr.is(e),o=0,a=t;o<a.length;o++){var s=a[o];s!==e&&(n=!1),gr.is(s)&&(r=!1)}if(n)return e;if(r)return t[t.length-1];for(var l={},c=0,u=t;c<u.length;c++){var s=u[c];for(var f in s)(!vc.call(l,f)||i||s[f]!==e[f])&&(l[f]=s[f])}return l}function Kw(e){switch(e._tag){case"RefinementType":case"ReadonlyType":return Kw(e.type);case"InterfaceType":case"StrictType":case"PartialType":return e.props;case"IntersectionType":return e.types.reduce(function(t,n){return Object.assign(t,Kw(n))},{})}}function wj(e,t){for(var n=Object.getOwnPropertyNames(e),r=!1,i={},o=0;o<n.length;o++){var a=n[o];vc.call(t,a)?i[a]=e[a]:r=!0}return r?i:e}function VEe(e){return kV(e)?"{| ".concat(Ww(e.props)," |}"):GEe(e)?IV("{| ".concat(Ww(e.props)," |}")):"Exact<".concat(e.name,">")}function zEe(e){return e.length>0}var $r={};function RV(e,t){for(var n=[],r=0,i=e;r<i.length;r++){var o=i[r];t.indexOf(o)!==-1&&n.push(o)}return n}function QEe(e,t){if(e===$r)return t;if(t===$r)return e;var n=Object.assign({},e);for(var r in t)if(vc.call(e,r)){var i=RV(e[r],t[r]);if(zEe(i))n[r]=i;else{n=$r;break}}else n[r]=t[r];return n}function HEe(e,t){if(e===$r||t===$r)return $r;var n=$r;for(var r in e)if(vc.call(t,r)){var i=RV(e[r],t[r]);i.length===0&&(n===$r&&(n={}),n[r]=e[r].concat(t[r]))}return n}function xj(e){return e._tag==="AnyType"}function $V(e){return e._tag==="LiteralType"}function YEe(e){return e._tag==="KeyofType"}function kV(e){return e._tag==="InterfaceType"}function GEe(e){return e._tag==="PartialType"}function JEe(e){return e._tag==="StrictType"}function ZEe(e){return e._tag==="ExactType"}function XEe(e){return e._tag==="RefinementType"}function eRe(e){return e._tag==="IntersectionType"}function OV(e){return e._tag==="UnionType"}function tRe(e){return e._tag==="RecursiveType"}var HC=[];function Ss(e){if(HC.indexOf(e)!==-1)return $r;if(kV(e)||JEe(e)){var t=$r;for(var n in e.props){var r=e.props[n];$V(r)&&(t===$r&&(t={}),t[n]=[r.value])}return t}else{if(ZEe(e)||XEe(e))return Ss(e.type);if(eRe(e))return e.types.reduce(function(o,a){return QEe(o,Ss(a))},$r);if(OV(e))return e.types.slice(1).reduce(function(o,a){return HEe(o,Ss(a))},Ss(e.types[0]));if(tRe(e)){HC.push(e);var i=Ss(e.type);return HC.pop(),i}}return $r}function MV(e){var t=Ss(e[0]),n=Object.keys(t),r=e.length,i=function(c){for(var u=t[c].slice(),f=[t[c]],p=1;p<r;p++){var h=e[p],m=Ss(h),g=m[c];if(g===void 0)return"continue-keys";if(g.some(function(y){return u.indexOf(y)!==-1}))return"continue-keys";u.push.apply(u,g),f.push(g)}return{value:[c,f]}};e:for(var o=0,a=n;o<a.length;o++){var s=a[o],l=i(s);if(typeof l=="object")return l.value;switch(l){case"continue-keys":continue e}}}var FV=function(e){rt(t,e);function t(){var n=e.call(this,"null",function(r){return r===null},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="NullType",n}return t}(ke),qw=new FV,jV=function(e){rt(t,e);function t(){var n=e.call(this,"undefined",function(r){return r===void 0},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="UndefinedType",n}return t}(ke),Ev=new jV,LV=function(e){rt(t,e);function t(){var n=e.call(this,"void",Ev.is,Ev.validate,qe)||this;return n._tag="VoidType",n}return t}(ke),_j=new LV,DV=function(e){rt(t,e);function t(){var n=e.call(this,"unknown",function(r){return!0},Ue,qe)||this;return n._tag="UnknownType",n}return t}(ke),nRe=new DV,UV=function(e){rt(t,e);function t(){var n=e.call(this,"string",function(r){return typeof r=="string"},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="StringType",n}return t}(ke),go=new UV,BV=function(e){rt(t,e);function t(){var n=e.call(this,"number",function(r){return typeof r=="number"},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="NumberType",n}return t}(ke),_u=new BV,PV=function(e){rt(t,e);function t(){var n=e.call(this,"bigint",function(r){return typeof r=="bigint"},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="BigIntType",n}return t}(ke),rRe=new PV,WV=function(e){rt(t,e);function t(){var n=e.call(this,"boolean",function(r){return typeof r=="boolean"},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="BooleanType",n}return t}(ke),C1=new WV,NV=function(e){rt(t,e);function t(){var n=e.call(this,"UnknownArray",Array.isArray,function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="AnyArrayType",n}return t}(ke),xd=new NV,KV=function(e){rt(t,e);function t(){var n=e.call(this,"UnknownRecord",function(r){var i=Object.prototype.toString.call(r);return i==="[object Object]"||i==="[object Window]"},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="AnyDictionaryType",n}return t}(ke),gr=new KV,qV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.value=a,s._tag="LiteralType",s}return t}(ke);function jm(e,t){t===void 0&&(t=JSON.stringify(e));var n=function(r){return r===e};return new qV(t,n,function(r,i){return n(r)?Ue(e):it(r,i)},qe,e)}var VV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.keys=a,s._tag="KeyofType",s}return t}(ke);function iRe(e,t){t===void 0&&(t=Object.keys(e).map(function(r){return JSON.stringify(r)}).join(" | "));var n=function(r){return go.is(r)&&vc.call(e,r)};return new VV(t,n,function(r,i){return n(r)?Ue(r):it(r,i)},qe,e)}var zV=function(e){rt(t,e);function t(n,r,i,o,a,s){var l=e.call(this,n,r,i,o)||this;return l.type=a,l.predicate=s,l._tag="RefinementType",l}return t}(ke);function S1(e,t,n){return ZO(e,t,n)}var Rv=S1(_u,function(e){return Number.isInteger(e)},"Int"),QO=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.runDefinition=a,s._tag="RecursiveType",s}return t}(ke);Object.defineProperty(QO.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});function HO(e,t){var n,r=function(){return n||(n=t(i),n.name=e),n},i=new QO(e,function(o){return r().is(o)},function(o,a){return r().validate(o,a)},function(o){return r().encode(o)},r);return i}var QV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.type=a,s._tag="ArrayType",s}return t}(ke);function w1(e,t){return t===void 0&&(t="Array<".concat(e.name,">")),new QV(t,function(n){return xd.is(n)&&n.every(e.is)},function(n,r){var i=xd.validate(n,r);if(ce(i))return i;for(var o=i.right,a=o.length,s=o,l=[],c=0;c<a;c++){var u=o[c],f=e.validate(u,Xi(r,String(c),e,u));if(ce(f))_a(l,f.left);else{var p=f.right;p!==u&&(s===o&&(s=o.slice()),s[c]=p)}}return l.length>0?ta(l):Ue(s)},e.encode===qe?qe:function(n){return n.map(e.encode)},e)}var HV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.props=a,s._tag="InterfaceType",s}return t}(ke);function Vw(e,t){t===void 0&&(t=TV(e));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new HV(t,function(o){if(gr.is(o)){for(var a=0;a<i;a++){var s=n[a],l=o[s];if(l===void 0&&!vc.call(o,s)||!r[a].is(l))return!1}return!0}return!1},function(o,a){var s=gr.validate(o,a);if(ce(s))return s;for(var l=s.right,c=l,u=[],f=0;f<i;f++){var p=n[f],h=c[p],m=r[f],g=m.validate(h,Xi(a,p,m,h));if(ce(g))_a(u,g.left);else{var y=g.right;(y!==h||y===void 0&&!vc.call(c,p))&&(c===l&&(c=wd({},l)),c[p]=y)}}return u.length>0?ta(u):Ue(c)},$h(r)?qe:function(o){for(var a=wd({},o),s=0;s<i;s++){var l=n[s],c=r[s].encode;c!==qe&&(a[l]=c(o[l]))}return a},e)}var YV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.props=a,s._tag="PartialType",s}return t}(ke);function oRe(e,t){t===void 0&&(t=IV(TV(e)));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new YV(t,function(o){if(gr.is(o)){for(var a=0;a<i;a++){var s=n[a],l=o[s];if(l!==void 0&&!e[s].is(l))return!1}return!0}return!1},function(o,a){var s=gr.validate(o,a);if(ce(s))return s;for(var l=s.right,c=l,u=[],f=0;f<i;f++){var p=n[f],h=c[p],m=e[p],g=m.validate(h,Xi(a,p,m,h));if(ce(g))h!==void 0&&_a(u,g.left);else{var y=g.right;y!==h&&(c===l&&(c=wd({},l)),c[p]=y)}}return u.length>0?ta(u):Ue(c)},$h(r)?qe:function(o){for(var a=wd({},o),s=0;s<i;s++){var l=n[s],c=o[l];c!==void 0&&(a[l]=r[s].encode(c))}return a},e)}var YO=function(e){rt(t,e);function t(n,r,i,o,a,s){var l=e.call(this,n,r,i,o)||this;return l.domain=a,l.codomain=s,l._tag="DictionaryType",l}return t}(ke);function GO(e,t,n){var r=zO(e);return r?KEe(Object.keys(r),e,t,n):qEe(e,t,n)}var JO=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.types=a,s._tag="UnionType",s}return t}(ke);function Lm(e,t){t===void 0&&(t=EV(e));var n=MV(e);if(n!==void 0&&e.length>0){var r=n[0],i=n[1],o=i.length,a=function(s){for(var l=0;l<o;l++)if(i[l].indexOf(s)!==-1)return l};return new $v(t,function(s){if(gr.is(s)){var l=a(s[r]);return l!==void 0?e[l].is(s):!1}return!1},function(s,l){var c=gr.validate(s,l);if(ce(c))return c;var u=c.right,f=a(u[r]);if(f===void 0)return it(s,l);var p=e[f];return p.validate(u,Xi(l,String(f),p,u))},$h(e)?qe:function(s){var l=a(s[r]);if(l===void 0)throw new Error("no codec found to encode value in union codec ".concat(t));return e[l].encode(s)},e,r)}else return new JO(t,function(s){return e.some(function(l){return l.is(s)})},function(s,l){for(var c=[],u=0;u<e.length;u++){var f=e[u],p=f.validate(s,Xi(l,String(u),f,s));if(ce(p))_a(c,p.left);else return Ue(p.right)}return ta(c)},$h(e)?qe:function(s){for(var l=0,c=e;l<c.length;l++){var u=c[l];if(u.is(s))return u.encode(s)}throw new Error("no codec found to encode value in union type ".concat(t))},e)}var GV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.types=a,s._tag="IntersectionType",s}return t}(ke);function aRe(e,t){t===void 0&&(t="(".concat(e.map(function(r){return r.name}).join(" & "),")"));var n=e.length;return new GV(t,function(r){return e.every(function(i){return i.is(r)})},e.length===0?Ue:function(r,i){for(var o=[],a=[],s=0;s<n;s++){var l=e[s],c=l.validate(r,Xi(i,String(s),l,r));ce(c)?_a(a,c.left):o.push(c.right)}return a.length>0?ta(a):Ue(Nw(r,o))},e.length===0?qe:function(r){return Nw(r,e.map(function(i){return i.encode(r)}))},e)}var JV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.types=a,s._tag="TupleType",s}return t}(ke);function sRe(e,t){t===void 0&&(t="[".concat(e.map(function(r){return r.name}).join(", "),"]"));var n=e.length;return new JV(t,function(r){return xd.is(r)&&r.length===n&&e.every(function(i,o){return i.is(r[o])})},function(r,i){var o=xd.validate(r,i);if(ce(o))return o;for(var a=o.right,s=a.length>n?a.slice(0,n):a,l=[],c=0;c<n;c++){var u=a[c],f=e[c],p=f.validate(u,Xi(i,String(c),f,u));if(ce(p))_a(l,p.left);else{var h=p.right;h!==u&&(s===a&&(s=a.slice()),s[c]=h)}}return l.length>0?ta(l):Ue(s)},$h(e)?qe:function(r){return e.map(function(i,o){return i.encode(r[o])})},e)}var ZV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.type=a,s._tag="ReadonlyType",s}return t}(ke);function lRe(e,t){return t===void 0&&(t="Readonly<".concat(e.name,">")),new ZV(t,e.is,e.validate,e.encode,e)}var XV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.type=a,s._tag="ReadonlyArrayType",s}return t}(ke);function ez(e,t){t===void 0&&(t="ReadonlyArray<".concat(e.name,">"));var n=w1(e);return new XV(t,n.is,n.validate,n.encode,e)}var kh=function(e,t){return nz(Vw(e),t)},tz=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.type=a,s._tag="ExactType",s}return t}(ke);function nz(e,t){t===void 0&&(t=VEe(e));var n=Kw(e);return new tz(t,e.is,function(r,i){var o=gr.validate(r,i);if(ce(o))return o;var a=e.validate(r,i);return ce(a)?a:Je(wj(a.right,n))},function(r){return e.encode(wj(r,n))},e)}var rz=function(e){rt(t,e);function t(){var n=e.call(this,"Function",function(r){return typeof r=="function"},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="FunctionType",n}return t}(ke),cRe=new rz,$v=function(e){rt(t,e);function t(n,r,i,o,a,s){var l=e.call(this,n,r,i,o,a)||this;return l.tag=s,l}return t}(JO),uRe=function(e,t,n){n===void 0&&(n=EV(t));var r=Lm(t,n);return r instanceof $v?r:(console.warn("[io-ts] Cannot build a tagged union for ".concat(n,", returning a de-optimized union")),new $v(n,r.is,r.validate,r.encode,t,e))},dRe=function(e,t){return{value:e,context:t}},iz=function(e){return[{key:"",type:e}]},oz=function(e){rt(t,e);function t(){var n=e.call(this,"never",function(r){return!1},function(r,i){return it(r,i)},function(){throw new Error("cannot encode never")})||this;return n._tag="NeverType",n}return t}(ke),fRe=new oz,az=function(e){rt(t,e);function t(){var n=e.call(this,"any",function(r){return!0},Ue,qe)||this;return n._tag="AnyType",n}return t}(ke),pRe=new az,hRe=gr,sz=function(e){rt(t,e);function t(){var n=e.call(this,"object",function(r){return r!==null&&typeof r=="object"},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="ObjectType",n}return t}(ke),ARe=new sz;function ZO(e,t,n){return n===void 0&&(n="(".concat(e.name," | ").concat(_V(t),")")),new zV(n,function(r){return e.is(r)&&t(r)},function(r,i){var o=e.validate(r,i);if(ce(o))return o;var a=o.right;return t(a)?Ue(a):it(a,i)},e.encode,e,t)}var mRe=ZO(_u,Number.isInteger,"Integer"),gRe=GO,vRe=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.props=a,s._tag="StrictType",s}return t}(ke);function yRe(e){return e}function bRe(e){return function(){return e}}const CRe=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:NV,AnyDictionaryType:KV,AnyType:az,Array:xd,ArrayType:QV,BigIntType:PV,BooleanType:WV,Dictionary:hRe,DictionaryType:YO,ExactType:tz,Function:cRe,FunctionType:rz,Int:Rv,Integer:mRe,InterfaceType:HV,IntersectionType:GV,KeyofType:VV,LiteralType:qV,NeverType:oz,NullType:FV,NumberType:BV,ObjectType:sz,PartialType:YV,ReadonlyArrayType:XV,ReadonlyType:ZV,RecursiveType:QO,RefinementType:zV,StrictType:vRe,StringType:UV,TaggedUnionType:$v,TupleType:JV,Type:ke,UndefinedType:jV,UnionType:JO,UnknownArray:xd,UnknownRecord:gr,UnknownType:DV,VoidType:LV,alias:bRe,any:pRe,appendContext:Xi,array:w1,bigint:rRe,boolean:C1,brand:S1,clean:yRe,dictionary:gRe,emptyTags:$r,exact:nz,failure:it,failures:ta,getContextEntry:NEe,getDefaultContext:iz,getDomainKeys:zO,getFunctionName:_V,getIndex:MV,getTags:Ss,getValidationError:dRe,identity:qe,interface:Vw,intersection:aRe,keyof:iRe,literal:jm,mergeAll:Nw,never:fRe,null:qw,nullType:qw,number:_u,object:ARe,partial:oRe,readonly:lRe,readonlyArray:ez,record:GO,recursion:HO,refinement:ZO,strict:kh,string:go,success:Ue,taggedUnion:uRe,tuple:sRe,type:Vw,undefined:Ev,union:Lm,unknown:nRe,void:_j,voidType:_j},Symbol.toStringTag,{value:"Module"})),ne=Mc(CRe);var Dm={};Object.defineProperty(Dm,"__esModule",{value:!0});Dm.ContentPath=void 0;const Tj="::";Dm.ContentPath={serialize(e){return e.map(t=>t.key).join(Tj)},current(e){return e[e.length-1]},append(e,t){return e+Tj+t},make(e){return e.reduce((t,{key:n,type:r})=>n?t.concat({key:n,type:r}):t,[])}};var Tu={},x1={};Object.defineProperty(x1,"__esModule",{value:!0});x1.getAssetOrThrow=void 0;const SRe=e=>t=>{const n=e[t];if(!n)throw new Error(`Missing asset with id '${t}'!`);return n};x1.getAssetOrThrow=SRe;var _1={};Object.defineProperty(_1,"__esModule",{value:!0});_1.getEmbedOrThrow=void 0;const wRe=e=>t=>{const n=e[t];if(!n)throw new Error(`Missing embed with url '${t}'`);return n};_1.getEmbedOrThrow=wRe;var T1={},nt={};const vo=Mc(NU);function lz(e,t,n){return n===void 0&&(n=e.name),new ke(n,e.is,e.validate,function(r){return t(e.encode(r))})}const xRe=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:lz},Symbol.toStringTag,{value:"Module"}));var cz=S1(go,function(e){return e.length>0},"NonEmptyString");function uz(e,t){t===void 0&&(t="NonEmptyArray<"+e.name+">");var n=w1(e);return new ke(t,function(r){return n.is(r)&&nn(r)},function(r,i){return ge(n.validate(r,i),Mi(function(o){var a=cT(o);return Qe(a)?it(r,i):Ue(a.value)}))},function(r){return n.encode(r)})}function dz(e,t,n){n===void 0&&(n="Set<"+e.name+">");var r=w1(e),i=iq(t),o=tq(t);return new ke(n,function(a){return a instanceof Set&&rq(e.is)(a)},function(a,s){return ge(r.validate(a,s),Mi(function(l){var c=o(l);return c.size!==l.length?it(a,s):Ue(c)}))},function(a){return r.encode(i(a))})}function _Re(e,t,n){return n===void 0&&(n="ReadonlySet<"+e.name+">"),dz(e,t,n)}function XO(e,t){return new ke(e,t,function(n,r){return t(n)?Ue(n):it(n,r)},qe)}var TRe=function(e){return e instanceof Date},IRe=XO("Date",TRe),ERe=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},RRe=function(e,t){return{get:e,reverseGet:t}},fz=function(e){return Sl(e.get,X(e.reverseGet,Ur))},$Re=function(e){return Iu(X(e.get,Ft),e.reverseGet)},kRe=function(e){return ls(X(e.get,Ft),X(e.reverseGet,Ur))},ORe=function(e){return lp(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.reverseGet(i)})}}})},Sl=function(e,t){return{get:e,set:t}},eM=function(e){return ls(X(e.get,Ft),e.set)},MRe=function(e){return lp(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.set(i)(r)})}}})},pz=function(e){return function(t){return Sl(function(n){return e.get(t.get(n))},function(n){return function(r){return t.set(e.set(n)(t.get(r)))(r)}})}},FRe=function(e){return function(t){return Iu(X(t.getOption,CA(e.getOption)),X(e.reverseGet,t.reverseGet))}},jRe=function(e){return function(t){return Eu(tM(e))(eM(t))}},LRe=function(){return Sl(Q,Ur)},DRe=function(e){return function(t){return Sl(function(n){return t.get(n)[e]},function(n){return function(r){var i,o=t.get(r);return n===o[e]?r:t.set(Object.assign({},o,(i={},i[e]=n,i)))(r)}})}},URe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return Sl(function(r){for(var i=n.get(r),o={},a=0,s=e;a<s.length;a++){var l=s[a];o[l]=i[l]}return o},function(r){return function(i){for(var o=n.get(i),a=0,s=e;a<s.length;a++){var l=s[a];if(r[l]!==o[l])return n.set(Object.assign({},o,r))(i)}return i}})}},BRe=function(e){return function(t){return Sl(function(n){return t.get(n)[e]},function(n){return function(r){var i=t.get(r);if(n===i[e])return r;var o=i.slice();return o[e]=n,t.set(o)(r)}})}},PRe=function(e){return function(t){return ge(t,pz(l$e().at(e)))}},Iu=function(e,t){return{getOption:e,reverseGet:t}},tM=function(e){return ls(e.getOption,function(t){return Az(t)(e)})},hz=function(e){return lp(function(t){return function(n){return function(r){return ge(e.getOption(r),nl(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return Az(o)(e)(r)})}))}}})},WRe=function(e){return function(t){return function(n){return ge(t.getOption(n),No(function(r){var i=e(r);return i===r?n:t.reverseGet(i)}))}}},NRe=function(e){return function(t){var n=WRe(e)(t);return function(r){return ge(n(r),WI(function(){return r}))}}},Az=function(e){return NRe(function(){return e})},KRe=function(e){return function(t){return Eu(eM(e))(tM(t))}},qRe=function(){return Iu(Nc,Q)},nM=function(e){return Iu(S0(e),Q)},VRe=function(){return Iu(Q,Ft)},zRe=function(){return Iu(hf,Je)},QRe=function(){return Iu(function(e){return ce(e)?Ft(e.left):ft},Dt)},ls=function(e,t){return{getOption:e,set:t}},HRe=function(e){return lp(function(t){return function(n){return function(r){return ge(e.getOption(r),nl(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return e.set(o)(r)})}))}}})},mz=function(e){return function(t){return function(n){return ge(t.getOption(n),No(function(r){var i=e(r);return i===r?n:t.set(i)(n)}))}}},gz=function(e){return function(t){var n=mz(e)(t);return function(r){return ge(n(r),WI(function(){return r}))}}},Eu=function(e){return function(t){return ls(X(t.getOption,CA(e.getOption)),function(n){return gz(e.set(n))(t)})}},YRe=function(e){return function(t){return ge(t,Eu(i$e().index(e)))}},GRe=function(e){return function(t){return ge(t,Eu(o$e().index(e)))}},JRe=function(e){return function(t){return ge(t,Eu(a$e().index(e)))}},ZRe=function(e){return ls(n0(e),function(t){return function(n){return ge(t0(e)(n),nl(function(){return n},function(r){return f0(r,t,n)}))}})},vz=function(e,t,n){if(n[e]===t)return n;var r=ERe([n[0]],n.slice(1),!0);return r[e]=t,r},XRe=function(e){return ls(n0(e),function(t){return function(n){return ge(t0(e)(n),nl(function(){return n},function(r){return vz(r,t,n)}))}})},lp=function(e){return{modifyF:e}};function rM(e){return function(t){return lp(function(n){return function(r){return t.modifyF(n)(e.modifyF(n)(r))}})}}var e$e={URI:"Identity",map:function(e,t){return t(e)},of:Q,ap:function(e,t){return e(t)}},t$e=function(e){return e.URI==="Identity"};function n$e(e){return function(){return lp(function(t){var n=t$e(t)?e.map:e.traverse(t);return function(r){return function(i){return n(i,r)}}})}}function r$e(e){return rM(n$e(e)())}var iM=function(e){return{index:e}},i$e=function(){return iM(function(e){return ls(function(t){return pc(e,t)},function(t){return function(n){return ge(pc(e,n),nl(function(){return n},function(){return f0(e,t,n)}))}})})},o$e=function(){return iM(function(e){return ls(function(t){return pc(e,t)},function(t){return function(n){return ge(pc(e,n),nl(function(){return n},function(){return vz(e,t,n)}))}})})},a$e=function(){return iM(function(e){return ls(function(t){return hc(e,t)},function(t){return function(n){return n[e]===t||Qe(hc(e,n))?n:W$(e,t)(n)}})})},s$e=function(e){return{at:e}};function l$e(){return s$e(function(e){return Sl(function(t){return hc(e,t)},nl(function(){return R$(e)},function(t){return W$(e,t)}))})}var yz=RRe,zw=fz,Qw=$Re,Hw=kRe,Yw=ORe,c$e=function(e){return function(t){return yz(X(t.get,e.get),X(e.reverseGet,t.reverseGet))}},u$e=function(e){return yz(e.reverseGet,e.get)},d$e=function(e){return function(t){return function(n){return t.reverseGet(e(t.get(n)))}}},bz=Sl,kv=LRe,Ns=eM,_d=MRe,yc=pz,f$e=yc,p$e=X(fz,yc),Ru=jRe,oM=function(e){return X(Ns,Eu(e))},h$e=function(e){return X(_d,rM(e))},Cz=function(e){return function(t){return function(n){var r=t.get(n),i=e(r);return r===i?n:t.set(i)(n)}}};function A$e(e){return function(t){return function(n){return function(r){return ge(n.get(r),t,function(i){return e.map(i,function(o){return n.set(o)(r)})})}}}}var m$e=function(e){return Ru(qRe())(e)};function g$e(e){return Ru(nM(e))}var Sz=DRe,wz=URe,v$e=BRe,y$e=function(e){return X(Ns,YRe(e))},b$e=function(e){return X(Ns,GRe(e))},C$e=function(e){return X(Ns,JRe(e))},S$e=PRe,w$e=Ru(VRe()),x$e=Ru(zRe()),_$e=Ru(QRe());function T$e(e){return X(_d,r$e(e))}function I$e(e){return oM(ZRe(e))}function E$e(e){return oM(XRe(e))}var R$e=function(e,t){return function(n){return xz(n,e,t)}},xz=function(e,t,n){return bz(X(e.get,t),X(n,e.set))},I1="monocle-ts/Lens",$$e={URI:I1,imap:xz},_z={URI:I1,compose:function(e,t){return yc(e)(t)}},k$e={URI:I1,compose:_z.compose,id:kv};const O$e=Object.freeze(Object.defineProperty({__proto__:null,Category:k$e,Invariant:$$e,Semigroupoid:_z,URI:I1,asOptional:Ns,asTraversal:_d,atKey:S$e,component:v$e,compose:yc,composeIso:p$e,composeLens:f$e,composeOptional:oM,composePrism:Ru,composeTraversal:h$e,filter:g$e,findFirst:I$e,findFirstNonEmpty:E$e,fromNullable:m$e,id:kv,imap:R$e,index:y$e,indexNonEmpty:b$e,key:C$e,left:_$e,lens:bz,modify:Cz,modifyF:A$e,prop:Sz,props:wz,right:x$e,some:w$e,traverse:T$e},Symbol.toStringTag,{value:"Module"}));var Ij=HRe,Vl=Eu,M$e=mz,F$e=gz,j$e=nM,Gw=tM,Jw=hz,Zw=FRe,L$e=KRe,va=rM,Tz=function(e){return function(t){return t.modifyF(e$e)(e)}},D$e=function(e){return Tz(function(){return e})};function U$e(e){return va(hz(nM(e)))}var Ej=function(e){return new Ez(e.get,e.reverseGet)},rd=function(e){return new aM(e.get,e.set)},Qp=function(e){return new Rz(e.getOption,e.reverseGet)},xi=function(e){return new B$e(e.getOption,e.set)},Yr=function(e){return new P$e(e.modifyF)},Iz=function(e,t,n){var r;return n===e[t]?e:Object.assign({},e,(r={},r[t]=n,r))},Ez=function(){function e(t,n){this.get=t,this.reverseGet=n,this._tag="Iso",this.unwrap=this.get,this.to=this.get,this.wrap=this.reverseGet,this.from=this.reverseGet}return e.prototype.reverse=function(){return Ej(u$e(this))},e.prototype.modify=function(t){return d$e(t)(this)},e.prototype.asLens=function(){return rd(zw(this))},e.prototype.asPrism=function(){return Qp(Qw(this))},e.prototype.asOptional=function(){return xi(Hw(this))},e.prototype.asTraversal=function(){return Yr(Yw(this))},e.prototype.asFold=function(){var t=this;return new cp(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.asGetter=function(){var t=this;return new kz(function(n){return t.get(n)})},e.prototype.asSetter=function(){var t=this;return new Um(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Ej(c$e(t)(this))},e.prototype.composeIso=function(t){return this.compose(t)},e.prototype.composeLens=function(t){return rd(ge(this,zw,yc(t)))},e.prototype.composePrism=function(t){return Qp(ge(this,Qw,Zw(t)))},e.prototype.composeOptional=function(t){return xi(ge(this,Hw,Vl(t)))},e.prototype.composeTraversal=function(t){return Yr(ge(this,Yw,va(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e}(),aM=function(){function e(t,n){this.get=t,this.set=n,this._tag="Lens"}return e.fromPath=function(){var t=e.fromProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromProp=function(){return function(t){return rd(ge(kv(),Sz(t)))}},e.fromProps=function(){return function(t){return rd(ge(kv(),wz.apply(O$e,t)))}},e.fromNullableProp=function(){return function(t,n){return new e(function(r){var i=Nc(r[t]);return Qe(i)?n:i.value},function(r){return function(i){return Iz(i,t,r)}})}},e.prototype.modify=function(t){return Cz(t)(this)},e.prototype.asOptional=function(){return xi(Ns(this))},e.prototype.asTraversal=function(){return Yr(_d(this))},e.prototype.asSetter=function(){var t=this;return new Um(function(n){return t.modify(n)})},e.prototype.asGetter=function(){var t=this;return new kz(function(n){return t.get(n)})},e.prototype.asFold=function(){var t=this;return new cp(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){return rd(yc(t)(this))},e.prototype.composeLens=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeOptional=function(t){return xi(ge(this,Ns,Vl(t)))},e.prototype.composeTraversal=function(t){return Yr(ge(this,_d,va(t)))},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return rd(ge(this,yc(ge(t,zw))))},e.prototype.composePrism=function(t){return xi(Ru(t)(this))},e}(),Rz=function(){function e(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return e.fromPredicate=function(t){return Qp(j$e(t))},e.some=function(){return $z},e.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return Qe(i)?r:i.value}},e.prototype.modifyOption=function(t){var n=this;return function(r){return GN.map(n.getOption(r),function(i){var o=t(i);return o===i?r:n.reverseGet(o)})}},e.prototype.set=function(t){return this.modify(function(){return t})},e.prototype.asOptional=function(){return xi(Gw(this))},e.prototype.asTraversal=function(){return Yr(Jw(this))},e.prototype.asSetter=function(){var t=this;return new Um(function(n){return t.modify(n)})},e.prototype.asFold=function(){var t=this;return new cp(function(n){return function(r){return function(i){var o=t.getOption(i);return Qe(o)?n.empty:r(o.value)}}})},e.prototype.compose=function(t){return Qp(Zw(t)(this))},e.prototype.composePrism=function(t){return this.compose(t)},e.prototype.composeOptional=function(t){return xi(ge(this,Gw,Vl(t)))},e.prototype.composeTraversal=function(t){return Yr(ge(this,Jw,va(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return Qp(ge(this,Zw(ge(t,Qw))))},e.prototype.composeLens=function(t){return xi(L$e(t)(this))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),$z=new Rz(Q,Ft),B$e=function(){function e(t,n){this.getOption=t,this.set=n,this._tag="Optional"}return e.fromPath=function(){var t=e.fromNullableProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromNullableProp=function(){return function(t){return new e(function(n){return Nc(n[t])},function(n){return function(r){return r[t]==null?r:Iz(r,t,n)}})}},e.fromOptionProp=function(){var t=aM.fromProp();return function(n){return t(n).composePrism($z)}},e.prototype.modify=function(t){return F$e(t)(this)},e.prototype.modifyOption=function(t){return M$e(t)(this)},e.prototype.asTraversal=function(){return Yr(Ij(this))},e.prototype.asFold=function(){var t=this;return new cp(function(n){return function(r){return function(i){var o=t.getOption(i);return Qe(o)?n.empty:r(o.value)}}})},e.prototype.asSetter=function(){var t=this;return new Um(function(n){return t.modify(n)})},e.prototype.compose=function(t){return xi(Vl(t)(this))},e.prototype.composeOptional=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return Yr(ge(this,Ij,va(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeLens=function(t){return xi(ge(this,Vl(ge(t,Ns))))},e.prototype.composePrism=function(t){return xi(ge(this,Vl(ge(t,Gw))))},e.prototype.composeIso=function(t){return xi(ge(this,Vl(ge(t,Hw))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),P$e=function(){function e(t){this.modifyF=t,this._tag="Traversal"}return e.prototype.modify=function(t){return Tz(t)(this)},e.prototype.set=function(t){return D$e(t)(this)},e.prototype.filter=function(t){return Yr(U$e(t)(this))},e.prototype.asFold=function(){var t=this;return new cp(function(n){return function(r){return t.modifyF(XN(n))(function(i){return Af(r(i))})}})},e.prototype.asSetter=function(){var t=this;return new Um(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Yr(va(t)(this))},e.prototype.composeTraversal=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeOptional=function(t){return this.compose(t.asTraversal())},e.prototype.composeLens=function(t){return Yr(ge(this,va(ge(t,_d))))},e.prototype.composePrism=function(t){return Yr(ge(this,va(ge(t,Jw))))},e.prototype.composeIso=function(t){return Yr(ge(this,va(ge(t,Yw))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),kz=function(){function e(t){this.get=t,this._tag="Getter"}return e.prototype.asFold=function(){var t=this;return new cp(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){var n=this;return new e(function(r){return t.get(n.get(r))})},e.prototype.composeGetter=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeLens=function(t){return this.compose(t.asGetter())},e.prototype.composeIso=function(t){return this.compose(t.asGetter())},e.prototype.composeTraversal=function(t){return this.asFold().compose(t.asFold())},e.prototype.composeOptional=function(t){return this.asFold().compose(t.asFold())},e.prototype.composePrism=function(t){return this.asFold().compose(t.asFold())},e}(),cp=function(){function e(t){this.foldMap=t,this._tag="Fold",this.getAll=t(bI())(tl),this.exist=t(I6),this.all=t(T6),this.foldMapFirst=t(JN())}return e.prototype.compose=function(t){var n=this;return new e(function(r){return function(i){return n.foldMap(r)(t.foldMap(r)(i))}})},e.prototype.composeFold=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.compose(t.asFold())},e.prototype.composeTraversal=function(t){return this.compose(t.asFold())},e.prototype.composeOptional=function(t){return this.compose(t.asFold())},e.prototype.composeLens=function(t){return this.compose(t.asFold())},e.prototype.composePrism=function(t){return this.compose(t.asFold())},e.prototype.composeIso=function(t){return this.compose(t.asFold())},e.prototype.find=function(t){return this.foldMapFirst(S0(t))},e.prototype.headOption=function(t){return this.find(function(){return!0})(t)},e}(),Um=function(){function e(t){this.modify=t,this._tag="Setter"}return e.prototype.set=function(t){return this.modify(Ur(t))},e.prototype.compose=function(t){var n=this;return new e(function(r){return n.modify(t.modify(r))})},e.prototype.composeSetter=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return this.compose(t.asSetter())},e.prototype.composeOptional=function(t){return this.compose(t.asSetter())},e.prototype.composeLens=function(t){return this.compose(t.asSetter())},e.prototype.composePrism=function(t){return this.compose(t.asSetter())},e.prototype.composeIso=function(t){return this.compose(t.asSetter())},e}(),W$e=new Ez(hd,hd);function N$e(){return W$e}function K$e(e,t){t===void 0&&(t="fromNewtype("+e.name+")");var n=N$e();return new ke(t,function(r){return e.is(r)},function(r,i){return ge(e.validate(r,i),zc(n.wrap))},function(r){return e.encode(n.unwrap(r))})}var q$e=kh({_tag:jm("None")}),V$e=jm("Some");function Oz(e,t){return t===void 0&&(t="Option<"+e.name+">"),Lm([q$e,kh({_tag:V$e,value:e},"Some<"+e.name+">")],t)}function z$e(e,t){return t===void 0&&(t="Option<"+e.name+">"),new ke(t,Oz(e).is,function(n,r){return n==null?Ue(ft):ge(e.validate(n,r),zc(Ft))},function(n){return NI(ge(n,No(e.encode)))})}var Q$e=new ke("DateFromISOString",function(e){return e instanceof Date},function(e,t){return ge(go.validate(e,t),Mi(function(n){var r=new Date(n);return isNaN(r.getTime())?it(e,t):Ue(r)}))},function(e){return e.toISOString()});function H$e(e,t){return t===void 0&&(t="ReadonlyNonEmptyArray<"+e.name+">"),uz(e,t)}function Mz(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}var Y$e=new ke("DateFromNumber",function(e){return e instanceof Date},function(e,t){return ge(_u.validate(e,t),Mi(function(n){var r=new Date(n);return isNaN(r.getTime())?it(e,t):Ue(r)}))},function(e){return e.getTime()});function E1(e,t,n){n===void 0&&(n=e.name);var r=Mz(e);return r.validate=t,r.decode=function(i){return t(i,iz(r))},r.name=n,r}function G$e(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),E1(e,function(r,i){return RK(function(){return Ue(t)})(e.validate(r,i))},n)}var J$e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Z$e=S1(go,function(e){return J$e.test(e)},"UUID");function X$e(e,t,n){return n===void 0&&(n="fromNullable("+e.name+")"),E1(e,function(r,i){return r==null?Ue(t):e.validate(r,i)},n)}var eke=new ke("BooleanFromString",C1.is,function(e,t){return ge(go.validate(e,t),Mi(function(n){return n==="true"?Ue(!0):n==="false"?Ue(!1):it(e,t)}))},String);function tke(e,t){return E1(e,function(n,r){return RA(function(){return[{value:n,context:r,message:t(n,r),actual:n}]})(e.validate(n,r))})}function Fz(e){switch(e._tag){case"InterfaceType":return e.props;case"ExactType":return Fz(e.type)}}var nke=aM.fromProp();function rke(e){var t={};for(var n in Fz(e))t[n]=nke(n);return t}var ike=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},oke=XO("RegExp",ike),ake=new ke("DateFromUnixTime",function(e){return e instanceof Date},function(e,t){return ge(Rv.validate(e,t),Mi(function(n){var r=new Date(n*1e3);return isNaN(r.getTime())?it(e,t):Ue(r)}))},function(e){return Math.floor(e.getTime()/1e3)}),Xw=new ke("NumberFromString",_u.is,function(e,t){return ge(go.validate(e,t),Mi(function(n){var r=+n;return isNaN(r)||n.trim()===""?it(e,t):Ue(r)}))},String),ske=new ke("IntFromString",Rv.is,function(e,t){return ge(Xw.validate(e,t),Mi(function(n){return Rv.is(n)?Ue(n):it(e,t)}))},Xw.encode),jz=HO("JsonArray",function(){return ez(R1)}),Lz=HO("JsonRecord",function(){return GO(go,R1)}),R1=Lm([C1,_u,go,qw,jz,Lz],"Json"),lke=new ke("JsonFromString",R1.is,function(e,t){try{return Ue(JSON.parse(e))}catch{return it(e,t)}},function(e){return JSON.stringify(e)}),cke=jm("Left"),uke=jm("Right");function dke(e,t,n){return n===void 0&&(n="Either<"+e.name+", "+t.name+">"),Lm([kh({_tag:cke,left:e},"Left<"+e.name+">"),kh({_tag:uke,right:t},"Right<"+e.name+">")],n)}var fke=new ke("BigIntFromString",function(e){return typeof e=="bigint"},function(e,t){return ge(go.validate(e,t),Mi(function(n){if(!cz.is(n.trim()))return it(e,t);try{return Ue(BigInt(n))}catch{return it(e,t)}}))},String);function pke(e,t,n){return n===void 0&&(n=e.name),new ke(n,e.is,e.validate,t)}var hke=new ke("BooleanFromNumber",C1.is,function(e,t){return ge(_u.validate(e,t),zc(function(n){return n!==0}))},Number);const Ake=Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:fke,BooleanFromNumber:hke,BooleanFromString:eke,DateFromISOString:Q$e,DateFromNumber:Y$e,DateFromUnixTime:ake,IntFromString:ske,Json:R1,JsonArray:jz,JsonFromString:lke,JsonRecord:Lz,NonEmptyString:cz,NumberFromString:Xw,UUID:Z$e,clone:Mz,date:IRe,either:dke,fromNewtype:K$e,fromNullable:X$e,fromRefinement:XO,getLenses:rke,mapOutput:lz,nonEmptyArray:uz,option:Oz,optionFromNullable:z$e,readonlyNonEmptyArray:H$e,readonlySetFromArray:_Re,regexp:oke,setFromArray:dz,withEncode:pke,withFallback:G$e,withMessage:tke,withValidate:E1},Symbol.toStringTag,{value:"Module"})),$1=Mc(Ake),mke=Mc(xRe);Object.defineProperty(nt,"__esModule",{value:!0});nt.withCustomError=nt.addType=nt.isEmpty=nt.objectToMap=nt.grouped=nt.formatDate=nt.formatDateTime=nt.filterDouble=nt.refineType=nt.nullable=void 0;const gke=G,Dz=lt,vke=vo,ad=(0,gke.__importStar)(ne),yke=$1,bke=mke;function Cke(e){return ad.union([e,ad.null,ad.undefined])}nt.nullable=Cke;function Ske(e,t,n){return new ad.Type(t,e.is,(r,i)=>(0,vke.pipe)(e.validate(r,i),Dz.either.chain(o=>n(o)?ad.success(o):ad.failure(r,i))),e.encode)}nt.refineType=Ske;function wke(e){if(e==="")return null;const t=Number(e);return Number.isNaN(t)?null:t}nt.filterDouble=wke;function xke(e){return e.toISOString().replace(/\.\d{3}Z$/,"+0000")}nt.formatDateTime=xke;function _ke(e){return e.toISOString().replace(/T.*/,"")}nt.formatDate=_ke;function Tke(e,t){return e.reduce((n,r,i)=>(i%t===0?n.push([r]):n[Math.floor(i/t)].push(r),n),new Array)}nt.grouped=Tke;function Ike(e){return new Map(Object.entries(e))}nt.objectToMap=Ike;function Eke(e){for(const t in e)return!1;return!0}nt.isEmpty=Eke;function Rke(e,t){return(0,bke.mapOutput)(e,n=>({...n,__TYPE__:t}))}nt.addType=Rke;function $ke(e,t){return(0,yke.withValidate)(e,(n,r)=>Dz.either.mapLeft(i=>i.find(o=>o.message)?i:[{value:n,context:r,message:t(n,r),actual:n}])(e.validate(n,r)))}nt.withCustomError=$ke;Object.defineProperty(T1,"__esModule",{value:!0});T1.WidgetKey=void 0;const kke=G,Oke=(0,kke.__importStar)(ne),Mke=nt,Fke=new RegExp("^[^<>]+$");T1.WidgetKey=(0,Mke.refineType)(Oke.string,"WidgetKey",e=>e.length===0||Fke.test(e));(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(x1,e),(0,t.__exportStar)(_1,e),(0,t.__exportStar)(T1,e)})(Tu);var he={},Uz={},up={},k1={},O1={};Object.defineProperty(O1,"__esModule",{value:!0});O1.clone=void 0;function jke(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}O1.clone=jke;var Lke=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Dke=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Uke=Se&&Se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&Lke(t,e,n);return Dke(t,e),t};Object.defineProperty(k1,"__esModule",{value:!0});k1.withValidate=void 0;var Bke=Uke(ne),Pke=O1;function Wke(e,t,n){n===void 0&&(n=e.name);var r=Pke.clone(e);return r.validate=t,r.decode=function(i){return t(i,Bke.getDefaultContext(r))},r.name=n,r}k1.withValidate=Wke;var Nke=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Kke=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),qke=Se&&Se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&Nke(t,e,n);return Kke(t,e),t};Object.defineProperty(up,"__esModule",{value:!0});up.withFallback=void 0;var Vke=qke(ne),zke=k1,Qke=un;function Hke(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),zke.withValidate(e,function(r,i){return Qke.orElse(function(){return Vke.success(t)})(e.validate(r,i))},n)}up.withFallback=Hke;var YC={},pn={};Object.defineProperty(pn,"__esModule",{value:!0});pn.EmptyArray=pn.EmptyObject=pn.Boolean=pn.NumberOrNull=pn.Number=pn.StringOrNull=pn.String=void 0;const Yke=G,Gke=lt,Jke=Ye,Xt=(0,Yke.__importStar)(ne),Bm=nt;pn.String=(0,Bm.withCustomError)(Xt.string,()=>"The value must be a string");pn.StringOrNull=(0,Bm.withCustomError)(Xt.union([Xt.string,Xt.null]),()=>"The value must be a string or null");pn.Number=(0,Bm.withCustomError)(Xt.number,()=>"The value must be a number");pn.NumberOrNull=(0,Bm.withCustomError)(Xt.union([Xt.number,Xt.null]),()=>"The value must be a number or null");pn.Boolean=(0,Bm.withCustomError)(Xt.boolean,()=>"The value must be a boolean");pn.EmptyObject=Xt.UnknownRecord.pipe(new Xt.Type("emptyObject",e=>Xt.UnknownRecord.is(e),(e,t)=>Object.keys(e).length>0?Xt.failure(e,t,"The object is not empty."):Xt.success({}),Xt.identity));pn.EmptyArray=new Xt.Type("emptyArray",e=>Xt.UnknownArray.is(e)&&e.length===0,(e,t)=>(0,Jke.pipe)(Xt.UnknownArray.decode(e),Gke.either.chain(n=>n.length>0?Xt.failure(e,t,"The array is not empty."):Xt.success(new Array))),()=>[]);var hg={};const cs=Mc(DK);var Rj;function Zke(){if(Rj)return hg;Rj=1,Object.defineProperty(hg,"__esModule",{value:!0});const e=G,t=cs,n=vo,r=(0,e.__importStar)(ne),i=pt();return hg.default=new r.Type("dateFromString",o=>o instanceof Date,(o,a)=>(0,n.pipe)(i.String.validate(o,a),(0,t.chain)(s=>{const l=new Date(s);return isNaN(l.getTime())?r.failure(o,a):r.success(l)})),o=>o.toISOString()),hg}var sM={};Object.defineProperty(sM,"__esModule",{value:!0});const Xke=G,eOe=cs,tOe=vo,Uu=(0,Xke.__importStar)(ne);sM.default=new Uu.Type("dateFromStringOrNumber",e=>e instanceof Date,(e,t)=>(0,tOe.pipe)(Uu.union([Uu.number,Uu.string]).validate(e,t),(0,eOe.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?Uu.failure(e,t):Uu.success(r)})),e=>e);var lM={};Object.defineProperty(lM,"__esModule",{value:!0});const nOe=G,rOe=cs,iOe=vo,Ag=(0,nOe.__importStar)(ne);lM.default=new Ag.Type("dateFromTsMs",e=>e instanceof Date,(e,t)=>(0,iOe.pipe)(Ag.number.validate(e,t),(0,rOe.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?Ag.failure(e,t):Ag.success(r)})),e=>e.getTime());var Bz={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyArrayOrElse=e.EmptyObjectOrElse=e.NullOrElse=e.DefaultOrElse=void 0;const t=G,n=un,r=(0,t.__importStar)(ne),i=pn,o=c=>u=>new r.Type(`DefaultOrElse<${c.name}, ${u.name}>`,f=>f===null||u.is(f),(f,p)=>(0,n.isRight)(c.validate(f,p))?r.success(null):u.validate(f,p),f=>f?u.encode(f):void 0);e.DefaultOrElse=o;const a=c=>(0,e.DefaultOrElse)(r.null)(c);e.NullOrElse=a;const s=c=>(0,e.DefaultOrElse)(i.EmptyObject)(c);e.EmptyObjectOrElse=s;const l=c=>(0,e.DefaultOrElse)(i.EmptyArray)(c);e.EmptyArrayOrElse=l})(Bz);var cM={};Object.defineProperty(cM,"__esModule",{value:!0});const oOe=G,aOe=cs,sOe=vo,Ml=(0,oOe.__importStar)(ne);cM.default=new Ml.Type("IntFromNumber",Ml.Int.is,(e,t)=>(0,sOe.pipe)(Ml.number.validate(e,t),(0,aOe.chain)(n=>Ml.Int.is(n)?Ml.success(n):Ml.success(Math.round(n)))),Ml.Int.encode);var uM={};Object.defineProperty(uM,"__esModule",{value:!0});const lOe=G,cOe=cs,uOe=vo,Bu=(0,lOe.__importStar)(ne),dOe=/^([0-9]+)px$/;uM.default=new Bu.Type("IntFromPixels",Bu.Int.is,(e,t)=>(0,uOe.pipe)(Bu.string.validate(e,t),(0,cOe.chain)(n=>{try{const r=n.match(dOe);if(!r)return Bu.failure(e,t);const i=parseInt(r[1]);return Bu.success(i)}catch{return Bu.failure(e,t)}})),String);var dM={};Object.defineProperty(dM,"__esModule",{value:!0});const fOe=G,pOe=(0,fOe.__importStar)(ne),$j=nt;dM.default=(0,$j.withCustomError)((0,$j.refineType)(pOe.string,"nonEmptyString",e=>e.trim().length>0),()=>"The value must be a non-empty string");var fM={},M1={};Object.defineProperty(M1,"__esModule",{value:!0});const hOe=G,AOe=(0,hOe.__importStar)(ne),mOe=nt;M1.default=(0,mOe.nullable)(AOe.string);Object.defineProperty(fM,"__esModule",{value:!0});const gOe=G,vOe=cs,yOe=vo,GC=ne,bOe=(0,gOe.__importDefault)(M1);fM.default=new GC.Type("nonEmptyStringOrNull",e=>typeof e=="string"||e===null,(e,t)=>(0,yOe.pipe)(bOe.default.validate(e,t),(0,vOe.chain)(n=>typeof n=="string"&&n.length>0?(0,GC.success)(n):(0,GC.success)(null))),e=>e);var pM={};Object.defineProperty(pM,"__esModule",{value:!0});const COe=G,SOe=(0,COe.__importStar)(ne),wOe=nt;pM.default=(0,wOe.nullable)(SOe.number);var hM={};Object.defineProperty(hM,"__esModule",{value:!0});const xOe=G,mg=(0,xOe.__importStar)(ne),kj=pn;hM.default=(e,t,n)=>kj.Number.pipe(new mg.Type("numberInRange",r=>kj.Number.is(r),(r,i)=>r>t||r<e?mg.failure(r,i,`${n} must be a number between ${e} and ${t}`):mg.success(r),mg.identity));var AM={};Object.defineProperty(AM,"__esModule",{value:!0});const _Oe=G,TOe=cs,IOe=vo,gg=(0,_Oe.__importStar)(ne);AM.default=new gg.Type("StringFromInt",gg.string.is,(e,t)=>(0,IOe.pipe)(gg.boolean.validate(e,t),(0,TOe.chain)(n=>gg.success(n.toString()))),e=>e);var mM={};Object.defineProperty(mM,"__esModule",{value:!0});const EOe=G,ROe=cs,$Oe=vo,vg=(0,EOe.__importStar)(ne);mM.default=new vg.Type("StringFromInt",vg.string.is,(e,t)=>(0,$Oe.pipe)(vg.number.validate(e,t),(0,ROe.chain)(n=>vg.success(n.toString()))),e=>e);var Oj;function pt(){return Oj||(Oj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StringOrNull=e.StringFromNumber=e.StringFromBoolean=e.NumberRange=e.NumberOrNull=e.NonEmptyStringOrNull=e.NonEmptyString=e.IntFromPixels=e.IntFromNumber=e.Function=e.DateFromTsMs=e.DateFromStringOrNumber=e.DateFromString=void 0;const t=G;(0,t.__exportStar)(pn,e);var n=Zke();Object.defineProperty(e,"DateFromString",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}});var r=sM;Object.defineProperty(e,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}});var i=lM;Object.defineProperty(e,"DateFromTsMs",{enumerable:!0,get:function(){return(0,t.__importDefault)(i).default}}),(0,t.__exportStar)(Bz,e),e.Function=(0,t.__importStar)(nt);var o=cM;Object.defineProperty(e,"IntFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(o).default}});var a=uM;Object.defineProperty(e,"IntFromPixels",{enumerable:!0,get:function(){return(0,t.__importDefault)(a).default}});var s=dM;Object.defineProperty(e,"NonEmptyString",{enumerable:!0,get:function(){return(0,t.__importDefault)(s).default}});var l=fM;Object.defineProperty(e,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(l).default}});var c=pM;Object.defineProperty(e,"NumberOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(c).default}});var u=hM;Object.defineProperty(e,"NumberRange",{enumerable:!0,get:function(){return(0,t.__importDefault)(u).default}});var f=AM;Object.defineProperty(e,"StringFromBoolean",{enumerable:!0,get:function(){return(0,t.__importDefault)(f).default}});var p=mM;Object.defineProperty(e,"StringFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(p).default}});var h=M1;Object.defineProperty(e,"StringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(h).default}})}(YC)),YC}var zi={},Gr={},dp={},us={},gM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanField=e.BooleanConfig=e.BooleanFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();e.BooleanFieldType="Boolean",e.BooleanConfig=n.exact(n.partial({label:r.StringOrNull,default_value:n.boolean,placeholder_true:n.string,placeholder_false:n.string})),e.BooleanField=n.exact(n.intersection([n.type({type:n.literal(e.BooleanFieldType)}),n.partial({config:e.BooleanConfig})]))})(gM);var vM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Color=e.ColorConfig=e.ColorFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();e.ColorFieldType="Color",e.ColorConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string})),e.Color=n.exact(n.intersection([n.type({type:n.literal(e.ColorFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ColorConfig})]))})(vM);var yM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Date=e.DateConfig=e.DateFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();e.DateFieldType="Date",e.DateConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Date=n.exact(n.intersection([n.type({type:n.literal(e.DateFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.DateConfig})]))})(yM);var bM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Embed=e.EmbedConfig=e.EmbedFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();e.EmbedFieldType="Embed",e.EmbedConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,useAsTitle:n.boolean})),e.Embed=n.exact(n.intersection([n.type({type:n.literal(e.EmbedFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.EmbedConfig})]))})(bM);var CM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPoint=e.GeoPointConfig=e.GeoPointFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();e.GeoPointFieldType="GeoPoint",e.GeoPointConfig=n.exact(n.partial({label:r.StringOrNull})),e.GeoPoint=n.exact(n.intersection([n.type({type:n.literal(e.GeoPointFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.GeoPointConfig})]))})(CM);var SM={},Pm={},F1={},fp={},bc={};Object.defineProperty(bc,"__esModule",{value:!0});bc.pipe=bc.pipeable=void 0;var ex=Ye,kOe=function(e){return typeof e.map=="function"},OOe=function(e){return typeof e.contramap=="function"},MOe=function(e){return typeof e.mapWithIndex=="function"},FOe=function(e){return typeof e.ap=="function"},jOe=function(e){return typeof e.chain=="function"},LOe=function(e){return typeof e.bimap=="function"},DOe=function(e){return typeof e.extend=="function"},UOe=function(e){return typeof e.reduce=="function"},BOe=function(e){return typeof e.reduceWithIndex=="function"},POe=function(e){return typeof e.alt=="function"},WOe=function(e){return typeof e.compact=="function"},NOe=function(e){return typeof e.filter=="function"},KOe=function(e){return typeof e.filterWithIndex=="function"},qOe=function(e){return typeof e.promap=="function"},VOe=function(e){return typeof e.compose=="function"},zOe=function(e){return typeof e.throwError=="function"};function QOe(e){var t={};if(kOe(e)){var n=function(F){return function(M){return e.map(M,F)}};t.map=n}if(OOe(e)){var r=function(F){return function(M){return e.contramap(M,F)}};t.contramap=r}if(MOe(e)){var i=function(F){return function(M){return e.mapWithIndex(M,F)}};t.mapWithIndex=i}if(FOe(e)){var o=function(F){return function(M){return e.ap(M,F)}},a=function(F){return function(M){return e.ap(e.map(M,function(W){return function(){return W}}),F)}};t.ap=o,t.apFirst=a,t.apSecond=function(F){return function(M){return e.ap(e.map(M,function(){return function(W){return W}}),F)}}}if(jOe(e)){var s=function(F){return function(M){return e.chain(M,F)}},l=function(F){return function(M){return e.chain(M,function(W){return e.map(F(W),function(){return W})})}},c=function(F){return e.chain(F,ex.identity)};t.chain=s,t.chainFirst=l,t.flatten=c}if(LOe(e)){var u=function(F,M){return function(W){return e.bimap(W,F,M)}},f=function(F){return function(M){return e.mapLeft(M,F)}};t.bimap=u,t.mapLeft=f}if(DOe(e)){var p=function(F){return function(M){return e.extend(M,F)}},h=function(F){return e.extend(F,ex.identity)};t.extend=p,t.duplicate=h}if(UOe(e)){var m=function(F,M){return function(W){return e.reduce(W,F,M)}},g=function(F){var M=e.foldMap(F);return function(W){return function(re){return M(re,W)}}},y=function(F,M){return function(W){return e.reduceRight(W,F,M)}};t.reduce=m,t.foldMap=g,t.reduceRight=y}if(BOe(e)){var C=function(F,M){return function(W){return e.reduceWithIndex(W,F,M)}},x=function(F){var M=e.foldMapWithIndex(F);return function(W){return function(re){return M(re,W)}}},b=function(F,M){return function(W){return e.reduceRightWithIndex(W,F,M)}};t.reduceWithIndex=C,t.foldMapWithIndex=x,t.reduceRightWithIndex=b}if(POe(e)){var v=function(F){return function(M){return e.alt(M,F)}};t.alt=v}if(WOe(e)&&(t.compact=e.compact,t.separate=e.separate),NOe(e)){var S=function(F){return function(M){return e.filter(M,F)}},w=function(F){return function(M){return e.filterMap(M,F)}},T=function(F){return function(M){return e.partition(M,F)}},E=function(F){return function(M){return e.partitionMap(M,F)}};t.filter=S,t.filterMap=w,t.partition=T,t.partitionMap=E}if(KOe(e)){var R=function(F){return function(M){return e.filterWithIndex(M,F)}},O=function(F){return function(M){return e.filterMapWithIndex(M,F)}},k=function(F){return function(M){return e.partitionWithIndex(M,F)}},B=function(F){return function(M){return e.partitionMapWithIndex(M,F)}};t.filterWithIndex=R,t.filterMapWithIndex=O,t.partitionWithIndex=k,t.partitionMapWithIndex=B}if(qOe(e)){var K=function(F,M){return function(W){return e.promap(W,F,M)}};t.promap=K}if(VOe(e)){var H=function(F){return function(M){return e.compose(M,F)}};t.compose=H}if(zOe(e)){var z=function(F){return function(M){return M._tag==="None"?e.throwError(F()):e.of(M.value)}},N=function(F){return F._tag==="Left"?e.throwError(F.left):e.of(F.right)},Y=function(F,M){return function(W){return F(W)?e.of(W):e.throwError(M(W))}},ee=function(F,M){return function(W){return e.chain(W,function(re){return F(re)?e.of(re):e.throwError(M(re))})}};t.fromOption=z,t.fromEither=N,t.fromPredicate=Y,t.filterOrElse=ee}return t}bc.pipeable=QOe;bc.pipe=ex.pipe;var HOe=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),YOe=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),GOe=Se&&Se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&HOe(t,e,n);return YOe(t,e),t};Object.defineProperty(fp,"__esModule",{value:!0});fp.NumberFromString=void 0;var vp=GOe(ne),JOe=bc,ZOe=un;fp.NumberFromString=new vp.Type("NumberFromString",vp.number.is,function(e,t){return JOe.pipe(vp.string.validate(e,t),ZOe.chain(function(n){var r=+n;return isNaN(r)||n.trim()===""?vp.failure(e,t):vp.success(r)}))},String);var XOe=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),eMe=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),tMe=Se&&Se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&XOe(t,e,n);return eMe(t,e),t};Object.defineProperty(F1,"__esModule",{value:!0});F1.IntFromString=void 0;var yp=tMe(ne),Mj=fp,nMe=bc,rMe=un;F1.IntFromString=new yp.Type("IntFromString",yp.Int.is,function(e,t){return nMe.pipe(Mj.NumberFromString.validate(e,t),rMe.chain(function(n){return yp.Int.is(n)?yp.success(n):yp.failure(e,t)}))},Mj.NumberFromString.encode);Object.defineProperty(Pm,"__esModule",{value:!0});const iMe=G,oMe=un,fa=(0,iMe.__importStar)(ne),aMe=F1,Fj=pt(),jj=new fa.Type("SideConstraints",e=>!e||typeof e=="number",(e,t)=>oMe.either.chain(fa.union([fa.literal("auto"),fa.literal(""),fa.Int,aMe.IntFromString,Fj.IntFromNumber,Fj.IntFromPixels,fa.null]).validate(e,t),n=>n==="auto"||n===""?fa.success(null):fa.success(n)),e=>e),sMe=fa.partial({width:jj,height:jj});Pm.default=sMe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Image=e.ImageConfig=e.Thumbnail=e.ImageFieldType=void 0;const t=G,n=(0,t.__importStar)(ne),r=pt(),i=(0,t.__importDefault)(Pm);e.ImageFieldType="Image",e.Thumbnail=n.exact(n.intersection([n.type({name:n.string}),i.default])),e.ImageConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,constraint:i.default,thumbnails:n.readonlyArray(e.Thumbnail)})),e.Image=n.exact(n.intersection([n.type({type:n.literal(e.ImageFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ImageConfig})]))})(SM);var wM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationField=e.IntegrationFieldConfig=e.IntegrationFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();e.IntegrationFieldType="IntegrationFields",e.IntegrationFieldConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,catalog:n.string})),e.IntegrationField=n.exact(n.intersection([n.type({type:n.literal(e.IntegrationFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.IntegrationFieldConfig})]))})(wM);var xM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Link=e.LinkConfig=e.LinkFieldType=void 0;const t=G,n=un,r=(0,t.__importStar)(ne),i=up,o=pt(),a=c=>{if(c instanceof Array&&c.reduce((f,p)=>f&&typeof p=="string",!0))return r.success(c)},s=c=>{if(typeof c=="string")return r.success([c])},l=new r.Type("MasksArrayString",c=>c instanceof Array,(c,u)=>n.either.chain(r.union([r.array(r.string),r.string]).validate(c,u),f=>a(f)||s(f)||r.failure(c,u)),c=>c);e.LinkFieldType="Link",e.LinkConfig=r.exact(r.partial({label:o.StringOrNull,useAsTitle:r.boolean,placeholder:r.string,select:(0,i.withFallback)(r.union([r.literal("media"),r.literal("document"),r.literal("web"),r.null]),null),customtypes:r.readonlyArray(r.string),masks:l,tags:l,allowTargetBlank:r.boolean,allowText:r.boolean,repeat:r.boolean,variants:r.array(r.string)})),e.Link=r.exact(r.intersection([r.type({type:r.literal(e.LinkFieldType)}),r.partial({fieldset:o.StringOrNull,config:e.LinkConfig})]))})(xM);var _M={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Number=e.NumberConfig=e.NumberFieldType=void 0;const n=(0,G.__importStar)(ne),r=fp,i=pt();e.NumberFieldType="Number",e.NumberConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Number=n.exact(n.intersection([n.type({type:n.literal(e.NumberFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.NumberConfig})]))})(_M);var TM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Range=e.RangeConfig=e.RangeFieldType=void 0;const n=(0,G.__importStar)(ne),r=fp,i=pt();e.RangeFieldType="Range",e.RangeConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Range=n.exact(n.intersection([n.type({type:n.literal(e.RangeFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.RangeConfig})]))})(TM);var j1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichText=e.RichTextConfig=e.RichTextNodeTypeCodec=e.RichTextNodeType=e.DEFAULT_OPTION=e.RichTextFieldType=void 0;const t=G,n=lt,r=un,i=Ye,o=(0,t.__importStar)(ne),a=pt(),s=(0,t.__importDefault)(Pm);e.RichTextFieldType="StructuredText",e.DEFAULT_OPTION="paragraph",e.RichTextNodeType={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",strong:"strong",em:"em",preformatted:"preformatted",hyperlink:"hyperlink",image:"image",embed:"embed",list:"list-item",orderedList:"o-list-item",rtl:"rtl"},e.RichTextNodeTypeCodec=o.keyof({[e.RichTextNodeType.heading1]:null,[e.RichTextNodeType.heading2]:null,[e.RichTextNodeType.heading3]:null,[e.RichTextNodeType.heading4]:null,[e.RichTextNodeType.heading5]:null,[e.RichTextNodeType.heading6]:null,[e.RichTextNodeType.paragraph]:null,[e.RichTextNodeType.strong]:null,[e.RichTextNodeType.em]:null,[e.RichTextNodeType.preformatted]:null,[e.RichTextNodeType.hyperlink]:null,[e.RichTextNodeType.image]:null,[e.RichTextNodeType.embed]:null,[e.RichTextNodeType.list]:null,[e.RichTextNodeType.orderedList]:null,[e.RichTextNodeType.rtl]:null});const l=new o.Type("RichTextOptions",m=>typeof m=="string",m=>(0,i.pipe)(o.union([o.string,o.null]).decode(m),n.either.map(g=>{if(!g)return e.DEFAULT_OPTION;const C=g.split(",").map(x=>x.trim()).filter(x=>(0,r.getOrElseW)(()=>{})(e.RichTextNodeTypeCodec.decode(x)));return C.length?C.join(","):e.DEFAULT_OPTION})),m=>m),c=m=>{if(!m)return o.success([])},u=m=>{if(m instanceof Object){const g=m;if(!Object.entries(g).length)return o.success([]);if(g[""])return o.success(g[""].map(C=>C.name));const y=Object.entries(g).reduce((C,[,x])=>C.concat(x.map(b=>b.name)),[]).filter(Boolean);return o.success(y)}},f=m=>{if(m instanceof Array&&m.reduce((y,C)=>y&&typeof C=="string",!0))return o.success(m)},p=m=>{if(typeof m=="string")return o.success([m])},h=new o.Type("RichTextLabels",m=>m instanceof Array,(m,g)=>{const y=o.record(o.string,o.readonlyArray(o.record(o.literal("name"),o.string))),C=o.readonlyArray(o.string);return(0,i.pipe)(o.union([y,C,o.string,o.null]).decode(m),n.either.chain(x=>c(x)||f(x)||u(x)||p(x)||o.failure(m,g)))},m=>m);e.RichTextConfig=o.exact(o.partial({label:a.StringOrNull,placeholder:o.string,useAsTitle:o.boolean,single:l,multi:l,imageConstraint:s.default,labels:h,allowTargetBlank:o.boolean})),e.RichText=o.exact(o.intersection([o.type({type:o.literal(e.RichTextFieldType)}),o.partial({fieldset:a.StringOrNull,config:e.RichTextConfig})]))})(j1);var IM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Select=e.SelectConfig=e.SelectFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();e.SelectFieldType="Select",e.SelectConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default_value:n.string,options:n.readonlyArray(n.union([n.string,r.StringFromNumber,r.StringFromBoolean]))})),e.Select=n.exact(n.intersection([n.type({type:n.literal(e.SelectFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.SelectConfig})]))})(IM);var EM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Separator=e.SeparatorConfig=e.SeparatorFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();e.SeparatorFieldType="Separator",e.SeparatorConfig=n.exact(n.partial({label:r.StringOrNull})),e.Separator=n.exact(n.intersection([n.type({type:n.literal(e.SeparatorFieldType)}),n.partial({config:e.SeparatorConfig})]))})(EM);var RM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TableCell=e.Table=e.TableFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt(),i=j1;e.TableFieldType="Table";const o=n.exact(n.partial({label:r.StringOrNull}));e.Table=n.exact(n.intersection([n.type({type:n.literal(e.TableFieldType)}),n.partial({config:o})])),e.TableCell={type:"StructuredText",config:{multi:[i.RichTextNodeType.paragraph,i.RichTextNodeType.strong,i.RichTextNodeType.em,i.RichTextNodeType.hyperlink].join(",")}}})(RM);var $M={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Text=e.TextConfig=e.TextFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();e.TextFieldType="Text",e.TextConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.Text=n.exact(n.intersection([n.type({type:n.literal(e.TextFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TextConfig})]))})($M);var kM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.TimestampConfig=e.TimestampFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();e.TimestampFieldType="Timestamp",e.TimestampConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Timestamp=n.exact(n.intersection([n.type({type:n.literal(e.TimestampFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TimestampConfig})]))})(kM);Object.defineProperty(us,"__esModule",{value:!0});us.NestableWidget=void 0;const lMe=G,cMe=(0,lMe.__importStar)(ne),uMe=gM,dMe=vM,fMe=yM,pMe=bM,hMe=CM,AMe=SM,mMe=wM,gMe=xM,vMe=_M,yMe=TM,bMe=j1,CMe=IM,SMe=EM,wMe=RM,xMe=$M,_Me=kM;us.NestableWidget=cMe.union([dMe.Color,uMe.BooleanField,pMe.Embed,hMe.GeoPoint,fMe.Date,vMe.Number,yMe.Range,bMe.RichText,CMe.Select,SMe.Separator,wMe.Table,xMe.Text,_Me.Timestamp,gMe.Link,AMe.Image,mMe.IntegrationField]);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Group=e.GroupConfig=e.NestedGroup=e.NestedGroupConfig=e.GroupFieldType=void 0;const n=(0,G.__importStar)(ne),r=Tu,i=pt(),o=us;e.GroupFieldType="Group";const a=l=>n.exact(n.partial({label:i.StringOrNull,repeat:n.boolean,fields:n.record(r.WidgetKey,l)})),s=l=>n.exact(n.intersection([n.type({type:n.literal(e.GroupFieldType)}),n.partial({fieldset:i.StringOrNull,icon:n.string,description:n.string,config:a(l)})]));e.NestedGroupConfig=a(o.NestableWidget),e.NestedGroup=s(o.NestableWidget),e.GroupConfig=a(n.union([o.NestableWidget,e.NestedGroup])),e.Group=s(n.union([o.NestableWidget,e.NestedGroup]))})(dp);var Wm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(gM,e),(0,t.__exportStar)(vM,e),(0,t.__exportStar)(yM,e),(0,t.__exportStar)(bM,e),(0,t.__exportStar)(CM,e),(0,t.__exportStar)(SM,e),(0,t.__exportStar)(wM,e),(0,t.__exportStar)(xM,e),(0,t.__exportStar)(us,e),(0,t.__exportStar)(_M,e),(0,t.__exportStar)(TM,e),(0,t.__exportStar)(j1,e),(0,t.__exportStar)(IM,e),(0,t.__exportStar)(EM,e),(0,t.__exportStar)(RM,e),(0,t.__exportStar)($M,e),(0,t.__exportStar)(kM,e)})(Wm);var OM={},L1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isCompositeSlice=e.CompositeSlice=e.CompositeSliceConfig=e.CompositeSliceType=void 0;const n=(0,G.__importStar)(ne),r=Tu,i=pt(),o=us;e.CompositeSliceType="Slice",e.CompositeSliceConfig=n.exact(n.partial({label:i.StringOrNull})),e.CompositeSlice=n.exact(n.intersection([n.type({type:n.literal(e.CompositeSliceType)}),n.partial({fieldset:i.StringOrNull,description:n.string,icon:n.string,display:n.string,"non-repeat":n.record(r.WidgetKey,o.NestableWidget),repeat:n.record(r.WidgetKey,o.NestableWidget),config:e.CompositeSliceConfig})]));function a(s){return s.type==="Slice"}e.isCompositeSlice=a})(L1);var Cc={};Object.defineProperty(Cc,"__esModule",{value:!0});Cc.isLegacySlice=Cc.LegacySlice=void 0;const TMe=G,IMe=(0,TMe.__importStar)(ne),EMe=dp,RMe=us;Cc.LegacySlice=IMe.union([RMe.NestableWidget,EMe.NestedGroup]);function $Me(e){return e.type!=="Slice"&&e.type!=="SharedSlice"}Cc.isLegacySlice=$Me;var Nm={},Sc={};Object.defineProperty(Sc,"__esModule",{value:!0});Sc.isSlicePrimaryWidget=Sc.SlicePrimaryWidget=void 0;const kMe=G,OMe=(0,kMe.__importStar)(ne),Pz=dp,Wz=Wm;Sc.SlicePrimaryWidget=OMe.union([Wz.NestableWidget,Pz.Group]);const MMe=e=>Wz.NestableWidget.is(e)||Pz.Group.is(e);Sc.isSlicePrimaryWidget=MMe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isDynamicSharedSlice=e.isStaticSharedSlice=e.SharedSlice=e.SharedSliceType=e.Variation=void 0;const n=(0,G.__importStar)(ne),r=up,i=Tu,o=us,a=Sc,s="https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format";e.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,r.withFallback)(n.string,s),docURL:n.string,version:n.string}),n.partial({display:n.string,primary:n.record(i.WidgetKey,a.SlicePrimaryWidget),items:n.record(i.WidgetKey,o.NestableWidget)})])),e.SharedSliceType="SharedSlice";const l=n.string,c=n.string;e.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(e.SharedSliceType),name:n.string,variations:n.readonlyArray(e.Variation)}),n.partial({description:n.string,legacyPaths:n.record(l,c)})]));function u(p){return p.type==="SharedSlice"}e.isStaticSharedSlice=u;function f(p){return p.type==="SharedSlice"}e.isDynamicSharedSlice=f})(Nm);var Km={};Object.defineProperty(Km,"__esModule",{value:!0});Km.SharedSliceRef=void 0;const FMe=G,JC=(0,FMe.__importStar)(ne),jMe=Nm;Km.SharedSliceRef=JC.exact(JC.type({type:JC.literal(jMe.SharedSliceType)}));(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Slices=e.DynamicSlices=e.StaticSlices=e.slicesReader=e.DynamicSlicesConfig=e.StaticSlicesConfig=e.slicesConfigReader=e.SlicesLabels=e.SlicesFieldType=e.LegacySlicesFieldType=void 0;const n=(0,G.__importStar)(ne),r=Tu,i=pt(),o=L1,a=Cc,s=Nm,l=Km;e.LegacySlicesFieldType="Choice",e.SlicesFieldType="Slices",e.SlicesLabels=n.union([n.record(n.string,n.readonlyArray(n.exact(n.intersection([n.type({name:n.string}),n.partial({display:n.string})])))),n.null]);function c(p){return n.exact(n.partial({label:i.StringOrNull,labels:e.SlicesLabels,choices:n.record(r.WidgetKey,n.union([a.LegacySlice,o.CompositeSlice,p]))}))}e.slicesConfigReader=c,e.StaticSlicesConfig=c(s.SharedSlice),e.DynamicSlicesConfig=c(l.SharedSliceRef);const u={toStatic(p,h){const m=Object.entries(p.choices||{}).reduce((g,[y,C])=>{if(C.type==="SharedSlice"){const x=h.get(y);return x?{...g,[y]:x}:g}else return{...g,[y]:C}},{});return{...p,choices:m}}};function f(p){return n.exact(n.intersection([n.type({type:n.keyof({[e.SlicesFieldType]:null,[e.LegacySlicesFieldType]:null})}),n.partial({fieldset:i.StringOrNull,config:p})]))}e.slicesReader=f,e.StaticSlices=f(e.StaticSlicesConfig),e.DynamicSlices=f(e.DynamicSlicesConfig),e.Slices={toStatic(p,h){return p.config?{...p,config:u.toStatic(p.config,h)}:p}}})(OM);var MM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UID=e.UIDConfig=e.UIDFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();e.UIDFieldType="UID",e.UIDConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.UID=n.exact(n.intersection([n.type({type:n.literal(e.UIDFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.UIDConfig})]))})(MM);Object.defineProperty(Gr,"__esModule",{value:!0});Gr.Widgets=Gr.FieldType=Gr.DynamicWidget=Gr.StaticWidget=Gr.widgetReader=void 0;const LMe=G,Nz=(0,LMe.__importStar)(ne),Kz=dp,Vn=Wm,DMe=us,Oh=OM,qz=MM;function FM(e){return Nz.union([qz.UID,DMe.NestableWidget,Kz.Group,e])}Gr.widgetReader=FM;Gr.StaticWidget=FM(Oh.StaticSlices);Gr.DynamicWidget=FM(Oh.DynamicSlices);Gr.FieldType=Nz.keyof({[Vn.ColorFieldType]:null,[Vn.BooleanFieldType]:null,[Vn.NumberFieldType]:null,[Vn.EmbedFieldType]:null,[Vn.GeoPointFieldType]:null,[Vn.DateFieldType]:null,[Vn.RangeFieldType]:null,[Vn.RichTextFieldType]:null,[Vn.SelectFieldType]:null,[Vn.SeparatorFieldType]:null,[Vn.TableFieldType]:null,[Vn.TextFieldType]:null,[Vn.TimestampFieldType]:null,[Vn.LinkFieldType]:null,[Vn.ImageFieldType]:null,[Vn.IntegrationFieldType]:null,[qz.UIDFieldType]:null,[Kz.GroupFieldType]:null,[Oh.SlicesFieldType]:null,[Oh.LegacySlicesFieldType]:null});Gr.Widgets={toStatic(e,t){switch(e.type){case"Choice":case"Slices":return Oh.Slices.toStatic(e,t);default:return e}}};Object.defineProperty(zi,"__esModule",{value:!0});zi.Sections=zi.DynamicSection=zi.StaticSection=zi.sectionReader=void 0;const UMe=G,BMe=(0,UMe.__importStar)(ne),PMe=Tu,jM=Gr;function LM(e){return BMe.record(PMe.WidgetKey,e)}zi.sectionReader=LM;zi.StaticSection=LM(jM.StaticWidget);zi.DynamicSection=LM(jM.DynamicWidget);zi.Sections={toStatic(e,t){return Object.entries(e).reduce((r,[i,o])=>({...r,[i]:jM.Widgets.toStatic(o,t)}),{})}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.collectSharedSlices=e.flattenCustomTypeFields=e.filterMissingSharedSlices=e.collectWidgets=e.validateSlices=e.toStatic=e.flattenSections=e.flattenWidgets=e.CustomType=e.StaticCustomType=e.CustomTypeFormat=void 0;const t=G,n=un,r=(0,t.__importStar)(ne),i=up,o=pt(),a=zi;e.CustomTypeFormat={page:"page",custom:"custom"};class s extends Error{constructor(v){super(),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.slices=v,this.message=this._formatError(v)}_formatError(v){return`The following slices doesn't exists in your Prismic repository:
3
+ ${v.map(w=>` - ${w}`).join(`
4
+ `)}
5
+ `}}function l(b){return r.exact(r.intersection([r.type({id:r.string,label:o.StringOrNull,repeatable:(0,i.withFallback)(r.boolean,!0),json:r.record(r.string,b),status:(0,i.withFallback)(r.boolean,!0)}),r.partial({format:(0,i.withFallback)(r.keyof(e.CustomTypeFormat),"custom")})]))}e.StaticCustomType=l(a.StaticSection),e.CustomType=l(a.DynamicSection);function c(b){return Object.entries(b.json).reduce((v,[,S])=>{const w=Object.entries(S);return v.concat(w)},[])}e.flattenWidgets=c;function u(b){return Object.entries(b.json).reduce((v,[,S])=>{const w=Object.entries(S);return v.concat(w)},[])}e.flattenSections=u;function f(b){return c(b).filter(([,w])=>w.type==="Slices").reduce((w,[,T])=>{const E=Object.entries(T.config&&T.config.choices?T.config.choices:{}).filter(([,R])=>R.type==="SharedSlice").map(([R])=>R);return w.concat(E)},[])}function p(b){const v=f(b);return function(S){return v.map(S)}}function h(b,v){const S=Object.entries(b.json).reduce((w,[T,E])=>({...w,[T]:a.Sections.toStatic(E,v)}),{});return{...b,json:S}}e.toStatic=h;function m(b,v){const S=p(b)(w=>{if(!v.get(w))return w}).filter(Boolean);return S.length>0?(0,n.left)(new s(S)):(0,n.right)(b)}e.validateSlices=m;function g(b,v){const S=Object.entries(b.json).reduce((w,[T,E])=>{const R=Object.entries(E).reduce((O,[k,B])=>{const K=v(k,B);return K?{...O,[k]:K}:O},{});return{...w,[T]:R}},{});return{...b,json:S}}e.collectWidgets=g;function y(b,v){return g(b,(S,w)=>{if(w.type==="Slices"){if(!w.config||!w.config.choices)return w;const T=Object.entries(w.config.choices).reduce((R,[O,k])=>k.type==="SharedSlice"&&!v.get(O)?R:{...R,[O]:k},{}),E={...w.config,choices:T};return{...w,config:E}}return w})}e.filterMissingSharedSlices=y;function C(b){return Object.values(b.json).reduce((v,S)=>({...v,...S}),{})}e.flattenCustomTypeFields=C;function x(b){return Object.entries(b.fields).reduce((v,[,S])=>{var w;return S.type==="Slices"||S.type==="Choice"?{...v,...Object.entries(((w=S.config)===null||w===void 0?void 0:w.choices)||{}).reduce((T,[E,R])=>R.type==="SharedSlice"?{...T,[E]:R}:T,{})}:v},{})}e.collectSharedSlices=x})(Uz);var Vz={},D1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiffOperation=void 0,function(t){t.Added="added",t.Removed="removed",t.Updated="updated"}(e.DiffOperation||(e.DiffOperation={}))})(D1);var U1={},ba={},B1={};Object.defineProperty(B1,"__esModule",{value:!0});B1.HexaColor=void 0;const WMe=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;B1.HexaColor={is:e=>WMe.test(e)};var P1={};Object.defineProperty(P1,"__esModule",{value:!0});P1.toRecord=void 0;function NMe(e,t){return e.reduce((n,r)=>{const i=t(r);return{...n,[i]:r}},{})}P1.toRecord=NMe;var Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.mapValues=Jr.isObject=Jr.withOptionals=Jr.isNotEmpty=Jr.zipObjects=void 0;const KMe=G,qMe=un,ZC=(0,KMe.__importStar)(ne);function VMe(e,t){return[...new Set(Object.keys(e||{}).concat(Object.keys(t||{})))].reduce((r,i)=>{const o=e==null?void 0:e[i],a=t==null?void 0:t[i];return{...r,[i]:{left:o,right:a}}},{})}Jr.zipObjects=VMe;function zMe(e){return!!Object.keys(e).length}Jr.isNotEmpty=zMe;function QMe(e,t){return{...e,...t.reduce((n,[r,i])=>i?{...n,[r]:i}:n,{})}}Jr.withOptionals=QMe;const HMe=ZC.record(ZC.string,ZC.unknown);function YMe(e){return(0,qMe.isRight)(HMe.decode(e))}Jr.isObject=YMe;function GMe(e,t){return Object.entries(e).reduce((n,[r,i])=>({...n,[r]:t(i,r)}),{})}Jr.mapValues=GMe;Object.defineProperty(ba,"__esModule",{value:!0});ba.Objects=ba.Arrays=ba.HexaColorCode=void 0;const DM=G;ba.HexaColorCode=(0,DM.__importStar)(B1);ba.Arrays=(0,DM.__importStar)(P1);ba.Objects=(0,DM.__importStar)(Jr);var qm={};Object.defineProperty(qm,"__esModule",{value:!0});qm.VariationComparator=void 0;const Ov=ba,XC=dp,ws=D1;function JMe(e,t){const n=Ov.Objects.zipObjects(e,t);return Object.entries(n).reduce((r,[i,o])=>i==="primary"||i==="items"||(o==null?void 0:o.left)===(o==null?void 0:o.right)?r:{...r,[i]:o==null?void 0:o.right},{})}function Mv(e,t){const n=Ov.Objects.zipObjects(e,t),r=Object.entries(n).reduce((i,[o,a])=>{if(JSON.stringify(a==null?void 0:a.left)===JSON.stringify(a==null?void 0:a.right))return i;const s=(()=>{var l,c,u,f,p,h,m;if(!(!(a!=null&&a.left)&&!(a!=null&&a.right))){if(a!=null&&a.left&&!a.right)return{op:ws.DiffOperation.Removed};if(!(a!=null&&a.left)&&(a!=null&&a.right)){if(((l=a.right)===null||l===void 0?void 0:l.type)===XC.GroupFieldType){const g={...a.right,config:{...a.right.config,fields:{}}};return g.config.fields=Mv(void 0,(c=a.right.config)===null||c===void 0?void 0:c.fields)||{},{op:ws.DiffOperation.Added,value:g}}return{op:ws.DiffOperation.Added,value:a.right}}if(((u=a.right)===null||u===void 0?void 0:u.type)===XC.GroupFieldType){const g={...a.right,config:{...a.right.config,fields:{}}};return g.config.fields=Mv(((f=a.left)===null||f===void 0?void 0:f.type)===XC.GroupFieldType?(h=(p=a.left)===null||p===void 0?void 0:p.config)===null||h===void 0?void 0:h.fields:void 0,(m=a.right.config)===null||m===void 0?void 0:m.fields)||{},{op:ws.DiffOperation.Updated,value:g}}return{op:ws.DiffOperation.Updated,value:a.right}}})();return s?{...i,[o]:s}:i},{});return Ov.Objects.isNotEmpty(r)?r:void 0}qm.VariationComparator={compare(e,t){if(e&&!t)return{op:ws.DiffOperation.Removed};if(!e&&t)return{op:ws.DiffOperation.Added,value:t};const n=JMe(e,t),r=Mv(e==null?void 0:e.primary,t==null?void 0:t.primary),i=Mv(e==null?void 0:e.items,t==null?void 0:t.items),o={...n,...r?{primary:r}:{},...i?{items:i}:{}};if(Ov.Objects.isNotEmpty(o))return{op:ws.DiffOperation.Updated,value:o}}};Object.defineProperty(U1,"__esModule",{value:!0});U1.SliceComparator=void 0;const Vu=ba,eS=D1,ZMe=qm;function XMe(e,t){const n=Vu.Objects.zipObjects(e,t);return Object.entries(n).reduce((r,[i,o])=>i==="variations"||(o==null?void 0:o.left)===(o==null?void 0:o.right)?r:{...r,[i]:o==null?void 0:o.right},{})}U1.SliceComparator={compare(e,t){if(!e&&t)return{op:eS.DiffOperation.Added,value:t};if(e&&!t)return{op:eS.DiffOperation.Removed};const n=XMe(e,t),r=Vu.Objects.zipObjects(e&&Vu.Arrays.toRecord(e.variations,a=>a.id),t&&Vu.Arrays.toRecord(t.variations,a=>a.id)),i=Object.entries(r).reduce((a,[s,l])=>{if(!l)return a;const c=ZMe.VariationComparator.compare(l.left,l.right);return c?{...a,[s]:c}:a},{}),o={...n,...Vu.Objects.isNotEmpty(i)?{variations:i}:{}};if(Vu.Objects.isNotEmpty(o))return{op:eS.DiffOperation.Updated,value:o}}};var zz={};Object.defineProperty(zz,"__esModule",{value:!0});(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(D1,e),(0,t.__exportStar)(U1,e),(0,t.__exportStar)(qm,e),(0,t.__exportStar)(zz,e)})(Vz);var na={},Qz={};(function(e){var t=Se&&Se.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageConstraint=void 0;var n=Pm;Object.defineProperty(e,"ImageConstraint",{enumerable:!0,get:function(){return t(n).default}})})(Qz);var Hz={},Yz={};Object.defineProperty(Yz,"__esModule",{value:!0});var W1={};Object.defineProperty(W1,"__esModule",{value:!0});W1.SlicesTypes=void 0;const eFe=G,tFe=(0,eFe.__importStar)(ne),nFe=L1,rFe=Nm;W1.SlicesTypes=tFe.keyof({[nFe.CompositeSliceType]:null,[rFe.SharedSliceType]:null});(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(L1,e),(0,t.__exportStar)(Cc,e),(0,t.__exportStar)(Nm,e),(0,t.__exportStar)(Km,e),(0,t.__exportStar)(Yz,e),(0,t.__exportStar)(Sc,e),(0,t.__exportStar)(OM,e),(0,t.__exportStar)(W1,e)})(Hz);(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(dp,e),(0,t.__exportStar)(Wm,e),(0,t.__exportStar)(Qz,e),(0,t.__exportStar)(Hz,e),(0,t.__exportStar)(MM,e),(0,t.__exportStar)(Gr,e)})(na);(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(Uz,e),(0,t.__exportStar)(Vz,e),(0,t.__exportStar)(zi,e),(0,t.__exportStar)(na,e)})(he);var tS={},nS={},Fl={},Lj;function jt(){if(Lj)return Fl;Lj=1,Object.defineProperty(Fl,"__esModule",{value:!0}),Fl.hasContentType=Fl.hasFieldContentType=void 0;const e=un,t=NM();function n(i){var o;return r(i)&&i.__TYPE__===t.FieldContentType&&((o=i)===null||o===void 0?void 0:o.type)!==void 0&&typeof i.type=="string"&&(0,e.isRight)(t.FieldType.decode(i.type))}Fl.hasFieldContentType=n;function r(i){return typeof i=="object"&&i!==null&&"__TYPE__"in i}return Fl.hasContentType=r,Fl}var Dj;function Gz(){return Dj||(Dj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyContent=e.EmptyLegacy=e.isEmptyContent=e.EmptyContentType=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=jt();e.EmptyContentType="EmptyContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.EmptyContentType;e.isEmptyContent=a;const s=i.union([i.null,i.type({value:i.null})]),l=c=>new i.Type("EmptyLegacy",e.isEmptyContent,u=>(0,r.pipe)(s.decode(u),n.either.map(()=>({type:c,__TYPE__:e.EmptyContentType}))),()=>null);e.EmptyLegacy=l,e.EmptyContent=i.strict({type:i.string,__TYPE__:i.literal(e.EmptyContentType)})}(nS)),nS}var rS={},pr={};Object.defineProperty(pr,"__esModule",{value:!0});pr.defaultCtx=pr.getFieldCtx=pr.LegacyContentCtx=pr.FieldOrSliceType=void 0;const iFe=G,iS=(0,iFe.__importStar)(ne),Uj=na;pr.FieldOrSliceType=iS.union([iS.union([Uj.FieldType,Uj.SlicesTypes]),iS.literal("Repeatable.Link")]);class UM{constructor(t,n,r){Object.defineProperty(this,"fieldKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prefixedKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"keyOfType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fieldKey=t,this.fieldPath=n||[],this.allTypes=r||new Map;const i=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=i,this.keyOfType=`${i}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}}pr.LegacyContentCtx=UM;function oFe(e,t,n){return new UM(e,[...t.fieldPath,t.fieldKey,...n||[]],t.allTypes)}pr.getFieldCtx=oFe;function aFe(e,t=new Map){return new UM(e,[],t)}pr.defaultCtx=aFe;var oS={},aS={},Bj;function Jz(){return Bj||(Bj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanContentDefaultValue=e.BooleanContent=e.BooleanLegacy=e.isBooleanContent=e.BooleanContentType=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=jt();e.BooleanContentType="BooleanContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.BooleanContentType;e.isBooleanContent=a;const s=c=>new i.Type("BooleanLegacy",e.isBooleanContent,u=>(0,r.pipe)(i.boolean.decode(u),n.either.map(f=>e.BooleanContent.encode({value:f,__TYPE__:e.BooleanContentType}))),u=>({content:u.value,types:{[c.keyOfType]:"Boolean"}}));e.BooleanLegacy=s,e.BooleanContent=i.strict({__TYPE__:i.literal(e.BooleanContentType),value:i.boolean});const l=c=>{var u;return((u=c.config)===null||u===void 0?void 0:u.default_value)!==void 0?{__TYPE__:e.BooleanContentType,value:c.config.default_value||!1}:void 0};e.BooleanContentDefaultValue=l}(aS)),aS}var sS={},Pj;function BM(){return Pj||(Pj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmbedContent=e.EmbedLegacy=e.EmbedContentLegacy=e.isEmbedContent=e.EmbedContentType=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=pt(),a=jt();e.EmbedContentType="EmbedContent";const s=c=>(0,a.hasContentType)(c)&&c.__TYPE__===e.EmbedContentType;e.isEmbedContent=s,e.EmbedContentLegacy=i.exact(i.intersection([i.type({embed_url:i.string,type:i.string}),i.partial({version:i.union([i.string,i.number,i.null]),title:o.StringOrNull,author_name:o.StringOrNull,author_url:o.StringOrNull,provider_name:o.StringOrNull,provider_url:o.StringOrNull,cache_age:i.union([i.string,i.number,i.null]),thumbnail_url:o.StringOrNull,thumbnail_width:o.NumberOrNull,thumbnail_height:o.NumberOrNull,html:o.StringOrNull})]));const l=c=>new i.Type("EmbedLegacy",e.isEmbedContent,u=>(0,r.pipe)(e.EmbedContentLegacy.decode(u),n.either.map(f=>({...f,all:u,__TYPE__:e.EmbedContentType}))),u=>({content:u.all,types:{[c.keyOfType]:"Embed"}}));e.EmbedLegacy=l,e.EmbedContent=i.intersection([e.EmbedContentLegacy,i.strict({__TYPE__:i.literal(e.EmbedContentType),all:i.unknown})])}(sS)),sS}var lS={},cS={},ds={};Object.defineProperty(ds,"__esModule",{value:!0});const sFe=G,lFe=cs,cFe=vo,yg=(0,sFe.__importStar)(ne);function uFe(e){let t=0;for(;t<e.length&&e[t]<=" ";)t++;let n=e.length;for(;t<n&&e[n-1]<=" ";)n--;return e.substring(t,n)}ds.default=new yg.Type("TrimmedString",yg.string.is,(e,t)=>(0,cFe.pipe)(yg.string.validate(e,t),(0,lFe.chain)(n=>yg.success(uFe(n)))),e=>e);var Pi={};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.FieldContentType=void 0;Pi.FieldContentType="FieldContent";var Wj;function Nj(){return Wj||(Wj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorContent=e.ColorLegacy=e.isColorContent=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=na,a=(0,t.__importDefault)(ds),s=jt(),l=Pi,c=f=>(0,s.hasContentType)(f)&&f.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Color";e.isColorContent=c;const u=f=>new i.Type("ColorLegacy",e.isColorContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>e.ColorContent.encode({value:h,type:o.ColorFieldType,__TYPE__:l.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.ColorFieldType}}));e.ColorLegacy=u,e.ColorContent=i.strict({type:i.literal(o.ColorFieldType),value:a.default,__TYPE__:i.literal(l.FieldContentType)})}(cS)),cS}var uS={},Kj;function qj(){return Kj||(Kj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DateContent=e.DateLegacy=e.isDateContent=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=na,a=(0,t.__importDefault)(ds),s=jt(),l=Pi,c=f=>(0,s.hasContentType)(f)&&f.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Date";e.isDateContent=c;const u=f=>new i.Type("DateLegacy",e.isDateContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>e.DateContent.encode({value:h,type:o.DateFieldType,__TYPE__:l.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.DateFieldType}}));e.DateLegacy=u,e.DateContent=i.strict({type:i.literal(o.DateFieldType),value:a.default,__TYPE__:i.literal(l.FieldContentType)})}(uS)),uS}var dS={},Vj;function zj(){return Vj||(Vj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NumberContent=e.NumberLegacy=e.isNumberContent=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=na,a=(0,t.__importDefault)(ds),s=jt(),l=Pi,c=f=>(0,s.hasContentType)(f)&&f.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Number";e.isNumberContent=c;const u=f=>new i.Type("NumberLegacy",e.isNumberContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>e.NumberContent.encode({value:h,type:o.NumberFieldType,__TYPE__:l.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.NumberFieldType}}));e.NumberLegacy=u,e.NumberContent=i.strict({type:i.literal(o.NumberFieldType),value:a.default,__TYPE__:i.literal(l.FieldContentType)})}(dS)),dS}var fS={},Qj;function Hj(){return Qj||(Qj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RangeContent=e.RangeLegacy=e.isRangeContent=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=na,a=(0,t.__importDefault)(ds),s=jt(),l=Pi,c=f=>(0,s.hasContentType)(f)&&f.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Range";e.isRangeContent=c;const u=f=>new i.Type("RangeLegacy",e.isRangeContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>e.RangeContent.encode({value:h,type:o.RangeFieldType,__TYPE__:l.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.RangeFieldType}}));e.RangeLegacy=u,e.RangeContent=i.strict({type:i.literal(o.RangeFieldType),value:a.default,__TYPE__:i.literal(l.FieldContentType)})}(fS)),fS}var pS={},Yj;function Gj(){return Yj||(Yj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectContentDefaultValue=e.SelectContent=e.SelectLegacy=e.isSelectContent=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=na,a=(0,t.__importDefault)(ds),s=jt(),l=Pi,c=p=>(0,s.hasContentType)(p)&&p.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(p)&&p.type==="Select";e.isSelectContent=c;const u=p=>new i.Type("SelectLegacy",e.isSelectContent,h=>(0,r.pipe)(a.default.decode(h),n.either.map(m=>e.SelectContent.encode({value:m,type:o.SelectFieldType,__TYPE__:l.FieldContentType}))),h=>({content:h.value,types:{[p.keyOfType]:o.SelectFieldType}}));e.SelectLegacy=u,e.SelectContent=i.strict({type:i.literal(o.SelectFieldType),value:a.default,__TYPE__:i.literal(l.FieldContentType)});const f=p=>{var h;return!((h=p.config)===null||h===void 0)&&h.default_value?{__TYPE__:l.FieldContentType,type:o.SelectFieldType,value:p.config.default_value||""}:void 0};e.SelectContentDefaultValue=f}(pS)),pS}var hS={},Jj;function Zj(){return Jj||(Jj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextContent=e.TextLegacy=e.isTextContent=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=na,a=(0,t.__importDefault)(ds),s=jt(),l=Pi,c=f=>(0,s.hasContentType)(f)&&f.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Text";e.isTextContent=c;const u=f=>new i.Type("TextLegacy",e.isTextContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>e.TextContent.encode({value:h,type:o.TextFieldType,__TYPE__:l.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.TextFieldType}}));e.TextLegacy=u,e.TextContent=i.strict({type:i.literal(o.TextFieldType),value:a.default,__TYPE__:i.literal(l.FieldContentType)})}(hS)),hS}var AS={},Xj;function eL(){return Xj||(Xj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TimestampContent=e.TimestampLegacy=e.isTimestampContent=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=na,a=(0,t.__importDefault)(ds),s=jt(),l=Pi,c=f=>(0,s.hasContentType)(f)&&f.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Timestamp";e.isTimestampContent=c;const u=f=>new i.Type("TimestampLegacy",e.isTimestampContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>e.TimestampContent.encode({value:h,type:o.TimestampFieldType,__TYPE__:l.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.TimestampFieldType}}));e.TimestampLegacy=u,e.TimestampContent=i.strict({type:i.literal(o.TimestampFieldType),value:a.default,__TYPE__:i.literal(l.FieldContentType)})}(AS)),AS}var tL;function Zz(){return tL||(tL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FieldContent=e.FieldType=void 0;const t=G,n=(0,t.__importStar)(ne),r=Nj(),i=qj(),o=zj(),a=Hj(),s=Gj(),l=Zj(),c=eL();e.FieldType=n.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),e.FieldContent=n.union([i.DateContent,r.ColorContent,o.NumberContent,a.RangeContent,s.SelectContent,l.TextContent,c.TimestampContent]),(0,t.__exportStar)(Nj(),e),(0,t.__exportStar)(Pi,e),(0,t.__exportStar)(qj(),e),(0,t.__exportStar)(zj(),e),(0,t.__exportStar)(Hj(),e),(0,t.__exportStar)(Gj(),e),(0,t.__exportStar)(Zj(),e),(0,t.__exportStar)(eL(),e)}(lS)),lS}var mS={},nL;function Xz(){return nL||(nL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPointContent=e.GeoPointLegacy=e.isGeoPointContent=e.GeoPointContentType=void 0;const t=G,n=lt,r=vo,i=(0,t.__importStar)(ne),o=jt();e.GeoPointContentType="GeoPointContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.GeoPointContentType;e.isGeoPointContent=a;const s=i.strict({position:i.strict({lat:i.number,lng:i.number})}),l=c=>new i.Type("GeoPointLegacy",e.isGeoPointContent,u=>(0,r.pipe)(s.decode(u),n.either.map(f=>e.GeoPointContent.encode({...f,__TYPE__:e.GeoPointContentType}))),u=>({content:{position:u.position},types:{[c.keyOfType]:"GeoPoint"}}));e.GeoPointLegacy=l,e.GeoPointContent=i.intersection([s,i.strict({__TYPE__:i.literal(e.GeoPointContentType)})])}(mS)),mS}var gS={},rL;function PM(){return rL||(rL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageContent=e.ImageLegacy=e.ImageContentView=e.isImageContent=e.ImageContentType=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=Jr,a=pt(),s=jt();e.ImageContentType="ImageContent";const l=p=>(0,s.hasContentType)(p)&&p.__TYPE__===e.ImageContentType;e.isImageContent=l;const c=i.exact(i.type({id:i.string,url:i.string,width:i.number,height:i.number}));e.ImageContentView=i.exact(i.intersection([i.type({origin:c,width:i.number,height:i.number,edit:i.type({zoom:i.number,crop:i.type({x:i.number,y:i.number}),background:i.string})}),i.partial({url:i.string,credits:a.NonEmptyStringOrNull,alt:a.NonEmptyStringOrNull,provider:a.StringOrNull})]));const u=i.intersection([e.ImageContentView,i.partial({thumbnails:i.record(i.string,e.ImageContentView)})]),f=p=>new i.Type("ImageLegacy",e.isImageContent,h=>(0,r.pipe)(u.decode(h),n.either.map(m=>e.ImageContent.encode({...m,__TYPE__:e.ImageContentType}))),h=>({content:(0,o.withOptionals)({edit:h.edit,height:h.height,origin:h.origin,width:h.width},[["alt",h.alt],["credits",h.credits],["provider",h.provider],["thumbnails",h.thumbnails],["url",h.url]]),types:{[p.keyOfType]:"Image"}}));e.ImageLegacy=f,e.ImageContent=i.intersection([u,i.strict({__TYPE__:i.literal(e.ImageContentType)})])}(gS)),gS}var vS={},iL;function eQ(){return iL||(iL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationFieldContent=e.IntegrationFieldLegacy=e.isIntegrationFieldContent=e.IntegrationFieldContentType=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=jt();e.IntegrationFieldContentType="IntegrationFieldsContent";const a=l=>(0,o.hasContentType)(l)&&l.__TYPE__===e.IntegrationFieldContentType;e.isIntegrationFieldContent=a;const s=l=>new i.Type("IntegrationFieldLegacy",e.isIntegrationFieldContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(u=>e.IntegrationFieldContent.encode({value:u,__TYPE__:e.IntegrationFieldContentType}))),c=>({content:c.value,types:{[l.keyOfType]:"IntegrationFields"}}));e.IntegrationFieldLegacy=s,e.IntegrationFieldContent=i.strict({__TYPE__:i.literal(e.IntegrationFieldContentType),value:i.string})}(vS)),vS}var yS={},tQ={},N1={},K1={};Object.defineProperty(K1,"__esModule",{value:!0});K1.default=fFe;let bg;const dFe=new Uint8Array(16);function fFe(){if(!bg&&(bg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!bg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return bg(dFe)}var wl={},$u={},q1={};Object.defineProperty(q1,"__esModule",{value:!0});q1.default=void 0;var pFe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;q1.default=pFe;Object.defineProperty($u,"__esModule",{value:!0});$u.default=void 0;var hFe=AFe(q1);function AFe(e){return e&&e.__esModule?e:{default:e}}function mFe(e){return typeof e=="string"&&hFe.default.test(e)}var gFe=mFe;$u.default=gFe;Object.defineProperty(wl,"__esModule",{value:!0});wl.default=void 0;wl.unsafeStringify=nQ;var vFe=yFe($u);function yFe(e){return e&&e.__esModule?e:{default:e}}const In=[];for(let e=0;e<256;++e)In.push((e+256).toString(16).slice(1));function nQ(e,t=0){return In[e[t+0]]+In[e[t+1]]+In[e[t+2]]+In[e[t+3]]+"-"+In[e[t+4]]+In[e[t+5]]+"-"+In[e[t+6]]+In[e[t+7]]+"-"+In[e[t+8]]+In[e[t+9]]+"-"+In[e[t+10]]+In[e[t+11]]+In[e[t+12]]+In[e[t+13]]+In[e[t+14]]+In[e[t+15]]}function bFe(e,t=0){const n=nQ(e,t);if(!(0,vFe.default)(n))throw TypeError("Stringified UUID is invalid");return n}var CFe=bFe;wl.default=CFe;Object.defineProperty(N1,"__esModule",{value:!0});N1.default=void 0;var SFe=xFe(K1),wFe=wl;function xFe(e){return e&&e.__esModule?e:{default:e}}let oL,bS,CS=0,SS=0;function _Fe(e,t,n){let r=t&&n||0;const i=t||new Array(16);e=e||{};let o=e.node||oL,a=e.clockseq!==void 0?e.clockseq:bS;if(o==null||a==null){const p=e.random||(e.rng||SFe.default)();o==null&&(o=oL=[p[0]|1,p[1],p[2],p[3],p[4],p[5]]),a==null&&(a=bS=(p[6]<<8|p[7])&16383)}let s=e.msecs!==void 0?e.msecs:Date.now(),l=e.nsecs!==void 0?e.nsecs:SS+1;const c=s-CS+(l-SS)/1e4;if(c<0&&e.clockseq===void 0&&(a=a+1&16383),(c<0||s>CS)&&e.nsecs===void 0&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");CS=s,SS=l,bS=a,s+=122192928e5;const u=((s&268435455)*1e4+l)%4294967296;i[r++]=u>>>24&255,i[r++]=u>>>16&255,i[r++]=u>>>8&255,i[r++]=u&255;const f=s/4294967296*1e4&268435455;i[r++]=f>>>8&255,i[r++]=f&255,i[r++]=f>>>24&15|16,i[r++]=f>>>16&255,i[r++]=a>>>8|128,i[r++]=a&255;for(let p=0;p<6;++p)i[r+p]=o[p];return t||(0,wFe.unsafeStringify)(i)}var TFe=_Fe;N1.default=TFe;var V1={},Ks={},Vm={};Object.defineProperty(Vm,"__esModule",{value:!0});Vm.default=void 0;var IFe=EFe($u);function EFe(e){return e&&e.__esModule?e:{default:e}}function RFe(e){if(!(0,IFe.default)(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=t&255,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=t&255,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=t&255,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=t&255,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=t&255,n}var $Fe=RFe;Vm.default=$Fe;Object.defineProperty(Ks,"__esModule",{value:!0});Ks.URL=Ks.DNS=void 0;Ks.default=jFe;var kFe=wl,OFe=MFe(Vm);function MFe(e){return e&&e.__esModule?e:{default:e}}function FFe(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}const rQ="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Ks.DNS=rQ;const iQ="6ba7b811-9dad-11d1-80b4-00c04fd430c8";Ks.URL=iQ;function jFe(e,t,n){function r(i,o,a,s){var l;if(typeof i=="string"&&(i=FFe(i)),typeof o=="string"&&(o=(0,OFe.default)(o)),((l=o)===null||l===void 0?void 0:l.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+i.length);if(c.set(o),c.set(i,o.length),c=n(c),c[6]=c[6]&15|t,c[8]=c[8]&63|128,a){s=s||0;for(let u=0;u<16;++u)a[s+u]=c[u];return a}return(0,kFe.unsafeStringify)(c)}try{r.name=e}catch{}return r.DNS=rQ,r.URL=iQ,r}var z1={};Object.defineProperty(z1,"__esModule",{value:!0});z1.default=void 0;function LFe(e){if(typeof e=="string"){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return DFe(UFe(BFe(e),e.length*8))}function DFe(e){const t=[],n=e.length*32,r="0123456789abcdef";for(let i=0;i<n;i+=8){const o=e[i>>5]>>>i%32&255,a=parseInt(r.charAt(o>>>4&15)+r.charAt(o&15),16);t.push(a)}return t}function oQ(e){return(e+64>>>9<<4)+14+1}function UFe(e,t){e[t>>5]|=128<<t%32,e[oQ(t)-1]=t;let n=1732584193,r=-271733879,i=-1732584194,o=271733878;for(let a=0;a<e.length;a+=16){const s=n,l=r,c=i,u=o;n=zn(n,r,i,o,e[a],7,-680876936),o=zn(o,n,r,i,e[a+1],12,-389564586),i=zn(i,o,n,r,e[a+2],17,606105819),r=zn(r,i,o,n,e[a+3],22,-1044525330),n=zn(n,r,i,o,e[a+4],7,-176418897),o=zn(o,n,r,i,e[a+5],12,1200080426),i=zn(i,o,n,r,e[a+6],17,-1473231341),r=zn(r,i,o,n,e[a+7],22,-45705983),n=zn(n,r,i,o,e[a+8],7,1770035416),o=zn(o,n,r,i,e[a+9],12,-1958414417),i=zn(i,o,n,r,e[a+10],17,-42063),r=zn(r,i,o,n,e[a+11],22,-1990404162),n=zn(n,r,i,o,e[a+12],7,1804603682),o=zn(o,n,r,i,e[a+13],12,-40341101),i=zn(i,o,n,r,e[a+14],17,-1502002290),r=zn(r,i,o,n,e[a+15],22,1236535329),n=Qn(n,r,i,o,e[a+1],5,-165796510),o=Qn(o,n,r,i,e[a+6],9,-1069501632),i=Qn(i,o,n,r,e[a+11],14,643717713),r=Qn(r,i,o,n,e[a],20,-373897302),n=Qn(n,r,i,o,e[a+5],5,-701558691),o=Qn(o,n,r,i,e[a+10],9,38016083),i=Qn(i,o,n,r,e[a+15],14,-660478335),r=Qn(r,i,o,n,e[a+4],20,-405537848),n=Qn(n,r,i,o,e[a+9],5,568446438),o=Qn(o,n,r,i,e[a+14],9,-1019803690),i=Qn(i,o,n,r,e[a+3],14,-187363961),r=Qn(r,i,o,n,e[a+8],20,1163531501),n=Qn(n,r,i,o,e[a+13],5,-1444681467),o=Qn(o,n,r,i,e[a+2],9,-51403784),i=Qn(i,o,n,r,e[a+7],14,1735328473),r=Qn(r,i,o,n,e[a+12],20,-1926607734),n=Hn(n,r,i,o,e[a+5],4,-378558),o=Hn(o,n,r,i,e[a+8],11,-2022574463),i=Hn(i,o,n,r,e[a+11],16,1839030562),r=Hn(r,i,o,n,e[a+14],23,-35309556),n=Hn(n,r,i,o,e[a+1],4,-1530992060),o=Hn(o,n,r,i,e[a+4],11,1272893353),i=Hn(i,o,n,r,e[a+7],16,-155497632),r=Hn(r,i,o,n,e[a+10],23,-1094730640),n=Hn(n,r,i,o,e[a+13],4,681279174),o=Hn(o,n,r,i,e[a],11,-358537222),i=Hn(i,o,n,r,e[a+3],16,-722521979),r=Hn(r,i,o,n,e[a+6],23,76029189),n=Hn(n,r,i,o,e[a+9],4,-640364487),o=Hn(o,n,r,i,e[a+12],11,-421815835),i=Hn(i,o,n,r,e[a+15],16,530742520),r=Hn(r,i,o,n,e[a+2],23,-995338651),n=Yn(n,r,i,o,e[a],6,-198630844),o=Yn(o,n,r,i,e[a+7],10,1126891415),i=Yn(i,o,n,r,e[a+14],15,-1416354905),r=Yn(r,i,o,n,e[a+5],21,-57434055),n=Yn(n,r,i,o,e[a+12],6,1700485571),o=Yn(o,n,r,i,e[a+3],10,-1894986606),i=Yn(i,o,n,r,e[a+10],15,-1051523),r=Yn(r,i,o,n,e[a+1],21,-2054922799),n=Yn(n,r,i,o,e[a+8],6,1873313359),o=Yn(o,n,r,i,e[a+15],10,-30611744),i=Yn(i,o,n,r,e[a+6],15,-1560198380),r=Yn(r,i,o,n,e[a+13],21,1309151649),n=Yn(n,r,i,o,e[a+4],6,-145523070),o=Yn(o,n,r,i,e[a+11],10,-1120210379),i=Yn(i,o,n,r,e[a+2],15,718787259),r=Yn(r,i,o,n,e[a+9],21,-343485551),n=_s(n,s),r=_s(r,l),i=_s(i,c),o=_s(o,u)}return[n,r,i,o]}function BFe(e){if(e.length===0)return[];const t=e.length*8,n=new Uint32Array(oQ(t));for(let r=0;r<t;r+=8)n[r>>5]|=(e[r/8]&255)<<r%32;return n}function _s(e,t){const n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535}function PFe(e,t){return e<<t|e>>>32-t}function Q1(e,t,n,r,i,o){return _s(PFe(_s(_s(t,e),_s(r,o)),i),n)}function zn(e,t,n,r,i,o,a){return Q1(t&n|~t&r,e,t,i,o,a)}function Qn(e,t,n,r,i,o,a){return Q1(t&r|n&~r,e,t,i,o,a)}function Hn(e,t,n,r,i,o,a){return Q1(t^n^r,e,t,i,o,a)}function Yn(e,t,n,r,i,o,a){return Q1(n^(t|~r),e,t,i,o,a)}var WFe=LFe;z1.default=WFe;Object.defineProperty(V1,"__esModule",{value:!0});V1.default=void 0;var NFe=aQ(Ks),KFe=aQ(z1);function aQ(e){return e&&e.__esModule?e:{default:e}}const qFe=(0,NFe.default)("v3",48,KFe.default);var VFe=qFe;V1.default=VFe;var H1={},Y1={};Object.defineProperty(Y1,"__esModule",{value:!0});Y1.default=void 0;const zFe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var QFe={randomUUID:zFe};Y1.default=QFe;Object.defineProperty(H1,"__esModule",{value:!0});H1.default=void 0;var aL=sQ(Y1),HFe=sQ(K1),YFe=wl;function sQ(e){return e&&e.__esModule?e:{default:e}}function GFe(e,t,n){if(aL.default.randomUUID&&!t&&!e)return aL.default.randomUUID();e=e||{};const r=e.random||(e.rng||HFe.default)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return(0,YFe.unsafeStringify)(r)}var JFe=GFe;H1.default=JFe;var G1={},J1={};Object.defineProperty(J1,"__esModule",{value:!0});J1.default=void 0;function ZFe(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function wS(e,t){return e<<t|e>>>32-t}function XFe(e){const t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){const a=unescape(encodeURIComponent(e));e=[];for(let s=0;s<a.length;++s)e.push(a.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const r=e.length/4+2,i=Math.ceil(r/16),o=new Array(i);for(let a=0;a<i;++a){const s=new Uint32Array(16);for(let l=0;l<16;++l)s[l]=e[a*64+l*4]<<24|e[a*64+l*4+1]<<16|e[a*64+l*4+2]<<8|e[a*64+l*4+3];o[a]=s}o[i-1][14]=(e.length-1)*8/Math.pow(2,32),o[i-1][14]=Math.floor(o[i-1][14]),o[i-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<i;++a){const s=new Uint32Array(80);for(let h=0;h<16;++h)s[h]=o[a][h];for(let h=16;h<80;++h)s[h]=wS(s[h-3]^s[h-8]^s[h-14]^s[h-16],1);let l=n[0],c=n[1],u=n[2],f=n[3],p=n[4];for(let h=0;h<80;++h){const m=Math.floor(h/20),g=wS(l,5)+ZFe(m,c,u,f)+p+t[m]+s[h]>>>0;p=f,f=u,u=wS(c,30)>>>0,c=l,l=g}n[0]=n[0]+l>>>0,n[1]=n[1]+c>>>0,n[2]=n[2]+u>>>0,n[3]=n[3]+f>>>0,n[4]=n[4]+p>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var eje=XFe;J1.default=eje;Object.defineProperty(G1,"__esModule",{value:!0});G1.default=void 0;var tje=lQ(Ks),nje=lQ(J1);function lQ(e){return e&&e.__esModule?e:{default:e}}const rje=(0,tje.default)("v5",80,nje.default);var ije=rje;G1.default=ije;var Z1={};Object.defineProperty(Z1,"__esModule",{value:!0});Z1.default=void 0;var oje="00000000-0000-0000-0000-000000000000";Z1.default=oje;var X1={};Object.defineProperty(X1,"__esModule",{value:!0});X1.default=void 0;var aje=sje($u);function sje(e){return e&&e.__esModule?e:{default:e}}function lje(e){if(!(0,aje.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}var cje=lje;X1.default=cje;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NIL",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"v3",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"v5",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return a.default}});var t=u(N1),n=u(V1),r=u(H1),i=u(G1),o=u(Z1),a=u(X1),s=u($u),l=u(wl),c=u(Vm);function u(f){return f&&f.__esModule?f:{default:f}}})(tQ);var sL;function eC(){return sL||(sL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FilledLinkContent=e.FilledLink=e.FilledLinkContentLegacy=e.FilledLinkLegacy=e.isFilledLinkContent=e.LinkContent=e.Link=e.LinkContentLegacy=e.LinkLegacy=e.isLinkContent=e.LinkContentType=e.AnyLinkContent=e.AnyLinkType=e.ExternalLinkContent=e.FilledExternalLinkContent=e.ExternalLinkType=e.DocumentLinkContent=e.FilledDocumentLinkContent=e.DocumentLinkType=e.MediaLinkContent=e.MediaLinkType=e.FileLinkContent=e.FilledFileLinkContent=e.FileLinkType=e.ImageLinkContent=e.FilledImageLinkContent=e.ImageLinkType=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=$1,a=tQ,s=pt(),l=nt,c=jt(),u=P=>typeof P=="string"&&(0,a.validate)(P),f=new i.Type("UUID",u,(P,ae)=>typeof P>"u"?i.success((0,a.v4)()):u(P)?i.success(P):i.failure(P,ae),i.identity);function p(P){return i.intersection([i.strict({key:f}),P])}e.ImageLinkType="ImageLink";const h=P=>typeof P=="string",m=new i.Type("ImageLinkKind",P=>h(P),(P,ae)=>h(P)?i.success("image"):i.failure(P,ae),()=>"image"),g=i.intersection([i.strict({kind:m,id:i.string,url:i.string,height:i.string,width:i.string,size:i.string,name:i.string}),i.exact(i.partial({date:s.StringOrNull}))]),y=new i.Type("FilledImageLink",P=>(0,c.hasContentType)(P)&&P.__TYPE__===e.ImageLinkType,P=>(0,r.pipe)(g.decode(P),n.either.map(ae=>e.FilledImageLinkContent.encode({...ae,__TYPE__:e.ImageLinkType}))),P=>g.encode(P));e.FilledImageLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ImageLinkType)}),g]);const C=i.intersection([i.union([g,i.strict({kind:i.literal("image")})]),i.exact(i.partial({text:i.string,variant:i.string}))]),x=new i.Type("ImageLink",P=>(0,c.hasContentType)(P)&&P.__TYPE__===e.ImageLinkType,P=>(0,r.pipe)(C.decode(P),n.either.map(ae=>e.ImageLinkContent.encode({...ae,__TYPE__:e.ImageLinkType}))),P=>C.encode(P));e.ImageLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ImageLinkType)}),C]),e.FileLinkType="FileLink";const b=P=>typeof P=="string",v=new i.Type("FileLinkKind",P=>b(P),(P,ae)=>b(P)?i.success("file"):i.failure(P,ae),()=>"file"),S=i.exact(i.intersection([i.type({kind:v,id:i.string,url:i.string,name:i.string,size:(0,o.withFallback)(i.string,"0")}),i.partial({date:s.StringOrNull})])),w=new i.Type("FilledFileLink",P=>(0,c.hasContentType)(P)&&P.__TYPE__===e.FileLinkType,P=>(0,r.pipe)(S.decode(P),n.either.map(ae=>e.FilledFileLinkContent.encode({...ae,__TYPE__:e.FileLinkType}))),P=>S.encode(P));e.FilledFileLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.FileLinkType)}),S]);const T=i.intersection([i.union([S,i.strict({kind:i.literal("file")})]),i.exact(i.partial({text:i.string,variant:i.string}))]),E=new i.Type("FileLink",P=>(0,c.hasContentType)(P)&&P.__TYPE__===e.FileLinkType,P=>(0,r.pipe)(T.decode(P),n.either.map(ae=>e.FileLinkContent.encode({...ae,__TYPE__:e.FileLinkType}))),P=>T.encode(P));e.FileLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.FileLinkType)}),T]),e.MediaLinkType="MediaLink";const R=i.intersection([i.strict({kind:i.literal("media")}),i.exact(i.partial({text:i.string,variant:i.string}))]),O=new i.Type("MediaLink",P=>(0,c.hasContentType)(P)&&P.__TYPE__===e.MediaLinkType,P=>(0,r.pipe)(R.decode(P),n.either.map(ae=>e.MediaLinkContent.encode({...ae,__TYPE__:e.MediaLinkType}))),P=>R.encode(P));e.MediaLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.MediaLinkType)}),R]),e.DocumentLinkType="DocumentLink";const k=i.strict({id:s.NonEmptyString}),B=new i.Type("FilledDocumentLink",P=>(0,c.hasContentType)(P)&&P.__TYPE__===e.DocumentLinkType,P=>(0,r.pipe)(k.decode(P),n.either.map(ae=>e.FilledDocumentLinkContent.encode({...ae,__TYPE__:e.DocumentLinkType}))),P=>k.encode(P));e.FilledDocumentLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.DocumentLinkType)}),k]);const K=i.intersection([i.union([k,i.strict({kind:i.literal("document")})]),i.exact(i.partial({text:i.string,variant:i.string}))]),H=new i.Type("DocumentLink",P=>(0,c.hasContentType)(P)&&P.__TYPE__===e.DocumentLinkType,P=>(0,r.pipe)(K.decode(P),n.either.map(ae=>e.DocumentLinkContent.encode({...ae,__TYPE__:e.DocumentLinkType}))),P=>K.encode(P));e.DocumentLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.DocumentLinkType)}),K]),e.ExternalLinkType="ExternalLink";const z=i.exact(i.intersection([i.type({url:i.string}),i.partial({kind:i.literal("web"),target:s.StringOrNull,preview:(0,l.nullable)(i.partial({title:i.string}))})])),N=new i.Type("FilledExternalLink",P=>(0,c.hasContentType)(P)&&P.__TYPE__===e.ExternalLinkType,P=>(0,r.pipe)(z.decode(P),n.either.map(ae=>e.FilledExternalLinkContent.encode({...ae,__TYPE__:e.ExternalLinkType}))),P=>z.encode(P));e.FilledExternalLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ExternalLinkType)}),z]);const Y=i.intersection([i.union([z,i.strict({kind:i.literal("web")})]),i.exact(i.partial({text:i.string,variant:i.string}))]),ee=new i.Type("ExternalLink",P=>(0,c.hasContentType)(P)&&P.__TYPE__===e.ExternalLinkType,P=>(0,r.pipe)(Y.decode(P),n.either.map(ae=>e.ExternalLinkContent.encode({...ae,__TYPE__:e.ExternalLinkType}))),P=>Y.encode(P));e.ExternalLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ExternalLinkType)}),Y]),e.AnyLinkType="AnyLink";const F=i.exact(i.intersection([i.type({kind:(0,o.withFallback)(i.literal("any"),"any")}),i.partial({text:i.string,variant:i.string})])),M=new i.Type("AnyLink",P=>(0,c.hasContentType)(P)&&P.__TYPE__===e.AnyLinkType,P=>(0,r.pipe)(F.decode(P),n.either.map(ae=>e.AnyLinkContent.encode({...ae,__TYPE__:e.AnyLinkType}))),P=>F.encode(P));e.AnyLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.AnyLinkType)}),F]),e.LinkContentType="LinkContent";const W=P=>(0,c.hasContentType)(P)&&P.__TYPE__===e.LinkContentType;e.isLinkContent=W,e.LinkLegacy=p(i.union([x,E,H,ee,O,M]));const re=P=>new i.Type("LinkLegacy",e.isLinkContent,ae=>(0,r.pipe)(e.LinkLegacy.decode(ae),n.either.map(({key:Ge,...ve})=>e.LinkContent.encode({__TYPE__:"LinkContent",key:Ge,value:ve}))),({key:ae,value:Ge})=>({content:e.LinkLegacy.encode({...Ge,key:ae}),types:{[P.keyOfType]:"Link"}}));e.LinkContentLegacy=re,e.Link=i.union([e.ImageLinkContent,e.FileLinkContent,e.DocumentLinkContent,e.ExternalLinkContent,e.MediaLinkContent,e.AnyLinkContent]),e.LinkContent=p(i.strict({__TYPE__:i.literal(e.LinkContentType),value:e.Link}));const Ie=P=>(0,c.hasContentType)(P)&&P.__TYPE__===e.LinkContentType;e.isFilledLinkContent=Ie,e.FilledLinkLegacy=i.union([y,w,B,N]);const Ce=P=>{const ae=p(e.FilledLinkLegacy);return new i.Type("FilledLinkLegacy",e.isFilledLinkContent,Ge=>(0,r.pipe)(ae.decode(Ge),n.either.map(({key:ve,...De})=>e.FilledLinkContent.encode({__TYPE__:"LinkContent",key:ve,value:De}))),({key:Ge,value:ve})=>({content:ae.encode({...ve,key:Ge}),types:{[P.keyOfType]:"Link"}}))};e.FilledLinkContentLegacy=Ce,e.FilledLink=i.union([e.FilledImageLinkContent,e.FilledFileLinkContent,e.FilledDocumentLinkContent,e.FilledExternalLinkContent]),e.FilledLinkContent=p(i.strict({__TYPE__:i.literal(e.LinkContentType),value:e.FilledLink}))}(yS)),yS}var Ni={},xS={},lL;function cQ(){return lL||(lL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseRepeatableContent=e.RepeatableLegacy=e.isRepeatableContent=e.RepeatableContent=void 0;const t=G,n=lt,r=un,i=Ye,o=(0,t.__importStar)(ne),a=jt(),s=eC(),l="RepeatableContent";e.RepeatableContent=o.strict({__TYPE__:o.literal(l),type:o.literal("Link"),value:o.array(s.LinkContent)});const c=p=>(0,a.hasContentType)(p)&&p.__TYPE__===l;e.isRepeatableContent=c;const u=(p,h)=>new o.Type("RepeatableLegacy",e.isRepeatableContent,m=>(0,i.pipe)(o.array(o.unknown).decode(m),n.either.map(y=>({value:y.reduce((x,b)=>{let v;switch(h){case"Link":v=(0,s.LinkContentLegacy)(p).decode(b);break}return!v||(0,r.isLeft)(v)?x:[...x,v.right]},[]),type:h,__TYPE__:"RepeatableContent"}))),m=>({content:o.array(s.LinkContent).encode(m.value).reduce((C,x)=>{let b;switch(x.__TYPE__){case s.LinkContentType:b=(0,s.LinkContentLegacy)(p).encode(x);break}return b?[...C,b]:C},[]).map(C=>C.content),types:{[p.keyOfType]:`Repeatable.${h}`}}));e.RepeatableLegacy=u;function f({path:p,key:h,apiId:m,model:g,content:y}){return C=>{const x=y.value.reduce((b,v,S)=>{const w=p.concat([{key:S.toString(),type:"Widget"}]),T=(g==null?void 0:g.type)==="Link"&&g.config?{...g,config:{...g.config,repeat:!1}}:g,E=C({path:w,key:h,apiId:m,model:T,content:v});return!E||!(0,s.isLinkContent)(E)?b:b.concat(E)},[]);return C({path:p,key:h,apiId:m,model:g,content:{__TYPE__:y.__TYPE__,type:y.type,value:x}})}}e.traverseRepeatableContent=f}(xS)),xS}var _S={},TS={},cL;function uL(){return cL||(cL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Block=e.BlockLegacy=e.TextBlockLegacy=e.TextBlock=e.checkEmbedBlock=e.EmbedBlock=e.checkImageBlock=e.ImageBlock=e.ValidatedSpans=e.SpanLegacy=e.Span=void 0;const t=G,n=lt,r=un,i=Ye,o=(0,t.__importStar)(ne),a=$1,s=Wm,l=pt(),c=nt,u=BM(),f=PM(),p=eC(),h=R=>o.strict({data:R,start:o.number,end:o.number,type:o.literal(s.RichTextNodeType.hyperlink)}),m=o.strict({data:(0,a.withFallback)(o.string,""),start:o.number,end:o.number,type:o.literal("label")}),g=o.strict({start:o.number,end:o.number,type:o.keyof({[s.RichTextNodeType.strong]:null,[s.RichTextNodeType.em]:null,"list-item":null})});e.Span=o.union([h(p.FilledLink),m,g]),e.SpanLegacy=o.union([h(p.FilledLinkLegacy),m,g]);const y=R=>new o.Type("ValidatedSpans",O=>Array.isArray(O)&&O.every(R.is),(O,k)=>{if(Array.isArray(O)){const B=O.reduce((K,H)=>{const z=R.decode(H);return(0,r.isLeft)(z)?K:[...K,z.right]},[]).sort((K,H)=>K.start-H.start);return o.success(B)}else return o.failure(O,k)},O=>O.reduce((k,B)=>{const K=R.encode(B);return[...k,K]},[]));e.ValidatedSpans=y;const C=R=>o.exact(o.intersection([o.type({type:o.literal(s.RichTextNodeType.image),data:o.intersection([f.ImageContentView,o.partial({linkTo:(0,c.nullable)(R)})])}),o.partial({label:l.StringOrNull,direction:l.StringOrNull})]));e.ImageBlock=C(p.FilledLink);const x=C(p.FilledLinkLegacy);function b(R){return R.type===s.RichTextNodeType.image}e.checkImageBlock=b;const v=o.exact(o.intersection([o.type({type:o.literal(s.RichTextNodeType.embed),data:o.unknown}),o.partial({label:l.StringOrNull,direction:l.StringOrNull})])),S=new o.Type("EmbedBlockLegacy",R=>R.type==="embed",R=>(0,i.pipe)(v.decode(R),n.either.chain(O=>n.either.map(k=>[O,k])(u.EmbedContentLegacy.decode(O.data))),n.either.map(([O,k])=>e.EmbedBlock.encode({...O,data:{...k,__TYPE__:u.EmbedContentType,all:O.data}}))),R=>({...v.encode(R),data:u.EmbedContentLegacy.encode(R.data)}));e.EmbedBlock=o.exact(o.intersection([o.type({type:o.literal(s.RichTextNodeType.embed),data:u.EmbedContent}),o.partial({label:l.StringOrNull,direction:l.StringOrNull})]));function w(R){return R.type===s.RichTextNodeType.embed}e.checkEmbedBlock=w;const T=R=>o.exact(o.intersection([o.type({type:(0,c.refineType)(s.RichTextNodeTypeCodec,`string which isn't ${s.RichTextNodeType.image} ${s.RichTextNodeType.embed}`,O=>O!==s.RichTextNodeType.image&&O!==s.RichTextNodeType.embed),content:o.intersection([o.type({text:o.string}),o.partial({spans:(0,e.ValidatedSpans)(R)})])}),o.partial({label:o.string,direction:o.string})]));e.TextBlock=T(e.Span),e.TextBlockLegacy=T(e.SpanLegacy);const E=o.union([S,x,e.TextBlockLegacy]);e.BlockLegacy=new o.Type("BlockLegacy",R=>S.is(R)||x.is(R)||e.TextBlockLegacy.is(R),R=>E.decode(R),R=>(()=>e.ImageBlock.is(R)?x.encode(R):e.EmbedBlock.is(R)?S.encode(R):e.TextBlockLegacy.encode(R))()),e.Block=o.union([e.ImageBlock,e.EmbedBlock,e.TextBlock])}(TS)),TS}var dL;function WM(){return dL||(dL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichTextLegacy=e.RichTextContent=e.RichTextLegacyContent=e.isRichTextContent=e.RichTextContentType=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=jt(),a=uL();e.RichTextContentType="StructuredTextContent";const s=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.RichTextContentType;e.isRichTextContent=s,e.RichTextLegacyContent=i.array(a.BlockLegacy),e.RichTextContent=i.strict({__TYPE__:i.literal(e.RichTextContentType),value:i.array(a.Block)}),(0,t.__exportStar)(uL(),e);const l=c=>new i.Type("RichTextLegacy",e.isRichTextContent,u=>(0,r.pipe)(e.RichTextLegacyContent.decode(u),n.either.map(f=>({value:f,__TYPE__:e.RichTextContentType}))),u=>({content:e.RichTextLegacyContent.encode(u.value),types:{[c.keyOfType]:"StructuredText"}}));e.RichTextLegacy=l}(_S)),_S}var IS={},fL;function uQ(){return fL||(fL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SeparatorContent=e.SeparatorLegacy=e.isSeparatorContent=e.SeparatorContentType=void 0;const n=(0,G.__importStar)(ne),r=jt();e.SeparatorContentType="SeparatorContent";const i=a=>(0,r.hasContentType)(a)&&a.__TYPE__===e.SeparatorContentType;e.isSeparatorContent=i;const o=a=>new n.Type("SeparatorLegacy",e.isSeparatorContent,()=>n.success(e.SeparatorContent.encode({__TYPE__:e.SeparatorContentType})),()=>({content:{},types:{[a.keyOfType]:"Separator"}}));e.SeparatorLegacy=o,e.SeparatorContent=n.strict({__TYPE__:n.literal(e.SeparatorContentType)})}(IS)),IS}var ES={},pL;function dQ(){return pL||(pL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseTableContent=e.TableLegacy=e.TableContent=e.isTableContent=e.TableContentType=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=he,a=jt(),s=WM();e.TableContentType="TableContent";const l=y=>(0,a.hasContentType)(y)&&y.__TYPE__===e.TableContentType;e.isTableContent=l;const c=i.intersection([i.strict({type:i.union([i.literal("tableHeader"),i.literal("tableCell")]),content:s.RichTextContent}),i.exact(i.partial({columnWidth:i.number}))]),u=i.strict({type:i.literal("tableRow"),content:i.array(c)});e.TableContent=i.strict({__TYPE__:i.literal(e.TableContentType),content:i.array(u)});const f=i.intersection([i.strict({type:i.union([i.literal("tableHeader"),i.literal("tableCell")]),content:s.RichTextLegacyContent}),i.exact(i.partial({columnWidth:i.number}))]),p=i.strict({type:i.literal("tableRow"),content:i.array(f)}),h=i.strict({content:i.array(p)}),m=y=>new i.Type("TableLegacy",e.isTableContent,C=>(0,r.pipe)(h.decode(C),n.either.map(x=>({__TYPE__:"TableContent",content:x.content.map(b=>({...b,content:b.content.map(v=>({...v,content:{__TYPE__:"StructuredTextContent",value:v.content}}))}))}))),C=>({content:h.encode({content:C.content.map(x=>({...x,content:x.content.map(b=>({...b,content:b.content.value}))}))}),types:{[y.keyOfType]:"Table"}}));e.TableLegacy=m;function g({path:y,key:C,apiId:x,model:b,content:v}){return S=>{const w=v.content.map((T,E)=>({...T,content:T.content.map((R,O)=>{const k=y.concat([{key:[E.toString(),O.toString()].join(","),type:"Widget"}]),B=S({path:k,key:C,apiId:x,model:o.TableCell,content:{__TYPE__:R.content.__TYPE__,value:R.content.value}})||{__TYPE__:"StructuredTextContent",value:[]};return{...R,content:B}})}));return S({path:y,key:C,apiId:x,model:b,content:{__TYPE__:v.__TYPE__,content:w}})}}e.traverseTableContent=g}(ES)),ES}var hL;function uje(){if(hL)return Ni;hL=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.NestableLegacy=Ni.isNestableContent=Ni.NestableContentDefaultValue=Ni.NestableContent=void 0;const e=G,t=un,n=(0,e.__importStar)(ne),r=Gz(),i=Jz(),o=BM(),a=Zz(),s=Pi,l=Xz(),c=PM(),u=eQ(),f=eC(),p=cQ(),h=WM(),m=uQ(),g=dQ();Ni.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,l.GeoPointContent,c.ImageContent,u.IntegrationFieldContent,f.LinkContent,h.RichTextContent,m.SeparatorContent,g.TableContent,p.RepeatableContent]);const y=b=>{switch(b.type){case"Boolean":return(0,i.BooleanContentDefaultValue)(b);case"Select":return(0,a.SelectContentDefaultValue)(b);default:return}};Ni.NestableContentDefaultValue=y;const C=b=>(0,a.isTextContent)(b)||(0,a.isColorContent)(b)||(0,a.isDateContent)(b)||(0,a.isTimestampContent)(b)||(0,a.isNumberContent)(b)||(0,a.isRangeContent)(b)||(0,a.isSelectContent)(b)||(0,l.isGeoPointContent)(b)||(0,h.isRichTextContent)(b)||(0,i.isBooleanContent)(b)||(0,o.isEmbedContent)(b)||(0,c.isImageContent)(b)||(0,u.isIntegrationFieldContent)(b)||(0,f.isLinkContent)(b)||(0,m.isSeparatorContent)(b)||(0,g.isTableContent)(b)||(0,r.isEmptyContent)(b)||(0,p.isRepeatableContent)(b);Ni.isNestableContent=C;const x=b=>({decode(v){if(!b.fieldType)return;const S=(0,r.EmptyLegacy)(b.fieldType).decode(v);if((0,t.isRight)(S))return S;const w=(()=>{switch(b.fieldType){case"Text":return(0,a.TextLegacy)(b);case"Color":return(0,a.ColorLegacy)(b);case"Date":return(0,a.DateLegacy)(b);case"Timestamp":return(0,a.TimestampLegacy)(b);case"Number":return(0,a.NumberLegacy)(b);case"Range":return(0,a.RangeLegacy)(b);case"Select":return(0,a.SelectLegacy)(b);case"GeoPoint":return(0,l.GeoPointLegacy)(b);case"StructuredText":return(0,h.RichTextLegacy)(b);case"Boolean":return(0,i.BooleanLegacy)(b);case"Embed":return(0,o.EmbedLegacy)(b);case"Image":return(0,c.ImageLegacy)(b);case"IntegrationFields":return(0,u.IntegrationFieldLegacy)(b);case"Link":return(0,f.LinkContentLegacy)(b);case"Separator":return(0,m.SeparatorLegacy)(b);case"Table":return(0,g.TableLegacy)(b);case"Repeatable.Link":return(0,p.RepeatableLegacy)(b,"Link");default:return}})();if(w)return w.decode(v)},encode(v){switch(v.__TYPE__){case s.FieldContentType:return v.type==="Text"?(0,a.TextLegacy)(b).encode(v):v.type==="Color"?(0,a.ColorLegacy)(b).encode(v):v.type==="Range"?(0,a.RangeLegacy)(b).encode(v):v.type==="Date"?(0,a.DateLegacy)(b).encode(v):v.type==="Number"?(0,a.NumberLegacy)(b).encode(v):v.type==="Timestamp"?(0,a.TimestampLegacy)(b).encode(v):v.type==="Select"?(0,a.SelectLegacy)(b).encode(v):void 0;case l.GeoPointContentType:return(0,l.GeoPointLegacy)(b).encode(v);case h.RichTextContentType:return(0,h.RichTextLegacy)(b).encode(v);case o.EmbedContentType:return(0,o.EmbedLegacy)(b).encode(v);case i.BooleanContentType:return(0,i.BooleanLegacy)(b).encode(v);case c.ImageContentType:return(0,c.ImageLegacy)(b).encode(v);case u.IntegrationFieldContentType:return(0,u.IntegrationFieldLegacy)(b).encode(v);case f.LinkContentType:return(0,f.LinkContentLegacy)(b).encode(v);case m.SeparatorContentType:return(0,m.SeparatorLegacy)(b).encode(v);case g.TableContentType:return(0,g.TableLegacy)(b).encode(v);case"RepeatableContent":return(0,p.RepeatableLegacy)(b,v.type).encode(v);default:return}}});return Ni.NestableLegacy=x,Ni}var AL;function ra(){return AL||(AL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(Jz(),e),(0,t.__exportStar)(BM(),e),(0,t.__exportStar)(Zz(),e),(0,t.__exportStar)(Xz(),e),(0,t.__exportStar)(PM(),e),(0,t.__exportStar)(eQ(),e),(0,t.__exportStar)(eC(),e),(0,t.__exportStar)(uje(),e),(0,t.__exportStar)(cQ(),e),(0,t.__exportStar)(WM(),e),(0,t.__exportStar)(uQ(),e),(0,t.__exportStar)(dQ(),e)}(oS)),oS}var la={},mL;function tC(){if(mL)return la;mL=1,Object.defineProperty(la,"__esModule",{value:!0}),la.repeatableContentWithDefaultNestableContentValues=la.withDefaultNestableContentValues=la.withDefaultSlicePrimaryContentValues=void 0;const e=he,t=fs(),n=ra();function r(a,s){const l=s;for(const[c,u]of Object.entries(a)){const f=s[c];if(f===void 0){if(u.type===e.GroupFieldType)l[c]=(0,t.groupContentWithDefaultValues)(u,t.GroupContentDefaultValue);else{const p=(0,n.NestableContentDefaultValue)(u);p&&(l[c]=p)}continue}u.type===e.GroupFieldType&&(0,t.isGroupContent)(f)&&(l[c]=(0,t.groupContentWithDefaultValues)(u,f))}return l}la.withDefaultSlicePrimaryContentValues=r;function i(a,s){return Object.entries(a).reduce((l,[c,u])=>{if(s[c]===void 0){const f=(0,n.NestableContentDefaultValue)(u);return f!==void 0?{...l,[c]:f}:l}return l},s)}la.withDefaultNestableContentValues=i;function o(a,s){const l=Object.entries(a);return s.map(c=>l.reduce((u,[f,p])=>{var h;const m=c.value.find(([g])=>g===f);if(p.type==="Group"){const g=(0,t.groupContentWithDefaultValues)(p,(h=m==null?void 0:m[1])!==null&&h!==void 0?h:{__TYPE__:t.GroupContentType,value:[]});return{...u,value:[...u.value.filter(([y])=>y!==f),...g?[[f,g]]:[]]}}else if(!m){const g=(0,n.NestableContentDefaultValue)(p);return{...u,value:[...u.value,...g?[[f,g]]:[]]}}return u},c))}return la.repeatableContentWithDefaultNestableContentValues=o,la}var gL;function fs(){return gL||(gL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseGroupItemsContent=e.traverseGroupContent=e.groupContentWithDefaultValues=e.GroupLegacy=e.GroupItemLegacy=e.GroupContentDefaultValue=e.isGroupContent=e.GroupContent=e.GroupItemContent=e.GroupContentType=e.GroupItemContentType=void 0;const t=G,n=lt,r=un,i=Ye,o=(0,t.__importStar)(ne),a=he,s=pr,l=jt(),c=ra(),u=tC();e.GroupItemContentType="GroupItemContent",e.GroupContentType="GroupContentType",e.GroupItemContent=o.recursion("GroupItemContent",()=>o.strict({__TYPE__:o.literal(e.GroupItemContentType),value:o.array(o.tuple([o.string,o.union([c.NestableContent,e.GroupContent])]))})),e.GroupContent=o.recursion("GroupContent",()=>o.strict({__TYPE__:o.literal(e.GroupContentType),value:o.array(e.GroupItemContent)}));const f=x=>(0,l.hasContentType)(x)&&x.__TYPE__===e.GroupContentType;e.isGroupContent=f,e.GroupContentDefaultValue={__TYPE__:e.GroupContentType,value:[]};const p=o.record(o.string,o.unknown),h=x=>new o.Type("GroupItemLegacy",b=>(0,l.hasContentType)(b)&&b.__TYPE__===e.GroupItemContentType,b=>(0,i.pipe)(p.decode(b),n.either.map(S=>({value:Object.entries(S).reduce((T,[E,R])=>{const O=(0,s.getFieldCtx)(E,x),k=O.fieldType===a.GroupFieldType?(0,e.GroupLegacy)(O).decode(R):(0,c.NestableLegacy)(O).decode(R);return!k||(0,r.isLeft)(k)?T:[...T,[E,k.right]]},[]),__TYPE__:e.GroupItemContentType}))),b=>b.value.reduce((v,[S,w])=>{const T=(0,s.getFieldCtx)(S,x),E=(0,e.isGroupContent)(w)?(0,e.GroupLegacy)(T).encode(w):(0,c.NestableLegacy)(T).encode(w);return E?{content:{...v.content,[S]:E.content},types:{...v.types,...E.types}}:v},{content:{},types:{}}));e.GroupItemLegacy=h;const m=x=>{const b=o.array(o.union([o.null,(0,e.GroupItemLegacy)(x)])),v=o.array((0,e.GroupItemLegacy)(x));return new o.Type("GroupLegacy",e.isGroupContent,S=>(0,i.pipe)(b.decode(S),n.either.map(w=>({value:w.map(T=>T===null?{__TYPE__:e.GroupItemContentType,value:[]}:T),__TYPE__:e.GroupContentType}))),S=>{const w=v.encode(S.value);return{content:w.map(T=>T.content),types:w.reduce((T,E)=>({...T,...E.types}),{[x.keyOfType]:a.GroupFieldType})}})};e.GroupLegacy=m;function g(x,b){var v;const S=(v=x.config)===null||v===void 0?void 0:v.fields;return S?{...b,value:(0,u.repeatableContentWithDefaultNestableContentValues)(S,b.value)}:b}e.groupContentWithDefaultValues=g;function y({path:x,key:b,apiId:v,model:S,content:w}){return T=>{var E;const R=C({path:x,model:(E=S==null?void 0:S.config)===null||E===void 0?void 0:E.fields,content:w.value})(T);return T({path:x,key:b,apiId:v,model:S,content:{__TYPE__:w.__TYPE__,value:R}})}}e.traverseGroupContent=y;function C({path:x,model:b,content:v}){return S=>v.map((w,T)=>{const E=x.concat([{key:T.toString(),type:"GroupItem"}]),R=w.value.reduce((O,[k,B])=>{const K=b==null?void 0:b[k];let H;return(0,e.isGroupContent)(B)?H=y({path:E.concat([{key:k,type:"Widget"}]),key:k,apiId:k,model:(K==null?void 0:K.type)==="Group"?K:void 0,content:B})(S):(0,c.isRepeatableContent)(B)?H=(0,c.traverseRepeatableContent)({path:E.concat([{key:k,type:"Widget"}]),key:k,apiId:k,model:(K==null?void 0:K.type)==="Link"?K:void 0,content:B})(S):(0,c.isTableContent)(B)?H=(0,c.traverseTableContent)({path:E.concat([{key:k,type:"Widget"}]),key:k,apiId:k,model:(K==null?void 0:K.type)==="Table"?K:void 0,content:B})(S):H=S({path:E.concat([{key:k,type:"Widget"}]),key:k,apiId:k,model:K,content:B}),!H||!((0,c.isNestableContent)(H)||(0,e.isGroupContent)(H))?O:O.concat([[k,H]])},[]);return{__TYPE__:w.__TYPE__,value:R}})}e.traverseGroupItemsContent=C}(rS)),rS}var RS={},$S={},kS={},jl={},vL;function fQ(){if(vL)return jl;vL=1,Object.defineProperty(jl,"__esModule",{value:!0}),jl.RepeatableWidgets=jl.RepeatableWidgetsLegacy=void 0;const t=(0,G.__importStar)(ne),n=fs(),r=ra(),i=s=>t.array((0,n.GroupItemLegacy)(s));jl.RepeatableWidgetsLegacy=i;const o=t.tuple([t.string,t.union([r.NestableContent,n.GroupContent])]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return jl.RepeatableWidgets=t.array(a),jl}var yL;function Fv(){return yL||(yL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.migrateCompositeSlice=e.traverseCompositeSliceContent=e.compositeSliceContentWithDefaultValues=e.CompositeSliceContent=e.CompositeSliceLegacy=e.isCompositeSliceContent=e.CompositeSliceContentType=void 0;const t=G,n=lt,r=un,i=Ye,o=(0,t.__importStar)(ne),a=pr,s=jt(),l=fs(),c=ra(),u=tC(),f=fQ();e.CompositeSliceContentType="CompositeSliceContent";const p=x=>(0,s.hasContentType)(x)&&x.__TYPE__===e.CompositeSliceContentType;e.isCompositeSliceContent=p;const h=o.exact(o.partial({repeat:o.array(o.unknown),"non-repeat":o.UnknownRecord})),m=x=>new o.Type("CompositeSliceLegacy",e.isCompositeSliceContent,b=>(0,i.pipe)(h.decode(b),n.either.map(v=>{const S=(()=>{const T=(0,a.getFieldCtx)("repeat",x),E=(0,f.RepeatableWidgetsLegacy)(T).decode(v.repeat);if(!(!E||(0,r.isLeft)(E)))return E.right})()||[];return{nonRepeat:Object.entries(v["non-repeat"]||{}).reduce((T,[E,R])=>{const O=(0,a.getFieldCtx)(E,x,["non-repeat"]);if(!O)return T;const k=(0,c.NestableLegacy)(O).decode(R);return!k||(0,r.isLeft)(k)?T:{...T,[E]:k.right}},{}),repeat:S,__TYPE__:e.CompositeSliceContentType}})),b=>{const v=Object.entries(b.nonRepeat).reduce((w,[T,E])=>{const R=(0,a.getFieldCtx)(T,x,["non-repeat"]),O=(0,c.NestableLegacy)(R).encode(E);return O?{content:{...w.content,[T]:O.content},types:{...w.types,...O.types}}:w},{content:{},types:{}}),S=(()=>{const w=(0,a.getFieldCtx)("repeat",x);return(0,f.RepeatableWidgetsLegacy)(w).encode(b.repeat)})()||[];return{content:{"non-repeat":v.content,repeat:S.map(w=>w.content)},types:{[x.keyOfType]:"Slice",...v.types,...S.reduce((w,T)=>({...w,...T.types}),{})}}});e.CompositeSliceLegacy=m,e.CompositeSliceContent=o.strict({__TYPE__:o.literal(e.CompositeSliceContentType),nonRepeat:o.record(o.string,c.NestableContent),repeat:f.RepeatableWidgets});function g(x,b){var v,S;const w=(0,u.withDefaultNestableContentValues)((v=x["non-repeat"])!==null&&v!==void 0?v:{},b.nonRepeat),T=(0,u.repeatableContentWithDefaultNestableContentValues)((S=x.repeat)!==null&&S!==void 0?S:{},b.repeat);return{...b,nonRepeat:w,repeat:T}}e.compositeSliceContentWithDefaultValues=g;function y({path:x,sliceKey:b,sliceName:v,model:S,content:w}){return(T,E)=>{const R=Object.entries(w.widget.nonRepeat).reduce((k,[B,K])=>{const H=(()=>{var N,Y,ee;return(S==null?void 0:S.type)==="SharedSlice"?(Y=(N=S==null?void 0:S.fields)===null||N===void 0?void 0:N.primary)===null||Y===void 0?void 0:Y[B]:(ee=S==null?void 0:S["non-repeat"])===null||ee===void 0?void 0:ee[B]})(),z=T({path:x.concat([{key:"non-repeat",type:"primary"},{key:B,type:"Widget"}]),key:B,apiId:v,model:H,content:K});return z?(0,c.isNestableContent)(z)?{...k,[B]:z}:(console.warn(`Warn: Non nestable content with key [${B}] detected in a composite slice [${v}] with key [${b}]`),k):k},{}),O=(0,l.traverseGroupItemsContent)({path:x.concat([{key:"repeat",type:"items"}]),model:(S==null?void 0:S.type)==="SharedSlice"?S==null?void 0:S.fields.items:S==null?void 0:S.repeat,content:w.widget.repeat})(T);return E({key:b,apiId:v,path:x,model:S,content:{...w,widget:{__TYPE__:"CompositeSliceContent",repeat:O,nonRepeat:R}}})}}e.traverseCompositeSliceContent=y;function C(x,b){const[,v]=b.key.split("$");return{key:`${x.sliceName}$${v}`,name:x.sliceName,maybeLabel:b.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:x.variationId,primary:Object.entries(b.widget.nonRepeat).reduce((S,[w,T])=>{var E;return!((E=x.fields.primary)===null||E===void 0)&&E[w]?{...S,[w]:T}:(console.warn(`The widget ${w} in the non-repeat zone of the composite slice [${x.sliceName}] with key [${b.key}] doesn't exist in the model.`),S)},{}),items:b.widget.repeat.map(S=>({__TYPE__:"GroupItemContent",value:S.value.reduce((w,[T,E])=>{var R;return!((R=x.fields.items)===null||R===void 0)&&R[T]?w.concat([[T,E]]):(console.warn(`The widget ${T} in the repeat zone of the composite slice [${x.sliceName}] with key [${b.key}] doesn't exist in the model.`),w)},[])}),[])}}}e.migrateCompositeSlice=C}(kS)),kS}var OS={},ca={},bL;function pQ(){if(bL)return ca;bL=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.isSlicePrimaryContent=ca.SlicePrimaryLegacy=ca.SlicePrimaryContent=void 0;const t=(0,G.__importStar)(ne),n=he,r=fs(),i=ra();ca.SlicePrimaryContent=t.union([i.NestableContent,r.GroupContent]);const o=s=>{const l=(0,r.GroupLegacy)(s),c=(0,i.NestableLegacy)(s);return{decode(u){return s.fieldType===n.GroupFieldType?l.decode(u):c.decode(u)},encode(u){return(0,r.isGroupContent)(u)?l.encode(u):c.encode(u)}}};ca.SlicePrimaryLegacy=o;const a=s=>(0,i.isNestableContent)(s)||(0,r.isGroupContent)(s);return ca.isSlicePrimaryContent=a,ca}var CL;function jv(){return CL||(CL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseSharedSliceContent=e.sharedSliceContentWithDefaultValues=e.SharedSliceContent=e.SharedSliceLegacy=e.isSharedSliceContent=e.SharedSliceContentType=void 0;const t=G,n=lt,r=un,i=Ye,o=(0,t.__importStar)(ne),a=$1,s=he,l=pr,c=jt(),u=fs(),f=ra(),p=tC(),h=fQ(),m=pQ();e.SharedSliceContentType="SharedSliceContent";const g=v=>(0,c.hasContentType)(v)&&v.__TYPE__===e.SharedSliceContentType;e.isSharedSliceContent=g;const y=o.exact(o.type({variation:o.string,items:(0,a.withFallback)(o.array(o.unknown),[]),primary:(0,a.withFallback)(o.UnknownRecord,{})})),C=v=>new o.Type("SharedSliceLegacy",e.isSharedSliceContent,S=>(0,i.pipe)(y.decode(S),n.either.map(w=>{const T=(()=>{const R=(0,l.getFieldCtx)("items",v,["variations",w.variation]),O=(0,h.RepeatableWidgetsLegacy)(R).decode(w.items);if(!(!O||(0,r.isLeft)(O)))return O.right})()||[],E=Object.entries(w.primary).reduce((R,[O,k])=>{const B=(0,l.getFieldCtx)(O,v,["variations",w.variation,"primary"]),K=(0,m.SlicePrimaryLegacy)(B).decode(k);return!K||(0,r.isLeft)(K)?R:{...R,[O]:K.right}},{});return{variation:w.variation,primary:E,items:T,__TYPE__:e.SharedSliceContentType}})),S=>{const w=Object.entries(S.primary).reduce((E,[R,O])=>{const k=(0,l.getFieldCtx)(R,v,["variations",S.variation,"primary"]),B=(0,m.SlicePrimaryLegacy)(k).encode(O);return B?{content:{...E.content,[R]:B.content},types:{...E.types,...B.types}}:E},{content:{},types:{}}),T=(()=>{const E=(0,l.getFieldCtx)("items",v,["variations",S.variation]);return(0,h.RepeatableWidgetsLegacy)(E).encode(S.items)})()||[];return{content:{primary:w.content,items:T.map(E=>E.content),variation:S.variation},types:{[v.keyOfType]:"SharedSlice",...w.types,...T.reduce((E,R)=>({...E,...R.types}),{})}}});e.SharedSliceLegacy=C,e.SharedSliceContent=o.strict({__TYPE__:o.literal(e.SharedSliceContentType),variation:o.string,primary:o.record(o.string,m.SlicePrimaryContent),items:h.RepeatableWidgets});function x(v,S){var w,T;const E=v.variations.find(K=>K.id===S.variation),R=(w=E==null?void 0:E.primary)!==null&&w!==void 0?w:{},O=(T=E==null?void 0:E.items)!==null&&T!==void 0?T:{},k=(0,p.withDefaultSlicePrimaryContentValues)(R,S.primary),B=(0,p.repeatableContentWithDefaultNestableContentValues)(O,S.items);return{...S,primary:k,items:B}}e.sharedSliceContentWithDefaultValues=x;function b({path:v,sliceKey:S,sliceName:w,model:T,content:E}){return(R,O)=>{const k=Object.entries(E.widget.primary).reduce((K,[H,z])=>{var N,Y;const ee=(Y=(N=T==null?void 0:T.fields)===null||N===void 0?void 0:N.primary)===null||Y===void 0?void 0:Y[H],F=(()=>(0,u.isGroupContent)(z)?(0,u.traverseGroupContent)({path:v.concat([{key:"primary",type:"primary"},{key:H,type:"Widget"}]),key:H,apiId:H,content:z,model:(ee==null?void 0:ee.type)===s.GroupFieldType?ee:void 0})(R):(0,f.isRepeatableContent)(z)?(0,f.traverseRepeatableContent)({path:v.concat([{key:"primary",type:"primary"},{key:H,type:"Widget"}]),key:H,apiId:H,content:z,model:(ee==null?void 0:ee.type)==="Link"?ee:void 0})(R):(0,f.isTableContent)(z)?(0,f.traverseTableContent)({path:v.concat([{key:"primary",type:"primary"},{key:H,type:"Widget"}]),key:H,apiId:H,content:z,model:(ee==null?void 0:ee.type)==="Table"?ee:void 0})(R):(0,f.isNestableContent)(z)?R({path:v.concat([{key:"primary",type:"primary"},{key:H,type:"Widget"}]),key:H,apiId:H,model:ee,content:z}):void 0)();return F?((0,m.isSlicePrimaryContent)(F)||console.warn(`Warn: Non nestable or group content with key [${H}] detected in a shared slice [${w}] with key [${S}]`),{...K,[H]:F}):K},{}),B=(0,u.traverseGroupItemsContent)({path:v.concat([{key:"items",type:"items"}]),model:T==null?void 0:T.fields.items,content:E.widget.items})(R);return O({key:S,apiId:w,path:v,model:T,content:{...E,widget:{__TYPE__:"SharedSliceContent",variation:E.widget.variation,primary:k,items:B}}})}}e.traverseSharedSliceContent=b}(OS)),OS}var Hr={},SL;function Lv(){if(SL)return Hr;SL=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.migrateSimpleSlice=Hr.traverseSimpleSliceContent=Hr.SimpleSliceLegacy=Hr.isSimpleSliceContent=Hr.SimpleSliceContent=void 0;const t=(0,G.__importStar)(ne),n=fs(),r=ra();Hr.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);const i=l=>(0,r.isNestableContent)(l)||(0,n.isGroupContent)(l);Hr.isSimpleSliceContent=i;const o=l=>({decode:(()=>l.fieldType==="Group"?(0,n.GroupLegacy)(l).decode.bind(null):(0,r.NestableLegacy)(l).decode.bind(null))(),encode:c=>{switch(c.__TYPE__){case"GroupContentType":return(0,n.GroupLegacy)(l).encode(c);default:return(0,r.NestableLegacy)(l).encode(c)}}});Hr.SimpleSliceLegacy=o;function a({path:l,sliceKey:c,sliceName:u,model:f,content:p}){return(h,m)=>{if((0,n.isGroupContent)(p.widget)){const y=(0,n.traverseGroupContent)({path:l,key:p.key,apiId:p.name,model:(()=>{if((f==null?void 0:f.type)==="Group")return f;if((f==null?void 0:f.type)==="SharedSlice")return{type:"Group",config:{fields:f.fields.items||{}}}})(),content:p.widget})(h);return y&&m({key:p.key,apiId:p.name,path:l,model:f,content:{...p,widget:y}})}const g=h({key:p.key,apiId:p.name,path:l,model:(()=>{var y;if((f==null?void 0:f.type)==="SharedSlice")return(y=f.fields.primary)===null||y===void 0?void 0:y[p.name];if((f==null?void 0:f.type)!=="Group")return f})(),content:p.widget});return g&&m({key:c,apiId:u,path:l,model:f,content:{...p,widget:g}})}}Hr.traverseSimpleSliceContent=a;function s(l,c){var u;const[,f]=c.key.split("$"),p=`${l.sliceName}$${f}`;return c.widget.__TYPE__==="GroupContentType"?{key:p,name:l.sliceName,maybeLabel:c.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:l.variationId,primary:{},items:c.widget.value.map(h=>({__TYPE__:"GroupItemContent",value:h.value.reduce((m,[g,y])=>{var C;return!((C=l.fields.items)===null||C===void 0)&&C[g]?m.concat([[g,y]]):m},[])}),[])}}:{key:p,name:l.sliceName,maybeLabel:c.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:l.variationId,primary:!((u=l.fields.primary)===null||u===void 0)&&u[c.name]?{[c.name]:c.widget}:{},items:[]}}}return Hr.migrateSimpleSlice=s,Hr}var wL;function hQ(){return wL||(wL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SliceContent=e.SliceLegacy=void 0;const t=G,n=(0,t.__importStar)(ne),r=Fv(),i=jv(),o=Lv(),a=s=>({decode:l=>(()=>{switch(s.fieldType){case"Slice":return(0,r.CompositeSliceLegacy)(s);case"SharedSlice":return(0,i.SharedSliceLegacy)(s);default:return(0,o.SimpleSliceLegacy)(s)}})().decode(l),encode:l=>{switch(l.__TYPE__){case"SharedSliceContent":return(0,i.SharedSliceLegacy)(s).encode(l);case"CompositeSliceContent":return(0,r.CompositeSliceLegacy)(s).encode(l);default:return(0,o.SimpleSliceLegacy)(s).encode(l)}}});e.SliceLegacy=a,e.SliceContent=n.union([r.CompositeSliceContent,i.SharedSliceContent,o.SimpleSliceContent]),(0,t.__exportStar)(Fv(),e),(0,t.__exportStar)(jv(),e),(0,t.__exportStar)(Lv(),e),(0,t.__exportStar)(pQ(),e)}($S)),$S}var Tn={},xL;function AQ(){if(xL)return Tn;xL=1,Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.migrateSliceItem=Tn.SlicesItemLegacy=Tn.sliceItemContentWithDefaultValues=Tn.isSimpleSliceItemContent=Tn.isCompositeSliceItemContent=Tn.isSharedSliceItemContent=Tn.SliceItemContent=void 0;const e=G,t=lt,n=un,r=Ye,i=(0,e.__importStar)(ne),o=nt,a=pr,s=fs(),l=ra(),c=tC(),u=hQ(),f=Fv(),p=jv(),h=Lv();Tn.SliceItemContent=i.type({key:i.string,name:i.string,maybeLabel:i.union([i.string,i.undefined]),widget:u.SliceContent});function m(S){return(0,p.isSharedSliceContent)(S.widget)}Tn.isSharedSliceItemContent=m;function g(S){return(0,f.isCompositeSliceContent)(S.widget)}Tn.isCompositeSliceItemContent=g;function y(S){return(0,s.isGroupContent)(S.widget)||(0,l.isNestableContent)(S.widget)}Tn.isSimpleSliceItemContent=y;function C(S,w){var T;if(S.type==="SharedSlice"&&(0,p.isSharedSliceContent)(w))return(0,u.sharedSliceContentWithDefaultValues)(S,w);if(S.type==="Slice"&&(0,f.isCompositeSliceContent)(w))return(0,u.compositeSliceContentWithDefaultValues)(S,w);if(S.type==="Group"&&(0,s.isGroupContent)(w)&&(!((T=S.config)===null||T===void 0)&&T.fields)){const E=(0,c.repeatableContentWithDefaultNestableContentValues)(S.config.fields,w.value);return{...w,value:E}}return w}Tn.sliceItemContentWithDefaultValues=C;const x=i.exact(i.intersection([i.type({key:i.string,value:i.unknown}),i.partial({label:(0,o.nullable)(i.string)})])),b=S=>new i.Type("SlicesItemLegacy",w=>((0,p.isSharedSliceContent)(w.widget),(0,f.isCompositeSliceContent)(w.widget),(0,h.isSimpleSliceContent)(w.widget)),(w,T)=>(0,r.pipe)(x.decode(w),t.either.chain(E=>{var R;const O=E.key.indexOf("$"),k=E.key.substring(0,O>0?O:void 0),B=(0,a.getFieldCtx)(k,S),K=(0,u.SliceLegacy)(B).decode(E.value);return!K||(0,n.isLeft)(K)?i.failure(w,T):i.success({key:E.key,name:k,maybeLabel:(R=E.label)!==null&&R!==void 0?R:void 0,widget:K.right})})),w=>{const T=(0,a.getFieldCtx)(w.name,S),E=(0,u.SliceLegacy)(T).encode(w.widget);return{content:{key:w.key,label:w.maybeLabel,value:(E==null?void 0:E.content)||{}},types:(E==null?void 0:E.types)||{}}});Tn.SlicesItemLegacy=b;const v=({model:S,content:w})=>g(w)&&(S==null?void 0:S.type)==="SharedSlice"?(0,f.migrateCompositeSlice)(S,w):y(w)&&(S==null?void 0:S.type)==="SharedSlice"?(0,h.migrateSimpleSlice)(S,w):w;return Tn.migrateSliceItem=v,Tn}var MS={},_L;function dje(){return _L||(_L=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseSlices=e.slicesContentWithDefaultValues=e.SlicesContent=e.SlicesLegacy=e.isSlicesContent=e.SlicesContentType=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=Dm,a=he,s=jt(),l=Fv(),c=jv(),u=Lv(),f=AQ();e.SlicesContentType="SliceContentType";const p=C=>(0,s.hasContentType)(C)&&C.__TYPE__===e.SlicesContentType;e.isSlicesContent=p;const h=C=>{const x=i.array((0,f.SlicesItemLegacy)(C));return new i.Type("SlicesLegacy",e.isSlicesContent,b=>(0,r.pipe)(x.decode(b),n.either.map(v=>({__TYPE__:e.SlicesContentType,value:v}))),b=>{const v=x.encode(b.value);return{content:v.map(S=>S.content),types:v.reduce((S,w)=>({...S,...w.types}),{[C.keyOfType]:"Slices"})}})};e.SlicesLegacy=h,e.SlicesContent=i.type({__TYPE__:i.literal(e.SlicesContentType),value:i.array(f.SliceItemContent)});function m(C,x){var b;const v=(b=C==null?void 0:C.config)===null||b===void 0?void 0:b.choices;if(v===void 0)return x;const S=x.value.map(w=>{const T=v[w.name];if(T){const E=(0,f.sliceItemContentWithDefaultValues)(T,w.widget);return{...w,widget:E}}return w});return{...x,value:S}}e.slicesContentWithDefaultValues=m;function g(C,x,b){var v,S;const w=(S=(v=x==null?void 0:x.config)===null||v===void 0?void 0:v.choices)===null||S===void 0?void 0:S[b.name],T=()=>{if((0,f.isSharedSliceItemContent)(b)&&w&&(0,a.isStaticSharedSlice)(w)){const O=w.variations.find(k=>k.id===b.widget.variation);return O?{type:"SharedSlice",sliceName:w.id,variationId:O.id,fields:{primary:O.primary||{},items:O.items||{}}}:void 0}},E=()=>{var O;const k=o.ContentPath.append(o.ContentPath.serialize(C),b.name),B=Object.values(((O=x==null?void 0:x.config)===null||O===void 0?void 0:O.choices)||{}).find(H=>{var z;return(0,a.isStaticSharedSlice)(H)?!!(!((z=H.legacyPaths)===null||z===void 0)&&z[k]):!1});if(!B)return;const K=B==null?void 0:B.variations.find(H=>{var z;return H.id===((z=B.legacyPaths)===null||z===void 0?void 0:z[k])});if(K)return{type:"SharedSlice",sliceName:B.id,variationId:K.id,fields:{primary:K.primary||{},items:K.items||{}}}},R=()=>{if(w){if((0,a.isCompositeSlice)(w))return{type:"Slice","non-repeat":w["non-repeat"]||{},repeat:w.repeat||{}};if((0,a.isLegacySlice)(w))return w}};return T()||E()||R()}function y({path:C,key:x,model:b,content:v}){return({transformWidget:S=({content:T})=>T,transformSlice:w=({content:T})=>T})=>{const T=v.value.reduce((E,R)=>{const O=b&&g(C,b,R),k=(()=>{if((0,f.isSharedSliceItemContent)(R))return(0,c.traverseSharedSliceContent)({path:C.concat({key:R.key,type:"SharedSlice"}),sliceKey:R.key,sliceName:R.name,model:(O==null?void 0:O.type)==="SharedSlice"?O:void 0,content:R})(S,w);if((0,f.isCompositeSliceItemContent)(R))return(0,l.traverseCompositeSliceContent)({path:C.concat({key:R.key,type:"Slice"}),sliceKey:R.key,sliceName:R.name,model:(O==null?void 0:O.type)==="Slice"||(O==null?void 0:O.type)==="SharedSlice"?O:void 0,content:R})(S,w);if((0,f.isSimpleSliceItemContent)(R))return(0,u.traverseSimpleSliceContent)({path:C.concat({key:R.key,type:"LegacySlice"}),sliceKey:R.key,sliceName:R.name,model:O&&(O==null?void 0:O.type)!=="Slice"?O:void 0,content:R})(S,w)})();return k?E.concat(k):E},[]);return S({path:C,key:x,apiId:x,model:b,content:{__TYPE__:v.__TYPE__,value:T}})}}e.traverseSlices=y}(MS)),MS}var TL;function mQ(){return TL||(TL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(hQ(),e),(0,t.__exportStar)(AQ(),e),(0,t.__exportStar)(dje(),e)}(RS)),RS}var FS={},IL;function gQ(){return IL||(IL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UIDContent=e.UIDLegacy=e.isUIDContent=e.UIDContentType=void 0;const t=G,n=lt,r=Ye,i=(0,t.__importStar)(ne),o=jt();e.UIDContentType="UIDContent";const a=l=>(0,o.hasContentType)(l)&&l.__TYPE__===e.UIDContentType;e.isUIDContent=a;const s=l=>new i.Type("UIDLegacy",e.isUIDContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(u=>e.UIDContent.encode({value:u,__TYPE__:e.UIDContentType}))),c=>({content:c.value,types:{[l.keyOfType]:"UID"}}));e.UIDLegacy=s,e.UIDContent=i.type({__TYPE__:i.literal(e.UIDContentType),value:i.string})}(FS)),FS}var ua={},EL;function fje(){if(EL)return ua;EL=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.WidgetLegacy=ua.isWidgetContent=ua.WidgetContent=void 0;const t=(0,G.__importStar)(ne),n=fs(),r=ra(),i=mQ(),o=gQ();ua.WidgetContent=t.union([n.GroupContent,r.NestableContent,o.UIDContent,i.SlicesContent]);const a=l=>(0,n.isGroupContent)(l)||(0,r.isNestableContent)(l)||(0,o.isUIDContent)(l)||(0,i.isSlicesContent)(l);ua.isWidgetContent=a;const s=l=>({decode(c){if(!l.fieldType)return;const u=(()=>{switch(l.fieldType){case"UID":return(0,o.UIDLegacy)(l);case"Group":return(0,n.GroupLegacy)(l);case"Choice":case"Slices":return(0,i.SlicesLegacy)(l);default:return(0,r.NestableLegacy)(l)}})();if(u)return u.decode(c)},encode(c){switch(c.__TYPE__){case o.UIDContentType:return(0,o.UIDLegacy)(l).encode(c);case n.GroupContentType:return(0,n.GroupLegacy)(l).encode(c);case i.SlicesContentType:return(0,i.SlicesLegacy)(l).encode(c);default:return(0,r.NestableLegacy)(l).encode(c)}}});return ua.WidgetLegacy=s,ua}var RL;function NM(){return RL||(RL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(Gz(),e),(0,t.__exportStar)(fs(),e),(0,t.__exportStar)(ra(),e),(0,t.__exportStar)(mQ(),e),(0,t.__exportStar)(gQ(),e),(0,t.__exportStar)(fje(),e)}(tS)),tS}Object.defineProperty(Rr,"__esModule",{value:!0});Rr.migrateDocument=Rr.collectWidgets=Rr.traverseDocument=Rr.fillDocumentWithDefaultValues=Rr.DocumentLegacy=Rr.Document=void 0;const pje=G,vQ=lt,KM=un,yQ=Ye,Td=(0,pje.__importStar)(ne),bQ=Dm,qM=Tu,Id=he,Zr=NM(),tx=pr;Rr.Document=Td.record(qM.WidgetKey,Zr.WidgetContent);const hje=Td.record(qM.WidgetKey,Td.unknown),VM=e=>new Td.Type("Document",t=>!!t&&typeof t=="object",t=>(0,yQ.pipe)(hje.decode(t),vQ.either.map(n=>Object.entries(n).reduce((r,[i,o])=>{const a=(0,tx.defaultCtx)(i,e),s=(0,Zr.WidgetLegacy)(a).decode(o);return!s||(0,KM.isLeft)(s)?r:{...r,[i]:s.right}},{}))),t=>Object.entries(t).reduce((n,[r,i])=>{const o=(0,tx.defaultCtx)(r,e),a=(0,Zr.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function CQ(e){const t=Object.entries(e),{types:n,widgets:r}=t.reduce((a,[s,l])=>{if(s.endsWith("_TYPE")){const c=tx.FieldOrSliceType.decode(l);if((0,KM.isRight)(c))return{...a,types:a.types.set(s.substring(0,s.length-5),c.right)}}return!s.endsWith("_POSITION")&&!s.endsWith("_TYPE")?{...a,widgets:{...a.widgets,[s]:l}}:a},{types:new Map,widgets:{}}),i=e.slugs_INTERNAL||[],o=e.uid;return{widgets:r,types:n,uid:o,slugs:i}}function Aje(e,t){const n=(0,yQ.pipe)(Td.record(qM.WidgetKey,Td.unknown).decode(e),vQ.either.chain(r=>{const{types:i,widgets:o}=CQ(r);return VM(i).decode(o)}));return(0,KM.isLeft)(n)?void 0:SQ(n.right,t)}function mje(e){const t=VM().encode(e);return{...t.content,...t.types}}Rr.DocumentLegacy={_codec:VM,extractMetadata:CQ,parse:Aje,encode:mje};function zM(e){return{customTypeId:e==null?void 0:e.id,fields:Object.fromEntries((0,Id.flattenSections)(e))}}function gje(e,t){const{fields:n}=e&&Id.StaticCustomType.is(e)?zM(e):e;return Object.entries(n).reduce((r,[i,o])=>{const a=t[i],s=(()=>{switch(o.type){case"Group":return(0,Zr.isGroupContent)(a)?(0,Zr.groupContentWithDefaultValues)(o,a):a;case"Choice":case"Slices":return(0,Zr.isSlicesContent)(a)?(0,Zr.slicesContentWithDefaultValues)(o,a):a;default:return a===void 0&&Id.NestableWidget.is(o)?(0,Zr.NestableContentDefaultValue)(o):a}})();return s?{...r,[i]:s}:r},t)}Rr.fillDocumentWithDefaultValues=gje;function QM({document:e,customType:t}){const n=t&&Id.StaticCustomType.is(t)?zM(t):t;return({transformWidget:r=({content:o})=>o,transformSlice:i=({content:o})=>o})=>{const o=n&&Object.entries(n.fields).reduce((a,[s,l])=>({...a,[s]:l}),{});return Object.entries(e).reduce((a,[s,l])=>{const c=o&&o[s],u=bQ.ContentPath.make([{key:n==null?void 0:n.customTypeId,type:"CustomType"},{key:s,type:"Widget"}]),f=(()=>{switch(l.__TYPE__){case"SliceContentType":return(0,Zr.traverseSlices)({path:u,key:s,model:(c==null?void 0:c.type)==="Slices"||(c==null?void 0:c.type)==="Choice"?c:void 0,content:l})({transformWidget:r,transformSlice:i});case"GroupContentType":return(0,Zr.traverseGroupContent)({path:u,key:s,apiId:s,model:(c==null?void 0:c.type)==="Group"?c:void 0,content:l})(r);case"RepeatableContent":return(0,Zr.traverseRepeatableContent)({path:u,key:s,apiId:s,model:(c==null?void 0:c.type)==="Link"?c:void 0,content:l})(r);case"TableContent":return(0,Zr.traverseTableContent)({path:u,key:s,apiId:s,model:(c==null?void 0:c.type)==="Table"?c:void 0,content:l})(r);default:return r({path:u,key:s,apiId:s,model:(c==null?void 0:c.type)!=="Group"&&(c==null?void 0:c.type)!=="Slices"&&(c==null?void 0:c.type)!=="Choice"?c:void 0,content:l})}})();return{...a,...f?{[s]:f}:{}}},{})}}Rr.traverseDocument=QM;function vje(e,t){const n={};return QM({document:e})({transformWidget:({content:r,path:i})=>{const o=bQ.ContentPath.serialize(i);return t(r,i)&&(n[o]=r),r}}),n}Rr.collectWidgets=vje;function SQ(e,t){const n=Id.StaticCustomType.is(t)?zM(t):t;return Object.values((0,Id.collectSharedSlices)(n)).some(i=>!!i.legacyPaths)?QM({document:e,customType:t})({transformSlice:Zr.migrateSliceItem}):e}Rr.migrateDocument=SQ;(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(Rr,e),(0,t.__exportStar)(NM(),e),(0,t.__exportStar)(pr,e)})(fe);const ia="meta_title",ps="meta_description",yje=$.object({[ia]:$.string(),[ps]:$.string()});async function wQ(e,t,n,r){const i=new URL("generate-seo-metadata",t);return i.searchParams.set("repository",e),se.request(i,{credentials:se.getRequestCredentials(n),okType:yje,method:"POST",body:r})}const Mh={min:50,max:60},Fh={min:120,max:165};function xQ(e,t){const n=[];return fe.traverseDocument({document:e,customType:t})({transformWidget:({content:i,model:o,apiId:a})=>{var s;if(!(a===ia||a===ps)&&(fe.isRichTextContent(i)&&(o==null?void 0:o.type)==="StructuredText"||fe.isTextContent(i)&&(o==null?void 0:o.type)==="Text"||fe.isUIDContent(i)&&(o==null?void 0:o.type)==="UID")){const l=Dv(i);l&&n.push({label:((s=o.config)==null?void 0:s.label)||"",value:l})}}}),n.map(i=>JSON.stringify(i)).join(`
6
+ `)}function Dv(e){if(fe.isWidgetContent(e)){if(e.__TYPE__==="UIDContent")return e.value;if(e.__TYPE__==="StructuredTextContent"){const[t]=e.value;return!t||t.type==="image"||t.type==="embed"?void 0:t.content.text}if(e.__TYPE__==="FieldContent"&&e.type==="Text")return e.value}}function _Q(e){return e.length>=300}const bje=$.object({id:$.string(),label:$.string(),repeatable:$.boolean(),status:$.boolean()});async function Cje(e,t,n){const r=await se.request(new URL("customtypes",e),{headers:{repository:t},credentials:se.getRequestCredentials(n),okType:$.array(bje)});return _t.sort(r,i=>i.label)}function zm(e){const{baseUrl:t,repository:n,authStrategy:r}=e;return Dr.queryOptions({queryKey:["customTypes"],queryFn:()=>Cje(t,n,r)})}function Sje(e,t){e.prefetchQuery(zm(t))}function wje(e,t){return e.fetchQuery(zm(t))}function nC(e){return Dr.useSuspenseQuery(zm(e))}function xje(e){const{id:t,baseUrl:n,repository:r,authStrategy:i}=e,a=nC({baseUrl:n,repository:r,authStrategy:i}).data.find(s=>s.id===t);if(!a)throw new Error(`Custom type "${t}" does not exist`);return a}function _je(e,t){return e.invalidateQueries(zm(t))}function Tje(e){const{id:t,baseUrl:n,repository:r,authStrategy:i}=e,o=new URL(`customtypes/${t}`,n);return o.searchParams.set("static","true"),se.request(o,{headers:{repository:r},credentials:se.getRequestCredentials(i),okType:Ije})}const Ije=$.unknown().transform((e,t)=>{const n=he.StaticCustomType.decode(e);return n._tag==="Right"?n.right:(t.addIssue({code:$.ZodIssueCode.custom,message:"Invalid custom type."}),$.NEVER)});function TQ(e){const{id:t}=e;return Dr.queryOptions({queryKey:["customTypes","static",t],queryFn:()=>Tje(e)})}function Eje(e){return Dr.useSuspenseQuery(TQ(e))}function Rje(e,t){e.prefetchQuery(TQ(t))}const $je=$.object({id:$.string().optional(),first_name:$.string().optional(),last_name:$.string().optional(),email:$.string().optional(),uploadedAvatar:$.string().optional()}),HM=$.object({id:$.string(),name:$.string(),is_master:$.boolean().optional()}).transform(e=>({id:e.id,label:e.name,...e.is_master!==void 0?{isMaster:e.is_master}:{}})),IQ=$.discriminatedUnion("status",[$.object({status:$.literal("unclassified")}),$.object({status:$.literal("published")}),$.object({status:$.literal("release"),release_id:$.string()}),$.object({status:$.literal("archived")})]),EQ=$.object({version_id:$.string(),tags:$.array($.string()),preview_image:$.string().optional(),last_modified_date:$.coerce.date(),uid:$.string().optional()}),RQ=IQ.and(EQ.extend({custom_type_label:$.string(),preview_summary:$.string().optional(),author:$je})),$Q=IQ.and(EQ.extend({custom_type_id:$.string().optional(),summary:$.string().optional(),author_ids:$.array($.string()).optional(),highlights:$.object({uid:$.string().optional()}).optional()}));function kQ(e){return RQ.safeParse(e).success}function nx(e){return $Q.safeParse(e).success}const OQ=$.string().nullish().transform(e=>e??"Untitled"),YM=$.object({id:$.string(),title:OQ,custom_type_id:$.string(),group_lang_id:$.string(),language:HM,versions:$.array(RQ)}),kje=$.object({total:$.number(),cursor:$.string().optional(),results:$.array(YM)}),Oje=$.object({id:$.string(),title:OQ,custom_type_id:$.string(),group_lang_id:$.string(),interesting_versions:$.array($Q),locale_id:$.string().optional()}).transform(e=>{const{interesting_versions:t,...n}=e;return{versions:t,...n}}),Mje=$.object({results:$.array(Oje)});function GM(e){const{baseUrl:t,authStrategy:n,limit:r,cursor:i,statuses:o,authors:a,language:s,groupLangIds:l,documentIds:c,customTypes:u,tags:f,term:p,uids:h,signal:m}=e,g=new URL("documents/search",t),y=Nd.filterValues({statuses:o,authors:a,language:s,groupLangIds:l,customTypes:u,tags:f,term:p,documentIds:c,limit:r,cursor:i,uids:h},C=>!(C===""||Array.isArray(C)&&C.length===0));return se.request(g,{credentials:se.getRequestCredentials(n),okType:kje,signal:m,method:"POST",body:y})}function MQ(e,t,n,r){const i=new URL(e);return i.search=n,se.request(i,{credentials:se.getRequestCredentials(t),okType:Mje,...r})}function FQ(e){const{repository:t,searchTerm:n,tags:r,authors:i,status:o,localeId:a,customTypesIds:s}=e,l=new URLSearchParams;return l.append("repository",t),n&&l.append("searchTerm",n),r!=null&&r.length&&l.append("tags",r.toString()),i!=null&&i.length&&l.append("authors",i.toString()),o!=null&&o.length&&l.append("status",o.toString()),a&&l.append("localeId",a),s!=null&&s.length&&l.append("customTypesIds",s.toString()),l.toString()}function jQ(e){return e.reduce((t,n)=>{if(n.values.every(i=>i===""||i===void 0))return t;const r=n.values.map(i=>[n.name,i??""]);return t.concat(r)},[])}function Qm(e,t,n){return se.request(new URL(`documents/${n}`,e),{credentials:se.getRequestCredentials(t),okType:YM})}const Fje=$.custom().transform((e,t)=>{const n=fe.Document.decode(e);return n._tag==="Left"?(t.addIssue({code:$.ZodIssueCode.custom,message:"Invalid document."}),$.NEVER):n.right}),jje=$.unknown().transform((e,t)=>{const n=fe.SliceItemContent.decode(e);return n._tag==="Right"?n.right:(t.addIssue({code:$.ZodIssueCode.custom,message:"Invalid slice content."}),$.NEVER)}),_o={all:()=>["documents"],lists:()=>[..._o.all(),"list"],list:e=>[..._o.lists(),e],infiniteLists:()=>[..._o.all(),"list:infinite"],infiniteList:e=>[..._o.infiniteLists(),e]};function Lje(e,t){e.setQueriesData({queryKey:_o.lists()},n=>n&&$L(n,t)),e.setQueriesData({queryKey:_o.infiniteLists()},n=>n&&{...n,pages:n.pages.map(r=>$L(r,t))})}function $L(e,t){const n=e.results.flatMap(r=>{const i=t(r,e);return i?[i]:[]});return{...e,results:n,total:e.total+(n.length-e.results.length)}}async function Dje(e){await e.invalidateQueries({queryKey:_o.lists()}),await e.invalidateQueries({queryKey:_o.infiniteLists()})}function JM(e){return Dr.useSuspenseQuery(LQ(e))}function LQ(e){return Dr.queryOptions({queryKey:_o.list(e),queryFn:({queryKey:[,,t]})=>GM(t)})}async function DQ(e){const{coreApiBaseUrl:t,documentSearchBaseUrl:n,authStrategy:r,repository:i,searchTerm:o="",customTypes:a,tags:s,authors:l,status:c,locale:u,signal:f,storageVersion:p}=e;if(p&&p.major<=6){const C=c!=null&&c.length?c:["published","unclassified","release"];return{results:(await GM({baseUrl:t,authStrategy:r,tags:s,customTypes:a,language:u,term:o,authors:l,statuses:C,limit:200})).results}}const h=FQ({repository:i,searchTerm:o,tags:s,authors:l,status:c,localeId:u,customTypesIds:a});return{results:(await MQ(n,r,h,{signal:f})).results}}function UQ(e){const{searchTerm:t,customTypes:n,tags:r,authors:i,status:o,locale:a,config:s,storageVersion:l}=e;s.searchDocuments||mt("searchDocuments");const{coreApiBaseUrl:c,documentSearchBaseUrl:u,authStrategy:f,repository:p}=s;return Dr.queryOptions({queryKey:["searchDocuments",{coreApiBaseUrl:c,documentSearchBaseUrl:u,authStrategy:f,repository:p,searchTerm:t,customTypes:n,tags:r,authors:i,status:o,locale:a,storageVersion:l}],queryFn:({queryKey:[,h],signal:m})=>DQ({...h,signal:m})})}const Uje=$.object({id:$.string(),firstname:$.string().optional(),lastname:$.string().optional(),email:$.string(),uploadedAvatar:$.string().optional()}),BQ=$.array(Uje),Bje=$.object({slicemachineEnabled:$.boolean()}),PQ=["next","nuxt","sveltekit"];function Pje(e){return PQ.includes(e)}const rC=$.preprocess(e=>typeof e=="string"&&Pje(e)?e:"other",$.enum([...PQ,"other"])),Wje=$.object({simulator_url:$.string().url().nullish(),languages:$.array(HM).transform(e=>_t.sort(e,t=>t.label)),authors:BQ.optional().default([]),quotas:Bje.optional().default({slicemachineEnabled:!1}),framework:rC.optional().default("other"),starterId:$.string().optional(),storageVersion:$.object({major:$.number().int(),minor:$.number().int()}),uploadedAvatar:$.string().url().optional()}).transform(({simulator_url:e,framework:t,...n})=>{const r=e&&WQ(e)?e:void 0;return{...n,framework:t,simulatorUrl:r,isSupportedFramework:t!=="other"}});function iC(e,t){return se.request(new URL("repository",e),{credentials:se.getRequestCredentials(t),okType:Wje})}function WQ(e){const t=ii.toURL(e);return t?t.pathname.endsWith("/slice-simulator"):!1}const Nje=$.object({results:$.array($.string())});function NQ(e,t){return se.request(new URL("repository/tags",e),{credentials:se.getRequestCredentials(t),okType:Nje})}const Kje=$.object({maxNbEnvironments:$.number(),integrationFieldsEnabled:$.boolean(),personalEnvironmentsEnabled:$.boolean(),sliceMachineEnabled:$.boolean(),customRolesEnabled:$.boolean()}),KQ=$.object({_id:$.string(),name:$.string(),onboarding:$.object({completedSteps:$.array($.string()),isDismissed:$.boolean()}),framework:rC.optional().default("other"),quotas:Kje.optional().default({maxNbEnvironments:0,integrationFieldsEnabled:!1,personalEnvironmentsEnabled:!1,sliceMachineEnabled:!1,customRolesEnabled:!1}),storageVersion:$.object({major:$.number().int(),minor:$.number().int()}),users:BQ.optional().default([])});function qje(e,t,n){const r=new URL("",e);return r.searchParams.append("repository",t),se.request(r,{headers:{repository:t},credentials:se.getRequestCredentials(n),okType:KQ})}const Vje=$.enum(["createPrismicProject","chooseLocale","createProject","setupSliceMachine","createPageType","codePage","createSlice","reviewAndPush","createContent","renderPage"]),qQ=$.object({completedSteps:$.array($.string()),isDismissed:$.boolean(),context:$.object({framework:rC,starterId:$.string().nullable().optional()})}),VQ=$.object({completedSteps:$.array($.string())}),zQ=$.object({isDismissed:$.boolean()});function zje(e,t,n){const r=new URL("onboarding",e);return r.searchParams.append("repository",t),se.request(r,{headers:{repository:t},credentials:se.getRequestCredentials(n),okType:qQ})}function Qje(e,t,n,r){const i=new URL(`onboarding/${e}/toggle`,t);return i.searchParams.append("repository",n),se.request(i,{method:"PATCH",headers:{repository:n},credentials:se.getRequestCredentials(r),okType:VQ})}function Hje(e,t,n){const r=new URL("onboarding/toggle",e);return r.searchParams.append("repository",t),se.request(r,{method:"PATCH",headers:{repository:t},credentials:se.getRequestCredentials(n),okType:zQ})}const rx=$.enum(["SuperUser","Owner","Administrator","Manager","Writer","Readonly"]);function Yje(e="Readonly"){return e==="Administrator"||e==="SuperUser"||e==="Owner"}const Gje={SuperUser:"SuperUser",Owner:"Owner",Administrator:"Administrator",Manager:"Publisher",Writer:"Writer",Readonly:"Read-only"};function Jje(e){return Gje[e]}const Zje=$.enum([rx.enum.Manager,rx.enum.Writer]),ZM=$.record(Zje),XM=$.record($.object({rolesPerLocale:ZM})),Xje=$.record($.object({rolesPerLocale:ZM,rolesPerUser:XM})),eLe=$.object({rolesPerUser:$.record(rx)}),tLe=$.object({rolesPerUser:XM}),nLe=$.object({rolesPerLocale:ZM.optional(),rolesPerUser:XM.optional(),rolesPerTeamSpace:Xje.optional()}),rLe=$.object({repository:eLe.optional(),locale:tLe.optional(),teamSpace:nLe.optional()});function QQ(e){const{baseUrl:t,repository:n,authStrategy:r,scopes:i,userIds:o,localeIds:a,teamSpaceIds:s,fetchEnabled:l}=e;if(!l)return Promise.resolve({});const c=new URL("roles",t);return c.searchParams.append("repository",n),i!=null&&i.length&&c.searchParams.set("scopes",i.join(",")),o!=null&&o.length&&c.searchParams.set("userIds",o.join(",")),a!=null&&a.length&&c.searchParams.set("localeIds",a.join(",")),s!=null&&s.length&&c.searchParams.set("teamSpaceIds",s.join(",")),se.request(c,{method:"GET",credentials:se.getRequestCredentials(r),okType:rLe})}function iLe(e){return Dr.queryOptions({queryKey:["roles",e],queryFn:()=>QQ(e)})}function oLe(e){const{baseUrl:t,repository:n,authStrategy:r,payload:i}=e,o=new URL("roles",t);return o.searchParams.append("repository",n),se.request(o,{method:"PATCH",body:i,credentials:se.getRequestCredentials(r),okType:$.unknown()})}function aLe(){const e=Dr.useQueryClient();return()=>e.invalidateQueries({queryKey:["roles"]})}const oC=$.object({id:$.string(),name:$.string(),customTypes:$.array($.string())});$.object({name:$.string(),customTypes:$.array($.string())});const sLe=$.object({results:$.array(oC)});function HQ(e){const{baseUrl:t,repository:n,authStrategy:r}=e,i=new URL("team-spaces",t);return i.searchParams.append("repository",n),se.request(i,{method:"GET",credentials:se.getRequestCredentials(r),okType:sLe})}function lLe(e){return Dr.queryOptions({queryKey:["teamSpaces",e],queryFn:()=>HQ(e),select:t=>t.results})}function cLe(){const e=Dr.useQueryClient();return()=>e.invalidateQueries({queryKey:["teamSpaces"]})}function uLe(e){const{baseUrl:t,repository:n,authStrategy:r,payload:i}=e,o=new URL("team-spaces",t);return o.searchParams.append("repository",n),se.request(o,{method:"POST",body:i,credentials:se.getRequestCredentials(r),okType:oC})}function dLe(e){const{baseUrl:t,repository:n,authStrategy:r,payload:i,teamSpaceId:o}=e,a=new URL(`team-spaces/${o}`,t);return a.searchParams.append("repository",n),se.request(a,{method:"PUT",body:i,credentials:se.getRequestCredentials(r),okType:oC})}function fLe(e){const{baseUrl:t,repository:n,authStrategy:r,teamSpaceId:i}=e,o=new URL(`team-spaces/${i}`,t);return o.searchParams.append("repository",n),se.request(o,{method:"DELETE",credentials:se.getRequestCredentials(r),okType:$.unknown()})}const YQ=$.enum(["SuperUser","Owner","Administrator","Writer","Manager","Readonly"]),pLe=$.record(YQ.optional()),hLe=YQ.or(pLe),ALe={SuperUser:"SuperUser",Owner:"Owner",Administrator:"Administrator",Manager:"Publisher",Writer:"Writer",Readonly:"Contributor"},GQ=$.object({userId:$.string(),shortId:$.string(),intercomHash:$.string(),email:$.string(),firstName:$.string(),lastName:$.string(),superPower:$.boolean(),repositories:$.array($.object({domain:$.string(),name:$.string().optional(),role:hLe}))});async function JQ(e,t){const n=new URL("profile",e);return await se.request(n,{credentials:se.getRequestCredentials(t),okType:GQ})}function eF(){const e=we();e.userServiceBaseUrl||mt("userServiceBaseUrl");const{authStrategy:t,userServiceBaseUrl:n}=e;return et.useRequest(JQ,[n,t])}function mLe(e){const{label:t,children:n,...r}=e;return d.jsx(kU,{label:t,children:d.jsx(A.Box,{minWidth:0,children:d.jsx(A.Select,{color:"grey",size:"medium",side:"bottom",flexContent:!0,endIcon:"unfoldMore",sx:{width:"100%"},...r,children:n})})})}function tF(e){var l,c,u,f;const t=we();"repository"in t||mt("repository"),"customTypesApiBaseUrl"in t||mt("customTypesApiBaseUrl"),"authStrategy"in t||mt("authStrategy");const{customTypesApiBaseUrl:n,repository:r,authStrategy:i}=t,o=nC({baseUrl:n,repository:r,authStrategy:i}).data.filter(p=>!e.nonRepeatableOnly||!p.repeatable),a=xl();function s(p){a.setRequestOptions(a.type,{...a.options[a.type],type:p})}return o.length===0?d.jsx(Cv,{value:((l=a.options[a.type])==null?void 0:l.type)??"",onValueChange:s,label:"TYPE *",placeholder:"page",error:!((c=a.options[a.type])!=null&&c.type)}):(!((u=a.options[a.type])!=null&&u.type)&&o[0]&&s(o[0].id),d.jsx(mLe,{label:"TYPE *",value:((f=a.options[a.type])==null?void 0:f.type)??"",onValueChange:s,placeholder:"page",children:o.map(({id:p})=>d.jsx(A.SelectItem,{value:p,children:Zn.overflow(p,60)},p))}))}const kL={type:"getByType",Fieldset(){return d.jsxs(d.Fragment,{children:[d.jsx(tF,{}),d.jsx(OU,{})]})},getSnippet(e){const t=[];return e.page&&t.push(` page: ${e.page}`),e.pageSize&&t.push(` pageSize: ${e.pageSize}`),t.length?`client.getByType(${e.type?`"${e.type}"`:"type"}, {
7
+ ${t.join(`,
8
+ `)}
9
+ })`:`client.getByType(${e.type?`"${e.type}"`:"type"})`},run(e,t){return e.getByType(String(t.type),{page:t.page,pageSize:t.pageSize})}},OL={type:"getByUID",Fieldset(){var n,r;const e=xl();function t(i){e.setRequestOptions("getByUID",{...e.options.getByUID,uid:i})}return d.jsxs(d.Fragment,{children:[d.jsx(tF,{}),d.jsx(Cv,{value:((n=e.options.getByUID)==null?void 0:n.uid)??"",onValueChange:t,label:"UID *",placeholder:"homepage",error:!((r=e.options.getByUID)!=null&&r.uid)})]})},getSnippet(e){return`client.getByUID(${e.type?`"${e.type}"`:"type"}, ${e.uid?`"${e.uid}"`:"uid"})`},run(e,t){return e.getByUID(String(t.type),String(t.uid))}},ML={type:"getRepository",getSnippet(){return"client.getRepository()"},run(e){return e.getRepository()}},FL={type:"get",Fieldset(){return d.jsx(OU,{})},getSnippet(e){const t=[];return e.page&&t.push(` page: ${e.page}`),e.pageSize&&t.push(` pageSize: ${e.pageSize}`),t.length?`client.get({
10
+ ${t.join(`,
11
+ `)}
12
+ })`:"client.get()"},run(e,t){return e.get({page:t.page,pageSize:t.pageSize})}},jL={type:"getSingle",Fieldset(){return d.jsx(tF,{nonRepeatableOnly:!0})},getSnippet(e){return`client.getSingle(${e.type?`"${e.type}"`:"type"})`},run(e,t){return e.getSingle(String(t.type))}},Hm={[FL.type]:FL,[kL.type]:kL,[OL.type]:OL,[jL.type]:jL,[ML.type]:ML},gLe=$.object({repository:$.object({id:$.string(),accessToken:$.string()}),type:$.enum(Object.keys(Hm)),options:$.record($.record($.string()).optional()),pagination:$.object({page:$.number().optional(),pageSize:$.number().optional()})}),jS="prismic-api-explorer",ZQ=I.createContext(void 0),vLe=e=>{const{children:t}=e,n=we();let r={repository:{id:"repository"in n?n.repository:"",accessToken:""},type:"get",options:{},pagination:{}};if(Wg.localStorage.has(jS)){const l=Wg.localStorage.readJSON(jS,gLe);l?r=l:console.warn("Could not retrieve API Explorer state from local storage")}const[i,o]=I.useState(r),s={...i,...{setRepositoryID(l){o(c=>({...c,repository:{...c.repository,id:l}}))},setRepositoryAccessToken(l){o(c=>({...c,repository:{...c.repository,accessToken:l}}))},setRequestType(l){o(c=>({...c,type:l}))},setRequestOptions(l,c){o(u=>({...u,options:{...u.options,[l]:c}}))},setPagination(l){o(c=>({...c,pagination:l}))},async run(){var p,h;o(m=>({...m,response:{status:"pending"}})),(p=n.onAnalyticsEvent)==null||p.call(n,"API Explorer Request",{type:s.type,repositoryID:s.repository.id});let l,c;const u=bee(i.repository.id,{accessToken:i.repository.accessToken,fetch(m,g){return l=new URL(m).searchParams.get("ref")??void 0,c=m,fetch(m,g)}}),f=Date.now();try{const m=await Hm[i.type].run(u,{...i.options[i.type],...i.pagination});o(g=>({...g,response:{status:"success",duration:Date.now()-f,ref:l,url:c,data:m}}))}catch(m){const g=m instanceof Error?m:new Error("Unknown error");o(y=>({...y,response:{status:"error",duration:Date.now()-f,url:c,error:g}})),(h=n.onAnalyticsEvent)==null||h.call(n,"API Explorer Request Error",{type:s.type,repositoryID:s.repository.id,url:c,error:g.message})}}}};return I.useEffect(()=>{s.run()},[]),I.useEffect(()=>{const{response:l,...c}=i;Wg.localStorage.write(jS,JSON.stringify(c))},[i]),d.jsx(ZQ.Provider,{value:{request:s},children:t})};function yLe(){const e=I.useContext(ZQ);if(!e)throw new Error("useAPIExplorer must be used within an APIExplorerProvider");return e}function xl(){return yLe().request}const bLe=18,CLe=41,SLe=24;function Uv(e){const t=e.code.split(`
13
+ `).length;return d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(A.Alert,{icon:"alert",title:"Oops! We couldn't load the Code Block",color:"error",noShadow:!0,footerButtons:{action:{onClick:()=>window.location.reload(),text:"Refresh page"}}}),children:d.jsx(I.Suspense,{fallback:d.jsx(A.Skeleton,{height:CLe+SLe+t*bLe,borderRadius:6}),children:d.jsx(A.LazyCodeBlock,{...e})})})}function wLe(){const e=xl();return d.jsx(A.Box,{display:"grid",gridTemplateRows:"minmax(0, 1fr)",minHeight:0,minWidth:0,children:d.jsx(A.Form,{onSubmit:e.run,children:d.jsxs(A.Box,{display:"grid",gridTemplateRows:"auto 1fr",borderRadius:8,border:!0,minHeight:0,minWidth:0,children:[d.jsx(A.Box,{as:"header",padding:{inline:16},alignItems:"center",border:{bottom:!0},minHeight:48,children:d.jsx(A.Text,{variant:"small",component:"h2",color:"grey9",children:"Request"})}),d.jsxs(A.Box,{display:"flex",flexDirection:"column",overflowY:"auto",children:[d.jsx(xLe,{}),d.jsx(_Le,{}),d.jsx(TLe,{}),d.jsx(ELe,{})]})]})})})}function xLe(){const e=xl();return d.jsx(A.Box,{padding:16,border:{bottom:!0},display:"grid",children:d.jsx(A.Select,{color:"grey",size:"large",side:"bottom",flexContent:!0,boldTriggerText:!0,endIcon:"unfoldMore",value:e.type,onValueChange:t=>e.setRequestType(t),children:Object.values(Hm).map(({type:t})=>d.jsx(A.SelectItem,{value:t,children:t},t))})})}function _Le(){const e=xl(),t=Hm[e.type].Fieldset;return t?d.jsxs(A.Box,{display:"flex",flexDirection:"column",padding:16,border:{bottom:!0},gap:8,children:[d.jsx(A.Text,{variant:"emphasized",component:"h3",color:"grey11",children:"Params"}),d.jsx(t,{})]}):null}function TLe(){return d.jsx(A.Box,{padding:16,border:{bottom:!0},display:"grid",children:d.jsx(A.Button,{type:"submit",color:"purple",size:"large",endIcon:"arrowForward",children:"Send"})})}const ILe="https://prismic.io/docs/technical-reference/prismicio-client";function ELe(){const e=xl(),[t,n]=I.useState("");return I.useEffect(()=>{const r=e.repository.accessToken?`const client = createClient("${e.repository.id}", {
14
+ accessToken: process.env.PRISMIC_ACCESS_TOKEN,
15
+ })`:`const client = createClient("${e.repository.id}")`,i=Hm[e.type].getSnippet({...e.options[e.type],...e.pagination});n(`${r}
16
+
17
+ const response = await ${i}`)},[e.repository,e.type,e.options,e.pagination]),d.jsxs(A.Box,{display:"flex",flexDirection:"column",padding:16,gap:8,children:[d.jsx(A.Text,{variant:"emphasized",component:"h3",color:"grey11",children:"Client code"}),d.jsx(Uv,{title:"request.ts",language:"typescript",code:t,showLineNumbers:!1}),d.jsxs(A.Text,{children:["Learn more on"," ",d.jsx(A.Text,{component:"a",href:ILe,target:"blank",underline:!0,children:"@prismicio/client documentation"}),"."]})]})}const zl=(e,t,n,r,i)=>{if(!r)throw new Error(i??`Invalid property path: ${t}
18
+ Couldn't access "${n}" in ${JSON.stringify(e)}`)},LL=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ng=e=>Array.isArray(e),XQ=(e,t)=>e.filter((n,r)=>r!==t),RLe=(e,t,n,r={})=>{const{remove:i=!1,createNew:o=!0,noError:a=!1}=r,s=e,l=typeof(c=t)=="string"?c:typeof c=="number"?String(c):c.reduce((p,h)=>typeof h=="number"?`${p}[${h}]`:p===""?h:`${p}.${h}`,"");var c;const u=Object.assign(Object.assign({},r),{remove:i,createNew:o,noError:a,fullData:s,fullPath:l}),f=Array.isArray(t)?t:(p=>Array.isArray(p)?p:p.split(/(\.|\[\d+\])/).filter(h=>h!=="."&&h!=="").map(h=>{const m=/\[(\d+)\]/.exec(h);return m?Number(m[1]):h}).flat())(t).filter(p=>p!=="");return Ng(e)&&i&&f.length===1?XQ(e,f[0]):$p(e,f,n,u)},$p=(e,t,n,r)=>{const i=LL(e)?Object.assign({},e):null,o=Ng(e)?[...e]:null;if(t.length===0)return e;if(!i&&!o)throw new Error("Can't assign property -- invalid input object");const{createNew:a,remove:s,noError:l,fullData:c,fullPath:u}=r,f=t[0];if(o&&typeof f=="string")return o.map(g=>$p(g,t,n,r));if(t.length===1){if(i&&typeof f=="string"){const g=$Le(i,f,n,r);return g??i}return o&&typeof f=="number"?(kLe(o,f,n,r),o):(zl(c,u,f,l),e)}const p=i||o||[];if(s&&t.length===2&&typeof t[1]=="number"){const g=p[f],y=t[1];return Ng(g)?p[f]=XQ(g,y):zl(c,u,f,l,"Trying to remove an indexed item from an object that is not an array"),p}const h=t.slice(1);if(f in e){if(m=p[f],!Ng(m)&&!LL(m)){if(!a)return zl(c,u,f,l),p;p[f]={}}return p[f]=$p(p[f],h,n,r),p}var m;if(a){const g=typeof h[0]=="number"?[]:{};if(i)return p[f]=g,p[f]=$p(p[f],h,n,r),p;if(o&&Array.isArray(p)){p.push(g);const y=p.length-1;return p[y]=$p(p[y],h,n,r),p}}return zl(c,u,f,l),p},$Le=(e,t,n,r)=>{const{remove:i,createNew:o,noError:a,insertAfter:s,insertBefore:l,fullData:c,fullPath:u}=r;if(l!==void 0||s!==void 0){const p=Object.entries(e);let h=1/0;return h=typeof l=="number"?l:typeof s=="number"?s:p.findIndex(([m,g])=>m===(l??s)),s&&h++,p.splice(h,0,[t,n]),Object.fromEntries(p)}const f=t in e;i?f?delete e[t]:zl(c,u,t,a):o||f?e[t]=n:zl(c,u,t,a)},kLe=(e,t,n,r)=>{const{noError:i,fullData:o,fullPath:a,createNew:s,insert:l}=r;l&&e.splice(t,0,n),t in e?e[t]=n:s?e.push(n):zl(o,a,t,i)},jh=(e,t,n)=>{const r=Array.isArray(t)?t:OLe(t);if(r.length===0)return e;const i=r[0];if(Array.isArray(e)&&typeof i!="number")return e.map(a=>jh(a,r,n));if(typeof e!="object"||e===null||!(i in e))return MLe(e,i,n);const o=e[i];return r.length===1?o:jh(o,r.slice(1),n)},OLe=e=>e.split(/(\.|\[\d+\])/).filter(t=>t!=="."&&t!=="").map(t=>{const n=/\[(\d+)\]/.exec(t);return n?Number(n[1]):t}).flat(),MLe=(e,t,n)=>{if(n===void 0)throw new Error(`Unable to extract object property
19
+ Looking for property: ${t}
20
+ In object: ${JSON.stringify(e)}`);return n};function zu(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(c){try{l(r.next(c))}catch(u){o(u)}}function s(c){try{l(r.throw(c))}catch(u){o(u)}}function l(c){var u;c.done?i(c.value):(u=c.value,u instanceof n?u:new n(function(f){f(u)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}const eH=({className:e,name:t,value:n,setValue:r,handleKeyPress:i,styles:o,textAreaRef:a})=>{if(typeof n!="string")return null;const s=n.slice(-1)===`
21
+ `?n+".":n;return d.jsxs("div",{style:{display:"grid"},children:[d.jsx("textarea",{id:`${t}_textarea`,ref:a,style:Object.assign({height:"auto",gridArea:"1 / 1 / 2 / 2",overflowY:"auto",whiteSpace:"pre-wrap"},o),rows:1,className:e,name:`${t}_textarea`,value:n,onChange:l=>r(l.target.value),autoFocus:!0,onFocus:l=>{n.length<40&&l.target.select()},onKeyDown:i}),d.jsx("span",{className:e,style:Object.assign({visibility:"hidden",height:"auto",gridArea:"1 / 1 / 2 / 2",color:"red",opacity:.9,whiteSpace:"pre-wrap",overflowY:"auto",border:"1px solid transparent"},o),children:s})]})},Ed=e=>e!==null&&typeof e=="object",tH=(e,t,n,r="")=>{if(!n&&!r)return!0;switch(e){case"collection":if(n){if(n(t,r))return!0;if(!ix(r,t,n))return!1}if(!n&&r&&!ix(r,t))return!1;break;case"value":if(n&&!n(t,r)||!n&&r&&!Rd(t,r))return!1}return!0},ix=(e="",t,n=Rd)=>{const r=t.value;return Object.entries(r).some(([i,o])=>{const a=[...t.path,i],s=Object.assign(Object.assign({},t),{key:i,path:a,level:t.level+1,value:o,size:a.length,parentData:r});return Ed(o)?ix(e,s,n):n(s,e)})},Rd=(e,t="")=>{const{value:n}=e;if(n===null&&"null".includes(t.toLowerCase()))return!0;switch(typeof n){case"string":return n.toLowerCase().includes(t.toLowerCase());case"number":return!!String(n).includes(t);case"boolean":return n?"true".includes(t.toLowerCase())||t==="1":"false".includes(t.toLowerCase())||t==="0";default:return!1}},DL=({key:e,path:t},n="")=>!!Rd({value:e},n)||!!t.some(r=>Rd({value:r},n)),FLe=(e,t=200)=>typeof e=="string"?e.length<t?e:`${e.slice(0,t-2).trim()}...`:e,pp=(e,t)=>(t??"")+e.map(n=>n===""?String.fromCharCode(0):n).join("."),nF=e=>e.shiftKey?"Shift":e.metaKey?"Meta":e.ctrlKey?"Control":e.altKey?"Alt":void 0,jLe=(e,t,n)=>{const r=e.key,i=nF(e);if(Array.isArray(t))return!!i&&t.includes(i);const{key:o,modifier:a}=t;return(n!=="stringLineBreak"||r!=="Enter"||i!=="Shift"||o!=="Enter"||!(a!=null&&a.includes("Shift")))&&r===o&&(a===i||Array.isArray(a)&&a.includes(i))},Ll={key:"Enter"},UL={confirm:Ll,cancel:{key:"Escape"},objectConfirm:Object.assign(Object.assign({},Ll),{modifier:["Meta","Shift","Control"]}),objectLineBreak:Ll,stringConfirm:Ll,stringLineBreak:Object.assign(Object.assign({},Ll),{modifier:["Shift"]}),numberConfirm:Ll,numberUp:{key:"ArrowUp"},numberDown:{key:"ArrowDown"},tabForward:{key:"Tab"},tabBack:{key:"Tab",modifier:"Shift"},booleanConfirm:Ll,booleanToggle:{key:" "},clipboardModifier:["Meta","Control"],collapseModifier:["Alt"]},Ts=(e,t,n="next",r)=>{const i=t.slice(0,t.length-1),o=t.slice(-1)[0];if(o===void 0)return null;const a=jh(e,i),s=LLe(a);Array.isArray(a)||r(s,({key:u,value:f})=>[u,f]);const l=s.findIndex(u=>u.key===o),c=s[l+(n==="next"?1:-1)];return c?Ed(c.value)?Object.keys(c.value).length===0?Ts(e,[...i,c.key],n,r):nH(e,[...i,c.key],n,r):[...i,c.key]:i.length===0?null:Ts(e,i,n,r)},nH=(e,t,n="next",r)=>{const i=jh(e,t);if(!Ed(i))return t;const o=Array.isArray(i)?i.map((s,l)=>l):Object.keys(i);r(o,s=>[s,i]);const a=n==="next"?o[0]:o[o.length-1];return nH(e,[...t,a],n,r)},LLe=e=>Array.isArray(e)?e.map((t,n)=>({index:n,value:t,key:n})):Object.entries(e).map(([t,n],r)=>({key:t,value:n,index:r})),rH=(e,t)=>{var n,r,i,o;const a=e.current,s=(n=a==null?void 0:a.selectionStart)!==null&&n!==void 0?n:1/0,l=(r=a==null?void 0:a.selectionEnd)!==null&&r!==void 0?r:1/0,c=((i=a==null?void 0:a.textContent)===null||i===void 0?void 0:i.slice(0,s))+t+((o=a==null?void 0:a.textContent)===null||o===void 0?void 0:o.slice(l));return a.value=c,a==null||a.setSelectionRange(s+1,s+1),c},rF={displayName:"Default",fragments:{edit:"rgb(42, 161, 152)"},styles:{container:{backgroundColor:"#f6f6f6",fontFamily:"monospace"},collection:{},collectionInner:{},collectionElement:{},dropZone:{},property:"#292929",bracket:{color:"rgb(0, 43, 54)",fontWeight:"bold"},itemCount:{color:"rgba(0, 0, 0, 0.3)",fontStyle:"italic"},string:"rgb(203, 75, 22)",number:"rgb(38, 139, 210)",boolean:"green",null:{color:"rgb(220, 50, 47)",fontVariant:"small-caps",fontWeight:"bold"},input:["#292929"],inputHighlight:"#b3d8ff",error:{fontSize:"0.8em",color:"red",fontWeight:"bold"},iconCollection:"rgb(0, 43, 54)",iconEdit:"edit",iconDelete:"rgb(203, 75, 22)",iconAdd:"edit",iconCopy:"rgb(38, 139, 210)",iconOk:"green",iconCancel:"rgb(203, 75, 22)"}},iH=I.createContext({getStyles:()=>({}),icons:{}}),DLe=({theme:e=rF,icons:t={},docRoot:n,children:r})=>{const i=ULe(e,n);return d.jsx(iH.Provider,{value:{getStyles:(o,a)=>typeof i[o]=="function"?i[o](a):i[o],icons:t},children:r})},oa=()=>I.useContext(iH),ULe=(e,t)=>{var n,r,i,o;const a={},s=(Array.isArray(e)?e:[e]).map(u=>BLe(u)?LS({fragments:{},styles:u},a):LS(u,a)),l=LS(rF,{});Object.keys(l).forEach(u=>{const f=u;s.forEach(p=>{p[f]&&(l[f]=Object.assign(Object.assign({},l[f]),p[f]))})});const c=Object.assign({},l);return Object.entries(a).forEach(([u,f])=>{const p=u;c[p]=h=>{const m=f(h)||{};return Object.assign(Object.assign({},l[p]),m)}}),typeof(c==null?void 0:c.inputHighlight)!="function"&&(!((n=c==null?void 0:c.inputHighlight)===null||n===void 0)&&n.backgroundColor)&&t.style.setProperty("--jer-highlight-color",(r=c==null?void 0:c.inputHighlight)===null||r===void 0?void 0:r.backgroundColor),typeof(c==null?void 0:c.iconCopy)!="function"&&(!((i=c==null?void 0:c.iconCopy)===null||i===void 0)&&i.color)&&t.style.setProperty("--jer-icon-copy-color",(o=c==null?void 0:c.iconCopy)===null||o===void 0?void 0:o.color),c},LS=(e,t)=>{const{fragments:n,styles:r}=e,i={};return Object.entries(r).forEach(([o,a])=>{const s=(Array.isArray(a)?a:[a]).reduce((l,c)=>{var u,f;if(typeof c=="function")return t[o]=c,Object.assign({},l);if(typeof c=="string"){const p=(u=n==null?void 0:n[c])!==null&&u!==void 0?u:c;return typeof p=="string"?Object.assign(Object.assign({},l),{[(f=PLe[o])!==null&&f!==void 0?f:"color"]:p}):Object.assign(Object.assign({},l),p)}return Object.assign(Object.assign({},l),c)},{});i[o]=s}),i},BLe=e=>!("styles"in e),PLe={container:"backgroundColor",collection:"backgroundColor",collectionInner:"backgroundColor",collectionElement:"backgroundColor",dropZone:"borderColor",inputHighlight:"backgroundColor"},oH=I.createContext({collapseState:null,setCollapseState:()=>{},doesPathMatch:()=>!1,currentlyEditingElement:null,setCurrentlyEditingElement:()=>{},previouslyEditedElement:null,setPreviouslyEditedElement:()=>{},areChildrenBeingEdited:()=>!1,dragSource:{path:null,pathString:null},setDragSource:()=>{},tabDirection:"next",setTabDirection:()=>{}}),WLe=({children:e})=>{const[t,n]=I.useState(null),[r,i]=I.useState(null),[o,a]=I.useState({path:null,pathString:null}),s=I.useRef(null),l=I.useRef("next"),c=I.useRef(null);return d.jsx(oH.Provider,{value:{collapseState:t,setCollapseState:u=>{n(u),u!==null&&setTimeout(()=>n(null),2e3)},doesPathMatch:u=>{if(t===null)return!1;for(const[f,p]of t.path.entries())if(p!==u[f])return!1;return!0},currentlyEditingElement:r,setCurrentlyEditingElement:(u,f)=>{const p=typeof u=="string"||u===null?u:pp(u,f==="key"?"key_":void 0);r!==null&&p!==null&&s.current!==null&&s.current(),i(p),s.current=typeof f=="function"?f:null},areChildrenBeingEdited:u=>r!==null&&r.includes(u),previouslyEditedElement:c.current,setPreviouslyEditedElement:u=>{c.current=u},tabDirection:l.current,setTabDirection:u=>{l.current=u},dragSource:o,setDragSource:a},children:e})},Ym=()=>I.useContext(oH),ox="**INVALID_FUNCTION**",NLe=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:o,stringTruncate:a,showStringQuotes:s,nodeData:l,handleKeyboard:c,keyboardCommon:u})=>{const{getStyles:f}=oa(),p=I.useRef(null),h=pp(r),m=s?'"':"";return n?d.jsx(eH,{className:"jer-input-text",textAreaRef:p,name:h,value:e,setValue:t,isEditing:n,handleKeyPress:g=>{c(g,Object.assign({stringConfirm:o,stringLineBreak:()=>{const y=rH(p,`
22
+ `);t(y)}},u))},styles:f("input",l)}):d.jsxs("div",{id:`${h}_display`,onDoubleClick:()=>i(!0),onClick:g=>{(g.getModifierState("Control")||g.getModifierState("Meta"))&&i(!0)},className:"jer-value-string",style:f("string",l),children:[m,FLe(e,a),m]})},KLe=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:o,nodeData:a,handleKeyboard:s,keyboardCommon:l})=>{const{getStyles:c}=oa();return n?d.jsx("input",{className:"jer-input-number",type:"text",name:pp(r),value:e,onChange:u=>t(u.target.value.replace(/[^0-9.-]/g,"")),autoFocus:!0,onFocus:u=>u.target.select(),onKeyDown:u=>s(u,Object.assign({numberConfirm:o,numberUp:()=>t(Number(e)+1),numberDown:()=>t(Number(e)-1)},l)),style:Object.assign({width:String(e).length/1.5+2+"em"},c("input",a))}):d.jsx("span",{onDoubleClick:()=>i(!0),className:"jer-value-number",style:c("number",a),children:e})},qLe=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:o,nodeData:a,handleKeyboard:s,keyboardCommon:l})=>{const{getStyles:c}=oa();return n?d.jsx("input",{className:"jer-input-boolean",type:"checkbox",name:pp(r),checked:e,onChange:()=>t(!e),onKeyDown:u=>{u.key===" "&&u.preventDefault(),s(u,Object.assign({booleanConfirm:o,booleanToggle:()=>t(!e)},l))},autoFocus:!0}):d.jsx("span",{onDoubleClick:()=>i(!0),className:"jer-value-boolean",style:c("boolean",a),children:String(e)})},VLe=({value:e,isEditing:t,setIsEditing:n,handleEdit:r,nodeData:i,handleKeyboard:o,keyboardCommon:a})=>{const{getStyles:s}=oa(),l=I.useRef();I.useEffect(()=>{if(t)return l.current=window.setTimeout(()=>window.addEventListener("keydown",c),100),()=>window.removeEventListener("keydown",c);window.clearTimeout(l.current)},[t]);const c=u=>o(u,Object.assign({confirm:r},a));return d.jsx("div",{onDoubleClick:()=>n(!0),className:"jer-value-null",style:s("null",i),children:String(e)})},zLe=({value:e})=>{let t="Error!";switch(typeof e){case"string":e===ox&&(t="Function");break;case"undefined":t="Undefined";break;case"symbol":t="Symbol"}return d.jsx("span",{className:"jer-value-invalid",children:t})},QLe=({size:e,style:t,className:n})=>d.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,children:[d.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}),d.jsx("path",{d:"M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8z"})]}),HLe=({size:e,style:t,className:n})=>d.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,transform:"translate(0, 0.5)",children:[d.jsx("path",{d:"M7 17.013l4.413-.015 9.632-9.54c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.756-.756-2.075-.752-2.825-.003L7 12.583v4.43zM18.045 4.458l1.589 1.583-1.597 1.582-1.586-1.585 1.594-1.58zM9 13.417l6.03-5.973 1.586 1.586-6.029 5.971L9 15.006v-1.589z"}),d.jsx("path",{d:"M5 21h14c1.103 0 2-.897 2-2v-8.668l-2 2V19H8.158c-.026 0-.053.01-.079.01-.033 0-.066-.009-.1-.01H5V5h6.847l2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2z"})]}),YLe=({size:e,style:t,className:n})=>d.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,children:d.jsx("path",{d:"M6 19a2 2 0 002 2h8a2 2 0 002-2V7H6v12m2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12M15.5 4l-1-1h-5l-1 1H5v2h14V4h-3.5z"})}),GLe=({size:e,style:t,className:n})=>d.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:e,height:e,className:n,style:t,children:[d.jsx("path",{d:"M9 2 H15 A1 1 0 0 1 16 3 V5 A1 1 0 0 1 15 6 H9 A1 1 0 0 1 8 5 V3 A1 1 0 0 1 9 2 z"}),d.jsx("path",{d:"M8 4H6a2 2 0 00-2 2v14a2 2 0 002 2h12a2 2 0 002-2v-2M16 4h2a2 2 0 012 2v4M21 14H11"}),d.jsx("path",{d:"M15 10l-4 4 4 4"})]}),JLe=({size:e,style:t,className:n})=>d.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:e,height:e,className:n,style:t,children:[d.jsx("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),d.jsx("path",{d:"M22 4L12 14.01l-3-3"})]}),ZLe=({size:e,style:t,className:n})=>d.jsx("svg",{baseProfile:"tiny",viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,children:d.jsx("path",{d:"M12 4c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8zm-5 8c0-.832.224-1.604.584-2.295l6.711 6.711A4.943 4.943 0 0112 17c-2.757 0-5-2.243-5-5zm9.416 2.295L9.705 7.584A4.943 4.943 0 0112 7c2.757 0 5 2.243 5 5 0 .832-.224 1.604-.584 2.295z"})}),XLe=({size:e,style:t,className:n})=>d.jsx("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:e,height:e,className:n,style:t,children:d.jsx("path",{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})}),Ql=({name:e,nodeData:t,rotate:n})=>{var r,i,o,a,s,l,c;const{getStyles:u,icons:f}=oa(),p={size:"1.4em",className:"jer-icon"};switch(e){case"add":return(r=f==null?void 0:f.add)!==null&&r!==void 0?r:d.jsx(QLe,Object.assign({},p,{style:u("iconAdd",t)}));case"edit":return(i=f==null?void 0:f.edit)!==null&&i!==void 0?i:d.jsx(HLe,Object.assign({},p,{style:u("iconEdit",t)}));case"delete":return(o=f==null?void 0:f.delete)!==null&&o!==void 0?o:d.jsx(YLe,Object.assign({},p,{style:u("iconDelete",t),size:"1.45em"}));case"copy":return(a=f==null?void 0:f.copy)!==null&&a!==void 0?a:d.jsx(GLe,Object.assign({},p,{style:u("iconCopy",t),size:"1.2em"}));case"ok":return(s=f==null?void 0:f.ok)!==null&&s!==void 0?s:d.jsx(JLe,Object.assign({},p,{style:Object.assign({fontSize:"90%"},u("iconOk",t))}));case"cancel":return(l=f==null?void 0:f.cancel)!==null&&l!==void 0?l:d.jsx(ZLe,Object.assign({},p,{style:Object.assign({fontSize:"130%"},u("iconCancel",t))}));case"chevron":return(c=f==null?void 0:f.chevron)!==null&&c!==void 0?c:d.jsx(XLe,{size:"1em",style:u("iconCollection",t)});default:return d.jsx(d.Fragment,{})}},aH=({startEdit:e,handleDelete:t,handleAdd:n,enableClipboard:r,type:i,customButtons:o,nodeData:a,translate:s,keyboardControls:l,handleKeyboard:c})=>{const{getStyles:u}=oa(),f=s("KEY_NEW",a),[p,h]=I.useState(!1),[m,g]=I.useState(f),{key:y,path:C,value:x}=a;return d.jsxs("div",{className:"jer-edit-buttons",style:{opacity:p?1:void 0},children:[r&&d.jsx("div",{onClick:b=>{var v;b.stopPropagation();let S,w,T="value",E="",R=null;if(r){const O=nF(b);if(O&&l.clipboardModifier.includes(O)?(S=e2e(C),E=S,T="path"):(S=x,E=i?JSON.stringify(x,null,2):String(S)),!navigator.clipboard)return void(typeof r=="function"&&r({success:!1,value:S,stringValue:E,path:C,key:y,type:T,errorMessage:"Can't access clipboard API"}));(v=navigator.clipboard)===null||v===void 0||v.writeText(E).then(()=>w=!0).catch(k=>{w=!1,R=k.message}).finally(()=>{typeof r=="function"&&r({success:w,errorMessage:R,value:S,stringValue:E,path:C,key:y,type:T})})}},className:"jer-copy-pulse",children:d.jsx(Ql,{name:"copy",nodeData:a})}),e&&d.jsx("div",{onClick:b=>{b.stopPropagation(),e()},children:d.jsx(Ql,{name:"edit",nodeData:a})}),t&&d.jsx("div",{onClick:b=>{b.stopPropagation(),t()},children:d.jsx(Ql,{name:"delete",nodeData:a})}),n&&d.jsx("div",{onClick:b=>{b.stopPropagation(),i==="object"?h(!0):n("")},children:d.jsx(Ql,{name:"add",nodeData:a})}),o==null?void 0:o.map(({Element:b,onClick:v},S)=>d.jsx("div",{onClick:w=>v&&v(a,w),children:d.jsx(b,{nodeData:a})},S)),p&&n&&i==="object"&&d.jsxs(d.Fragment,{children:[d.jsx("input",{className:"jer-input-new-key",type:"text",name:"new-object-key",value:m,onChange:b=>g(b.target.value),autoFocus:!0,onFocus:b=>b.target.select(),onKeyDown:b=>{c(b,{stringConfirm:()=>{n&&(h(!1),n(m),g(f))},cancel:()=>{h(!1),g(f)}})},style:u("input",a)}),d.jsx(iF,{onOk:b=>{m&&(b.stopPropagation(),h(!1),n(m))},onCancel:b=>{b.stopPropagation(),h(!1)},nodeData:a})]})]})},iF=({onOk:e,onCancel:t,nodeData:n})=>d.jsxs("div",{className:"jer-confirm-buttons",children:[d.jsx("div",{onClick:e,children:d.jsx(Ql,{name:"ok",nodeData:n})}),d.jsx("div",{onClick:t,children:d.jsx(Ql,{name:"cancel",nodeData:n})})]}),e2e=e=>e.reduce((t,n)=>typeof n=="number"?`${t}[${n}]`:t===""?n:`${t}.${n}`,""),t2e=["string","number","boolean","null","object","array"],sH=(e=[],t)=>{const n=e.filter(({condition:m})=>m(t));if(n.length===0)return{};const r=n[0],{element:i,wrapperElement:o,customNodeProps:a,wrapperProps:s,hideKey:l=!1,showEditTools:c=!0,showOnEdit:u=!1,showOnView:f=!0,showCollectionWrapper:p=!0}=r,h=function(m,g){var y={};for(var C in m)Object.prototype.hasOwnProperty.call(m,C)&&g.indexOf(C)<0&&(y[C]=m[C]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function"){var x=0;for(C=Object.getOwnPropertySymbols(m);x<C.length;x++)g.indexOf(C[x])<0&&Object.prototype.propertyIsEnumerable.call(m,C[x])&&(y[C[x]]=m[C[x]])}return y}(r,["element","wrapperElement","customNodeProps","wrapperProps","hideKey","showEditTools","showOnEdit","showOnView","showCollectionWrapper"]);return Object.assign({CustomNode:i,CustomWrapper:o,customNodeProps:a,wrapperProps:s,hideKey:l,showEditTools:c,showOnEdit:u,showOnView:f,showCollectionWrapper:p},h)},lH=({props:e,collapsed:t})=>{const{data:n,nodeData:r,parentData:i,onEdit:o,onError:a,showErrorMessages:s,restrictEditFilter:l,restrictDeleteFilter:c,restrictAddFilter:u,restrictDragFilter:f,translate:p,errorMessageTimeout:h}=e,{currentlyEditingElement:m,setCurrentlyEditingElement:g}=Ym(),[y,C]=I.useState(null),x=Object.assign(Object.assign({},r),{collapsed:t}),{path:b,key:v,size:S}=x,w=pp(b),T=I.useMemo(()=>!l(x),[x]),E=I.useMemo(()=>!c(x),[x]),R=I.useMemo(()=>!u(x),[x]),O=I.useMemo(()=>!f(x)&&E&&m===null,[x]),k=N=>{s&&(C(N),setTimeout(()=>C(null),h)),console.warn("Error",N)},B=I.useMemo(()=>(N,Y)=>{k(N.message),a&&a({currentData:x.fullData,errorValue:Y,currentValue:n,name:v,path:b,error:N})},[a,s]),K=m===w,H=m===`key_${w}`,z=typeof b.slice(-1)[0]=="number";return{pathString:w,nodeData:x,path:b,name:v,size:S,canEdit:T,canDelete:E,canAdd:R,canDrag:O,error:y,showError:k,onError:B,setError:C,handleEditKey:N=>{if(g(null),v===N||!i)return;const Y=b.slice(0,-1);if(Object.keys(i).includes(N))return void B({code:"KEY_EXISTS",message:p("ERROR_KEY_EXISTS",x)},N);const ee=Object.fromEntries(Object.entries(i).map(([F,M])=>F===v?[N,M]:[F,M]));o(ee,Y).then(F=>{F&&B({code:"UPDATE_ERROR",message:F},N)})},derivedValues:{isEditing:K,isEditingKey:H,isArray:z,canEditKey:i!==null&&T&&R&&E&&!z}}},cH=({canDrag:e,canDragOnto:t,path:n,nodeData:r,onMove:i,onError:o,translate:a})=>{const{getStyles:s}=oa(),{dragSource:l,setDragSource:c}=Ym(),[u,f]=I.useState(!1),p=pp(n),h=I.useMemo(()=>e?{onDragStart:C=>{C.stopPropagation(),c({path:n,pathString:p})},onDragEnd:C=>{C.stopPropagation(),c({path:null,pathString:null})}}:{},[e]),m=I.useMemo(()=>C=>t?{onDragOver:x=>{x.stopPropagation(),x.preventDefault()},onDrop:x=>{x.stopPropagation(),y(C),c({path:null,pathString:null}),f(!1)},onDragEnter:x=>{var b;x.stopPropagation(),p.startsWith((b=l.pathString)!==null&&b!==void 0?b:"")||f(C)},onDragExit:x=>{x.stopPropagation(),f(!1)}}:{},[l,t]),g=I.useMemo(()=>t&&l.pathString!==null?d.jsx("div",Object.assign({className:"jer-drop-target-bottom",style:{height:"50%",position:"absolute",width:"100%",top:"50%",zIndex:n.length}},m("below"))):null,[l,t]),y=C=>{var x,b;const v=(x=l.path)===null||x===void 0?void 0:x.slice(-1)[0],S=(b=l.path)===null||b===void 0?void 0:b.slice(0,-1).join("."),w=n.slice(0,-1).join(""),{parentData:T}=r;typeof v=="string"&&T&&!Array.isArray(T)&&Object.keys(T).includes(v)&&v in T&&S!==w?o({code:"KEY_EXISTS",message:a("ERROR_KEY_EXISTS",r)},v):i(l.path,n,C).then(E=>{E&&o({code:"UPDATE_ERROR",message:E},r.value)})};return{dragSourceProps:h,getDropTargetProps:m,BottomDropTarget:g,DropTargetPadding:({position:C,nodeData:x})=>u===C?d.jsx("div",{className:"jer-drag-n-drop-padding",style:s("dropZone",x)}):null,handleDrop:y}},n2e=(e,t,n)=>{var r,i,o;const a=parseInt((r=getComputedStyle(n.current).getPropertyValue("line-height"))!==null&&r!==void 0?r:"16px"),s=((o=(i=t.current)===null||i===void 0?void 0:i.offsetWidth)!==null&&o!==void 0?o:0)/(.5*a),l=JSON.stringify(e,null,2).replace(/\\n/g,`
23
+ `).split(`
24
+ `).map(c=>Math.ceil(c.length/s)).reduce((c,u)=>c+u,0)*a;return Math.min(l+30,window.innerHeight-50)},uH=e=>{const{data:t,parentData:n,onEdit:r,onDelete:i,onChange:o,onMove:a,enableClipboard:s,canDragOnto:l,restrictTypeSelection:c,searchFilter:u,searchText:f,showLabel:p,stringTruncate:h,showStringQuotes:m,indent:g,translate:y,customNodeDefinitions:C,handleKeyboard:x,keyboardControls:b,sort:v}=e,{getStyles:S}=oa(),{setCurrentlyEditingElement:w,setCollapseState:T,previouslyEditedElement:E,setPreviouslyEditedElement:R,tabDirection:O,setTabDirection:k}=Ym(),[B,K]=I.useState(typeof t=="function"?ox:t),{pathString:H,nodeData:z,path:N,name:Y,canEdit:ee,canDelete:F,canDrag:M,error:W,onError:re,handleEditKey:Ie,derivedValues:Ce}=lH({props:e}),{dragSourceProps:P,getDropTargetProps:ae,BottomDropTarget:Ge,DropTargetPadding:ve}=cH({canDrag:M,canDragOnto:l,path:N,nodeData:z,onMove:a,onError:re,translate:y}),De=sH(C,z),[gt,on]=I.useState(Cg(t,De)),Yt=I.useCallback(j=>{if(!o)return void K(j);const te=o({currentData:z.fullData,newValue:j,currentValue:B,name:Y,path:N});K(te)},[o]);I.useEffect(()=>{K(typeof t=="function"?ox:t),on(Cg(t,De))},[t,W]);const{CustomNode:xe,customNodeProps:Ze,hideKey:ht,showEditTools:tt=!0,showOnEdit:ct,showOnView:Gt}=De,wn=[...t2e,...C.filter(({showInTypesSelector:j=!1,name:te})=>j&&!!te).map(({name:j})=>j)],Jt=I.useMemo(()=>{if(typeof c=="boolean")return c?[]:wn;if(Array.isArray(c))return c;const j=c(z);return typeof j=="boolean"?j?[]:wn:j},[z,c]),{isEditing:Rt}=Ce,Tr=tH("value",z,u,f);if(Rt&&(!Tr||!ee)){const j=Ts(z.fullData,N,O,v);w(j||E)}if(!Tr)return null;const Pt=()=>{let j;switch(w(null),gt){case"object":j={[y("DEFAULT_NEW_KEY",z)]:B};break;case"array":j=B??[];break;case"number":{const te=Number(B);j=isNaN(te)?0:te;break}default:j=B}r(j,N).then(te=>{te&&re({code:"UPDATE_ERROR",message:te},j)})},Zt=()=>{w(null),K(t),on(Cg(t,De))},{isEditingKey:an,canEditKey:Ir}=Ce,Er=!Rt&&W,Me=Rt&&Jt.length>0,$e=gt!=="invalid"&&!W&&tt,D=p&&an,L=p&&!an&&!ht,U={value:B,parentData:n,setValue:Yt,isEditing:Rt,setIsEditing:ee?()=>w(N):()=>{},handleEdit:Pt,handleCancel:Zt,path:N,stringTruncate:h,showStringQuotes:m,nodeData:z,translate:y,handleKeyboard:x,keyboardCommon:{cancel:Zt,tabForward:()=>{k("next"),R(H);const j=Ts(z.fullData,N,"next",v);j&&(Pt(),w(j))},tabBack:()=>{k("prev"),R(H);const j=Ts(z.fullData,N,"prev",v);j&&(Pt(),w(j))}}},ue=xe&&(Rt&&ct||!Rt&&Gt)?d.jsx(xe,Object.assign({},e,{value:B,customNodeProps:Ze,setValue:Yt,handleEdit:Pt,handleCancel:Zt,handleKeyPress:j=>x(j,{stringConfirm:Pt,cancel:Zt}),isEditing:Rt,setIsEditing:()=>w(N),getStyles:S})):r2e(Cg(t),U);return d.jsxs("div",Object.assign({className:"jer-component jer-value-component",style:{marginLeft:g/2+"em",position:"relative"},draggable:M},P,ae("above"),{children:[Ge,d.jsx(ve,{position:"above",nodeData:z}),d.jsxs("div",{className:"jer-value-main-row",style:{flexWrap:Y.length>10?"wrap":"nowrap"},children:[L&&d.jsx("span",{className:"jer-key-text",style:Object.assign(Object.assign({},S("property",z)),{minWidth:`${Math.min(String(Y).length+1,5)}ch`,flexShrink:Y.length>10?1:0}),onDoubleClick:()=>Ir&&w(N,"key"),children:Y===""?d.jsx("span",{className:N.length>0?"jer-empty-string":void 0}):`${Y}:`}),D&&d.jsx("input",{className:"jer-input-text jer-key-edit",type:"text",name:H,defaultValue:Y,autoFocus:!0,onFocus:j=>j.target.select(),onKeyDown:j=>x(j,{stringConfirm:()=>Ie(j.target.value),cancel:Zt,tabForward:()=>{Ie(j.target.value),w(N)},tabBack:()=>{Ie(j.target.value),w(Ts(z.fullData,N,"prev",v))}}),style:{width:String(Y).length/1.5+.5+"em"}}),d.jsxs("div",{className:"jer-value-and-buttons",children:[d.jsx("div",{className:"jer-input-component",children:ue}),Rt?d.jsx(iF,{onOk:Pt,onCancel:Zt,nodeData:z}):$e&&d.jsx(aH,{startEdit:ee?()=>w(N,Zt):void 0,handleDelete:F?()=>{i(B,N).then(j=>{j&&re({code:"DELETE_ERROR",message:j},B)})}:void 0,enableClipboard:s,translate:y,customButtons:e.customButtons,nodeData:z,handleKeyboard:x,keyboardControls:b}),Me&&d.jsxs("div",{className:"jer-select",children:[d.jsx("select",{name:`${Y}-type-select`,className:"jer-type-select",onChange:j=>(te=>{const pe=C.find(le=>le.name===te);if(pe)r(pe.defaultValue,N),on(te),w(null),T({path:N,collapsed:!1});else{const le=i2e(B,te,y("DEFAULT_NEW_KEY",z),De!=null&&De.CustomNode?y("DEFAULT_STRING",z):void 0);Yt(le),r(le,N).then(be=>{be&&(re({code:"UPDATE_ERROR",message:be},le),w(null))})}})(j.target.value),value:gt,children:Jt.map(j=>d.jsx("option",{value:j,children:j},j))}),d.jsx("span",{className:"focus"})]}),Er&&d.jsx("span",{className:"jer-error-slug",style:S("error",z),children:W})]})]}),d.jsx(ve,{position:"below",nodeData:z})]}))},Cg=(e,t)=>t!=null&&t.CustomNode&&(t!=null&&t.name)&&t.showInTypesSelector?t.name:typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":e===null?"null":"invalid",r2e=(e,t)=>{const n=t.value;switch(e){case"string":return d.jsx(NLe,Object.assign({},t,{value:n}));case"number":return d.jsx(KLe,Object.assign({},t,{value:n}));case"boolean":return d.jsx(qLe,Object.assign({},t,{value:n}));case"null":return d.jsx(VLe,Object.assign({},t));default:return d.jsx(zLe,Object.assign({},t))}},i2e=(e,t,n,r)=>{switch(t){case"string":return r??String(e);case"number":{const i=Number(e);return isNaN(i)?0:i}case"boolean":return!!e;case"null":return null;case"object":return{[n]:e};case"array":return[e];default:return String(e)}},dH=e=>{const{getStyles:t}=oa(),{collapseState:n,setCollapseState:r,doesPathMatch:i,currentlyEditingElement:o,setCurrentlyEditingElement:a,areChildrenBeingEdited:s}=Ym(),{mainContainerRef:l,data:c,nodeData:u,parentData:f,showCollectionCount:p,onEdit:h,onAdd:m,onDelete:g,canDragOnto:y,collapseFilter:C,collapseAnimationTime:x,onMove:b,enableClipboard:v,searchFilter:S,searchText:w,indent:T,sort:E,showArrayIndices:R,defaultValue:O,translate:k,customNodeDefinitions:B,jsonParse:K,jsonStringify:H,TextEditor:z,keyboardControls:N,handleKeyboard:Y,insertAtTop:ee}=e,[F,M]=I.useState(H(c)),W=C(u),{contentRef:re,isAnimating:Ie,maxHeight:Ce,collapsed:P,animateCollapse:ae}=((me,at,As,Co)=>{const[ug,dg]=I.useState(As?0:void 0),[jC,kX]=I.useState(As),LC=I.useRef(!1),DC=I.useRef(null),uj=I.useRef(0),dj=I.useRef();return{contentRef:DC,isAnimating:LC.current,animateCollapse:UC=>{var BC,PC;if(jC!==UC){switch(window.clearTimeout(dj.current),LC.current=!0,UC){case!0:{const fj=(PC=(BC=DC.current)===null||BC===void 0?void 0:BC.offsetHeight)!==null&&PC!==void 0?PC:0;uj.current=fj,dg(fj),setTimeout(()=>{dg(0)},5);break}case!1:dg(uj.current||n2e(me,DC,Co))}kX(!jC),dj.current=window.setTimeout(()=>{LC.current=!1,UC||dg(void 0)},at)}},maxHeight:ug,collapsed:jC}})(c,x,W,l),{pathString:Ge,nodeData:ve,path:De,name:gt,size:on,canEdit:Yt,canDelete:xe,canAdd:Ze,canDrag:ht,error:tt,setError:ct,onError:Gt,handleEditKey:wn,derivedValues:Jt}=lH({props:e,collapsed:P}),{dragSourceProps:Rt,getDropTargetProps:Tr,BottomDropTarget:Pt,DropTargetPadding:Zt}=cH({canDrag:ht,canDragOnto:y,path:De,nodeData:ve,onMove:b,onError:Gt,translate:k}),an=I.useRef(!W);I.useEffect(()=>{M(H(c)),_n&&a(null)},[c]),I.useEffect(()=>{const me=C(ve)&&!Jt.isEditing;an.current=!me,ae(me)},[C]),I.useEffect(()=>{n!==null&&i(De)&&(an.current=!0,ae(n.collapsed))},[n]);const Ir=I.useRef(null),Er=I.useMemo(()=>(me,at)=>typeof O!="function"?O:O(me,at),[O]),{CustomNode:Me,customNodeProps:$e,CustomWrapper:D,wrapperProps:L={},hideKey:U,showEditTools:ue=!0,showOnEdit:j,showOnView:te,showCollectionWrapper:pe=!0}=I.useMemo(()=>sH(B,ve),[]),le=s(Ge);if(le&&P&&ae(!1),!(tH("collection",ve,S,w)||ve.level===0)&&!le)return null;const be=Array.isArray(c)?"array":"object",ot=be==="array"?{open:"[",close:"]"}:{open:"{",close:"}"},xn=me=>{if(me.key!=="Tab"||me.getModifierState("Shift"))Y(me,{objectConfirm:kl,cancel:sa});else{me.preventDefault();const at=rH(Ir," ");M(at)}},bo=me=>{const at=nF(me);if(at&&N.collapseModifier.includes(at))return an.current=!0,void r({collapsed:!P,path:De});o&&o.includes(Ge)||(an.current=!0,r(null),ae(!P))},kl=()=>{try{const me=K(F);if(a(null),ct(null),JSON.stringify(me)===JSON.stringify(c))return;h(me,De).then(at=>{at&&Gt({code:"UPDATE_ERROR",message:at},me)})}catch{Gt({code:"INVALID_JSON",message:k("ERROR_INVALID_JSON",ve)},F)}},aa=De.length>0?()=>{g(c,De).then(me=>{me&&Gt({code:"DELETE_ERROR",message:me},c)})}:void 0,sa=()=>{a(null),ct(null),M(H(c))},{isEditing:_n,isEditingKey:hs,isArray:MC,canEditKey:gp}=Jt,Ol=p==="when-closed"?P:p,IX=!_n&&ue,EX=(R||!MC)&&!U&&gt!==void 0,RX=Me&&(_n&&j||!_n&&te),cg=Object.entries(c).map(([me,at])=>[be==="array"?Number(me):me,at]);be==="object"&&E(cg,me=>me);const oj=an.current?_n?d.jsxs("div",{className:"jer-collection-text-edit",children:[z?d.jsx(z,{value:F,onChange:M,onKeyDown:me=>Y(me,{objectConfirm:kl,cancel:sa})}):d.jsx(eH,{textAreaRef:Ir,className:"jer-collection-text-area",name:Ge,value:F,setValue:M,isEditing:_n,handleKeyPress:xn,styles:t("input",ve)}),d.jsx("div",{className:"jer-collection-input-button-row",children:d.jsx(iF,{onOk:kl,onCancel:sa,nodeData:ve})})]}):cg.map(([me,at],As)=>{const Co={key:me,value:at,path:[...De,me],level:De.length+1,index:As,size:Ed(at)?Object.keys(at).length:1,parentData:c,fullData:ve.fullData};return d.jsx("div",{className:"jer-collection-element",style:t("collectionElement",Co),children:Ed(at)?d.jsx(dH,Object.assign({},e,{data:at,parentData:c,nodeData:Co,showCollectionCount:p,canDragOnto:Yt}),me):d.jsx(uH,Object.assign({},e,{data:at,parentData:c,nodeData:Co,canDragOnto:Yt,showLabel:be==="object"||R}),me)},me)}):null,FC=!!pe&&P&&!le;FC||(an.current=!0);const aj=Object.assign(Object.assign({},e),{data:c,value:c,parentData:f,nodeData:ve,setValue:me=>zu(void 0,void 0,void 0,function*(){return yield h(me,De)}),handleEdit:kl,handleCancel:sa,handleKeyPress:xn,isEditing:_n,setIsEditing:()=>a(De),getStyles:t,canDragOnto:Yt}),$X=RX?d.jsx(Me,Object.assign({customNodeProps:$e},aj,{children:oj})):oj,sj=hs?d.jsx("input",{className:"jer-input-text jer-key-edit",type:"text",name:Ge,defaultValue:gt,autoFocus:!0,onFocus:me=>me.target.select(),onKeyDown:me=>Y(me,{stringConfirm:()=>wn(me.target.value),cancel:sa,tabForward:()=>{wn(me.target.value);const at=cg==null?void 0:cg[0][0];a(at?[...De,at]:Ts(ve.fullData,De,"next",E))},tabBack:()=>{wn(me.target.value),a(Ts(ve.fullData,De,"prev",E))}}),style:{width:String(gt).length/1.5+.5+"em"}}):EX&&d.jsx("span",{className:"jer-key-text",style:t("property",ve),onClick:me=>me.stopPropagation(),onDoubleClick:()=>gp&&a(De,"key"),children:gt===""?d.jsx("span",{className:De.length>0?"jer-empty-string":void 0}):`${gt}:`}),lj=IX&&d.jsx(aH,{startEdit:Yt?()=>{an.current=!0,a(De)}:void 0,handleAdd:Ze?me=>{ae(!1);const at=Er(ve,me);if(be==="array"){const As=ee.array?0:c.length,Co=ee.array?{insert:!0}:{};m(at,[...De,As],Co).then(ug=>{ug&&Gt({code:"ADD_ERROR",message:ug},at)})}else if(me in c)Gt({code:"KEY_EXISTS",message:k("ERROR_KEY_EXISTS",ve)},me);else{const As=ee.object?{insertBefore:0}:{};m(at,[...De,me],As).then(Co=>{Co&&Gt({code:"ADD_ERROR",message:Co},at)})}}:void 0,handleDelete:xe?aa:void 0,enableClipboard:v,type:be,nodeData:ve,translate:k,customButtons:e.customButtons,keyboardControls:N,handleKeyboard:Y}),cj=d.jsxs("div",Object.assign({className:"jer-component jer-collection-component",style:Object.assign(Object.assign({marginLeft:(De.length===0?0:T/2)+"em"},t("collection",ve)),{position:"relative"}),draggable:ht},Rt,Tr("above"),{children:[d.jsx("div",{className:"jer-clickzone",style:{width:T/2+1+"em",zIndex:10+2*ve.level},onClick:me=>bo(me)}),!_n&&Pt,d.jsx(Zt,{position:"above",nodeData:ve}),pe?d.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},onClick:me=>bo(me),children:[d.jsxs("div",{className:"jer-collection-name",children:[d.jsx("div",{className:"jer-collapse-icon jer-accordion-icon"+(P?" jer-rotate-90":""),style:{zIndex:11+2*ve.level},onClick:me=>bo(me),children:d.jsx(Ql,{name:"chevron",rotate:P,nodeData:ve})}),sj,!_n&&d.jsx("span",{className:"jer-brackets jer-bracket-open",style:t("bracket",ve),children:ot.open})]}),!_n&&Ol&&d.jsx("div",{className:"jer-collection-item-count"+(Ol?" jer-visible":" jer-hidden"),style:t("itemCount",ve),children:on===1?k("ITEM_SINGLE",Object.assign(Object.assign({},ve),{size:1}),1):k("ITEMS_MULTIPLE",ve,on)}),d.jsx("div",{className:"jer-brackets"+(FC?" jer-visible":" jer-hidden"),style:t("bracket",ve),children:ot.close}),lj]}):U?d.jsx(d.Fragment,{}):d.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},children:[sj,lj]}),d.jsxs("div",{className:"jer-collection-inner",style:Object.assign({overflowY:FC||Ie?"clip":"visible",maxHeight:le?void 0:Ce},t("collectionInner",ve)),ref:re,children:[$X,d.jsx("div",{className:_n?"jer-collection-error-row":"jer-collection-error-row-edit",children:tt&&d.jsx("span",{className:"jer-error-slug",style:t("error",ve),children:tt})}),!_n&&pe&&d.jsx("div",{className:"jer-brackets jer-bracket-outside",style:Object.assign(Object.assign({},t("bracket",ve)),{marginLeft:(T<3?-1:T<6?-.5:0)+"em"}),children:ot.close})]}),d.jsx(Zt,{position:"below",nodeData:ve})]}));return D?d.jsx(D,Object.assign({customNodeProps:L},aj,{children:cj})):cj},o2e={ITEM_SINGLE:"{{count}} item",ITEMS_MULTIPLE:"{{count}} items",KEY_NEW:"Enter new key",ERROR_KEY_EXISTS:"Key already exists",ERROR_INVALID_JSON:"Invalid JSON",ERROR_UPDATE:"Update unsuccessful",ERROR_DELETE:"Delete unsuccessful",ERROR_ADD:"Adding node unsuccessful",DEFAULT_STRING:"New data!",DEFAULT_NEW_KEY:"key"},a2e=(e,t)=>(n,r,i)=>((o,a,s,l,c)=>{if(a[l]){const f=a[l](s);if(f!==null)return f}const u=l in o?o[l]:o2e[l];return c===void 0?u:u==null?void 0:u.replace("{{count}}",String(c))})(e,t,r,n,i);var BL=[],bp=[];(function(e,t){if(e&&typeof document<"u"){var n,r=t.prepend===!0?"prepend":"append",i=t.singleTag===!0,o=typeof t.container=="string"?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(i){var a=BL.indexOf(o);a===-1&&(a=BL.push(o)-1,bp[a]={}),n=bp[a]&&bp[a][r]?bp[a][r]:bp[a][r]=s()}else n=s();e.charCodeAt(0)===65279&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function s(){var l=document.createElement("style");if(l.setAttribute("type","text/css"),t.attributes)for(var c=Object.keys(t.attributes),u=0;u<c.length;u++)l.setAttribute(c[u],t.attributes[c[u]]);var f=r==="prepend"?"afterbegin":"beforeend";return o.insertAdjacentElement(f,l),l}})(':root{--jer-select-border:#b6b6b6;--jer-select-focus:#777;--jer-select-arrow:#777;--jer-form-border:1px solid #ededf0;--jer-form-border-focus:1px solid #e2e2e2;--jer-expand-transition-time:0.3s;--jer-highlight-color:#b3d8ff}.jer-visible{opacity:1}.jer-hidden,.jer-visible{transition:var(--jer-expand-transition-time)}.jer-hidden{opacity:0}.jer-select select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;color:#000;cursor:inherit;font-family:inherit;font-size:.8em;line-height:inherit;margin:0;outline:none;padding:0 1em 0 0;z-index:1}select::-ms-expand{display:none}.jer-select{align-items:center;background-color:#fff;background-image:linear-gradient(0deg,#f9f9f9,#fff 33%);border:1px solid var(--jer-select-border);border-radius:.25em;cursor:pointer;display:grid;grid-template-areas:"select";line-height:1.1;max-width:15ch;min-width:12ch;padding:.25em .5em;position:relative}.jer-select select,.jer-select:after{grid-area:select}.jer-select:not(.jer-select--multiple):after{background-color:var(--jer-select-arrow);clip-path:polygon(100% 0,0 0,50% 100%);content:"";height:.5em;justify-self:end;width:.8em}select:focus+.focus{border:1px solid var(--jer-select-focus);border-radius:inherit;bottom:-1px;left:-1px;position:absolute;right:-1px;top:-1px}.jer-editor-container{border-radius:.5em;font-size:16px;line-height:1;padding:1em 1em 1em 2em;position:relative;text-align:left}.jer-editor-container textarea{border:var(--jer-form-border);border-radius:.3em;color:var(--jer-input-color);outline:none}.jer-editor-container textarea:focus{border:var(--jer-form-border-focus)}.jer-editor-container input{border:var(--jer-form-border);border-radius:.3em;font-family:inherit;outline:none}.jer-editor-container input:focus{border:var(--jer-form-border-focus)}.jer-editor-container ::selection{background-color:var(--jer-highlight-color)}.jer-collection-header-row,.jer-value-main-row{align-items:center;display:flex;gap:.3em;min-height:1.7em}.jer-collection-header-row{display:flex;flex-wrap:wrap}.jer-collapse-icon{left:-1.2em;position:absolute;top:.35em}.jer-collection-inner{position:relative;transition:var(--jer-expand-transition-time)}.jer-collection-text-edit{align-items:flex-start;display:flex;flex-direction:column;gap:.3em}.jer-collection-text-area{font-family:inherit;font-size:.85em;max-height:40em;overflow:hidden;padding:.2em .5em 0;resize:both}.jer-collection-input-button-row{display:flex;font-size:150%;justify-content:flex-end;margin-top:.4em;width:100%}.jer-collection-error-row{bottom:.5em;position:absolute}.jer-error-slug{margin-left:1em}.jer-value-component{position:relative}.jer-value-main-row{display:flex;gap:0}.jer-value-and-buttons{align-items:center;display:flex;justify-content:flex-start;padding-left:.5em}.jer-value-error-row{position:absolute}.jer-value-string{line-height:1.3em;overflow-wrap:anywhere;white-space:pre-wrap}.jer-hyperlink{text-decoration:underline}.jer-input-text{font-family:inherit;font-size:.9em;height:1.4em;line-height:1.2em;margin:0;min-width:6em;overflow:hidden;padding:.25em .5em .2em;resize:none}.jer-input-boolean{margin-left:.3em;margin-right:.3em;transform:scale(1.5)}.jer-key-text{line-height:1.1em;white-space:pre-wrap;word-break:break-word}.jer-key-edit{font-size:inherit;font-size:.9em;padding:0 .3em}.jer-value-invalid{font-style:italic;opacity:.5}.jer-input-number{font-size:90%;min-width:3em}.jer-confirm-buttons,.jer-edit-buttons{align-items:center;cursor:pointer;display:flex;height:1em}.jer-input-buttons{gap:.4em}.jer-edit-buttons{gap:.4em;margin-left:.5em;opacity:0}.jer-confirm-buttons{gap:.2em;margin-left:.4em}.jer-edit-buttons:hover{opacity:1;position:relative}.jer-collection-header-row:hover>.jer-edit-buttons,.jer-value-and-buttons:hover>.jer-edit-buttons,.jer-value-main-row:hover>.jer-edit-buttons{opacity:1}.jer-copy-pulse{position:relative;transition:transform var(--jer-expand-transition-time)}.jer-copy-pulse:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-copy-pulse:after{border-radius:50%;box-shadow:0 0 15px 5px var(--jer-icon-copy-color);content:"";display:block;height:100%;left:0;opacity:0;position:absolute;top:0;transition:all .5s;width:100%}.jer-copy-pulse:active:after{border-radius:4em;box-shadow:0 0 0 0 var(--jer-icon-copy-color);left:0;opacity:1;position:absolute;top:0;transition:0s}.jer-copy-pulse:active{top:.07em}.jer-rotate-90{transform:rotate(-90deg)}.jer-accordion-icon,.jer-rotate-90{transition:transform var(--jer-expand-transition-time)}.jer-icon:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-empty-string:after{content:"<empty string>:";font-size:90%;font-style:italic}.jer-drag-n-drop-padding{border:1px dashed #e0e0e0;border-radius:.3em;height:.5em}.jer-clickzone{height:calc(100% - .8em);left:-1em;position:absolute;top:1.2em}',{});const s2e=({data:e,setData:t,rootName:n="root",onUpdate:r=()=>{},onEdit:i=r,onDelete:o=r,onAdd:a=r,onChange:s,onError:l,showErrorMessages:c=!0,enableClipboard:u=!0,indent:f=2,collapse:p=!1,collapseAnimationTime:h=300,showCollectionCount:m=!0,restrictEdit:g=!1,restrictDelete:y=!1,restrictAdd:C=!1,restrictTypeSelection:x=!1,restrictDrag:b=!0,searchFilter:v,searchText:S,searchDebounceTime:w=350,keySort:T=!1,showArrayIndices:E=!0,showStringQuotes:R=!0,defaultValue:O=null,minWidth:k=250,maxWidth:B="min(600px, 90vw)",rootFontSize:K,stringTruncate:H=250,translations:z={},className:N,id:Y,customText:ee={},customNodeDefinitions:F=[],customButtons:M=[],jsonParse:W=JSON.parse,jsonStringify:re=Ge=>JSON.stringify(Ge,null,2),TextEditor:Ie,errorMessageTimeout:Ce=2500,keyboardControls:P={},insertAtTop:ae=!1})=>{const{getStyles:Ge}=oa(),{setCurrentlyEditingElement:ve}=Ym(),De=I.useCallback(Sp(p),[p]),gt=I.useCallback(a2e(z,ee),[z,ee]),[on,Yt]=I.useState(S),[xe,Ze]=(({setData:Me,data:$e})=>{const[D,L]=I.useState(Me?void 0:$e),U=I.useCallback(ue=>{Me?Me(ue):L(ue)},[Me]);return I.useEffect(()=>{Me||L($e)},[$e]),[Me?$e:D,U]})({setData:t,data:e}),ht=I.useRef(null);I.useEffect(()=>{ve(null);const Me=setTimeout(()=>Yt(S),w);return()=>clearTimeout(Me)},[S,w]);const tt={key:n,path:[],level:0,index:0,value:xe,size:typeof xe=="object"&&xe!==null?Object.keys(xe).length:1,parentData:null,fullData:xe},ct=(Me,$e)=>zu(void 0,void 0,void 0,function*(){const D=yield Me($e);if(D===!0||D===void 0)return void Ze($e.newData);const L=u2e(D)?D:["error",D],[U,ue]=L;if(U==="error")return Ze($e.currentData),ue===!1?gt("ERROR_UPDATE",tt):String(ue);Ze(ue)}),Gt=I.useMemo(()=>Sp(g),[g]),wn=I.useMemo(()=>Sp(y),[y]),Jt=I.useMemo(()=>Sp(C),[C]),Rt=I.useMemo(()=>Sp(b),[b]),Tr=I.useMemo(()=>c2e(v),[v]),Pt=I.useMemo(()=>(Me=>{const $e=Object.assign({},UL);for(const D of Object.keys(UL)){const L=D;if(Me[L]){const U=Me[L],ue=["clipboardModifier","collapseModifier"].includes(D)?Array.isArray(U)?U:[U]:typeof U=="string"?{key:U}:U;$e[L]=ue,["stringConfirm","numberConfirm","booleanConfirm"].forEach(j=>{!Me[j]&&Me.confirm&&($e[j]=$e.confirm)})}}return $e})(P),[P]),Zt=I.useCallback((Me,$e)=>((D,L,U)=>{const ue=Object.entries(L);for(const[j,te]of ue)if(jLe(U,D[j],j)){U.preventDefault(),te();break}})(Pt,$e,Me),[P]),an=I.useCallback((Me,$e)=>{T!==!1&&(typeof T!="function"?Me.sort((D,L)=>{const U=$e(D)[0],ue=$e(L)[0];return U<ue?-1:U>ue?1:0}):Me.sort((D,L)=>T($e(D),$e(L))))},[T]),Ir={mainContainerRef:ht,name:n,nodeData:tt,onEdit:(Me,$e)=>zu(void 0,void 0,void 0,function*(){const{currentData:D,newData:L,currentValue:U,newValue:ue}=Cp(xe,$e,Me,"update");if(U!==ue)return yield ct(i,{currentData:D,newData:L,currentValue:U,newValue:ue,name:$e.slice(-1)[0],path:$e})}),onDelete:(Me,$e)=>zu(void 0,void 0,void 0,function*(){const{currentData:D,newData:L,currentValue:U,newValue:ue}=Cp(xe,$e,Me,"delete");return yield ct(o,{currentData:D,newData:L,currentValue:U,newValue:ue,name:$e.slice(-1)[0],path:$e})}),onAdd:(Me,$e,D)=>zu(void 0,void 0,void 0,function*(){const{currentData:L,newData:U,currentValue:ue,newValue:j}=Cp(xe,$e,Me,"add",D);return yield ct(a,{currentData:L,newData:U,currentValue:ue,newValue:j,name:$e.slice(-1)[0],path:$e})}),onChange:s,onError:l,showErrorMessages:c,onMove:(Me,$e,D)=>zu(void 0,void 0,void 0,function*(){if(Me===null)return;const{currentData:L,newData:U,currentValue:ue}=Cp(xe,Me,"","delete"),j=Me.slice(-1)[0],te=$e.slice(0,-1),pe=$e.slice(-1)[0];let le=typeof pe=="number"?D==="above"?pe:pe+1:typeof j=="number"?`arr_${j}`:j;Me.slice(0,-1).join(".")===$e.slice(0,-1).join(".")&&typeof j=="number"&&typeof le=="number"&&j<le&&(le-=1);const be=typeof le=="number"?{insert:!0}:D==="above"?{insertBefore:pe}:{insertAfter:pe},{newData:ot,newValue:xn}=Cp(U,[...te,le],ue,"add",be);return yield ct(i,{currentData:L,newData:ot,currentValue:ue,newValue:xn,name:$e.slice(-1)[0],path:$e})}),showCollectionCount:m,collapseFilter:De,collapseAnimationTime:h,restrictEditFilter:Gt,restrictDeleteFilter:wn,restrictAddFilter:Jt,restrictTypeSelection:x,restrictDragFilter:Rt,canDragOnto:!1,searchFilter:Tr,searchText:on,enableClipboard:u,keySort:T,sort:an,showArrayIndices:E,showStringQuotes:R,indent:f,defaultValue:O,stringTruncate:H,translate:gt,customNodeDefinitions:F,customButtons:M,parentData:null,jsonParse:W,jsonStringify:re,TextEditor:Ie,errorMessageTimeout:Ce,handleKeyboard:Zt,keyboardControls:Pt,insertAtTop:{object:ae===!0||ae==="object",array:ae===!0||ae==="array"}},Er=Object.assign(Object.assign({},Ge("container",tt)),{minWidth:k,maxWidth:B});return Er.fontSize=K??Er.fontSize,d.jsx("div",{id:Y,ref:ht,className:`jer-editor-container ${N??""}`,style:Er,children:Ed(xe)?d.jsx(dH,Object.assign({data:xe},Ir)):d.jsx(uH,Object.assign({data:xe,showLabel:!0},Ir))})},l2e=e=>{var t;const[n,r]=I.useState();I.useEffect(()=>{const a=document.documentElement;r(a)},[]);const{collapseAnimationTime:i=300}=e;if(!n)return null;const o=getComputedStyle(n).getPropertyValue("--jer-expand-transition-time");return 1e3*parseFloat(o)!==i&&n.style.setProperty("--jer-expand-transition-time",i/1e3+"s"),d.jsx(DLe,{theme:(t=e.theme)!==null&&t!==void 0?t:rF,icons:e.icons,docRoot:n,children:d.jsx(WLe,{children:d.jsx(s2e,Object.assign({},e))})})},Cp=(e,t,n,r,i={})=>{if(t.length===0)return{currentData:e,newData:n,currentValue:e,newValue:n};const o=Object.assign({remove:r==="delete"},i),a=r!=="add"?jh(e,t):void 0;return{currentData:e,newData:RLe(e,t,n,o),currentValue:a,newValue:r!=="delete"?n:void 0}},Sp=e=>typeof e=="boolean"?()=>e:typeof e=="number"?({level:t})=>t>=e:e,c2e=e=>{if(e!==void 0)return e==="value"?Rd:e==="key"?DL:e==="all"?(t,n)=>Rd(t,n)||DL(t,n):e},u2e=e=>Array.isArray(e)&&e.length===2&&["error","value"].includes(e[0]);function d2e(){var t,n,r;const e=xl();return d.jsxs(A.Box,{display:"grid",gridTemplateRows:"auto auto 1fr",borderRadius:{topLeft:8,topRight:8},border:{top:!0,right:!0,left:!0,bottom:!1},minHeight:0,minWidth:0,children:[d.jsx(A.Box,{as:"header",padding:{inline:16},alignItems:"center",border:{bottom:!0},minHeight:48,children:d.jsx(A.Text,{variant:"small",component:"h2",color:"grey9",children:"Response"})}),((t=e.response)==null?void 0:t.status)==="pending"&&d.jsx(f2e,{}),((n=e.response)==null?void 0:n.status)==="error"&&d.jsx(p2e,{response:e.response}),((r=e.response)==null?void 0:r.status)==="success"&&d.jsx(h2e,{response:e.response})]})}function f2e(){return d.jsx(A.Box,{display:"grid",children:d.jsx(A.Box,{padding:16,justifyContent:"center",children:d.jsx(A.Alert,{color:"info",icon:"terminal",title:"Fetching data",titleLoading:!0})})})}function p2e(e){const{response:t}=e;return d.jsx(A.Box,{display:"grid",children:d.jsx(A.Box,{padding:16,justifyContent:"center",children:d.jsx(A.Alert,{color:"error",icon:"alert",title:"Error fetching data",subtitle:t.error.message})})})}function h2e(e){const{response:t}=e;return d.jsxs(d.Fragment,{children:[d.jsx(A2e,{response:t}),d.jsx(m2e,{response:t})]})}function A2e(e){const{response:t}=e;let n=null;return"total_results_size"in t.data?n=t.data.total_results_size:Array.isArray(t.data)&&(n=t.data.length),d.jsxs(A.Box,{as:"header",padding:{inline:16},alignItems:"center",border:{bottom:!0},minHeight:48,children:[d.jsx(A.Box,{flexGrow:1,gap:12,children:!!t.ref&&d.jsx(A.Badge,{icon:"tag",title:d.jsxs(d.Fragment,{children:[d.jsxs(A.Text,{variant:"small",color:"grey11",children:["ref: $",t.ref]}),d.jsx(A.Icon,{name:"contentCopy",size:"extraSmall",color:"grey11"})]}),size:"medium",color:"grey",onClick:()=>navigator.clipboard.writeText(t.ref??"")})}),d.jsxs(A.Box,{gap:12,children:[!!n&&d.jsx(d.Fragment,{children:d.jsxs(A.Box,{alignItems:"center",gap:4,children:[d.jsx(A.Icon,{name:"insertDriveFile",size:"extraSmall",color:"grey11"}),d.jsxs(A.Text,{variant:"small",color:"grey11",component:"p",children:[Zn.pluralize(n,"Document","Documents")," ",d.jsx(A.Text,{variant:"small",color:"purple9",component:"span",children:n})]})]})}),!!t.duration&&d.jsx(d.Fragment,{children:d.jsxs(A.Box,{alignItems:"center",gap:4,children:[d.jsx(A.Icon,{name:"schedule",size:"extraSmall",color:"grey11"}),d.jsxs(A.Text,{variant:"small",color:"grey11",component:"p",children:["Time"," ",d.jsxs(A.Text,{variant:"small",color:"green9",component:"span",children:[t.duration.toString(),"ms"]})]})]})})]})]})}function m2e(e){const{response:t}=e;return d.jsxs(A.Box,{display:"flex",flexDirection:"column",overflowY:"auto",backgroundColor:"white",children:[d.jsx("div",{style:{position:"sticky",top:0,left:0,zIndex:1},children:d.jsxs(A.Box,{position:"absolute",top:16,right:16,gap:8,children:[d.jsx(A.Button,{startIcon:"contentCopy",color:"grey",onClick:()=>navigator.clipboard.writeText(JSON.stringify(t.data,null,2)),children:"Copy"}),t.url&&d.jsx(A.Button,{endIcon:"link",asChild:!0,color:"grey",children:d.jsx("a",{href:t.url,target:"_blank",rel:"noreferrer",title:"Open CDN response in a new tab"})})]})}),d.jsx(l2e,{className:"responsePreview",data:t.data,enableClipboard:!1,restrictEdit:!0,restrictDelete:!0,restrictAdd:!0,theme:[{styles:{container:{backgroundColor:"transparent",fontFamily:'Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace'},property:"#0550ae",bracket:{color:"#1f2328",fontWeight:"normal"},string:"##0a3069",number:"#0550ae",boolean:"#0550ae",null:{color:"#0550ae",fontVariant:"initial",fontWeight:"normal"}}}],icons:{chevron:d.jsx(A.Icon,{name:"expandMore",size:"small"})},indent:3,collapse:3,collapseAnimationTime:0,rootName:"",showArrayIndices:!1,showStringQuotes:!0,showCollectionCount:"when-closed",stringTruncate:1/0,minWidth:"100%",maxWidth:"auto",rootFontSize:"calc(14rem / 16)"}),d.jsx("style",{children:`
25
+ .responsePreview {
26
+ /* Fixing weird text alignment */
27
+ & .jer-value-main-row {
28
+ min-height: 1.5em;
29
+ }
30
+ & .jer-key-text:has(+ div .jer-value-string) {
31
+ align-self: baseline;
32
+ line-height: 1.5em;
33
+ }
34
+ & .jer-value-string {
35
+ line-height: 1.5em;
36
+ }
37
+ & .jer-value-and-buttons:has(.jer-value-string) {
38
+ align-self: baseline;
39
+ }
40
+ & .jer-brackets::before {
41
+ content: " ";
42
+ }
43
+ & .jer-rotate-90 {
44
+ transform: rotate(-90deg) translateX(.1em);
45
+ }
46
+
47
+ & .jer-input-component [class*=jer-value]::after,
48
+ & .jer-bracket-outside::after,
49
+ & .jer-brackets.jer-visible::after {
50
+ content: ",";
51
+ color: #1f2328;
52
+ }
53
+
54
+ & .jer-bracket-outside::before {
55
+ white-space: pre;
56
+ }
57
+
58
+ /* Removing awkward UX */
59
+ & .jer-clickzone {
60
+ display: none;
61
+ }
62
+
63
+ & .jer-collapse-icon {
64
+ left: -1.4rem;
65
+ cursor: pointer;
66
+ }
67
+ }
68
+ `})]})}function g2e(){return d.jsx(A.Box,{display:"grid",gridTemplateColumns:"380px 1px minmax(0, 1fr)",width:"100%",height:"100%",gap:16,children:d.jsxs(vLe,{children:[d.jsx(wLe,{}),d.jsx(A.Separator,{orientation:"vertical",style:"dashed",decorative:!0}),d.jsx(d2e,{})]})})}function fH(e){if(fe.isRepeatableContent(e))return e;if(fe.isLinkContent(e))return{__TYPE__:"RepeatableContent",type:"Link",value:[e]}}function pH(e){if(fe.isLinkContent(e))return e;if(fe.isRepeatableContent(e)){const[t]=e.value;if(fe.isLinkContent(t))return t}}function v2e(e,t){let n=C2e(e,t);return n=y2e(e,n),n=b2e(e,n),fe.fillDocumentWithDefaultValues(e,n)}function y2e(e,t){return he.flattenSections(e).reduce((r,[i,o])=>!t[i]&&o.type==="Group"?{...r,[i]:hH}:r,t)}function b2e(e,t){return fe.traverseDocument({document:t,customType:e})({transformWidget({model:n,content:r}){return n?r:void 0},transformSlice(n){return n.model?n.content:void 0}})}function C2e(e,t){return fe.traverseDocument({document:t,customType:e})({transformWidget({model:n,content:r}){if((n==null?void 0:n.type)==="Link"){const{repeat:i}=n.config??{};switch(r.__TYPE__){case"LinkContent":return i?fH(r)??r:r;case"RepeatableContent":return i?r:pH(r)??r;default:return r}}return r}})}const hH={__TYPE__:"GroupContentType",value:[{__TYPE__:"GroupItemContent",value:[]}]},AH={unclassified:{title:"Draft",color:"amber"},published:{title:"Live",color:"green"},release:{title:"Planned",color:"purple"},archived:{title:"Archived",color:"grey"}},ax={unclassified:["unclassified","published"],archived:["unclassified","published"],release:["release","published"],published:["published","unclassified"]};function oF(e){const{documentId:t,versionId:n,baseUrl:r,status:i,releaseId:o}=e,a={s:i,v:n,r:o},s=ii.createRouteParams({params:a}),l=new URLSearchParams(s).toString();return new URL(`pages/${t}?${l}`,r)}function S2e(e){const{children:t,...n}=e;return d.jsx(Dr.QueryErrorResetBoundary,{children:({reset:r})=>d.jsx(A.ErrorBoundary,{...n,onReset:r,children:t})})}const mH=I.createContext(void 0),w2e={selectedIds:new Set,excludedIds:new Set,isAllSelected:!1};function gH(e){const{children:t,initialState:n,initialTotalItemCount:r,isSelectAllEnabled:i=!1}=e,o=I.useRef(),a=I.useRef(r||0);function s(){if(n&&n.selectedIds){const T=[...n.selectedIds].pop();T&&(o.current=T)}return{...w2e,...n}}const[l,c]=I.useState(s),u=I.useMemo(()=>{const{selectedIds:T,excludedIds:E,isAllSelected:R}=l;return R?a.current-E.size:T.size},[l]),f=I.useCallback(T=>{const{isAllSelected:E,selectedIds:R,excludedIds:O}=l;return E?!O.has(T):R.has(T)},[l]),p=I.useCallback(()=>{const{isAllSelected:T,selectedIds:E,excludedIds:R}=l;return{selectedIds:[...E],excludedIds:[...R],isAllSelected:T,selectedCount:u}},[l,u]),h=ze.useStableCallback(()=>{i&&c({isAllSelected:!0,selectedIds:new Set,excludedIds:new Set})}),m=ze.useStableCallback(()=>{c({isAllSelected:!1,selectedIds:new Set,excludedIds:new Set})});I.useEffect(()=>{const{isAllSelected:T,selectedIds:E,excludedIds:R}=l,O=a.current;if(!(O===0||!i)){if(T&&R.size===O){m();return}if(!T&&E.size===O){h();return}}},[l,i,h,m]);const g=ze.useStableCallback(T=>{const{id:E,isSingleSelection:R,metaKey:O,shiftKey:k,ids:B}=T;return k&&B&&B.length>0&&o.current?C(E,B,o.current):R&&!O?y(E):f(E)?v([E]):b([E]),o.current=E,f(E)});function y(T){f(T)&&u===1?c(E=>({...E,selectedIds:new Set})):c({isAllSelected:!1,selectedIds:new Set([T]),excludedIds:new Set})}function C(T,E,R){const O=x2e(E,R,T),k=f(T);return k?v(O):b(O),k}const x=ze.useStableCallback(()=>{u>0?m():h()});function b(T){const{isAllSelected:E}=l;if(E){c(R=>({...R,excludedIds:PL(R.excludedIds,T)}));return}c(R=>({...R,selectedIds:WL(R.selectedIds,T)}))}function v(T){const{isAllSelected:E}=l;if(E){c(R=>({...R,excludedIds:WL(R.excludedIds,T)}));return}c(R=>({...R,selectedIds:PL(R.selectedIds,T)}))}function S(T){a.current=T}const w=I.useMemo(()=>({selectedCount:u,state:l,totalItemCount:a.current,isSelected:f,isSelectAllEnabled:i,getSelectionState:p,toggleSelection:g,toggleSelectAll:x,clearSelection:m,setTotalItemCount:S}),[l,m,p,i,f,u,x,g]);return d.jsx(mH.Provider,{value:w,children:t})}function _l(e){const t=I.useContext(mH);if(t===void 0)throw new Error("useSelectionManagerContext must be used within a SelectionManagerProvider");const{totalItemCount:n,onChangeSelection:r}=e||{},{setTotalItemCount:i,totalItemCount:o,state:a,getSelectionState:s,...l}=t;n!==void 0&&n!==o&&i(n);const c=ze.useStableCallback(r);return I.useEffect(()=>{c==null||c(s())},[s,c,a]),{...l,getSelectionState:s,isAllSelected:a.isAllSelected}}function x2e(e,t,n){const r=e.indexOf(t),i=e.indexOf(n);if(i===-1)throw new Error("targetId must be in the array");return r===-1?[n]:r<=i?e.slice(r,i+1):e.slice(i,r+1)}function PL(e,t){const n=new Set(e);return t.forEach(r=>n.delete(r)),n}function WL(e,t){return new Set([...e,...t])}const _2e="https://prismic.io/docs/guides/manage-images#supported-media";function Gm(){const e=we();e.mediaLibrary||mt("mediaLibrary");const{assetsApiBaseUrl:t,authStrategy:n,repository:r}=e,{items:i}=et.useRequest(vH,[t,r,n]);return{tags:i}}function vH(e,t,n){return se.request(new URL("tags",e),{credentials:se.getRequestCredentials(n),okType:T2e,headers:{repository:t}})}const yH=1,bH=20,aF=$.string().min(yH).max(bH),sF=$.object({id:$.string(),name:aF,uploader_id:$.string().optional(),created_at:$.number(),last_modified:$.number(),count:$.number().optional().default(0)}),T2e=$.object({items:$.array(sF)});function Jm(e){et.updateFetcherData(vH,t=>{const{items:n}=t,r=e(n);if(r)return{items:r}})}function I2e(e){const{assetType:t,keyword:n,mode:r,tagIds:i}=e,o=we();o.mediaLibrary||mt("mediaLibrary");const{onAnalyticsEvent:a}=o,s=et.useFetcherData(Wi),l=s[s.length-1],c=I.useRef(l);c.current=l,I.useEffect(()=>{if(!a||!n||!c.current||c.current.keyword!==n)return;const u=String(n.split(" ").length),f=String(c.current.total),p=i.join(",");a("Media Library Search",{searchQuery:n,numberOfWords:u,numberOfResults:f,timeToGetResults:c.current.time,assetType:t,mode:r,tags:p})},[n,t,r,a,i])}function E2e(e){const{assetType:t,mediaDialogOpen:n}=e,r=we(),i=et.useFetcherData(Wi),o=I.useRef(0);I.useEffect(()=>{n&&(o.current=performance.now())},[n]);function a(s){if(!r.onAnalyticsEvent||!r.mediaLibrary)return;const l=i[i.length-1];if(!l)return;const{keyword:c,uploaderId:u,tags:f}=l,p=wH(i,c,t,u,f),h=String(c.split(" ").length),m=String(l.total),g=p.findIndex(b=>b.id===s),y=String(g+1),C=[s].join(","),x=(performance.now()-o.current).toFixed(0);r.onAnalyticsEvent("Media Added To Page",{assetType:t,searchQuery:c,numberOfWords:h,numberOfResults:m,searchPosition:y,mediaIds:C,timeToAddMediaToPage:x,tags:f})}return a}const Sg=$.array($.string()).optional().transform(e=>e==null?void 0:e[0]),aC=$.object({id:$.string(),kind:$.string(),extension:$.string().optional(),filename:$.string(),width:$.number().optional(),height:$.number().optional(),last_modified:$.number(),url:$.string(),alt:$.string().optional(),uploader_id:$.string().optional(),size:$.number(),notes:$.string().optional(),credits:$.string().optional(),search_highlight:$.object({filename:Sg,alt:Sg,notes:Sg,credits:Sg}).optional(),tags:$.array(sF)}),CH={"X-Prismic-Source":"Wroom"},R2e=$.object({total:$.number(),cursor:$.string().optional(),items:$.array(aC)}),SH=30;function Wi(e,t,n,r,i,o,a,s,l){const c=e?new URL("assets",e):void 0,u=new URLSearchParams(jQ([{name:"limit",values:[`${SH}`]},{name:"cursor",values:[l]},{name:"keyword",values:[r]},{name:"assetType",values:[i]},{name:"uploaderId",values:[o]},{name:"tags",values:a.split(",")}])).toString(),f=R2e.transform(h=>({...h,keyword:r,assetType:i,uploaderId:o,tags:a,page:s})),p=performance.now();return se.request(`${(c==null?void 0:c.href)??""}?${u}`,{headers:{repository:t,...CH},credentials:se.getRequestCredentials(n),okType:f}).then(h=>({...h,time:(performance.now()-p).toFixed(0)}))}et.cache.registerFetcherConfig(Wi,{revalidationStrategy:{type:"never"}});const fr={keyword:"",assetType:"all",uploaderId:void 0,tagIds:[]};function $2e(e){const{initialAssetType:t=fr.assetType,mode:n}=e,r=we(),[i,o]=I.useState({...fr,assetType:t,page:0});r.mediaLibrary||mt("mediaLibrary");const{assetsApiBaseUrl:a,authStrategy:s,repository:l}=r,{page:c,cursor:u,keyword:f,assetType:p,uploaderId:h,tagIds:m}=i,g=et.useRequest(Wi,Lh({assetsApiBaseUrl:a,authStrategy:s,repository:l,keyword:f,assetType:p,uploaderId:h,tagIds:m,page:c,cursor:u}));I2e({assetType:p,keyword:f,tagIds:m,mode:n});const y=F2e(f,p,h,m),C=g.total!==y.length;function x(){g.cursor!==void 0&&o(w=>({...w,page:w.page+1,cursor:g.cursor}))}function b(w){o(T=>({...T,page:0,cursor:void 0})),wc((T,E)=>{if(E.page===0)return[...w,...T]})}function v(w){o(T=>({...T,...w,page:0,cursor:void 0}))}function S(){o(w=>({...w,...fr,assetType:t==="all"?fr.assetType:w.assetType,page:0,cursor:void 0}))}return{keyword:f,assetType:p,uploaderId:h,tagIds:m,setFilters:v,resetFilters:S,media:y,mediaTotal:g.total,limit:SH,hasNextPage:C,fetchNextPage:x,updateMedia:k2e,unshiftMedia:b,deleteMedia:O2e,deleteSearchData:M2e,revalidateFirstPage:xH}}function k2e(e){wc(t=>t.flatMap(n=>{const r=e.find(i=>i.id===n.id);return r?r.response===void 0?[]:{...n,...r.response}:n}))}function O2e(e){wc(t=>t.filter(n=>!e.includes(n.id)))}function M2e(e){const{keyword:t,assetType:n,uploaderId:r,tagIds:i}=e,o=i==null?void 0:i.join(",");et.updateFetcherData(Wi,a=>{if(!(a.keyword===t&&a.assetType===n&&a.uploaderId===r&&a.tags===o))return a})}function wH(e,t,n,r,i){const o=e.filter(l=>l.keyword===t&&l.assetType===n&&l.uploaderId===r&&l.tags===i),s=_t.sort(o,l=>l.page).flatMap(l=>l.items);return t?_t.uniqBy(s,l=>l.id):s}function F2e(e,t,n,r){const i=et.useFetcherData(Wi);return wH(i,e,t,n,r.join(","))}function wc(e){et.updateFetcherData(Wi,t=>{const{items:n,total:r}=t,i=e(n,t);if(i)return{...t,total:r+(i.length-n.length),items:i}})}function xH(e){const{config:t,keyword:n=fr.keyword,assetType:r=fr.assetType,tagIds:i=fr.tagIds}=e;if(!t.mediaLibrary)throw new Error("media library is not configured");const{assetsApiBaseUrl:o,authStrategy:a,repository:s}=t;et.revalidateData(Wi,Lh({assetsApiBaseUrl:o,repository:s,authStrategy:a,keyword:n,assetType:r,tagIds:i,page:0}))}function _H(e){const{config:t,keyword:n=fr.keyword,assetType:r=fr.assetType,tagIds:i=fr.tagIds}=e;if(!t.mediaLibrary)throw new Error("media library is not configured");et.updateFetcherData(Wi,o=>o.page===0?o:void 0),xH({config:t,keyword:n,assetType:r,tagIds:i})}function Lh(e){return[e.assetsApiBaseUrl,e.repository,e.authStrategy,e.keyword,e.assetType,e.uploaderId,e.tagIds.join(","),e.page,e.cursor]}function TH(){const e=we();e.mediaLibrary||mt("mediaLibrary");const{assetsApiBaseUrl:t,coreApiBaseUrl:n,authStrategy:r,repository:i}=e,{authors:o}=et.useRequest(iC,[n,r]),{items:a}=et.useRequest(IH,[t,i,r]),{shortId:s}=eF(),l=new Map(o.map(f=>[f.id,f])),c=[];for(const f of a){if(f.id==="ghost"){c.push({id:f.id,name:"Ghost",uploadedAvatar:"https://images.prismic.io/page-builder-assets/ZuAXWBoQrfVKl5sD_ghost_user.png?auto=format,compress&w=64"});continue}const p=l.get(f.id);if(!p)continue;let h;if(p.uploadedAvatar){const m=new URL(p.uploadedAvatar);m.searchParams.set("w","64"),h=m.toString()}c.push({id:f.id,name:[p.firstname,p.lastname].filter(Boolean).join(" "),firstName:p.firstname,lastName:p.lastname,email:p.email,uploadedAvatar:h})}const u=new Map(c.map(f=>[f.id,f]));return{uploaders:_t.sort(c,f=>f.id===s?0:1,f=>f.name),uploadersById:u}}function IH(e,t,n){return se.request(new URL("uploaders",e),{credentials:se.getRequestCredentials(n),okType:L2e,headers:{repository:t}})}const j2e=$.object({id:$.string()}),L2e=$.object({items:$.array(j2e)});function EH(){const e=we();e.mediaLibrary||mt("mediaLibrary");const{assetsApiBaseUrl:t,authStrategy:n,repository:r}=e;return()=>{et.revalidateData(IH,[t,r,n])}}function D2e(e){const{revalidate:t,config:n,keyword:r,assetType:i,uploaderId:o,tagIds:a}=e,{assetsApiBaseUrl:s=void 0,repository:l="",authStrategy:c="token"}=n.mediaLibrary?n:{},[u,f]=I.useState(!1),[p,h]=I.useState(!1),m={assetsApiBaseUrl:s,repository:l,authStrategy:c,keyword:r,assetType:i,uploaderId:o,tagIds:a,page:0},{revalidateData:g}=et.useCacheRevalidation({fetcher:Wi,requestParams:Lh(m),validator:(x,b)=>{var w,T;const v=((w=x.items[0])==null?void 0:w.id)??"",S=((T=b.items[0])==null?void 0:T.id)??"";return v!==S||x.total!==(b==null?void 0:b.total)},onCacheInvalidated:()=>h(!0),every:6e4}),y=x=>{g(Lh({...m,...x}))};I.useEffect(()=>{u&&(h(!1),f(!1))},[u]);function C(){f(!0),t()}return{isMediaRevalidationInProgress:u,isMediaCacheInvalid:p,revalidateMedia:C,revalidateWithParams:y}}function U2e(e){const{onBeforeUpload:t,onComplete:n}=e,[r,i]=I.useState([]),o=r.some(u=>u.status==="idle"||u.status==="uploading"),a=we();function s(){if(!r.length||r.some(h=>h.status==="uploading")||r.every(h=>h.status==="error"))return;const u=r.find(h=>h.status==="idle");if(!u)return;let f=r;function p(h){f=h(f),i(f),f.every(g=>g.status==="success"||g.status==="error")&&setTimeout(()=>{i([]),n==null||n(f)},1500)}p(h=>h.map(m=>m.id===u.id?{...m,status:"uploading"}:m)),RH({file:u.file,config:a}).then(h=>{p(m=>m.map(g=>g.id===u.id?{...g,status:"success",response:h}:g))}).catch(()=>{p(h=>h.map(m=>m.id===u.id?{...m,status:"error"}:m))})}function l(u){const f=u.map(p=>({id:`temp-${crypto.randomUUID()}`,file:p,status:"idle"}));i(f),t(f)}const c=I.useCallback(u=>{const f=[{...u,status:"idle"},...r.filter(p=>p.id!==u.id)];i(f),t(f)},[t,r]);return I.useEffect(s,[a,r,n]),{isUploading:o,uploadingFiles:r,onFilesSelected:l,onRetry:c}}async function RH(e){const{file:t,config:n}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n,a=new FormData;return a.append(t.name,t),se.request(new URL("assets",r),{headers:{repository:i,"Content-Type":"multipart/form-data",...CH},method:"POST",body:a,credentials:se.getRequestCredentials(o),okType:aC})}const $H=I.createContext(void 0);function B2e(e){const{children:t,assetType:n=fr.assetType,onSelectedChange:r,actionContainer:i}=e,o=r?"select":"browse",[a,s]=I.useTransition(),[l,c]=I.useTransition(),u=we(),{showAlert:f}=A.useAlert(),p=eF(),h=EH(),{keyword:m,assetType:g,uploaderId:y,tagIds:C,setFilters:x,resetFilters:b,media:v,fetchNextPage:S,hasNextPage:w,updateMedia:T,unshiftMedia:E,deleteMedia:R,mediaTotal:O,deleteSearchData:k,revalidateFirstPage:B}=$2e({initialAssetType:n,mode:o}),[K,H]=I.useState();function z(){_H({config:u,keyword:m,assetType:g,uploaderId:y,tagIds:C})}const{isMediaRevalidationInProgress:N,isMediaCacheInvalid:Y,revalidateMedia:ee,revalidateWithParams:F}=D2e({config:u,revalidate:z,keyword:m,assetType:g,uploaderId:y,tagIds:C});function M(xe){const Ze=xe.keyword===fr.keyword,ht=xe.assetType===n,tt=xe.uploaderId===fr.uploaderId,ct=xe.tagIds.length===fr.tagIds.length&&xe.tagIds.every((Gt,wn)=>Gt===fr.tagIds[wn]);return Ze&&ht&&tt&&ct}function W(xe){const Ze={keyword:m,assetType:g,tagIds:C,uploaderId:y,...xe};M(Ze)?F(xe):k(Ze),c(()=>{x(xe),ae.clearSelection()})}const{isUploading:re,onFilesSelected:Ie,uploadingFiles:Ce,onRetry:P}=U2e({onBeforeUpload:xe=>{b();const Ze=xe.filter(tt=>tt.status==="idle").map(tt=>({id:tt.id,url:URL.createObjectURL(tt.file),filename:tt.file.name,size:tt.file.size,extension:tt.file.type,kind:tt.file.type,last_modified:tt.file.lastModified,tags:[],uploader_id:p.shortId}));E(Ze);const[ht]=Ze??[];ht&&ae.toggleSelection({id:ht.id,isSingleSelection:!0})},onComplete:xe=>{const Ze=xe.flatMap(ct=>ct.status==="success"?ct:(gt(ct),{id:ct.id,response:void 0}));T(Ze),B({config:u,assetType:g,tagIds:C}),h();const ht=Ze[0];!ht||!ht.response||!ae.isSelected(ht.id)||ae.toggleSelection({id:ht.response.id,isSingleSelection:!0})}}),ae=_l({totalItemCount:O,onChangeSelection:({selectedIds:xe,selectedCount:Ze})=>{if(Yt(!1),!!r){if(Ze===1){const[ht]=[...xe];if(Ce.some(ct=>ct.id===ht&&ct.status!=="success")){r(new Set);return}}r(new Set(xe))}}});function Ge(xe){re||Ie(xe)}function ve(){w&&s(S)}function De(xe,Ze){T([{id:xe,response:Ze}])}function gt(xe){const Ze=Zn.overflow(xe.file.name,30);f({id:xe.id,title:`The specified file "${Ze}" could not be uploaded.`,subtitle:d.jsxs(A.Text,{color:"inherit",children:["Read more about our"," ",d.jsx(A.Text,{color:"tomato11",href:_2e,underline:!0,children:"supported media"}),"."]}),buttons:{action:{text:"Retry upload",icon:"cloudUpload",onClick:()=>P(xe)}}})}const[on,Yt]=I.useState(!1);return d.jsx($H.Provider,{value:{isFetchingMedia:a,media:v,mediaTotal:O,onScrollToBottom:ve,actionContainer:i,onFilesUpload:Ge,isUploading:re,uploadingFiles:Ce,isMediaRevalidationInProgress:N,isMediaCacheInvalid:Y,revalidateMedia:ee,deleteMedia:R,updateMedia:De,keyword:m,isSearchingMedia:l,assetType:g,initialAssetType:n,uploaderId:y,tagManagerOpen:on,setTagManagerOpen:Yt,tagIds:C,onFilterChange:W,openMediaSection:K,setOpenMediaSection:H},children:t})}function Et(){const e=I.useContext($H);if(!e)throw new Error("useMediaLibrary must be used within a MediaLibraryProvider");return e}function P2e(){const e=we(),{initialAssetType:t}=Et(),{assetsApiBaseUrl:n=void 0,repository:r="",authStrategy:i="token"}=e.mediaLibrary?e:{},{total:o}=et.useRequest(Wi,Lh({assetsApiBaseUrl:n,authStrategy:i,repository:r,assetType:t,keyword:"",tagIds:[],page:0}));return o}function kH(){return P2e()===0}function W2e(){return kH()?d.jsx(N2e,{}):d.jsx(MH,{})}function OH(e){const{children:t}=e;return d.jsx(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:t})}function MH(){return d.jsx(OH,{children:d.jsxs(A.BlankSlate,{children:[d.jsx(A.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(A.BlankSlateTitle,{size:"big",children:"Oops!"}),d.jsx(A.BlankSlateDescription,{width:360,children:"No items found matching your search"})]})})}function N2e(){const{onFilesUpload:e}=Et();return d.jsx(OH,{children:d.jsxs(A.Box,{gap:20,flexDirection:"column",alignItems:"center",children:[d.jsx(A.Box,{maxWidth:375,children:d.jsx(A.BlankSlateTitle,{size:"big",children:"Start by uploading your files!"})}),d.jsx(A.Box,{border:!0,borderStyle:"dashed",borderRadius:4,justifyContent:"center",children:d.jsxs(A.BlankSlate,{sx:{marginBlock:80,marginInline:48},children:[d.jsx(A.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),d.jsx(A.BlankSlateTitle,{children:"Drop your files anywhere to upload or ..."}),d.jsx(A.FileUploadButton,{onFilesSelected:e,renderButton:t=>d.jsx(A.Box,{display:"inline-flex",as:"span",children:d.jsx(A.Button,{onClick:t,color:"grey",children:"Upload media"})})}),d.jsx(A.BlankSlateDescription,{children:"Maximum upload size file: 128 MB"})]})})]})})}const $d={warning:{uploadWhileUploading:{title:"Hang tight!",description:"Your current images are still being uploaded. Once they're all set, you'll be free to upload more."}}};function K2e(){const{actionContainer:e,isUploading:t,onFilesUpload:n,assetType:r}=Et();return d.jsx(FH,{actionContainer:e,children:d.jsxs(A.Box,{width:"100%",gap:16,children:[d.jsx(q2e,{}),d.jsx(A.Tooltip,{title:$d.warning.uploadWhileUploading.title,content:$d.warning.uploadWhileUploading.description,visible:t,stableMount:!0,children:d.jsx(A.FileUploadButton,{disabled:t,onFilesSelected:n,startIcon:"cloudUpload",color:e?"purple":"grey",size:"large",assetType:r,children:"Upload media"})})]})})}function q2e(){const{keyword:e,onFilterChange:t,isFetchingMedia:n}=Et(),[r,i]=I.useState(e);return ze.useOnChange(e,()=>{e===""&&i("")}),ze.useDebounce(r,300,ze.useStableCallback(o=>t({keyword:o}))),d.jsx(A.Box,{width:"100%",flexDirection:"column",children:d.jsx(A.FormSearchInput,{value:r,placeholder:"Search",onValueChange:i,maxLength:200,isLoading:n&&e!==r})})}function FH(e){const{children:t,actionContainer:n}=e;return n?d.jsx(A.Portal,{container:n,asChild:!0,children:t}):d.jsx(d.Fragment,{children:t})}function V2e(e){const{children:t}=e,{onFilesUpload:n,assetType:r}=Et();return d.jsx(A.FileDropZone,{overlay:d.jsx(z2e,{}),onFilesSelected:n,assetType:r,children:t})}function z2e(){const{isUploading:e}=Et(),t=e?$d.warning.uploadWhileUploading.title:"Drop files here",n=e?$d.warning.uploadWhileUploading.description:"Drop your files to upload them instantly to the media library.";return d.jsx(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:d.jsxs(A.BlankSlate,{children:[d.jsx(A.BlankSlateIcon,{name:e?"block":"cloudUpload",lineColor:e?"tomato11":"purple10",backgroundColor:e?"tomato2":"purple3",borderColor:e?"tomato6":"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(A.BlankSlateTitle,{size:"big",children:t}),d.jsx(A.BlankSlateDescription,{width:360,children:n})]})})}function jH(){return d.jsx(A.DefaultErrorMessage,{title:"Oops! Something went wrong",description:"An error occurred while searching for your image.",errorImageSrc:A.dialogErrorImage,sx:{marginBlock:"auto",marginInline:"auto"}})}function LH(e){const{mediaList:t,mediaActions:n,mediaToolbar:r,sidePane:i}=e,o=A.useMediaQuery({min:"medium"}),a=i&&o;return d.jsxs(A.Box,{display:"grid",gridTemplateRows:"auto auto 1fr",gridTemplateColumns:a?"1fr 380px":"1fr",width:"100%",height:"100%",children:[d.jsxs(A.Box,{position:"relative",display:"grid",gap:16,gridColumn:"1",gridRow:"1",padding:{right:16,bottom:16},children:[n,r]}),d.jsx(A.Box,{position:"relative",display:"grid",gridColumn:"1",gridRow:"2 / -1",children:t}),a&&i]})}function Q2e(){var p;const{onScrollToBottom:e,media:t,isUploading:n,uploadingFiles:r,isSearchingMedia:i,isMediaRevalidationInProgress:o,setOpenMediaSection:a,isFetchingMedia:s}=Et(),l=_l(),c=I.useRef(null);function u(h){l.toggleSelection({id:h,isSingleSelection:!0}),a("tags")}(n||i||o)&&((p=c.current)==null||p.scrollTo({top:0,behavior:"instant"}));function f(h,m,g){const y=m.shiftKey?t.map(({id:C})=>C):void 0;l.toggleSelection({id:h,isSingleSelection:g==="single",metaKey:m.metaKey,shiftKey:m.shiftKey,ids:y})}return d.jsxs(DH,{onScrollToBottom:e,scrollAreaRef:c,children:[t.map(h=>{var m,g;return d.jsx(A.MediaCard,{"aria-label":"media item",...h,filenameHighlight:(m=h.search_highlight)==null?void 0:m.filename,loading:i,status:(g=r.find(y=>y.id===h.id))==null?void 0:g.status,selected:l.isSelected(h.id),onCardClick:y=>f(h.id,y,"single"),onCheckedChange:(y,C)=>f(h.id,C,"multi"),onAddTagClick:()=>u(h.id)},h.id)}),d.jsx(A.Box,{gridColumn:"1 / -1",justifyContent:"center",children:d.jsx(A.AnimatedElement,{animation:{name:"fade"},children:s&&d.jsx(A.Text,{align:"center",color:"grey11",sx:{marginBlock:8},children:"Loading more items ..."})})})]})}function DH(e){const{children:t,scrollAreaRef:n,onScrollToBottom:r}=e,i=16,o=4,a="250px",s=`calc((100% - ${i*(o-1)}px) / ${o})`;return d.jsx(A.ScrollArea,{"aria-label":"Media list",ref:n,style:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(max(${a}, ${s}), 1fr))`,gridTemplateRows:"1fr 1fr 1fr ",gap:i,padding:2,paddingBottom:16,position:"relative"},onScrollToBottom:r,threshold:500,children:t})}function UH(e){const{children:t,hasSelectedMedia:n}=e;return d.jsx(A.Box,{overflow:"hidden",gridColumn:"2 / -1",gridRow:"1 / -1",children:d.jsx(A.ScrollArea,{style:{display:"grid",height:"100%"},children:d.jsx(A.Box,{flexGrow:1,borderRadius:{topRight:8,topLeft:8},borderStyle:n?"solid":"dashed",border:{top:!0,right:!0,left:!0,bottom:!1},minWidth:0,children:t})})})}function BH(e){const{onFilesUpload:t,isUploading:n,isInitialLoad:r=!1}=e,i=r||n;return d.jsxs(A.Box,{flexDirection:"column",justifyContent:"center",alignItems:"center",padding:16,gap:16,width:"100%",children:[d.jsx(A.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),d.jsx(A.Box,{flexDirection:"column",gap:4,children:d.jsxs(A.Text,{align:"center",children:["Select or"," ",d.jsx(A.FileUploadButton,{disabled:i,onFilesSelected:t,renderButton:o=>d.jsx(A.Tooltip,{title:$d.warning.uploadWhileUploading.title,content:$d.warning.uploadWhileUploading.description,visible:n,children:d.jsx(A.Box,{display:"inline-flex",as:"span",children:d.jsx(A.Button,{disabled:i,onClick:o,invisible:!0,children:"upload"})})})})," ","media."]})}),d.jsx(A.FileUploadButton,{disabled:i,onFilesSelected:t,color:"grey",children:"Upload media"})]})}function PH(e){const{count:t}=e;return d.jsxs(A.Text,{variant:"bold",children:[t," item",t==1?"":"s"]})}function H2e(e){const{actionContainer:t}=e;return d.jsx(LH,{sidePane:d.jsx(J2e,{}),mediaActions:d.jsx(G2e,{actionContainer:t}),mediaToolbar:d.jsx(A.Skeleton,{color:"grey5",borderRadius:12,children:d.jsx(PH,{count:888})}),mediaList:d.jsx(Y2e,{})})}function Y2e(){return d.jsx(DH,{children:_t.range(1,24).map(e=>d.jsx(WH,{},e))})}function G2e(e){const{actionContainer:t}=e;return d.jsx(FH,{actionContainer:t,children:d.jsxs(A.Box,{width:"100%",gap:16,children:[d.jsx(A.Box,{width:"100%",flexDirection:"column",children:d.jsx(A.FormSearchInput,{placeholder:"Search",maxLength:200,value:"",disabled:!0,onValueChange:()=>{}})}),d.jsx(A.FileUploadButton,{disabled:!0,onFilesSelected:()=>{},startIcon:"cloudUpload",color:t?"purple":"grey",size:"large",children:"Upload media"})]})})}function J2e(){return d.jsx(UH,{hasSelectedMedia:!1,children:d.jsx(BH,{onFilesUpload:()=>{},isUploading:!1,isInitialLoad:!0})})}function WH(){return d.jsx(A.Card,{variant:"outlined",padding:16,children:d.jsxs(A.CardContent,{gap:0,children:[d.jsx(A.Skeleton,{height:185,width:"100%"}),d.jsx(A.Skeleton,{height:16,width:"100%",sx:{marginTop:12}}),d.jsx(A.Skeleton,{height:10,width:100,sx:{marginTop:8}}),d.jsx(A.Skeleton,{height:1,width:"100%",sx:{marginTop:20,marginBottom:16}}),d.jsxs(A.Box,{flexDirection:"row",gap:8,children:[d.jsx(A.Skeleton,{height:24,width:54}),d.jsx(A.Skeleton,{height:24,width:45}),d.jsx(A.Skeleton,{height:24,width:62})]})]})})}const NH=I.createContext({showToast:()=>{}});function Z2e(e){const{children:t}=e,[n,r]=I.useState({title:"",seconds:5}),[i,o]=I.useState(!1),{title:a,action:s,seconds:l=1,icon:c="check"}=n,u=I.useMemo(()=>({showToast:f=>{r({seconds:l,...f}),o(!0)}}),[l]);return d.jsxs(d.Fragment,{children:[d.jsx(X2e,{}),d.jsx(A.Toast,{anchor:d.jsx(A.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:i,onOpenChange:o,title:a,action:s,seconds:l,icon:c}),d.jsx(NH.Provider,{value:u,children:t})]})}function KH(){return I.useContext(NH)}function X2e(){const{revalidateMedia:e,isMediaCacheInvalid:t}=Et(),[n,r]=I.useState(t);return ze.useOnChange(t,r),d.jsx(A.Toast,{anchor:d.jsx(A.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:n,title:"There have been changes to your media library",action:{title:"Update",onClick:e},cancel:{onClick:()=>r(!1)}})}function ku(){const{media:e}=Et(),t=_l();return e.filter(({id:n})=>t.isSelected(n))}function eDe(){const[e,t]=I.useState(!1),n=ku(),r=_l(),i=I.useMemo(()=>n.some(({id:a})=>a.startsWith("temp")),[n]),[o]=n;return o?r.selectedCount>1?d.jsxs(A.Box,{gap:8,alignItems:"center",children:[d.jsxs(A.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:[r.selectedCount," media selected"]}),d.jsx(A.Tooltip,{content:"Open all selected media in new tabs",children:d.jsx(A.IconButton,{icon:"openInFull",variant:"solid",size:"small",onClick:()=>n.forEach(a=>window.open(a.url,"_blank"))})}),d.jsx(A.Tooltip,{content:"Remove selected media",children:d.jsx(A.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),d.jsx(NL,{open:e,onOpenChange:t,media:n})]}):d.jsxs(A.Box,{gap:8,alignItems:"center",children:[d.jsx(A.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:o.filename}),d.jsxs(A.Box,{gap:8,children:[d.jsx(A.Tooltip,{content:"Open media in new tab",children:d.jsx(A.IconButton,{icon:"openInFull",variant:"solid",size:"small",hiddenLabel:"Open media in new tab",onClick:()=>window.open(o.url,"_blank"),disabled:i})}),d.jsx(A.Tooltip,{content:"Copy media URL",children:d.jsx(A.IconButton,{icon:"link",variant:"solid",size:"small",hiddenLabel:"Copy media URL",onClick:()=>navigator.clipboard.writeText(o.url),disabled:i})}),d.jsx(A.Tooltip,{content:"Remove media",children:d.jsx(A.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),d.jsx(NL,{open:e,onOpenChange:t,media:o})]})]}):null}function NL(e){const{open:t,onOpenChange:n,media:r}=e,i=we(),{showAlert:o}=A.useAlert(),{deleteMedia:a}=Et(),s=_l(),l=EH(),[c,u]=I.useState(!1),f=Array.isArray(r),p=f?"these items":"this item";function h(){u(!0);const g=s.getSelectionState().selectedIds;nDe({ids:g,config:i}).then(()=>{n(!1),a(g),s.clearSelection(),l()}).catch(()=>{n(!1),o({title:"Error",subtitle:`Something went wrong when removing ${p}.`})}).finally(()=>{u(!1)})}return d.jsxs(A.Dialog,{onOpenChange:n,open:t,size:"small",children:[d.jsx(A.DialogHeader,{icon:"alert",title:`Remove ${p} from your media library?`}),d.jsx(A.DialogDescription,{asChild:!0,children:d.jsx(A.DialogContent,{children:d.jsxs(A.Box,{padding:16,flexDirection:"column",children:[d.jsxs(A.Text,{children:["You are about to delete ",p,":  ",!f&&d.jsx("b",{children:r.filename})]}),f&&d.jsx(tDe,{media:r})]})})}),d.jsxs(A.DialogActions,{children:[d.jsx(A.DialogCancelButton,{}),d.jsxs(A.DialogActionButton,{onClick:h,color:"tomato",loading:c,children:["Yes, I want to remove ",p]})]})]})}const DS=15;function tDe(e){const{media:t}=e,n=t.slice(0,DS),r=t.length>DS,i=r?t.length-DS:0,o=Zn.pluralize(i,"item");return d.jsxs(A.UnorderedList,{density:"compact",sx:{marginTop:8},children:[n.map((a,s)=>d.jsx(A.ListItem,{children:d.jsx("b",{children:a.filename})},s)),r&&d.jsxs(A.ListItem,{children:["And ",d.jsx("b",{children:i})," more ",o,"..."]})]})}function nDe(e){const{ids:t,config:n}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");if(t.length===0)throw new Error("No ids provided during media deletion");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;if(t.length===1){const[a]=t;return se.request(new URL(`assets/${a}`,r),{headers:{repository:i},method:"DELETE",credentials:se.getRequestCredentials(o),okType:$.unknown()})}return se.request(new URL("assets/bulk-delete",r),{headers:{repository:i},method:"POST",credentials:se.getRequestCredentials(o),okType:$.unknown(),body:{ids:t}})}const Is=2e3,hp="__MAIN_THUMBNAIL__";function sx(e,t,n){const r=e.name===hp?void 0:e.name;let i;return t?Qi.isDefined(n)?i=[n.width,n.height]:Qi.isDefined(e.width)||Qi.isDefined(e.height)?i=[e.width??void 0,e.height??void 0]:i=[t.origin.width,t.origin.height]:i=void 0,[r,i?`${i[0]??"auto"}×${i[1]??"auto"}px`:void 0]}function rDe(e){var t,n;return[{...(t=e.config)==null?void 0:t.constraint,name:hp}].concat(((n=e.config)==null?void 0:n.thumbnails)??[])}function iDe(e,t){var a,s;const{__TYPE__:n,thumbnails:r,...i}=t,o=(s=(a=e.config)==null?void 0:a.thumbnails)==null?void 0:s.map(({name:l})=>r==null?void 0:r[l]);return[i,...o??[]]}function oDe(e,t,n,r){const i=r.length===0?void 0:r;return e===hp||!fe.isImageContent(t)?{...t,alt:i}:{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}}function aDe(e,t){const{width:n,height:r}=t??{};return n&&r?[n,r]:n?[n,Math.round(e.height*(n/e.width))]:r?[Math.round(e.width*(r/e.height)),r]:[e.width,e.height]}function sDe(e,t,n,r,i){if(pDe(e)==="svg")return e;const o=new URL(e);if(i){const{x:a,y:s,width:l,height:c}=t,u=[...o.searchParams.entries(),["rect",[a,s,l,c].join(",")],["w",n],["h",r]];o.search=u.map(f=>f.join("=")).join("&")}return o.toString()}function lF(e,t){const n=new URL(e.split("?")[0]??e);return t!=null&&t.width&&n.searchParams.set("w",t.width.toString()),t!=null&&t.height&&n.searchParams.set("h",t.height.toString()),(t!=null&&t.width||!(t!=null&&t.height))&&n.searchParams.set("dpr",Math.max(1,Math.min(window.devicePixelRatio,3)).toString()),t!=null&&t.width&&(t!=null&&t.height)&&n.searchParams.set("fit","max"),n.searchParams.set("auto","compress,format"),n.toString()}function lDe(e){return lF(e,{width:300})}function qH(e){return lF(e,{width:800,height:800})}function cDe(e){return e!=null&&e.url?qH(e.url):void 0}function uDe(e,t,n,r){var s,l,c,u,f;if(!n||e===hp){const p=(s=t.config)==null?void 0:s.thumbnails,h=p&&Object.fromEntries(p.map(m=>[m.name,Kg(r,m)]));return{__TYPE__:"ImageContent",...Kg(r,(l=t.config)==null?void 0:l.constraint),thumbnails:h}}const i=(u=(c=t.config)==null?void 0:c.thumbnails)==null?void 0:u.find(p=>p.name===e);if(!i)return n;const o=(f=n.thumbnails)==null?void 0:f[e],a=Kg(r,i);return a.url===(o==null?void 0:o.url)?n:{...n,thumbnails:Nd.mapValues(n.thumbnails??{},(p,h)=>h===e?a:p)}}function dDe(e){return"kind"in e&&"extension"in e}function Kg(e,t){const{width:n,height:r,rect:i}=fDe({...e,width:(e==null?void 0:e.width)??Is,height:(e==null?void 0:e.height)??Is},t),o=!!(t!=null&&t.width||t!=null&&t.height);return{provider:"imgix",url:sDe(e.url,i,n,r,o),alt:e.alt,...dDe(e)?{credits:e.credits}:{},origin:{id:e.id,url:e.url,width:e.width??Is,height:e.height??Is},width:n,height:r,edit:{background:"transparent",zoom:1,crop:{x:i.x,y:i.y}}}}function fDe(e,t){const[n,r]=aDe(e,t),i=Math.max(n/e.width,r/e.height),o=Math.round((e.width-n/i)/2),a=Math.round((e.height-r/i)/2),s=Math.round(n/i),l=Math.round(r/i);return{width:n,height:r,rect:{x:o,y:a,width:s,height:l}}}function pDe(e){const{pathname:t}=new URL(e),n=t.lastIndexOf(".");if(n!==-1)return t.substring(n).slice(1).toLowerCase()}function hDe(e){if(!e)return"";const{filename:t,extension:n}=e;return!n||!t.endsWith(`.${n}`)?t:t.slice(0,-n.length-1)}function ADe(){var o;const e=ku(),{uploadingFiles:t}=Et(),[n]=e;if(!n)return null;if(e.length===2)return d.jsx(US,{children:e.map((a,s)=>d.jsx("div",{style:{position:"absolute",transform:s===0?"translateX(25%) rotate(15deg) ":"translateX(-25%) rotate(-15deg) "},children:d.jsx(KL,{media:a})},a.id))});if(e.length>2)return d.jsx(US,{children:e.slice(-4).map((a,s)=>d.jsx("div",{style:{position:"absolute",paddingRight:s*16},children:d.jsx(KL,{media:a})},a.id))});const r=(o=t.find(a=>a.id===n.id))==null?void 0:o.status,i=n.kind.startsWith("image");return d.jsx(A.Box,{flexDirection:"column",children:d.jsx(A.CheckerBoard,{children:d.jsx(US,{uploadStatus:r,hasImage:i,children:i?d.jsx(A.Image,{src:n.url,alt:n.alt,sizing:"contain"}):d.jsx(A.MediaCardPlaceholder,{kind:n.kind,filename:n.filename})})})})}function US(e){const{children:t,uploadStatus:n,hasImage:r}=e;return d.jsxs(A.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:200,width:"100%",backgroundColor:r?"transparent":"purple2",children:[t,n&&d.jsx(mDe,{uploadStatus:n})]})}function mDe(e){const{uploadStatus:t}=e,{value:n,color:r,height:i,transition:o}=gDe(t);return d.jsx(A.Box,{position:"absolute",backgroundColor:"greyAlpha1",width:"100%",height:"100%",padding:{inline:16},justifyContent:"end",flexDirection:"column",children:d.jsx(A.ProgressBar,{value:n,color:r,height:i,transition:o})})}function gDe(e){switch(e){case"idle":return{value:0,height:"collapsed",color:"grey4"};case"uploading":return{value:90,transition:"slow",color:"purple9"};case"success":return{value:100,height:"collapsed",color:"purple9"};case"error":return{value:100,color:"tomato11"}}}function KL(e){const{media:t}=e;return d.jsx(A.Box,{width:111,height:152,children:t.kind==="image"?d.jsx(A.Image,{borderRadius:8,src:lF(t.url,{width:111,height:152}),alt:t.alt,sizing:"cover"}):d.jsx(A.MediaCardPlaceholder,{kind:t.kind,filename:t.filename})})}function vDe(e){const t=e.length,n={},r=[];return e.forEach(o=>{o.tags.forEach(a=>{n[a.id]||(n[a.id]=0,r.push(a)),n[a.id]++})}),r.filter(o=>n[o.id]===t)}function VH(e){const{tags:t,toggleAssetTag:n,getTagsLabel:r}=e,{setTagManagerOpen:i}=Et(),{showToast:o}=KH(),{showAlert:a}=A.useAlert(),[s,l]=I.useState("");async function c(u,f){l("");try{await n(u,f),o({title:"Media tags were updated",seconds:3})}catch{a({title:"Error",subtitle:"Something went wrong when updating media tags"})}}return d.jsxs(A.Box,{flexDirection:"column",children:[d.jsxs(A.Box,{justifyContent:"space-between",children:[d.jsx(A.Text,{color:"grey12",variant:"bold",children:r()}),d.jsx(A.Button,{startIcon:"edit",invisible:!0,color:"dark",onClick:()=>i(!0),children:"Manage tags"})]}),d.jsxs(A.ComboBox,{sx:{marginTop:4,marginBottom:8},children:[d.jsx(yDe,{searchTerm:s,setSearchTerm:l}),d.jsx(A.ComboBoxContent,{children:d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:d.jsx(I.Suspense,{fallback:d.jsx(A.Box,{padding:8,flexDirection:"column",gap:8,children:_t.range(1,6).map(u=>d.jsx(A.Skeleton,{height:24,width:85},u))}),children:d.jsx(bDe,{searchTerm:s,assignedTags:t,onToggleAssetTag:c})})})})]}),d.jsx(A.Box,{flexDirection:"column",alignItems:"flex-start",gap:8,children:t.map(u=>d.jsx(A.Badge,{title:u.name,size:"medium",color:"purple",selected:!0,onClose:()=>c(u,"remove")},u.id))})]})}function yDe(e){const{searchTerm:t,setSearchTerm:n}=e,r=I.useRef(null),{openMediaSection:i,setOpenMediaSection:o}=Et();return I.useEffect(()=>{var a;i==="tags"&&((a=r.current)==null||a.focus(),o(void 0))},[i,o]),d.jsx(A.ComboBoxInput,{value:t,onValueChange:n,placeholder:"Add or create a new tag",ref:r})}function bDe(e){const{searchTerm:t,assignedTags:n,onToggleAssetTag:r}=e,[i]=ku(),o=we(),{showAlert:a}=A.useAlert(),{tags:s}=Gm(),l=I.useMemo(()=>{const p=t.toLowerCase();return s.filter(h=>h.name.toLowerCase().includes(p))},[s,t]),u=aF.safeParse(t).success&&s.every(p=>p.name!==t);async function f(){if(!t||!i)return;let p;try{p=await CDe({name:t,config:o}),Jm(h=>[p,...h])}catch{a({title:"Error",subtitle:`Something went wrong when creating the tag ${t}`});return}await r(p,"add")}return i?d.jsxs(d.Fragment,{children:[!l.length&&d.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),l.map((p,h)=>d.jsx(A.ComboBoxItem,{value:p.id,onCheckedChange:m=>r(p,m?"add":"remove"),checked:n.some(m=>m.id===p.id),children:d.jsx(A.Badge,{title:p.name,color:"purple",size:"medium",sx:{marginInline:8,marginBottom:h===l.length-1?8:4,marginTop:h===0?8:4}})},p.id)),u&&d.jsx(A.ComboBoxItem,{value:"new",onCheckedChange:f,children:d.jsxs(A.Box,{padding:8,flexDirection:"row",alignItems:"center",gap:4,children:[d.jsx(A.Icon,{name:"add",size:"small",color:"grey11"}),d.jsxs(A.Text,{color:"grey12",children:['Create tag "',t,'"']})]})})]}):null}function CDe(e){const{name:t,config:n}=e;n.mediaLibrary||mt("mediaLibrary");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;return se.request(new URL("tags",r),{headers:{repository:i},body:{name:t},method:"POST",credentials:se.getRequestCredentials(o),okType:sF})}function SDe(e){const{selectedMedia:t}=e,n=we(),r=I.useMemo(()=>vDe(t),[t]);async function i(a,s){const l=s==="remove",c=t.map(f=>f.id);let u=[];wc(f=>(u=f,f.map(p=>c.includes(p.id)?l?_De(p,a):xDe(p,a):p)));try{await wDe({tagId:a.id,assetIds:c,operation:l?"remove":"add",config:n});const f=t.length*(l?-1:1);Jm(p=>p.map(h=>h.id===a.id?{...h,count:h.count+f}:h))}catch(f){throw wc(()=>u),f}}function o(){const a=r.length;return a>1?`${a} tags in common`:a===1?"1 tag in common":"Common tags"}return d.jsx(VH,{tags:r,getTagsLabel:o,toggleAssetTag:i})}function wDe(e){const{tagId:t,assetIds:n,config:r,operation:i}=e;if(!r.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:o,repository:a,authStrategy:s}=r;return se.request(new URL(`tags/${t}/assets`,o),{headers:{repository:a},body:{assetIds:n},method:i==="add"?"POST":"DELETE",credentials:se.getRequestCredentials(s),okType:$.unknown()})}function xDe(e,t){return e.tags.some(({id:r})=>r===t.id)?e:{...e,tags:[...e.tags,t]}}function _De(e,t){const n=e.tags.filter(r=>r.id!==t.id);return{...e,tags:n}}function TDe(e){const{selectedMedia:t}=e,n=t.tags,r=we(),{updateMedia:i}=Et();async function o(s,l){const c=t.tags,u=l==="remove",f=u?c.filter(p=>p.id!==s.id):[...c,s];i(t.id,{tags:f});try{await IDe({mediaId:t.id,config:r,tags:f.map(p=>p.id)}),Jm(p=>p.map(h=>h.id===s.id?{...h,count:h.count+(u?-1:1)}:h))}catch(p){throw i(t.id,{tags:c}),p}}function a(){const s=n.length;return s>1?`${s} tags`:s===1?"1 tag":"Tags"}return d.jsx(VH,{tags:n,getTagsLabel:a,toggleAssetTag:o})}function IDe(e){const{mediaId:t,config:n,tags:r}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=n;return se.request(new URL(`assets/${t}`,i),{headers:{repository:o},body:{tags:r},method:"PATCH",credentials:se.getRequestCredentials(a),okType:aC})}function EDe(){const[e,t]=I.useState("description");if(ku().length!==1)return d.jsx(MDe,{});const r=e==="description",i=e==="more-info";return d.jsxs(d.Fragment,{children:[d.jsxs(A.Box,{display:"grid",gridTemplateColumns:"1fr 1fr",backgroundColor:"grey2",border:!0,borderStyle:"solid",borderRadius:8,children:[d.jsx(A.Tab,{selected:r,outline:r,transparent:!0,onClick:()=>t("description"),children:"Description"}),d.jsx(A.Tab,{selected:i,outline:i,transparent:!0,onClick:()=>t("more-info"),children:"More info"})]}),d.jsx(RDe,{tab:e})]})}function RDe(e){const{tab:t}=e;switch(t){case"description":return d.jsx($De,{});case"more-info":return d.jsx(kDe,{})}}function $De(){const{title:e,alt:t,onBlur:n,isUploading:r,selectedMedia:i}=QH();if(!i)return null;const{extension:o}=i;return d.jsxs(A.Box,{flexDirection:"column",gap:16,children:[d.jsx(A.FormInput,{value:e.value,onValueChange:e.set,label:"Media title",placeholder:"Media title",onBlur:n,disabled:r,suffix:o?`.${o}`:void 0}),d.jsx(A.FormInputField,{label:"Alternative text",children:d.jsx(A.ContentEditable,{content:t.displayValue,contentVersion:t.version,readOnly:r,placeholder:"A short description of the media for accessibility",multiline:!0,decorations:{em:"highlight"},onChange:t.onChange,onBlur:n})}),!r&&d.jsx(TDe,{selectedMedia:i})]})}function kDe(){const{credits:e,notes:t,onBlur:n,isUploading:r,selectedMedia:i}=QH();if(!i)return null;const{uploader_id:o}=i,a=LDe(i);return d.jsxs(A.Box,{gap:8,flexDirection:"column",children:[a.map(s=>d.jsxs(A.Box,{gap:8,children:[d.jsxs(A.Text,{color:"grey11",children:[s.label,":"]}),d.jsx(A.Text,{children:s.value})]},s.label)),d.jsxs(A.Box,{gap:8,children:[d.jsx(A.Text,{color:"grey11",children:"Uploaded by:"}),d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(A.Text,{color:"grey11",children:"Error getting uploader"}),children:d.jsx(I.Suspense,{fallback:d.jsx(zH,{}),children:d.jsx(ODe,{uploaderId:o})})})]}),d.jsx(A.FormInputField,{label:"Copyright",children:d.jsx(A.ContentEditable,{content:e.displayValue,contentVersion:e.version,readOnly:r,placeholder:"Media copyrights or credits",multiline:!0,decorations:{em:"highlight"},onChange:e.onChange,onBlur:n})}),d.jsx(A.FormInputField,{label:"Private notes",children:d.jsx(A.ContentEditable,{content:t.displayValue,contentVersion:t.version,readOnly:r,placeholder:"Private notes are never shared publicly",multiline:!0,decorations:{em:"highlight"},onChange:t.onChange,onBlur:n})})]})}function ODe(e){const{uploaderId:t}=e,{uploadersById:n}=TH(),r=n.get(t??"ghost");return t&&!r?d.jsx(zH,{}):r?d.jsxs(d.Fragment,{children:[d.jsx(A.Avatar,{size:24,firstName:r.firstName,lastName:r.lastName,imageUrl:r.uploadedAvatar,hasBorder:!1}),d.jsx(A.Text,{children:r.name})]}):null}function zH(){return d.jsx(A.Skeleton,{width:128})}function MDe(){const e=ku(),{uploadingFiles:t}=Et(),n=I.useMemo(()=>t.some(r=>e.some(i=>r.id===i.id)&&r.status!=="success"),[e,t]);return d.jsx(d.Fragment,{children:!n&&d.jsx(SDe,{selectedMedia:e})})}function QH(){const[e]=ku(),{updateMedia:t,uploadingFiles:n}=Et(),r=we(),{showToast:i}=KH(),o=(e==null?void 0:e.id)??"",a=wg(e,"alt"),s=wg(e,"notes"),l=wg(e,"credits"),c=wg(e,"filename",hDe),u=n.some(p=>p.id===(e==null?void 0:e.id)&&p.status!=="success");async function f(){if(!e||!c.changed&&!a.changed&&!l.changed&&!s.changed)return;const{extension:p,search_highlight:h}=e,m=p?`${c.value}.${p}`:c.value;t(o,{filename:m,alt:a.value,credits:l.value,notes:s.value,search_highlight:{alt:a.changed||h==null?void 0:h.alt,credits:l.changed||h==null?void 0:h.credits,filename:c.changed||h==null?void 0:h.filename,notes:s.changed||h==null?void 0:h.notes}}),await jDe({id:o,config:r,metadata:{filename:m,alt:a.value,credits:l.value,notes:s.value}}),i({title:"Media metadata has been saved.",seconds:3})}return{selectedMedia:e,onBlur:f,isUploading:u,title:c,alt:a,credits:l,notes:s,extension:e==null?void 0:e.extension}}function wg(e,t,n=r=>r==null?void 0:r[t]){var c;const r=n(e)??"",[i,o]=I.useState(r);ze.useOnChange(e==null?void 0:e.id,()=>o(r));const a=(c=e==null?void 0:e.search_highlight)==null?void 0:c[t],s=!!a;function l(u){const{from:f,to:p}=u.state.selection;u.commands.selectAll(),u.commands.unsetAllMarks(),u.commands.setTextSelection({from:f,to:p}),o(u.getText())}return{value:i,set:o,displayValue:FDe(a??i)??"",onChange:l,version:`${(e==null?void 0:e.id)??""}_${s}`,changed:i!==r}}function FDe(e){return e==null?void 0:e.replace(/\n/g,"<br>")}function jDe(e){const{id:t,config:n,metadata:r}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=n;return se.request(new URL(`assets/${t}`,i),{headers:{repository:o},body:{...r},method:"PATCH",credentials:se.getRequestCredentials(a),okType:aC})}function LDe(e){const{width:t,height:n,last_modified:r,size:i,extension:o}=e,a=t&&n,s={label:"Date",value:u_.prettyPrintDate(new Date(r))},l={label:"File size",value:Zn.formatBytes(i)},c=a?{label:"Dimensions",value:`${t}×${n}`}:void 0,u=a?{label:"Ratio",value:((t??0)/(n??0)).toFixed(1)}:void 0,f=o?{label:"Extension",value:o.toUpperCase()}:void 0;return[s,l,c,u,f].filter(Qi.isDefined)}function DDe(){const{setTagManagerOpen:e}=Et(),[t,n]=I.useState("");return d.jsxs(A.Box,{gap:20,flexDirection:"column",height:"100%",children:[d.jsxs(A.Box,{alignItems:"center",gap:4,children:[d.jsx(A.IconButton,{icon:"close",size:"small",hasPadding:!1,onClick:()=>e(!1)}),d.jsx(A.Text,{variant:"bold",children:"Tags management"})]}),d.jsxs(A.Box,{gap:16,flexDirection:"column",height:"100%",children:[d.jsx(A.FormSearchInput,{value:t,onValueChange:n,placeholder:"Search for tags",endAdornment:!1,autoFocus:!0}),d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(WDe,{}),children:d.jsx(I.Suspense,{fallback:d.jsx(qDe,{}),children:d.jsx(UDe,{searchTerm:t})})})]})]})}function UDe(e){const{searchTerm:t}=e,{tags:n}=Gm(),r=n.filter(i=>i.name.toLowerCase().includes(t.toLowerCase()));return r.length===0?d.jsx(A.Text,{color:"grey9",variant:"small",children:"No tags found"}):d.jsx(A.AnimatedList,{ariaLabel:"Tags list",getItemKey:i=>i.id,gap:16,items:r,children:i=>d.jsx(BDe,{tag:i})})}function BDe(e){const{tag:t}=e,[n,r]=I.useState(!1),i=we(),{showAlert:o}=A.useAlert(),{showToast:a}=A.useToast(),{tags:s}=Gm();async function l(c){if(!aF.safeParse(c).success){o({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${c}". Tag name must be at least ${yH} and at maximum ${bH} characters long.`});return}if(s.some(p=>p.name===c)){o({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${c}". Tag with name "${c}" already exists.`});return}try{await KDe({id:t.id,name:c,config:i}),Jm(p=>p.map(h=>h.id===t.id?{...h,name:c}:h)),wc(p=>p.map(h=>{if(h.tags.findIndex(g=>g.id===t.id)!==-1){const g=h.tags.map(y=>y.id===t.id?{...y,name:c}:y);return{...h,tags:g}}return h})),a({title:`Tag "${t.name}" renamed to "${c}"`,seconds:3})}catch{o({title:"Error",subtitle:"Something went wrong when renaming the tag."})}}return d.jsxs(d.Fragment,{children:[d.jsxs(A.Box,{justifyContent:"space-between",children:[d.jsx(A.Badge,{title:t.name,color:"purple",size:"medium",onEdit:l}),d.jsx(A.Button,{invisible:!0,color:"tomato",textWeight:"normal",onClick:()=>r(!0),children:"Delete"})]}),d.jsx(PDe,{open:n,onOpenChange:r,tag:t})]})}function PDe(e){const{open:t,onOpenChange:n,tag:r}=e,{id:i,name:o,count:a}=r,s=we(),{showAlert:l}=A.useAlert(),[c,u]=I.useState(!1);async function f(){u(!0);try{await NDe({id:i,config:s}),Jm(p=>p.filter(h=>h.id!==i)),wc(p=>p.map(h=>{if(h.tags.findIndex(g=>g.id===i)!==-1){const g=h.tags.filter(y=>y.id!==i);return{...h,tags:g}}return h}))}catch{l({title:"Error",subtitle:"Something went wrong when removing the tag."})}finally{u(!1),n(!1)}}return d.jsxs(A.Dialog,{onOpenChange:n,open:t,size:"small",children:[d.jsx(A.DialogHeader,{title:`This tag is being used on ${a} media ${Zn.pluralize(a,"item")}`}),d.jsx(A.DialogDescription,{asChild:!0,children:d.jsx(A.DialogContent,{padding:16,children:d.jsxs(A.Text,{children:["You are about to delete the tag name ",d.jsx("b",{children:o}),"."," ",a>0&&`This tag is being used on ${a} media ${Zn.pluralize(a,"item")} and will be deleted from ${Zn.pluralize(a,"it","them")}.`]})})}),d.jsxs(A.DialogActions,{children:[d.jsx(A.DialogCancelButton,{}),d.jsx(A.DialogActionButton,{onClick:f,color:"tomato",loading:c,children:"Yes, I want to delete"})]})]})}function WDe(){const e=I.useContext(et.ErrorBoundaryContext);return d.jsx(A.Box,{flexDirection:"column",children:d.jsxs(A.BlankSlate,{children:[d.jsx(A.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed"}),d.jsx(A.BlankSlateTitle,{size:"big",children:"Oops!"}),d.jsx(A.BlankSlateDescription,{width:360,children:"We couldn't load your media tags."}),d.jsx(A.BlankSlateActions,{children:d.jsx(A.Button,{onClick:e==null?void 0:e.reset,size:"medium",children:"Try again"})})]})})}function NDe(e){const{id:t,config:n}=e;n.mediaLibrary||mt("mediaLibrary");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;return se.request(new URL(`tags/${t}`,r),{headers:{repository:i},method:"DELETE",credentials:se.getRequestCredentials(o),okType:$.unknown()})}function KDe(e){const{id:t,name:n,config:r}=e;r.mediaLibrary||mt("mediaLibrary");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=r;return se.request(new URL(`tags/${t}`,i),{headers:{repository:o},method:"PATCH",credentials:se.getRequestCredentials(a),body:{name:n},okType:$.unknown()})}function qDe(){return d.jsx(A.Box,{flexDirection:"column",gap:16,children:_t.range(1,6).map(e=>d.jsxs(A.Box,{justifyContent:"space-between",children:[d.jsx(A.Skeleton,{height:24,width:85}),d.jsx(A.Skeleton,{height:24,width:45})]},e))})}function VDe(){const e=ku(),{onFilesUpload:t,isUploading:n,tagManagerOpen:r}=Et();return e.length===0&&r===!1?d.jsx(BH,{onFilesUpload:t,isUploading:n}):d.jsx(A.Box,{flexDirection:"column",backgroundColor:"grey1",width:"100%",padding:16,gap:16,borderRadius:{topLeft:8,topRight:8},children:r?d.jsx(DDe,{}):d.jsxs(d.Fragment,{children:[d.jsx(eDe,{}),d.jsx(ADe,{}),d.jsx(EDe,{})]})})}function zDe(){const e=_l();return d.jsx(UH,{hasSelectedMedia:e.selectedCount!==0,children:d.jsx(VDe,{})})}const lx={all:{name:"All media",icon:"public"},image:{name:"Images",icon:"image"},video:{name:"Videos",icon:"videocam"},document:{name:"Documents",icon:"insertDriveFile"},audio:{name:"Audio files",icon:"musicNote"}},QDe=Object.entries(lx);function HDe(){const{assetType:e,initialAssetType:t,onFilterChange:n}=Et(),[r,i]=I.useState(e);ze.useOnChange(e,()=>{i(e)});const[o,a]=I.useState(!1);function s(p){a(!1),i(p),n({assetType:p})}const{icon:l,name:c}=lx[r],u=lx[t].name,f=t!=="all";return d.jsxs(A.DropdownMenu,{open:o,onOpenChange:a,children:[d.jsx(A.DropdownMenuTrigger,{disabled:f,children:d.jsx(YDe,{icon:l,isDropdownDisabled:f,buttonName:c,tooltipAssetTypeName:u})}),d.jsx(A.DropdownMenuContent,{minWidth:256,align:"start",childrenFocusScope:!0,children:d.jsx(d.Fragment,{children:QDe.filter(([p])=>p!==r).map(([p,{icon:h,name:m}])=>d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:h}),onSelect:()=>s(p),children:m},p))})})]})}const YDe=I.forwardRef(function(t,n){const{icon:r,isDropdownDisabled:i,buttonName:o,tooltipAssetTypeName:a,...s}=t;return d.jsx(A.Tooltip,{content:`You can only pick ${(a==null?void 0:a.toLocaleLowerCase())??"this type of media"}`,visible:i,children:d.jsx(A.Button,{startIcon:r,endIcon:"arrowDropDown",size:"small",color:"grey",disabled:i,ref:n,...s,children:o})})});function GDe(e){const{optimisticTagIds:t,setOptimisticTagIds:n}=e,{onFilterChange:r}=Et(),{tags:i}=Gm(),o=I.useMemo(()=>FX.groupBy(i,s=>s.id),[i]);function a(s){const l=t.filter(c=>c!==s.id);n(l),r({tagIds:l})}return d.jsx(d.Fragment,{children:t.map(s=>{var c;const l=(c=o.get(s))==null?void 0:c[0];return l?d.jsx(A.Badge,{title:l.name,size:"medium",color:"purple",onClose:()=>a(l),selected:!0},l.id):null})})}function JDe(){const{setTagManagerOpen:e,tagIds:t,onFilterChange:n}=Et(),[r,i]=I.useState(""),[o,a]=I.useState(!1),[s,l]=I.useState(t);ze.useOnChange(JSON.stringify(t),()=>{l(t)});function c(p){a(p),p||i("")}function u(p){const h=s.includes(p.id)?t.filter(m=>m!==p.id):[...t,p.id];l(h),n({tagIds:h}),a(!1)}function f(){a(!1),e(!0)}return d.jsxs(d.Fragment,{children:[d.jsxs(A.DropdownMenu,{open:o,onOpenChange:c,children:[d.jsx(A.DropdownMenuTrigger,{children:d.jsx(A.Button,{startIcon:"label",endIcon:"arrowDropDown",size:"small",color:"grey",children:"Tags"})}),d.jsx(A.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:d.jsxs(A.ComboBox,{variant:"attached",children:[d.jsx(A.ComboBoxInput,{value:r,onValueChange:i,placeholder:"Search for a tag",autoFocus:!0}),d.jsx(A.ComboBoxContent,{paddingBlock:4,children:d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:d.jsx(I.Suspense,{fallback:d.jsx(A.Box,{padding:8,flexDirection:"column",gap:8,children:_t.range(1,6).map(p=>d.jsx(A.Skeleton,{height:24,width:85},p))}),children:d.jsx(ZDe,{searchTerm:r,setSearchTerm:i,onTagToggle:u,optimisticTagIds:s})})})}),d.jsx(A.ComboboxAction,{children:d.jsx(A.Button,{invisible:!0,startIcon:"edit",textWeight:"normal",color:"dark",onClick:f,children:"Manage tags"})})]})})]}),s.length>0&&d.jsx(A.ErrorBoundary,{children:d.jsx(I.Suspense,{children:d.jsx(GDe,{optimisticTagIds:s,setOptimisticTagIds:l})})})]})}function ZDe(e){const{onTagToggle:t,searchTerm:n,optimisticTagIds:r}=e,{tags:i}=Gm(),o=I.useMemo(()=>{const a=n.toLowerCase();return i.filter(s=>s.name.toLowerCase().includes(a))},[i,n]);return d.jsxs(d.Fragment,{children:[!o.length&&d.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),o.map(a=>{const s=r.includes(a.id);return d.jsx(A.ComboBoxItem,{value:a.id,onCheckedChange:()=>t(a),checked:s,children:d.jsx(A.Badge,{title:a.name,color:"purple",sx:{marginLeft:8,marginBottom:4,marginTop:4},size:"medium"})},a.id)})]})}function XDe(){const{uploaderId:e,onFilterChange:t}=Et(),[n,r]=I.useState(""),[i,o]=I.useState(!1),[a,s]=I.useState();ze.useOnChange(e,()=>{e||s(void 0)});function l(u){o(u),u||r("")}function c(u){s(u),t({uploaderId:u==null?void 0:u.id}),o(!1)}return d.jsxs(A.DropdownMenu,{open:i,onOpenChange:l,children:[d.jsx(A.DropdownMenuTrigger,{children:d.jsx(A.Button,{startIcon:"people",renderStartIcon:u=>a?d.jsx(A.Avatar,{imageUrl:a==null?void 0:a.uploadedAvatar,firstName:a.firstName,lastName:a.lastName,size:16,hasBorder:!1}):u,endIcon:"arrowDropDown",size:"small",color:"grey",children:(a==null?void 0:a.name)??"All uploaders"})}),d.jsx(A.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:d.jsxs(A.ComboBox,{variant:"attached",children:[d.jsx(A.ComboBoxInput,{value:n,onValueChange:r,placeholder:"Search for uploaders",autoFocus:!0}),d.jsx(A.ComboBoxContent,{paddingBlock:4,children:d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting uploaders"}),children:d.jsx(I.Suspense,{fallback:d.jsx(tUe,{}),children:d.jsx(eUe,{searchTerm:n,setSearchTerm:r,onUploaderToggle:c,optimisticUploader:a})})})})]})})]})}function eUe(e){const{searchTerm:t,optimisticUploader:n,onUploaderToggle:r}=e,{uploaders:i}=TH(),o=I.useMemo(()=>{const a=t.toLowerCase();return _t.sort(i.filter(s=>{var l;return s.name.toLowerCase().includes(a)||((l=s.email)==null?void 0:l.toLowerCase().includes(a))}),s=>(n==null?void 0:n.id)===(s==null?void 0:s.id)?0:1)},[i,n,t]);return o.length?d.jsx(d.Fragment,{children:o.map(a=>{const s=a.id===(n==null?void 0:n.id);return d.jsx(A.ComboBoxItem,{value:a.id,onCheckedChange:()=>s?r():r(a),checked:s,children:d.jsxs(A.Box,{alignItems:"center",padding:{top:8,bottom:8,left:16,right:16},gap:8,children:[d.jsx(A.Avatar,{firstName:a.firstName,lastName:a.lastName,imageUrl:a.uploadedAvatar,hasBorder:!1}),d.jsxs(A.Box,{display:"flex",flexDirection:"column",children:[d.jsx(A.Text,{color:"grey12",variant:"normal",children:a.name}),a.email&&d.jsx(A.Text,{color:"grey10",variant:"small",children:a.email})]})]})},a.id)})}):d.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No uploaders found"})}function tUe(){return d.jsx(A.Box,{padding:8,flexDirection:"column",gap:8,children:_t.range(1,4).map(e=>d.jsx(A.Skeleton,{height:48,width:"full"},e))})}function nUe(){const{media:e,mediaTotal:t}=Et(),n=_l();return d.jsxs(A.Box,{alignItems:"center",gap:16,children:[n.isSelectAllEnabled&&d.jsx(A.Checkbox,{onCheckedChange:n.toggleSelectAll,checked:n.selectedCount>0,indeterminate:n.selectedCount!==t,onClick:r=>r.stopPropagation(),disabled:e.length===0}),e.length!==0&&d.jsx(PH,{count:t}),d.jsxs(A.Box,{gap:8,alignItems:"center",children:[d.jsx(A.Text,{children:"Filter:"}),d.jsx(HDe,{}),d.jsx(XDe,{}),d.jsx(JDe,{})]})]})}function HH(e){const{assetType:t,onSelectedChange:n,actionContainer:r}=e;return d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(jH,{}),children:d.jsx(I.Suspense,{fallback:d.jsx(H2e,{actionContainer:r}),children:d.jsx(gH,{children:d.jsx(B2e,{assetType:t,actionContainer:r,onSelectedChange:n,children:d.jsx(V2e,{children:d.jsx(rUe,{})})})})})})}function rUe(){const{media:e}=Et(),t=kH();return d.jsx(Z2e,{children:d.jsx(LH,{sidePane:t?void 0:d.jsx(zDe,{}),mediaActions:d.jsx(K2e,{}),mediaToolbar:d.jsx(nUe,{}),mediaList:e.length===0?d.jsx(W2e,{}):d.jsx(Q2e,{})})})}function iUe(e){const{href:t,tracking:n}=e;return d.jsx(A.Box,{justifyContent:"center",padding:{block:6},children:d.jsxs(A.Text,{href:t,variant:"smallBold",color:"grey11",onClick:()=>void n.track({event:"shared-onboarding:follow-tutorial",source:n.source}),children:["Or watch our in-depth course",d.jsx(A.Icon,{name:"playCircle",color:"grey11",size:"small",sx:{marginLeft:4}})]})})}function oUe(e){const{step:t,stepIndex:n,isOpen:r,onActionClick:i,onClose:o,contentRef:a}=e,[s,l]=I.useState(!1),[c,u]=I.useState(e.isStepComplete);I.useEffect(()=>{r&&u(e.isStepComplete)},[e.isStepComplete,r]);async function f(){if(r)try{l(!0),await i(c)}finally{l(!1)}}return d.jsxs(A.Dialog,{open:r,onOpenChange:o,size:"small",children:[d.jsx(A.DialogHeader,{title:"Onboarding"}),d.jsxs(A.DialogContent,{children:[d.jsx(A.ScrollArea,{children:d.jsxs(A.Box,{ref:a,as:"article",flexDirection:"column",padding:16,gap:16,children:[d.jsx(A.DialogDescription,{asChild:!0,children:d.jsxs("section",{children:[d.jsxs(A.Text,{sx:{marginBottom:4},color:"purple9",variant:"bold",children:["Step ",n+1]}),d.jsx(A.Text,{variant:"h3",children:t.title}),t.content]})}),t.videoUrl&&d.jsx(A.Video,{src:t.videoUrl,sizing:"contain",borderRadius:4,autoPlay:!0,loop:!0})]})}),d.jsxs(A.DialogActions,{children:[d.jsx(A.DialogCancelButton,{size:"medium",children:"Close"}),!t.defaultCompleted&&d.jsx(A.DialogActionButton,{size:"medium",onClick:f,loading:s,color:c?"darkGrey":"purple",children:c?"Undo step":"Complete step"})]})]})]})}function aUe(e){const{steps:t,completedSteps:n,onToggleStep:r,tracking:i,stepOverrides:o}=e,[a,s]=I.useState(!1),[l,c]=I.useState(t[0]),u=I.useRef(null);if(!l)return null;const f=t.findIndex(({id:y})=>y===l.id);function p(y){return n.includes(y.id)}function h(y){c(y),s(!0),i.track({event:"shared-onboarding:step-opened",stepId:y.id,stepTitle:y.title,source:i.source})}async function m(y=!1){var C;if(l&&(await r(l),!y)){(C=u.current)==null||C.animate([{opacity:0},{opacity:1}],{duration:400});const x=g();x?h(x):s(!1)}}function g(){let y=f+1;for(;y<t.length;){const C=t[y];if(C&&!p(C))return C;y++}}return d.jsxs(d.Fragment,{children:[d.jsx(oUe,{contentRef:u,isOpen:a,step:l,stepIndex:f,isStepComplete:p(l),onClose:()=>s(!1),onActionClick:m}),d.jsxs(A.DropdownMenu,{children:[d.jsx(A.DropdownMenuTrigger,{children:d.jsx(A.Button,{size:"large",color:"grey",sx:{width:"100%"},renderStartIcon:sUe,children:n.length>0?"Continue":"Start now"})}),d.jsxs(A.DropdownMenuContent,{side:"right",minWidth:256,collisionPadding:8,children:[d.jsx(A.DropdownMenuLabel,{children:d.jsx(A.Text,{variant:"small",color:"grey11",sx:{marginInline:8},children:"Progress"})}),t.map((y,C)=>{const x=p(y);return d.jsx(A.DropdownMenuItem,{onSelect:(o==null?void 0:o[y.id])??(()=>h(y)),description:y.description,completed:x,endAdornment:d.jsx(A.Icon,{name:"chevronRight",size:"small",color:"grey11"}),children:`${C+1} ${y.title}`},y.id)})]})]})]})}function sUe(){return d.jsx(A.Icon,{name:"arrowForward",size:"small",color:"grey11"})}function lUe(e){const{steps:t,completedSteps:n,tutorialLink:r,tracking:i,onToggleStep:o,onClose:a,stepOverrides:s}=e,l=n.length===t.length;return d.jsx(A.Card,{variant:l?"elevated":"animated-light",paddingBlock:16,onClose:a,children:d.jsxs(A.CardContent,{children:[d.jsxs("div",{children:[d.jsx(A.Text,{variant:"bold",children:`Build your first page in ${t.length.toString()} simple steps`}),d.jsx(A.Text,{color:"grey11",variant:"small",children:"Render a live page with content coming from Prismic."})]}),d.jsx(A.ProgressBar,{value:n.length,max:t.length,displayLabel:!0,getValueLabel:(c,u)=>`${c}/${u}`}),d.jsx(aUe,{steps:t,completedSteps:n,onToggleStep:o,tracking:i,stepOverrides:s}),r&&d.jsx(iUe,{href:r,tracking:i})]})})}function cUe(e){const{framework:t,projectName:n,starterId:r,repositoryName:i}=e,{frameworkNameLabel:o,createProjectCodeSnippet:a}=uUe(e),s=[{id:"createPrismicProject",title:"Create your Prismic project",description:"Create and set up your project",defaultCompleted:!0,content:d.jsx(A.Text,{children:"A Prismic project is a space for managing and organizing the content of your website."})},{id:"chooseLocale",title:"Select your main locale",description:"Choose your first locale",defaultCompleted:!!r,content:d.jsx(A.Text,{children:"Locales allow you to create and manage multilingual versions of your content within a single Prismic project."})},{id:"createProject",title:`Create a ${o}project`,description:"Create and set up your project",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1727768069/DEV_TOOLS/ONBOARDING_GUIDE/Pagebuilder_onboarding_step_3_puh6fx.mp4",content:d.jsxs(d.Fragment,{children:[d.jsx(A.Text,{sx:{marginBottom:16},children:"Now that you have a Prismic project to manage the content of your website, let's create the code project that will be querying your content."}),!!a&&d.jsx(Uv,{code:`${a} ${i??"<my-project>"}`,language:"bash"}),d.jsx(A.Text,{variant:"small",sx:{marginTop:16},children:"(example for Next.js below)"})]})},{id:"setupSliceMachine",title:"Set up & run Slice Machine",description:"Prepare the code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1727768069/DEV_TOOLS/ONBOARDING_GUIDE/page_builder_onboarding_step_4_yl8fb8.mp4",content:d.jsxs(d.Fragment,{children:[d.jsx(A.Text,{sx:{marginBottom:16},children:`Slice Machine is the Prismic tool for creating your content models.
69
+ Install it in your ${o}project by running these commands:`}),d.jsx(Uv,{code:`cd ${n??"<your project name>"}
70
+ npx @slicemachine/init@latest --repository ${i??"<my-project>"}`,language:"bash",title:"Terminal",showLineNumbers:!1})]})},{id:"createPageType",title:"Create a Page Type",description:"Build the structure of your page",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Create_page_type_xdn13j.mp4",content:d.jsx(A.Text,{children:"A page type is a base content structure editors will use to create pages in the Page Builder (Prismic's content creation UI). A page type can be reusable (e.g., for multiple blog posts) or single (e.g., for a one-time page like the homepage)."})},{id:"codePage",title:"Code Your Page Type",description:"Prepare code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Step2_code_your_page_jatiur.mp4",content:d.jsx(A.Text,{children:"Prepare your code to query the content from the Prismic API."})},{id:"createSlice",title:"Create a Slice",description:"Build a reusable website section",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918322/DEV_TOOLS/ONBOARDING_GUIDE/Step3_add_slice_qzmvxf.mp4",content:d.jsx(A.Text,{children:"Slices are website sections that can be reused on different pages with different content. Each slice has a code component automatically generated by Slice Machine. Start with a template and look at your code to see how it's structured."})},{id:"reviewAndPush",title:"Review and Push changes",description:"Enable editors to create content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/DevTools_Squad_push_changes_ovvmul.mp4",content:d.jsx(A.Text,{children:"Your page types and slices currently exist only in your local project. Push them to your repository to make them available for your content editors."})},{id:"createContent",title:"Create Content",description:"Publish a page to the Prismic API",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1732631905/DEV_TOOLS/ONBOARDING_GUIDE/step_9_create_content_y8m3m0.mp4",content:d.jsx(A.Text,{children:"In Prismic, content creation takes place in the Prismic Page Builder UI. Open the Page Builder and start creating your first page."})},{id:"renderPage",title:"Render Your Page",description:"View your page in the browser",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918321/DEV_TOOLS/ONBOARDING_GUIDE/Step_6_Render_Page_tnauh9.mp4",content:d.jsxs(A.Text,{children:["Now that your content is published, you can run your project in your terminal and visit the page on your local server (e.g.,"," ",d.jsx(A.Text,{component:"code",children:"localhost:3000/example-page"}),"). Your content should now be visible!"]})}],l={next:"https://prismic.dev/course/next",nuxt:"https://prismic.dev/course/nuxt",sveltekit:"https://prismic.dev/course/sveltekit"};return{steps:s,defaultCompletedStepIds:s.flatMap(c=>c.defaultCompleted?[c.id]:[]),tutorialLink:t?l[t]:void 0}}function uUe(e){const{framework:t}=e;if(!t||t==="other")return{frameworkNameLabel:"",createProjectCodeSnippet:""};const n=mU[t];return{frameworkNameLabel:n?`${n} `:"",createProjectCodeSnippet:gU[t]}}const BS=3e3,qL=400;function dUe(e){const{onboardingState:t,tracking:n,onToggleStep:r,onToggleGuide:i,fallback:o=null,stepOverrides:a,repositoryName:s,projectName:l}=e,{context:c,isDismissed:u}=t,{steps:f,defaultCompletedStepIds:p,tutorialLink:h}=cUe({...c,repositoryName:s,projectName:l}),m=x(t.completedSteps),g=fUe(y,qL);if(ze.useOnChange(u,()=>!u&&g.reset()),c.framework==="other")return d.jsx(d.Fragment,{children:o});function y(){i()}async function C(b){const v=await r(b.id);v.includes(b.id)&&n.track({event:"shared-onboarding:step-completed",stepId:b.id,stepTitle:b.title,source:n.source}),x(v).length===f.length&&(n.track({event:"shared-onboarding:completed",source:n.source}),g.start())}function x(b){const v=f.map(({id:S})=>S);return Array.from(new Set([...b.filter(S=>v.includes(S)),...p]))}return u?null:d.jsx(A.AnimatedElement,{enterDuration:0,exitDuration:qL,children:g.status!=="hidden"&&d.jsxs("div",{ref:g.refs.container,style:{position:"relative"},children:[d.jsx(lUe,{steps:f,completedSteps:m,tutorialLink:h,tracking:n,onToggleStep:C,onClose:g.status!=="animating"?y:void 0,stepOverrides:a}),d.jsx("div",{ref:g.refs.cannon,style:{position:"absolute",bottom:0,left:0}})]})})}function fUe(e,t=400){const n=LX.useConfetti({config:{duration:BS}}),[r,i]=I.useState("visible"),o=I.useRef(!1),a=I.useCallback(()=>{i("animating"),setTimeout(()=>i("hidden"),BS-t),o.current||(setTimeout(e,BS),o.current=!0)},[e,t]),s=()=>{n.throwConfetti(),a()},l=I.useCallback(()=>{i("visible"),o.current=!1},[]);return{refs:{container:n.confettiContainerRef,cannon:n.confettiCannonRef},status:r,start:s,reset:l}}function YH(e){const{type:t,value:n}=e,r=t===ia?Mh.max:Fh.max;return d.jsx(A.Box,{alignItems:"center",children:d.jsx(A.Tooltip,{title:pUe[t],content:mUe[t],stableMount:!0,children:d.jsx(A.Badge,{title:`${n.length} characters`,size:"medium",color:n.length>r?"tomato":"green",sx:{alignSelf:"center"}})})})}const pUe={[ia]:"Meta title length",[ps]:"Meta description length"},hUe=`${Mh.min}-${Mh.max}`,AUe=`${Fh.min}-${Fh.max}`,mUe={[ia]:`For optimal mobile SEO, keep your meta title within ${hUe} characters to prevent it from being cut off in search results.`,[ps]:`To ensure your meta description isn’t truncated in mobile search results, aim for ${AUe} characters. This helps improve visibility and click-through rates.`};function GH(e){const{title:t,description:n}=e;return d.jsx(A.Card,{paddingBlock:8,paddingInline:8,variant:"highlighted",children:d.jsxs(A.CardContent,{gap:4,children:[d.jsx(A.Text,{color:"indigo11",variant:"h4",noSelect:!0,children:Zn.overflow(t,Mh.max)}),d.jsx(A.Text,{color:"green11",noSelect:!0,children:"https://www.yourdomain.com/"}),d.jsx(A.Text,{variant:"small",color:"grey11",noSelect:!0,children:Zn.overflow(n,Fh.max)})]})})}const JH=I.createContext({editedUID:{current:!1},onEditUID:()=>{}});function ZH(e){return Object.values(e.json).some(t=>{var n;return((n=t.uid)==null?void 0:n.type)==="UID"})}function gUe(e){const{content:t,customType:n}=e;return ZH(n)&&!t.uid}function XH(e){const{documentId:t,documentsWithUid:n,uid:r}=e;return n.filter(i=>t!==i.id&&yUe({document:i,uid:r})&&vUe({...e,document:i}))}function vUe(e){const{customTypeId:t,languageId:n,document:r}=e,i=t===r.custom_type_id,o=n===r.language.id;return i&&o}function yUe(e){const{document:t,uid:n}=e,r=t.versions.filter(i=>i.uid===n);return r.length===0?!0:r.some(i=>i.status!=="archived")}const qs=I.createContext(void 0);function bUe(e){const{customTypeFormat:t,children:n}=e,r=I.useMemo(()=>({customTypeFormat:t,isInSlice:!1,isInGroup:!1,isInRepeatable:!1}),[t]);return d.jsx(qs.Provider,{value:r,children:n})}function CUe(e){const{children:t}=e,n=I.useContext(qs),r=I.useMemo(()=>n&&{...n,isInSlice:!0},[n]);return d.jsx(qs.Provider,{value:r,children:t})}function SUe(e){const{children:t}=e,n=I.useContext(qs),r=I.useMemo(()=>n&&{...n,isInGroup:!0},[n]);return d.jsx(qs.Provider,{value:r,children:t})}function wUe(e){const{children:t}=e,n=I.useContext(qs),r=I.useMemo(()=>n&&{...n,isInRepeatable:!0},[n]);return d.jsx(qs.Provider,{value:r,children:t})}function xUe(){return I.useContext(qs)}function sC(e,t){return`${e}___${t}`}const eY=I.createContext({ids:[],isSelected:()=>!1,update:()=>{}});function lC(){return I.useContext(eY)}function _r(e){var t;return(t=e.config)!=null&&t.label?e.config.label:e.type!=="Boolean"&&e.type!=="Separator"&&e.type!=="Table"&&e.fieldset?e.fieldset:e.type}const cF="...";function _Ue(e,t,n=cF){var r,i;return(t?(r=e.config)==null?void 0:r.placeholder_true:(i=e.config)==null?void 0:i.placeholder_false)||n}function Ou(e,t=cF){var n;return((n=e.config)==null?void 0:n.placeholder)||t}function TUe(e){var s;const{content:t,field:n,id:r,readOnly:i,onContentChange:o}=e,a=(t==null?void 0:t.value)??((s=n.config)==null?void 0:s.default_value)??!1;return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"biToggle"}),d.jsx(A.FieldLabel,{htmlFor:r,children:_r(n)}),d.jsxs(A.FieldControl,{children:[d.jsx(A.Box,{padding:4,alignItems:"center",children:d.jsx(A.Text,{children:_Ue(n,a)})}),d.jsx(A.Switch,{id:r,sx:{alignSelf:"center",marginLeft:"auto",marginRight:12},checked:a,onCheckedChange:l=>{i||o(IUe(l))}})]})]})}function IUe(e){return{__TYPE__:"BooleanContent",value:e}}function EUe(e){const{id:t,field:n,content:r,onContentChange:i}=e;return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"colorLens"}),d.jsx(A.FieldLabel,{id:t,children:_r(n)}),d.jsx(A.FieldControl,{children:d.jsx(A.Box,{padding:{left:4},alignItems:"center",children:d.jsx(A.ColorInput,{onValueChange:o=>i(RUe(o)),value:r==null?void 0:r.value,"aria-labelledby":t,placeholder:Ou(n)})})})]})}function RUe(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Color",value:e}}function $Ue(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=i!=null&&i.value?u_.dateFromISOString(i.value):void 0;return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"dateRange"}),d.jsx(A.FieldLabel,{id:t,children:_r(r)}),d.jsx(A.FieldControl,{children:d.jsx(A.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:d.jsx(A.DateInput,{mode:"date","aria-labelledby":t,disabled:n,value:a,onValueChange:s=>o(kUe(s))})})})]})}function kUe(e){if(e)return{__TYPE__:"FieldContent",type:"Date",value:OUe(e)}}function OUe(e){const t=`${e.getFullYear()}`.padStart(4,"0"),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0");return`${t}-${n}-${r}`}const Tl=I.forwardRef(function(t,n){const{padding:r=tY,...i}=t;return d.jsx(A.TextInput,{...i,padding:r,ref:n,sx:{...t.sx,alignSelf:"stretch"}})}),tY={input:{inline:4},adornment:{inline:12}},MUe=({provider:e})=>FUe[e.toLowerCase()]??d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("g",{clipPath:"url(#clip0_6524_22412)",children:d.jsx("path",{d:"M7.99992 1.33333C4.31992 1.33333 1.33325 4.32 1.33325 8C1.33325 11.68 4.31992 14.6667 7.99992 14.6667C11.6799 14.6667 14.6666 11.68 14.6666 8C14.6666 4.32 11.6799 1.33333 7.99992 1.33333ZM2.66659 8C2.66659 7.59333 2.71992 7.19333 2.80659 6.81333L5.99325 10V10.6667C5.99325 11.4 6.59325 12 7.32658 12V13.2867C4.70658 12.9533 2.66659 10.7133 2.66659 8ZM11.9266 11.6C11.7533 11.06 11.2599 10.6667 10.6599 10.6667H9.99325V8.66667C9.99325 8.3 9.69325 8 9.32658 8H5.32658V6.66667H6.65992C7.02658 6.66667 7.32658 6.36667 7.32658 6V4.66667H8.65992C9.39325 4.66667 9.99325 4.06667 9.99325 3.33333V3.06C11.9466 3.84667 13.3333 5.76667 13.3333 8C13.3333 9.38667 12.7933 10.6533 11.9266 11.6Z",fill:"#6F6E77"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6524_22412",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),FUe={codepen:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("g",{clipPath:"url(#clip0_6523_22409)",children:d.jsx("path",{d:"M15.9879 5.44292C15.9843 5.42352 15.981 5.40413 15.9759 5.38517C15.9726 5.37375 15.9688 5.36298 15.9651 5.35177C15.9597 5.33497 15.9541 5.31816 15.9474 5.30179C15.9427 5.29037 15.9373 5.27938 15.9321 5.26839C15.9248 5.25288 15.9173 5.23758 15.9086 5.22271C15.9026 5.21172 15.8957 5.20138 15.889 5.19082C15.8798 5.1766 15.8703 5.1626 15.8599 5.14902C15.8524 5.13889 15.8446 5.1292 15.8365 5.1195C15.8257 5.10657 15.8141 5.09429 15.8024 5.08223C15.7934 5.07318 15.7843 5.06413 15.7748 5.05529C15.7623 5.04387 15.7494 5.0331 15.7358 5.02276C15.7255 5.01479 15.7154 5.0066 15.7046 4.99927C15.7007 4.99647 15.6973 4.99324 15.6932 4.99065L8.38116 0.115543C8.15039 -0.0385144 7.84939 -0.0385144 7.61863 0.115543L0.306176 4.99044C0.302082 4.99302 0.29885 4.99626 0.294756 4.99906C0.283983 5.0066 0.273856 5.01457 0.263514 5.02254C0.250155 5.0331 0.237011 5.04387 0.224515 5.05486C0.215034 5.06348 0.205985 5.07253 0.19715 5.0818C0.185084 5.09386 0.17388 5.10614 0.162892 5.11907C0.154704 5.12877 0.146947 5.13846 0.139406 5.14924C0.129064 5.16281 0.119583 5.1766 0.110318 5.19104C0.103639 5.20159 0.0969593 5.21194 0.0907108 5.22293C0.0820922 5.23779 0.0745509 5.25309 0.0674405 5.26817C0.0622694 5.27916 0.0566673 5.29037 0.0521425 5.30157C0.0454631 5.31795 0.0396456 5.33475 0.0342589 5.35156C0.030596 5.36276 0.0267177 5.37375 0.0237011 5.38388C0.0187455 5.40284 0.0150825 5.42201 0.0116351 5.44162C0.00969592 5.45153 0.00732581 5.46123 0.00603302 5.47136C0.00215465 5.50109 0 5.53082 0 5.56121V10.4372C0 10.4673 0.00215465 10.4975 0.00646395 10.527C0.00797221 10.5378 0.0107733 10.5464 0.0129279 10.5568C0.0163753 10.5762 0.0193919 10.5955 0.0258558 10.6149C0.0288723 10.6257 0.0323198 10.6365 0.0366291 10.6483C0.0420157 10.6656 0.0474023 10.6828 0.0538662 10.6985C0.058391 10.7093 0.0646395 10.7201 0.0689488 10.7309C0.0760591 10.7459 0.0840314 10.761 0.09265 10.7768C0.098683 10.7875 0.105578 10.7983 0.112042 10.8082C0.121307 10.8233 0.131434 10.8362 0.142207 10.8491C0.149748 10.8599 0.157289 10.8685 0.165908 10.8789C0.176897 10.8918 0.187455 10.9047 0.200382 10.9162C0.209217 10.9248 0.21762 10.9355 0.228393 10.942C0.24089 10.9528 0.254249 10.9636 0.267177 10.9748C0.277519 10.9834 0.288723 10.9898 0.297342 10.9982C0.301436 11.0004 0.303806 11.0047 0.308115 11.0067L7.61863 15.8841C7.73412 15.9617 7.86641 16.0005 8 15.9998C8.13359 15.9992 8.26588 15.9611 8.38137 15.8841L15.6938 11.0092C15.6979 11.0067 15.7014 11.0036 15.7052 11.0008C15.716 10.9933 15.7261 10.9853 15.7365 10.9773C15.7498 10.9668 15.763 10.9558 15.7755 10.9446C15.785 10.9362 15.794 10.9269 15.8031 10.9179C15.8149 10.9058 15.8263 10.8935 15.8371 10.8806C15.8453 10.8709 15.8531 10.8612 15.8606 10.8509C15.8709 10.8373 15.8804 10.8233 15.8897 10.8091C15.8964 10.7987 15.903 10.7882 15.9093 10.7776C15.9179 10.7625 15.9254 10.7472 15.9328 10.7317C15.9379 10.7207 15.9433 10.7097 15.9481 10.6985C15.9548 10.6819 15.9604 10.6651 15.9657 10.6483C15.9694 10.6371 15.9733 10.6261 15.9765 10.6149C15.9815 10.596 15.9849 10.5766 15.9886 10.5572C15.9903 10.5473 15.9929 10.5376 15.994 10.5275C15.9978 10.4977 16 10.468 16 10.4376V5.5625C16 5.53212 15.9976 5.50238 15.994 5.47265C15.9922 5.46209 15.989 5.45347 15.9869 5.44292H15.9879ZM7.99978 9.62638L5.56826 8.00005L7.99978 6.37351L10.4315 8.00005L7.99978 9.62638ZM7.31245 5.17919L4.33171 7.17288L1.92561 5.56336L7.31245 1.97221V5.17919ZM3.09515 7.99984L1.37531 9.15021V6.84947L3.09515 7.99984ZM4.33171 8.82765L7.31245 10.8211V14.0281L1.92561 10.4365L4.33171 8.82722V8.82765ZM8.68733 10.8207L11.6681 8.82722L14.0744 10.4365L8.68733 14.0277V10.8207ZM12.9046 8.00027L14.6247 6.84969V9.15064L12.9046 7.99984V8.00027ZM11.6681 7.17288L8.68733 5.1794V1.97221L14.0744 5.56336L11.6681 7.17288Z",fill:"black"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22409",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),codesandbox:d.jsxs("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("g",{clipPath:"url(#clip0_6523_22406)",children:d.jsx("path",{d:"M6.24312 14.1129V8.35021L1.28724 5.49888V8.78388L3.55732 10.0999V12.5702L6.24312 14.1129ZM7.53036 14.1468L10.2658 12.571V10.0422L12.5506 8.71812V5.47426L7.53036 8.3727V14.1468ZM11.8904 4.36906L9.25164 2.83995L6.93472 4.18436L4.60022 2.8386L1.93795 4.38817L6.90626 7.24665L11.8904 4.36906ZM0 12.0115V4.02675L6.91821 0L13.8378 4.00984V11.9988L6.91805 15.985L0 12.0115Z",fill:"black"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22406",children:d.jsx("rect",{width:"13.8378",height:"16",fill:"white"})})})]}),dailymotion:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsxs("g",{clipPath:"url(#clip0_6523_22345)",children:[d.jsx("path",{d:"M16 0H0V16H16V0Z",fill:"white"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.73038 10.3003C8.40789 10.6268 8.00377 10.7901 7.51804 10.7901C7.04025 10.7901 6.64411 10.6308 6.32956 10.3122C6.01503 9.99367 5.85776 9.58351 5.85776 9.08176C5.85776 8.60389 6.01901 8.20766 6.3415 7.89306C6.66401 7.57847 7.06016 7.42118 7.52998 7.42118C7.84849 7.42118 8.13715 7.49484 8.39594 7.64219C8.65474 7.78953 8.8558 7.99063 8.99913 8.2455C9.14246 8.50034 9.21412 8.77908 9.21412 9.08176C9.21412 9.56757 9.05287 9.97376 8.73038 10.3003ZM9.10662 3.58632V6.35792C8.82791 6.07918 8.53131 5.87808 8.21678 5.75463C7.90223 5.63118 7.54988 5.56946 7.1597 5.56946C6.53062 5.56946 5.96527 5.72476 5.4636 6.03538C4.96193 6.34597 4.57176 6.77007 4.29305 7.30768C4.01435 7.84528 3.875 8.44062 3.875 9.09369C3.875 9.76269 4.01236 10.366 4.28708 10.9036C4.5618 11.4412 4.95197 11.8653 5.45763 12.1759C5.96328 12.4865 6.54258 12.6418 7.19553 12.6418C8.14312 12.6418 8.80403 12.3312 9.17831 11.71H9.20218V12.5595H11.0894V3.15625L9.10662 3.58632Z",fill:"#232323"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22345",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),flickr:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{width:"16",height:"16",fill:"white"}),d.jsxs("g",{clipPath:"url(#clip0_6523_22379)",children:[d.jsx("path",{d:"M8.43286 7.78387C8.43286 9.321 9.67925 10.5674 11.2166 10.5674C12.7538 10.5674 13.9999 9.321 13.9999 7.78387C13.9999 6.24675 12.7538 5.00061 11.2166 5.00061C9.67925 5.00061 8.43286 6.24675 8.43286 7.78387Z",fill:"#FF0084"}),d.jsx("path",{d:"M2 7.78408C2 9.32121 3.24614 10.5676 4.78352 10.5676C6.32089 10.5676 7.56703 9.32121 7.56703 7.78408C7.56703 6.24695 6.32089 5.00081 4.78352 5.00081C3.24614 5.00081 2 6.24695 2 7.78408Z",fill:"#0063DC"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22379",children:d.jsx("rect",{width:"12",height:"5.568",fill:"white",transform:"translate(2 5)"})})})]}),giphy:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{width:"16",height:"16",fill:"#121212"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3.38889V12.2778H5.11111V3.38889H4Z",fill:"#00FF99"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6663 5.61111V12.2778H11.7774V5.61111H10.6663Z",fill:"#9933FF"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.75 3H4V4.11111H8.83333V3H7.75Z",fill:"#FFF35C"}),d.jsx("path",{d:"M9.00041 4.11111H7.33374H8.83374V3.77778L9.00041 4.11111Z",fill:"#999999"}),d.jsx("path",{d:"M8.83374 4.11111H7.33374L8.44485 3L8.83374 3.77778V4.11111Z",fill:"#999237"}),d.jsx("path",{d:"M10.6663 7.44444V5.77778L11.7774 6.33333L10.6663 7.44444Z",fill:"#5C1F99"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6667 11.8889H4V13H11.7778V11.8889H10.6667Z",fill:"#00CCFF"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6668 5.22222V4.11111H9.55569V3H8.44458V3.90739V5.0185V6.33333H9.55569H10.6668H11.7779V5.22222H10.6668Z",fill:"#FF6666"})]}),instagram:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[d.jsxs("g",{clipPath:"url(#clip0_6523_22356)",children:[d.jsx("mask",{id:"mask0_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:d.jsx("path",{d:"M4.70325 0.0949238C3.85627 0.1349 3.27778 0.270564 2.77227 0.468642C2.24897 0.672648 1.80537 0.946046 1.36408 1.38914C0.922279 1.83249 0.650958 2.27688 0.448504 2.8007C0.252489 3.3075 0.119662 3.88627 0.0822604 4.73377C0.045126 5.58283 0.0366102 5.85363 0.0407495 8.01522C0.0448729 10.1765 0.0544124 10.4479 0.0949012 11.2972C0.135388 12.1439 0.270546 12.7222 0.468623 13.2279C0.672886 13.7512 0.946004 14.1946 1.38935 14.6361C1.83245 15.0777 2.27708 15.3487 2.80115 15.5515C3.30744 15.7472 3.88644 15.8806 4.73369 15.9177C5.58273 15.9551 5.85379 15.9634 8.01483 15.9592C10.1769 15.9551 10.448 15.9456 11.297 15.9053C12.144 15.8648 12.722 15.7292 13.228 15.5316C13.7513 15.3268 14.1949 15.0542 14.6362 14.6109C15.0775 14.1678 15.3488 13.7231 15.5512 13.199C15.7473 12.6927 15.8806 12.1137 15.9175 11.267C15.9546 10.4174 15.9634 10.1461 15.9593 7.98478C15.9551 5.8232 15.9453 5.55239 15.9051 4.7036C15.8649 3.85609 15.7292 3.27811 15.5314 2.77208C15.3269 2.24877 15.054 1.80567 14.6109 1.36387C14.1678 0.922574 13.7232 0.650729 13.1991 0.448785C12.6926 0.252768 12.1138 0.119166 11.2666 0.0825425C10.4175 0.0448876 10.1465 0.0366393 7.98465 0.0407642C5.82336 0.0448892 5.5523 0.0541772 4.70325 0.0949238ZM4.79611 14.485C4.02004 14.4512 3.59863 14.3222 3.31776 14.2142C2.94585 14.0703 2.68046 13.8977 2.40114 13.6205C2.12234 13.3422 1.94928 13.0776 1.80408 12.7064C1.69497 12.4255 1.5637 12.0046 1.52734 11.2286C1.48788 10.3896 1.47886 10.1378 1.47498 8.01237C1.47086 5.88742 1.47859 5.63569 1.51522 4.79593C1.54848 4.02038 1.67822 3.59843 1.78602 3.31782C1.92993 2.94539 2.10196 2.68051 2.37973 2.4012C2.65801 2.12187 2.92263 1.94933 3.29402 1.80412C3.57463 1.69451 3.99555 1.56426 4.77134 1.52738C5.61084 1.48766 5.8623 1.47915 7.98723 1.47502C10.1127 1.47089 10.3644 1.47838 11.2042 1.51526C11.9797 1.54904 12.4016 1.67749 12.682 1.78607C13.0541 1.92998 13.3195 2.1015 13.5986 2.37979C13.8777 2.65808 14.0507 2.92218 14.1959 3.29435C14.3055 3.57418 14.4358 3.99562 14.4724 4.77117C14.5124 5.61068 14.5214 5.8624 14.5253 7.98736C14.5294 10.1128 14.5217 10.3646 14.4848 11.2038C14.451 11.9799 14.3223 12.4016 14.214 12.6827C14.0701 13.0543 13.898 13.3197 13.62 13.5991C13.342 13.8773 13.0774 14.0509 12.7057 14.1961C12.4256 14.3055 12.0042 14.436 11.2289 14.4729C10.3894 14.5123 10.1379 14.5214 8.01225 14.5252C5.88732 14.5294 5.63586 14.5214 4.79611 14.485ZM11.2854 3.74493C11.2864 4.27211 11.7151 4.69896 12.2422 4.69792C12.7697 4.69689 13.1965 4.2685 13.1957 3.74132C13.1947 3.21414 12.7661 2.78704 12.2386 2.78807C11.7112 2.7891 11.2844 3.21775 11.2854 3.74493ZM3.91277 8.00773C3.91714 10.2653 5.75063 12.0913 8.0076 12.0869C10.2648 12.0825 12.0919 10.2495 12.0875 7.99201C12.0831 5.73526 10.2494 3.90819 7.99188 3.91257C5.73489 3.91696 3.90837 5.75073 3.91277 8.00773ZM5.34648 8.0049C5.3439 6.53969 6.52978 5.34942 7.99471 5.34683C9.45991 5.344 10.6504 6.52937 10.6533 7.99484C10.6561 9.46031 9.47022 10.6503 8.00477 10.6532C6.53984 10.656 5.34932 9.47037 5.34648 8.0049Z",fill:"white"})}),d.jsxs("g",{mask:"url(#mask0_6523_22356)",children:[d.jsx("mask",{id:"mask1_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:d.jsx("path",{d:"M16.5905 -0.583628H-0.603516V16.6106H16.5905V-0.583628Z",fill:"white"})}),d.jsxs("g",{mask:"url(#mask1_6523_22356)",children:[d.jsx("mask",{id:"mask2_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:d.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),d.jsxs("g",{mask:"url(#mask2_6523_22356)",children:[d.jsx("mask",{id:"mask3_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:d.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),d.jsx("g",{mask:"url(#mask3_6523_22356)",children:d.jsx("rect",{x:"-0.688721",y:"-0.665792",width:"17.3622",height:"17.3622",fill:"url(#pattern0)"})})]})]})]})]}),d.jsxs("defs",{children:[d.jsx("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:d.jsx("use",{xlinkHref:"#image0_6523_22356",transform:"scale(0.000439947)"})}),d.jsx("clipPath",{id:"clip0_6523_22356",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})}),d.jsx("image",{id:"image0_6523_22356",width:"2273",height:"2275",xlinkHref:"data:image/jpeg;base64,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Hbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfw5h277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3XY/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26j+GHbqP4Yduo38MO3Ub+GHbqP4Yduo/hh26j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmNh25jYduY2HbmNh25jYduY2HbmNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh0+Nh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jhz+j7fweHn/AFd+fp9v6v8Ape79DDf1JLc930/LnmGfj9H0+v7/APAf6c32/wAQ/wCR+n/5f9383/iNaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca0415xrzjXnGvONeca8415xrzjXnGvONeca8415xrzjXnGvONeca8415xrzjXnGvONeYa8w15hrzDXmGvMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMNeYa8w15hrzDXnGvONeca8415xrzjXnGvONeca041pxrTjWnGtONaca041pxrTjWnGtONacas41ZxqzjVnGrONWcas41ZxqzjVnGrONScak41JxqTjUUGooNRQaig1FBqKDTUGmoNNQaag01BpqDTUGmoNNQaag0lBpKDSUGkoNJQaSg0lBpKDSUGioNFQaKg0VBoqDRVGiqNFUaKo0FRoKjQVGgqNBUaCo0FRoKjQVGgqPXqj16o9eqPXqj16o9eqPXqj16o9eqPXqj1yo9cqPXKj1yo9cqPXLD1yw9csPXLD1yw9csPWrD1qw9asPWrD1qw9asPWrD1qw9asPWrD1qw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1aw9WsPVrD1aw9WsPVrD1aw9WsPVrD1aw9WsPVrB34/8Ay/z/AH/53yHY/wDU/E/0v+P7/wCz/9k="})]})]}),pinterest:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsxs("g",{clipPath:"url(#clip0_6570_25513)",children:[d.jsx("rect",{width:"15.996",height:"16",rx:"2",fill:"#CC2127"}),d.jsx("path",{d:"M7.999 2C4.68555 2 2 4.68555 2 7.999C2 10.5406 3.58174 12.7102 5.81336 13.5861C5.76137 13.1121 5.71338 12.3843 5.83336 11.8644C5.94134 11.3964 6.53724 8.88285 6.53724 8.88285C6.53724 8.88285 6.35727 8.52291 6.35727 7.993C6.35727 7.15914 6.84119 6.53524 7.44309 6.53524C7.95501 6.53524 8.20297 6.91918 8.20297 7.3811C8.20297 7.89502 7.87502 8.66489 7.70705 9.37877C7.56507 9.97667 8.007 10.4626 8.5949 10.4626C9.66072 10.4626 10.4806 9.33878 10.4806 7.71505C10.4806 6.27929 9.44876 5.27345 7.975 5.27345C6.26729 5.27345 5.26546 6.55324 5.26546 7.87702C5.26546 8.39293 5.46342 8.94484 5.71138 9.24679C5.75937 9.30678 5.76737 9.35877 5.75337 9.41876C5.70738 9.60873 5.6074 10.0167 5.5874 10.0987C5.56141 10.2086 5.50142 10.2326 5.38743 10.1786C4.63756 9.83069 4.16964 8.73488 4.16964 7.85502C4.16964 5.96334 5.54541 4.22563 8.13298 4.22563C10.2146 4.22563 11.8304 5.70938 11.8304 7.69105C11.8304 9.75871 10.5266 11.4224 8.71688 11.4224C8.10898 11.4224 7.53708 11.1065 7.34111 10.7345C7.34111 10.7345 7.04116 11.8804 6.96717 12.1603C6.83119 12.6822 6.46526 13.3341 6.2213 13.732C6.7832 13.906 7.3791 14 7.997 14C11.3104 14 13.996 11.3144 13.996 8.001C13.998 4.68555 11.3124 2 7.999 2Z",fill:"white"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6570_25513",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),spotify:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("g",{clipPath:"url(#clip0_6523_22402)",children:d.jsx("path",{d:"M12.6609 7.10585C10.121 5.59751 5.93158 5.45882 3.50697 6.1947C3.11759 6.31287 2.70584 6.09298 2.5879 5.70373C2.46988 5.31411 2.68945 4.90265 3.07911 4.78429C5.86241 3.93945 10.4892 4.1026 13.4132 5.83828C13.7634 6.04622 13.8782 6.49851 13.6707 6.84813C13.4629 7.19833 13.0103 7.31376 12.6609 7.10585ZM12.5777 9.33993C12.3995 9.62908 12.0215 9.71979 11.7327 9.54223C9.61522 8.24063 6.38637 7.86357 3.88123 8.624C3.55636 8.72218 3.21323 8.53899 3.11455 8.21475C3.01666 7.88989 3.19992 7.54738 3.5242 7.44859C6.38597 6.58018 9.9436 7.00081 12.3756 8.49536C12.6644 8.67322 12.7553 9.05146 12.5777 9.33993ZM11.6136 11.4855C11.472 11.7177 11.1697 11.7904 10.9383 11.6489C9.08801 10.518 6.75909 10.2627 4.01637 10.8891C3.75207 10.9497 3.48866 10.7841 3.42838 10.5198C3.36785 10.2556 3.53284 9.99217 3.79772 9.93186C6.79916 9.2457 9.37381 9.54101 11.4506 10.8101C11.6822 10.9515 11.7551 11.254 11.6136 11.4855ZM8.00002 0.120623C3.64839 0.120623 0.120605 3.64834 0.120605 7.99989C0.120605 12.352 3.64839 15.8794 8.00002 15.8794C12.3517 15.8794 15.8794 12.352 15.8794 7.99989C15.8794 3.64834 12.3517 0.120623 8.00002 0.120623Z",fill:"#1ED760"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22402",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),twitter:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M14.3193 4.31285C14.329 4.45301 14.329 4.59317 14.329 4.73462C14.329 9.04475 11.0516 14.0156 5.05865 14.0156V14.0131C3.28832 14.0156 1.55478 13.508 0.0644531 12.5507C0.321873 12.5817 0.580582 12.5972 0.839937 12.5979C2.30703 12.5992 3.7322 12.1063 4.88639 11.1988C3.4922 11.1724 2.26961 10.2623 1.84252 8.93366C2.3309 9.02796 2.83413 9.00858 3.31349 8.87746C1.79349 8.57001 0.699937 7.23299 0.699937 5.68023C0.699937 5.66602 0.699937 5.65246 0.699937 5.63889C1.15284 5.89144 1.65994 6.0316 2.17865 6.0471C0.747034 5.08923 0.305743 3.18251 1.17026 1.69176C2.82445 3.7296 5.2651 4.96844 7.8851 5.09956C7.62252 3.96664 7.98123 2.77947 8.82768 1.98307C10.1399 0.748096 12.2038 0.811395 13.4374 2.12452C14.167 1.98048 14.8664 1.71243 15.5064 1.33264C15.2632 2.0877 14.7541 2.72909 14.0741 3.13665C14.7199 3.06044 15.3509 2.88734 15.9451 2.62316C15.5077 3.2794 14.9567 3.85103 14.3193 4.31285Z",fill:"#1D9BF0"})}),vimeo:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsxs("g",{clipPath:"url(#clip0_6523_22340)",children:[d.jsx("path",{d:"M16 14.4C16 15.28 15.28 16 14.4 16H1.6C0.72 16 0 15.28 0 14.4V1.6C0 0.72 0.72 0 1.6 0H14.4C15.28 0 16 0.72 16 1.6V14.4Z",fill:"#1AB7EA"}),d.jsx("path",{d:"M13.9945 5.3084C13.9391 6.42815 13.1229 7.97447 11.5458 9.93402C9.91331 11.9736 8.52987 13 7.40928 13C6.70372 13 6.12267 12.3735 5.63846 11.1338C5.32027 9.98735 4.98824 8.85427 4.67005 7.70786C4.31036 6.46814 3.92299 5.84161 3.50796 5.84161C3.42495 5.84161 3.10676 6.02824 2.56721 6.38816L2 5.68165C2.59488 5.1751 3.17593 4.68187 3.75698 4.17532C4.54554 3.52214 5.14042 3.17555 5.54162 3.13556C6.46853 3.05557 7.04958 3.66877 7.27093 4.97514C7.50612 6.40149 7.67213 7.28129 7.75514 7.62788C8.01799 8.80095 8.32235 9.40081 8.64054 9.40081C8.88956 9.40081 9.26309 9.01423 9.77497 8.2544C10.273 7.49457 10.5497 6.90804 10.5774 6.50813C10.6465 5.85494 10.3837 5.52169 9.77497 5.52169C9.48444 5.52169 9.19392 5.58834 8.88956 5.70831C9.48444 3.84206 10.605 2.94893 12.2652 3.00225C13.4826 3.02891 14.0637 3.80207 13.9945 5.3084Z",fill:"white"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22340",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),youtube:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{d:"M15.6656 3.75817C15.4816 3.06609 14.9395 2.5211 14.2511 2.33614C13.0034 2 8 2 8 2C8 2 2.99666 2 1.7489 2.33614C1.06051 2.5211 0.518324 3.06609 0.334339 3.75817C0 5.01251 0 7.62963 0 7.62963C0 7.62963 0 10.2467 0.334339 11.5012C0.518324 12.1932 1.06051 12.7381 1.7489 12.9232C2.99666 13.2593 8 13.2593 8 13.2593C8 13.2593 13.0034 13.2593 14.2511 12.9232C14.9395 12.7381 15.4816 12.1932 15.6656 11.5012C16 10.2467 16 7.62963 16 7.62963C16 7.62963 16 5.01251 15.6656 3.75817Z",fill:"#ED1D24"}),d.jsx("path",{d:"M6.36353 10.0058L10.5453 7.62974L6.36353 5.25349V10.0058Z",fill:"white"})]})};function nY(e){const{debouncedUrl:t,content:n,onContentChange:r,selected:i}=e,o=I.useRef(null),[a,s]=I.useState(!1);ze.useOnChange(t,()=>{var c;a&&(s(!1),(c=o.current)==null||c.reset())});function l(){s(!0),r(void 0)}return ii.toURL(t)?t===(n==null?void 0:n.embed_url)?d.jsx(cx,{content:n,selected:i}):d.jsx(A.ErrorBoundary,{ref:o,renderError:jUe,onError:l,children:d.jsx(I.Suspense,{fallback:n&&d.jsx(cx,{content:n,selected:i}),children:d.jsx(LUe,{url:t,selected:i,onContentChange:r})})}):null}function jUe(){return d.jsxs(A.Box,{backgroundColor:"grey2",borderRadius:6,padding:16,gap:4,children:[d.jsx(A.Icon,{name:"alert",size:"small",color:"grey11"}),d.jsx(A.Text,{variant:"smallBold",color:"grey11",children:"There is no embed data available."})]})}function cx(e){const{content:t,selected:n}=e,{thumbnail:r,provider:i,author:o,url:a,subtitle:s}=PUe(t);return d.jsxs(A.PreviewCard,{selected:n,children:[d.jsx(A.PreviewImage,{src:r.url,aspectRatio:r.aspectRatio}),d.jsxs(A.PreviewContent,{children:[d.jsxs(A.Box,{display:"flex",alignItems:"center",gap:4,children:[d.jsx(MUe,{provider:i}),d.jsx(A.Text,{variant:"smallBold",color:"grey12",noWrap:!0,children:i}),o&&d.jsx(A.Text,{variant:"small",color:"grey11",noWrap:!0,children:o})]}),d.jsx(A.Text,{variant:"smallBold",href:a,children:s})]})]})}function LUe(e){const{url:t,onContentChange:n,selected:r}=e,i=DUe({url:t,onContentChange:n});return d.jsx(cx,{content:i,selected:r})}function DUe(e){const{url:t,onContentChange:n}=e,{embedApiEndpoint:r}=we(),i=et.useRequest(UUe,[t,r]),o=ze.useStableCallback(n);return I.useEffect(()=>{const a=A.handleEditorFlushSyncError(()=>o(i));return()=>{clearTimeout(a)}},[i,o]),i}function UUe(e,t){const n=new URL(t);return n.searchParams.set("url",e),se.request(n,{okType:BUe(e)})}function BUe(e){return $.object({type:$.string(),version:$.string().or($.number()).nullish(),title:$.string().nullish(),author_name:$.string().nullish(),author_url:$.string().nullish(),provider_name:$.string().nullish(),provider_url:$.string().nullish(),cache_age:$.string().or($.number()).nullish(),thumbnail_url:$.string().nullish(),thumbnail_width:$.number().nullish(),thumbnail_height:$.number().nullish(),html:$.string().nullish()}).passthrough().transform(t=>{const n={embed_url:e};return{...n,__TYPE__:"EmbedContent",type:t.type,version:t.version,title:t.title,author_name:t.author_name,author_url:t.author_url,provider_name:t.provider_name,provider_url:t.provider_url,cache_age:t.cache_age,thumbnail_url:t.thumbnail_url,thumbnail_width:t.thumbnail_width,thumbnail_height:t.thumbnail_height,html:t.html,all:{...n,...t}}})}function PUe(e){let t="";switch(e.type){case"video":t=e.title??"";break;case"photo":t=`View this post${e.provider_name?` on ${e.provider_name}`:""}`;break;default:t=`Open${e.provider_name?` on ${e.provider_name}`:""}`}return{url:e.embed_url,thumbnail:{url:e.thumbnail_url??"",aspectRatio:e.type==="video"?"16:9":"1:1"},provider:e.provider_name??"",author:e.author_name??"",subtitle:t}}function WUe(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=ze.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:I.startTransition});function s(l){a.set(l),ii.toURL(l)||o(void 0)}return d.jsxs(A.Field,{footer:ii.toURL(a.value)&&d.jsx(A.FieldFooter,{children:d.jsx(nY,{debouncedUrl:a.debouncedValue,content:i,onContentChange:o})}),children:[d.jsx(A.FieldIcon,{name:"cloud"}),d.jsx(A.FieldLabel,{htmlFor:t,children:_r(r)}),d.jsx(A.FieldControl,{children:d.jsx(Tl,{id:t,readOnly:n,placeholder:Ou(r),value:a.value,onValueChange:s,variant:ii.toURL(a.value)?"link":"normal",endAdornment:d.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:()=>s("")})})})]})}function rY(e){return!(e.lat>85||e.lat<-85||e.lng>180||e.lng<-180)}function PS(e){const t=/^.*@(-?\d+.\d+),(-?\d+.\d+).*$/,n=e.match(t);if(!n)return;const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return;const o={lat:r,lng:i};if(rY(o))return o}function VL(e){return e?`${e.lat}, ${e.lng}`:""}function zL(e){const t=/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/,n=e.match(t);if(!n)return PS(e);const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return PS(e);const o={lat:r,lng:i};return rY(o)?o:PS(e)}function NUe(e){const{field:t,id:n,readOnly:r,...i}=e,{onValueChange:o,displayedValue:a,onBlur:s,clearValue:l,isValidCoordinates:c}=KUe(i);return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"place"}),d.jsx(A.FieldLabel,{htmlFor:n,children:_r(t)}),d.jsx(A.FieldControl,{children:d.jsx(Tl,{id:n,onValueChange:o,placeholder:cF,readOnly:r,value:a,onBlur:s,variant:c?"link":"normal",endAdornment:d.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:l})})})]})}function KUe(e){const{content:t,onContentChange:n}=e,r=VL(t==null?void 0:t.position),[i,o]=I.useState(r);function a(){const c=zL(i);if(!c)return o(""),n(void 0);const{lat:u,lng:f}=c;o(VL({lat:u,lng:f})),n({__TYPE__:"GeoPointContent",position:{lat:u,lng:f}})}function s(){o(""),n(void 0)}const l=!!zL(i);return{displayedValue:i,isValidCoordinates:l,onValueChange:o,onBlur:a,clearValue:s}}function iY(e){const{fieldLabel:t,imageLabel:n=[]}=e;return d.jsxs(A.CardHeaderTitle,{children:[d.jsx(A.Text,{variant:"bold",noWrap:!0,children:Zn.overflow(t,30)}),n.length!==0&&d.jsx(A.Text,{color:"grey11",noSelect:!0,children:` • ${n.join(" • ")}`})]})}function oY(e){const{fieldLabel:t,isUpdating:n,readOnly:r,onMediaDialogOpenChange:i}=e;return d.jsxs(d.Fragment,{children:[d.jsx(A.CardHeader,{sx:{flexWrap:"wrap"},children:d.jsx(iY,{fieldLabel:t})}),d.jsx(A.CardContent,{children:d.jsx(A.Card,{color:"grey2",variant:"dashed",paddingBlock:12,radius:4,sx:{width:"100%"},children:d.jsx(A.CardContent,{children:d.jsxs(A.BlankSlate,{variant:"horizontal",children:[d.jsx(A.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple9",backgroundColor:"purple4",size:"small"}),d.jsx(A.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!r&&d.jsx(A.BlankSlateActions,{children:d.jsx(A.Button,{disabled:n,onClick:()=>i(!0),size:"medium",children:"Select image"})})]})})})})]})}const qUe=bv({id:Nl(),width:yv(),height:yv(),urls:bv({full:Nl(),small:Nl().transform(lDe)}),alt_description:Nl().optional(),description:Nl().nullable()}),VUe=bv({results:$U(qUe)}).transform(e=>e.results);function aY(e,t){const n=new URL("search/photos",e);return n.searchParams.set("page","1"),n.searchParams.set("per_page","28"),n.searchParams.set("query",t),se.request(n,{okType:VUe})}et.cache.registerFetcherConfig(aY,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function zUe(e,t){const n=I.useRef(),r=we(),i=et.useRequest(aY,[e,t]);return ze.useDebounce(t,1e3,()=>{var o;n.current&&t!==n.current&&((o=r.onAnalyticsEvent)==null||o.call(r,"Unsplash Image Searched")),n.current=t}),i}function QUe(e){const{onSelectedChange:t}=e,[n,r]=I.useTransition(),i=ze.useDebounceState({initialState:"",ms:300,startTransition:r});return d.jsxs(A.Box,{flexDirection:"column",gap:16,width:"100%",position:"relative",children:[d.jsx(A.FormSearchInput,{value:i.value,placeholder:"Search on Unsplash.com",onValueChange:i.set}),d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(jH,{}),children:d.jsx(I.Suspense,{fallback:d.jsx(YUe,{}),children:d.jsx(HUe,{term:i.debouncedValue,loading:n,onSelectedChange:t})})})]})}function HUe(e){const{term:t,onSelectedChange:n,loading:r}=e,{media:i,toggleSelected:o,selectedImageId:a}=GUe({term:t,onSelectedChange:n});return d.jsxs(d.Fragment,{children:[i.length>0&&d.jsx(sY,{children:i==null?void 0:i.map(s=>{const c=new URL(s.urls.full).searchParams.get("fm")??"jpg";return d.jsx(A.MediaCard,{url:s.urls.small,filename:s.description??"Unsplash Image",selected:a===s.id,onCardClick:()=>o(s),onCheckedChange:()=>o(s),extension:c,kind:"image",width:s.width,height:s.height,loading:r},s.id)})}),i.length===0&&d.jsx(MH,{})]})}function sY(e){const{children:t}=e;return d.jsx(A.ScrollArea,{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,padding:2,paddingBottom:16,position:"relative",width:"100%"},children:t})}function YUe(){return d.jsx(sY,{children:_t.range(1,24).map(e=>d.jsx(WH,{},e))})}function GUe(e){var c;const{term:t,onSelectedChange:n}=e,{unsplashApiBaseUrl:r}=we(),i=zUe(r,t||"citrus fruit"),o=(c=i==null?void 0:i[0])==null?void 0:c.id,[a,s]=I.useState();I.useEffect(()=>{n==null||n([]),s(void 0)},[o,n]);function l(u){if(u.id===a)return s(void 0),n==null?void 0:n([]);s(u.id),n==null||n([{...u,url:u.urls.full,alt:u.alt_description}])}return{media:i,toggleSelected:l,selectedImageId:a}}function uF(e){const{open:t,onOpenChange:n,onMediaSelected:r,assetType:i}=e,o=we(),a=o.mediaLibrary,[s,l]=I.useState(()=>a?"media":"unsplash"),[c,u]=I.useState(new Set),[f,p]=I.useState([]),h=c.size+f.length,m=et.useFetcherData(Wi);I.useEffect(()=>{!t||!a||_H({config:o,assetType:i})},[t,o,i,a]);function g(S){if(S!=="media"&&S!=="unsplash")throw new Error(`Invalid option ${S}.`);l(S)}function y(S){S||u(new Set),n(S)}const C=E2e({assetType:i,mediaDialogOpen:t});function x(){var S;switch(s){case"unsplash":{const w=f[0];if(!w)return;r(w),(S=o.onAnalyticsEvent)==null||S.call(o,"Unsplash Image Added");break}case"media":{const E=m.flatMap(R=>R.items).filter(R=>c.has(R.id))[0];if(!E)return;r(E),C(E.id);break}}}function b(){if(h===0)return"Select a media item to add to the page";if(h>1)return"Only one media item can be added to the page"}const{containerRef:v}=A.useAlert();return d.jsxs(A.Dialog,{open:t,onOpenChange:y,size:{width:"min(calc(100% - 48px), 2000px)",height:"calc(100% - 30px)"},position:"center",onPointerDownOutside:S=>{v&&ze.refContainsTarget(v,S.target)&&S.preventDefault()},children:[d.jsx(A.DialogHeader,{icon:"image",title:"Media library"}),d.jsx(A.DialogDescription,{hidden:!0,children:"Select a media item to add to the page"}),d.jsxs(A.DialogOptions,{value:s,onValueChange:g,padding:"small",width:"auto",children:[a&&d.jsx(A.DialogOptionsItem,{value:"media",icon:"photo"}),d.jsx(A.DialogOptionsItem,{value:"unsplash",icon:"unsplash"})]}),d.jsx(A.DialogContent,{children:d.jsx(A.Box,{flexDirection:"column",flexGrow:1,overflow:"hidden",children:d.jsxs(A.Box,{overflow:"hidden",backgroundColor:"grey2",padding:{top:16,inline:16},flexGrow:1,children:[s==="media"&&d.jsx(HH,{assetType:i,onSelectedChange:u}),s==="unsplash"&&d.jsx(QUe,{onSelectedChange:p})]})})}),d.jsxs(A.DialogActions,{children:[d.jsx(A.DialogCancelButton,{}),d.jsx(A.DialogActionButton,{onClick:x,disabled:h!==1,tooltipLabel:b(),children:"Add to page"})]})]})}const lY=I.forwardRef(function(t,n){const{isMediaDialogOpen:r,selected:i,children:o,onMediaSelected:a,onMediaDialogOpenChange:s}=t;function l(c){a(c),s(!1)}return d.jsxs(A.Card,{ref:n,color:i?"indigo2":"grey2",variant:i?"selected":"dashed",paddingBlock:12,radius:4,children:[o,d.jsx(uF,{open:r,onOpenChange:s,onMediaSelected:l,assetType:"image"})]})});function cY(e){const{uploadImage:t,children:n,isUploading:r,disabled:i}=e;if(i)return d.jsx(d.Fragment,{children:n});function o(a){if(r)return;const s=a[0];s&&t(s)}return d.jsx(A.FileDropZone,{assetType:"image",maxFiles:1,onFilesSelected:o,overlay:d.jsx(JUe,{isUploading:r}),children:n})}function JUe(e){const{isUploading:t}=e,n=t?"You can't upload while the upload is ongoing":"Drop image to instantly upload";return d.jsx(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",padding:8,children:d.jsxs(A.BlankSlate,{children:[d.jsx(A.BlankSlateIcon,{name:t?"block":"cloudUpload",lineColor:t?"tomato11":"purple10",backgroundColor:t?"tomato2":"purple3",borderColor:t?"tomato6":"purple6",borderStyle:"dashed",size:"small"}),d.jsx(A.BlankSlateTitle,{size:"regular",children:n})]})})}function uY(e){const{contentView:t,croppedImage:n}=e,{width:r,height:i,x:o,y:a,zoom:s}=n,l=XUe({origin:t.origin,croppedImage:n});return{...t,width:r,height:i,url:l,edit:{...t.edit,zoom:s,crop:{x:o,y:a}}}}function ZUe(e){var c,u,f;const{field:t,content:n,thumbnail:r,croppedImage:i}=e;if(r===hp)return dY({content:n,croppedImage:i});const o=fe.isImageContent(n),a=(u=(c=t==null?void 0:t.config)==null?void 0:c.thumbnails)==null?void 0:u.find(p=>p.name===r),s=o?(f=n.thumbnails)==null?void 0:f[r]:void 0;if(!a||!s)return n;const l=uY({contentView:s,croppedImage:i});return l.url===s.url?n:{...n,thumbnails:o?{...n.thumbnails,[r]:l}:void 0}}function dY(e){const{content:t,croppedImage:n}=e,r=uY({contentView:t,croppedImage:n});return r.url===t.url?t:{...t,...r}}function XUe(e){const{origin:t,croppedImage:n}=e,{x:r,y:i,width:o,height:a,cropHeight:s,cropWidth:l}=n,c=new URL(t.url),u=t.height!==a||t.width!==o;if(r!==0||i!==0||s!==t.height||l!==t.width){const p=[r,i,l,s].map(Math.round).join(",");c.searchParams.set("rect",p),c.searchParams.set("w",o.toString()),c.searchParams.set("h",a.toString())}return u&&(c.searchParams.set("w",o.toString()),c.searchParams.set("h",a.toString())),c.toString()}function eBe(e){const{edit:{crop:{x:t,y:n},zoom:r},width:i,height:o,origin:{width:a,height:s}}=e;let l,c;const u=a/s,f=i/o;return f>=u?(l=a/r,c=l/f):(c=s/r,l=c*f),{x:t,y:n,width:i,height:o,zoom:r,cropWidth:l,cropHeight:c}}function tBe(e){const{selectedImage:t,imageCrop:n,setImageCrop:r}=e,{width:i,height:o,zoom:a,cropHeight:s,cropWidth:l}=n,c=t.contentView,u={x:n.x,y:n.y,width:l,height:s},[f,p]=I.useState(),h=(c==null?void 0:c.origin.url)??"",m=!(t!=null&&t.thumbnail.height&&(t!=null&&t.thumbnail.width));function g(v,S){const w=parseInt(S);isNaN(w)||w<=0||!m||r({...n,[v]:w})}function y(v){r({...n,cropWidth:v.width,cropHeight:v.height,x:v.x,y:v.y})}function C(v){r({...n,zoom:v})}function x(){p(xg),r({...n,...xg})}function b(){c&&(p(xg),r({...n,...xg,zoom:1,cropWidth:c.width,cropHeight:c.height}))}return d.jsxs(A.Box,{padding:{inline:24,block:16},flexDirection:"column",gap:16,height:"100%",overflowY:"auto",alignItems:"center",children:[d.jsxs(A.Box,{gap:8,height:32,alignItems:"flex-start",width:"100%",children:[d.jsx(A.Tooltip,{content:"Center",children:d.jsx(A.Button,{color:"grey",size:"medium",startIcon:"centerFocusWeak",onClick:x})}),d.jsx(A.Tooltip,{content:"Cover",children:d.jsx(A.Button,{color:"grey",size:"medium",startIcon:"zoomOutMap",onClick:b})}),d.jsx(A.Separator,{orientation:"vertical"}),d.jsx(A.FormInput,{prefix:"W",prefixTooltip:"Width",placeholder:"width",type:"number",size:"medium",value:String(i),onValueChange:v=>g("width",v),sx:{width:100},disabled:!m}),d.jsx(A.FormInput,{prefix:"H",prefixTooltip:"Height",placeholder:"height",type:"number",size:"medium",value:String(o),onValueChange:v=>g("height",v),sx:{width:100},disabled:!m})]}),d.jsx(A.Cropper,{image:h,aspect:i/o,crop:f??{x:0,y:0},onCropChange:p,zoom:a,onZoomChange:C,onCropAreaChange:(v,S)=>y(S),initialCroppedAreaPixels:u}),d.jsx(A.Box,{width:"100%",maxWidth:320,children:d.jsx(A.Slider,{min:1,max:3,step:.01,value:[a],onValueChange:([v])=>C(v??1)})})]})}const xg={x:0,y:0};function nBe(e){const{trigger:t,initialImages:n,renderTooltip:r}=e,{open:i,onOpenChange:o,ready:a,option:s,selectedImage:l,croppedImage:c,setCroppedImage:u,setReady:f,setOption:p}=rBe(e);return d.jsxs(A.Dialog,{trigger:t,onAnimationEnd:()=>f(!0),open:i,onOpenChange:o,renderTooltip:r,children:[d.jsx(A.DialogHeader,{icon:"photo",title:"Image editor"}),d.jsx(A.DialogDescription,{hidden:!0,children:"Crop your image to the desired size."}),d.jsx(A.DialogOptions,{value:String(s),onValueChange:h=>p(Number(h)),children:n.map((h,m)=>d.jsx(A.DialogOptionsItem,{value:String(m),icon:"photo",title:h.labels[0]??"Main",subtitle:h.labels[1]??""},h.thumbnail.name))}),l&&d.jsx(A.DialogContent,{children:a&&c&&d.jsx(tBe,{selectedImage:l,imageCrop:c,setImageCrop:u},l.thumbnail.name)})]})}function rBe(e){const{initialImages:t,initialOption:n,onClose:r}=e,[i,o]=I.useState(y),[a,s]=I.useState(!1),[l,c]=I.useState(!1),[u,f]=I.useState(n);function p(C){C?(f(n),o(y())):(c(!1),r({option:u,croppedImages:i})),s(C)}const h=t[u],m=i[(h==null?void 0:h.thumbnail.name)??""];function g(C){if(!h)return;const x=h.thumbnail.name;o({...i,[x]:C})}function y(){return t.reduce((C,x)=>(x.contentView&&(C[x.thumbnail.name]=eBe(x.contentView)),C),{})}return{open:a,ready:l,option:u,selectedImage:h,croppedImage:m,setCroppedImage:g,setReady:c,setOption:f,onClose:r,onOpenChange:p}}function iBe(e){const{readOnly:t,altText:n,selected:r,onValueChange:i}=e,o=I.useId();return d.jsxs(A.Field,{selected:r,children:[d.jsx(A.FieldLabel,{htmlFor:o,children:"Alt text"}),d.jsx(A.FieldControl,{children:d.jsx(A.Box,{flexGrow:1,height:40,children:d.jsx(Tl,{id:o,placeholder:"Short description for the visually impaired",readOnly:t,value:n,padding:{input:{inline:12}},onValueChange:i})})})]})}function oBe(e){const{fieldLabel:t,imageLabel:n,initialImages:r,page:i,displaySeparator:o=!0,isSVGContentView:a,visibility:s,onClear:l,onCropperDialogClose:c,onMediaDialogOpenChange:u}=e;return d.jsxs(A.Box,{display:"flex",flexDirection:"column",gap:12,children:[d.jsxs(A.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:4,children:[d.jsx(iY,{fieldLabel:t,imageLabel:n}),d.jsxs(A.CardHeaderActions,{sx:{visibility:s},children:[d.jsx(nBe,{trigger:d.jsx(A.Button,{startIcon:"crop",disabled:a,hiddenLabel:"Crop & Resize"}),renderTooltip:f=>d.jsx(A.Tooltip,{content:"Crop & Resize",children:f}),initialImages:r,initialOption:i,onClose:c}),d.jsx(A.Tooltip,{content:"Replace",children:d.jsx(A.Button,{startIcon:"imageSearch",hiddenLabel:"Replace",onClick:()=>u(!0)})}),d.jsx(A.Tooltip,{content:"Clear",children:d.jsx(A.Button,{onClick:l,startIcon:"delete",hiddenLabel:"Clear"})})]})]}),o&&d.jsx(A.Separator,{style:"dashed",decorative:!0})]})}function xc(e){const{description:t,largeIconName:n="public",loading:r,error:i,onEdit:o,onUnlink:a}=e,s=i?d.jsx(uBe,{}):d.jsx(cBe,{...e,largeIconName:n,loading:r});return d.jsx(A.Card,{sx:{width:420},children:d.jsxs(A.CardContent,{gap:12,children:[d.jsxs(A.Box,{display:"grid",gridTemplateColumns:"max-content 1fr min-content",gridTemplateRows:"1fr",gap:8,children:[s,d.jsxs(A.ButtonGroup,{size:"medium",color:"grey",sx:{justifySelf:"end"},children:[o&&d.jsx(A.Button,{startIcon:"edit",onClick:o}),a&&d.jsx(A.Button,{startIcon:"linkOff",onClick:a})]})]}),!i&&d.jsx(lBe,{description:t,loading:r})]})})}function aBe(e){const{url:t,title:n,loading:r}=e;return r?d.jsx(fY,{height:16,width:80}):n?d.jsx(A.Text,{variant:"smallBold",href:t==null?void 0:t.toString(),children:n}):null}function sBe(e){const{subTitle:t,loading:n}=e;return n?d.jsx(A.Box,{padding:{block:2},children:d.jsx(fY,{height:12,width:60})}):t?d.jsx(A.Text,{variant:"small",color:"grey11",noWrap:!0,children:t}):null}function lBe(e){const{description:t,loading:n}=e;return!t||n?null:d.jsx(A.Text,{variant:"small",color:"grey11",children:t})}function cBe(e){const{largeIconName:t,title:n,url:r,loading:i,subTitle:o}=e;return d.jsxs(d.Fragment,{children:[d.jsx(A.ConjoinedIcons,{largeIconName:t,smallIconName:"link"}),d.jsxs(A.Box,{flexDirection:"column",minWidth:0,children:[d.jsx(aBe,{title:n,url:r,loading:i}),d.jsx(sBe,{subTitle:o,loading:i})]})]})}function uBe(){return d.jsxs(A.Box,{alignItems:"center",gap:8,children:[d.jsx(A.BackgroundIcon,{name:"alert",color:"tomato",size:"small"}),d.jsx(A.Text,{color:"tomato11",children:"Failed to load linked document data"})]})}function fY(e){const{width:t,height:n}=e;return d.jsx(A.Skeleton,{color:"grey5",borderRadius:6,width:t,height:n})}function QL(){const e=we();e.searchDocuments||mt("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,r=et.useRequest(iC,[t,n]);return new Set(r.languages.map(i=>({id:i.id,label:i.label})))}function dBe(){const e=we();e.searchDocuments||mt("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,r=et.useRequest(NQ,[t,n]);return new Set(r.results.map(i=>({id:i,label:i})))}function pY(){const e=we();e.searchDocuments||mt("searchDocuments");const{customTypesApiBaseUrl:t,repository:n,authStrategy:r}=e,i=nC({baseUrl:t,repository:n,authStrategy:r});return new Set(i.data)}function fBe(e){const{documentTypeId:t,documentUrl:n,title:r,statusColor:i,description:o,tags:a,tagsFilter:s,previewImageUrl:l,highlighted:c,highlightedUID:u,searchTerm:f,onSelect:p}=e;function h(m){return m.nativeEvent instanceof MouseEvent&&(m.metaKey||m.ctrlKey)?window.open(n,"_blank"):p()}return d.jsxs(A.Card,{paddingBlock:16,onSelect:h,variant:c?"highlighted":void 0,color:c?"purple2":void 0,sx:{marginBlock:c?4:0,marginInline:4,flexShrink:0},children:[d.jsx(A.CardContent,{children:d.jsxs(A.Box,{justifyContent:"space-between",gap:6,children:[d.jsxs(A.Box,{flexDirection:"column",gap:4,alignItems:"flex-start",flexGrow:1,children:[d.jsx(pBe,{documentTypeId:t}),d.jsx(ABe,{title:r,statusColor:i,searchTerm:f}),u&&f&&d.jsx(yBe,{uid:u,searchTerm:f}),d.jsx(mBe,{description:o})]}),d.jsx(gBe,{previewImageUrl:l})]})}),a.length>0&&d.jsx(vBe,{tags:a,tagsFilter:s})]})}function pBe(e){const{documentTypeId:t}=e;return d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(A.Badge,{maxWidth:150,size:"medium",title:"Type: error",icon:"description"}),children:d.jsx(I.Suspense,{fallback:d.jsx(A.Skeleton,{width:150,height:24}),children:d.jsx(hBe,{documentTypeId:t})})})}function hBe(e){const{documentTypeId:t}=e,r=[...pY()].find(i=>i.id===t);return d.jsx(A.Badge,{size:"medium",title:`Type: ${(r==null?void 0:r.label)??"Unknown"}`,icon:"description"})}function ABe(e){const{title:t,statusColor:n,searchTerm:r}=e;return d.jsxs(A.Box,{gap:8,alignItems:"center",children:[d.jsx(A.Dot,{color:n}),d.jsx(hY,{text:t,highlight:r})]})}function mBe(e){const{description:t}=e,n=t==null?void 0:t.substring(0,150);return n?d.jsx(A.Text,{variant:"small",color:"grey11",children:`${n}${n!==t?"...":""}`}):d.jsx(A.Text,{variant:"smallItalic",color:"grey11",children:"No description available"})}function gBe(e){const{previewImageUrl:t}=e;return d.jsx(A.Box,{width:142,height:90,backgroundColor:"grey2",border:!0,borderRadius:6,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,flexShrink:0,padding:8,children:t?d.jsx(A.Image,{src:t,sizing:"cover"}):d.jsxs(d.Fragment,{children:[d.jsx(A.Icon,{name:"hideImage",size:"large",color:"grey11"}),d.jsx(A.Text,{color:"grey11",variant:"small",children:"No preview available"})]})})}function vBe(e){const{tags:t}=e;return d.jsxs(A.CardFooter,{children:[d.jsxs(A.Box,{gap:4,alignItems:"center",children:[d.jsx(A.Icon,{name:"label",size:"small",color:"grey11"}),d.jsx(A.Text,{variant:"small",color:"grey11",children:"Tags:"})]}),d.jsx(A.TextOverflow,{children:t.map(n=>d.jsx(A.Badge,{size:"medium",title:n,sx:{marginRight:8}},n))})]})}function yBe(e){const{uid:t,searchTerm:n}=e;return d.jsxs(A.Box,{alignItems:"flex-start",children:[d.jsx(A.Icon,{name:"tag",color:"green11",sx:{width:12,height:12}}),d.jsx(hY,{variant:"uid",highlight:n,text:t})]})}function hY(e){const{text:t,highlight:n,variant:r="title"}=e,i=bBe[r],o=n?t.split(new RegExp(`(${Zn.escapeStringRegexp(n)})`,"gi")):[t];return d.jsx(A.Text,{variant:i.textVariants.text,color:i.colors.text,hyphens:!0,overflowWrap:"anywhere",children:o.map((a,s)=>a.toLowerCase()===(n==null?void 0:n.toLowerCase())?d.jsx(A.Text,{variant:i.textVariants.highlight,hyphens:!0,overflowWrap:"anywhere",highlight:!0,highlightColor:i.colors.highlight,highlightBorderRadius:2,color:i.colors.highlightText,children:a},s):a)})}const bBe={title:{colors:{text:void 0,highlight:void 0,highlightText:"purple11"},textVariants:{text:"bold",highlight:"bold"}},uid:{colors:{text:"green11",highlight:"green3",highlightText:"green11"},textVariants:{text:"extraSmall",highlight:"extraSmall"}}};function CBe(e){const{searchTerm:t,tagsFilter:n,typesFilter:r,localesFilter:i}=e,o=we();o.searchDocuments||mt("searchDocuments");const{storageVersion:a}=et.useRequest(iC,[o.coreApiBaseUrl,o.authStrategy]);o.searchDocuments||mt("searchDocuments");const{status:s}=o,{data:l}=Dr.useSuspenseQuery({...UQ({searchTerm:t,tags:[...ni.map(n,c=>c.id)],customTypes:[...ni.map(r,c=>c.id)],locale:[...ni.map(i,c=>c.id)][0]??"",status:ax[s],storageVersion:a,config:o}),select:c=>SBe(c.results,ax[s]),staleTime:300});return{documents:l.results}}function SBe(e,t){return{results:e.flatMap(r=>{const o=r.versions.filter(a=>t.includes(a.status));return o.length===0?[]:{...r,versions:o}})}}function wBe(e,t){const n=we(),r=ze.useDebounceState({initialState:""}),[i,o]=I.useState(new Set),[a,s]=I.useState(new Set);function l(){return!n.searchDocuments||!n.localeId?new Set:new Set([{id:n.localeId,label:n.localeId}])}const[c,u]=I.useState(l),f=ni.union(a,Bv(e)),p=ni.union(i,Bv(t));return{searchTerm:r,filteredTags:i,setFilteredTags:o,filteredCustomTypes:a,setFilteredCustomTypes:s,filteredLocales:c,setFilteredLocales:u,typesFilter:f,tagsFilter:p}}function Bv(e){return e?ni.map(e,t=>({id:t,label:t})):new Set}function xBe(e){const{filteredLocales:t,setFilteredLocales:n,filteredTags:r,setFilteredTags:i,filteredCustomTypes:o,setFilteredCustomTypes:a,fixedTags:s,fixedCustomTypes:l}=e;return d.jsxs(d.Fragment,{children:[d.jsx(TBe,{selectedValues:t,onSelectedValuesChange:n}),d.jsx(ux,{selectedValues:r,fixedSelectedValues:Bv(s),onSelectedValuesChange:i,label:"Tags",icon:"label",fetchFilters:dBe}),d.jsx(ux,{selectedValues:o,fixedSelectedValues:Bv(l),onSelectedValuesChange:a,label:"Type",icon:"description",fetchFilters:pY})]})}function ux(e){const[t,n]=I.useState(!1),r=I.useRef(null);return d.jsx(A.ErrorBoundary,{ref:r,renderError:()=>{var i;return d.jsx(A.FilterField,{mode:"error",onErrorRetry:(i=r.current)==null?void 0:i.reset,open:t,setOpen:n,values:new Set,...e})},children:d.jsx(I.Suspense,{fallback:d.jsx(A.FilterField,{mode:"loading",open:t,setOpen:n,values:new Set,...e}),children:d.jsx(_Be,{open:t,setOpen:n,...e})})})}function _Be(e){const{open:t,setOpen:n,onSelectedValuesChange:r,fixedSelectedValues:i,selectedValues:o,label:a,icon:s,fetchFilters:l,multiple:c}=e,u=l();return d.jsx(A.FilterField,{open:t,setOpen:n,label:a,icon:s,selectedValues:o,values:new Set(u),fixedSelectedValues:i,onSelectedValuesChange:r,multiple:c})}function TBe(e){const{selectedValues:t,onSelectedValuesChange:n}=e,[r,i]=I.useState(ni.first(t));function o(s){n(s),i(ni.first(s))}const a=ni.find(QL(),s=>{var l;return s.id===((l=ni.first(t))==null?void 0:l.id)});return(a==null?void 0:a.label)!==(r==null?void 0:r.label)&&i(a),d.jsx(ux,{selectedValues:new Set(r?[r]:[]),onSelectedValuesChange:o,label:"Locale",icon:"public",fetchFilters:QL,multiple:!1})}function AY(e){const{onSelectDocument:t,fixedCustomTypes:n,fixedTags:r,linkedDocumentId:i,...o}=e,a=we(),{searchTerm:s,filteredTags:l,setFilteredTags:c,filteredCustomTypes:u,setFilteredCustomTypes:f,filteredLocales:p,setFilteredLocales:h,typesFilter:m,tagsFilter:g}=wBe(n,r);return d.jsxs(A.Dialog,{size:{height:727,width:656},hasClose:!1,...o,children:[d.jsx(A.DialogTitle,{hidden:!0,children:"Link to a page"}),d.jsx(A.DialogDescription,{hidden:!0,children:"Search and select a page to link to"}),d.jsx(A.DialogContent,{children:d.jsxs(A.Box,{flexDirection:"column",height:"100%",children:[d.jsxs(A.Box,{padding:{top:16,inline:16,bottom:8},flexDirection:"column",gap:12,children:[d.jsx(A.FormInput,{value:s.value,onValueChange:s.set,placeholder:"Search a page",icon:"search"}),a.searchDocuments&&d.jsx(xBe,{filteredTags:l,setFilteredTags:c,filteredCustomTypes:u,setFilteredCustomTypes:f,filteredLocales:p,setFilteredLocales:h,fixedTags:r,fixedCustomTypes:n})]}),a.searchDocuments?d.jsx(IBe,{searchTerm:s.debouncedValue,tagsFilter:g,typesFilter:m,localesFilter:p,onSelectDocument:t,linkedDocumentId:i}):d.jsx(gY,{title:"Oops!",message:"Slice Machine does not yet support mock data for linked documents in the simulator."})]})})]})}function IBe(e){const{searchTerm:t,tagsFilter:n,typesFilter:r,localesFilter:i,linkedDocumentId:o,onSelectDocument:a}=e;return d.jsxs(A.ScrollArea,{style:{flexGrow:1,paddingBottom:A.theme.space[16],paddingInline:A.theme.space[12],display:"flex",flexDirection:"column"},children:[o&&d.jsxs(d.Fragment,{children:[d.jsx(YL,{children:"Linked page"}),d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(HL,{description:"An error occurred while fetching the linked page."}),children:d.jsx(I.Suspense,{fallback:MBe,children:d.jsx($Be,{linkedDocumentId:o,tagsFilter:n,onSelectDocument:a})})})]}),d.jsx(YL,{children:"Link to a page"}),d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(HL,{description:"An error occurred while fetching pages."}),children:d.jsx(I.Suspense,{fallback:RBe,children:d.jsx(EBe,{searchTerm:t,tagsFilter:n,localesFilter:i,typesFilter:r,linkedDocumentId:o,onSelectDocument:a})})})]})}function EBe(e){const{searchTerm:t,tagsFilter:n,localesFilter:r,typesFilter:i,linkedDocumentId:o,onSelectDocument:a}=e,{documents:s}=CBe({searchTerm:t,tagsFilter:n,localesFilter:r,typesFilter:i}),l=s.filter(c=>c.id!==o);return l.length===0?d.jsx(gY,{title:s.length===1?"No other pages found!":void 0}):d.jsx(A.Box,{flexDirection:"column",gap:12,children:l.map(c=>{const u=c==null?void 0:c.versions[0];return u?d.jsx(mY,{document:c,version:u,tagsFilter:n,searchTerm:t,onSelectDocument:a},`${c.id}-${u.status}`):null})})}const RBe=d.jsx(A.Box,{flexDirection:"column",gap:12,children:_t.range(1,3).map(e=>d.jsx(A.Skeleton,{height:124,sx:{marginInline:4},zIndex:-1},e))});function HL(e){const{description:t}=e;return d.jsx(A.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",children:d.jsx(A.DefaultErrorMessage,{title:"Request failed",description:t,errorImageSrc:A.dialogErrorImage})})}function $Be(e){const{linkedDocumentId:t,tagsFilter:n,onSelectDocument:r}=e,i=FBe(t),o=kBe(i);return d.jsx(mY,{document:i,version:o,tagsFilter:n,onSelectDocument:r,highlighted:!0})}function kBe(e){return I.useMemo(()=>OBe(e),[e])}function OBe(e){return _t.sort(e.versions,t=>t.status==="unclassified"||t.status==="published"?-1:0,t=>t.status==="release"?-1:0,t=>-t.last_modified_date.getTime())[0]}const MBe=d.jsx(A.Skeleton,{height:124,sx:{marginBlock:4,marginInline:4},zIndex:-1});function FBe(e){const t=we();t.searchDocuments||mt("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return et.useRequest(Qm,[n,r,e])}function mY(e){var p;const{document:t,version:n,tagsFilter:r,highlighted:i,onSelectDocument:o,searchTerm:a}=e,s=we();if(!t||!n)return null;const l=oF({documentId:t.id,versionId:n.status==="archived"?n.version_id:void 0,releaseId:n.status==="release"?n.release_id:void 0,status:n.status,baseUrl:s.baseUrl}),c=jBe({tags:n.tags,tagsFilter:r}),u=nx(n)&&n.summary||kQ(n)&&n.preview_summary||"",f=nx(n)?(p=n.highlights)==null?void 0:p.uid:void 0;return d.jsx(fBe,{documentTypeId:t.custom_type_id,documentUrl:l,description:u,tags:c,title:t.title,previewImageUrl:n.preview_image,onSelect:()=>o(t.id),statusColor:AH[n.status].color,highlighted:i,highlightedUID:f,searchTerm:a})}function YL(e){const{children:t}=e;return d.jsx(A.Box,{position:"sticky",top:0,backgroundColor:"white",padding:{block:6,inline:4},children:d.jsx(A.Text,{variant:"smallBold",color:"grey11",children:t})})}function gY(e){const{title:t="No pages found!",message:n="Consider using different keywords or tweaking your filters to find what you need."}=e;return d.jsx(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:d.jsxs(A.BlankSlate,{children:[d.jsx(A.BlankSlateIcon,{name:"close",lineColor:"tomato11",backgroundColor:"tomato4",size:48}),d.jsx(A.BlankSlateTitle,{size:"big",children:t}),d.jsx(A.BlankSlateDescription,{width:360,children:n})]})})}function jBe(e){const{tags:t,tagsFilter:n}=e,r=[...n].map(o=>o.label).reverse();return _t.sort(t,o=>-r.indexOf(o))}function vY(e){const{hasLink:t,onUnlink:n,selectEnabled:r,selectedType:i,value:o,onOpenLinkModal:a,onValueChange:s,openInNewTab:l=!0,condensedButtons:c=!1,showNewTabButton:u=!1,displayTextEnabled:f,variants:p,variant:h,onVariantChange:m}=e;return d.jsxs(d.Fragment,{children:[!f&&u&&l&&d.jsx(A.Badge,{title:"Open in a new tab",color:"indigo",size:"small",icon:"openInNew",onClick:a}),!t&&r&&d.jsxs(A.Select,{value:i==="any"?void 0:i,color:"grey",size:"small",boldTriggerText:!0,position:"popper",sideOffset:4,startIcon:sd({selectType:i}),disabled:!r,onValueChange:s,placeholder:c?"":Pu("any"),onlyStartIcon:c&&i!==void 0,renderTrigger:({button:g})=>d.jsx(A.Tooltip,{content:Pu(i),visible:c,children:g}),children:[d.jsx(A.SelectItem,{value:"web",icon:"public",children:Pu("web")}),d.jsx(A.SelectItem,{value:"document",icon:"description",children:Pu("document")}),d.jsx(A.SelectItem,{value:"media",icon:"image",children:Pu("media")})]},i===void 0?"unlinked":"linked"),!t&&!r&&d.jsx(A.Button,{startIcon:sd({selectType:i}),color:"grey",textColor:"link",textWeight:"normal",size:"small",onClick:a,children:Pu(i)}),t&&!f&&d.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",onClick:n,"aria-label":"Close"}),t&&f&&d.jsxs(A.ButtonGroup,{density:"compact",children:[d.jsx(A.Button,{startIcon:sd({selectType:i}),renderEndIcon:()=>l&&i==="web"?d.jsx(A.Icon,{name:"openInNew",size:"extraSmall",color:"indigo11"}):null,color:"grey",textColor:"link",textWeight:"normal",size:"small",disabled:!t,onClick:a,children:o.length>30?`${o.slice(0,30)}...`:o}),d.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",onClick:n})]}),p.length>1&&d.jsx(A.Select,{value:h,color:"grey",size:"small",boldTriggerText:!0,position:"popper",sideOffset:4,startIcon:"colorLens",onValueChange:m,children:p.map((g,y)=>d.jsx(A.SelectItem,{value:g,children:g},`${g}-${y}`))})]})}function Pu(e){if(!e||e==="any")return"Choose link type";switch(e){case"document":return"Link to Prismic page";case"web":return"Link to web page";case"media":return"Link to media"}}function yY(e){const{onEdit:t,onUnlink:n,url:r,title:i,subTitle:o}=e,[a,s]=I.useState(null);return d.jsx(A.Card,{paddingBlock:16,ref:s,children:d.jsxs(A.CardContent,{children:[d.jsx(DBe,{url:r,title:i,subTitle:o,onEdit:t,onUnlink:n,container:a}),r&&d.jsx(A.CheckerBoard,{children:d.jsx(LBe,{children:d.jsx(A.Image,{src:r,alt:i,sizing:"contain"})})})]})})}function LBe(e){const{children:t}=e;return d.jsx(A.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:327,children:t})}function DBe(e){const{url:t,title:n,subTitle:r,onEdit:i,onUnlink:o,container:a}=e;return d.jsxs(A.Box,{flexDirection:"row",justifyContent:"space-between",gap:8,children:[d.jsxs(A.Box,{gap:8,minWidth:0,children:[d.jsx(A.ConjoinedIcons,{largeIconName:"image",smallIconName:"link"}),d.jsxs(A.Box,{flexDirection:"column",minWidth:0,children:[d.jsx(A.Text,{noWrap:!0,variant:"smallBold",href:t,inline:!0,children:n}),d.jsx(A.Text,{variant:"small",color:"grey11",children:r})]})]}),d.jsxs(A.ButtonGroup,{size:"medium",color:"grey",children:[i&&d.jsx(A.Tooltip,{content:"Edit link",side:"top",container:a,children:d.jsx(A.Button,{startIcon:"edit",onClick:i})}),o&&d.jsx(A.Tooltip,{content:"Remove link",side:"top",container:a,children:d.jsx(A.Button,{startIcon:"linkOff",onClick:o})})]})]})}function UBe(e){var K,H,z;const{field:t,content:n,onContentChange:r}=e,i=x(),o=((K=t.config)==null?void 0:K.allowText)??!1,a=o&&(n==null?void 0:n.value.text)||void 0,s=((H=t.config)==null?void 0:H.variants)??[],c=(n==null?void 0:n.value.variant)&&s.includes(n==null?void 0:n.value.variant)?n==null?void 0:n.value.variant:s[0],[u,f]=I.useState(C),p=fe.FilledExternalLinkContent.is(n==null?void 0:n.value)&&(n==null?void 0:n.value.target)||void 0,[h,m]=I.useState(!1),g=I.useRef(null);ze.useOnChange(i,k);const y=u?BBe[u]:void 0;function C(){var N,Y;return!((N=t.config)!=null&&N.select)||n!=null&&n.value.__TYPE__?n==null?void 0:n.value.__TYPE__:GL[(Y=t.config)==null?void 0:Y.select]}function x(){return n?fe.FilledDocumentLinkContent.is(n.value)?n.value.id:fe.FilledExternalLinkContent.is(n.value)?n.value.url:fe.FilledFileLinkContent.is(n.value)||fe.FilledImageLinkContent.is(n.value)?n.value.name:"":""}function b(N){var F;const{displayText:Y,variant:ee}=N;if(!Y&&!ee)return r(void 0);switch((F=t.config)==null?void 0:F.select){case"web":return r({__TYPE__:"LinkContent",key:Wu(n),value:{__TYPE__:"ExternalLink",kind:"web",...Y&&{text:Y},...ee&&{variant:ee}}});case"document":return r({__TYPE__:"LinkContent",key:Wu(n),value:{__TYPE__:"DocumentLink",kind:"document",...Y&&{text:Y},...ee&&{variant:ee}}});case"media":return r({__TYPE__:"LinkContent",key:Wu(n),value:{__TYPE__:"MediaLink",kind:"media",...Y&&{text:Y},...ee&&{variant:ee}}});default:return r({__TYPE__:"LinkContent",key:Wu(n),value:{__TYPE__:"AnyLink",kind:"any",...Y&&{text:Y},...ee&&{variant:ee}}})}}function v(N,Y){if(!N)return b({displayText:a,variant:c});const{newTab:ee=!1}=Y??{},F=ee?"_blank":void 0;switch(u){case"ExternalLink":return r({__TYPE__:"LinkContent",key:Wu(n),value:{__TYPE__:"ExternalLink",url:N,target:F,...a&&{text:a},...c&&{variant:c}}});case"DocumentLink":return r({__TYPE__:"LinkContent",key:Wu(n),value:{__TYPE__:"DocumentLink",id:N,...a&&{text:a},...c&&{variant:c}}});default:return r(void 0)}}function S(N){return n?r({__TYPE__:n.__TYPE__,key:n.key,value:{...n.value,text:N}}):b({displayText:N})}function w(N){return n?r({__TYPE__:n.__TYPE__,key:n.key,value:{...n.value,variant:N}}):b({variant:N})}const T=WBe();function E(N){f(N?GL[N]:void 0),v(""),N&&N!=="any"&&T(N)}function R(N){v(N)}function O(){m(!0)}function k(){var N;h&&(m(!1),(N=g.current)==null||N.reset())}function B(N){const Y=bY({media:N});switch(Y.value.__TYPE__){case"ImageLink":return r({__TYPE__:Y.__TYPE__,key:Y.key,value:{...Y.value,...a&&{text:a},...c&&{variant:c}}});case"FileLink":return r({__TYPE__:Y.__TYPE__,key:Y.key,value:{...Y.value,...a&&{text:a},...c&&{variant:c}}})}}return{contentType:u,selectType:y,fieldValue:i,onDisplayTextChange:S,onValueChange:v,onTypeChange:E,placeholder:Ou(t),isTypeSelectEnabled:!((z=t.config)!=null&&z.select),onDocumentSelected:R,onError:O,errorBoundaryRef:g,isTargetNewTab:p==="_blank",onMediaSelected:B,displayTextEnabled:o,displayText:a??"",variants:s,variant:c,onVariantChange:w}}function Wu(e){return e?e.key:crypto.randomUUID()}const BBe={AnyLink:"any",DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media",MediaLink:"media"},GL={any:"AnyLink",document:"DocumentLink",web:"ExternalLink",media:"FileLink"};function PBe(e){const t=we();t.searchDocuments||mt("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return et.useRequest(Qm,[n,r,e]).title}et.cache.registerFetcherConfig(Qm,{concurrency:50});function bY(e){var i,o,a,s,l,c;const{media:t}=e,n="kind"in t;return n&&t.kind==="image"?{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"ImageLink",id:t.id,name:t.filename,url:t.url,kind:"image",size:t.size.toString(),height:((i=t.height)==null?void 0:i.toString())??`${Is}`,width:((o=t.width)==null?void 0:o.toString())??`${Is}`,date:((a=t.last_modified)==null?void 0:a.toString())??""}}:n?{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"FileLink",id:t.id,name:t.filename,kind:"file",url:t.url,size:t.size.toString(),date:((s=t.last_modified)==null?void 0:s.toString())??""}}:{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"ImageLink",id:t.id,name:(t==null?void 0:t.alt)??t.url,kind:"image",url:t.url,size:"0",height:((l=t.height)==null?void 0:l.toString())??`${Is}`,width:((c=t.width)==null?void 0:c.toString())??`${Is}`}}}const WBe=()=>{const e=xUe(),{onAnalyticsEvent:t}=we();function n(r){e&&t&&t("Generic Link Added",{type:r,isInSlice:String(e.isInSlice),isInGroup:String(e.isInGroup),isInRepeatable:String(e.isInRepeatable),customTypeFormat:e.customTypeFormat??"custom"})}return n};function NBe(e){const{open:t,onOpenChange:n,showNewTabButton:r}=e,{url:i,setUrl:o,openInNewTab:a,setOpenInNewTab:s,disabled:l,onUpdate:c}=KBe(e);return d.jsxs(A.Dialog,{open:t,onOpenChange:n,size:"small",noDescription:!0,children:[d.jsx(A.DialogHeader,{title:"Set Link URL"}),d.jsxs(A.DialogContent,{padding:16,children:[d.jsx(A.FormInput,{value:i,onValueChange:o,placeholder:"Paste URL",icon:"public"}),r&&d.jsx(A.InlineLabel,{value:"Open in a new tab",children:d.jsx(A.Checkbox,{checked:a,onCheckedChange:s})})]}),d.jsxs(A.DialogActions,{children:[d.jsx(A.DialogCancelButton,{}),d.jsx(A.DialogActionButton,{onClick:c,disabled:l,children:"Update"})]})]})}function KBe(e){const{url:t,openInNewTab:n,onUpdate:r,open:i}=e,[o,a]=I.useState(t),[s,l]=I.useState(n);ze.useOnChange(i,()=>{i&&(a(t),l(n))});const c=!o||o===t&&s===n;function u(){r(o,{newTab:s})}return{url:o,setUrl:a,openInNewTab:s,disabled:c,setOpenInNewTab:l,onUpdate:u}}function dF(e){var Y,ee,F,M;const{content:t,field:n,id:r,onContentChange:i,appearance:o="normal",backgroundColor:a="grey1"}=e,s=ze.useDebounceState({initialState:!1}),[l,c]=I.useState(),{contentType:u,fieldValue:f,errorBoundaryRef:p,onDocumentSelected:h,onError:m,onMediaSelected:g,onValueChange:y,selectType:C,onTypeChange:x,isTypeSelectEnabled:b,displayTextEnabled:v,...S}=UBe({content:t,field:n,onContentChange:i}),w=u==="DocumentLink"&&f!=="",E=u==="ExternalLink"&&ii.toURL(f),R=!!((Y=n.config)!=null&&Y.allowTargetBlank);function O(){switch(u){case"DocumentLink":return c("document");case"ExternalLink":return c("web");case"FileLink":case"ImageLink":case"MediaLink":return c("media");default:return c(void 0)}}const k={...S,id:r,onFocus:()=>s.set(!0),onBlur:()=>s.set(!1),onOpenLinkModal:O,onUnlink:()=>{b?x(void 0):y("")},onSelectValueChange:W=>{x(W),c(W)},value:f,allowTargetBlank:R,selectType:C,onValueChange:y,isTypeSelectEnabled:b,displayTextEnabled:v,onKeyDown(W){v||(W.key==="Enter"||W.key===" ")&&(O(),W.preventDefault())},onClick:()=>{v||O()},appearance:o},{searchDocuments:B}=we();function K(W){if(W)return;const re=t&&t.value.__TYPE__!=="AnyLink";!W&&!re&&b&&x(void 0),c(void 0)}function H(W,re){y(W,re),c(void 0)}function z(W){g(W),c(void 0)}function N(W){h(W),c(void 0)}return d.jsxs(d.Fragment,{children:[d.jsxs(A.Popover,{align:"start",sideOffset:-3,focusOnEnter:!1,open:s.debouncedValue,anchor:d.jsxs(A.Field,{variant:qBe(o),color:a,children:[w?d.jsx(QBe,{documentId:f,displayTextEnabled:v}):d.jsx(A.FieldIcon,{name:sd({selectType:C,displayTextEnabled:v})}),o!=="compact"&&d.jsx(A.FieldLabel,{htmlFor:r,children:_r(n)}),d.jsx(A.FieldControl,{children:w&&B?d.jsx(YBe,{errorBoundaryRef:p,onError:m,fallback:d.jsx(dx,{...k,value:"..."}),renderError:()=>VBe(k),children:d.jsx(zBe,{...k,documentId:f})}):d.jsx(dx,{...k})})]}),children:[E&&d.jsx(xc,{url:E,title:ii.getUrlTitle(E)??"",subTitle:E.toString()}),t&&fe.FilledImageLinkContent.is(t.value)&&d.jsx(yY,{url:t.value.url,title:t.value.name,subTitle:`${t.value.width} x ${t.value.height} pixels`})]}),d.jsx(NBe,{open:l==="web",onOpenChange:K,onUpdate:H,url:f,openInNewTab:S.isTargetNewTab,showNewTabButton:!!((ee=n.config)!=null&&ee.allowTargetBlank)}),d.jsx(uF,{open:l==="media",onOpenChange:K,onMediaSelected:z,assetType:"all"}),d.jsx(AY,{open:l==="document",onOpenChange:K,onSelectDocument:N,fixedCustomTypes:new Set((F=n.config)==null?void 0:F.customtypes),fixedTags:new Set((M=n.config)==null?void 0:M.tags),linkedDocumentId:t&&fe.FilledDocumentLinkContent.is(t.value)?t.value.id:void 0})]})}function qBe(e){switch(e){case"compact":return"compact";case"normal":return"normal";default:return}}function VBe(e){return d.jsx(dx,{...e})}function dx(e){const{id:t,value:n,onOpenLinkModal:r,onBlur:i,isTypeSelectEnabled:o,selectType:a,onSelectValueChange:s,onUnlink:l,isTargetNewTab:c,allowTargetBlank:u,displayTextEnabled:f,displayText:p,onFocus:h,onClick:m,onKeyDown:g,appearance:y,placeholder:C,variants:x,variant:b,onVariantChange:v,onDisplayTextChange:S,onValueChange:w}=e;return d.jsx(A.Box,{padding:{block:4},width:"100%",children:d.jsx(Tl,{id:t,textOverflow:"ellipsis",variant:f?"normal":"link",readOnly:!f,placeholder:f?"Add your display text":C,padding:CY(y),value:f?p:n,cursor:SY({value:n,displayTextEnabled:f,isTypeSelectEnabled:o}),onBlur:i,onFocus:h,onClick:m,onKeyDown:g,onValueChange:f?S:w,endAdornment:d.jsx(vY,{hasLink:!!(n&&a),onUnlink:l,selectEnabled:o,selectedType:a,value:n,onOpenLinkModal:r,onValueChange:s,openInNewTab:c,condensedButtons:y==="condensedButtons",showNewTabButton:u&&a==="web",displayTextEnabled:f,variants:x,variant:b,onVariantChange:v})})})}function zBe(e){const{id:t,documentId:n,onOpenLinkModal:r,isTypeSelectEnabled:i,selectType:o,displayTextEnabled:a,onSelectValueChange:s,onUnlink:l,onFocus:c,onClick:u,onKeyDown:f,appearance:p,variants:h,variant:m,displayText:g,onVariantChange:y,onDisplayTextChange:C}=e,x=PBe(n),b=wY(n);return d.jsx(Tl,{id:t,textOverflow:"ellipsis",padding:CY(p),placeholder:a?"Add your display text":void 0,readOnly:!a,value:a?g:x,variant:a?"normal":"link",cursor:SY({value:x,displayTextEnabled:a,isTypeSelectEnabled:i}),onFocus:c,onClick:u,onKeyDown:f,onValueChange:a?C:void 0,endAdornment:d.jsxs(A.Box,{gap:4,children:[b&&d.jsx(A.Badge,{title:"Broken Link",color:"tomato"}),d.jsx(vY,{hasLink:!0,onUnlink:l,selectEnabled:i,selectedType:o,value:x,onOpenLinkModal:r,condensedButtons:p==="condensedButtons",onValueChange:s,displayTextEnabled:a,variants:h,variant:m,onVariantChange:y})]})})}function QBe(e){const{documentId:t,displayTextEnabled:n}=e;return d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(A.FieldIcon,{name:"warning"}),children:d.jsx(I.Suspense,{fallback:d.jsx(A.FieldIcon,{name:sd({selectType:"document",displayTextEnabled:n})}),children:d.jsx(HBe,{documentId:t,displayTextEnabled:n})})})}function HBe(e){const{displayTextEnabled:t,documentId:n}=e;return wY(n)?d.jsx(A.FieldIcon,{name:"linkOff"}):d.jsx(A.FieldIcon,{name:sd({selectType:"document",displayTextEnabled:t})})}function CY(e){switch(e){case"compact":return{input:{inline:4}};default:return}}function YBe(e){const{errorBoundaryRef:t,onError:n,children:r,fallback:i,renderError:o}=e;return d.jsx(A.ErrorBoundary,{ref:t,onError:n,renderError:o,children:d.jsx(I.Suspense,{fallback:i,children:r})})}function sd(e){const{selectType:t,displayTextEnabled:n}=e;if(n)return"notes";switch(t){case"document":return"description";case"web":return"public";case"media":return"image";default:return"link"}}function SY(e){const{value:t,displayTextEnabled:n,isTypeSelectEnabled:r}=e;return n?"text":r&&!t?"default":"pointer"}function GBe(e){const{onContentChange:t,...n}=e;function r(i){const o=fe.FilledLinkContent.is(i)?i:void 0;t(o)}return d.jsx(dF,{...n,onContentChange:r})}function wY(e){const t=we();t.uidField||mt("uidField");const{coreApiBaseUrl:n,authStrategy:r}=t,{data:i}=JM({baseUrl:n,authStrategy:r,documentIds:[e],statuses:["archived","unclassified","published"]});if(i.results.length===0||i.results.length>1)return!1;const o=i.results[0];return o==null?void 0:o.versions.every(a=>a.status==="archived")}function JBe(e){const{onDelete:t,isDeleteEnabled:n,onMoveUp:r,onMoveDown:i,isMoveUpEnabled:o,isMoveDownEnabled:a}=e;return d.jsxs(A.DropdownMenu,{children:[d.jsx(A.DropdownMenuTrigger,{children:d.jsx(A.IconButton,{hiddenLabel:"Link actions",icon:"moreVert",size:"small",variant:"solid"})}),d.jsxs(A.DropdownMenuContent,{children:[d.jsx(A.DropdownMenuLabel,{children:d.jsx(A.Text,{variant:"small",color:"grey11",children:"Item options"})}),d.jsx(A.DropdownMenuItem,{onSelect:r,startIcon:d.jsx(A.Icon,{name:"arrowUpward"}),disabled:!o,children:"Move up"}),d.jsx(A.DropdownMenuItem,{onSelect:i,startIcon:d.jsx(A.Icon,{name:"arrowDownward"}),disabled:!a,children:"Move down"}),d.jsx(A.DropdownMenuItem,{color:"tomato",onSelect:t,startIcon:d.jsx(A.Icon,{name:"delete",color:"tomato9"}),disabled:!n,children:"Delete"})]})]})}function ZBe(e){const{field:t,content:n,onContentChange:r}=e,{config:i}=t,o=I.useMemo(()=>WS({config:i}),[i]),a=n!=null&&n.value.length?n.value:[o];function s(p){const h=_t.insertAtIndex(a,p,WS({config:i}));r(wp(h))}function l(p,h){var y;const m=[...a],g=WS({config:i,key:(y=m[h])==null?void 0:y.key});m[h]=p??g,r(wp(m))}function c(p){r(wp(p))}function u(p){const h=_t.removeIndex(a,p);r(wp(h))}function f(p,h){const m=_t.move(a,h,h+XBe(p));r(wp(m))}return{links:a,updateLink:l,updateLinks:c,addLink:s,deleteLink:u,moveLink:f}}function XBe(e){switch(e){case"up":return-1;case"down":return 1}}function WS(e){const{config:t,key:n=crypto.randomUUID()}=e,r=ePe(t==null?void 0:t.select);return t!=null&&t.allowText&&(r.text=""),{__TYPE__:"LinkContent",key:n,value:r}}function ePe(e){switch(e){case"web":return{__TYPE__:"ExternalLink",kind:"web"};case"document":return{__TYPE__:"DocumentLink",kind:"document"};case"media":return{__TYPE__:"MediaLink",kind:"media"};default:return{__TYPE__:"AnyLink",kind:"any"}}}function wp(e){return{__TYPE__:"RepeatableContent",type:"Link",value:e}}function tPe(e){const{id:t,field:n}=e,r=ZBe(e),[i,o]=I.useState(!1),{links:a}=r;return d.jsx(wUe,{children:d.jsxs(A.FieldSet,{id:t,legend:nPe(n.config),variant:"compact",selected:i,children:[d.jsx(rPe,{field:n,items:a,onItemDelete:r.deleteLink,onItemChange:r.updateLink,onItemMove:r.moveLink,onItemAdd:r.addLink,onItemReorder:r.updateLinks,onDragStatusChange:o}),d.jsx(A.Button,{startIcon:"add",color:"grey",onClick:()=>r.addLink(a.length),sx:{marginInline:4,marginBlock:4},children:"Add"})]})})}function nPe(e){return e!=null&&e.label?`Multiple • ${e.label}`:"Multiple"}function rPe(e){const{field:t,items:n,onItemChange:r,onItemDelete:i,onItemMove:o}=e,a=n.length>1,s=iPe(e);return d.jsx(A.AnimatedList,{items:n,getItemKey:l=>l.key,ariaLabel:"Link list",dnd:s,children:(l,c)=>d.jsxs(A.Draggable,{disabled:!a,children:[d.jsx(dF,{appearance:"compact",content:l,field:t,onContentChange:u=>r(u,c),backgroundColor:"transparent"}),d.jsx(JBe,{onDelete:()=>i(c),isDeleteEnabled:n.length>1,onMoveUp:()=>o("up",c),isMoveUpEnabled:c>0,onMoveDown:()=>o("down",c),isMoveDownEnabled:c<n.length-1})]})})}function iPe(e){const{onDragStatusChange:t,onItemReorder:n,onItemAdd:r}=e,{scrollOffsetTop:i}=we(),o=ze.useStableCallback(r);return{renderDropIndicator:s=>d.jsx(oPe,{...s,onItemAdd:o}),scrollOffsetTop:i,onDragChange:t,onReorder:n}}function oPe(e){const{isDropTarget:t,itemIndex:n,position:r,itemCount:i,onItemAdd:o}=e;return n===0&&r==="before"?d.jsx(JL,{isDropTarget:t,position:"before"}):n===i-1&&r==="after"?d.jsx(JL,{isDropTarget:t,position:"after"}):d.jsx(aPe,{index:n,isDropTarget:t,onItemAdd:o})}function aPe(e){const{index:t,onItemAdd:n,isDropTarget:r}=e,[i,o]=I.useState(0);function a(){n(t+1),o(s=>s+1)}return d.jsx(A.HairlineButton,{icon:"add",size:"small",variant:"rightDashed",tooltip:{content:"Add item below"},onClick:a,dropMode:r,sx:{marginInline:4}},i)}function JL(e){const{isDropTarget:t,position:n}=e;return d.jsx(A.AnimatedElement,{enterDuration:150,animation:{name:"expand-vertical"},children:t&&d.jsx(A.Box,{children:d.jsx(A.Line,{color:"purple",thickness:2,sx:{width:"100%",marginBottom:n==="before"?4:void 0,marginTop:n==="after"?4:void 0}},"line")})})}function sPe(e){const{linkTo:t,onLinkToChange:n}=e,r=lPe(t);return d.jsx(GBe,{content:r,onContentChange:i=>n(cPe(i)),field:{type:"Link",config:{label:"Link",allowTargetBlank:!0,allowText:!1}},appearance:"condensedButtons"})}function lPe(e){const[t]=I.useState(()=>crypto.randomUUID());if(e)return{__TYPE__:"LinkContent",key:t,value:e}}function cPe(e){return e==null?void 0:e.value}function xY(e){var b,v;const{allContentViews:t,content:n,contentView:r,fieldLabel:i,imageLabel:o,initialImages:a,isUpdating:s,page:l=0,readOnly:c,thumbnailName:u,onClear:f,onContentChange:p,onCropperDialogClose:h,onPageChange:m,onMediaDialogOpenChange:g}=e,y=((v=(b=n==null?void 0:n.url)==null?void 0:b.split("?")[0])==null?void 0:v.slice(-4))===".svg",C=n!=null&&n.url&&!c?"visible":"hidden",x=!fe.isImageContent(n);return d.jsxs(A.Box,{display:"flex",gap:12,padding:{inline:12},children:[d.jsx(A.Box,{children:d.jsx(A.Carousel,{getItemSource:cDe,items:t,onPageChange:m,page:l,buttonSize:"small",renderPrevTooltip:S=>d.jsx(A.Tooltip,{content:"Previous",children:S}),renderNextTooltip:S=>d.jsx(A.Tooltip,{content:"Next",children:S}),style:x?{width:181,height:142}:{width:123,height:93},children:S=>(S==null?void 0:S.url)&&d.jsx(A.CarouselItem,{"aria-label":"Image Field Item",src:qH(S.url),alt:S.alt??void 0,isUpdating:s,disableAnimation:x},`${u}_${S.url}`)})}),d.jsxs(A.Box,{width:"100%",display:"flex",flexDirection:"column",gap:x?16:12,children:[d.jsx(oBe,{fieldLabel:i,imageLabel:o,initialImages:a,page:l,displaySeparator:!x,isSVGContentView:y,visibility:C,onClear:f,onCropperDialogClose:h,onMediaDialogOpenChange:g}),d.jsx(iBe,{readOnly:c||!r,altText:(r==null?void 0:r.alt)??"",onValueChange:S=>{r&&p(oDe(u,n,r,S))}}),x&&d.jsx(sPe,{linkTo:n.linkTo,onLinkToChange:S=>{p({...n,linkTo:S})}})]})]})}function _Y(e){const{onMediaSelected:t}=e,n=we(),{showAlert:r}=A.useAlert(),{mutate:i,isPending:o}=Dr.useMutation({mutationFn:a=>RH({file:a,config:n}),onSuccess:a=>{t(a)},onError:()=>{r({title:"Error uploading image",subtitle:"Please try again"})}});return{uploadImage:i,isUploadingImage:o}}function uPe(e){const{content:t,onContentChange:n,field:r}=e,[i,o]=I.useState(0),[a,s]=I.useTransition(),l=rDe(r),c=l[i],u=t?iDe(r,t):void 0,f=u==null?void 0:u[i];function p(x){if(!c)return;const b=uDe(c.name,r,t,x);b!==t&&s(()=>n(b))}function h(x){s(()=>o(x))}function m({option:x,croppedImages:b}){if(o(x),!t)return;const v=Object.entries(b).reduce((S,[w,T])=>ZUe({field:r,content:S,thumbnail:w,croppedImage:T}),t);v!==t&&s(()=>n(v))}function g(){o==null||o(0),n(void 0)}const{uploadImage:y,isUploadingImage:C}=_Y({onMediaSelected:p});return{onCropperDialogClose:m,onPageChange:h,onMediaSelected:p,isUpdating:a,page:i,thumbnail:c,allThumbnails:l,allContentViews:u,contentView:f,onClear:g,uploadImage:y,isUploadingImage:C}}function dPe(e){const{content:t,field:n,readOnly:r,onContentChange:i}=e,o=t&&t.origin.url.length>0,{onCropperDialogClose:a,onPageChange:s,isUpdating:l,page:c,onMediaSelected:u,thumbnail:f,allThumbnails:p,allContentViews:h,contentView:m,onClear:g,uploadImage:y,isUploadingImage:C}=uPe({field:n,content:t,onContentChange:i}),[x,b]=I.useState(!1),v=_r(n),S=p.map((R,O)=>{const k=h==null?void 0:h[O];return{thumbnail:R,contentView:k,labels:sx(R,t,k)}}),w=f&&o?sx(f,t,m).filter(Qi.isDefined):[],T=f&&t&&o&&h,E=C||l;return d.jsx(lY,{isMediaDialogOpen:x,onMediaSelected:u,onMediaDialogOpenChange:b,children:d.jsx(I.Suspense,{fallback:d.jsx("div",{style:{height:95}}),children:T?d.jsx(xY,{allContentViews:h,content:t,contentView:m,fieldLabel:v,imageLabel:w,initialImages:S,isUpdating:E,page:c,readOnly:r,thumbnailName:f.name,onClear:g,onContentChange:i,onCropperDialogClose:a,onMediaDialogOpenChange:b,onPageChange:s}):d.jsx(cY,{uploadImage:y,isUploading:C,disabled:r||x,children:d.jsx(oY,{fieldLabel:v,isUpdating:E,readOnly:r,onMediaDialogOpenChange:b})})})})}function fPe(e){var y,C;const{searchTerm:t,catalogId:n}=e,r=we();r.integrationFields||mt("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,[s,l]=I.useState(1),[c,u]=I.useState([]),[f,p]=I.useState(""),h=et.useRequest(pPe,[i,a,o,n,t,t===f?s:1]);t!==f?(p(t),l(1),u(h.items)):h.items.length>0&&((y=_t.last(c))==null?void 0:y.id)!==((C=_t.last(h.items))==null?void 0:C.id)&&u(x=>x.concat(h.items));const m=s<h.totalPages;function g(){m&&l(x=>x+1)}return{items:c,response:h,fetchNextPage:g,hasNextPage:m}}function pPe(e,t,n,r,i,o=1,a=30){const s=new URL(`if/search/${r}`,e);return s.searchParams.set("searchTerm",i),s.searchParams.set("limit",a.toString()),s.searchParams.set("page",o.toString()),se.request(s,{headers:{repository:n},credentials:se.getRequestCredentials(t),okType:hPe})}const TY=$.object({id:$.string(),title:$.string(),imageURL:$.string().optional(),description:$.string().optional()}),hPe=$.object({items:$.array(TY),totalPages:$.number(),page:$.number()});function IY(e){const{itemId:t,catalogId:n}=e,r=we();r.integrationFields||mt("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,l=et.useRequest(APe,[i,a,o,n,t]).items[0];if(!l)throw new Error("Item not found");return{item:l}}function APe(e,t,n,r,i){const o=new URL(`if/read/${r}`,e);return o.searchParams.set("ids",[i].toString()),se.request(o,{headers:{repository:n},credentials:se.getRequestCredentials(t),okType:mPe})}const mPe=$.object({items:$.array(TY)});function fF(e){const{item:t,onClick:n,catalogId:r}=e;return d.jsxs(A.PreviewCard,{variant:"large",onClick:n,children:[d.jsx(gPe,{src:t.imageURL??"",alt:t.title}),d.jsxs(A.PreviewContent,{children:[d.jsx(A.Badge,{title:`Catalog: ${r}`,icon:"multipleStop",size:"medium"}),d.jsx(A.Text,{variant:"bold",color:"grey12",sx:{marginTop:4},children:t.title}),d.jsx(A.Text,{variant:"small",color:"grey11",children:t.description??t.id})]})]})}const _g=76;function gPe(e){const{src:t,alt:n}=e;return t?d.jsx(A.PreviewImage,{src:t,alt:n,width:_g,height:_g,framed:!0}):d.jsxs(A.Box,{borderRadius:6,backgroundColor:"grey2",height:_g,width:_g,flexDirection:"column",alignItems:"center",justifyContent:"center",border:!0,padding:{inline:4,block:8},children:[d.jsx(A.Icon,{name:"hideImage",size:"large",color:"grey11"}),d.jsx(A.Text,{color:"grey11",variant:"small",noSelect:!0,align:"center",children:"No preview image"})]})}function Qu(){return d.jsxs(A.PreviewCard,{variant:"large",children:[d.jsx(A.Skeleton,{height:76,width:76}),d.jsxs(A.PreviewContent,{children:[d.jsx(A.Skeleton,{height:24,width:168}),d.jsx(A.Skeleton,{height:24,width:240,sx:{marginTop:4}}),d.jsx(A.Skeleton,{height:16,width:144})]})]})}function vPe(e){const{open:t,onOpenChange:n,catalogId:r,onSelectItem:i}=e,o=ze.useDebounceState({initialState:""}),a=we();return d.jsx(A.Dialog,{open:t,onOpenChange:n,hasClose:!1,size:{width:612,height:724},noDescription:!0,children:d.jsx(A.DialogContent,{children:d.jsxs(A.Box,{flexDirection:"column",height:"100%",children:[d.jsxs(A.Box,{padding:{top:16,inline:16},flexDirection:"column",gap:8,children:[d.jsx(A.FormSearchInput,{value:o.value,onValueChange:o.set,placeholder:"Search in your catalog"}),d.jsx(A.DialogTitle,{asChild:!0,children:d.jsx(A.Text,{variant:"smallBold",color:"grey11",children:"Select an item"})})]}),a.integrationFields?d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(fx,{message:"There was an error while fetching your catalog items."}),children:d.jsx(I.Suspense,{fallback:d.jsxs(A.Box,{flexDirection:"column",gap:12,padding:{top:10,inline:16,bottom:16},children:[d.jsx(Qu,{}),d.jsx(Qu,{}),d.jsx(Qu,{}),d.jsx(Qu,{}),d.jsx(Qu,{})]}),children:d.jsx(yPe,{searchTerm:o.debouncedValue,catalogId:r,onItemClick:i})})}):d.jsx(fx,{message:"Slice Machine does not yet support mock data for integration field in the simulator."})]})})})}function yPe(e){const{catalogId:t,searchTerm:n,onItemClick:r}=e,[i,o]=I.useTransition(),{items:a,hasNextPage:s,fetchNextPage:l}=fPe({catalogId:t,searchTerm:n});return d.jsx(d.Fragment,{children:d.jsxs(A.ScrollArea,{onScrollToBottom:()=>s&&o(l),style:{flexGrow:1,paddingTop:A.theme.space[10],paddingBottom:A.theme.space[16],paddingInline:A.theme.space[16],display:"flex",flexDirection:"column",gap:A.theme.space[12]},threshold:252,children:[a.length===0?d.jsx(fx,{}):a.map(c=>d.jsx(fF,{item:c,catalogId:t,onClick:()=>r(c)},c.id)),d.jsx(A.AnimatedElement,{animation:{name:"fade"},children:i&&d.jsx(A.Text,{color:"grey11",align:"center",sx:{marginBlock:8},children:"Loading more results ..."})})]})})}function fx(e){const{message:t="We can't find any items matching your search"}=e,n="Oops!";return d.jsx(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:d.jsxs(A.BlankSlate,{children:[d.jsx(A.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(A.BlankSlateTitle,{size:"big",children:n}),d.jsx(A.BlankSlateDescription,{width:360,children:t})]})})}function bPe(e){const{itemId:t,item:n}=e,r=we();return t&&n&&n.id===t?d.jsx(Hu,{...e,value:n.title}):t&&r.integrationFields?d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(Hu,{...e,value:t}),children:d.jsx(I.Suspense,{fallback:d.jsx(Hu,{...e,value:t}),children:d.jsx(wPe,{...e,itemId:t})},t)},t):t&&!r.integrationFields?d.jsx(Hu,{...e,value:t}):d.jsx(Hu,{...e,value:""})}function CPe(e){const{catalogId:t,itemId:n,item:r}=e,i=we();return n&&r&&r.id===n?d.jsx(A.FieldFooter,{children:d.jsx(fF,{catalogId:t,item:r})}):n&&i.integrationFields?d.jsx(A.ErrorBoundary,{renderError:()=>null,children:d.jsx(A.FieldFooter,{children:d.jsx(I.Suspense,{fallback:d.jsx(Qu,{}),children:d.jsx(SPe,{catalogId:t,itemId:n})},n)})},n):null}function SPe(e){const{itemId:t,catalogId:n}=e,{item:r}=IY({catalogId:n,itemId:t});return d.jsx(fF,{catalogId:n,item:r})}function Hu(e){const{id:t,field:n,readOnly:r,value:i,onFocus:o,onClearItem:a}=e;return d.jsx(Tl,{id:t,placeholder:Ou(n),readOnly:!0,variant:"link",value:i,...!r&&{cursor:"pointer",onFocus:o},endAdornment:d.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",disabled:!i,onClick:a})})}function wPe(e){const{itemId:t,catalogId:n}=e,{item:r}=IY({catalogId:n,itemId:t});return d.jsx(Hu,{...e,value:r.title})}function xPe(e){var h;const{id:t,field:n,content:r,readOnly:i,onContentChange:o}=e,[a,s]=I.useState(!1),[l,c]=I.useState(),u=(h=n.config)==null?void 0:h.catalog;if(!u)return null;function f(m){o({value:m.id,__TYPE__:"IntegrationFieldsContent"}),c(m),s(!1)}function p(){o(void 0),c(void 0)}return d.jsxs(d.Fragment,{children:[d.jsxs(A.Field,{footer:d.jsx(CPe,{catalogId:u,item:l,itemId:r==null?void 0:r.value}),children:[d.jsx(A.FieldIcon,{name:"multipleStop"}),d.jsx(A.FieldLabel,{htmlFor:t,children:_r(n)}),d.jsx(A.FieldControl,{children:d.jsx(bPe,{id:t,field:n,readOnly:i,catalogId:u,item:l,itemId:r==null?void 0:r.value,onFocus:()=>s(!0),onClearItem:p})})]}),d.jsx(vPe,{open:a,onOpenChange:s,catalogId:u,onSelectItem:f})]})}function EY(e){const{content:t,field:n,id:r,onContentChange:i,readOnly:o,endAdornment:a,placeholder:s}=e;return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"notes"}),d.jsx(A.FieldLabel,{htmlFor:r,children:_r(n)}),d.jsxs(A.FieldControl,{children:[d.jsx(A.TextArea,{id:r,placeholder:s||Ou(n),readOnly:o,paddingLeft:4,paddingRight:12,sx:{flexGrow:1},value:(t==null?void 0:t.value)??"",onChange:l=>{i(_Pe(l))}}),a]})]})}function _Pe(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}function TPe(e){var s;const{content:t,id:n,field:r,onContentChange:i,readOnly:o}=e,a={id:n,readOnly:o,onContentChange:i};return(s=r.config)!=null&&s.repeat?d.jsx(tPe,{...a,field:r,content:fH(t)}):d.jsx(dF,{...a,field:r,content:pH(t)})}const IPe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var s,l;const o=Number(e==null?void 0:e.value),a=Number.isFinite(o)?o:void 0;return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"pin"}),d.jsx(A.FieldLabel,{htmlFor:n,children:_r(t)}),d.jsx(A.FieldControl,{children:d.jsx(A.NumberInput,{id:n,value:a,min:(s=t.config)==null?void 0:s.min,max:(l=t.config)==null?void 0:l.max,padding:tY,placeholder:Ou(t),readOnly:i,onValueChange:c=>r(EPe(c))})})]})};function EPe(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function En(e){this.content=e}En.prototype={constructor:En,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new En(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new En(n)},addToStart:function(e,t){return new En([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new En(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new En(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=En.from(e),e.size?new En(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=En.from(e),e.size?new En(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=En.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};En.from=function(e){if(e instanceof En)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new En(t)};function RY(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=RY(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function $Y(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=e.child(--i),s=t.child(--o),l=a.nodeSize;if(a==s){n-=l,r-=l;continue}if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){let c=0,u=Math.min(a.text.length,s.text.length);for(;c<u&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){let c=$Y(a.content,s.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class q{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,s=0;s<n;a++){let l=this.content[a],c=s+l.nodeSize;if(c>t&&r(l,i+s,o||null,a)!==!1&&l.content.size){let u=s+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,n-u),r,i+u)}s=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(s,l)=>{let c=s.isText?s.text.slice(Math.max(t,l)-l,n-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&c||s.isTextblock)&&r&&(a?a=!1:o+=r),o+=c},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new q(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,a=0;a<n;o++){let s=this.content[o],l=a+s.nodeSize;l>t&&((a<t||l>n)&&(s.isText?s=s.cut(Math.max(0,t-a),Math.min(s.text.length,n-a)):s=s.cut(Math.max(0,t-a-1),Math.min(s.content.size,n-a-1))),r.push(s),i+=s.nodeSize),a=l}return new q(r,i)}cutByIndex(t,n){return t==n?q.empty:t==0&&n==this.content.length?this:new q(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new q(i,o)}addToStart(t){return new q([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new q(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return RY(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return $Y(this,t,n,r)}findIndex(t,n=-1){if(t==0)return Tg(0,t);if(t==this.size)return Tg(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=t)return a==t||n>0?Tg(r+1,a):Tg(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return q.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new q(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return q.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new q(n||t,r)}static from(t){if(!t)return q.empty;if(t instanceof q)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new q([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}q.empty=new q([],0);const NS={index:0,offset:0};function Tg(e,t){return NS.index=e,NS.offset=t,NS}function Pv(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Pv(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Pv(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let xt=class px{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Pv(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return px.none;if(t instanceof px)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};xt.none=[];class _c extends Error{}class V{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=OY(this.content,t+this.openStart,n);return r&&new V(r,this.openStart,this.openEnd)}removeBetween(t,n){return new V(kY(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return V.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new V(q.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new V(t,r,i)}}V.empty=new V(q.empty,0,0);function kY(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:a,offset:s}=e.findIndex(n);if(i==t||o.isText){if(s!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(kY(o.content,t-i-1,n-i-1)))}function OY(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),a=e.maybeChild(i);if(o==t||a.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=OY(a.content,t-o-1,n);return s&&e.replaceChild(i,a.copy(s))}function RPe(e,t,n){if(n.openStart>e.depth)throw new _c("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new _c("Inconsistent open depths");return MY(e,t,n,0)}function MY(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let a=MY(e,t,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,s=a.content;return Xl(a,s.cut(0,e.parentOffset).append(n.content).append(s.cut(t.parentOffset)))}else{let{start:a,end:s}=$Pe(n,e);return Xl(o,jY(e,a,s,t,r))}else return Xl(o,Wv(e,t,r))}function FY(e,t){if(!t.type.compatibleContent(e.type))throw new _c("Cannot join "+t.type.name+" onto "+e.type.name)}function hx(e,t,n){let r=e.node(n);return FY(r,t.node(n)),r}function Zl(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Hp(e,t,n,r){let i=(t||e).node(n),o=0,a=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Zl(e.nodeAfter,r),o++));for(let s=o;s<a;s++)Zl(i.child(s),r);t&&t.depth==n&&t.textOffset&&Zl(t.nodeBefore,r)}function Xl(e,t){return e.type.checkContent(t),e.copy(t)}function jY(e,t,n,r,i){let o=e.depth>i&&hx(e,t,i+1),a=r.depth>i&&hx(n,r,i+1),s=[];return Hp(null,e,i,s),o&&a&&t.index(i)==n.index(i)?(FY(o,a),Zl(Xl(o,jY(e,t,n,r,i+1)),s)):(o&&Zl(Xl(o,Wv(e,t,i+1)),s),Hp(t,n,i,s),a&&Zl(Xl(a,Wv(n,r,i+1)),s)),Hp(r,null,i,s),new q(s)}function Wv(e,t,n){let r=[];if(Hp(null,e,n,r),e.depth>n){let i=hx(e,t,n+1);Zl(Xl(i,Wv(e,t,n+1)),r)}return Hp(t,null,n,r),new q(r)}function $Pe(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(q.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class Dh{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return xt.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let s=r;r=i,i=s}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Nv(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:s,offset:l}=a.content.findIndex(o),c=o-l;if(r.push(a,s,i+l),!c||(a=a.child(s),a.isText))break;o=c-1,i+=l+1}return new Dh(n,r,o)}static resolveCached(t,n){let r=ZL.get(t);if(r)for(let o=0;o<r.elts.length;o++){let a=r.elts[o];if(a.pos==n)return a}else ZL.set(t,r=new kPe);let i=r.elts[r.i]=Dh.resolve(t,n);return r.i=(r.i+1)%OPe,i}}class kPe{constructor(){this.elts=[],this.i=0}}const OPe=12,ZL=new WeakMap;class Nv{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const MPe=Object.create(null);let ec=class Ax{constructor(t,n,r,i=xt.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||q.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Pv(this.attrs,n||t.defaultAttrs||MPe)&&xt.sameSet(this.marks,r||xt.none)}copy(t=null){return t==this.content?this:new Ax(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new Ax(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return V.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),s=i.start(a),c=i.node(a).content.cut(i.pos-s,o.pos-s);return new V(c,i.depth-a,o.depth-a)}replace(t,n,r){return RPe(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Dh.resolveCached(this,t)}resolveNoCache(t){return Dh.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),LY(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=q.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),s=a&&a.matchFragment(this.content,n);if(!s||!s.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=xt.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!xt.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=q.fromJSON(t,n.content),o=t.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};ec.prototype.text=void 0;class Kv extends ec{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):LY(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Kv(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Kv(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function LY(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Tc{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new FPe(t,n);if(r.next==null)return Tc.empty;let i=DY(r);r.next&&r.err("Unexpected trailing text");let o=WPe(PPe(i));return NPe(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(a,s){let l=a.matchFragment(t,r);if(l&&(!n||l.validEnd))return q.from(s.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:u,next:f}=a.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let p=o(f,s.concat(u));if(p)return p}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:l}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in n)&&(!i.type||l.validEnd)&&(r.push({match:s.contentMatch,type:s,via:i}),n[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return o}).join(`
71
+ `)}}Tc.empty=new Tc(!0);class FPe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function DY(e){let t=[];do t.push(jPe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function jPe(e){let t=[];do t.push(LPe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function LPe(e){let t=BPe(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=DPe(e,t);else break;return t}function XL(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function DPe(e,t){let n=XL(e),r=n;return e.eat(",")&&(e.next!="}"?r=XL(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function UPe(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let a=n[o];a.isInGroup(t)&&i.push(a)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function BPe(e){if(e.eat("(")){let t=DY(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=UPe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function PPe(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(a,s,l){let c={term:l,to:s};return t[a].push(c),c}function i(a,s){a.forEach(l=>l.to=s)}function o(a,s){if(a.type=="choice")return a.exprs.reduce((l,c)=>l.concat(o(c,s)),[]);if(a.type=="seq")for(let l=0;;l++){let c=o(a.exprs[l],s);if(l==a.exprs.length-1)return c;i(c,s=n())}else if(a.type=="star"){let l=n();return r(s,l),i(o(a.expr,l),l),[r(l)]}else if(a.type=="plus"){let l=n();return i(o(a.expr,s),l),i(o(a.expr,l),l),[r(l)]}else{if(a.type=="opt")return[r(s)].concat(o(a.expr,s));if(a.type=="range"){let l=s;for(let c=0;c<a.min;c++){let u=n();i(o(a.expr,l),u),l=u}if(a.max==-1)i(o(a.expr,l),l);else for(let c=a.min;c<a.max;c++){let u=n();r(l,u),i(o(a.expr,l),u),l=u}return[r(l)]}else{if(a.type=="name")return[r(s,void 0,a.value)];throw new Error("Unknown expr type")}}}}function UY(e,t){return t-e}function e2(e,t){let n=[];return r(t),n.sort(UY);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let a=0;a<o.length;a++){let{term:s,to:l}=o[a];!s&&n.indexOf(l)==-1&&r(l)}}}function WPe(e){let t=Object.create(null);return n(e2(e,0));function n(r){let i=[];r.forEach(a=>{e[a].forEach(({term:s,to:l})=>{if(!s)return;let c;for(let u=0;u<i.length;u++)i[u][0]==s&&(c=i[u][1]);e2(e,l).forEach(u=>{c||i.push([s,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=t[r.join(",")]=new Tc(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let s=i[a][1].sort(UY);o.next.push({type:i[a][0],next:t[s.join(",")]||n(s)})}return o}}function NPe(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,a=[];for(let s=0;s<i.next.length;s++){let{type:l,next:c}=i.next[s];a.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function BY(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function PY(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function WY(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in e){let o=e[i];o.validate&&o.validate(t[i])}}function NY(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new qPe(e,r,t[r]);return n}let t2=class KY{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=NY(t,r.attrs),this.defaultAttrs=BY(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Tc.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:PY(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ec(this,this.computeAttrs(t),q.from(n),xt.setFrom(r))}createChecked(t=null,n,r){return n=q.from(n),this.checkContent(n),new ec(this,this.computeAttrs(t),n,xt.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=q.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(q.empty,!0);return o?new ec(this,t,n.append(o),xt.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){WY(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:xt.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,a)=>r[o]=new KY(o,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function KPe(e,t,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}class qPe{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?KPe(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class cC{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=NY(t,i.attrs),this.excluded=null;let o=BY(this.attrs);this.instance=o?new xt(this,o):null}create(t=null){return!t&&this.instance?this.instance:new xt(this,PY(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new cC(o,i++,n,a)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){WY(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class qY{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=En.from(t.nodes),n.marks=En.from(t.marks||{}),this.nodes=t2.compile(this.spec.nodes,this),this.marks=cC.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",s=o.spec.marks;if(o.contentMatch=r[a]||(r[a]=Tc.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=s=="_"?null:s?n2(this,s.split(" ")):s==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:n2(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof t2){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Kv(r,r.defaultAttrs,t,xt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return ec.fromJSON(this,t)}markFromJSON(t){return xt.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function n2(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],a=o;if(o)n.push(o);else for(let s in e.marks){let l=e.marks[s];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function VPe(e){return e.tag!=null}function zPe(e){return e.style!=null}class tc{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(VPe(i))this.tags.push(i);else if(zPe(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=t.nodes[i.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new i2(this,n,!1);return r.addAll(t,xt.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new i2(this,n,!0);return r.addAll(t,xt.none,n.from,n.to),V.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(YPe(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],s=a.style;if(!(s.indexOf(t)!=0||a.context&&!r.matchesContext(a.context)||s.length>t.length&&(s.charCodeAt(t.length)!=61||s.slice(t.length+1)!=n))){if(a.getAttrs){let l=a.getAttrs(n);if(l===!1)continue;a.attrs=l||void 0}return a}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let s=n[a];if((s.priority==null?50:s.priority)<o)break}n.splice(a,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=o2(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=o2(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new tc(t,tc.schemaRules(t)))}}const VY={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},QPe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},zY={ol:!0,ul:!0},Uh=1,mx=2,Yp=4;function r2(e,t,n){return t!=null?(t?Uh:0)|(t==="full"?mx:0):e&&e.whitespace=="pre"?Uh|mx:n&~Yp}class Ig{constructor(t,n,r,i,o,a){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=xt.none,this.match=o||(a&Yp?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(q.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Uh)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=q.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(q.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!VY.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class i2{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,a=r2(null,n.preserveWhitespace,0)|(r?Yp:0);i?o=new Ig(i.type,i.attrs,xt.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new Ig(null,null,xt.none,!0,null,a):o=new Ig(t.schema.topNodeType,null,xt.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,o=i.options&mx?"full":this.localPreserveWS||(i.options&Uh)>0;if(o==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
72
+ `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],s=t.previousSibling;(!a||s&&s.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,o=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let a=t.nodeName.toLowerCase(),s;zY.hasOwnProperty(a)&&this.parser.normalizeLists&&HPe(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(s=this.parser.matchTag(t,this,r));e:if(l?l.ignore:QPe.hasOwnProperty(a))this.findInside(t),this.ignoreFallback(t,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let c,u=this.needsBlock;if(VY.hasOwnProperty(a))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let f=l&&l.skip?n:this.readStyles(t,n);f&&this.addAll(t,f),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(t,n);c&&this.addElementByRule(t,l,c,l.consuming===!1?s:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
73
+ `),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],a=r.getPropertyValue(o);if(a)for(let s=void 0;;){let l=this.parser.matchStyle(o,a,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return n}addElementByRule(t,n,r,i){let o,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r)||this.leafFallback(t,r);else{let l=this.enter(a,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let s=this.top;if(a&&a.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,r),this.findAround(t,l,!1)}o&&this.sync(s)&&this.open--}addAll(t,n,r,i){let o=r||0;for(let a=r?t.childNodes[r]:t.firstChild,s=i==null?null:t.childNodes[i];a!=s;a=a.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(a,n);this.findAtPoint(t,o)}findPlace(t,n){let r,i;for(let o=this.open;o>=0;o--){let a=this.nodes[o],s=a.findWrapping(t);if(s&&(!r||r.length>s.length)&&(r=s,i=a,!s.length)||a.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(t,n){if(t.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(t,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(t.type));let o=xt.none;for(let a of r.concat(t.marks))(i.type?i.type.allowsMarkType(a.type):a2(a.type,t.type))&&(o=a.addToSet(o));return i.content.push(t.mark(o)),!0}return!1}enter(t,n,r,i){let o=this.findPlace(t.create(n),r);return o&&(o=this.enterInner(t,n,r,!0,i)),o}enterInner(t,n,r,i=!1,o){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(t);let s=r2(t,o,a.options);a.options&Yp&&a.content.length==0&&(s|=Yp);let l=xt.none;return r=r.filter(c=>(a.type?a.type.allowsMarkType(c.type):a2(c.type,t))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Ig(t,n,l,i,null,s)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Uh)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(s,l)=>{for(;s>=0;s--){let c=n[s];if(c==""){if(s==n.length-1||s==0)continue;for(;l>=o;l--)if(a(s-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function HPe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&zY.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function YPe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function o2(e){let t={};for(let n in e)t[n]=e[n];return t}function a2(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],a=s=>{o.push(s);for(let l=0;l<s.edgeCount;l++){let{type:c,next:u}=s.edge(l);if(c==t||o.indexOf(u)<0&&a(u))return!0}};if(a(i.contentMatch))return!0}}class Zm{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=KS(n).createDocumentFragment());let i=r,o=[];return t.forEach(a=>{if(o.length||a.marks.length){let s=0,l=0;for(;s<o.length&&l<a.marks.length;){let c=a.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[s][0])||c.type.spec.spanning===!1)break;s++,l++}for(;s<o.length;)i=o.pop()[1];for(;l<a.marks.length;){let c=a.marks[l++],u=this.serializeMark(c,a.isInline,n);u&&(o.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=qg(KS(n),this.nodes[t.type.name](t),null,t.attrs);if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&qg(KS(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return qg(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Zm(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=s2(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return s2(t.marks)}}function s2(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function KS(e){return e.document||window.document}const l2=new WeakMap;function GPe(e){let t=l2.get(e);return t===void 0&&l2.set(e,t=JPe(e)),t}function JPe(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(e),t}function qg(e,t,n,r){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=GPe(r))&&o.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let s,l=n?e.createElementNS(n,i):e.createElement(i),c=t[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let f in c)if(c[f]!=null){let p=f.indexOf(" ");p>0?l.setAttributeNS(f.slice(0,p),f.slice(p+1),c[f]):l.setAttribute(f,c[f])}}for(let f=u;f<t.length;f++){let p=t[f];if(p===0){if(f<t.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:m}=qg(e,p,n,r);if(l.appendChild(h),m){if(s)throw new RangeError("Multiple content holes");s=m}}}return{dom:l,contentDOM:s}}const QY=65535,HY=Math.pow(2,16);function ZPe(e,t){return e+t*HY}function c2(e){return e&QY}function XPe(e){return(e-(e&QY))/HY}const YY=1,GY=2,Vg=4,JY=8;let gx=class{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&JY)>0}get deletedBefore(){return(this.delInfo&(YY|Vg))>0}get deletedAfter(){return(this.delInfo&(GY|Vg))>0}get deletedAcross(){return(this.delInfo&Vg)>0}},kd=class Yu{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Yu.empty)return Yu.empty}recover(t){let n=0,r=c2(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+XPe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?i:0);if(l>t)break;let c=this.ranges[s+o],u=this.ranges[s+a],f=l+c;if(t<=f){let p=c?t==l?-1:t==f?1:n:n,h=l+i+(p<0?0:u);if(r)return h;let m=t==(n<0?l:f)?null:ZPe(s/3,t-l),g=t==l?GY:t==f?YY:Vg;return(n<0?t!=l:t!=f)&&(g|=JY),new gx(h,g,m)}i+=u-c}return r?t+i:new gx(t+i,0,null)}touches(t,n){let r=0,i=c2(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>t)break;let c=this.ranges[s+o],u=l+c;if(t<=u&&s==i*3)return!0;r+=this.ranges[s+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),l=a+(this.inverted?0:o),c=this.ranges[i+n],u=this.ranges[i+r];t(s,s+c,l,l+u),o+=u-c}}invert(){return new Yu(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Yu.empty:new Yu(t<0?[0,-t,0]:[0,0,t])}};kd.empty=new kd([]);let eWe=class zg{constructor(t=[],n,r=0,i=t.length){this.maps=t,this.mirror=n,this.from=r,this.to=i}slice(t=0,n=this.maps.length){return new zg(this.maps,this.mirror,t,n)}copy(){return new zg(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let i=t.getMirror(n);this.appendMap(t.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new zg;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],s=a.mapResult(t,n);if(s.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,t=this.maps[l].recover(s.recover);continue}}i|=s.delInfo,t=s.pos}return r?t:new gx(t,i,null)}};const qS=Object.create(null);let Qr=class{getMap(){return kd.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=qS[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in qS)throw new RangeError("Duplicate use of step JSON ID "+t);return qS[t]=n,n.prototype.jsonID=t,n}},kr=class kp{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new kp(t,null)}static fail(t){return new kp(null,t)}static fromReplace(t,n,r,i){try{return kp.ok(t.replace(n,r,i))}catch(o){if(o instanceof _c)return kp.fail(o.message);throw o}}};function pF(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(pF(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return q.fromArray(r)}let ZY=class Op extends Qr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new V(pF(n.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return kr.fromReplace(t,this.from,this.to,o)}invert(){return new XY(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Op(n.pos,r.pos,this.mark)}merge(t){return t instanceof Op&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Op(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Op(n.from,n.to,t.markFromJSON(n.mark))}};Qr.jsonID("addMark",ZY);let XY=class Mp extends Qr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new V(pF(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return kr.fromReplace(t,this.from,this.to,r)}invert(){return new ZY(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Mp(n.pos,r.pos,this.mark)}merge(t){return t instanceof Mp&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Mp(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Mp(n.from,n.to,t.markFromJSON(n.mark))}};Qr.jsonID("removeMark",XY);let eG=class Fp extends Qr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return kr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return kr.fromReplace(t,this.pos,this.pos+1,new V(q.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Fp(this.pos,n.marks[i]);return new Fp(this.pos,this.mark)}}return new tG(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Fp(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Fp(n.pos,t.markFromJSON(n.mark))}};Qr.jsonID("addNodeMark",eG);let tG=class vx extends Qr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return kr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return kr.fromReplace(t,this.pos,this.pos+1,new V(q.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new eG(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new vx(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new vx(n.pos,t.markFromJSON(n.mark))}};Qr.jsonID("removeNodeMark",tG);let nG=class Dl extends Qr{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&yx(t,this.from,this.to)?kr.fail("Structure replace would overwrite content"):kr.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new kd([this.from,this.to-this.from,this.slice.size])}invert(t){return new Dl(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Dl(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Dl)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?V.empty:new V(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Dl(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?V.empty:new V(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Dl(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Dl(n.from,n.to,V.fromJSON(t,n.slice),!!n.structure)}};Qr.jsonID("replace",nG);let Ap=class Qg extends Qr{constructor(t,n,r,i,o,a,s=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(t){if(this.structure&&(yx(t,this.from,this.gapFrom)||yx(t,this.gapTo,this.to)))return kr.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return kr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?kr.fromReplace(t,this.from,this.to,r):kr.fail("Content does not fit in gap")}getMap(){return new kd([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Qg(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Qg(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Qg(n.from,n.to,n.gapFrom,n.gapTo,V.fromJSON(t,n.slice),n.insert,!!n.structure)}};Qr.jsonID("replaceAround",Ap);function yx(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function tWe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function nWe(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!tWe(i,o,a))break}return null}function rWe(e,t,n=null,r=e){let i=iWe(e,t),o=i&&oWe(r,t);return o?i.map(u2).concat({type:t,attrs:n}).concat(o.map(u2)):null}function u2(e){return{type:e,attrs:null}}function iWe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}function oWe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let l=(a.length?a[a.length-1]:t).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:a}function aWe(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>o;c--,u--){let f=i.node(c),p=i.index(c);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(p,f.childCount),m=r&&r[u+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||f;if(!f.canReplace(p+1,f.childCount)||!g.type.validContent(h))return!1}let s=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(s,s,l?l.type:i.node(o+1).type)}function sWe(e,t){let n=e.resolve(t),r=n.index();return lWe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function lWe(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function cWe(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let a=r.depth;a>=0;a--){let s=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,l=r.index(a)+(s>0?1:0),c=r.node(a),u=!1;if(o==1)u=c.canReplace(l,l,i);else{let f=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=f&&c.canReplaceWith(l,l,f[0])}if(u)return s==0?r.pos:s<0?r.before(a+1):r.after(a+1)}return null}let uWe=class Hg extends Qr{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return kr.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return kr.fromReplace(t,this.pos,this.pos+1,new V(q.from(i),0,n.isLeaf?0:1))}getMap(){return kd.empty}invert(t){return new Hg(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Hg(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Hg(n.pos,n.attr,n.value)}};Qr.jsonID("attr",uWe);let Bh=class extends Error{};Bh=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Bh.prototype=Object.create(Error.prototype);Bh.prototype.constructor=Bh;Bh.prototype.name="TransformError";const VS=Object.create(null);class je{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new rG(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=V.empty){let r=n.content.lastChild,i=null;for(let s=0;s<n.openEnd;s++)i=r,r=r.lastChild;let o=t.steps.length,a=this.ranges;for(let s=0;s<a.length;s++){let{$from:l,$to:c}=a[s],u=t.mapping.slice(o);t.replaceRange(u.map(l.pos),u.map(c.pos),s?V.empty:n),s==0&&p2(t,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:s}=i[o],l=t.mapping.slice(r),c=l.map(a.pos),u=l.map(s.pos);o?t.deleteRange(c,u):(t.replaceRangeWith(c,u,n),p2(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Oe(t):Gu(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let o=t.depth-1;o>=0;o--){let a=n<0?Gu(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Gu(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(a)return a}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new _i(t.node(0))}static atStart(t){return Gu(t,t,0,0,1)||new _i(t)}static atEnd(t){return Gu(t,t,t.content.size,t.childCount,-1)||new _i(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=VS[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in VS)throw new RangeError("Duplicate use of selection JSON ID "+t);return VS[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Oe.between(this.$anchor,this.$head).getBookmark()}}je.prototype.visible=!0;class rG{constructor(t,n){this.$from=t,this.$to=n}}let d2=!1;function f2(e){!d2&&!e.parent.inlineContent&&(d2=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Oe extends je{constructor(t,n=t){f2(t),f2(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return je.near(r);let i=t.resolve(n.map(this.anchor));return new Oe(i.parent.inlineContent?i:r,r)}replace(t,n=V.empty){if(super.replace(t,n),n==V.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Oe&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new uC(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Oe(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=je.findFrom(n,r,!0)||je.findFrom(n,-r,!0);if(o)n=o.$head;else return je.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(je.findFrom(t,-r,!0)||je.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new Oe(t,n)}}je.jsonID("text",Oe);class uC{constructor(t,n){this.anchor=t,this.head=n}map(t){return new uC(t.map(this.anchor),t.map(this.head))}resolve(t){return Oe.between(t.resolve(this.anchor),t.resolve(this.head))}}class _e extends je{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?je.near(o):new _e(o)}content(){return new V(q.from(this.node),0,0)}eq(t){return t instanceof _e&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new hF(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new _e(t.resolve(n.anchor))}static create(t,n){return new _e(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}_e.prototype.visible=!1;je.jsonID("node",_e);class hF{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new uC(r,r):new hF(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&_e.isSelectable(r)?new _e(n):je.near(n)}}class _i extends je{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=V.empty){if(n==V.empty){t.delete(0,t.doc.content.size);let r=je.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new _i(t)}map(t){return new _i(t)}eq(t){return t instanceof _i}getBookmark(){return dWe}}je.jsonID("all",_i);const dWe={map(){return this},resolve(e){return new _i(e)}};function Gu(e,t,n,r,i,o=!1){if(t.inlineContent)return Oe.create(e,n);for(let a=r-(i>0?0:1);i>0?a<t.childCount:a>=0;a+=i){let s=t.child(a);if(s.isAtom){if(!o&&_e.isSelectable(s))return _e.create(e,n-(i<0?s.nodeSize:0))}else{let l=Gu(e,s,n+i,i<0?s.childCount:0,i,o);if(l)return l}n+=s.nodeSize*i}return null}function p2(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof nG||i instanceof Ap))return;let o=e.mapping.maps[r],a;o.forEach((s,l,c,u)=>{a==null&&(a=u)}),e.setSelection(je.near(e.doc.resolve(a),n))}function h2(e,t){return!t||!e?e:e.bind(t)}class Eg{constructor(t,n,r){this.name=t,this.init=h2(n.init,r),this.apply=h2(n.apply,r)}}new Eg("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Eg("selection",{init(e,t){return e.selection||je.atStart(t.doc)},apply(e){return e.selection}}),new Eg("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Eg("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});function iG(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=iG(i,t,{})),n[r]=i}return n}class dn{constructor(t){this.spec=t,this.props={},t.props&&iG(t.props,this,this.props),this.key=t.key?t.key.key:oG("plugin")}getState(t){return t[this.key]}}const zS=Object.create(null);function oG(e){return e in zS?e+"$"+ ++zS[e]:(zS[e]=0,e+"$")}class qn{constructor(t="key"){this.key=oG(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Mu=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},aG=function(e,t,n,r){return n&&(A2(e,t,n,r,-1)||A2(e,t,n,r,1))},fWe=/^(img|br|input|textarea|hr)$/i;function A2(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:qv(e))){let o=e.parentNode;if(!o||o.nodeType!=1||AF(e)||fWe.test(e.nodeName)||e.contentEditable=="false")return!1;t=Mu(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.contentEditable=="false")return!1;t=i<0?qv(e):0}else return!1}}function qv(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function pWe(e,t,n){for(let r=t==0,i=t==qv(e);r||i;){if(e==n)return!0;let o=Mu(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==qv(e)}}function AF(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const sG=function(e){return e.focusNode&&aG(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function lG(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const Do=typeof navigator<"u"?navigator:null,m2=typeof document<"u"?document:null,Il=Do&&Do.userAgent||"",bx=/Edge\/(\d+)/.exec(Il),cG=/MSIE \d/.exec(Il),Cx=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Il),Xm=!!(cG||Cx||bx),uG=cG?document.documentMode:Cx?+Cx[1]:bx?+bx[1]:0,dC=!Xm&&/gecko\/(\d+)/i.test(Il);dC&&+(/Firefox\/(\d+)/.exec(Il)||[0,0])[1];const Sx=!Xm&&/Chrome\/(\d+)/.exec(Il),El=!!Sx,dG=Sx?+Sx[1]:0,Fu=!Xm&&!!Do&&/Apple Computer/.test(Do.vendor),mF=Fu&&(/Mobile\/\w+/.test(Il)||!!Do&&Do.maxTouchPoints>2),Ci=mF||(Do?/Mac/.test(Do.platform):!1),hWe=Do?/Win/.test(Do.platform):!1,eg=/Android \d/.test(Il),gF=!!m2&&"webkitFontSmoothing"in m2.documentElement.style,AWe=gF?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function mWe(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let s=r.resolve(a),l,c;if(sG(n)){for(l=a;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&_e.isSelectable(f)&&i.parent&&!(f.isInline&&pWe(n.focusNode,n.focusOffset,i.dom))){let p=i.posBefore;c=new _e(a==p?s:r.resolve(p))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=a,p=a;for(let h=0;h<n.rangeCount;h++){let m=n.getRangeAt(h);f=Math.min(f,e.docView.posFromDOM(m.startContainer,m.startOffset,1)),p=Math.max(p,e.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(f<0)return null;[l,a]=p==e.state.selection.anchor?[p,f]:[f,p],s=r.resolve(a)}else l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!c){let f=t=="pointer"||e.state.selection.head<s.pos&&!o?1:-1;c=pG(e,u,s,f)}return c}function fG(e){return e.editable?e.hasFocus():bWe(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function vF(e,t=!1){let n=e.state.selection;if(yWe(e,n),!!fG(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&El){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&aG(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)vWe(e);else{let{anchor:r,head:i}=n,o,a;g2&&!(n instanceof Oe)&&(n.$from.parent.inlineContent||(o=v2(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=v2(e,n.to))),e.docView.setSelection(r,i,e,t),g2&&(o&&y2(o),a&&y2(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&gWe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const g2=Fu||El&&dG<63;function v2(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Fu&&i&&i.contentEditable=="false")return QS(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return QS(i);if(o)return QS(o)}}function QS(e){return e.contentEditable="true",Fu&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function y2(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function gWe(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!fG(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function vWe(e){let t=e.domSelection(),n=document.createRange();if(!t)return;let r=e.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,Mu(r)+1):n.setStart(r,0),n.collapse(!0),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&Xm&&uG<=11&&(r.disabled=!0,r.disabled=!1)}function yWe(e,t){if(t instanceof _e){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(b2(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else b2(e)}function b2(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function pG(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Oe.between(t,n,r)}function bWe(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function wx(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&je.findFrom(o,t)}function vs(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function C2(e,t,n){let r=e.state.selection;if(r instanceof Oe)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let a=e.state.doc.resolve(i.pos+o.nodeSize*(t<0?-1:1));return vs(e,new Oe(r.$anchor,a))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=wx(e.state,t);return i&&i instanceof _e?vs(e,i):!1}else if(!(Ci&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=e.docView.descAt(s))&&!a.contentDOM?_e.isSelectable(o)?vs(e,new _e(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):gF?vs(e,new Oe(e.state.doc.resolve(t<0?s:s+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof _e&&r.node.isInline)return vs(e,new Oe(t>0?r.$to:r.$from));{let i=wx(e.state,t);return i?vs(e,i):!1}}}function Vv(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Gp(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Nu(e,t){return t<0?CWe(e):SWe(e)}function CWe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(dC&&n.nodeType==1&&r<Vv(n)&&Gp(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let s=n.childNodes[r-1];if(Gp(s,-1))i=n,o=--r;else if(s.nodeType==3)n=s,r=n.nodeValue.length;else break}}else{if(hG(n))break;{let s=n.previousSibling;for(;s&&Gp(s,-1);)i=n.parentNode,o=Mu(s),s=s.previousSibling;if(s)n=s,r=Vv(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?xx(e,n,r):i&&xx(e,i,o)}function SWe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Vv(n),o,a;for(;;)if(r<i){if(n.nodeType!=1)break;let s=n.childNodes[r];if(Gp(s,1))o=n,a=++r;else break}else{if(hG(n))break;{let s=n.nextSibling;for(;s&&Gp(s,1);)o=s.parentNode,a=Mu(s)+1,s=s.nextSibling;if(s)n=s,r=0,i=Vv(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&xx(e,o,a)}function hG(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function wWe(e,t){for(;e&&t==e.childNodes.length&&!AF(e);)t=Mu(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function xWe(e,t){for(;e&&!t&&!AF(e);)t=Mu(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function xx(e,t,n){if(t.nodeType!=3){let o,a;(a=wWe(t,n))?(t=a,n=0):(o=xWe(t,n))&&(t=o,n=o.nodeValue.length)}let r=e.domSelection();if(!r)return;if(sG(r)){let o=document.createRange();o.setEnd(t,n),o.setStart(t,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&vF(e)},50)}function S2(e,t){let n=e.state.doc.resolve(t);if(!(El||hWe)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(t<n.end()){let o=e.coordsAtPos(t+1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function w2(e,t,n){let r=e.state.selection;if(r instanceof Oe&&!r.empty||n.indexOf("s")>-1||Ci&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=wx(e.state,t);if(a&&a instanceof _e)return vs(e,a)}if(!i.parent.inlineContent){let a=t<0?i:o,s=r instanceof _i?je.near(a,t):je.findFrom(a,t);return s?vs(e,s):!1}return!1}function x2(e,t){if(!(e.state.selection instanceof Oe))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let a=e.state.tr;return t<0?a.delete(n.pos-o.nodeSize,n.pos):a.delete(n.pos,n.pos+o.nodeSize),e.dispatch(a),!0}return!1}function _2(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function _We(e){if(!Fu||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;_2(e,r,"true"),setTimeout(()=>_2(e,r,"false"),20)}return!1}function TWe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function IWe(e,t){let n=t.keyCode,r=TWe(t);if(n==8||Ci&&n==72&&r=="c")return x2(e,-1)||Nu(e,-1);if(n==46&&!t.shiftKey||Ci&&n==68&&r=="c")return x2(e,1)||Nu(e,1);if(n==13||n==27)return!0;if(n==37||Ci&&n==66&&r=="c"){let i=n==37?S2(e,e.state.selection.from)=="ltr"?-1:1:-1;return C2(e,i,r)||Nu(e,i)}else if(n==39||Ci&&n==70&&r=="c"){let i=n==39?S2(e,e.state.selection.from)=="ltr"?1:-1:1;return C2(e,i,r)||Nu(e,i)}else{if(n==38||Ci&&n==80&&r=="c")return w2(e,-1,r)||Nu(e,-1);if(n==40||Ci&&n==78&&r=="c")return _We(e)||w2(e,1,r)||Nu(e,1);if(r==(Ci?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function AG(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let a=e.someProp("clipboardSerializer")||Zm.fromSchema(e.state.schema),s=CG(),l=s.createElement("div");l.appendChild(a.serializeFragment(r,{document:s}));let c=l.firstChild,u,f=0;for(;c&&c.nodeType==1&&(u=bG[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let m=s.createElement(u[h]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),f++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,`
74
+
75
+ `);return{dom:l,text:p,slice:t}}function mG(e,t,n,r,i){let o=i.parent.type.spec.code,a,s;if(!n&&!t)return null;let l=t&&(r||o||!n);if(l){if(e.someProp("transformPastedText",p=>{t=p(t,o||r,e)}),o)return t?new V(q.from(e.state.schema.text(t.replace(/\r\n?/g,`
76
+ `))),0,0):V.empty;let f=e.someProp("clipboardTextParser",p=>p(t,i,r,e));if(f)s=f;else{let p=i.marks(),{schema:h}=e.state,m=Zm.fromSchema(h);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=a.appendChild(document.createElement("p"));g&&y.appendChild(m.serializeNode(h.text(g,p)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),a=kWe(n),gF&&OWe(a);let c=a&&a.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let p=a.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;a=p}if(s||(s=(e.someProp("clipboardParser")||e.someProp("domParser")||tc.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!EWe.test(p.parentNode.nodeName)?{ignore:!0}:null}})),u)s=MWe(T2(s,+u[1],+u[2]),u[4]);else if(s=V.maxOpen(RWe(s.content,i),!0),s.openStart||s.openEnd){let f=0,p=0;for(let h=s.content.firstChild;f<s.openStart&&!h.type.spec.isolating;f++,h=h.firstChild);for(let h=s.content.lastChild;p<s.openEnd&&!h.type.spec.isolating;p++,h=h.lastChild);s=T2(s,f,p)}return e.someProp("transformPasted",f=>{s=f(s,e)}),s}const EWe=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function RWe(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,a=[];if(e.forEach(s=>{if(!a)return;let l=i.findWrapping(s.type),c;if(!l)return a=null;if(c=a.length&&o.length&&vG(l,o,s,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=yG(a[a.length-1],o.length));let u=gG(s,l);a.push(u),i=i.matchType(u.type),o=l}}),a)return q.from(a)}return e}function gG(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,q.from(e));return e}function vG(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=vG(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(q.from(gG(n,e,i+1))))}}function yG(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,yG(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(q.empty,!0);return e.copy(n.append(r))}function _x(e,t,n,r,i,o){let a=t<0?e.firstChild:e.lastChild,s=a.content;return e.childCount>1&&(o=0),i<r-1&&(s=_x(s,t,n,r,i+1,o)),i>=n&&(s=t<0?a.contentMatchAt(0).fillBefore(s,o<=i).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(q.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(s))}function T2(e,t,n){return t<e.openStart&&(e=new V(_x(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new V(_x(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const bG={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let I2=null;function CG(){return I2||(I2=document.implementation.createHTMLDocument("title"))}let HS=null;function $We(e){let t=window.trustedTypes;return t?(HS||(HS=t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),HS.createHTML(e)):e}function kWe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=CG().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&bG[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=$We(e),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function OWe(e){let t=e.querySelectorAll(El?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function MWe(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:o,openEnd:a}=e;for(let s=r.length-2;s>=0;s-=2){let l=n.nodes[r[s]];if(!l||l.hasRequiredAttrs())break;i=q.from(l.create(r[s+1],i)),o++,a++}return new V(i,o,a)}const yo={},si={};function Es(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}si.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!wG(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(eg&&El&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),mF&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,lG(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||IWe(e,n)?n.preventDefault():Es(e,"key")};si.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};si.keypress=(e,t)=>{let n=t;if(wG(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ci&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Oe)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",o=>o(e,r.$from.pos,r.$to.pos,i))&&e.dispatch(e.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function fC(e){return{left:e.clientX,top:e.clientY}}function FWe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function yF(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(e.someProp(t,s=>a>o.depth?s(e,n,o.nodeAfter,o.before(a),i,!0):s(e,n,o.node(a),o.before(a),i,!1)))return!0;return!1}function ld(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function jWe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&_e.isSelectable(r)?(ld(e,new _e(n),"pointer"),!0):!1}function LWe(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof _e&&(r=n.node);let o=e.state.doc.resolve(t);for(let a=o.depth+1;a>0;a--){let s=a>o.depth?o.nodeAfter:o.node(a);if(_e.isSelectable(s)){r&&n.$from.depth>0&&a>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(a);break}}return i!=null?(ld(e,_e.create(e.state.doc,i),"pointer"),!0):!1}function DWe(e,t,n,r,i){return yF(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?LWe(e,n):jWe(e,n))}function UWe(e,t,n,r){return yF(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function BWe(e,t,n,r){return yF(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||PWe(e,n,r)}function PWe(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(ld(e,Oe.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),s=i.before(o);if(a.inlineContent)ld(e,Oe.create(r,s+1,s+1+a.content.size),"pointer");else if(_e.isSelectable(a))ld(e,_e.create(r,s),"pointer");else continue;return!0}}function bF(e){return zv(e)}const SG=Ci?"metaKey":"ctrlKey";yo.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=bF(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&FWe(n,e.input.lastClick)&&!n[SG]&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let a=e.posAtCoords(fC(n));a&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new WWe(e,a,n,!!r)):(o=="doubleClick"?UWe:BWe)(e,a.pos,a.inside,n)?n.preventDefault():Es(e,"pointer"))};class WWe{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[SG],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let u=t.state.doc.resolve(n.pos);o=u.parent,a=u.depth?u.before():0}const s=i?null:r.target,l=s?t.docView.nearestDesc(s,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=t.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof _e&&c.from<=a&&c.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&dC&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Es(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>vF(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(fC(t))),this.updateAllowDefault(t),this.allowDefault||!n?Es(this.view,"pointer"):DWe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Fu&&this.mightDrag&&!this.mightDrag.node.isAtom||El&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(ld(this.view,je.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):Es(this.view,"pointer")}move(t){this.updateAllowDefault(t),Es(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}yo.touchstart=e=>{e.input.lastTouch=Date.now(),bF(e),Es(e,"pointer")};yo.touchmove=e=>{e.input.lastTouch=Date.now(),Es(e,"pointer")};yo.contextmenu=e=>bF(e);function wG(e,t){return e.composing?!0:Fu&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const NWe=eg?5e3:-1;si.compositionstart=si.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Oe&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),zv(e,!0),e.markCursor=null;else if(zv(e,!t.selection.empty),dC&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){let s=e.domSelection();s&&s.collapse(a,a.nodeValue.length);break}else i=a,o=-1}}e.input.composing=!0}xG(e,NWe)};si.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,xG(e,20))};function xG(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>zv(e),t))}function KWe(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=qWe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function qWe(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function zv(e,t=!1){if(!(eg&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),KWe(e),t||e.docView&&e.docView.dirty){let n=mWe(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!e.state.selection.empty?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function VWe(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Ph=Xm&&uG<15||mF&&AWe<604;yo.copy=si.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=Ph?null:n.clipboardData,a=r.content(),{dom:s,text:l}=AG(e,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",l)):VWe(e,s),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function zWe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function QWe(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Tx(e,r.value,null,i,t):Tx(e,r.textContent,r.innerHTML,i,t)},50)}function Tx(e,t,n,r,i){let o=mG(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,i,o||V.empty)))return!0;if(!o)return!1;let a=zWe(o),s=a?e.state.tr.replaceSelectionWith(a,r):e.state.tr.replaceSelection(o);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function _G(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}si.paste=(e,t)=>{let n=t;if(e.composing&&!eg)return;let r=Ph?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Tx(e,_G(r),r.getData("text/html"),i,n)?n.preventDefault():QWe(e,n)};class HWe{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const TG=Ci?"altKey":"ctrlKey";yo.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(fC(n)),a;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof _e?i.to-1:i.to))){if(r&&r.mightDrag)a=_e.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=e.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=e.docView&&(a=_e.create(e.state.doc,f.posBefore))}}let s=(a||e.state.selection).content(),{dom:l,text:c,slice:u}=AG(e,s);(!n.dataTransfer.files.length||!El||dG>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Ph?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ph||n.dataTransfer.setData("text/plain",c),e.dragging=new HWe(u,!n[TG],a)};yo.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};si.dragover=si.dragenter=(e,t)=>t.preventDefault();si.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(fC(n));if(!i)return;let o=e.state.doc.resolve(i.pos),a=r&&r.slice;a?e.someProp("transformPasted",m=>{a=m(a,e)}):a=mG(e,_G(n.dataTransfer),Ph?null:n.dataTransfer.getData("text/html"),!1,o);let s=!!(r&&!n[TG]);if(e.someProp("handleDrop",m=>m(e,n,a||V.empty,s))){n.preventDefault();return}if(!a)return;n.preventDefault();let l=a?cWe(e.state.doc,o.pos,a):o.pos;l==null&&(l=o.pos);let c=e.state.tr;if(s){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let u=c.mapping.map(l),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,p=c.doc;if(f?c.replaceRangeWith(u,u,a.content.firstChild):c.replaceRange(u,u,a),c.doc.eq(p))return;let h=c.doc.resolve(u);if(f&&_e.isSelectable(a.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new _e(h));else{let m=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,y,C,x)=>m=x),c.setSelection(pG(e,h,c.doc.resolve(m)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};yo.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&vF(e)},20))};yo.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};yo.beforeinput=(e,t)=>{if(El&&eg&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,lG(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in si)yo[e]=si[e];function Wh(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Qv{constructor(t,n){this.toDOM=t,this.spec=n||nc,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:a}=t.mapResult(n.from+i,this.side<0?-1:1);return a?null:new Jn(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Qv&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Wh(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Ms{constructor(t,n){this.attrs=t,this.spec=n||nc}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,a=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new Jn(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Ms&&Wh(this.attrs,t.attrs)&&Wh(this.spec,t.spec)}static is(t){return t.type instanceof Ms}destroy(){}}let YWe=class IG{constructor(t,n){this.attrs=t,this.spec=n||nc}map(t,n,r,i){let o=t.mapResult(n.from+i,1);if(o.deleted)return null;let a=t.mapResult(n.to+i,-1);return a.deleted||a.pos<=o.pos?null:new Jn(o.pos-r,a.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),o;return i==n.from&&!(o=t.child(r)).isText&&i+o.nodeSize==n.to}eq(t){return this==t||t instanceof IG&&Wh(this.attrs,t.attrs)&&Wh(this.spec,t.spec)}destroy(){}};class Jn{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Jn(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new Jn(t,t,new Qv(n,r))}static inline(t,n,r,i){return new Jn(t,n,new Ms(r,i))}static node(t,n,r,i){return new Jn(t,n,new YWe(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ms}get widget(){return this.type instanceof Qv}}const Ju=[],nc={};class Ot{constructor(t,n){this.local=t.length?t:Ju,this.children=n.length?n:Ju}static create(t,n){return n.length?Hv(n,t,0,nc):ur}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let a=0;a<this.local.length;a++){let s=this.local[a];s.from<=n&&s.to>=t&&(!o||o(s.spec))&&r.push(s.copy(s.from+i,s.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>t){let s=this.children[a]+1;this.children[a+2].findInner(t-s,n-s,r,i+s,o)}}map(t,n,r){return this==ur||t.maps.length==0?this:this.mapInner(t,n,0,0,r||nc)}mapInner(t,n,r,i,o){let a;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(t,r,i);l&&l.type.valid(n,l)?(a||(a=[])).push(l):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?GWe(this.children,a||[],t,n,r,i,o):a?new Ot(a.sort(rc),Ju):ur}add(t,n){return n.length?this==ur?Ot.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((s,l)=>{let c=l+r,u;if(u=RG(n,s,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(s,u,c+1):i.splice(o,0,l,l+s.nodeSize,Hv(u,s,c+1,nc)),o+=3}});let a=EG(o?$G(n):n,-r);for(let s=0;s<a.length;s++)a[s].type.valid(t,a[s])||a.splice(s--,1);return new Ot(a.length?this.local.concat(a).sort(rc):this.local,i||this.children)}remove(t){return t.length==0||this==ur?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,s=r[o]+n,l=r[o+1]+n;for(let u=0,f;u<t.length;u++)(f=t[u])&&f.from>s&&f.to<l&&(t[u]=null,(a||(a=[])).push(f));if(!a)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(a,s+1);c!=ur?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<t.length;o++)if(a=t[o])for(let s=0;s<i.length;s++)i[s].eq(a,n)&&(i==this.local&&(i=this.local.slice()),i.splice(s--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ot(i,r):ur}forChild(t,n){if(this==ur)return this;if(n.isLeaf)return Ot.empty;let r,i;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=t){this.children[s]==t&&(r=this.children[s+2]);break}let o=t+1,a=o+n.content.size;for(let s=0;s<this.local.length;s++){let l=this.local[s];if(l.from<a&&l.to>o&&l.type instanceof Ms){let c=Math.max(o,l.from)-o,u=Math.min(a,l.to)-o;c<u&&(i||(i=[])).push(l.copy(c,u))}}if(i){let s=new Ot(i.sort(rc),Ju);return r?new Kl([s,r]):s}return r||ur}eq(t){if(this==t)return!0;if(!(t instanceof Ot)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return CF(this.localsInner(t))}localsInner(t){if(this==ur)return Ju;if(t.inlineContent||!this.local.some(Ms.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Ms||n.push(this.local[r]);return n}forEachSet(t){t(this)}}Ot.empty=new Ot([],[]);Ot.removeOverlap=CF;const ur=Ot.empty;class Kl{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,nc));return Kl.from(r)}forChild(t,n){if(n.isLeaf)return Ot.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=ur&&(o instanceof Kl?r=r.concat(o.members):r.push(o))}return Kl.from(r)}eq(t){if(!(t instanceof Kl)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(t);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let a=0;a<o.length;a++)n.push(o[a])}}return n?CF(r?n:n.sort(rc)):Ju}static from(t){switch(t.length){case 0:return ur;case 1:return t[0];default:return new Kl(t.every(n=>n instanceof Ot)?t:t.reduce((n,r)=>n.concat(r instanceof Ot?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function GWe(e,t,n,r,i,o,a){let s=e.slice();for(let c=0,u=o;c<n.maps.length;c++){let f=0;n.maps[c].forEach((p,h,m,g)=>{let y=g-m-(h-p);for(let C=0;C<s.length;C+=3){let x=s[C+1];if(x<0||p>x+u-f)continue;let b=s[C]+u-f;h>=b?s[C+1]=p<=b?-2:-1:p>=u&&y&&(s[C]+=y,s[C+1]+=y)}f+=y}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<s.length;c+=3)if(s[c+1]<0){if(s[c+1]==-2){l=!0,s[c+1]=-1;continue}let u=n.map(e[c]+o),f=u-i;if(f<0||f>=r.content.size){l=!0;continue}let p=n.map(e[c+1]+o,-1),h=p-i,{index:m,offset:g}=r.content.findIndex(f),y=r.maybeChild(m);if(y&&g==f&&g+y.nodeSize==h){let C=s[c+2].mapInner(n,y,u+1,e[c]+o+1,a);C!=ur?(s[c]=f,s[c+1]=h,s[c+2]=C):(s[c+1]=-2,l=!0)}else l=!0}if(l){let c=JWe(s,e,t,n,i,o,a),u=Hv(c,r,0,a);t=u.local;for(let f=0;f<s.length;f+=3)s[f+1]<0&&(s.splice(f,3),f-=3);for(let f=0,p=0;f<u.children.length;f+=3){let h=u.children[f];for(;p<s.length&&s[p]<h;)p+=3;s.splice(p,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Ot(t.sort(rc),s)}function EG(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Jn(i.from+t,i.to+t,i.type))}return n}function JWe(e,t,n,r,i,o,a){function s(l,c){for(let u=0;u<l.local.length;u++){let f=l.local[u].map(r,i,c);f?n.push(f):a.onRemove&&a.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)s(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<e.length;l+=3)e[l+1]==-1&&s(e[l+2],t[l]+o+1);return n}function RG(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o=0,a;o<e.length;o++)(a=e[o])&&a.from>n&&a.to<r&&((i||(i=[])).push(a),e[o]=null);return i}function $G(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Hv(e,t,n,r){let i=[],o=!1;t.forEach((s,l)=>{let c=RG(e,s,l+n);if(c){o=!0;let u=Hv(c,s,n+l+1,r);u!=ur&&i.push(l,l+s.nodeSize,u)}});let a=EG(o?$G(e):e,-n).sort(rc);for(let s=0;s<a.length;s++)a[s].type.valid(t,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||i.length?new Ot(a,i):ur}function rc(e,t){return e.from-t.from||e.to-t.to}function CF(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),E2(t,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),E2(t,i,r.copy(o.from,r.to)));break}}}return t}function E2(e,t,n){for(;t<e.length&&rc(n,e[t])>0;)t++;e.splice(t,0,n)}var Vs={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Yv={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ZWe=typeof navigator<"u"&&/Mac/.test(navigator.platform),XWe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var $n=0;$n<10;$n++)Vs[48+$n]=Vs[96+$n]=String($n);for(var $n=1;$n<=24;$n++)Vs[$n+111]="F"+$n;for(var $n=65;$n<=90;$n++)Vs[$n]=String.fromCharCode($n+32),Yv[$n]=String.fromCharCode($n);for(var YS in Vs)Yv.hasOwnProperty(YS)||(Yv[YS]=Vs[YS]);function eNe(e){var t=ZWe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||XWe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Yv:Vs)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const tNe=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function nNe(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,a;for(let s=0;s<t.length-1;s++){let l=t[s];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))tNe?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),a&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function rNe(e){let t=Object.create(null);for(let n in e)t[nNe(n)]=e[n];return t}function GS(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function iNe(e){return new dn({props:{handleKeyDown:kG(e)}})}function kG(e){let t=rNe(e);return function(n,r){let i=eNe(r),o,a=t[GS(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let s=t[GS(i,r,!1)];if(s&&s(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=Vs[r.keyCode])&&o!=i){let s=t[GS(o,r)];if(s&&s(n.state,n.dispatch,n))return!0}}return!1}}const OG=65535,MG=Math.pow(2,16);function oNe(e,t){return e+t*MG}function R2(e){return e&OG}function aNe(e){return(e-(e&OG))/MG}const FG=1,jG=2,Yg=4,LG=8;let $2=class{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&LG)>0}get deletedBefore(){return(this.delInfo&(FG|Yg))>0}get deletedAfter(){return(this.delInfo&(jG|Yg))>0}get deletedAcross(){return(this.delInfo&Yg)>0}},Ic=class Zu{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Zu.empty)return Zu.empty}recover(t){let n=0,r=R2(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+aNe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?i:0);if(l>t)break;let c=this.ranges[s+o],u=this.ranges[s+a],f=l+c;if(t<=f){let p=c?t==l?-1:t==f?1:n:n,h=l+i+(p<0?0:u);if(r)return h;let m=t==(n<0?l:f)?null:oNe(s/3,t-l),g=t==l?jG:t==f?FG:Yg;return(n<0?t!=l:t!=f)&&(g|=LG),new $2(h,g,m)}i+=u-c}return r?t+i:new $2(t+i,0,null)}touches(t,n){let r=0,i=R2(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>t)break;let c=this.ranges[s+o],u=l+c;if(t<=u&&s==i*3)return!0;r+=this.ranges[s+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),l=a+(this.inverted?0:o),c=this.ranges[i+n],u=this.ranges[i+r];t(s,s+c,l,l+u),o+=u-c}}invert(){return new Zu(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Zu.empty:new Zu(t<0?[0,-t,0]:[0,0,t])}};Ic.empty=new Ic([]);const JS=Object.create(null);let ar=class{getMap(){return Ic.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=JS[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in JS)throw new RangeError("Duplicate use of step JSON ID "+t);return JS[t]=n,n.prototype.jsonID=t,n}},hr=class jp{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new jp(t,null)}static fail(t){return new jp(null,t)}static fromReplace(t,n,r,i){try{return jp.ok(t.replace(n,r,i))}catch(o){if(o instanceof _c)return jp.fail(o.message);throw o}}};function SF(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(SF(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return q.fromArray(r)}let DG=class Lp extends ar{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new V(SF(n.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return hr.fromReplace(t,this.from,this.to,o)}invert(){return new UG(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Lp(n.pos,r.pos,this.mark)}merge(t){return t instanceof Lp&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Lp(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Lp(n.from,n.to,t.markFromJSON(n.mark))}};ar.jsonID("addMark",DG);let UG=class Dp extends ar{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new V(SF(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return hr.fromReplace(t,this.from,this.to,r)}invert(){return new DG(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Dp(n.pos,r.pos,this.mark)}merge(t){return t instanceof Dp&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Dp(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Dp(n.from,n.to,t.markFromJSON(n.mark))}};ar.jsonID("removeMark",UG);let BG=class Up extends ar{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return hr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return hr.fromReplace(t,this.pos,this.pos+1,new V(q.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Up(this.pos,n.marks[i]);return new Up(this.pos,this.mark)}}return new PG(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Up(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Up(n.pos,t.markFromJSON(n.mark))}};ar.jsonID("addNodeMark",BG);let PG=class Ix extends ar{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return hr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return hr.fromReplace(t,this.pos,this.pos+1,new V(q.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new BG(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ix(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ix(n.pos,t.markFromJSON(n.mark))}};ar.jsonID("removeNodeMark",PG);let WG=class Ul extends ar{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&Ex(t,this.from,this.to)?hr.fail("Structure replace would overwrite content"):hr.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Ic([this.from,this.to-this.from,this.slice.size])}invert(t){return new Ul(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Ul(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Ul)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?V.empty:new V(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Ul(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?V.empty:new V(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Ul(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ul(n.from,n.to,V.fromJSON(t,n.slice),!!n.structure)}};ar.jsonID("replace",WG);let NG=class Gg extends ar{constructor(t,n,r,i,o,a,s=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(t){if(this.structure&&(Ex(t,this.from,this.gapFrom)||Ex(t,this.gapTo,this.to)))return hr.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return hr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?hr.fromReplace(t,this.from,this.to,r):hr.fail("Content does not fit in gap")}getMap(){return new Ic([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Gg(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Gg(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Gg(n.from,n.to,n.gapFrom,n.gapTo,V.fromJSON(t,n.slice),n.insert,!!n.structure)}};ar.jsonID("replaceAround",NG);function Ex(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function sNe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function lNe(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!sNe(i,o,a))break}return null}function cNe(e,t,n=null,r=e){let i=uNe(e,t),o=i&&dNe(r,t);return o?i.map(k2).concat({type:t,attrs:n}).concat(o.map(k2)):null}function k2(e){return{type:e,attrs:null}}function uNe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}function dNe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let l=(a.length?a[a.length-1]:t).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:a}function Jg(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>o;c--,u--){let f=i.node(c),p=i.index(c);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(p,f.childCount),m=r&&r[u+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||f;if(!f.canReplace(p+1,f.childCount)||!g.type.validContent(h))return!1}let s=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(s,s,l?l.type:i.node(o+1).type)}function wF(e,t){let n=e.resolve(t),r=n.index();return KG(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function fNe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),a=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(a),!n||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}function KG(e,t){return!!(e&&t&&!e.isLeaf&&fNe(e,t))}function qG(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,a,s=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),s++,a=r.node(i).maybeChild(s)):(o=r.node(i).maybeChild(s-1),a=r.node(i+1)),o&&!o.isTextblock&&KG(o,a)&&r.node(i).canReplace(s,s+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}let pNe=class Zg extends ar{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return hr.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return hr.fromReplace(t,this.pos,this.pos+1,new V(q.from(i),0,n.isLeaf?0:1))}getMap(){return Ic.empty}invert(t){return new Zg(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Zg(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Zg(n.pos,n.attr,n.value)}};ar.jsonID("attr",pNe);let hNe=class Rx extends ar{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return hr.ok(r)}getMap(){return Ic.empty}invert(t){return new Rx(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Rx(n.attr,n.value)}};ar.jsonID("docAttr",hNe);let Nh=class extends Error{};Nh=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Nh.prototype=Object.create(Error.prototype);Nh.prototype.constructor=Nh;Nh.prototype.name="TransformError";const VG=65535,zG=Math.pow(2,16);function ANe(e,t){return e+t*zG}function O2(e){return e&VG}function mNe(e){return(e-(e&VG))/zG}const QG=1,HG=2,Xg=4,YG=8;let M2=class{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&YG)>0}get deletedBefore(){return(this.delInfo&(QG|Xg))>0}get deletedAfter(){return(this.delInfo&(HG|Xg))>0}get deletedAcross(){return(this.delInfo&Xg)>0}},Ec=class Xu{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Xu.empty)return Xu.empty}recover(t){let n=0,r=O2(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+mNe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?i:0);if(l>t)break;let c=this.ranges[s+o],u=this.ranges[s+a],f=l+c;if(t<=f){let p=c?t==l?-1:t==f?1:n:n,h=l+i+(p<0?0:u);if(r)return h;let m=t==(n<0?l:f)?null:ANe(s/3,t-l),g=t==l?HG:t==f?QG:Xg;return(n<0?t!=l:t!=f)&&(g|=YG),new M2(h,g,m)}i+=u-c}return r?t+i:new M2(t+i,0,null)}touches(t,n){let r=0,i=O2(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>t)break;let c=this.ranges[s+o],u=l+c;if(t<=u&&s==i*3)return!0;r+=this.ranges[s+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),l=a+(this.inverted?0:o),c=this.ranges[i+n],u=this.ranges[i+r];t(s,s+c,l,l+u),o+=u-c}}invert(){return new Xu(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Xu.empty:new Xu(t<0?[0,-t,0]:[0,0,t])}};Ec.empty=new Ec([]);const ZS=Object.create(null);let sr=class{getMap(){return Ec.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=ZS[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in ZS)throw new RangeError("Duplicate use of step JSON ID "+t);return ZS[t]=n,n.prototype.jsonID=t,n}},Ar=class Bp{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Bp(t,null)}static fail(t){return new Bp(null,t)}static fromReplace(t,n,r,i){try{return Bp.ok(t.replace(n,r,i))}catch(o){if(o instanceof _c)return Bp.fail(o.message);throw o}}};function xF(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(xF(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return q.fromArray(r)}let GG=class Pp extends sr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new V(xF(n.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Ar.fromReplace(t,this.from,this.to,o)}invert(){return new JG(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Pp(n.pos,r.pos,this.mark)}merge(t){return t instanceof Pp&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Pp(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Pp(n.from,n.to,t.markFromJSON(n.mark))}};sr.jsonID("addMark",GG);let JG=class Wp extends sr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new V(xF(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Ar.fromReplace(t,this.from,this.to,r)}invert(){return new GG(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Wp(n.pos,r.pos,this.mark)}merge(t){return t instanceof Wp&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Wp(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Wp(n.from,n.to,t.markFromJSON(n.mark))}};sr.jsonID("removeMark",JG);let ZG=class Np extends sr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Ar.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ar.fromReplace(t,this.pos,this.pos+1,new V(q.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Np(this.pos,n.marks[i]);return new Np(this.pos,this.mark)}}return new XG(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Np(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Np(n.pos,t.markFromJSON(n.mark))}};sr.jsonID("addNodeMark",ZG);let XG=class $x extends sr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Ar.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Ar.fromReplace(t,this.pos,this.pos+1,new V(q.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new ZG(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new $x(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new $x(n.pos,t.markFromJSON(n.mark))}};sr.jsonID("removeNodeMark",XG);let pC=class Bl extends sr{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&kx(t,this.from,this.to)?Ar.fail("Structure replace would overwrite content"):Ar.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Ec([this.from,this.to-this.from,this.slice.size])}invert(t){return new Bl(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Bl(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Bl)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?V.empty:new V(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Bl(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?V.empty:new V(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Bl(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Bl(n.from,n.to,V.fromJSON(t,n.slice),!!n.structure)}};sr.jsonID("replace",pC);let Gv=class ev extends sr{constructor(t,n,r,i,o,a,s=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(t){if(this.structure&&(kx(t,this.from,this.gapFrom)||kx(t,this.gapTo,this.to)))return Ar.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ar.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ar.fromReplace(t,this.from,this.to,r):Ar.fail("Content does not fit in gap")}getMap(){return new Ec([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new ev(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new ev(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ev(n.from,n.to,n.gapFrom,n.gapTo,V.fromJSON(t,n.slice),n.insert,!!n.structure)}};sr.jsonID("replaceAround",Gv);function kx(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function gNe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function hC(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!gNe(i,o,a))break}return null}function vNe(e,t,n=null,r=e){let i=yNe(e,t),o=i&&bNe(r,t);return o?i.map(F2).concat({type:t,attrs:n}).concat(o.map(F2)):null}function F2(e){return{type:e,attrs:null}}function yNe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}function bNe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let l=(a.length?a[a.length-1]:t).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:a}function CNe(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>o;c--,u--){let f=i.node(c),p=i.index(c);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(p,f.childCount),m=r&&r[u+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||f;if(!f.canReplace(p+1,f.childCount)||!g.type.validContent(h))return!1}let s=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(s,s,l?l.type:i.node(o+1).type)}function AC(e,t){let n=e.resolve(t),r=n.index();return eJ(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function SNe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),a=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(a),!n||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}function eJ(e,t){return!!(e&&t&&!e.isLeaf&&SNe(e,t))}function tJ(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,a,s=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),s++,a=r.node(i).maybeChild(s)):(o=r.node(i).maybeChild(s-1),a=r.node(i+1)),o&&!o.isTextblock&&eJ(o,a)&&r.node(i).canReplace(s,s+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function _F(e,t,n=t,r=V.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return wNe(i,o,r)?new pC(t,n,r):new xNe(i,o,r).fit()}function wNe(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}let xNe=class{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=q.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=q.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,a=r.depth,s=i.depth;for(;a&&s&&o.childCount==1;)o=o.firstChild.content,a--,s--;let l=new V(o,a,s);return t>-1?new Gv(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new pC(r.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=XS(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let s=this.depth;s>=0;s--){let{type:l,match:c}=this.frontier[s],u,f=null;if(n==1&&(a?c.matchType(a.type)||(f=c.fillBefore(q.from(a),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:f};if(n==2&&a&&(u=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=XS(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new V(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=XS(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new V(Kp(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new V(Kp(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let a=this.unplaced,s=r?r.content:a.content,l=a.openStart-t,c=0,u=[],{match:f,type:p}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));f=f.matchFragment(i)}let h=s.size+t-(a.content.size-a.openEnd);for(;c<s.childCount;){let g=s.child(c),y=f.matchType(g.type);if(!y)break;c++,(c>1||l==0||g.content.size)&&(f=y,u.push(nJ(g.mark(p.allowedMarks(g.marks)),c==1?l:0,c==s.childCount?h:-1)))}let m=c==s.childCount;m||(h=-1),this.placed=qp(this.placed,n,q.from(u)),this.frontier[n].match=f,m&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=s;g<h;g++){let C=y.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),y=C.content}this.unplaced=m?t==0?V.empty:new V(Kp(a.content,t-1,1),t-1,h<0?a.openEnd:t-1):new V(Kp(a.content,t,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!ew(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),a=ew(t,n,i,r,o);if(a){for(let s=n-1;s>=0;s--){let{match:l,type:c}=this.frontier[s],u=ew(t,s,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:a,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=qp(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=qp(this.placed,this.depth,q.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(q.empty,!0);n.childCount&&(this.placed=qp(this.placed,this.frontier.length,n))}};function Kp(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Kp(e.firstChild.content,t-1,n)))}function qp(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(qp(e.lastChild.content,t-1,n)))}function XS(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function nJ(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,nJ(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(q.empty,!0)))),e.copy(r)}function ew(e,t,n,r,i){let o=e.node(t),a=i?e.indexAfter(t):e.index(t);if(a==o.childCount&&!n.compatibleContent(o.type))return null;let s=r.fillBefore(o.content,!0,a);return s&&!_Ne(n,o.content,a)?s:null}function _Ne(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}let TNe=class tv extends sr{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Ar.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Ar.fromReplace(t,this.pos,this.pos+1,new V(q.from(i),0,n.isLeaf?0:1))}getMap(){return Ec.empty}invert(t){return new tv(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new tv(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new tv(n.pos,n.attr,n.value)}};sr.jsonID("attr",TNe);let INe=class Ox extends sr{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Ar.ok(r)}getMap(){return Ec.empty}invert(t){return new Ox(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ox(n.attr,n.value)}};sr.jsonID("docAttr",INe);let Kh=class extends Error{};Kh=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Kh.prototype=Object.create(Error.prototype);Kh.prototype.constructor=Kh;Kh.prototype.name="TransformError";const ENe=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function rJ(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const RNe=(e,t,n)=>{let r=rJ(e,n);if(!r)return!1;let i=TF(r);if(!i){let a=r.blockRange(),s=a&&hC(a);return s==null?!1:(t&&t(e.tr.lift(a,s).scrollIntoView()),!0)}let o=i.nodeBefore;if(sJ(e,i,t,-1))return!0;if(r.parent.content.size==0&&(Od(o,"end")||_e.isSelectable(o)))for(let a=r.depth;;a--){let s=_F(e.doc,r.before(a),r.after(a),V.empty);if(s&&s.slice.size<s.to-s.from){if(t){let l=e.tr.step(s);l.setSelection(Od(o,"end")?je.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):_e.create(l.doc,i.pos-o.nodeSize)),t(l.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},$Ne=(e,t,n)=>{let r=rJ(e,n);if(!r)return!1;let i=TF(r);return i?iJ(e,i,t):!1},kNe=(e,t,n)=>{let r=oJ(e,n);if(!r)return!1;let i=IF(r);return i?iJ(e,i,t):!1};function iJ(e,t,n){let r=t.nodeBefore,i=r,o=t.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let a=t.nodeAfter,s=a,l=t.pos+1;for(;!s.isTextblock;l++){if(s.type.spec.isolating)return!1;let u=s.firstChild;if(!u)return!1;s=u}let c=_F(e.doc,o,l,V.empty);if(!c||c.from!=o||c instanceof pC&&c.slice.size>=l-o)return!1;if(n){let u=e.tr.step(c);u.setSelection(Oe.create(u.doc,o)),n(u.scrollIntoView())}return!0}function Od(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const ONe=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=TF(r)}let a=o&&o.nodeBefore;return!a||!_e.isSelectable(a)?!1:(t&&t(e.tr.setSelection(_e.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function TF(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function oJ(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const MNe=(e,t,n)=>{let r=oJ(e,n);if(!r)return!1;let i=IF(r);if(!i)return!1;let o=i.nodeAfter;if(sJ(e,i,t,1))return!0;if(r.parent.content.size==0&&(Od(o,"start")||_e.isSelectable(o))){let a=_F(e.doc,r.before(),r.after(),V.empty);if(a&&a.slice.size<a.to-a.from){if(t){let s=e.tr.step(a);s.setSelection(Od(o,"start")?je.findFrom(s.doc.resolve(s.mapping.map(i.pos)),1):_e.create(s.doc,s.mapping.map(i.pos))),t(s.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},FNe=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=IF(r)}let a=o&&o.nodeAfter;return!a||!_e.isSelectable(a)?!1:(t&&t(e.tr.setSelection(_e.create(e.doc,o.pos)).scrollIntoView()),!0)};function IF(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const jNe=(e,t)=>{let n=e.selection,r=n instanceof _e,i;if(r){if(n.node.isTextblock||!AC(e.doc,n.from))return!1;i=n.from}else if(i=tJ(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(_e.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},LNe=(e,t)=>{let n=e.selection,r;if(n instanceof _e){if(n.node.isTextblock||!AC(e.doc,n.to))return!1;r=n.to}else if(r=tJ(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},DNe=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&hC(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},UNe=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
77
+ `).scrollIntoView()),!0)};function aJ(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const BNe=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),a=aJ(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(t){let s=n.after(),l=e.tr.replaceWith(s,s,a.createAndFill());l.setSelection(je.near(l.doc.resolve(s),1)),t(l.scrollIntoView())}return!0},PNe=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof _i||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=aJ(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(a,o.createAndFill());s.setSelection(Oe.create(s.doc,a+1)),t(s.scrollIntoView())}return!0},WNe=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(CNe(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&hC(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},NNe=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(_e.create(e.doc,i))),!0)};function KNe(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||AC(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function sJ(e,t,n,r){let i=t.nodeBefore,o=t.nodeAfter,a,s,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&KNe(e,t,n))return!0;let c=!l&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(a=(s=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&s.matchType(a[0]||o.type).validEnd){if(n){let h=t.pos+o.nodeSize,m=q.empty;for(let C=a.length-1;C>=0;C--)m=q.from(a[C].create(null,m));m=q.from(i.copy(m));let g=e.tr.step(new Gv(t.pos-1,h,t.pos,h,new V(m,1,0),a.length,!0)),y=g.doc.resolve(h+2*a.length);y.nodeAfter&&y.nodeAfter.type==i.type&&AC(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&l?null:je.findFrom(t,1),f=u&&u.$from.blockRange(u.$to),p=f&&hC(f);if(p!=null&&p>=t.depth)return n&&n(e.tr.lift(f,p).scrollIntoView()),!0;if(c&&Od(o,"start",!0)&&Od(i,"end")){let h=i,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let g=o,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(n){let C=q.empty;for(let b=m.length-1;b>=0;b--)C=q.from(m[b].copy(C));let x=e.tr.step(new Gv(t.pos-m.length,t.pos+o.nodeSize,t.pos+y,t.pos+o.nodeSize-y,new V(C,m.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function lJ(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(Oe.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const qNe=lJ(-1),VNe=lJ(1);function zNe(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),s=a&&vNe(a,e,t);return s?(r&&r(n.tr.wrap(a,s).scrollIntoView()),!0):!1}}function j2(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:s}}=n.selection.ranges[o];n.doc.nodesBetween(a,s,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(e,t)))if(l.type==e)i=!0;else{let u=n.doc.resolve(c),f=u.index();i=u.parent.canReplaceWith(f,f+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[a];o.setBlockType(s,l,e,t)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function QNe(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),s=!1,l=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(e)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let u=n.doc.resolve(a.start-2);l=new Nv(u,u,a.depth),a.endIndex<a.parent.childCount&&(a=new Nv(i,n.doc.resolve(o.end(a.depth)),a.depth)),s=!0}let c=rWe(l,e,t,a);return c?(r&&r(HNe(n.tr,a,c,s,e).scrollIntoView()),!0):!1}}function HNe(e,t,n,r,i){let o=q.empty;for(let u=n.length-1;u>=0;u--)o=q.from(n[u].type.create(n[u].attrs,o));e.step(new Ap(t.start-(r?2:0),t.end,t.start,t.end,new V(o,0,0),n.length,!0));let a=0;for(let u=0;u<n.length;u++)n[u].type==i&&(a=u+1);let s=n.length-a,l=t.start+n.length-(r?2:0),c=t.parent;for(let u=t.startIndex,f=t.endIndex,p=!0;u<f;u++,p=!1)!p&&aWe(e.doc,l,s)&&(e.split(l,s),l+=2*s),l+=c.child(u).nodeSize;return e}function YNe(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?GNe(t,n,e,o):JNe(t,n,o):!0:!1}}function GNe(e,t,n,r){let i=e.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new Ap(o-1,a,o,a,new V(q.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Nv(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const s=nWe(r);if(s==null)return!1;i.lift(r,s);let l=i.mapping.map(o,-1)-1;return sWe(i.doc,l)&&i.join(l),t(i.scrollIntoView()),!0}function JNe(e,t,n){let r=e.tr,i=n.parent;for(let h=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)h-=i.child(m).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(n.start),a=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,l=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(s?0:1),u+1,a.content.append(l?q.empty:q.from(i))))return!1;let f=o.pos,p=f+a.nodeSize;return r.step(new Ap(f-(s?1:0),p+(l?1:0),f+1,p-1,new V((s?q.empty:q.from(i.copy(q.empty))).append(l?q.empty:q.from(i.copy(q.empty))),s?0:1,l?0:1),s?0:1)),t(r.scrollIntoView()),!0}function ZNe(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==e);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let s=o.parent,l=s.child(a-1);if(l.type!=e)return!1;if(n){let c=l.lastChild&&l.lastChild.type==s.type,u=q.from(c?e.create():null),f=new V(q.from(e.create(null,q.from(s.type.create(null,u)))),c?3:1,0),p=o.start,h=o.end;n(t.tr.step(new Ap(p-(c?3:1),h,p,h,f,1,!0)).scrollIntoView())}return!0}}function mC(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class EF{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([s,l])=>[s,(...u)=>{const f=l(...u)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,s=[],l=!!t,c=t||o.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(c),s.every(p=>p===!0)),f={...Object.fromEntries(Object.entries(r).map(([p,h])=>[p,(...g)=>{const y=this.buildProps(c,n),C=h(...g)(y);return s.push(C),f}])),run:u};return f}createCan(t){const{rawCommands:n,state:r}=this,i=!1,o=t||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...u)=>c(...u)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,s={tr:t,editor:i,view:a,state:mC({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(s)]))}};return s}}function de(e,t,n){return e.config[t]===void 0&&e.parent?de(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?de(e.parent,t,n):null}):e.config[t]}function gC(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function cJ(e){const t=[],{nodeExtensions:n,markExtensions:r}=gC(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage,extensions:i},l=de(a,"addGlobalAttributes",s);if(!l)return;l().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([p,h])=>{t.push({type:f,name:p,attribute:{...o,...h}})})})})}),i.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage},l=de(a,"addAttributes",s);if(!l)return;const c=l();Object.entries(c).forEach(([u,f])=>{const p={...o,...f};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,t.push({type:a.name,name:u,attribute:p})})}),t}function sn(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function Ut(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const s=o?String(o).split(" "):[],l=r[i]?r[i].split(" "):[],c=s.filter(u=>!l.includes(u));r[i]=[...l,...c].join(" ")}else if(i==="style"){const s=o?o.split(";").map(u=>u.trim()).filter(Boolean):[],l=r[i]?r[i].split(";").map(u=>u.trim()).filter(Boolean):[],c=new Map;l.forEach(u=>{const[f,p]=u.split(":").map(h=>h.trim());c.set(f,p)}),s.forEach(u=>{const[f,p]=u.split(":").map(h=>h.trim());c.set(f,p)}),r[i]=Array.from(c.entries()).map(([u,f])=>`${u}: ${f}`).join("; ")}else r[i]=o}),r},{})}function Jv(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>Ut(n,r),{})}function XNe(e){return typeof e=="function"}function We(e,t=void 0,...n){return XNe(e)?t?e.bind(t)(...n):e(...n):e}function eKe(e={}){return Object.keys(e).length===0&&e.constructor===Object}function tKe(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function L2(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((o,a)=>{const s=a.attribute.parseHTML?a.attribute.parseHTML(n):tKe(n.getAttribute(a.name));return s==null?o:{...o,[a.name]:s}},{});return{...r,...i}}}}function D2(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&eKe(n)?!1:n!=null))}function uJ(e,t){var n;const r=cJ(e),{nodeExtensions:i,markExtensions:o}=gC(e),a=(n=i.find(c=>de(c,"topNode")))===null||n===void 0?void 0:n.name,s=Object.fromEntries(i.map(c=>{const u=r.filter(C=>C.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:t},p=e.reduce((C,x)=>{const b=de(x,"extendNodeSchema",f);return{...C,...b?b(c):{}}},{}),h=D2({...p,content:We(de(c,"content",f)),marks:We(de(c,"marks",f)),group:We(de(c,"group",f)),inline:We(de(c,"inline",f)),atom:We(de(c,"atom",f)),selectable:We(de(c,"selectable",f)),draggable:We(de(c,"draggable",f)),code:We(de(c,"code",f)),whitespace:We(de(c,"whitespace",f)),linebreakReplacement:We(de(c,"linebreakReplacement",f)),defining:We(de(c,"defining",f)),isolating:We(de(c,"isolating",f)),attrs:Object.fromEntries(u.map(C=>{var x;return[C.name,{default:(x=C==null?void 0:C.attribute)===null||x===void 0?void 0:x.default}]}))}),m=We(de(c,"parseHTML",f));m&&(h.parseDOM=m.map(C=>L2(C,u)));const g=de(c,"renderHTML",f);g&&(h.toDOM=C=>g({node:C,HTMLAttributes:Jv(C,u)}));const y=de(c,"renderText",f);return y&&(h.toText=y),[c.name,h]})),l=Object.fromEntries(o.map(c=>{const u=r.filter(y=>y.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:t},p=e.reduce((y,C)=>{const x=de(C,"extendMarkSchema",f);return{...y,...x?x(c):{}}},{}),h=D2({...p,inclusive:We(de(c,"inclusive",f)),excludes:We(de(c,"excludes",f)),group:We(de(c,"group",f)),spanning:We(de(c,"spanning",f)),code:We(de(c,"code",f)),attrs:Object.fromEntries(u.map(y=>{var C;return[y.name,{default:(C=y==null?void 0:y.attribute)===null||C===void 0?void 0:C.default}]}))}),m=We(de(c,"parseHTML",f));m&&(h.parseDOM=m.map(y=>L2(y,u)));const g=de(c,"renderHTML",f);return g&&(h.toDOM=y=>g({mark:y,HTMLAttributes:Jv(y,u)})),[c.name,h]}));return new qY({topNode:a,nodes:s,marks:l})}function tw(e,t){return t.nodes[e]||t.marks[e]||null}function U2(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function dJ(e,t){const n=Zm.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const nKe=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,a,s)=>{var l,c;const u=((c=(l=i.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:i,pos:o,parent:a,index:s}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-o))}),n};function RF(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class $F{constructor(t){this.find=t.find,this.handler=t.handler}}const rKe=(e,t)=>{if(RF(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Rg(e){var t;const{editor:n,from:r,to:i,text:o,rules:a,plugin:s}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((t=c.nodeBefore||c.nodeAfter)===null||t===void 0)&&t.marks.find(p=>p.type.spec.code))return!1;let u=!1;const f=nKe(c)+o;return a.forEach(p=>{if(u)return;const h=rKe(f,p.find);if(!h)return;const m=l.state.tr,g=mC({state:l.state,transaction:m}),y={from:r-(h[0].length-o.length),to:i},{commands:C,chain:x,can:b}=new EF({editor:n,state:g});p.handler({state:g,range:y,match:h,commands:C,chain:x,can:b})===null||!m.steps.length||(m.setMeta(s,{transform:m,from:r,to:i,text:o}),l.dispatch(m),u=!0)}),u}function iKe(e){const{editor:t,rules:n}=e,r=new dn({state:{init(){return null},apply(i,o,a){const s=i.getMeta(r);if(s)return s;const l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:u}=l;typeof u=="string"?u=u:u=dJ(q.from(u),a.schema);const{from:f}=l,p=f+u.length;Rg({editor:t,from:f,to:p,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,a,s){return Rg({editor:t,from:o,to:a,text:s,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Rg({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Rg({editor:t,from:a.pos,to:a.pos,text:`
78
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function oKe(e){return Object.prototype.toString.call(e).slice(8,-1)}function $g(e){return oKe(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function vC(e,t){const n={...e};return $g(e)&&$g(t)&&Object.keys(t).forEach(r=>{$g(t[r])&&$g(e[r])?n[r]=vC(e[r],t[r]):n[r]=t[r]}),n}let tg=class Mx{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=We(de(this,"addOptions",{name:this.name}))),this.storage=We(de(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Mx(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>vC(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new Mx(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=We(de(n,"addOptions",{name:n.name})),n.storage=We(de(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=a.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}};function aKe(e){return typeof e=="number"}class sKe{constructor(t){this.find=t.find,this.handler=t.handler}}const lKe=(e,t,n)=>{if(RF(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=e,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function cKe(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:a,dropEvent:s}=e,{commands:l,chain:c,can:u}=new EF({editor:t,state:n}),f=[];return n.doc.nodesBetween(r,i,(h,m)=>{if(!h.isTextblock||h.type.spec.code)return;const g=Math.max(r,m),y=Math.min(i,m+h.content.size),C=h.textBetween(g-m,y-m,void 0,"");lKe(C,o.find,a).forEach(b=>{if(b.index===void 0)return;const v=g+b.index+1,S=v+b[0].length,w={from:n.tr.mapping.map(v),to:n.tr.mapping.map(S)},T=o.handler({state:n,range:w,match:b,commands:l,chain:c,can:u,pasteEvent:a,dropEvent:s});f.push(T)})}),f.every(h=>h!==null)}let kg=null;const uKe=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function dKe(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,s;try{s=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{s=null}const l=({state:u,from:f,to:p,rule:h,pasteEvt:m})=>{const g=u.tr,y=mC({state:u,transaction:g});if(!(!cKe({editor:t,state:y,from:Math.max(f-1,0),to:p.b-1,rule:h,pasteEvent:m,dropEvent:s})||!g.steps.length)){try{s=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{s=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(u=>new dn({view(f){const p=m=>{var g;r=!((g=f.dom.parentElement)===null||g===void 0)&&g.contains(m.target)?f.dom.parentElement:null,r&&(kg=t)},h=()=>{kg&&(kg=null)};return window.addEventListener("dragstart",p),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",p),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(f,p)=>{if(o=r===f.dom.parentElement,s=p,!o){const h=kg;h&&setTimeout(()=>{const m=h.state.selection;m&&h.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(f,p)=>{var h;const m=(h=p.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return a=p,i=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(f,p,h)=>{const m=f[0],g=m.getMeta("uiEvent")==="paste"&&!i,y=m.getMeta("uiEvent")==="drop"&&!o,C=m.getMeta("applyPasteRules"),x=!!C;if(!g&&!y&&!x)return;if(x){let{text:S}=C;typeof S=="string"?S=S:S=dJ(q.from(S),h.schema);const{from:w}=C,T=w+S.length,E=uKe(S);return l({rule:u,state:h,from:w,to:{b:T},pasteEvt:E})}const b=p.doc.content.findDiffStart(h.doc.content),v=p.doc.content.findDiffEnd(h.doc.content);if(!(!aKe(b)||!v||b===v.b))return l({rule:u,state:h,from:b,to:v,pasteEvt:a})}}))}function fKe(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}class id{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=id.resolve(t),this.schema=uJ(this.extensions,n),this.setupExtensions()}static resolve(t){const n=id.sort(id.flatten(t)),r=fKe(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=de(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(t){return t.sort((r,i)=>{const o=de(r,"priority")||100,a=de(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((t,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:tw(n.name,this.schema)},i=de(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){const{editor:t}=this,n=id.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(a=>{const s={name:a.name,options:a.options,storage:a.storage,editor:t,type:tw(a.name,this.schema)},l=[],c=de(a,"addKeyboardShortcuts",s);let u={};if(a.type==="mark"&&de(a,"exitable",s)&&(u.ArrowRight=()=>tg.handleExit({editor:t,mark:a})),c){const g=Object.fromEntries(Object.entries(c()).map(([y,C])=>[y,()=>C({editor:t})]));u={...u,...g}}const f=iNe(u);l.push(f);const p=de(a,"addInputRules",s);U2(a,t.options.enableInputRules)&&p&&r.push(...p());const h=de(a,"addPasteRules",s);U2(a,t.options.enablePasteRules)&&h&&i.push(...h());const m=de(a,"addProseMirrorPlugins",s);if(m){const g=m();l.push(...g)}return l}).flat();return[iKe({editor:t,rules:r}),...dKe({editor:t,rules:i}),...o]}get attributes(){return cJ(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=gC(this.extensions);return Object.fromEntries(n.filter(r=>!!de(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:t,type:sn(r.name,this.schema)},a=de(r,"addNodeView",o);if(!a)return[];const s=(l,c,u,f,p)=>{const h=Jv(l,i);return a()({node:l,view:c,getPos:u,decorations:f,innerDecorations:p,editor:t,extension:r,HTMLAttributes:h})};return[r.name,s]}))}setupExtensions(){this.extensions.forEach(t=>{var n;this.editor.extensionStorage[t.name]=t.storage;const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:tw(t.name,this.schema)};t.type==="mark"&&(!((n=We(de(t,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(t.name);const i=de(t,"onBeforeCreate",r),o=de(t,"onCreate",r),a=de(t,"onUpdate",r),s=de(t,"onSelectionUpdate",r),l=de(t,"onTransaction",r),c=de(t,"onFocus",r),u=de(t,"onBlur",r),f=de(t,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),a&&this.editor.on("update",a),s&&this.editor.on("selectionUpdate",s),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}}class jn{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=We(de(this,"addOptions",{name:this.name}))),this.storage=We(de(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new jn(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>vC(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new jn({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=We(de(n,"addOptions",{name:n.name})),n.storage=We(de(n,"addStorage",{name:n.name,options:n.options})),n}}function pKe(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
79
+
80
+ `,textSerializers:a={}}=n||{};let s="";return e.nodesBetween(r,i,(l,c,u,f)=>{var p;l.isBlock&&c>r&&(s+=o);const h=a==null?void 0:a[l.type.name];if(h)return u&&(s+=h({node:l,pos:c,parent:u,index:f,range:t})),!1;l.isText&&(s+=(p=l==null?void 0:l.text)===null||p===void 0?void 0:p.slice(Math.max(r,c)-c,i-c))}),s}function hKe(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}jn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new dn({key:new qn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,a=Math.min(...o.map(u=>u.$from.pos)),s=Math.max(...o.map(u=>u.$to.pos)),l=hKe(n);return pKe(r,{from:a,to:s},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}});const AKe=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),mKe=(e=!1)=>({commands:t})=>t.setContent("",e),gKe=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:a})=>{e.doc.nodesBetween(o.pos,a.pos,(s,l)=>{if(s.type.isText)return;const{doc:c,mapping:u}=t,f=c.resolve(u.map(l)),p=c.resolve(u.map(l+s.nodeSize)),h=f.blockRange(p);if(!h)return;const m=lNe(h);if(s.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(h.start,g)}(m||m===0)&&t.lift(h,m)})}),!0},vKe=e=>t=>e(t),yKe=()=>({state:e,dispatch:t})=>PNe(e,t),bKe=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const a=r.mapping.map(t);return r.insert(a,o.content),r.setSelection(new Oe(r.doc.resolve(a-1))),!0},CKe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const s=i.before(o),l=i.after(o);e.delete(s,l).scrollIntoView()}return!0}return!1},SKe=e=>({tr:t,state:n,dispatch:r})=>{const i=sn(e,n.schema),o=t.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const l=o.before(a),c=o.after(a);t.delete(l,c).scrollIntoView()}return!0}return!1},wKe=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},xKe=()=>({state:e,dispatch:t})=>ENe(e,t),_Ke=()=>({commands:e})=>e.keyboardShortcut("Enter"),TKe=()=>({state:e,dispatch:t})=>BNe(e,t);function Zv(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:RF(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function fJ(e,t,n={}){return e.find(r=>r.type===t&&Zv(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function B2(e,t,n={}){return!!fJ(e,t,n)}function kF(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if((!i.node||!i.node.marks.some(u=>u.type===t))&&(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(u=>u.type===t)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!fJ([...i.node.marks],t,n)))return;let a=i.index,s=e.start()+i.offset,l=a+1,c=s+i.node.nodeSize;for(;a>0&&B2([...e.parent.child(a-1).marks],t,n);)a-=1,s-=e.parent.child(a).nodeSize;for(;l<e.parent.childCount&&B2([...e.parent.child(l).marks],t,n);)c+=e.parent.child(l).nodeSize,l+=1;return{from:s,to:c}}function Rl(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const IKe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Rl(e,r.schema),{doc:a,selection:s}=n,{$from:l,from:c,to:u}=s;if(i){const f=kF(l,o,t);if(f&&f.from<=c&&f.to>=u){const p=Oe.create(a,f.from,f.to);n.setSelection(p)}}return!0},EKe=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function OF(e){return e instanceof Oe}function ya(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function RKe(e,t=null){if(!t)return null;const n=je.atStart(e),r=je.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Oe.create(e,ya(0,i,o),ya(e.content.size,i,o)):Oe.create(e,ya(t,i,o),ya(t,i,o))}function pJ(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function yC(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const $Ke=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const a=()=>{(yC()||pJ())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!OF(n.state.selection))return a(),!0;const s=RKe(i.doc,e)||n.state.selection,l=n.state.selection.eq(s);return o&&(l||i.setSelection(s),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},kKe=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),OKe=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),hJ=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&hJ(r)}return e};function Og(e){const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return hJ(n)}function Xv(e,t,n){if(e instanceof ec||e instanceof q)return e;n={slice:!0,parseOptions:{},...n};const r=typeof e=="object"&&e!==null,i=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return q.fromArray(e.map(s=>t.nodeFromJSON(s)));const a=t.nodeFromJSON(e);return n.errorOnInvalidContent&&a.check(),a}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),Xv("",t,n)}if(i){if(n.errorOnInvalidContent){let a=!1,s="";const l=new qY({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(a=!0,s=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?tc.fromSchema(l).parseSlice(Og(e),n.parseOptions):tc.fromSchema(l).parse(Og(e),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${s}`)})}const o=tc.fromSchema(t);return n.slice?o.parseSlice(Og(e),n.parseOptions).content:o.parse(Og(e),n.parseOptions)}return Xv("",t,n)}function MKe(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof WG||i instanceof NG))return;const o=e.mapping.maps[r];let a=0;o.forEach((s,l,c,u)=>{a===0&&(a=u)}),e.setSelection(je.near(e.doc.resolve(a),n))}const FKe=e=>!("type"in e),jKe=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var a;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let s;try{s=Xv(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(a=n.errorOnInvalidContent)!==null&&a!==void 0?a:o.options.enableContentCheck})}catch(m){return o.emit("contentError",{editor:o,error:m,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:l,to:c}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},u=!0,f=!0;if((FKe(s)?s:[s]).forEach(m=>{m.check(),u=u?m.isText&&m.marks.length===0:!1,f=f?m.isBlock:!1}),l===c&&f){const{parent:m}=r.doc.resolve(l);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(l-=1,c+=1)}let h;if(u){if(Array.isArray(t))h=t.map(m=>m.text||"").join("");else if(t instanceof q){let m="";t.forEach(g=>{g.text&&(m+=g.text)}),h=m}else typeof t=="object"&&t&&t.text?h=t.text:h=t;r.insertText(h,l,c)}else h=s,r.replaceWith(l,c,h);n.updateSelection&&MKe(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:h})}return!0},LKe=()=>({state:e,dispatch:t})=>jNe(e,t),DKe=()=>({state:e,dispatch:t})=>LNe(e,t),UKe=()=>({state:e,dispatch:t})=>RNe(e,t),BKe=()=>({state:e,dispatch:t})=>MNe(e,t),PKe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=qG(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},WKe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=qG(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},NKe=()=>({state:e,dispatch:t})=>$Ne(e,t),KKe=()=>({state:e,dispatch:t})=>kNe(e,t);function AJ(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function qKe(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,a;for(let s=0;s<t.length-1;s+=1){const l=t[s];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))yC()||AJ()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const VKe=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=qKe(e).split(/-(?!$)/),a=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),s=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,s))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function Md(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,a=t?sn(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(f,p)=>{if(f.isText)return;const h=Math.max(r,p),m=Math.min(i,p+f.nodeSize);s.push({node:f,from:h,to:m})});const l=i-r,c=s.filter(f=>a?a.name===f.node.type.name:!0).filter(f=>Zv(f.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((f,p)=>f+p.to-p.from,0)>=l}const zKe=(e,t={})=>({state:n,dispatch:r})=>{const i=sn(e,n.schema);return Md(n,i,t)?DNe(n,r):!1},QKe=()=>({state:e,dispatch:t})=>WNe(e,t),HKe=e=>({state:t,dispatch:n})=>{const r=sn(e,t.schema);return YNe(r)(t,n)},YKe=()=>({state:e,dispatch:t})=>UNe(e,t);function mJ(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function P2(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}const GKe=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const s=mJ(typeof e=="string"?e:e.name,r.schema);return s?(s==="node"&&(o=sn(e,r.schema)),s==="mark"&&(a=Rl(e,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{o&&o===c.type&&n.setNodeMarkup(u,void 0,P2(c.attrs,t)),a&&c.marks.length&&c.marks.forEach(f=>{a===f.type&&n.addMark(u,u+c.nodeSize,a.create(P2(f.attrs,t)))})})}),!0):!1},JKe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),ZKe=()=>({tr:e,dispatch:t})=>{if(t){const n=new _i(e.doc);e.setSelection(n)}return!0},XKe=()=>({state:e,dispatch:t})=>ONe(e,t),e3e=()=>({state:e,dispatch:t})=>FNe(e,t),t3e=()=>({state:e,dispatch:t})=>NNe(e,t),n3e=()=>({state:e,dispatch:t})=>VNe(e,t),r3e=()=>({state:e,dispatch:t})=>qNe(e,t);function i3e(e,t,n={},r={}){return Xv(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const o3e=(e,t=!1,n={},r={})=>({editor:i,tr:o,dispatch:a,commands:s})=>{var l,c;const{doc:u}=o;if(n.preserveWhitespace!=="full"){const f=i3e(e,i.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return a&&o.replaceWith(0,u.content.size,f).setMeta("preventUpdate",!t),!0}return a&&o.setMeta("preventUpdate",!t),s.insertContentAt({from:0,to:u.content.size},e,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck})};function a3e(e,t){const n=Rl(t,e.schema),{from:r,to:i,empty:o}=e.selection,a=[];o?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,l=>{a.push(...l.marks)});const s=a.find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function s3e(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function gJ(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function ng(e){return t=>gJ(t.$from,e)}function l3e(e,t){const n=id.resolve(e);return uJ(n,t)}function vJ(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e),a=kF(o,i.type);a&&r.push({mark:i,...a})}):n.nodesBetween(e,t,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}const c3e=(e,t,n,r=20)=>{const i=e.doc.resolve(n);let o=r,a=null;for(;o>0&&a===null;){const s=i.node(o);(s==null?void 0:s.type.name)===t?a=s:o-=1}return[a,o]};function nv(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function u3e(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Rl(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Zv(f.attrs,n,{strict:!1}));let a=0;const s=[];if(i.forEach(({$from:f,$to:p})=>{const h=f.pos,m=p.pos;e.doc.nodesBetween(h,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const C=Math.max(h,y),x=Math.min(m,y+g.nodeSize),b=x-C;a+=b,s.push(...g.marks.map(v=>({mark:v,from:C,to:x})))})}),a===0)return!1;const l=s.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Zv(f.mark.attrs,n,{strict:!1})).reduce((f,p)=>f+p.to-p.from,0),c=s.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,p)=>f+p.to-p.from,0);return(l>0?l+c:l)>=a}const d3e=(e,t)=>{const{$from:n,$to:r,$anchor:i}=e.selection;if(t){const o=ng(s=>s.type.name===t)(e.selection);if(!o)return!1;const a=e.doc.resolve(o.pos+1);return i.pos+1===a.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},f3e=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function W2(e,t){const{nodeExtensions:n}=gC(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=We(de(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function MF(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((r=e.text)!==null&&r!==void 0?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(o=>{i!==!1&&(MF(o,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function p3e(e){return e instanceof _e}function h3e(e,t,n){const i=e.state.doc.content.size,o=ya(t,0,i),a=ya(n,0,i),s=e.coordsAtPos(o),l=e.coordsAtPos(a,-1),c=Math.min(s.top,l.top),u=Math.max(s.bottom,l.bottom),f=Math.min(s.left,l.left),p=Math.max(s.right,l.right),h=p-f,m=u-c,C={top:c,bottom:u,left:f,right:p,width:h,height:m,x:f,y:c};return{...C,toJSON:()=>C}}function A3e(e,t,n){var r;const{selection:i}=t;let o=null;if(OF(i)&&(o=i.$cursor),o){const s=(r=e.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(s)||!s.some(l=>l.type.excludes(n))}const{ranges:a}=i;return a.some(({$from:s,$to:l})=>{let c=s.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(s.pos,l.pos,(u,f,p)=>{if(c)return!1;if(u.isInline){const h=!p||p.type.allowsMarkType(n),m=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));c=h&&m}return!c}),c})}const m3e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:a,ranges:s}=o,l=Rl(e,r.schema);if(i)if(a){const c=a3e(r,l);n.addStoredMark(l.create({...c,...t}))}else s.forEach(c=>{const u=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(u,f,(p,h)=>{const m=Math.max(h,u),g=Math.min(h+p.nodeSize,f);p.marks.find(C=>C.type===l)?p.marks.forEach(C=>{l===C.type&&n.addMark(m,g,l.create({...C.attrs,...t}))}):n.addMark(m,g,l.create(t))})});return A3e(r,n,l)},g3e=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),v3e=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=sn(e,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:s})=>j2(o,{...a,...t})(n)?!0:s.clearNodes()).command(({state:s})=>j2(o,{...a,...t})(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},y3e=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=ya(e,0,r.content.size),o=_e.create(r,i);t.setSelection(o)}return!0},b3e=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,a=Oe.atStart(r).from,s=Oe.atEnd(r).to,l=ya(i,a,s),c=ya(o,a,s),u=Oe.create(r,l,c);t.setSelection(u)}return!0},C3e=e=>({state:t,dispatch:n})=>{const r=sn(e,t.schema);return ZNe(r)(t,n)};function N2(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}const S3e=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:a}=t,{$from:s,$to:l}=o,c=i.extensionManager.attributes,u=nv(c,s.node().type.name,s.node().attrs);if(o instanceof _e&&o.node.isBlock)return!s.parentOffset||!Jg(a,s.pos)?!1:(r&&(e&&N2(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;const f=l.parentOffset===l.parent.content.size,p=s.depth===0?void 0:s3e(s.node(-1).contentMatchAt(s.indexAfter(-1)));let h=f&&p?[{type:p,attrs:u}]:void 0,m=Jg(t.doc,t.mapping.map(s.pos),1,h);if(!h&&!m&&Jg(t.doc,t.mapping.map(s.pos),1,p?[{type:p}]:void 0)&&(m=!0,h=p?[{type:p,attrs:u}]:void 0),r){if(m&&(o instanceof Oe&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,h),p&&!f&&!s.parentOffset&&s.parent.type!==p)){const g=t.mapping.map(s.before()),y=t.doc.resolve(g);s.node(-1).canReplaceWith(y.index(),y.index()+1,p)&&t.setNodeMarkup(t.mapping.map(s.before()),p)}e&&N2(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},w3e=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var a;const s=sn(e,r.schema),{$from:l,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(c))return!1;const f=l.node(-1);if(f.type!==s)return!1;const p=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let C=q.empty;const x=l.index(-1)?1:l.index(-2)?2:3;for(let E=l.depth-x;E>=l.depth-3;E-=1)C=q.from(l.node(E).copy(C));const b=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,v={...nv(p,l.node().type.name,l.node().attrs),...t},S=((a=s.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill(v))||void 0;C=C.append(q.from(s.createAndFill(null,S)||void 0));const w=l.before(l.depth-(x-1));n.replace(w,l.after(-b),new V(C,4-x,0));let T=-1;n.doc.nodesBetween(w,n.doc.content.size,(E,R)=>{if(T>-1)return!1;E.isTextblock&&E.content.size===0&&(T=R+1)}),T>-1&&n.setSelection(Oe.near(n.doc.resolve(T))),n.scrollIntoView()}return!0}const h=c.pos===l.end()?f.contentMatchAt(0).defaultType:null,m={...nv(p,f.type.name,f.attrs),...t},g={...nv(p,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,c.pos);const y=h?[{type:s,attrs:m},{type:h,attrs:g}]:[{type:s,attrs:m}];if(!Jg(n.doc,l.pos,2))return!1;if(i){const{selection:C,storedMarks:x}=r,{splittableMarks:b}=o.extensionManager,v=x||C.$to.parentOffset&&C.$from.marks();if(n.split(l.pos,2,y).scrollIntoView(),!v||!i)return!0;const S=v.filter(w=>b.includes(w.type.name));n.ensureMarks(S)}return!0},nw=(e,t)=>{const n=ng(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&wF(e.doc,n.pos)&&e.join(n.pos),!0},rw=(e,t)=>{const n=ng(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&wF(e.doc,r)&&e.join(r),!0},x3e=(e,t,n,r={})=>({editor:i,tr:o,state:a,dispatch:s,chain:l,commands:c,can:u})=>{const{extensions:f,splittableMarks:p}=i.extensionManager,h=sn(e,a.schema),m=sn(t,a.schema),{selection:g,storedMarks:y}=a,{$from:C,$to:x}=g,b=C.blockRange(x),v=y||g.$to.parentOffset&&g.$from.marks();if(!b)return!1;const S=ng(w=>W2(w.type.name,f))(g);if(b.depth>=1&&S&&b.depth-S.depth<=1){if(S.node.type===h)return c.liftListItem(m);if(W2(S.node.type.name,f)&&h.validContent(S.node.content)&&s)return l().command(()=>(o.setNodeMarkup(S.pos,h),!0)).command(()=>nw(o,h)).command(()=>rw(o,h)).run()}return!n||!v||!s?l().command(()=>u().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>nw(o,h)).command(()=>rw(o,h)).run():l().command(()=>{const w=u().wrapInList(h,r),T=v.filter(E=>p.includes(E.type.name));return o.ensureMarks(T),w?!0:c.clearNodes()}).wrapInList(h,r).command(()=>nw(o,h)).command(()=>rw(o,h)).run()},_3e=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,a=Rl(e,r.schema);return u3e(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,t)},T3e=(e,t,n={})=>({state:r,commands:i})=>{const o=sn(e,r.schema),a=sn(t,r.schema),s=Md(r,o,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),s?i.setNode(a,l):i.setNode(o,{...l,...n})},I3e=(e,t={})=>({state:n,commands:r})=>{const i=sn(e,n.schema);return Md(n,i,t)?r.lift(i):r.wrapIn(i,t)},E3e=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const a=e.tr,s=o.transform;for(let l=s.steps.length-1;l>=0;l-=1)a.step(s.steps[l].invert(s.docs[l]));if(o.text){const l=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,e.schema.text(o.text,l))}else a.delete(o.from,o.to)}return!0}}return!1},R3e=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},$3e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=t,{selection:s}=n,l=Rl(e,r.schema),{$from:c,empty:u,ranges:f}=s;if(!i)return!0;if(u&&a){let{from:p,to:h}=s;const m=(o=c.marks().find(y=>y.type===l))===null||o===void 0?void 0:o.attrs,g=kF(c,l,m);g&&(p=g.from,h=g.to),n.removeMark(p,h,l)}else f.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,l)});return n.removeStoredMark(l),!0},k3e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const s=mJ(typeof e=="string"?e:e.name,r.schema);return s?(s==="node"&&(o=sn(e,r.schema)),s==="mark"&&(a=Rl(e,r.schema)),i&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;let f,p,h,m;n.selection.empty?r.doc.nodesBetween(c,u,(g,y)=>{o&&o===g.type&&(h=Math.max(y,c),m=Math.min(y+g.nodeSize,u),f=y,p=g)}):r.doc.nodesBetween(c,u,(g,y)=>{y<c&&o&&o===g.type&&(h=Math.max(y,c),m=Math.min(y+g.nodeSize,u),f=y,p=g),y>=c&&y<=u&&(o&&o===g.type&&n.setNodeMarkup(y,void 0,{...g.attrs,...t}),a&&g.marks.length&&g.marks.forEach(C=>{if(a===C.type){const x=Math.max(y,c),b=Math.min(y+g.nodeSize,u);n.addMark(x,b,a.create({...C.attrs,...t}))}}))}),p&&(f!==void 0&&n.setNodeMarkup(f,void 0,{...p.attrs,...t}),a&&p.marks.length&&p.marks.forEach(g=>{a===g.type&&n.addMark(h,m,a.create({...g.attrs,...t}))}))}),!0):!1},O3e=(e,t={})=>({state:n,dispatch:r})=>{const i=sn(e,n.schema);return zNe(i,t)(n,r)},M3e=(e,t={})=>({state:n,dispatch:r})=>{const i=sn(e,n.schema);return QNe(i,t)(n,r)};var F3e=Object.freeze({__proto__:null,blur:AKe,clearContent:mKe,clearNodes:gKe,command:vKe,createParagraphNear:yKe,cut:bKe,deleteCurrentNode:CKe,deleteNode:SKe,deleteRange:wKe,deleteSelection:xKe,enter:_Ke,exitCode:TKe,extendMarkRange:IKe,first:EKe,focus:$Ke,forEach:kKe,insertContent:OKe,insertContentAt:jKe,joinBackward:UKe,joinDown:DKe,joinForward:BKe,joinItemBackward:PKe,joinItemForward:WKe,joinTextblockBackward:NKe,joinTextblockForward:KKe,joinUp:LKe,keyboardShortcut:VKe,lift:zKe,liftEmptyBlock:QKe,liftListItem:HKe,newlineInCode:YKe,resetAttributes:GKe,scrollIntoView:JKe,selectAll:ZKe,selectNodeBackward:XKe,selectNodeForward:e3e,selectParentNode:t3e,selectTextblockEnd:n3e,selectTextblockStart:r3e,setContent:o3e,setMark:m3e,setMeta:g3e,setNode:v3e,setNodeSelection:y3e,setTextSelection:b3e,sinkListItem:C3e,splitBlock:S3e,splitListItem:w3e,toggleList:x3e,toggleMark:_3e,toggleNode:T3e,toggleWrap:I3e,undoInputRule:E3e,unsetAllMarks:R3e,unsetMark:$3e,updateAttributes:k3e,wrapIn:O3e,wrapInList:M3e});jn.create({name:"commands",addCommands(){return{...F3e}}});jn.create({name:"drop",addProseMirrorPlugins(){return[new dn({key:new qn("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}});jn.create({name:"editable",addProseMirrorPlugins(){return[new dn({key:new qn("editable"),props:{editable:()=>this.editor.options.editable}})]}});jn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new dn({key:new qn("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}});jn.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:s})=>{const{selection:l,doc:c}=s,{empty:u,$anchor:f}=l,{pos:p,parent:h}=f,m=f.parent.isTextblock&&p>0?s.doc.resolve(p-1):f,g=m.parent.type.spec.isolating,y=f.pos-f.parentOffset,C=g&&m.parent.childCount===1?y===f.pos:je.atStart(c).from===p;return!u||!h.type.isTextblock||h.textContent.length||!C||C&&f.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return yC()||AJ()?o:i},addProseMirrorPlugins(){return[new dn({key:new qn("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(g=>g.getMeta("composition")))return;const r=e.some(g=>g.docChanged)&&!t.doc.eq(n.doc),i=e.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:a,to:s}=t.selection,l=je.atStart(t.doc).from,c=je.atEnd(t.doc).to;if(o||!(a===l&&s===c)||!MF(n.doc))return;const p=n.tr,h=mC({state:n,transaction:p}),{commands:m}=new EF({editor:this.editor,state:h});if(m.clearNodes(),!!p.steps.length)return p}})]}});jn.create({name:"paste",addProseMirrorPlugins(){return[new dn({key:new qn("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}});jn.create({name:"tabindex",addProseMirrorPlugins(){return[new dn({key:new qn("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function ey(e){return new $F({find:e.find,handler:({state:t,range:n,match:r})=>{const i=We(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],s=r[0];if(a){const l=s.search(/\S/),c=n.from+s.indexOf(a),u=c+a.length;if(vJ(n.from,n.to,t.doc).filter(h=>h.mark.type.excluded.find(g=>g===e.type&&g!==h.mark.type)).filter(h=>h.to>c).length)return null;u<n.to&&o.delete(u,n.to),c>n.from&&o.delete(n.from+l,c);const p=n.from+l+a.length;o.addMark(n.from+l,p,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function Fx(e){return new $F({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=We(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function ty(e){return new $F({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=We(e.getAttributes,void 0,r)||{},a=t.tr.delete(n.from,n.to),l=a.doc.resolve(n.from).blockRange(),c=l&&cNe(l,e.type,o);if(!c)return null;if(a.wrap(l,c),e.keepMarks&&e.editor){const{selection:f,storedMarks:p}=t,{splittableMarks:h}=e.editor.extensionManager,m=p||f.$to.parentOffset&&f.$from.marks();if(m){const g=m.filter(y=>h.includes(y.type.name));a.ensureMarks(g)}}if(e.keepAttributes){const f=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const u=a.doc.resolve(n.from-1).nodeBefore;u&&u.type===e.type&&wF(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,u))&&a.join(n.from-1)}})}class gn{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=We(de(this,"addOptions",{name:this.name}))),this.storage=We(de(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new gn(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>vC(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new gn(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=We(de(n,"addOptions",{name:n.name})),n.storage=We(de(n,"addStorage",{name:n.name,options:n.options})),n}}class j3e{constructor(t,n,r){this.isDragging=!1,this.component=t,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var n,r,i,o,a,s,l;const{view:c}=this.editor,u=t.target,f=u.nodeType===3?(n=u.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(u)||!f)return;let p=0,h=0;if(this.dom!==f){const C=this.dom.getBoundingClientRect(),x=f.getBoundingClientRect(),b=(i=t.offsetX)!==null&&i!==void 0?i:(o=t.nativeEvent)===null||o===void 0?void 0:o.offsetX,v=(a=t.offsetY)!==null&&a!==void 0?a:(s=t.nativeEvent)===null||s===void 0?void 0:s.offsetY;p=x.x-C.x+b,h=x.y-C.y+v}(l=t.dataTransfer)===null||l===void 0||l.setDragImage(this.dom,p,h);const m=this.getPos();if(typeof m!="number")return;const g=_e.create(c.state.doc,m),y=c.state.tr.setSelection(g);c.dispatch(y)}stopEvent(t){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:t});const r=t.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const o=t.type.startsWith("drag"),a=t.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!a&&!o)return!0;const{isEditable:l}=this.editor,{isDragging:c}=this,u=!!this.node.type.spec.draggable,f=_e.isSelectable(this.node),p=t.type==="copy",h=t.type==="paste",m=t.type==="cut",g=t.type==="mousedown";if(!u&&f&&o&&t.target===this.dom&&t.preventDefault(),u&&o&&!c&&t.target===this.dom)return t.preventDefault(),!1;if(u&&l&&!c&&g){const y=r.closest("[data-drag-handle]");y&&(this.dom===y||this.dom.contains(y))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||a||p||h||m||g&&f)}ignoreMutation(t){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:t}):this.node.isLeaf||this.node.isAtom?!0:t.type==="selection"||this.dom.contains(t.target)&&t.type==="childList"&&(yC()||pJ())&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target)}updateAttributes(t){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return typeof r!="number"?!1:(n.setNodeMarkup(r,void 0,{...this.node.attrs,...t}),!0)})}deleteNode(){const t=this.getPos();if(typeof t!="number")return;const n=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:n})}}function ny(e){return new sKe({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const o=We(e.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:a}=t,s=r[r.length-1],l=r[0];let c=n.to;if(s){const u=l.search(/\S/),f=n.from+l.indexOf(s),p=f+s.length;if(vJ(n.from,n.to,t.doc).filter(m=>m.mark.type.excluded.find(y=>y===e.type&&y!==m.mark.type)).filter(m=>m.to>f).length)return null;p<n.to&&a.delete(p,n.to),f>n.from&&a.delete(n.from+u,f),c=n.from+u+s.length,a.addMark(n.from+u,c,e.type.create(o||{})),a.removeStoredMark(e.type)}}})}function L3e(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var ry=200,hn=function(){};hn.prototype.append=function(t){return t.length?(t=hn.from(t),!this.length&&t||t.length<ry&&this.leafAppend(t)||this.length<ry&&t.leafPrepend(this)||this.appendInner(t)):this};hn.prototype.prepend=function(t){return t.length?hn.from(t).append(this):this};hn.prototype.appendInner=function(t){return new D3e(this,t)};hn.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?hn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};hn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};hn.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};hn.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(t(o,a))},n,r),i};hn.from=function(t){return t instanceof hn?t:t&&t.length?new yJ(t):hn.empty};var yJ=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,a,s){for(var l=o;l<a;l++)if(i(this.values[l],s+l)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,a,s){for(var l=o-1;l>=a;l--)if(i(this.values[l],s+l)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=ry)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=ry)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(hn);hn.empty=new yJ([]);var D3e=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,o,a){var s=this.left.length;if(i<s&&this.left.forEachInner(r,i,Math.min(o,s),a)===!1||o>s&&this.right.forEachInner(r,Math.max(i-s,0),Math.min(this.length,o)-s,a+s)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,a){var s=this.left.length;if(i>s&&this.right.forEachInvertedInner(r,i-s,Math.max(o,s)-s,a+s)===!1||o<s&&this.left.forEachInvertedInner(r,Math.min(i,s),o,a)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(hn);const U3e=500;class qi{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=t.tr,s,l,c=[],u=[];return this.items.forEach((f,p)=>{if(!f.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new wo(f.map));let h=f.step.map(i.slice(o)),m;h&&a.maybeStep(h).doc&&(m=a.mapping.maps[a.mapping.maps.length-1],c.push(new wo(m,void 0,void 0,c.length+u.length))),o--,m&&i.appendMap(m,o)}else a.maybeStep(f.step);if(f.selection)return s=i?f.selection.map(i.slice(o)):f.selection,l=new qi(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:a,selection:s}}addTransform(t,n,r,i){let o=[],a=this.eventCount,s=this.items,l=!i&&s.length?s.get(s.length-1):null;for(let u=0;u<t.steps.length;u++){let f=t.steps[u].invert(t.docs[u]),p=new wo(t.mapping.maps[u],f,n),h;(h=l&&l.merge(p))&&(p=h,u?o.pop():s=s.slice(0,s.length-1)),o.push(p),n&&(a++,n=void 0),i||(l=p)}let c=a-r.depth;return c>P3e&&(s=B3e(s,c),a-=c),new qi(s.append(o),a)}remapping(t,n){let r=new eWe;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},t,n),r}addMaps(t){return this.eventCount==0?this:new qi(this.items.append(t.map(n=>new wo(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,a=t.steps.length,s=this.eventCount;this.items.forEach(p=>{p.selection&&s--},i);let l=n;this.items.forEach(p=>{let h=o.getMirror(--l);if(h==null)return;a=Math.min(a,h);let m=o.maps[h];if(p.step){let g=t.steps[h].invert(t.docs[h]),y=p.selection&&p.selection.map(o.slice(l+1,h));y&&s++,r.push(new wo(m,g,y))}else r.push(new wo(m))},i);let c=[];for(let p=n;p<a;p++)c.push(new wo(o.maps[p]));let u=this.items.slice(0,i).append(c).append(r),f=new qi(u,s);return f.emptyItemCount()>U3e&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((a,s)=>{if(s>=t)i.push(a),a.selection&&o++;else if(a.step){let l=a.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=a.selection&&a.selection.map(n.slice(r));u&&o++;let f=new wo(c.invert(),l,u),p,h=i.length-1;(p=i.length&&i[h].merge(f))?i[h]=p:i.push(f)}}else a.map&&r--},this.items.length,0),new qi(hn.from(i.reverse()),o)}}qi.empty=new qi(hn.empty,0);function B3e(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class wo{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new wo(n.getMap().invert(),n,this.selection)}}}class ys{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const P3e=20;function W3e(e,t,n,r){let i=n.getMeta(ic),o;if(i)return i.historyState;n.getMeta(q3e)&&(e=new ys(e.done,e.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(a&&a.getMeta(ic))return a.getMeta(ic).redo?new ys(e.done.addTransform(n,void 0,r,rv(t)),e.undone,K2(n.mapping.maps),e.prevTime,e.prevComposition):new ys(e.done,e.undone.addTransform(n,void 0,r,rv(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let s=n.getMeta("composition"),l=e.prevTime==0||!a&&e.prevComposition!=s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!N3e(n,e.prevRanges)),c=a?iw(e.prevRanges,n.mapping):K2(n.mapping.maps);return new ys(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,rv(t)),qi.empty,c,n.time,s??e.prevComposition)}else return(o=n.getMeta("rebased"))?new ys(e.done.rebased(n,o),e.undone.rebased(n,o),iw(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new ys(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),iw(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function N3e(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&i>=t[o]&&(n=!0)}),n}function K2(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,o,a)=>t.push(o,a));return t}function iw(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function K3e(e,t,n){let r=rv(t),i=ic.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let a=o.selection.resolve(o.transform.doc),s=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),l=new ys(n?s:o.remaining,n?o.remaining:s,null,0,-1);return o.transform.setSelection(a).setMeta(ic,{redo:n,historyState:l})}let ow=!1,q2=null;function rv(e){let t=e.plugins;if(q2!=t){ow=!1,q2=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){ow=!0;break}}return ow}const ic=new qn("history"),q3e=new qn("closeHistory");function V3e(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new dn({key:ic,state:{init(){return new ys(qi.empty,qi.empty,null,0,-1)},apply(t,n,r){return W3e(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?CJ:r=="historyRedo"?SJ:null;return i?(n.preventDefault(),i(t.state,t.dispatch)):!1}}}})}function bJ(e,t){return(n,r)=>{let i=ic.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=K3e(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const CJ=bJ(!1,!0),SJ=bJ(!0,!0),z3e=jn.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>CJ(e,t),redo:()=>({state:e,dispatch:t})=>SJ(e,t)}},addProseMirrorPlugins(){return[V3e(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),bC=(e,t)=>{const{$from:n}=t.selection,r=sn(e,t.schema);let i=null,o=n.depth,a=n.pos,s=null;for(;o>0&&s===null;)i=n.node(o),i.type===r?s=o:(o-=1,a-=1);return s===null?null:{$pos:t.doc.resolve(a),depth:s}},wJ=(e,t)=>{const n=bC(e,t);if(!n)return!1;const[,r]=c3e(t,e,n.$pos.pos+4);return r},Q3e=(e,t,n)=>{const{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),o=e.doc.resolve(i).node();return!(!o||!n.includes(o.type.name))},H3e=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)===null||n===void 0?void 0:n.type.name)!==e)},Y3e=(e,t,n)=>{if(!n)return!1;const r=sn(e,t.schema);let i=!1;return n.descendants(o=>{o.type===r&&(i=!0)}),i},V2=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Md(e.state,t)&&Q3e(e.state,t,n)){const{$anchor:s}=e.state.selection,l=e.state.doc.resolve(s.before()-1),c=[];l.node().descendants((p,h)=>{p.type.name===t&&c.push({node:p,pos:h})});const u=c.at(-1);if(!u)return!1;const f=e.state.doc.resolve(l.start()+u.pos+1);return e.chain().cut({from:s.start()-1,to:s.end()+1},f.end()).joinForward().run()}if(!Md(e.state,t)||!f3e(e.state))return!1;const r=bC(t,e.state);if(!r)return!1;const o=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=Y3e(t,e.state,o);return H3e(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},G3e=(e,t)=>{const n=wJ(e,t),r=bC(e,t);return!r||!n?!1:n>r.depth},J3e=(e,t)=>{const n=wJ(e,t),r=bC(e,t);return!r||!n?!1:n<r.depth},z2=(e,t)=>{if(!Md(e.state,t)||!d3e(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:G3e(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():J3e(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},Z3e=jn.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&z2(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&z2(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&V2(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&V2(e,n,r)&&(t=!0)}),t}}}});var Or="top",Ii="bottom",Ei="right",Mr="left",FF="auto",rg=[Or,Ii,Ei,Mr],Fd="start",qh="end",X3e="clippingParents",xJ="viewport",xp="popper",e5e="reference",Q2=rg.reduce(function(e,t){return e.concat([t+"-"+Fd,t+"-"+qh])},[]),_J=[].concat(rg,[FF]).reduce(function(e,t){return e.concat([t,t+"-"+Fd,t+"-"+qh])},[]),t5e="beforeRead",n5e="read",r5e="afterRead",i5e="beforeMain",o5e="main",a5e="afterMain",s5e="beforeWrite",l5e="write",c5e="afterWrite",u5e=[t5e,n5e,r5e,i5e,o5e,a5e,s5e,l5e,c5e];function Uo(e){return e?(e.nodeName||"").toLowerCase():null}function li(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Rc(e){var t=li(e).Element;return e instanceof t||e instanceof Element}function Ti(e){var t=li(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function jF(e){if(typeof ShadowRoot>"u")return!1;var t=li(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function d5e(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!Ti(o)||!Uo(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function f5e(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,c){return l[c]="",l},{});!Ti(i)||!Uo(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const TJ={name:"applyStyles",enabled:!0,phase:"write",fn:d5e,effect:f5e,requires:["computeStyles"]};function Eo(e){return e.split("-")[0]}var oc=Math.max,iy=Math.min,jd=Math.round;function jx(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function IJ(){return!/^((?!chrome|android).)*safari/i.test(jx())}function Ld(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Ti(e)&&(i=e.offsetWidth>0&&jd(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&jd(r.height)/e.offsetHeight||1);var a=Rc(e)?li(e):window,s=a.visualViewport,l=!IJ()&&n,c=(r.left+(l&&s?s.offsetLeft:0))/i,u=(r.top+(l&&s?s.offsetTop:0))/o,f=r.width/i,p=r.height/o;return{width:f,height:p,top:u,right:c+f,bottom:u+p,left:c,x:c,y:u}}function LF(e){var t=Ld(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function EJ(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&jF(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Ta(e){return li(e).getComputedStyle(e)}function p5e(e){return["table","td","th"].indexOf(Uo(e))>=0}function $l(e){return((Rc(e)?e.ownerDocument:e.document)||window.document).documentElement}function CC(e){return Uo(e)==="html"?e:e.assignedSlot||e.parentNode||(jF(e)?e.host:null)||$l(e)}function H2(e){return!Ti(e)||Ta(e).position==="fixed"?null:e.offsetParent}function h5e(e){var t=/firefox/i.test(jx()),n=/Trident/i.test(jx());if(n&&Ti(e)){var r=Ta(e);if(r.position==="fixed")return null}var i=CC(e);for(jF(i)&&(i=i.host);Ti(i)&&["html","body"].indexOf(Uo(i))<0;){var o=Ta(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function ig(e){for(var t=li(e),n=H2(e);n&&p5e(n)&&Ta(n).position==="static";)n=H2(n);return n&&(Uo(n)==="html"||Uo(n)==="body"&&Ta(n).position==="static")?t:n||h5e(e)||t}function DF(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Jp(e,t,n){return oc(e,iy(t,n))}function A5e(e,t,n){var r=Jp(e,t,n);return r>n?n:r}function RJ(){return{top:0,right:0,bottom:0,left:0}}function $J(e){return Object.assign({},RJ(),e)}function kJ(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var m5e=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,$J(typeof t!="number"?t:kJ(t,rg))};function g5e(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Eo(n.placement),l=DF(s),c=[Mr,Ei].indexOf(s)>=0,u=c?"height":"width";if(!(!o||!a)){var f=m5e(i.padding,n),p=LF(o),h=l==="y"?Or:Mr,m=l==="y"?Ii:Ei,g=n.rects.reference[u]+n.rects.reference[l]-a[l]-n.rects.popper[u],y=a[l]-n.rects.reference[l],C=ig(o),x=C?l==="y"?C.clientHeight||0:C.clientWidth||0:0,b=g/2-y/2,v=f[h],S=x-p[u]-f[m],w=x/2-p[u]/2+b,T=Jp(v,w,S),E=l;n.modifiersData[r]=(t={},t[E]=T,t.centerOffset=T-w,t)}}function v5e(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||EJ(t.elements.popper,i)&&(t.elements.arrow=i))}const y5e={name:"arrow",enabled:!0,phase:"main",fn:g5e,effect:v5e,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Dd(e){return e.split("-")[1]}var b5e={top:"auto",right:"auto",bottom:"auto",left:"auto"};function C5e(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:jd(n*i)/i||0,y:jd(r*i)/i||0}}function Y2(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,f=e.isFixed,p=a.x,h=p===void 0?0:p,m=a.y,g=m===void 0?0:m,y=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=y.x,g=y.y;var C=a.hasOwnProperty("x"),x=a.hasOwnProperty("y"),b=Mr,v=Or,S=window;if(c){var w=ig(n),T="clientHeight",E="clientWidth";if(w===li(n)&&(w=$l(n),Ta(w).position!=="static"&&s==="absolute"&&(T="scrollHeight",E="scrollWidth")),w=w,i===Or||(i===Mr||i===Ei)&&o===qh){v=Ii;var R=f&&w===S&&S.visualViewport?S.visualViewport.height:w[T];g-=R-r.height,g*=l?1:-1}if(i===Mr||(i===Or||i===Ii)&&o===qh){b=Ei;var O=f&&w===S&&S.visualViewport?S.visualViewport.width:w[E];h-=O-r.width,h*=l?1:-1}}var k=Object.assign({position:s},c&&b5e),B=u===!0?C5e({x:h,y:g},li(n)):{x:h,y:g};if(h=B.x,g=B.y,l){var K;return Object.assign({},k,(K={},K[v]=x?"0":"",K[b]=C?"0":"",K.transform=(S.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",K))}return Object.assign({},k,(t={},t[v]=x?g+"px":"",t[b]=C?h+"px":"",t.transform="",t))}function S5e(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,c={placement:Eo(t.placement),variation:Dd(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Y2(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Y2(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const w5e={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:S5e,data:{}};var Mg={passive:!0};function x5e(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=li(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",n.update,Mg)}),s&&l.addEventListener("resize",n.update,Mg),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Mg)}),s&&l.removeEventListener("resize",n.update,Mg)}}const _5e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:x5e,data:{}};var T5e={left:"right",right:"left",bottom:"top",top:"bottom"};function iv(e){return e.replace(/left|right|bottom|top/g,function(t){return T5e[t]})}var I5e={start:"end",end:"start"};function G2(e){return e.replace(/start|end/g,function(t){return I5e[t]})}function UF(e){var t=li(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function BF(e){return Ld($l(e)).left+UF(e).scrollLeft}function E5e(e,t){var n=li(e),r=$l(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var c=IJ();(c||!c&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+BF(e),y:l}}function R5e(e){var t,n=$l(e),r=UF(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=oc(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=oc(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+BF(e),l=-r.scrollTop;return Ta(i||n).direction==="rtl"&&(s+=oc(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function PF(e){var t=Ta(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function OJ(e){return["html","body","#document"].indexOf(Uo(e))>=0?e.ownerDocument.body:Ti(e)&&PF(e)?e:OJ(CC(e))}function Zp(e,t){var n;t===void 0&&(t=[]);var r=OJ(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=li(r),a=i?[o].concat(o.visualViewport||[],PF(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Zp(CC(a)))}function Lx(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function $5e(e,t){var n=Ld(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function J2(e,t,n){return t===xJ?Lx(E5e(e,n)):Rc(t)?$5e(t,n):Lx(R5e($l(e)))}function k5e(e){var t=Zp(CC(e)),n=["absolute","fixed"].indexOf(Ta(e).position)>=0,r=n&&Ti(e)?ig(e):e;return Rc(r)?t.filter(function(i){return Rc(i)&&EJ(i,r)&&Uo(i)!=="body"}):[]}function O5e(e,t,n,r){var i=t==="clippingParents"?k5e(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,c){var u=J2(e,c,r);return l.top=oc(u.top,l.top),l.right=iy(u.right,l.right),l.bottom=iy(u.bottom,l.bottom),l.left=oc(u.left,l.left),l},J2(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function MJ(e){var t=e.reference,n=e.element,r=e.placement,i=r?Eo(r):null,o=r?Dd(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case Or:l={x:a,y:t.y-n.height};break;case Ii:l={x:a,y:t.y+t.height};break;case Ei:l={x:t.x+t.width,y:s};break;case Mr:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var c=i?DF(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case Fd:l[c]=l[c]-(t[u]/2-n[u]/2);break;case qh:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function Vh(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?X3e:s,c=n.rootBoundary,u=c===void 0?xJ:c,f=n.elementContext,p=f===void 0?xp:f,h=n.altBoundary,m=h===void 0?!1:h,g=n.padding,y=g===void 0?0:g,C=$J(typeof y!="number"?y:kJ(y,rg)),x=p===xp?e5e:xp,b=e.rects.popper,v=e.elements[m?x:p],S=O5e(Rc(v)?v:v.contextElement||$l(e.elements.popper),l,u,a),w=Ld(e.elements.reference),T=MJ({reference:w,element:b,strategy:"absolute",placement:i}),E=Lx(Object.assign({},b,T)),R=p===xp?E:w,O={top:S.top-R.top+C.top,bottom:R.bottom-S.bottom+C.bottom,left:S.left-R.left+C.left,right:R.right-S.right+C.right},k=e.modifiersData.offset;if(p===xp&&k){var B=k[i];Object.keys(O).forEach(function(K){var H=[Ei,Ii].indexOf(K)>=0?1:-1,z=[Or,Ii].indexOf(K)>=0?"y":"x";O[K]+=B[z]*H})}return O}function M5e(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?_J:l,u=Dd(r),f=u?s?Q2:Q2.filter(function(m){return Dd(m)===u}):rg,p=f.filter(function(m){return c.indexOf(m)>=0});p.length===0&&(p=f);var h=p.reduce(function(m,g){return m[g]=Vh(e,{placement:g,boundary:i,rootBoundary:o,padding:a})[Eo(g)],m},{});return Object.keys(h).sort(function(m,g){return h[m]-h[g]})}function F5e(e){if(Eo(e)===FF)return[];var t=iv(e);return[G2(e),t,G2(t)]}function j5e(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,m=h===void 0?!0:h,g=n.allowedAutoPlacements,y=t.options.placement,C=Eo(y),x=C===y,b=l||(x||!m?[iv(y)]:F5e(y)),v=[y].concat(b).reduce(function(Ce,P){return Ce.concat(Eo(P)===FF?M5e(t,{placement:P,boundary:u,rootBoundary:f,padding:c,flipVariations:m,allowedAutoPlacements:g}):P)},[]),S=t.rects.reference,w=t.rects.popper,T=new Map,E=!0,R=v[0],O=0;O<v.length;O++){var k=v[O],B=Eo(k),K=Dd(k)===Fd,H=[Or,Ii].indexOf(B)>=0,z=H?"width":"height",N=Vh(t,{placement:k,boundary:u,rootBoundary:f,altBoundary:p,padding:c}),Y=H?K?Ei:Mr:K?Ii:Or;S[z]>w[z]&&(Y=iv(Y));var ee=iv(Y),F=[];if(o&&F.push(N[B]<=0),s&&F.push(N[Y]<=0,N[ee]<=0),F.every(function(Ce){return Ce})){R=k,E=!1;break}T.set(k,F)}if(E)for(var M=m?3:1,W=function(P){var ae=v.find(function(Ge){var ve=T.get(Ge);if(ve)return ve.slice(0,P).every(function(De){return De})});if(ae)return R=ae,"break"},re=M;re>0;re--){var Ie=W(re);if(Ie==="break")break}t.placement!==R&&(t.modifiersData[r]._skip=!0,t.placement=R,t.reset=!0)}}const L5e={name:"flip",enabled:!0,phase:"main",fn:j5e,requiresIfExists:["offset"],data:{_skip:!1}};function Z2(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function X2(e){return[Or,Ei,Ii,Mr].some(function(t){return e[t]>=0})}function D5e(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Vh(t,{elementContext:"reference"}),s=Vh(t,{altBoundary:!0}),l=Z2(a,r),c=Z2(s,i,o),u=X2(l),f=X2(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const U5e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:D5e};function B5e(e,t,n){var r=Eo(e),i=[Mr,Or].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Mr,Ei].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function P5e(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=_J.reduce(function(u,f){return u[f]=B5e(f,t.rects,o),u},{}),s=a[t.placement],l=s.x,c=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}const W5e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:P5e};function N5e(e){var t=e.state,n=e.name;t.modifiersData[n]=MJ({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const K5e={name:"popperOffsets",enabled:!0,phase:"read",fn:N5e,data:{}};function q5e(e){return e==="x"?"y":"x"}function V5e(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,p=n.tether,h=p===void 0?!0:p,m=n.tetherOffset,g=m===void 0?0:m,y=Vh(t,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),C=Eo(t.placement),x=Dd(t.placement),b=!x,v=DF(C),S=q5e(v),w=t.modifiersData.popperOffsets,T=t.rects.reference,E=t.rects.popper,R=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,O=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),k=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(w){if(o){var K,H=v==="y"?Or:Mr,z=v==="y"?Ii:Ei,N=v==="y"?"height":"width",Y=w[v],ee=Y+y[H],F=Y-y[z],M=h?-E[N]/2:0,W=x===Fd?T[N]:E[N],re=x===Fd?-E[N]:-T[N],Ie=t.elements.arrow,Ce=h&&Ie?LF(Ie):{width:0,height:0},P=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:RJ(),ae=P[H],Ge=P[z],ve=Jp(0,T[N],Ce[N]),De=b?T[N]/2-M-ve-ae-O.mainAxis:W-ve-ae-O.mainAxis,gt=b?-T[N]/2+M+ve+Ge+O.mainAxis:re+ve+Ge+O.mainAxis,on=t.elements.arrow&&ig(t.elements.arrow),Yt=on?v==="y"?on.clientTop||0:on.clientLeft||0:0,xe=(K=k==null?void 0:k[v])!=null?K:0,Ze=Y+De-xe-Yt,ht=Y+gt-xe,tt=Jp(h?iy(ee,Ze):ee,Y,h?oc(F,ht):F);w[v]=tt,B[v]=tt-Y}if(s){var ct,Gt=v==="x"?Or:Mr,wn=v==="x"?Ii:Ei,Jt=w[S],Rt=S==="y"?"height":"width",Tr=Jt+y[Gt],Pt=Jt-y[wn],Zt=[Or,Mr].indexOf(C)!==-1,an=(ct=k==null?void 0:k[S])!=null?ct:0,Ir=Zt?Tr:Jt-T[Rt]-E[Rt]-an+O.altAxis,Er=Zt?Jt+T[Rt]+E[Rt]-an-O.altAxis:Pt,Me=h&&Zt?A5e(Ir,Jt,Er):Jp(h?Ir:Tr,Jt,h?Er:Pt);w[S]=Me,B[S]=Me-Jt}t.modifiersData[r]=B}}const z5e={name:"preventOverflow",enabled:!0,phase:"main",fn:V5e,requiresIfExists:["offset"]};function Q5e(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function H5e(e){return e===li(e)||!Ti(e)?UF(e):Q5e(e)}function Y5e(e){var t=e.getBoundingClientRect(),n=jd(t.width)/e.offsetWidth||1,r=jd(t.height)/e.offsetHeight||1;return n!==1||r!==1}function G5e(e,t,n){n===void 0&&(n=!1);var r=Ti(t),i=Ti(t)&&Y5e(t),o=$l(t),a=Ld(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Uo(t)!=="body"||PF(o))&&(s=H5e(t)),Ti(t)?(l=Ld(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=BF(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function J5e(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function Z5e(e){var t=J5e(e);return u5e.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function X5e(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function e6e(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var eD={placement:"bottom",modifiers:[],strategy:"absolute"};function tD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function t6e(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?eD:i;return function(s,l,c){c===void 0&&(c=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},eD,o),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},f=[],p=!1,h={state:u,setOptions:function(C){var x=typeof C=="function"?C(u.options):C;g(),u.options=Object.assign({},o,u.options,x),u.scrollParents={reference:Rc(s)?Zp(s):s.contextElement?Zp(s.contextElement):[],popper:Zp(l)};var b=Z5e(e6e([].concat(r,u.options.modifiers)));return u.orderedModifiers=b.filter(function(v){return v.enabled}),m(),h.update()},forceUpdate:function(){if(!p){var C=u.elements,x=C.reference,b=C.popper;if(tD(x,b)){u.rects={reference:G5e(x,ig(b),u.options.strategy==="fixed"),popper:LF(b)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(O){return u.modifiersData[O.name]=Object.assign({},O.data)});for(var v=0;v<u.orderedModifiers.length;v++){if(u.reset===!0){u.reset=!1,v=-1;continue}var S=u.orderedModifiers[v],w=S.fn,T=S.options,E=T===void 0?{}:T,R=S.name;typeof w=="function"&&(u=w({state:u,options:E,name:R,instance:h})||u)}}}},update:X5e(function(){return new Promise(function(y){h.forceUpdate(),y(u)})}),destroy:function(){g(),p=!0}};if(!tD(s,l))return h;h.setOptions(c).then(function(y){!p&&c.onFirstUpdate&&c.onFirstUpdate(y)});function m(){u.orderedModifiers.forEach(function(y){var C=y.name,x=y.options,b=x===void 0?{}:x,v=y.effect;if(typeof v=="function"){var S=v({state:u,name:C,instance:h,options:b}),w=function(){};f.push(S||w)}})}function g(){f.forEach(function(y){return y()}),f=[]}return h}}var n6e=[_5e,K5e,w5e,TJ,W5e,L5e,z5e,y5e,U5e],r6e=t6e({defaultModifiers:n6e}),i6e="tippy-box",FJ="tippy-content",o6e="tippy-backdrop",jJ="tippy-arrow",LJ="tippy-svg-arrow",Pl={passive:!0,capture:!0},DJ=function(){return document.body};function a6e(e,t){return{}.hasOwnProperty.call(e,t)}function aw(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function WF(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function UJ(e,t){return typeof e=="function"?e.apply(void 0,t):e}function nD(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function s6e(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function l6e(e){return e.split(/\s+/).filter(Boolean)}function ed(e){return[].concat(e)}function rD(e,t){e.indexOf(t)===-1&&e.push(t)}function c6e(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function u6e(e){return e.split("-")[0]}function oy(e){return[].slice.call(e)}function iD(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Xp(){return document.createElement("div")}function zh(e){return["Element","Fragment"].some(function(t){return WF(e,t)})}function d6e(e){return WF(e,"NodeList")}function f6e(e){return WF(e,"MouseEvent")}function p6e(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function h6e(e){return zh(e)?[e]:d6e(e)?oy(e):Array.isArray(e)?e:oy(document.querySelectorAll(e))}function sw(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function oD(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function A6e(e){var t,n=ed(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function m6e(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,l=s.interactiveBorder,c=u6e(a.placement),u=a.modifiersData.offset;if(!u)return!0;var f=c==="bottom"?u.top.y:0,p=c==="top"?u.bottom.y:0,h=c==="right"?u.left.x:0,m=c==="left"?u.right.x:0,g=o.top-r+f>l,y=r-o.bottom-p>l,C=o.left-n+h>l,x=n-o.right-m>l;return g||y||C||x})}function lw(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function aD(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var xo={isTouch:!1},sD=0;function g6e(){xo.isTouch||(xo.isTouch=!0,window.performance&&document.addEventListener("mousemove",BJ))}function BJ(){var e=performance.now();e-sD<20&&(xo.isTouch=!1,document.removeEventListener("mousemove",BJ)),sD=e}function v6e(){var e=document.activeElement;if(p6e(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function y6e(){document.addEventListener("touchstart",g6e,Pl),window.addEventListener("blur",v6e)}var b6e=typeof window<"u"&&typeof document<"u",C6e=b6e?!!window.msCrypto:!1;function Ku(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function lD(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function S6e(e){return lD(`
81
+ %ctippy.js
82
+
83
+ %c`+lD(e)+`
84
+
85
+ %c👷‍ This is a development-only message. It will be removed in production.
86
+ `)}function PJ(e){return[S6e(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Qh;process.env.NODE_ENV!=="production"&&w6e();function w6e(){Qh=new Set}function Aa(e,t){if(e&&!Qh.has(t)){var n;Qh.add(t),(n=console).warn.apply(n,PJ(t))}}function Dx(e,t){if(e&&!Qh.has(t)){var n;Qh.add(t),(n=console).error.apply(n,PJ(t))}}function x6e(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;Dx(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Dx(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var WJ={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},_6e={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Xr=Object.assign({appendTo:DJ,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},WJ,_6e),T6e=Object.keys(Xr),I6e=function(t){process.env.NODE_ENV!=="production"&&KJ(t,[]);var n=Object.keys(t);n.forEach(function(r){Xr[r]=t[r]})};function NJ(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var s;r[o]=e[o]!==void 0?e[o]:(s=Xr[o])!=null?s:a}return r},{});return Object.assign({},e,n)}function E6e(e,t){var n=t?Object.keys(NJ(Object.assign({},Xr,{plugins:t}))):T6e,r=n.reduce(function(i,o){var a=(e.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function cD(e,t){var n=Object.assign({},t,{content:UJ(t.content,[e])},t.ignoreAttributes?{}:E6e(e,t.plugins));return n.aria=Object.assign({},Xr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function KJ(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=s6e(Xr,Object.keys(WJ)),o=!a6e(i,r);o&&(o=t.filter(function(a){return a.name===r}).length===0),Aa(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
87
+
88
+ `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
89
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var R6e=function(){return"innerHTML"};function Ux(e,t){e[R6e()]=t}function uD(e){var t=Xp();return e===!0?t.className=jJ:(t.className=LJ,zh(e)?t.appendChild(e):Ux(t,e)),t}function dD(e,t){zh(t.content)?(Ux(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?Ux(e,t.content):e.textContent=t.content)}function Bx(e){var t=e.firstElementChild,n=oy(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(FJ)}),arrow:n.find(function(r){return r.classList.contains(jJ)||r.classList.contains(LJ)}),backdrop:n.find(function(r){return r.classList.contains(o6e)})}}function qJ(e){var t=Xp(),n=Xp();n.className=i6e,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Xp();r.className=FJ,r.setAttribute("data-state","hidden"),dD(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var s=Bx(t),l=s.box,c=s.content,u=s.arrow;a.theme?l.setAttribute("data-theme",a.theme):l.removeAttribute("data-theme"),typeof a.animation=="string"?l.setAttribute("data-animation",a.animation):l.removeAttribute("data-animation"),a.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?l.setAttribute("role",a.role):l.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&dD(c,e.props),a.arrow?u?o.arrow!==a.arrow&&(l.removeChild(u),l.appendChild(uD(a.arrow))):l.appendChild(uD(a.arrow)):u&&l.removeChild(u)}return{popper:t,onUpdate:i}}qJ.$$tippy=!0;var $6e=1,Fg=[],cw=[];function k6e(e,t){var n=cD(e,Object.assign({},Xr,NJ(iD(t)))),r,i,o,a=!1,s=!1,l=!1,c=!1,u,f,p,h=[],m=nD(Ze,n.interactiveDebounce),g,y=$6e++,C=null,x=c6e(n.plugins),b={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},v={id:y,reference:e,popper:Xp(),popperInstance:C,props:n,state:b,plugins:x,clearDelayTimeouts:Ir,setProps:Er,setContent:Me,show:$e,hide:D,hideWithInteractivity:L,enable:Zt,disable:an,unmount:U,destroy:ue};if(!n.render)return process.env.NODE_ENV!=="production"&&Dx(!0,"render() function has not been supplied."),v;var S=n.render(v),w=S.popper,T=S.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+v.id,v.popper=w,e._tippy=v,w._tippy=v;var E=x.map(function(j){return j.fn(v)}),R=e.hasAttribute("aria-expanded");return on(),M(),Y(),ee("onCreate",[v]),n.showOnCreate&&Tr(),w.addEventListener("mouseenter",function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&H().addEventListener("mousemove",m)}),v;function O(){var j=v.props.touch;return Array.isArray(j)?j:[j,0]}function k(){return O()[0]==="hold"}function B(){var j;return!!((j=v.props.render)!=null&&j.$$tippy)}function K(){return g||e}function H(){var j=K().parentNode;return j?A6e(j):document}function z(){return Bx(w)}function N(j){return v.state.isMounted&&!v.state.isVisible||xo.isTouch||u&&u.type==="focus"?0:aw(v.props.delay,j?0:1,Xr.delay)}function Y(j){j===void 0&&(j=!1),w.style.pointerEvents=v.props.interactive&&!j?"":"none",w.style.zIndex=""+v.props.zIndex}function ee(j,te,pe){if(pe===void 0&&(pe=!0),E.forEach(function(be){be[j]&&be[j].apply(be,te)}),pe){var le;(le=v.props)[j].apply(le,te)}}function F(){var j=v.props.aria;if(j.content){var te="aria-"+j.content,pe=w.id,le=ed(v.props.triggerTarget||e);le.forEach(function(be){var ot=be.getAttribute(te);if(v.state.isVisible)be.setAttribute(te,ot?ot+" "+pe:pe);else{var xn=ot&&ot.replace(pe,"").trim();xn?be.setAttribute(te,xn):be.removeAttribute(te)}})}}function M(){if(!(R||!v.props.aria.expanded)){var j=ed(v.props.triggerTarget||e);j.forEach(function(te){v.props.interactive?te.setAttribute("aria-expanded",v.state.isVisible&&te===K()?"true":"false"):te.removeAttribute("aria-expanded")})}}function W(){H().removeEventListener("mousemove",m),Fg=Fg.filter(function(j){return j!==m})}function re(j){if(!(xo.isTouch&&(l||j.type==="mousedown"))){var te=j.composedPath&&j.composedPath()[0]||j.target;if(!(v.props.interactive&&aD(w,te))){if(ed(v.props.triggerTarget||e).some(function(pe){return aD(pe,te)})){if(xo.isTouch||v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else ee("onClickOutside",[v,j]);v.props.hideOnClick===!0&&(v.clearDelayTimeouts(),v.hide(),s=!0,setTimeout(function(){s=!1}),v.state.isMounted||ae())}}}function Ie(){l=!0}function Ce(){l=!1}function P(){var j=H();j.addEventListener("mousedown",re,!0),j.addEventListener("touchend",re,Pl),j.addEventListener("touchstart",Ce,Pl),j.addEventListener("touchmove",Ie,Pl)}function ae(){var j=H();j.removeEventListener("mousedown",re,!0),j.removeEventListener("touchend",re,Pl),j.removeEventListener("touchstart",Ce,Pl),j.removeEventListener("touchmove",Ie,Pl)}function Ge(j,te){De(j,function(){!v.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&te()})}function ve(j,te){De(j,te)}function De(j,te){var pe=z().box;function le(be){be.target===pe&&(lw(pe,"remove",le),te())}if(j===0)return te();lw(pe,"remove",f),lw(pe,"add",le),f=le}function gt(j,te,pe){pe===void 0&&(pe=!1);var le=ed(v.props.triggerTarget||e);le.forEach(function(be){be.addEventListener(j,te,pe),h.push({node:be,eventType:j,handler:te,options:pe})})}function on(){k()&&(gt("touchstart",xe,{passive:!0}),gt("touchend",ht,{passive:!0})),l6e(v.props.trigger).forEach(function(j){if(j!=="manual")switch(gt(j,xe),j){case"mouseenter":gt("mouseleave",ht);break;case"focus":gt(C6e?"focusout":"blur",tt);break;case"focusin":gt("focusout",tt);break}})}function Yt(){h.forEach(function(j){var te=j.node,pe=j.eventType,le=j.handler,be=j.options;te.removeEventListener(pe,le,be)}),h=[]}function xe(j){var te,pe=!1;if(!(!v.state.isEnabled||ct(j)||s)){var le=((te=u)==null?void 0:te.type)==="focus";u=j,g=j.currentTarget,M(),!v.state.isVisible&&f6e(j)&&Fg.forEach(function(be){return be(j)}),j.type==="click"&&(v.props.trigger.indexOf("mouseenter")<0||a)&&v.props.hideOnClick!==!1&&v.state.isVisible?pe=!0:Tr(j),j.type==="click"&&(a=!pe),pe&&!le&&Pt(j)}}function Ze(j){var te=j.target,pe=K().contains(te)||w.contains(te);if(!(j.type==="mousemove"&&pe)){var le=Rt().concat(w).map(function(be){var ot,xn=be._tippy,bo=(ot=xn.popperInstance)==null?void 0:ot.state;return bo?{popperRect:be.getBoundingClientRect(),popperState:bo,props:n}:null}).filter(Boolean);m6e(le,j)&&(W(),Pt(j))}}function ht(j){var te=ct(j)||v.props.trigger.indexOf("click")>=0&&a;if(!te){if(v.props.interactive){v.hideWithInteractivity(j);return}Pt(j)}}function tt(j){v.props.trigger.indexOf("focusin")<0&&j.target!==K()||v.props.interactive&&j.relatedTarget&&w.contains(j.relatedTarget)||Pt(j)}function ct(j){return xo.isTouch?k()!==j.type.indexOf("touch")>=0:!1}function Gt(){wn();var j=v.props,te=j.popperOptions,pe=j.placement,le=j.offset,be=j.getReferenceClientRect,ot=j.moveTransition,xn=B()?Bx(w).arrow:null,bo=be?{getBoundingClientRect:be,contextElement:be.contextElement||K()}:e,kl={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(_n){var hs=_n.state;if(B()){var MC=z(),gp=MC.box;["placement","reference-hidden","escaped"].forEach(function(Ol){Ol==="placement"?gp.setAttribute("data-placement",hs.placement):hs.attributes.popper["data-popper-"+Ol]?gp.setAttribute("data-"+Ol,""):gp.removeAttribute("data-"+Ol)}),hs.attributes.popper={}}}},aa=[{name:"offset",options:{offset:le}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ot}},kl];B()&&xn&&aa.push({name:"arrow",options:{element:xn,padding:3}}),aa.push.apply(aa,(te==null?void 0:te.modifiers)||[]),v.popperInstance=r6e(bo,w,Object.assign({},te,{placement:pe,onFirstUpdate:p,modifiers:aa}))}function wn(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function Jt(){var j=v.props.appendTo,te,pe=K();v.props.interactive&&j===DJ||j==="parent"?te=pe.parentNode:te=UJ(j,[pe]),te.contains(w)||te.appendChild(w),v.state.isMounted=!0,Gt(),process.env.NODE_ENV!=="production"&&Aa(v.props.interactive&&j===Xr.appendTo&&pe.nextElementSibling!==w,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
90
+
91
+ `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
92
+
93
+ `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
94
+
95
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Rt(){return oy(w.querySelectorAll("[data-tippy-root]"))}function Tr(j){v.clearDelayTimeouts(),j&&ee("onTrigger",[v,j]),P();var te=N(!0),pe=O(),le=pe[0],be=pe[1];xo.isTouch&&le==="hold"&&be&&(te=be),te?r=setTimeout(function(){v.show()},te):v.show()}function Pt(j){if(v.clearDelayTimeouts(),ee("onUntrigger",[v,j]),!v.state.isVisible){ae();return}if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(j.type)>=0&&a)){var te=N(!1);te?i=setTimeout(function(){v.state.isVisible&&v.hide()},te):o=requestAnimationFrame(function(){v.hide()})}}function Zt(){v.state.isEnabled=!0}function an(){v.hide(),v.state.isEnabled=!1}function Ir(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Er(j){if(process.env.NODE_ENV!=="production"&&Aa(v.state.isDestroyed,Ku("setProps")),!v.state.isDestroyed){ee("onBeforeUpdate",[v,j]),Yt();var te=v.props,pe=cD(e,Object.assign({},te,iD(j),{ignoreAttributes:!0}));v.props=pe,on(),te.interactiveDebounce!==pe.interactiveDebounce&&(W(),m=nD(Ze,pe.interactiveDebounce)),te.triggerTarget&&!pe.triggerTarget?ed(te.triggerTarget).forEach(function(le){le.removeAttribute("aria-expanded")}):pe.triggerTarget&&e.removeAttribute("aria-expanded"),M(),Y(),T&&T(te,pe),v.popperInstance&&(Gt(),Rt().forEach(function(le){requestAnimationFrame(le._tippy.popperInstance.forceUpdate)})),ee("onAfterUpdate",[v,j])}}function Me(j){v.setProps({content:j})}function $e(){process.env.NODE_ENV!=="production"&&Aa(v.state.isDestroyed,Ku("show"));var j=v.state.isVisible,te=v.state.isDestroyed,pe=!v.state.isEnabled,le=xo.isTouch&&!v.props.touch,be=aw(v.props.duration,0,Xr.duration);if(!(j||te||pe||le)&&!K().hasAttribute("disabled")&&(ee("onShow",[v],!1),v.props.onShow(v)!==!1)){if(v.state.isVisible=!0,B()&&(w.style.visibility="visible"),Y(),P(),v.state.isMounted||(w.style.transition="none"),B()){var ot=z(),xn=ot.box,bo=ot.content;sw([xn,bo],0)}p=function(){var aa;if(!(!v.state.isVisible||c)){if(c=!0,w.offsetHeight,w.style.transition=v.props.moveTransition,B()&&v.props.animation){var sa=z(),_n=sa.box,hs=sa.content;sw([_n,hs],be),oD([_n,hs],"visible")}F(),M(),rD(cw,v),(aa=v.popperInstance)==null||aa.forceUpdate(),ee("onMount",[v]),v.props.animation&&B()&&ve(be,function(){v.state.isShown=!0,ee("onShown",[v])})}},Jt()}}function D(){process.env.NODE_ENV!=="production"&&Aa(v.state.isDestroyed,Ku("hide"));var j=!v.state.isVisible,te=v.state.isDestroyed,pe=!v.state.isEnabled,le=aw(v.props.duration,1,Xr.duration);if(!(j||te||pe)&&(ee("onHide",[v],!1),v.props.onHide(v)!==!1)){if(v.state.isVisible=!1,v.state.isShown=!1,c=!1,a=!1,B()&&(w.style.visibility="hidden"),W(),ae(),Y(!0),B()){var be=z(),ot=be.box,xn=be.content;v.props.animation&&(sw([ot,xn],le),oD([ot,xn],"hidden"))}F(),M(),v.props.animation?B()&&Ge(le,v.unmount):v.unmount()}}function L(j){process.env.NODE_ENV!=="production"&&Aa(v.state.isDestroyed,Ku("hideWithInteractivity")),H().addEventListener("mousemove",m),rD(Fg,m),m(j)}function U(){process.env.NODE_ENV!=="production"&&Aa(v.state.isDestroyed,Ku("unmount")),v.state.isVisible&&v.hide(),v.state.isMounted&&(wn(),Rt().forEach(function(j){j._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w),cw=cw.filter(function(j){return j!==v}),v.state.isMounted=!1,ee("onHidden",[v]))}function ue(){process.env.NODE_ENV!=="production"&&Aa(v.state.isDestroyed,Ku("destroy")),!v.state.isDestroyed&&(v.clearDelayTimeouts(),v.unmount(),Yt(),delete e._tippy,v.state.isDestroyed=!0,ee("onDestroy",[v]))}}function og(e,t){t===void 0&&(t={});var n=Xr.plugins.concat(t.plugins||[]);process.env.NODE_ENV!=="production"&&(x6e(e),KJ(t,n)),y6e();var r=Object.assign({},t,{plugins:n}),i=h6e(e);if(process.env.NODE_ENV!=="production"){var o=zh(r.content),a=i.length>1;Aa(o&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
96
+
97
+ `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
98
+
99
+ `,`1) content: element.innerHTML
100
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(l,c){var u=c&&k6e(c,r);return u&&l.push(u),l},[]);return zh(e)?s[0]:s}og.defaultProps=Xr;og.setDefaultProps=I6e;og.currentInput=xo;Object.assign({},TJ,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});og.setDefaultProps({render:qJ});class O6e{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:s,state:l,from:c,to:u})=>{const{doc:f,selection:p}=l,{empty:h}=p,m=!f.textBetween(c,u).length&&OF(l.selection),g=this.element.contains(document.activeElement);return!(!(s.hasFocus()||g)||h||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var l;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(s.relatedTarget))||(s==null?void 0:s.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.handleDebouncedUpdate=(s,l)=>{const c=!(l!=null&&l.selection.eq(s.state.selection)),u=!(l!=null&&l.doc.eq(s.state.doc));!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(s,c,u,l)},this.updateDelay))},this.updateHandler=(s,l,c,u)=>{var f,p,h;const{state:m,composing:g}=s,{selection:y}=m;if(g||!l&&!c)return;this.createTooltip();const{ranges:x}=y,b=Math.min(...x.map(w=>w.$from.pos)),v=Math.max(...x.map(w=>w.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,element:this.element,view:s,state:m,oldState:u,from:b,to:v}))){this.hide();return}(p=this.tippy)===null||p===void 0||p.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(p3e(m.selection)){let w=s.nodeDOM(b);if(w){const T=w.dataset.nodeViewWrapper?w:w.querySelector("[data-node-view-wrapper]");if(T&&(w=T.firstChild),w)return w.getBoundingClientRect()}}return h3e(s,b,v)})}),this.show()},this.editor=t,this.element=n,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=og(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(t,n){const{state:r}=t,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(t,n);return}const o=!(n!=null&&n.selection.eq(t.state.selection)),a=!(n!=null&&n.doc.eq(t.state.doc));this.updateHandler(t,o,a,n)}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t,n;!((t=this.tippy)===null||t===void 0)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const VJ=e=>new dn({key:typeof e.pluginKey=="string"?new qn(e.pluginKey):e.pluginKey,view:t=>new O6e({view:t,...e})});jn.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[VJ({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var Px={exports:{}},uw={};/**
101
+ * @license React
102
+ * use-sync-external-store-shim.production.min.js
103
+ *
104
+ * Copyright (c) Facebook, Inc. and its affiliates.
105
+ *
106
+ * This source code is licensed under the MIT license found in the
107
+ * LICENSE file in the root directory of this source tree.
108
+ */var fD;function M6e(){if(fD)return uw;fD=1;var e=I;function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(f,p){var h=p(),m=r({inst:{value:h,getSnapshot:p}}),g=m[0].inst,y=m[1];return o(function(){g.value=h,g.getSnapshot=p,l(g)&&y({inst:g})},[f,h,p]),i(function(){return l(g)&&y({inst:g}),f(function(){l(g)&&y({inst:g})})},[f]),a(h),h}function l(f){var p=f.getSnapshot;f=f.value;try{var h=p();return!n(f,h)}catch{return!0}}function c(f,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return uw.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,uw}var dw={};/**
109
+ * @license React
110
+ * use-sync-external-store-shim.development.js
111
+ *
112
+ * Copyright (c) Facebook, Inc. and its affiliates.
113
+ *
114
+ * This source code is licensed under the MIT license found in the
115
+ * LICENSE file in the root directory of this source tree.
116
+ */var pD;function F6e(){return pD||(pD=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=I,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(b){{for(var v=arguments.length,S=new Array(v>1?v-1:0),w=1;w<v;w++)S[w-1]=arguments[w];r("error",b,S)}}function r(b,v,S){{var w=t.ReactDebugCurrentFrame,T=w.getStackAddendum();T!==""&&(v+="%s",S=S.concat([T]));var E=S.map(function(R){return String(R)});E.unshift("Warning: "+v),Function.prototype.apply.call(console[b],console,E)}}function i(b,v){return b===v&&(b!==0||1/b===1/v)||b!==b&&v!==v}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue,u=!1,f=!1;function p(b,v,S){u||e.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var w=v();if(!f){var T=v();o(w,T)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var E=a({inst:{value:w,getSnapshot:v}}),R=E[0].inst,O=E[1];return l(function(){R.value=w,R.getSnapshot=v,h(R)&&O({inst:R})},[b,w,v]),s(function(){h(R)&&O({inst:R});var k=function(){h(R)&&O({inst:R})};return b(k)},[b]),c(w),w}function h(b){var v=b.getSnapshot,S=b.value;try{var w=v();return!o(S,w)}catch{return!0}}function m(b,v,S){return v()}var g=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y=!g,C=y?m:p,x=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:C;dw.useSyncExternalStore=x,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),dw}process.env.NODE_ENV==="production"?Px.exports=M6e():Px.exports=F6e();var NF=Px.exports;const j6e=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},L6e=({contentComponent:e})=>{const t=NF.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return I.createElement(I.Fragment,null,Object.values(t))};function D6e(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:d_.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(i=>i())}}}class U6e extends I.Component{constructor(t){var n;super(t),this.editorContentRef=I.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=t.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const t=this.props.editor;if(t&&!t.isDestroyed&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=D6e(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const t=this.props.editor;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,innerRef:n,...r}=this.props;return I.createElement(I.Fragment,null,I.createElement("div",{ref:j6e(n,this.editorContentRef),...r}),(t==null?void 0:t.contentComponent)&&I.createElement(L6e,{contentComponent:t.contentComponent}))}}const B6e=I.forwardRef((e,t)=>{const n=I.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return I.createElement(U6e,{key:n,innerRef:t,...e})}),P6e=I.memo(B6e);var fw={};/**
117
+ * @license React
118
+ * use-sync-external-store-shim/with-selector.production.min.js
119
+ *
120
+ * Copyright (c) Facebook, Inc. and its affiliates.
121
+ *
122
+ * This source code is licensed under the MIT license found in the
123
+ * LICENSE file in the root directory of this source tree.
124
+ */var hD;function W6e(){if(hD)return fw;hD=1;var e=I,t=NF;function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;return fw.useSyncExternalStoreWithSelector=function(c,u,f,p,h){var m=o(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=s(function(){function C(w){if(!x){if(x=!0,b=w,w=p(w),h!==void 0&&g.hasValue){var T=g.value;if(h(T,w))return v=T}return v=w}if(T=v,r(b,w))return T;var E=p(w);return h!==void 0&&h(T,E)?T:(b=w,v=E)}var x=!1,b,v,S=f===void 0?null:f;return[function(){return C(u())},S===null?void 0:function(){return C(S())}]},[u,f,p,h]);var y=i(c,m[0],m[1]);return a(function(){g.hasValue=!0,g.value=y},[y]),l(y),y},fw}var pw={};/**
125
+ * @license React
126
+ * use-sync-external-store-shim/with-selector.development.js
127
+ *
128
+ * Copyright (c) Facebook, Inc. and its affiliates.
129
+ *
130
+ * This source code is licensed under the MIT license found in the
131
+ * LICENSE file in the root directory of this source tree.
132
+ */var AD;function N6e(){return AD||(AD=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=I,t=NF;function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;function c(u,f,p,h,m){var g=o(null),y;g.current===null?(y={hasValue:!1,value:null},g.current=y):y=g.current;var C=s(function(){var S=!1,w,T,E=function(B){if(!S){S=!0,w=B;var K=h(B);if(m!==void 0&&y.hasValue){var H=y.value;if(m(H,K))return T=H,H}return T=K,K}var z=w,N=T;if(r(z,B))return N;var Y=h(B);return m!==void 0&&m(N,Y)?N:(w=B,T=Y,Y)},R=p===void 0?null:p,O=function(){return E(f())},k=R===null?void 0:function(){return E(R())};return[O,k]},[f,p,h,m]),x=C[0],b=C[1],v=i(u,x,b);return a(function(){y.hasValue=!0,y.value=v},[v]),l(v),v}pw.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),pw}process.env.NODE_ENV==="production"?W6e():N6e();process.env.NODE_ENV;const zJ=I.createContext({editor:null});zJ.Consumer;const K6e=()=>I.useContext(zJ),hw=e=>{const[t,n]=I.useState(null),{editor:r}=K6e();return I.useEffect(()=>{var i;if(!t||!((i=e.editor)===null||i===void 0)&&i.isDestroyed||r!=null&&r.isDestroyed)return;const{pluginKey:o="bubbleMenu",editor:a,tippyOptions:s={},updateDelay:l,shouldShow:c=null}=e,u=a||r;if(!u){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const f=VJ({updateDelay:l,editor:u,element:t,pluginKey:o,shouldShow:c,tippyOptions:s});return u.registerPlugin(f),()=>{u.unregisterPlugin(o)}},[e.editor,r,t]),I.createElement("div",{ref:n,className:e.className,style:{visibility:"hidden"}},e.children)},QJ=I.createContext({onDragStart:void 0}),q6e=()=>I.useContext(QJ),HJ=I.forwardRef((e,t)=>{const{onDragStart:n}=q6e(),r=e.as||"div";return I.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function V6e(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function z6e(e){var t;return typeof e=="object"&&((t=e.$$typeof)===null||t===void 0?void 0:t.toString())==="Symbol(react.forward_ref)"}class YJ{constructor(t,{editor:n,props:r={},as:i="div",className:o=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.editor.isInitialized?d_.flushSync(()=>{this.render()}):this.render()}render(){var t;const n=this.component,r=this.props,i=this.editor;(V6e(n)||z6e(n))&&(r.ref=o=>{this.ref=o}),this.reactElement=I.createElement(n,{...r}),(t=i==null?void 0:i.contentComponent)===null||t===void 0||t.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t;const n=this.editor;(t=n==null?void 0:n.contentComponent)===null||t===void 0||t.removeRenderer(this.id)}updateAttributes(t){Object.keys(t).forEach(n=>{this.element.setAttribute(n,t[n])})}}class Q6e extends j3e{mount(){const t={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(c={})=>this.updateAttributes(c),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const c=u=>u.charAt(0).toUpperCase()+u.substring(1);this.component.displayName=c(this.extension.name)}const i={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)}},o=this.component,a=I.memo(c=>I.createElement(QJ.Provider,{value:i},I.createElement(o,c)));a.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.style.whiteSpace="inherit");let s=this.node.isInline?"span":"div";this.options.as&&(s=this.options.as);const{className:l=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new YJ(a,{editor:this.editor,props:t,as:s,className:`node-${this.node.type.name} ${l}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var t;if(this.renderer.element.firstElementChild&&!(!((t=this.renderer.element.firstElementChild)===null||t===void 0)&&t.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:t,to:n}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(t<=r&&n>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(t,n,r){const i=o=>{this.renderer.updateProps(o),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(t.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const o=this.node,a=this.decorations,s=this.innerDecorations;return this.node=t,this.decorations=n,this.innerDecorations=r,this.options.update({oldNode:o,oldDecorations:a,newNode:t,newDecorations:n,oldInnerDecorations:s,innerDecorations:r,updateProps:()=>i({node:t,decorations:n,innerDecorations:r})})}return t===this.node&&this.decorations===n&&this.innerDecorations===r||(this.node=t,this.decorations=n,this.innerDecorations=r,i({node:t,decorations:n,innerDecorations:r})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let t={};if(typeof this.options.attrs=="function"){const n=this.editor.extensionManager.attributes,r=Jv(this.node,n);t=this.options.attrs({node:this.node,HTMLAttributes:r})}else t=this.options.attrs;this.renderer.updateAttributes(t)}}}function GJ(e,t){return n=>n.editor.contentComponent?new Q6e(e,n,t):{}}function JJ(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=JJ(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ZJ(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=JJ(e))&&(r&&(r+=" "),r+=t);return r}function H6e(e){return e.type==="table"}const ac={...he.RichTextNodeType,table:"table"};function Y6e(e){return!!(e&&e.has(ac.table))}const G6e=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,J6e=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Z6e=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,X6e=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,e4e=tg.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",Ut(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ey({find:G6e,type:this.type}),ey({find:Z6e,type:this.type})]},addPasteRules(){return[ny({find:J6e,type:this.type}),ny({find:X6e,type:this.type})]}});var ju=(e=>(e.Document="document",e.Mark="mark",e.Node="node",e))(ju||{}),Hl=(e=>(e.Text="text",e.Embed="embed",e.Image="image",e.Table="table",e))(Hl||{});class t4e{constructor(t,n,r){$t(this,"extType","document");this.name=t,this.component=n,this.converter=r}}class ag{constructor(t,n,r,i,o,a=!1){$t(this,"extType","node");$t(this,"nodeType","text");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}function XJ(e){return e instanceof ag}class n4e{constructor(t,n,r,i){$t(this,"extType","node");$t(this,"nodeType","embed");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class r4e{constructor(t,n,r,i){$t(this,"extType","node");$t(this,"nodeType","image");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class i4e extends ag{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class KF extends ag{constructor(t,n,r,i){super(t,n,r,i)}}class o4e{constructor(t,n,r,i){$t(this,"extType","node");$t(this,"nodeType","table");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}function a4e(e){return e instanceof KF}const eZ=gn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Ut(this.options.HTMLAttributes,e)]},renderText(){return`
133
+ `},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:s}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&a){const f=l.filter(p=>s.includes(p.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),zs={isHardBreak(e){return e.type.name===eZ.name},children:{reduce(e,t,n){let r=n;return e.forEach((i,o,a)=>{r=t(r,i,a)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},exists(e,t){return this.reduce(e,(n,r)=>n||t(r),!1)},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}},marks:{reduce(e,t,n){let r=n;return e.marks.forEach((i,o)=>{r=t(r,i,o)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}}};function s4e(e){if(!e||!(e!=null&&e.single)&&!(e!=null&&e.multi))return mD();const t=l4e(e);if(!t.size)return mD();const n=c4e(t),r=u4e(n,e);return{nodeTypes:t,extensions:r}}function l4e(e){const n=(e.single||e.multi||"").split(/\s*,\s*/).map(r=>{if(r==="table")return r;const i=he.RichTextNodeTypeCodec.decode(r);return i._tag==="Right"?i.right:void 0}).filter(Qi.isDefined);return new Set(n)}function c4e(e){return mX(e).filter(n=>ni.some(e,r=>n.richTextNodeTypes.includes(r)))}function u4e(e,t){var r;const n=new Set(e);return ni.some(n,a4e)&&n.add(Fr),ni.some(n,XJ)||n.add(Fr),(r=t==null?void 0:t.labels)!=null&&r.length&&n.add(JF),[...n]}function mD(){return{extensions:mX(),nodeTypes:new Set(Nd.keys(he.RichTextNodeTypeCodec.keys))}}class d4e{constructor(t,n,r){$t(this,"extType",ju.Mark);$t(this,"richTextNodeTypes",[he.RichTextNodeType.strong]);this.name=t,this.component=n,this.converter=r}}const tZ="bold",nZ=e4e.extend({name:tZ}),f4e={fromPrismic(e){return function(){var t;return(t=e.marks[nZ.name])==null?void 0:t.create()}},toPrismic(){}},p4e=new d4e(tZ,nZ,f4e),qF=p4e,h4e="listItem",gD="textStyle",vD=/^\s*([-+*])\s$/,A4e=gn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Ut(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(h4e,this.editor.getAttributes(gD)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=ty({find:vD,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ty({find:vD,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(gD),editor:this.editor})),[e]}}),m4e=gn.create({name:"doc",topNode:!0,content:"block+"}),g4e=gn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Ut(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),rZ=g4e.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),v4e={fromPrismic(e){return function(t){var r;const n=Fr.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[rZ.name])==null?void 0:r.create({},n)}},toPrismic(e,t){return zs.children.reduce(e,(n,r)=>{const i=Fr.converter.toPrismic(r),o=(()=>i instanceof Array?i.map(a=>({...a,type:t})):i?[{...i,type:t}]:[])();return[...n,...o]},[])}},Ud={component:rZ,converter:v4e,placeholder:"List"};function y4e(e,t){return e.copy(e.content.append(t.content))}const td={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",preformatted:"preformatted",strong:"strong",em:"em",listItem:"list-item",oListItem:"o-list-item",list:"group-list-item",oList:"group-o-list-item",image:"image",embed:"embed",hyperlink:"hyperlink",label:"label",span:"span"},SC=()=>(++SC.i).toString();SC.i=0;const b4e=e=>{const t=C4e(e),n=[];for(let r=0;r<t.length;r++)n.push(iZ(t[r]));return{key:SC(),children:n}},eh=(e,t=[])=>({key:SC(),type:e.type,text:"text"in e?e.text:void 0,node:e,children:t}),Aw=e=>eh({type:td.span,text:e,spans:[]}),C4e=e=>{const t=e.slice(0);for(let n=0;n<t.length;n++){const r=t[n];if(r.type===td.listItem||r.type===td.oListItem){const i=[r];for(;t[n+1]&&t[n+1].type===r.type;)i.push(t[n+1]),t.splice(n,1);r.type===td.listItem?t[n]={type:td.list,items:i}:t[n]={type:td.oList,items:i}}}return t},iZ=e=>{if("text"in e)return eh(e,oZ(e.spans,e));if("items"in e){const t=[];for(let n=0;n<e.items.length;n++)t.push(iZ(e.items[n]));return eh(e,t)}return eh(e)},oZ=(e,t,n)=>{if(!e.length)return[Aw(t.text)];const r=e.slice(0);r.sort((o,a)=>o.start-a.start||a.end-o.end);const i=[];for(let o=0;o<r.length;o++){const a=r[o],s=n&&n.start||0,l=a.start-s,c=a.end-s,u=t.text.slice(l,c),f=[];for(let h=o;h<r.length;h++){const m=r[h];m!==a&&m.start>=a.start&&m.end<=a.end&&(f.push(m),r.splice(h,1),h--)}o===0&&l>0&&i.push(Aw(t.text.slice(0,l)));const p={...a,text:u};i.push(eh(p,oZ(f,{...t,text:u},a))),c<t.text.length&&i.push(Aw(t.text.slice(c,r[o+1]?r[o+1].start-s:void 0)))}return i},S4e=(e,t)=>aZ(b4e(e).children,t),aZ=(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t(i.type,i.node,i.text,aZ(i.children,t),i.key);o!=null&&n.push(o)}return n},w4e=gn.create({name:"text",group:"inline"});function x4e(e){return e.reduce((t,n)=>{const r=(t[n.type]||[]).concat(n);return{...t,[n.type]:r}},{})}function yD(e){return e.sort((t,n)=>t.start-n.start)}function _4e(e){const t=x4e(e),n=Object.entries(t).map(([r,i])=>yD(i).reduce((a,s)=>{if(!a.length)return[s];const l=a.length-1,c=a[l];return c?c.end<s.start?[...a,s]:c.end>=s.end?a:[...a.slice(0,l),{...c,end:s.end}]:a},[])).flat();return yD(n)}const ay=eZ.extend({name:"hard_break"}),sy=`
134
+ `,sZ={fromPrismic(e){return function(t){var n;if(t===sy)return(n=e.nodes[ay.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===ay.name)return sy}},mw={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function T4e(e,t){return function(n){const r=sZ.fromPrismic(e)(sy);if(!r)return[n(t)];const i=t.split(sy);return i.length===1?t.length?[n(t)]:[r]:i.reduce((o,a,s)=>mw.isFirst(s)?mw.isEmptyLine(a)?o:[...o,n(a)]:mw.isEmptyLine(a)?[...o,r]:[...o,r,n(a)],[])}}const I4e={name:ay.name,component:ay,converter:sZ,splitTextToNodes:T4e},ly=I4e,lZ={fromPrismic(e){return t=>{switch(t.type){case"hyperlink":return LZ.converter.fromPrismic(e)(t);case"em":return GF.converter.fromPrismic(e)(t);case"strong":return qF.converter.fromPrismic(e)(t);case"label":return JF.converter.fromPrismic(e)(t);case"list-item":return}}},toPrismic(e,t,n){const r=AX.find(i=>e.type.name===i.name);if(!r)throw new Error(`Invalid mark extension '${e.type.name}'.`);switch(r.name){case"bold":return{type:"strong",start:t,end:n};case"em":return{type:r.name,start:t,end:n};case"hyperlink":return{type:r.name,start:t,end:n,data:r.converter.toPrismic(e)};case"label":return{type:r.name,start:t,end:n,data:r.converter.toPrismic(e)}}}},E4e={strong:"bold",label:"label",em:"em",hyperlink:"hyperlink","list-item":void 0},bD=w4e.extend({name:"text"}),R4e={fromPrismic(e){return function(t,n,r=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return S4e([i],$4e(e,r)).flat()}},toPrismic(e,t,n){const r=zs.children.reduce(e,(i,o)=>{const a=(()=>o.type.name===ly.name?ly.converter.toPrismic(o):o.textContent)(),s=a?i.text+a:i.text,l=i.text.length,c=s.length,u=(()=>o.marks.length?zs.marks.map(o,p=>lZ.toPrismic(p,l,c)):void 0)();return{...i,text:s,spans:u?[...i.spans,...u]:i.spans}},{text:"",spans:[]});return{type:t,content:{text:r.text,spans:[..._4e(r.spans)].sort((i,o)=>i.type.localeCompare(o.type))},...n}}};function $4e(e,t=!1){return(n,r,i,o)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:ly.splitTextToNodes(e,i)(l=>e.text(l));const a=lZ.fromPrismic(e)(r);return a?k4e(a,o):o.flat()}}function k4e(e,t){return t.flat().map(r=>{const o=[...r.marks,e].sort((a,s)=>a.type.name.localeCompare(s.type.name));return r.mark(o)})}const O4e={name:bD.name,component:bD,converter:R4e},$c=O4e,VF="document";function M4e(e){return m4e.extend({name:VF,content:e?"block+":"block"})}function F4e(e){return{fromPrismic(t,n,r){var o;const i=r.value.reduce((a,s)=>{const{extension:l,block:c}=U4e(e,s,t,n),u=L4e({extension:l,block:c,schema:t}),f=a.slice(0,a.length-1),p=_t.last(a),h=D4e({node:u,previousNode:p});return h.updatedNode?[...h.merged?f:a,h.updatedNode]:a},[]);return(o=t.nodes[VF])==null?void 0:o.create({},i)},toPrismic(t){return{__TYPE__:"StructuredTextContent",value:[...zs.children.reduce(t,(r,i)=>{const o=Object.values(e).find(s=>i.type.name===s.name),a=o==null?void 0:o.converter.toPrismic(i);return a||console.warn(`Cannot convert node of type '${i.type.name}'.`),a?[...r,...a instanceof Array?a:[a]]:r},[])]}}}}const j4e=new t4e(VF,M4e,F4e),Wx=j4e;function L4e(e){const{extension:t,block:n,schema:r}=e;if(t)switch(t.nodeType){case Hl.Embed:return fe.EmbedBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case Hl.Text:return fe.TextBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case Hl.Image:return fe.ImageBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case Hl.Table:return H6e(n)?t.converter.fromPrismic(r)(n):void 0}}function D4e(e){const{node:t,previousNode:n}=e;return!t||!n?{merged:!1,updatedNode:t}:t.type.name===n.type.name&&(t.type.name===py.name||t.type.name===Ay.name)?{merged:!0,updatedNode:y4e(n,t)}:{merged:!1,updatedNode:t}}function U4e(e,t,n,r){var s;const i=e.find(l=>l.richTextNodeTypes.includes(t.type)&&r.has(t.type));if(i)return{extension:i,block:t};if(!fe.TextBlock.is(t))return{extension:void 0,block:t};const o=e.find(l=>XJ(l)&&l.name in n.nodes),a=(s=t.content.spans)==null?void 0:s.filter(l=>{const c=E4e[l.type];return c&&c in n.marks});return{extension:o,block:{...t,content:{text:t.content.text,spans:a}}}}const B4e=jn.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new dn({key:new qn("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;const o=this.editor.isEmpty;return e.descendants((a,s)=>{const l=r>=s&&r<=s+a.nodeSize,c=!a.isLeaf&&MF(a);if((l||!this.options.showOnlyCurrent)&&c){const u=[this.options.emptyNodeClass];o&&u.push(this.options.emptyEditorClass);const f=Jn.node(s,s+a.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:s,hasAnchor:l}):this.options.placeholder});i.push(f)}return this.options.includeChildren}),Ot.create(e,i)}}})]}}),P4e=gn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Ut(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ov="ltr",Yl="rtl",ga="dir",CD=he.RichTextNodeType.rtl,W4e=jn.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[ga]:{default:ov,parseHTML:e=>e.getAttribute(ga),renderHTML:e=>({[ga]:Nx(e[ga])})}}}]},addCommands(){return{setDirection:e=>({commands:t})=>{switch(e){case ov:return t.setLeftToRight();case Yl:return t.setRightToLeft()}},toggleDirection:e=>({commands:t})=>{const n=e===Yl?ov:Yl;return t.setDirection(n)},setRightToLeft:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.updateAttributes(t,{[ga]:Yl})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,ga))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),Ia={parseNodeAttrsDirection(e){return Nx(e[ga])},fromPrismic(e){return{[ga]:Nx(e.direction)}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}};function Nx(e){return e===Yl?Yl:ov}const cy=P4e.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Ut(this.options.HTMLAttributes,e),0]}}),N4e={fromPrismic(e){return function(t){var r;const n=$c.converter.fromPrismic(e)(cy.name,t);return(r=e.nodes[cy.name])==null?void 0:r.create(Ia.fromPrismic(t),n)}},toPrismic(e){return $c.converter.toPrismic(e,he.RichTextNodeType.paragraph,Ia.toPrismic(e))}},K4e=new ag([he.RichTextNodeType.paragraph],cy.name,cy,N4e,"Type '/' for commands"),Fr=K4e,q4e=e=>B4e.configure({includeChildren:!0,placeholder:t=>V4e(t,e),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function V4e(e,t){const{editor:n,hasAnchor:r,pos:i,node:o}=e,{placeholderByNodeType:a,unfocusedPlaceholder:s,nodeExtensions:l}=t,c=!zs.children.exists(n.state.doc,x=>x===o),u=n.isEditable;if(s&&!n.isFocused&&n.isEmpty&&i===0)return s;const f=o.type.name!==Fr.name,p=n.isFocused&&r||f||c,h=l.filter(x=>x!==Fr).length>1;function m(x){return x===Fr.placeholder?u&&p&&h:u&&p}function g(){if(c)return Ud.placeholder;const x=a[o.type.name];return typeof x=="string"?x:x==null?void 0:x(o.attrs)}const y=g();return m(y)&&y||""}function wC(e){return e.split("-")[1]}function cZ(e){return e==="y"?"height":"width"}function Fs(e){return e.split("-")[0]}function sg(e){return["top","bottom"].includes(Fs(e))?"x":"y"}function SD(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=sg(t),l=cZ(s),c=r[l]/2-i[l]/2,u=s==="x";let f;switch(Fs(t)){case"top":f={x:o,y:r.y-i.height};break;case"bottom":f={x:o,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:a};break;case"left":f={x:r.x-i.width,y:a};break;default:f={x:r.x,y:r.y}}switch(wC(t)){case"start":f[s]-=c*(n&&u?-1:1);break;case"end":f[s]+=c*(n&&u?-1:1)}return f}const z4e=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:f}=SD(c,r,l),p=r,h={},m=0;for(let g=0;g<s.length;g++){const{name:y,fn:C}=s[g],{x,y:b,data:v,reset:S}=await C({x:u,y:f,initialPlacement:r,placement:p,strategy:i,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});u=x??u,f=b??f,h={...h,[y]:{...h[y],...v}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(p=S.placement),S.rects&&(c=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:u,y:f}=SD(c,p,l)),g=-1)}return{x:u,y:f,placement:p,strategy:i,middlewareData:h}};function Q4e(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function Kx(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function uZ(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=t,m=Q4e(h),g=s[p?f==="floating"?"reference":"floating":f],y=Kx(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),C=f==="floating"?{...a.floating,x:r,y:i}:a.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),b=await(o.isElement==null?void 0:o.isElement(x))&&await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1},v=Kx(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:C,offsetParent:x,strategy:l}):C);return{top:(y.top-v.top+m.top)/b.y,bottom:(v.bottom-y.bottom+m.bottom)/b.y,left:(y.left-v.left+m.left)/b.x,right:(v.right-y.right+m.right)/b.x}}const H4e=Math.min,Y4e=Math.max;function wD(e,t,n){return Y4e(e,H4e(t,n))}const G4e=["top","right","bottom","left"];G4e.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const J4e={left:"right",right:"left",bottom:"top",top:"bottom"};function uy(e){return e.replace(/left|right|bottom|top/g,t=>J4e[t])}function Z4e(e,t,n){n===void 0&&(n=!1);const r=wC(e),i=sg(e),o=cZ(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=uy(a)),{main:a,cross:uy(a)}}const X4e={start:"end",end:"start"};function gw(e){return e.replace(/start|end/g,t=>X4e[t])}const e9e=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=e,y=Fs(r),C=Fs(a)===a,x=await(s.isRTL==null?void 0:s.isRTL(l.floating)),b=f||(C||!m?[uy(a)]:function(k){const B=uy(k);return[gw(k),B,gw(B)]}(a));f||h==="none"||b.push(...function(k,B,K,H){const z=wC(k);let N=function(Y,ee,F){const M=["left","right"],W=["right","left"],re=["top","bottom"],Ie=["bottom","top"];switch(Y){case"top":case"bottom":return F?ee?W:M:ee?M:W;case"left":case"right":return ee?re:Ie;default:return[]}}(Fs(k),K==="start",H);return z&&(N=N.map(Y=>Y+"-"+z),B&&(N=N.concat(N.map(gw)))),N}(a,m,h,x));const v=[a,...b],S=await uZ(t,g),w=[];let T=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&w.push(S[y]),u){const{main:k,cross:B}=Z4e(r,o,x);w.push(S[k],S[B])}if(T=[...T,{placement:r,overflows:w}],!w.every(k=>k<=0)){var E,R;const k=(((E=i.flip)==null?void 0:E.index)||0)+1,B=v[k];if(B)return{data:{index:k,overflows:T},reset:{placement:B}};let K=(R=T.filter(H=>H.overflows[0]<=0).sort((H,z)=>H.overflows[1]-z.overflows[1])[0])==null?void 0:R.placement;if(!K)switch(p){case"bestFit":{var O;const H=(O=T.map(z=>[z.placement,z.overflows.filter(N=>N>0).reduce((N,Y)=>N+Y,0)]).sort((z,N)=>z[1]-N[1])[0])==null?void 0:O[0];H&&(K=H);break}case"initialPlacement":K=a}if(r!==K)return{reset:{placement:K}}}return{}}}},t9e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(o,a){const{placement:s,platform:l,elements:c}=o,u=await(l.isRTL==null?void 0:l.isRTL(c.floating)),f=Fs(s),p=wC(s),h=sg(s)==="x",m=["left","top"].includes(f)?-1:1,g=u&&h?-1:1,y=typeof a=="function"?a(o):a;let{mainAxis:C,crossAxis:x,alignmentAxis:b}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return p&&typeof b=="number"&&(x=p==="end"?-1*b:b),h?{x:x*g,y:C*m}:{x:C*m,y:x*g}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function dZ(e){return e==="x"?"y":"x"}const n9e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:y=>{let{x:C,y:x}=y;return{x:C,y:x}}},...l}=e,c={x:n,y:r},u=await uZ(t,l),f=sg(Fs(i)),p=dZ(f);let h=c[f],m=c[p];if(o){const y=f==="y"?"bottom":"right";h=wD(h+u[f==="y"?"top":"left"],h,h-u[y])}if(a){const y=p==="y"?"bottom":"right";m=wD(m+u[p==="y"?"top":"left"],m,m-u[y])}const g=s.fn({...t,[f]:h,[p]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}},r9e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=e,u={x:n,y:r},f=sg(i),p=dZ(f);let h=u[f],m=u[p];const g=typeof s=="function"?s(t):s,y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const b=f==="y"?"height":"width",v=o.reference[f]-o.floating[b]+y.mainAxis,S=o.reference[f]+o.reference[b]-y.mainAxis;h<v?h=v:h>S&&(h=S)}if(c){var C,x;const b=f==="y"?"width":"height",v=["top","left"].includes(Fs(i)),S=o.reference[p]-o.floating[b]+(v&&((C=a.offset)==null?void 0:C[p])||0)+(v?0:y.crossAxis),w=o.reference[p]+o.reference[b]+(v?0:((x=a.offset)==null?void 0:x[p])||0)-(v?y.crossAxis:0);m<S?m=S:m>w&&(m=w)}return{[f]:h,[p]:m}}}};function ri(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ro(e){return ri(e).getComputedStyle(e)}const xD=Math.min,th=Math.max,dy=Math.round;function fZ(e){const t=Ro(e);let n=parseFloat(t.width),r=parseFloat(t.height);const i=e.offsetWidth,o=e.offsetHeight,a=dy(n)!==i||dy(r)!==o;return a&&(n=i,r=o),{width:n,height:r,fallback:a}}function Qs(e){return hZ(e)?(e.nodeName||"").toLowerCase():""}let jg;function pZ(){if(jg)return jg;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(jg=e.brands.map(t=>t.brand+"/"+t.version).join(" "),jg):navigator.userAgent}function $o(e){return e instanceof ri(e).HTMLElement}function Yi(e){return e instanceof ri(e).Element}function hZ(e){return e instanceof ri(e).Node}function _D(e){return typeof ShadowRoot>"u"?!1:e instanceof ri(e).ShadowRoot||e instanceof ShadowRoot}function xC(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ro(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function i9e(e){return["table","td","th"].includes(Qs(e))}function qx(e){const t=/firefox/i.test(pZ()),n=Ro(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!r&&r!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(i=>n.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const o=n.contain;return o!=null&&o.includes(i)})}function Vx(){return/^((?!chrome|android).)*safari/i.test(pZ())}function zF(e){return["html","body","#document"].includes(Qs(e))}function AZ(e){return Yi(e)?e:e.contextElement}const mZ={x:1,y:1};function cd(e){const t=AZ(e);if(!$o(t))return mZ;const n=t.getBoundingClientRect(),{width:r,height:i,fallback:o}=fZ(t);let a=(o?dy(n.width):n.width)/r,s=(o?dy(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}function kc(e,t,n,r){var i,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),s=AZ(e);let l=mZ;t&&(r?Yi(r)&&(l=cd(r)):l=cd(e));const c=s?ri(s):window,u=Vx()&&n;let f=(a.left+(u&&((i=c.visualViewport)==null?void 0:i.offsetLeft)||0))/l.x,p=(a.top+(u&&((o=c.visualViewport)==null?void 0:o.offsetTop)||0))/l.y,h=a.width/l.x,m=a.height/l.y;if(s){const g=ri(s),y=r&&Yi(r)?ri(r):r;let C=g.frameElement;for(;C&&r&&y!==g;){const x=cd(C),b=C.getBoundingClientRect(),v=getComputedStyle(C);b.x+=(C.clientLeft+parseFloat(v.paddingLeft))*x.x,b.y+=(C.clientTop+parseFloat(v.paddingTop))*x.y,f*=x.x,p*=x.y,h*=x.x,m*=x.y,f+=b.x,p+=b.y,C=ri(C).frameElement}}return{width:h,height:m,top:p,right:f+h,bottom:p+m,left:f,x:f,y:p}}function js(e){return((hZ(e)?e.ownerDocument:e.document)||window.document).documentElement}function _C(e){return Yi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function gZ(e){return kc(js(e)).left+_C(e).scrollLeft}function Hh(e){if(Qs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_D(e)&&e.host||js(e);return _D(t)?t.host:t}function vZ(e){const t=Hh(e);return zF(t)?t.ownerDocument.body:$o(t)&&xC(t)?t:vZ(t)}function sc(e,t){var n;t===void 0&&(t=[]);const r=vZ(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=ri(r);return i?t.concat(o,o.visualViewport||[],xC(r)?r:[]):t.concat(r,sc(r))}function TD(e,t,n){let r;if(t==="viewport")r=function(a,s){const l=ri(a),c=js(a),u=l.visualViewport;let f=c.clientWidth,p=c.clientHeight,h=0,m=0;if(u){f=u.width,p=u.height;const g=Vx();(!g||g&&s==="fixed")&&(h=u.offsetLeft,m=u.offsetTop)}return{width:f,height:p,x:h,y:m}}(e,n);else if(t==="document")r=function(a){const s=js(a),l=_C(a),c=a.ownerDocument.body,u=th(s.scrollWidth,s.clientWidth,c.scrollWidth,c.clientWidth),f=th(s.scrollHeight,s.clientHeight,c.scrollHeight,c.clientHeight);let p=-l.scrollLeft+gZ(a);const h=-l.scrollTop;return Ro(c).direction==="rtl"&&(p+=th(s.clientWidth,c.clientWidth)-u),{width:u,height:f,x:p,y:h}}(js(e));else if(Yi(t))r=function(a,s){const l=kc(a,!0,s==="fixed"),c=l.top+a.clientTop,u=l.left+a.clientLeft,f=$o(a)?cd(a):{x:1,y:1};return{width:a.clientWidth*f.x,height:a.clientHeight*f.y,x:u*f.x,y:c*f.y}}(t,n);else{const a={...t};if(Vx()){var i,o;const s=ri(e);a.x-=((i=s.visualViewport)==null?void 0:i.offsetLeft)||0,a.y-=((o=s.visualViewport)==null?void 0:o.offsetTop)||0}r=a}return Kx(r)}function ID(e,t){return $o(e)&&Ro(e).position!=="fixed"?t?t(e):e.offsetParent:null}function ED(e,t){const n=ri(e);let r=ID(e,t);for(;r&&i9e(r)&&Ro(r).position==="static";)r=ID(r,t);return r&&(Qs(r)==="html"||Qs(r)==="body"&&Ro(r).position==="static"&&!qx(r))?n:r||function(i){let o=Hh(i);for(;$o(o)&&!zF(o);){if(qx(o))return o;o=Hh(o)}return null}(e)||n}function o9e(e,t,n){const r=$o(t),i=js(t),o=kc(e,!0,n==="fixed",t);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Qs(t)!=="body"||xC(i))&&(a=_C(t)),$o(t)){const l=kc(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=gZ(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}const a9e={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=n==="clippingAncestors"?function(c,u){const f=u.get(c);if(f)return f;let p=sc(c).filter(y=>Yi(y)&&Qs(y)!=="body"),h=null;const m=Ro(c).position==="fixed";let g=m?Hh(c):c;for(;Yi(g)&&!zF(g);){const y=Ro(g),C=qx(g);y.position==="fixed"?h=null:(m?C||h:C||y.position!=="static"||!h||!["absolute","fixed"].includes(h.position))?h=y:p=p.filter(x=>x!==g),g=Hh(g)}return u.set(c,p),p}(t,this._c):[].concat(n),a=[...o,r],s=a[0],l=a.reduce((c,u)=>{const f=TD(t,u,i);return c.top=th(f.top,c.top),c.right=xD(f.right,c.right),c.bottom=xD(f.bottom,c.bottom),c.left=th(f.left,c.left),c},TD(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=$o(n),o=js(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},s={x:1,y:1};const l={x:0,y:0};if((i||!i&&r!=="fixed")&&((Qs(n)!=="body"||xC(o))&&(a=_C(n)),$o(n))){const c=kc(n);s=cd(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}},isElement:Yi,getDimensions:function(e){return $o(e)?fZ(e):e.getBoundingClientRect()},getOffsetParent:ED,getDocumentElement:js,getScale:cd,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||ED,o=this.getDimensions;return{reference:o9e(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Ro(e).direction==="rtl"};function s9e(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,c=l||o?[...Yi(e)?sc(e):e.contextElement?sc(e.contextElement):[],...sc(t)]:[];c.forEach(h=>{l&&h.addEventListener("scroll",n,{passive:!0}),o&&h.addEventListener("resize",n)});let u,f=null;if(a){let h=!0;f=new ResizeObserver(()=>{h||n(),h=!1}),Yi(e)&&!s&&f.observe(e),Yi(e)||!e.contextElement||s||f.observe(e.contextElement),f.observe(t)}let p=s?kc(e):null;return s&&function h(){const m=kc(e);!p||m.x===p.x&&m.y===p.y&&m.width===p.width&&m.height===p.height||n(),p=m,u=requestAnimationFrame(h)}(),n(),()=>{var h;c.forEach(m=>{l&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),(h=f)==null||h.disconnect(),f=null,s&&cancelAnimationFrame(u)}}const l9e=(e,t,n)=>{const r=new Map,i={platform:a9e,...n},o={...i.platform,_c:r};return z4e(e,t,{...i,platform:o})};var av=typeof document<"u"?I.useLayoutEffect:I.useEffect;function fy(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!fy(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!fy(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function RD(e){const t=Fe.useRef(e);return av(()=>{t.current=e}),t}function c9e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,whileElementsMounted:o,open:a}=e,[s,l]=Fe.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[c,u]=Fe.useState(r);fy(c,r)||u(r);const f=Fe.useRef(null),p=Fe.useRef(null),h=Fe.useRef(s),m=RD(o),g=RD(i),[y,C]=Fe.useState(null),[x,b]=Fe.useState(null),v=Fe.useCallback(O=>{f.current!==O&&(f.current=O,C(O))},[]),S=Fe.useCallback(O=>{p.current!==O&&(p.current=O,b(O))},[]),w=Fe.useCallback(()=>{if(!f.current||!p.current)return;const O={placement:t,strategy:n,middleware:c};g.current&&(O.platform=g.current),l9e(f.current,p.current,O).then(k=>{const B={...k,isPositioned:!0};T.current&&!fy(h.current,B)&&(h.current=B,DX.flushSync(()=>{l(B)}))})},[c,t,n,g]);av(()=>{a===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,l(O=>({...O,isPositioned:!1})))},[a]);const T=Fe.useRef(!1);av(()=>(T.current=!0,()=>{T.current=!1}),[]),av(()=>{if(y&&x){if(m.current)return m.current(y,x,w);w()}},[y,x,w,m]);const E=Fe.useMemo(()=>({reference:f,floating:p,setReference:v,setFloating:S}),[v,S]),R=Fe.useMemo(()=>({reference:y,floating:x}),[y,x]);return Fe.useMemo(()=>({...s,update:w,refs:E,elements:R,reference:v,floating:S}),[s,w,E,R,v,S])}var Rs=typeof document<"u"?I.useLayoutEffect:I.useEffect;function u9e(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}let vw=!1,d9e=0;const $D=()=>"floating-ui-"+d9e++;function f9e(){const[e,t]=Fe.useState(()=>vw?$D():void 0);return Rs(()=>{e==null&&t($D())},[]),Fe.useEffect(()=>{vw||(vw=!0)},[]),e}const kD=Fe["useId".toString()],OD=kD??f9e,p9e=Fe.createContext(null),h9e=Fe.createContext(null),yZ=()=>{var e,t;return(e=(t=Fe.useContext(p9e))==null?void 0:t.id)!=null?e:null},QF=()=>Fe.useContext(h9e);function HF(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function bZ(e){var t;return(t=HF(e).defaultView)!=null?t:window}function sv(e){return e?e instanceof bZ(e).Element:!1}function A9e(e){return e?e instanceof bZ(e).HTMLElement:!1}const MD=Fe["useInsertionEffect".toString()];function zx(e){const t=Fe.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return MD?MD(()=>{t.current=e}):t.current=e,Fe.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function m9e(e){let{open:t=!1,onOpenChange:n,whileElementsMounted:r,placement:i,middleware:o,strategy:a,nodeId:s}=e===void 0?{}:e;const[l,c]=Fe.useState(null),u=QF(),f=Fe.useRef(null),p=Fe.useRef({}),h=Fe.useState(()=>u9e())[0],m=c9e({placement:i,middleware:o,strategy:a,whileElementsMounted:r}),g=zx(n),y=Fe.useMemo(()=>({...m.refs,domReference:f}),[m.refs]),C=Fe.useMemo(()=>({...m,refs:y,dataRef:p,nodeId:s,events:h,open:t,onOpenChange:g,_:{domReference:l}}),[m,s,h,t,g,y,l]);Rs(()=>{const v=u==null?void 0:u.nodesRef.current.find(S=>S.id===s);v&&(v.context=C)});const{reference:x}=m,b=Fe.useCallback(v=>{(sv(v)||v===null)&&(C.refs.domReference.current=v,c(v)),x(v)},[x,C.refs]);return Fe.useMemo(()=>({...m,context:C,refs:y,reference:b}),[m,y,C,b])}function yw(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(a=>{let[s,l]=a;if(s.indexOf("on")===0){if(r.has(s)||r.set(s,[]),typeof l=="function"){var c;(c=r.get(s))==null||c.push(l),i[s]=function(){for(var u,f=arguments.length,p=new Array(f),h=0;h<f;h++)p[h]=arguments[h];(u=r.get(s))==null||u.forEach(m=>m(...p))}}}else i[s]=l}),i),{})}}const g9e=function(e){return e===void 0&&(e=[]),{getReferenceProps:t=>yw(t,e,"reference"),getFloatingProps:t=>yw(t,e,"floating"),getItemProps:t=>yw(t,e,"item")}};function bw(e,t){var n;let r=(n=e.filter(a=>{var s;return a.parentId===t&&((s=a.context)==null?void 0:s.open)}))!=null?n:[],i=r;for(;i.length;){var o;i=(o=e.filter(a=>{var s;return(s=i)==null?void 0:s.some(l=>{var c;return a.parentId===l.id&&((c=a.context)==null?void 0:c.open)})}))!=null?o:[],r=r.concat(i)}return r}function FD(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function v9e(e){return"composedPath"in e?e.composedPath()[0]:e.target}function gs(e){e.preventDefault(),e.stopPropagation()}function y9e(e){const t=I.useRef(e);return Rs(()=>{t.current=e}),t}function jD(e){const t=I.useRef();return Rs(()=>{t.current=e},[e]),t.current}const b9e=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=t===void 0?{}:t;const o=OD(),a=OD(),s={id:o,role:i};return r?i==="tooltip"?{reference:{"aria-describedby":n?o:void 0},floating:s}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":i==="alertdialog"?"dialog":i,"aria-controls":n?o:void 0,...i==="listbox"&&{role:"combobox"},...i==="menu"&&{id:a}},floating:{...s,...i==="menu"&&{"aria-labelledby":a}}}:{}};function Cw(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const C9e=function(e,t){let{open:n,onOpenChange:r,refs:i,events:o,nodeId:a}=e,{enabled:s=!0,escapeKey:l=!0,outsidePointerDown:c=!0,referencePointerDown:u=!1,ancestorScroll:f=!1,bubbles:p=!0}=t===void 0?{}:t;const h=QF(),m=yZ()!=null,g=Fe.useRef(!1);return Fe.useEffect(()=>{if(!n||!s)return;function y(S){if(S.key==="Escape"){if(!p&&h&&bw(h.nodesRef.current,a).length>0)return;o.emit("dismiss",{preventScroll:!1}),r(!1)}}function C(S){const w=g.current;if(g.current=!1,w)return;const T=v9e(S);if(sv(T)&&i.floating.current){var E;const O=(E=i.floating.current.ownerDocument.defaultView)!=null?E:window,k=T.scrollWidth>T.clientWidth,B=T.scrollHeight>T.clientHeight;let K=B&&S.offsetX>T.clientWidth;if(B&&O.getComputedStyle(T).direction==="rtl"&&(K=S.offsetX<=T.offsetWidth-T.clientWidth),K||k&&S.offsetY>T.clientHeight)return}const R=h&&bw(h.nodesRef.current,a).some(O=>{var k;return Cw(S,(k=O.context)==null?void 0:k.refs.floating.current)});Cw(S,i.floating.current)||Cw(S,i.domReference.current)||R||!p&&h&&bw(h.nodesRef.current,a).length>0||(o.emit("dismiss",m?{preventScroll:!0}:!1),r(!1))}function x(){r(!1)}const b=HF(i.floating.current);l&&b.addEventListener("keydown",y),c&&b.addEventListener("pointerdown",C);const v=(f?[...sv(i.reference.current)?sc(i.reference.current):[],...sv(i.floating.current)?sc(i.floating.current):[]]:[]).filter(S=>{var w;return S!==((w=b.defaultView)==null?void 0:w.visualViewport)});return v.forEach(S=>S.addEventListener("scroll",x,{passive:!0})),()=>{l&&b.removeEventListener("keydown",y),c&&b.removeEventListener("pointerdown",C),v.forEach(S=>S.removeEventListener("scroll",x))}},[l,c,o,h,a,n,r,f,s,p,i,m]),s?{reference:{onPointerDown(){u&&(o.emit("dismiss"),r(!1))}},floating:{onPointerDownCapture(){g.current=!0}}}:{}},YF="ArrowUp",TC="ArrowDown",Bd="ArrowLeft",lg="ArrowRight";function Lg(e,t,n){return Math.floor(e/t)!==n}function _p(e,t){return t<0||t>=e.current.length}function Gn(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let s=n;do{var l,c;s=s+(r?-o:o)}while(s>=0&&s<=a.length-1&&(i?i.includes(s):a[s]==null||(l=a[s])!=null&&l.hasAttribute("disabled")||((c=a[s])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return s}function IC(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function LD(e,t){return IC(t,e===YF||e===TC,e===Bd||e===lg)}function Sw(e,t,n){return IC(t,e===TC,n?e===Bd:e===lg)||e==="Enter"||e==" "||e===""}function S9e(e,t,n){return IC(t,n?e===Bd:e===lg,e===TC)}function w9e(e,t,n){return IC(t,n?e===lg:e===Bd,e===YF)}function ww(e,t){return Gn(e,{disabledIndices:t})}function DD(e,t){return Gn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const x9e=function(e,t){let{open:n,onOpenChange:r,refs:i}=e,{listRef:o,activeIndex:a,onNavigate:s=()=>{},enabled:l=!0,selectedIndex:c=null,allowEscape:u=!1,loop:f=!1,nested:p=!1,rtl:h=!1,virtual:m=!1,focusItemOnOpen:g="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:C=!0,disabledIndices:x=void 0,orientation:b="vertical",cols:v=1}=t===void 0?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t;process.env.NODE_ENV!=="production"&&(u&&(f||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),m||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),b==="vertical"&&v>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const S=yZ(),w=QF(),T=jD(n),E=zx(s),R=zx(jD(s)),O=Fe.useRef(g),k=Fe.useRef(c??-1),B=Fe.useRef(null),K=y9e(x),H=Fe.useRef(!1),z=Fe.useRef(-1),[N,Y]=Fe.useState(),ee=Fe.useCallback((M,W)=>{z.current=requestAnimationFrame(()=>{if(m){var re;Y((re=M.current[W.current])==null?void 0:re.id)}else{var Ie;(Ie=M.current[W.current])==null||Ie.focus({preventScroll:!0})}})},[m]);Rs(()=>{l&&(!T&&n&&O.current&&c!=null&&E(c),T&&!n&&(cancelAnimationFrame(z.current),k.current=-1,R(null)))},[n,T,c,o,ee,l,E,R]),Rs(()=>{if(l&&n)if(a==null){if(c!=null)return;T&&(k.current=-1,ee(o,k)),!T&&O.current&&(B.current!=null||O.current===!0&&B.current==null)&&(k.current=B.current==null||Sw(B.current,b,h)||p?ww(o,K.current):DD(o,K.current),E(k.current),ee(o,k))}else _p(o,a)||(k.current=a,ee(o,k))},[n,T,a,c,p,o,E,ee,l,u,b,h,m,K]),Rs(()=>{if(l&&!n&&T){var M,W;const re=w==null||(M=w.nodesRef.current.find(Ie=>Ie.id===S))==null||(W=M.context)==null?void 0:W.refs.floating.current;re&&!re.contains(FD(HF(re)))&&re.focus({preventScroll:!0})}},[l,n,T,w,S]),Rs(()=>{B.current=null});function F(M){if(H.current=!0,p&&w9e(M.key,b,h)){gs(M),r(!1),A9e(i.domReference.current)&&i.domReference.current.focus();return}const W=k.current,re=ww(o,x),Ie=DD(o,x);if(M.key==="Home"&&(k.current=re,E(k.current)),M.key==="End"&&(k.current=Ie,E(k.current)),v>1){const Ce=k.current;if(M.key===YF){if(gs(M),Ce===-1)k.current=Ie;else if(k.current=Gn(o,{startingIndex:Ce,amount:v,decrement:!0,disabledIndices:x}),f&&(Ce-v<re||k.current<0)){const P=Ce%v,ae=Ie%v,Ge=Ie-(ae-P);ae===P?k.current=Ie:k.current=ae>P?Ge:Ge-v}_p(o,k.current)&&(k.current=Ce),E(k.current)}if(M.key===TC&&(gs(M),Ce===-1?k.current=re:(k.current=Gn(o,{startingIndex:Ce,amount:v,disabledIndices:x}),f&&Ce+v>Ie&&(k.current=Gn(o,{startingIndex:Ce%v-v,amount:v,disabledIndices:x}))),_p(o,k.current)&&(k.current=Ce),E(k.current)),b==="both"){const P=Math.floor(Ce/v);M.key===lg&&(gs(M),Ce%v!==v-1?(k.current=Gn(o,{startingIndex:Ce,disabledIndices:x}),f&&Lg(k.current,v,P)&&(k.current=Gn(o,{startingIndex:Ce-Ce%v-1,disabledIndices:x}))):f&&(k.current=Gn(o,{startingIndex:Ce-Ce%v-1,disabledIndices:x})),Lg(k.current,v,P)&&(k.current=Ce)),M.key===Bd&&(gs(M),Ce%v!==0?(k.current=Gn(o,{startingIndex:Ce,disabledIndices:x,decrement:!0}),f&&Lg(k.current,v,P)&&(k.current=Gn(o,{startingIndex:Ce+(v-Ce%v),decrement:!0,disabledIndices:x}))):f&&(k.current=Gn(o,{startingIndex:Ce+(v-Ce%v),decrement:!0,disabledIndices:x})),Lg(k.current,v,P)&&(k.current=Ce));const ae=Math.floor(Ie/v)===P;_p(o,k.current)&&(f&&ae?k.current=M.key===Bd?Ie:Gn(o,{startingIndex:Ce-Ce%v-1,disabledIndices:x}):k.current=Ce),E(k.current);return}}if(LD(M.key,b)){if(gs(M),n&&!m&&FD(M.currentTarget.ownerDocument)===M.currentTarget){k.current=Sw(M.key,b,h)?re:Ie,E(k.current);return}Sw(M.key,b,h)?f?k.current=W>=Ie?u&&W!==o.current.length?-1:re:Gn(o,{startingIndex:W,disabledIndices:x}):k.current=Math.min(Ie,Gn(o,{startingIndex:W,disabledIndices:x})):f?k.current=W<=re?u&&W!==-1?o.current.length:Ie:Gn(o,{startingIndex:W,decrement:!0,disabledIndices:x}):k.current=Math.max(re,Gn(o,{startingIndex:W,decrement:!0,disabledIndices:x})),_p(o,k.current)?E(null):E(k.current)}}return l?{reference:{...m&&n&&a!=null&&{"aria-activedescendant":N},onKeyDown(M){if(H.current=!0,m&&n)return F(M);if((M.key.indexOf("Arrow")===0||M.key==="Enter"||M.key===" "||M.key==="")&&(B.current=M.key),p){S9e(M.key,b,h)&&(gs(M),n?(k.current=ww(o,x),E(k.current)):r(!0));return}LD(M.key,b)&&(c!=null&&(k.current=c),gs(M),!n&&C?r(!0):F(M),n&&E(k.current))}},floating:{"aria-orientation":b==="both"?void 0:b,...m&&a!=null&&{"aria-activedescendant":N},onKeyDown:F,onPointerMove(){H.current=!1}},item:{onFocus(M){let{currentTarget:W}=M;const re=o.current.indexOf(W);re!==-1&&E(re)},onClick:M=>{let{currentTarget:W}=M;return W.focus({preventScroll:!0})},...y&&{onMouseMove(M){let{currentTarget:W}=M;const re=W;if(re){const Ie=o.current.indexOf(re);Ie!==-1&&E(Ie)}},onPointerLeave(){if(!H.current&&(k.current=-1,ee(o,k),E(null),!m)){var M;(M=i.floating.current)==null||M.focus({preventScroll:!0})}}}}}:{}};function _9e(e){var t;const{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:a,$position:s}=e,l=r&&!i,c=L3e(n),u=new RegExp(`\\s${c}$`),f=a?"^":"",p=i?"":c,h=l?new RegExp(`${f}${c}.*?(?=\\s${p}|$)`,"gm"):new RegExp(`${f}(?:^)?${c}[^\\s${p}]*`,"gm"),m=((t=s.nodeBefore)===null||t===void 0?void 0:t.isText)&&s.nodeBefore.text;if(!m)return null;const g=s.pos-m.length,y=Array.from(m.matchAll(h)).pop();if(!y||y.input===void 0||y.index===void 0)return null;const C=y.input.slice(Math.max(0,y.index-1),y.index),x=new RegExp(`^[${o==null?void 0:o.join("")}\0]?$`).test(C);if(o!==null&&!x)return null;const b=g+y.index;let v=b+y[0].length;return l&&u.test(m.slice(v-1,v+1))&&(y[0]+=" ",v+=1),b<s.pos&&v>=s.pos?{range:{from:b,to:v},query:y[0].slice(n.length),text:y[0]}:null}const T9e=new qn("suggestion");function I9e({pluginKey:e=T9e,editor:t,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:o=[" "],startOfLine:a=!1,decorationTag:s="span",decorationClass:l="suggestion",command:c=()=>null,items:u=()=>[],render:f=()=>({}),allow:p=()=>!0,findSuggestionMatch:h=_9e}){let m;const g=f==null?void 0:f(),y=new dn({key:e,view(){return{update:async(C,x)=>{var b,v,S,w,T,E,R;const O=(b=this.key)===null||b===void 0?void 0:b.getState(x),k=(v=this.key)===null||v===void 0?void 0:v.getState(C.state),B=O.active&&k.active&&O.range.from!==k.range.from,K=!O.active&&k.active,H=O.active&&!k.active,z=!K&&!H&&O.query!==k.query,N=K||B&&z,Y=z||B,ee=H||B&&z;if(!N&&!Y&&!ee)return;const F=ee&&!N?O:k,M=C.dom.querySelector(`[data-decoration-id="${F.decorationId}"]`);m={editor:t,range:F.range,query:F.query,text:F.text,items:[],command:W=>c({editor:t,range:F.range,props:W}),decorationNode:M,clientRect:M?()=>{var W;const{decorationId:re}=(W=this.key)===null||W===void 0?void 0:W.getState(t.state),Ie=C.dom.querySelector(`[data-decoration-id="${re}"]`);return(Ie==null?void 0:Ie.getBoundingClientRect())||null}:null},N&&((S=g==null?void 0:g.onBeforeStart)===null||S===void 0||S.call(g,m)),Y&&((w=g==null?void 0:g.onBeforeUpdate)===null||w===void 0||w.call(g,m)),(Y||N)&&(m.items=await u({editor:t,query:F.query})),ee&&((T=g==null?void 0:g.onExit)===null||T===void 0||T.call(g,m)),Y&&((E=g==null?void 0:g.onUpdate)===null||E===void 0||E.call(g,m)),N&&((R=g==null?void 0:g.onStart)===null||R===void 0||R.call(g,m))},destroy:()=>{var C;m&&((C=g==null?void 0:g.onExit)===null||C===void 0||C.call(g,m))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(C,x,b,v){const{isEditable:S}=t,{composing:w}=t.view,{selection:T}=C,{empty:E,from:R}=T,O={...x};if(O.composing=w,S&&(E||t.view.composing)){(R<x.range.from||R>x.range.to)&&!w&&!x.composing&&(O.active=!1);const k=h({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:a,$position:T.$from}),B=`id_${Math.floor(Math.random()*4294967295)}`;k&&p({editor:t,state:v,range:k.range,isActive:x.active})?(O.active=!0,O.decorationId=x.decorationId?x.decorationId:B,O.range=k.range,O.query=k.query,O.text=k.text):O.active=!1}else O.active=!1;return O.active||(O.decorationId=null,O.range={from:0,to:0},O.query=null,O.text=null),O}},props:{handleKeyDown(C,x){var b;const{active:v,range:S}=y.getState(C.state);return v&&((b=g==null?void 0:g.onKeyDown)===null||b===void 0?void 0:b.call(g,{view:C,event:x,range:S}))||!1},decorations(C){const{active:x,range:b,decorationId:v}=y.getState(C);return x?Ot.create(C.doc,[Jn.inline(b.from,b.to,{nodeName:s,class:l,"data-decoration-id":v})]):null}}});return y}const CZ=["ArrowDown","ArrowUp","End","Home"],SZ=["Enter"],E9e=["Escape",...CZ,...SZ],R9e=jn.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=dv(gX,this.options.nodeTypes);return e.length>1?[I9e({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===Fr.name&&n.depth===1},command:({editor:t,props:n,range:r})=>{n.runCommands(t,{deleteRange:r})},items:({query:t})=>{const n=t.toLocaleLowerCase().trim();return e.filter(r=>{var i,o;return((i=r.shortText)==null?void 0:i.toLocaleLowerCase().includes(n))||((o=r.text)==null?void 0:o.toLocaleLowerCase().includes(n))})},render:()=>{let t;return{onStart:n=>{t=new YJ($9e,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var r;return!!(E9e.includes(n.key)&&((r=t==null?void 0:t.ref)!=null&&r.handleKeyDown(n)))},onExit:()=>{t==null||t.destroy(),t==null||t.element.remove()}}}})]:[]}}),$9e=I.forwardRef(function(t,n){const{command:r,decorationNode:i,editor:o,items:a}=t,[s,l]=I.useState(!0),{context:c,floating:u,reference:f,x:p,y:h}=m9e({middleware:[t9e(0),e9e(),n9e({limiter:r9e()})],onOpenChange:l,open:s,placement:"top-start",strategy:"fixed",whileElementsMounted:s9e});I.useLayoutEffect(()=>{f(i)},[f,i]),I.useEffect(()=>{let T;const E=()=>{T=window.setTimeout(()=>{l(!0)})},R=()=>{l(!1)};return o.on("focus",E).on("blur",R),()=>{o.off("focus",E).off("blur",R),clearTimeout(T)}},[o]);const[m,g]=I.useState(0),y=I.useRef([]);ze.useOnChange(a,()=>{g(0),y.current=[]});const{getFloatingProps:C,getItemProps:x,getReferenceProps:b}=g9e([C9e(c,{outsidePointerDown:!1}),x9e(c,{activeIndex:m,listRef:y,onNavigate:T=>{g(E=>T??E)},openOnArrowKeyDown:!1,virtual:!0}),b9e(c,{role:"menu"})]),S=b().onKeyDown;I.useImperativeHandle(n,()=>({handleKeyDown:T=>{if(s){if(CZ.includes(T.key)&&S(T),SZ.includes(T.key)){const E=a[m];E!==void 0&&r(E)}return!0}else return!1}}),[m,r,a,S,s]);const w=p!==null&&h!==null;return s?d.jsxs(A.Box,{...C(),minWidth:256,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,flexDirection:"column",ref:u,top:0,left:0,position:"fixed",transform:w?`translate3d(${Math.round(p)}px, ${Math.round(h)}px, 0)`:"translate3d(0, -200%, 0)",overflow:"hidden",children:[a.map((T,E)=>{const R=x({onClick:()=>{r(T)},onPointerDown:O=>{O.preventDefault()}});return I.createElement(UD,{...R,key:T.nodeType,ref:O=>{y.current[E]=O},active:E===m,isFirstItem:E===0,isLastItem:E===a.length-1,shortcut:`/${T.shortText??""}`},T.text)}),a.length===0&&d.jsx(UD,{...x({onPointerDown:T=>{T.preventDefault()}}),disabled:!0,ref:T=>{y.current[0]=T},children:"No results"})]}):null}),UD=I.forwardRef(function(t,n){const{children:r,disabled:i=!1,shortcut:o,active:a=!1,isFirstItem:s=!1,isLastItem:l=!1,...c}=t;return d.jsx("div",{...c,role:"button",style:{cursor:i?"default":"pointer"},ref:n,children:d.jsxs(A.Box,{alignItems:"center",height:32,flexDirection:"row",gap:8,padding:8,backgroundColor:a?"grey4":"inherit",justifyContent:"space-between",opacity:i?.5:1,children:[d.jsx(A.Text,{color:"grey12",component:"span",children:r}),o&&d.jsx(A.Text,{color:"inherit",component:"span",variant:"small",children:o})]})})});function k9e(e,t){var l,c;const n=t.map(u=>u.richTextNodeTypes).flat(),i={placeholderByNodeType:O9e(t),unfocusedPlaceholder:(l=e.config)==null?void 0:l.placeholder,nodeExtensions:t},o=n.includes(ac.orderedList)||n.includes(ac.list),a=!n.includes(ac.table);return[Wx.component(((c=e.config)==null?void 0:c.single)===void 0),$c.component,ly.component,a?q4e(i):void 0,o?Ud.component:void 0,R9e.configure({nodeTypes:n})].filter(Qi.isDefined)}function O9e(e){return e.reduce((t,n)=>(n.nodeType===Hl.Text&&(t[n.name]=n.placeholder),t),{})}const Qx=A4e.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Ut(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),M9e={fromPrismic(e){return function(t){var r;const n=Ud.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[Qx.name])==null?void 0:r.create(Ia.fromPrismic(t),n)}},toPrismic(e){return zs.children.map(e,t=>Ud.converter.toPrismic(t,he.RichTextNodeType.list).filter(Qi.isDefined)).flat()}},F9e=new KF([he.RichTextNodeType.list],Qx.name,Qx,M9e),py=F9e,j9e=/^```([a-z]+)?[\s\n]$/,L9e=/^~~~([a-z]+)?[\s\n]$/,D9e=gn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,o=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(a=>a.startsWith(n)).map(a=>a.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",Ut(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
135
+
136
+ `);return!o||!a?!1:e.chain().command(({tr:s})=>(s.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const s=i.after();return s===void 0?!1:r.nodeAt(s)?e.commands.command(({tr:c})=>(c.setSelection(je.near(r.resolve(s))),!0)):e.commands.exitCode()}}},addInputRules(){return[Fx({find:j9e,type:this.type,getAttributes:e=>({language:e[1]})}),Fx({find:L9e,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new dn({key:new qn("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:a,schema:s}=e.state,l=s.text(n.replace(/\r\n?/g,`
137
+ `));return a.replaceSelectionWith(this.type.create({language:o},l)),a.selection.$from.parent.type!==this.type&&a.setSelection(Oe.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}),hy=D9e.extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:e=>{var o;const{languageClassPrefix:t}=this.options,i=[...((o=e.firstElementChild)==null?void 0:o.classList)||[]].filter(a=>a.startsWith(t)).map(a=>a.replace(t,""))[0];return i||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){return["pre",Ut(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),U9e={fromPrismic(e){return function(t){var r;const n=$c.converter.fromPrismic(e)(hy.name,t,!0);return(r=e.nodes[hy.name])==null?void 0:r.create(Ia.fromPrismic(t),n)}},toPrismic(e){return $c.converter.toPrismic(e,he.RichTextNodeType.preformatted,Ia.toPrismic(e))}},B9e=new ag([he.RichTextNodeType.preformatted],hy.name,hy,U9e,"",!0),wZ=B9e;function xZ(e){const{editor:t,getPos:n,node:r}=e,[i,o]=I.useState(!1);return I.useEffect(()=>{function a(){const{from:l,to:c}=t.state.selection,u=n(),f=n()+r.nodeSize,p=l<=u&&c>=f;o(p)}function s(){o(!1)}return t.on("blur",s),t.on("selectionUpdate",a),()=>{t.off("blur",s),t.off("selectionUpdate",a)}},[t,n,r.nodeSize]),{selected:i}}function P9e(e,t,n){const{node:r}=e,i=r.attrs.content,o=ze.useStableCallback(e.updateAttributes),a=ze.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:I.startTransition});function s(u){o({content:u})}function l(u){a.set(u),ii.toURL(u)||s(void 0)}const{onKeyDown:c}=W9e(e,a.value,t,n);return{inputRef:t,containerRef:n,onKeyDown:c,url:a.value,urlChanged:l,onContentChange:s,debouncedUrl:a.debouncedValue,content:e.node.attrs.content}}function W9e(e,t,n,r){const{editor:i,getPos:o,node:a}=e,[s,l]=I.useState(!0);I.useEffect(()=>{!s||!e.editor.isFocused||A.handleEditorFlushSyncError(()=>{var u;return(u=n.current)==null?void 0:u.focus()})},[n,s,e.editor.isFocused]);function c(u){const f=o(),p=o()+a.nodeSize;u.code==="Enter"&&(l(!1),i.chain().insertContentAt(p,{type:"paragraph"}).focus(p+1).run()),u.code==="Backspace"&&t===""&&i.chain().deleteRange({from:f,to:p}).focus(p+1).run(),u.code==="ArrowUp"&&(l(!1),i.chain().focus(f-1).run()),u.code==="ArrowDown"&&(l(!1),i.chain().focus(p+1).run())}return{containerRef:r,inputRef:n,onKeyDown:c}}function N9e(e){const t=I.useRef(null),n=I.useRef(null),{onKeyDown:r,url:i,urlChanged:o,onContentChange:a,debouncedUrl:s,content:l}=P9e(e,t,n),{selected:c}=xZ(e);return d.jsx(HJ,{className:"custom-embed",children:d.jsxs("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:[d.jsxs(A.Box,{flexGrow:1,alignItems:"center",children:[d.jsx(A.Icon,{size:"small",name:"cloud",color:"grey11"}),d.jsx(A.Box,{flexGrow:1,height:40,ref:n,children:d.jsx(Tl,{id:"id",ref:t,value:i,variant:ii.toURL(i)?"link":"normal",placeholder:"Paste your link here",onValueChange:o,onKeyDown:r})})]}),ii.toURL(i)&&d.jsx(nY,{selected:c,debouncedUrl:s,onContentChange:a,content:l})]})})}const Hx=gn.create({name:"embed",group:"block",atom:!0,content:"block*",marks:"",addAttributes(){return{content:{default:void 0}}},addCommands(){return{setEmbed:()=>({tr:e,dispatch:t})=>{const n=this.type.create();return t&&e.replaceSelectionWith(n),!0}}},parseHTML(){return[{tag:"embed"}]},renderHTML(){return["embed"]},addNodeView(){return GJ(N9e)}}),K9e={fromPrismic(e){return function(t){var n;return(n=e.nodes[Hx.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){return e.attrs.content===void 0?{type:"embed",data:{type:"embed",embed_url:"",__TYPE__:"EmbedContent",all:[]}}:{type:"embed",data:{...e.attrs.content}}}},_Z=new n4e([he.RichTextNodeType.embed],Hx.name,Hx,K9e),q9e=gn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Ut(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Fx({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),Yx="heading";function EC(e){switch(e){case 1:return he.RichTextNodeType.heading1;case 2:return he.RichTextNodeType.heading2;case 3:return he.RichTextNodeType.heading3;case 4:return he.RichTextNodeType.heading4;case 5:return he.RichTextNodeType.heading5;case 6:return he.RichTextNodeType.heading6}}function BD(e){return{fullName:EC(e),level:e}}const TZ=[1,2,3,4,5,6];function IZ(e,t=TZ){const n=new RegExp(`^heading([${t.join(",")}]){1}$`),r=e.match(n);if(!r||!r[1])return;const i=parseInt(r[1]);return{fullName:EC(i),level:i}}function EZ(e,t){const n=e.level;if(t.includes(n))return{fullName:EC(n),level:n}}const V9e=e=>{const t=e[0]??1;return{fromPrismic(n){return function(r){var a;const i=$c.converter.fromPrismic(n)(Yx,r),o=IZ(r.type,e)||BD(t);return(a=n.nodes[Yx])==null?void 0:a.create({level:o.level,...Ia.fromPrismic(r)},i)}},toPrismic(n){const{fullName:r}=EZ(n.attrs,e)||BD(t);return $c.converter.toPrismic(n,r,Ia.toPrismic(n))}}};function z9e(e){return e?e.size?Array.from(e.values()).reduce((n,r)=>{const i=IZ(r);return i?[...n,i.level]:n},[]).sort((n,r)=>n-r):[]:TZ}function Q9e(e){return q9e.extend({name:"heading"}).configure({levels:e})}const Wl={name:Yx,build:e=>{const t=z9e(e);if(!t)return;const n=t.map(r=>EC(r));return new i4e(n,Q9e(t),t,V9e(t),r=>{const i=EZ(r,t);return i&&`Heading ${i.level}`})}};function H9e(e){const{content:t,thumbnail:n,imageViewProps:{getPos:r,updateAttributes:i,editor:o,node:a}}=e,[s,l]=I.useTransition();function c(g){l(()=>i({content:g}))}function u(g){const y=Kg(g),C=r()+a.nodeSize;c({...t,...y}),o.chain().focus(C+1).run()}function f({croppedImages:g}){if(!t)return;const y=g[n.name];if(!y)return;const C=dY({content:t,croppedImage:y});C!==t&&c(C)}function p(){const g=r(),y=r()+a.nodeSize;o.chain().deleteRange({from:g,to:y}).focus(y).run()}const{uploadImage:h,isUploadingImage:m}=_Y({onMediaSelected:u});return{onMediaSelected:u,onCropperDialogClose:f,isUpdating:s,updateContent:c,onClear:p,uploadImage:h,isUploadingImage:m}}function Y9e(e){const{node:t}=e,n=t.attrs.content,{selected:r}=xZ(e),i=I.useRef(null),o={width:void 0,height:void 0,name:hp},{onMediaSelected:a,onCropperDialogClose:s,isUpdating:l,updateContent:c,onClear:u,uploadImage:f,isUploadingImage:p}=H9e({content:n,thumbnail:o,imageViewProps:e}),[h,m]=I.useState(!1),g="Feature image",y=(n==null?void 0:n.width)===0&&(n==null?void 0:n.height)===0,C=n&&!y?[`${n.width}×${n.height}px`]:[],x={thumbnail:o,contentView:n,labels:sx(o,n,n)};I.useLayoutEffect(()=>{var S;const v=(S=i==null?void 0:i.current)==null?void 0:S.closest(`.${RZ}`);Wg.isHTMLElement(v)&&v.style.removeProperty("min-height")},[]);const b=p||l;return d.jsx(HJ,{children:d.jsx(lY,{ref:i,isMediaDialogOpen:h,selected:r,onMediaSelected:a,onMediaDialogOpenChange:m,children:d.jsx(I.Suspense,{fallback:Z9e,children:n!=null&&n.url?d.jsx(xY,{allContentViews:[n],content:n,contentView:n,fieldLabel:g,imageLabel:C,initialImages:[x],isUpdating:b,readOnly:!1,thumbnailName:o.name,onClear:u,onContentChange:c,onCropperDialogClose:s,onMediaDialogOpenChange:m}):d.jsx(cY,{uploadImage:f,isUploading:p,disabled:h,children:d.jsx(oY,{fieldLabel:g,isUpdating:b,readOnly:!1,onMediaDialogOpenChange:m})})})})})}const RZ="imageViewNodeWrapper",$Z=144,G9e=94;function J9e(e){return(e?G9e:$Z)+12+12+1+1}const Z9e=d.jsx("div",{style:{height:$Z}}),Gx=gn.create({name:"image",group:"block",atom:!0,addAttributes(){return{content:{default:void 0}}},addCommands(){return{setImage:()=>e=>{const{dispatch:t,tr:n}=e,r=this.type.create();return t&&n.replaceSelectionWith(r),!0}}},parseHTML(){return[{tag:"image"}]},renderHTML({HTMLAttributes:e}){return["image",e]},addNodeView(){return function(t){const n=t.node.attrs.content===void 0;return GJ(Y9e,{attrs:{style:`min-height: ${J9e(n)}px`,class:RZ}})(t)}}}),X9e={fromPrismic(e){return function(t){var n;return(n=e.nodes[Gx.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){if(e.attrs.content!==void 0)return{type:"image",data:{...e.attrs.content}}}},kZ=new r4e([he.RichTextNodeType.image],Gx.name,Gx,X9e),e8e=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,t8e=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,n8e=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,r8e=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,i8e=tg.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Ut(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ey({find:e8e,type:this.type}),ey({find:n8e,type:this.type})]},addPasteRules(){return[ny({find:t8e,type:this.type}),ny({find:r8e,type:this.type})]}});class o8e{constructor(t,n,r){$t(this,"extType",ju.Mark);$t(this,"richTextNodeTypes",[he.RichTextNodeType.em]);this.name=t,this.component=n,this.converter=r}}const OZ="em",MZ=i8e.extend({name:OZ}),a8e={fromPrismic(e){return function(){var t;return(t=e.marks[MZ.name])==null?void 0:t.create()}},toPrismic(){}},s8e=new o8e(OZ,MZ,a8e),GF=s8e;class l8e{constructor(t,n,r){$t(this,"extType",ju.Mark);$t(this,"richTextNodeTypes",[]);this.name=t,this.component=n,this.converter=r}}const FZ="label",Jx=tg.create({name:FZ,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{htmlAttributes:{style:"background-color: hsl(251, 89%, 96%); border: 1px dashed rgba(68, 53, 146, 0.4); border-radius: 0px 2px 2px 2px"}}},addAttributes(){return{label:{default:""}}},addCommands(){return{setLabel:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).run(),unsetLabel:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},renderHTML({HTMLAttributes:e}){return["span",Ut(this.options.htmlAttributes,e),0]}}),c8e={fromPrismic(e){return function(t){var i;const n=t.data,r={type:Jx.name,label:n};return(i=e.marks[Jx.name])==null?void 0:i.create(r)}},toPrismic(e){return e.attrs.label}},JF=new l8e(FZ,Jx,c8e);class u8e{constructor(t,n,r){$t(this,"extType",ju.Mark);$t(this,"richTextNodeTypes",[he.RichTextNodeType.hyperlink]);this.name=t,this.component=n,this.converter=r}}const jZ="hyperlink",pa=tg.create({name:jZ,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{openOnClick:!1,linkOnPaste:!0,autolink:!0,protocols:[],htmlAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null,id:""},validate:void 0}},addAttributes(){return{href:{default:""},id:{default:""},target:{default:"_blank"},rel:{default:"noopener noreferrer nofollow"},class:{default:null},media:{default:null}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:e}){return["a",Ut(this.options.htmlAttributes,e),0]},addCommands(){return{setWebLink:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).setMeta("preventAutolink",!0).run(),setDocumentLink:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).setMeta("preventAutolink",!0).run(),setMediaLink:e=>({chain:t})=>{const n=Zx(bY({media:e.media}).value);return t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,{media:n}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}),d8e={fromPrismic(e){return function(t){var r,i,o,a;const n=t.data;if(n.__TYPE__==="DocumentLink"){const s={type:pa.name,id:n.id};return(r=e.marks[pa.name])==null?void 0:r.create(s)}if(n.__TYPE__==="ImageLink"){const s={type:pa.name,media:Zx(n)};return(i=e.marks[pa.name])==null?void 0:i.create(s)}if(n.__TYPE__==="FileLink"){const s={type:pa.name,media:Zx(n)};return(o=e.marks[pa.name])==null?void 0:o.create(s)}if(n.__TYPE__==="ExternalLink"){const s={type:pa.name,url:n.url,href:n.url,target:n.target};return(a=e.marks[pa.name])==null?void 0:a.create(s)}}},toPrismic(e){return e.attrs.media?DZ(e.attrs.media):e.attrs.id?{__TYPE__:"DocumentLink",id:e.attrs.id}:{__TYPE__:"ExternalLink",url:e.attrs.href,target:e.attrs.target}}},LZ=new u8e(jZ,pa,d8e);function Zx(e){return JSON.stringify(e)}function DZ(e){return JSON.parse(e)}const f8e="listItem",PD="textStyle",WD=/^(\d+)\.\s$/,p8e=gn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",Ut(this.options.HTMLAttributes,n),0]:["ol",Ut(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(f8e,this.editor.getAttributes(PD)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=ty({find:WD,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ty({find:WD,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(PD)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),Xx=p8e.extend({name:"orderedList",addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",Ut(this.options.HTMLAttributes,n),0]:["ol",Ut(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}}).configure({itemTypeName:"listItem"}),h8e={fromPrismic(e){return function(t){var r;const n=Ud.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[Xx.name])==null?void 0:r.create(Ia.fromPrismic(t),n)}},toPrismic(e){return zs.children.map(e,t=>Ud.converter.toPrismic(t,he.RichTextNodeType.orderedList).filter(Qi.isDefined)).flat()}},A8e=new KF([he.RichTextNodeType.orderedList],Xx.name,Xx,h8e),Ay=A8e,UZ=65535,BZ=Math.pow(2,16);function m8e(e,t){return e+t*BZ}function ND(e){return e&UZ}function g8e(e){return(e-(e&UZ))/BZ}const PZ=1,WZ=2,lv=4,NZ=8;class e_{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&NZ)>0}get deletedBefore(){return(this.delInfo&(PZ|lv))>0}get deletedAfter(){return(this.delInfo&(WZ|lv))>0}get deletedAcross(){return(this.delInfo&lv)>0}}class ei{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&ei.empty)return ei.empty}recover(t){let n=0,r=ND(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+g8e(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?i:0);if(l>t)break;let c=this.ranges[s+o],u=this.ranges[s+a],f=l+c;if(t<=f){let p=c?t==l?-1:t==f?1:n:n,h=l+i+(p<0?0:u);if(r)return h;let m=t==(n<0?l:f)?null:m8e(s/3,t-l),g=t==l?WZ:t==f?PZ:lv;return(n<0?t!=l:t!=f)&&(g|=NZ),new e_(h,g,m)}i+=u-c}return r?t+i:new e_(t+i,0,null)}touches(t,n){let r=0,i=ND(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>t)break;let c=this.ranges[s+o],u=l+c;if(t<=u&&s==i*3)return!0;r+=this.ranges[s+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),l=a+(this.inverted?0:o),c=this.ranges[i+n],u=this.ranges[i+r];t(s,s+c,l,l+u),o+=u-c}}invert(){return new ei(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?ei.empty:new ei(t<0?[0,-t,0]:[0,0,t])}}ei.empty=new ei([]);class nh{constructor(t=[],n,r=0,i=t.length){this.maps=t,this.mirror=n,this.from=r,this.to=i}slice(t=0,n=this.maps.length){return new nh(this.maps,this.mirror,t,n)}copy(){return new nh(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let i=t.getMirror(n);this.appendMap(t.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new nh;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],s=a.mapResult(t,n);if(s.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,t=this.maps[l].recover(s.recover);continue}}i|=s.delInfo,t=s.pos}return r?t:new e_(t,i,null)}}const xw=Object.create(null);class lr{getMap(){return ei.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=xw[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in xw)throw new RangeError("Duplicate use of step JSON ID "+t);return xw[t]=n,n.prototype.jsonID=t,n}}class en{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new en(t,null)}static fail(t){return new en(null,t)}static fromReplace(t,n,r,i){try{return en.ok(t.replace(n,r,i))}catch(o){if(o instanceof _c)return en.fail(o.message);throw o}}}function ZF(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(ZF(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return q.fromArray(r)}class $s extends lr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new V(ZF(n.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return en.fromReplace(t,this.from,this.to,o)}invert(){return new To(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new $s(n.pos,r.pos,this.mark)}merge(t){return t instanceof $s&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new $s(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new $s(n.from,n.to,t.markFromJSON(n.mark))}}lr.jsonID("addMark",$s);class To extends lr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new V(ZF(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return en.fromReplace(t,this.from,this.to,r)}invert(){return new $s(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new To(n.pos,r.pos,this.mark)}merge(t){return t instanceof To&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new To(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new To(n.from,n.to,t.markFromJSON(n.mark))}}lr.jsonID("removeMark",To);class ks extends lr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return en.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return en.fromReplace(t,this.pos,this.pos+1,new V(q.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new ks(this.pos,n.marks[i]);return new ks(this.pos,this.mark)}}return new Pd(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new ks(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ks(n.pos,t.markFromJSON(n.mark))}}lr.jsonID("addNodeMark",ks);class Pd extends lr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return en.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return en.fromReplace(t,this.pos,this.pos+1,new V(q.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new ks(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Pd(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Pd(n.pos,t.markFromJSON(n.mark))}}lr.jsonID("removeNodeMark",Pd);class dr extends lr{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&t_(t,this.from,this.to)?en.fail("Structure replace would overwrite content"):en.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new ei([this.from,this.to-this.from,this.slice.size])}invert(t){return new dr(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new dr(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof dr)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?V.empty:new V(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new dr(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?V.empty:new V(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new dr(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new dr(n.from,n.to,V.fromJSON(t,n.slice),!!n.structure)}}lr.jsonID("replace",dr);class ko extends lr{constructor(t,n,r,i,o,a,s=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(t){if(this.structure&&(t_(t,this.from,this.gapFrom)||t_(t,this.gapTo,this.to)))return en.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return en.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?en.fromReplace(t,this.from,this.to,r):en.fail("Content does not fit in gap")}getMap(){return new ei([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new ko(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new ko(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ko(n.from,n.to,n.gapFrom,n.gapTo,V.fromJSON(t,n.slice),n.insert,!!n.structure)}}lr.jsonID("replaceAround",ko);function t_(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function v8e(e,t,n,r){let i=[],o=[],a,s;e.doc.nodesBetween(t,n,(l,c,u)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let p=Math.max(c,t),h=Math.min(c+l.nodeSize,n),m=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(m)||(a&&a.to==p&&a.mark.eq(f[g])?a.to=h:i.push(a=new To(p,h,f[g])));s&&s.to==p?s.to=h:o.push(s=new $s(p,h,r))}}),i.forEach(l=>e.step(l)),o.forEach(l=>e.step(l))}function y8e(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(a,s)=>{if(!a.isInline)return;o++;let l=null;if(r instanceof cC){let c=a.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(a.marks)&&(l=[r]):l=a.marks;if(l&&l.length){let c=Math.min(s+a.nodeSize,n);for(let u=0;u<l.length;u++){let f=l[u],p;for(let h=0;h<i.length;h++){let m=i[h];m.step==o-1&&f.eq(i[h].style)&&(p=m)}p?(p.to=c,p.step=o):i.push({style:f,from:Math.max(s,t),to:c,step:o})}}}),i.forEach(a=>e.step(new To(a.from,a.to,a.style)))}function XF(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),a=[],s=t+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),u=s+c.nodeSize,f=r.matchType(c.type);if(!f)a.push(new dr(s,u,V.empty));else{r=f;for(let p=0;p<c.marks.length;p++)n.allowsMarkType(c.marks[p].type)||e.step(new To(s,u,c.marks[p]));if(i&&c.isText&&n.whitespace!="pre"){let p,h=/\r?\n|\r/g,m;for(;p=h.exec(c.text);)m||(m=new V(q.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),a.push(new dr(s+p.index,s+p.index+p[0].length,m))}}s=u}if(!r.validEnd){let l=r.fillBefore(q.empty,!0);e.replace(s,s,new V(l,0,0))}for(let l=a.length-1;l>=0;l--)e.step(a[l])}function b8e(e,t,n){let{$from:r,$to:i,depth:o}=t,a=r.before(o+1),s=i.after(o+1),l=a,c=s,u=q.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=q.from(r.node(m).copy(u)),f++):l--;let p=q.empty,h=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,p=q.from(i.node(m).copy(p)),h++):c++;e.step(new ko(l,c,a,s,new V(u.append(p),f,h),u.size-f,!0))}function C8e(e,t,n){let r=q.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let s=n[a].type.contentMatch.matchFragment(r);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=q.from(n[a].type.create(n[a].attrs,r))}let i=t.start,o=t.end;e.step(new ko(i,o,i,o,new V(r,0,0),n.length,!0))}function S8e(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(a,s)=>{let l=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,l)&&w8e(e.doc,e.mapping.slice(o).map(s),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!m?c=!1:!h&&m&&(c=!0)}c===!1&&qZ(e,a,s,o),XF(e,e.mapping.slice(o).map(s,1),r,void 0,c===null);let u=e.mapping.slice(o),f=u.map(s,1),p=u.map(s+a.nodeSize,1);return e.step(new ko(f,p,f+1,p-1,new V(q.from(r.create(l,null,a.marks)),0,0),1,!0)),c===!0&&KZ(e,a,s,o),!1}})}function KZ(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let a,s=/\r?\n|\r/g;for(;a=s.exec(i.text);){let l=e.mapping.slice(r).map(n+1+o+a.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function qZ(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let a=e.mapping.slice(r).map(n+1+o);e.replaceWith(a,a+1,t.type.schema.text(`
138
+ `))}})}function w8e(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function x8e(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let a=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,a);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new ko(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new V(q.from(a),0,0),1,!0))}function _8e(e,t,n=1,r){let i=e.doc.resolve(t),o=q.empty,a=q.empty;for(let s=i.depth,l=i.depth-n,c=n-1;s>l;s--,c--){o=q.from(i.node(s).copy(o));let u=r&&r[c];a=q.from(u?u.type.create(u.attrs,a):i.node(s).copy(a))}e.step(new dr(t,t,new V(o.append(a),n,n),!0))}function T8e(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),a=o.node().type;if(i&&a.inlineContent){let u=a.whitespace=="pre",f=!!a.contentMatch.matchType(i);u&&!f?r=!1:!u&&f&&(r=!0)}let s=e.steps.length;if(r===!1){let u=e.doc.resolve(t+n);qZ(e,u.node(),u.before(),s)}a.inlineContent&&XF(e,t+n-1,a,o.node().contentMatchAt(o.index()),r==null);let l=e.mapping.slice(s),c=l.map(t-n);if(e.step(new dr(c,l.map(t+n,-1),V.empty,!0)),r===!0){let u=e.doc.resolve(c);KZ(e,u.node(),u.before(),e.steps.length)}return e}function I8e(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function E8e(e,t,n=t,r=V.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return VZ(i,o,r)?new dr(t,n,r):new R8e(i,o,r).fit()}function VZ(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class R8e{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=q.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=q.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,a=r.depth,s=i.depth;for(;a&&s&&o.childCount==1;)o=o.firstChild.content,a--,s--;let l=new V(o,a,s);return t>-1?new ko(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new dr(r.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=_w(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let s=this.depth;s>=0;s--){let{type:l,match:c}=this.frontier[s],u,f=null;if(n==1&&(a?c.matchType(a.type)||(f=c.fillBefore(q.from(a),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:f};if(n==2&&a&&(u=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=_w(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new V(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=_w(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new V(Vp(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new V(Vp(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let a=this.unplaced,s=r?r.content:a.content,l=a.openStart-t,c=0,u=[],{match:f,type:p}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));f=f.matchFragment(i)}let h=s.size+t-(a.content.size-a.openEnd);for(;c<s.childCount;){let g=s.child(c),y=f.matchType(g.type);if(!y)break;c++,(c>1||l==0||g.content.size)&&(f=y,u.push(zZ(g.mark(p.allowedMarks(g.marks)),c==1?l:0,c==s.childCount?h:-1)))}let m=c==s.childCount;m||(h=-1),this.placed=zp(this.placed,n,q.from(u)),this.frontier[n].match=f,m&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=s;g<h;g++){let C=y.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),y=C.content}this.unplaced=m?t==0?V.empty:new V(Vp(a.content,t-1,1),t-1,h<0?a.openEnd:t-1):new V(Vp(a.content,t,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!Tw(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),a=Tw(t,n,i,r,o);if(a){for(let s=n-1;s>=0;s--){let{match:l,type:c}=this.frontier[s],u=Tw(t,s,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:a,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=zp(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=zp(this.placed,this.depth,q.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(q.empty,!0);n.childCount&&(this.placed=zp(this.placed,this.frontier.length,n))}}function Vp(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Vp(e.firstChild.content,t-1,n)))}function zp(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(zp(e.lastChild.content,t-1,n)))}function _w(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function zZ(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,zZ(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(q.empty,!0)))),e.copy(r)}function Tw(e,t,n,r,i){let o=e.node(t),a=i?e.indexAfter(t):e.index(t);if(a==o.childCount&&!n.compatibleContent(o.type))return null;let s=r.fillBefore(o.content,!0,a);return s&&!$8e(n,o.content,a)?s:null}function $8e(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function k8e(e){return e.spec.defining||e.spec.definingForContent}function O8e(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(VZ(i,o,r))return e.step(new dr(t,n,r));let a=HZ(i,e.doc.resolve(n));a[a.length-1]==0&&a.pop();let s=-(i.depth+1);a.unshift(s);for(let p=i.depth,h=i.pos-1;p>0;p--,h--){let m=i.node(p).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;a.indexOf(p)>-1?s=p:i.before(p)==h&&a.splice(1,0,-p)}let l=a.indexOf(s),c=[],u=r.openStart;for(let p=r.content,h=0;;h++){let m=p.firstChild;if(c.push(m),h==r.openStart)break;p=m.content}for(let p=u-1;p>=0;p--){let h=c[p],m=k8e(h.type);if(m&&!h.sameMarkup(i.node(Math.abs(s)-1)))u=p;else if(m||!h.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let h=(p+u+1)%(r.openStart+1),m=c[h];if(m)for(let g=0;g<a.length;g++){let y=a[(g+l)%a.length],C=!0;y<0&&(C=!1,y=-y);let x=i.node(y-1),b=i.index(y-1);if(x.canReplaceWith(b,b,m.type,m.marks))return e.replace(i.before(y),C?o.after(y):n,new V(QZ(r.content,0,r.openStart,h),h,r.openEnd))}}let f=e.steps.length;for(let p=a.length-1;p>=0&&(e.replace(t,n,r),!(e.steps.length>f));p--){let h=a[p];h<0||(t=i.before(h),n=o.after(h))}}function QZ(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(QZ(o.content,t+1,n,r,o)))}if(t>r){let o=i.contentMatchAt(0),a=o.fillBefore(e).append(e);e=a.append(o.matchFragment(a).fillBefore(q.empty,!0))}return e}function M8e(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=I8e(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new V(q.from(r),0,0))}function F8e(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=HZ(r,i);for(let a=0;a<o.length;a++){let s=o[a],l=a==o.length-1;if(l&&s==0||r.node(s).type.contentMatch.validEnd)return e.delete(r.start(s),i.end(s));if(s>0&&(l||r.node(s-1).canReplace(r.index(s-1),i.indexAfter(s-1))))return e.delete(r.before(s),i.after(s))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function HZ(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let o=e.start(i);if(o<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class ud extends lr{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return en.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return en.fromReplace(t,this.pos,this.pos+1,new V(q.from(i),0,n.isLeaf?0:1))}getMap(){return ei.empty}invert(t){return new ud(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new ud(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ud(n.pos,n.attr,n.value)}}lr.jsonID("attr",ud);class Yh extends lr{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return en.ok(r)}getMap(){return ei.empty}invert(t){return new Yh(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Yh(n.attr,n.value)}}lr.jsonID("docAttr",Yh);let Wd=class extends Error{};Wd=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Wd.prototype=Object.create(Error.prototype);Wd.prototype.constructor=Wd;Wd.prototype.name="TransformError";class j8e{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new nh}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Wd(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=V.empty){let i=E8e(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new V(q.from(r),0,0))}delete(t,n){return this.replace(t,n,V.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return O8e(this,t,n,r),this}replaceRangeWith(t,n,r){return M8e(this,t,n,r),this}deleteRange(t,n){return F8e(this,t,n),this}lift(t,n){return b8e(this,t,n),this}join(t,n=1){return T8e(this,t,n),this}wrap(t,n){return C8e(this,t,n),this}setBlockType(t,n=t,r,i=null){return S8e(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return x8e(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new ud(t,n,r)),this}setDocAttribute(t,n){return this.step(new Yh(t,n)),this}addNodeMark(t,n){return this.step(new ks(t,n)),this}removeNodeMark(t,n){if(!(n instanceof xt)){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Pd(t,n)),this}split(t,n=1,r){return _8e(this,t,n,r),this}addMark(t,n,r){return v8e(this,t,n,r),this}removeMark(t,n,r){return y8e(this,t,n,r),this}clearIncompatible(t,n,r){return XF(this,t,n,r),this}}var n_,r_;if(typeof WeakMap<"u"){let e=new WeakMap;n_=t=>e.get(t),r_=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;n_=r=>{for(let i=0;i<e.length;i+=2)if(e[i]==r)return e[i+1]},r_=(r,i)=>(n==10&&(n=0),e[n++]=r,e[n++]=i)}var vt=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const r=t%this.width,i=t/this.width|0;let o=r+1,a=i+1;for(let s=1;o<this.width&&this.map[t+s]==n;s++)o++;for(let s=1;a<this.height&&this.map[t+this.width*s]==n;s++)a++;return{left:r,top:i,right:o,bottom:a}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:r,right:i,top:o,bottom:a}=this.findCell(e);return t=="horiz"?(n<0?r==0:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?o==0:a==this.height)?null:this.map[r+this.width*(n<0?o-1:a)]}rectBetween(e,t){const{left:n,right:r,top:i,bottom:o}=this.findCell(e),{left:a,right:s,top:l,bottom:c}=this.findCell(t);return{left:Math.min(n,a),top:Math.min(i,l),right:Math.max(r,s),bottom:Math.max(o,c)}}cellsInRect(e){const t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){const o=r*this.width+i,a=this.map[o];n[a]||(n[a]=!0,!(i==e.left&&i&&this.map[o-1]==a||r==e.top&&r&&this.map[o-this.width]==a)&&t.push(a))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){const o=i+n.child(r).nodeSize;if(r==e){let a=t+e*this.width;const s=(e+1)*this.width;for(;a<s&&this.map[a]<i;)a++;return a==s?o-1:this.map[a]}i=o}}static get(e){return n_(e)||r_(e,L8e(e))}};function L8e(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=D8e(e),n=e.childCount,r=[];let i=0,o=null;const a=[];for(let c=0,u=t*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const f=e.child(c);u++;for(let m=0;;m++){for(;i<r.length&&r[i]!=0;)i++;if(m==f.childCount)break;const g=f.child(m),{colspan:y,rowspan:C,colwidth:x}=g.attrs;for(let b=0;b<C;b++){if(b+c>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:u,n:C-b});break}const v=i+b*t;for(let S=0;S<y;S++){r[v+S]==0?r[v+S]=u:(o||(o=[])).push({type:"collision",row:c,pos:u,n:y-S});const w=x&&x[S];if(w){const T=(v+S)%t*2,E=a[T];E==null||E!=w&&a[T+1]==1?(a[T]=w,a[T+1]=1):E==w&&a[T+1]++}}}i+=y,u+=g.nodeSize}const p=(c+1)*t;let h=0;for(;i<p;)r[i++]==0&&h++;h&&(o||(o=[])).push({type:"missing",row:c,n:h}),u++}(t===0||n===0)&&(o||(o=[])).push({type:"zero_sized"});const s=new vt(t,n,r,o);let l=!1;for(let c=0;!l&&c<a.length;c+=2)a[c]!=null&&a[c+1]<n&&(l=!0);return l&&U8e(s,a,e),s}function D8e(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){const i=e.child(r);let o=0;if(n)for(let a=0;a<r;a++){const s=e.child(a);for(let l=0;l<s.childCount;l++){const c=s.child(l);a+c.attrs.rowspan>r&&(o+=c.attrs.colspan)}}for(let a=0;a<i.childCount;a++){const s=i.child(a);o+=s.attrs.colspan,s.attrs.rowspan>1&&(n=!0)}t==-1?t=o:t!=o&&(t=Math.max(t,o))}return t}function U8e(e,t,n){e.problems||(e.problems=[]);const r={};for(let i=0;i<e.map.length;i++){const o=e.map[i];if(r[o])continue;r[o]=!0;const a=n.nodeAt(o);if(!a)throw new RangeError(`No cell with offset ${o} found`);let s=null;const l=a.attrs;for(let c=0;c<l.colspan;c++){const u=(i+c)%e.width,f=t[u*2];f!=null&&(!l.colwidth||l.colwidth[c]!=f)&&((s||(s=B8e(l)))[c]=f)}s&&e.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:s})}}function B8e(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function nr(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var xs=new qn("selectingCells");function mp(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function P8e(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function ci(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function RC(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=mp(t.$head)||W8e(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function W8e(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function i_(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function N8e(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ej(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function YZ(e,t,n){const r=e.node(-1),i=vt.get(r),o=e.start(-1),a=i.nextCell(e.pos-o,t,n);return a==null?null:e.node(0).resolve(o+a)}function Oc(e,t,n=1){const r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function GZ(e,t,n=1){const r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(t,0,0)}return r}function K8e(e,t,n){const r=nr(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var dt=class ha extends je{constructor(t,n=t){const r=t.node(-1),i=vt.get(r),o=t.start(-1),a=i.rectBetween(t.pos-o,n.pos-o),s=t.node(0),l=i.cellsInRect(a).filter(u=>u!=n.pos-o);l.unshift(n.pos-o);const c=l.map(u=>{const f=r.nodeAt(u);if(!f)throw RangeError(`No cell with offset ${u} found`);const p=o+u+1;return new rG(s.resolve(p),s.resolve(p+f.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(i_(r)&&i_(i)&&ej(r,i)){const o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?ha.rowSelection(r,i):o&&this.isColSelection()?ha.colSelection(r,i):new ha(r,i)}return Oe.between(r,i)}content(){const t=this.$anchorCell.node(-1),n=vt.get(t),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},a=[];for(let l=i.top;l<i.bottom;l++){const c=[];for(let u=l*n.width+i.left,f=i.left;f<i.right;f++,u++){const p=n.map[u];if(o[p])continue;o[p]=!0;const h=n.findCell(p);let m=t.nodeAt(p);if(!m)throw RangeError(`No cell with offset ${p} found`);const g=i.left-h.left,y=h.right-i.right;if(g>0||y>0){let C=m.attrs;if(g>0&&(C=Oc(C,0,g)),y>0&&(C=Oc(C,C.colspan-y,y)),h.left<i.left){if(m=m.type.createAndFill(C),!m)throw RangeError(`Could not create cell with attrs ${JSON.stringify(C)}`)}else m=m.type.create(C,m.content)}if(h.top<i.top||h.bottom>i.bottom){const C={...m.attrs,rowspan:Math.min(h.bottom,i.bottom)-Math.max(h.top,i.top)};h.top<i.top?m=m.type.createAndFill(C):m=m.type.create(C,m.content)}c.push(m)}a.push(t.child(l).copy(q.from(c)))}const s=this.isColSelection()&&this.isRowSelection()?t:a;return new V(q.from(s),1,1)}replace(t,n=V.empty){const r=t.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){const{$from:s,$to:l}=i[a],c=t.mapping.slice(r);t.replace(c.map(s.pos),c.map(l.pos),a?V.empty:n)}const o=je.findFrom(t.doc.resolve(t.mapping.slice(r).map(this.to)),-1);o&&t.setSelection(o)}replaceWith(t,n){this.replace(t,new V(q.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),r=vt.get(n),i=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let a=0;a<o.length;a++)t(n.nodeAt(o[a]),i+o[a])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const r=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const r=t.node(-1),i=vt.get(r),o=t.start(-1),a=i.findCell(t.pos-o),s=i.findCell(n.pos-o),l=t.node(0);return a.top<=s.top?(a.top>0&&(t=l.resolve(o+i.map[a.left])),s.bottom<i.height&&(n=l.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=l.resolve(o+i.map[s.left])),a.bottom<i.height&&(t=l.resolve(o+i.map[i.width*(i.height-1)+a.right-1]))),new ha(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=vt.get(t),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),o=n.colCount(this.$headCell.pos-r);if(Math.min(i,o)>0)return!1;const a=i+this.$anchorCell.nodeAfter.attrs.colspan,s=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,s)==n.width}eq(t){return t instanceof ha&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const r=t.node(-1),i=vt.get(r),o=t.start(-1),a=i.findCell(t.pos-o),s=i.findCell(n.pos-o),l=t.node(0);return a.left<=s.left?(a.left>0&&(t=l.resolve(o+i.map[a.top*i.width])),s.right<i.width&&(n=l.resolve(o+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=l.resolve(o+i.map[s.top*i.width])),a.right<i.width&&(t=l.resolve(o+i.map[i.width*(a.top+1)-1]))),new ha(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new ha(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new ha(t.resolve(n),t.resolve(r))}getBookmark(){return new q8e(this.$anchorCell.pos,this.$headCell.pos)}};dt.prototype.visible=!1;je.jsonID("cell",dt);var q8e=class JZ{constructor(t,n){this.anchor=t,this.head=n}map(t){return new JZ(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),r=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&ej(n,r)?new dt(n,r):je.near(r,1)}};function V8e(e){if(!(e.selection instanceof dt))return null;const t=[];return e.selection.forEachCell((n,r)=>{t.push(Jn.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Ot.create(e.doc,t)}function z8e({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let o=t.depth;o>=0&&!(t.before(o+1)>t.start(o));o--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function Q8e({$from:e,$to:t}){let n,r;for(let i=e.depth;i>0;i--){const o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=t.depth;i>0;i--){const o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&t.parentOffset===0}function H8e(e,t,n){const r=(t||e).selection,i=(t||e).doc;let o,a;if(r instanceof _e&&(a=r.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")o=dt.create(i,r.from);else if(a=="row"){const s=i.resolve(r.from+1);o=dt.rowSelection(s,s)}else if(!n){const s=vt.get(r.node),l=r.from+1,c=l+s.map[s.width*s.height-1];o=dt.create(i,l+1,c)}}else r instanceof Oe&&z8e(r)?o=Oe.create(i,r.from):r instanceof Oe&&Q8e(r)&&(o=Oe.create(i,r.$from.start(),r.$from.end()));return o&&(t||(t=e.tr)).setSelection(o),t}var Y8e=new qn("fix-tables");function ZZ(e,t,n,r){const i=e.childCount,o=t.childCount;e:for(let a=0,s=0;a<o;a++){const l=t.child(a);for(let c=s,u=Math.min(i,a+3);c<u;c++)if(e.child(c)==l){s=c+1,n+=l.nodeSize;continue e}r(l,n),s<i&&e.child(s).sameMarkup(l)?ZZ(e.child(s),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function XZ(e,t){let n;const r=(i,o)=>{i.type.spec.tableRole=="table"&&(n=G8e(e,i,o,n))};return t?t.doc!=e.doc&&ZZ(t.doc,e.doc,0,r):e.doc.descendants(r),n}function G8e(e,t,n,r){const i=vt.get(t);if(!i.problems)return r;r||(r=e.tr);const o=[];for(let l=0;l<i.height;l++)o.push(0);for(let l=0;l<i.problems.length;l++){const c=i.problems[l];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const f=u.attrs;for(let p=0;p<f.rowspan;p++)o[c.row+p]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,Oc(f,f.colspan-c.n,c.n))}else if(c.type=="missing")o[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=r.mapping.map(n);r.delete(u,u+t.nodeSize)}}let a,s;for(let l=0;l<o.length;l++)o[l]&&(a==null&&(a=l),s=l);for(let l=0,c=n+1;l<i.height;l++){const u=t.child(l),f=c+u.nodeSize,p=o[l];if(p>0){let h="cell";u.firstChild&&(h=u.firstChild.type.spec.tableRole);const m=[];for(let y=0;y<p;y++){const C=nr(e.schema)[h].createAndFill();C&&m.push(C)}const g=(l==0||a==l-1)&&s==l?c+1:f-1;r.insert(r.mapping.map(g),m)}c=f}return r.setMeta(Y8e,{fixTables:!0})}function Ri(e){const t=e.selection,n=RC(e),r=n.node(-1),i=n.start(-1),o=vt.get(r);return{...t instanceof dt?o.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function tj(e,{map:t,tableStart:n,table:r},i){let o=i>0?-1:0;K8e(t,r,i+o)&&(o=i==0||i==t.width?null:0);for(let a=0;a<t.height;a++){const s=a*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){const l=t.map[s],c=r.nodeAt(l);e.setNodeMarkup(e.mapping.map(n+l),null,GZ(c.attrs,i-t.colCount(l))),a+=c.attrs.rowspan-1}else{const l=o==null?nr(r.type.schema).cell:r.nodeAt(t.map[s+o]).type,c=t.positionAt(a,i,r);e.insert(e.mapping.map(n+c),l.createAndFill())}}return e}function J8e(e,t){if(!ci(e))return!1;if(t){const n=Ri(e);t(tj(e.tr,n,n.left))}return!0}function Z8e(e,t){if(!ci(e))return!1;if(t){const n=Ri(e);t(tj(e.tr,n,n.right))}return!0}function X8e(e,{map:t,table:n,tableStart:r},i){const o=e.mapping.maps.length;for(let a=0;a<t.height;){const s=a*t.width+i,l=t.map[s],c=n.nodeAt(l),u=c.attrs;if(i>0&&t.map[s-1]==l||i<t.width-1&&t.map[s+1]==l)e.setNodeMarkup(e.mapping.slice(o).map(r+l),null,Oc(u,i-t.colCount(l)));else{const f=e.mapping.slice(o).map(r+l);e.delete(f,f+c.nodeSize)}a+=u.rowspan}}function eqe(e,t){if(!ci(e))return!1;if(t){const n=Ri(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;X8e(r,n,i),i!=n.left;i--){const o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=vt.get(o)}t(r)}return!0}function tqe(e,t,n){var r;const i=nr(t.type.schema).header_cell;for(let o=0;o<e.width;o++)if(((r=t.nodeAt(e.map[o+n*e.width]))==null?void 0:r.type)!=i)return!1;return!0}function nj(e,{map:t,tableStart:n,table:r},i){var o;let a=n;for(let c=0;c<i;c++)a+=r.child(c).nodeSize;const s=[];let l=i>0?-1:0;tqe(t,r,i+l)&&(l=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c<t.width;c++,u++)if(i>0&&i<t.height&&t.map[u]==t.map[u-t.width]){const f=t.map[u],p=r.nodeAt(f).attrs;e.setNodeMarkup(n+f,null,{...p,rowspan:p.rowspan+1}),c+=p.colspan-1}else{const f=l==null?nr(r.type.schema).cell:(o=r.nodeAt(t.map[u+l*t.width]))==null?void 0:o.type,p=f==null?void 0:f.createAndFill();p&&s.push(p)}return e.insert(a,nr(r.type.schema).row.create(null,s)),e}function nqe(e,t){if(!ci(e))return!1;if(t){const n=Ri(e);t(nj(e.tr,n,n.top))}return!0}function rqe(e,t){if(!ci(e))return!1;if(t){const n=Ri(e);t(nj(e.tr,n,n.bottom))}return!0}function iqe(e,{map:t,table:n,tableStart:r},i){let o=0;for(let c=0;c<i;c++)o+=n.child(c).nodeSize;const a=o+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(o+r,a+r);const l=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const f=t.map[u];if(!l.has(f)){if(l.add(f),i>0&&f==t.map[u-t.width]){const p=n.nodeAt(f).attrs;e.setNodeMarkup(e.mapping.slice(s).map(f+r),null,{...p,rowspan:p.rowspan-1}),c+=p.colspan-1}else if(i<t.height&&f==t.map[u+t.width]){const p=n.nodeAt(f),h=p.attrs,m=p.type.create({...h,rowspan:p.attrs.rowspan-1},p.content),g=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(s).map(r+g),m),c+=h.colspan-1}}}}function oqe(e,t){if(!ci(e))return!1;if(t){const n=Ri(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;iqe(r,n,i),i!=n.top;i--){const o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=vt.get(n.table)}t(r)}return!0}function KD(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function aqe({width:e,height:t,map:n},r){let i=r.top*e+r.left,o=i,a=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&n[o]==n[o-1]||r.right<e&&n[s]==n[s+1])return!0;o+=e,s+=e}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[a]==n[a+e])return!0;i++,a++}return!1}function qD(e,t){const n=e.selection;if(!(n instanceof dt)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Ri(e),{map:i}=r;if(aqe(i,r))return!1;if(t){const o=e.tr,a={};let s=q.empty,l,c;for(let u=r.top;u<r.bottom;u++)for(let f=r.left;f<r.right;f++){const p=i.map[u*i.width+f],h=r.table.nodeAt(p);if(!(a[p]||!h))if(a[p]=!0,l==null)l=p,c=h;else{KD(h)||(s=s.append(h.content));const m=o.mapping.map(p+r.tableStart);o.delete(m,m+h.nodeSize)}}if(l==null||c==null)return!0;if(o.setNodeMarkup(l+r.tableStart,null,{...GZ(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),s.size){const u=l+1+c.content.size,f=KD(c)?l+1:u;o.replaceWith(f+r.tableStart,u+r.tableStart,s)}o.setSelection(new dt(o.doc.resolve(l+r.tableStart))),t(o)}return!0}function VD(e,t){const n=nr(e.schema);return sqe(({node:r})=>n[r.type.spec.tableRole])(e,t)}function sqe(e){return(t,n)=>{var r;const i=t.selection;let o,a;if(i instanceof dt){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,a=i.$anchorCell.pos}else{if(o=P8e(i.$from),!o)return!1;a=(r=mp(i.$from))==null?void 0:r.pos}if(o==null||a==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let s=o.attrs;const l=[],c=s.colwidth;s.rowspan>1&&(s={...s,rowspan:1}),s.colspan>1&&(s={...s,colspan:1});const u=Ri(t),f=t.tr;for(let h=0;h<u.right-u.left;h++)l.push(c?{...s,colwidth:c&&c[h]?[c[h]]:null}:s);let p;for(let h=u.top;h<u.bottom;h++){let m=u.map.positionAt(h,u.left,u.table);h==u.top&&(m+=o.nodeSize);for(let g=u.left,y=0;g<u.right;g++,y++)g==u.left&&h==u.top||f.insert(p=f.mapping.map(m+u.tableStart,1),e({node:o,row:h,col:g}).createAndFill(l[y]))}f.setNodeMarkup(a,e({node:o,row:u.top,col:u.left}),l[0]),i instanceof dt&&f.setSelection(new dt(f.doc.resolve(i.$anchorCell.pos),p?f.doc.resolve(p):void 0)),n(f)}return!0}}function lqe(e,t){return function(n,r){if(!ci(n))return!1;const i=RC(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){const o=n.tr;n.selection instanceof dt?n.selection.forEachCell((a,s)=>{a.attrs[e]!==t&&o.setNodeMarkup(s,null,{...a.attrs,[e]:t})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(o)}return!0}}function cqe(e){return function(t,n){if(!ci(t))return!1;if(n){const r=nr(t.schema),i=Ri(t),o=t.tr,a=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=a.map(l=>i.table.nodeAt(l));for(let l=0;l<a.length;l++)s[l].type==r.header_cell&&o.setNodeMarkup(i.tableStart+a[l],r.cell,s[l].attrs);if(o.steps.length==0)for(let l=0;l<a.length;l++)o.setNodeMarkup(i.tableStart+a[l],r.header_cell,s[l].attrs);n(o)}return!0}}function zD(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<r.length;i++){const o=t.table.nodeAt(r[i]);if(o&&o.type!==n.header_cell)return!1}return!0}function Gh(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?cqe(e):function(n,r){if(!ci(n))return!1;if(r){const i=nr(n.schema),o=Ri(n),a=n.tr,s=zD("row",o,i),l=zD("column",o,i),u=(e==="column"?s:e==="row"?l:!1)?1:0,f=e=="column"?{left:0,top:u,right:1,bottom:o.map.height}:e=="row"?{left:u,top:0,right:o.map.width,bottom:1}:o,p=e=="column"?l?i.cell:i.header_cell:e=="row"?s?i.cell:i.header_cell:i.cell;o.map.cellsInRect(f).forEach(h=>{const m=h+o.tableStart,g=a.doc.nodeAt(m);g&&a.setNodeMarkup(m,p,g.attrs)}),r(a)}return!0}}Gh("row",{useDeprecatedLogic:!0});Gh("column",{useDeprecatedLogic:!0});var uqe=Gh("cell",{useDeprecatedLogic:!0});function dqe(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let r=e.index(-1)-1,i=e.before();r>=0;r--){const o=e.node(-1).child(r),a=o.lastChild;if(a)return i-1-a.nodeSize;i-=o.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let r=e.indexAfter(-1),i=e.after();r<n.childCount;r++){const o=n.child(r);if(o.childCount)return i+1;i+=o.nodeSize}}return null}function QD(e){return function(t,n){if(!ci(t))return!1;const r=dqe(RC(t),e);if(r==null)return!1;if(n){const i=t.doc.resolve(r);n(t.tr.setSelection(Oe.between(i,N8e(i))).scrollIntoView())}return!0}}function fqe(e,t){const n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Dg(e,t){const n=e.selection;if(!(n instanceof dt))return!1;if(t){const r=e.tr,i=nr(e.schema).cell.createAndFill().content;n.forEachCell((o,a)=>{o.content.eq(i)||r.replace(r.mapping.map(a+1),r.mapping.map(a+o.nodeSize-1),new V(i,0,0))}),r.docChanged&&t(r)}return!0}function pqe(e){if(!e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole=="table");)n--,r--,t=t.child(0).content;const i=t.child(0),o=i.type.spec.tableRole,a=i.type.schema,s=[];if(o=="row")for(let l=0;l<t.childCount;l++){let c=t.child(l).content;const u=l?0:Math.max(0,n-1),f=l<t.childCount-1?0:Math.max(0,r-1);(u||f)&&(c=o_(nr(a).row,new V(c,u,f)).content),s.push(c)}else if(o=="cell"||o=="header_cell")s.push(n||r?o_(nr(a).row,new V(t,n,r)).content:t);else return null;return hqe(a,s)}function hqe(e,t){const n=[];for(let i=0;i<t.length;i++){const o=t[i];for(let a=o.childCount-1;a>=0;a--){const{rowspan:s,colspan:l}=o.child(a).attrs;for(let c=i;c<i+s;c++)n[c]=(n[c]||0)+l}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(q.empty),n[i]<r){const o=nr(e).cell.createAndFill(),a=[];for(let s=n[i];s<r;s++)a.push(o);t[i]=t[i].append(q.from(a))}return{height:t.length,width:r,rows:t}}function o_(e,t){const n=e.createAndFill();return new j8e(n).replace(0,n.content.size,t).doc}function Aqe({width:e,height:t,rows:n},r,i){if(e!=r){const o=[],a=[];for(let s=0;s<n.length;s++){const l=n[s],c=[];for(let u=o[s]||0,f=0;u<r;f++){let p=l.child(f%l.childCount);u+p.attrs.colspan>r&&(p=p.type.createChecked(Oc(p.attrs,p.attrs.colspan,u+p.attrs.colspan-r),p.content)),c.push(p),u+=p.attrs.colspan;for(let h=1;h<p.attrs.rowspan;h++)o[s+h]=(o[s+h]||0)+p.attrs.colspan}a.push(q.from(c))}n=a,e=r}if(t!=i){const o=[];for(let a=0,s=0;a<i;a++,s++){const l=[],c=n[s%t];for(let u=0;u<c.childCount;u++){let f=c.child(u);a+f.attrs.rowspan>i&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,i-f.attrs.rowspan)},f.content)),l.push(f)}o.push(q.from(l))}n=o,t=i}return{width:e,height:t,rows:n}}function mqe(e,t,n,r,i,o,a){const s=e.doc.type.schema,l=nr(s);let c,u;if(i>t.width)for(let f=0,p=0;f<t.height;f++){const h=n.child(f);p+=h.nodeSize;const m=[];let g;h.lastChild==null||h.lastChild.type==l.cell?g=c||(c=l.cell.createAndFill()):g=u||(u=l.header_cell.createAndFill());for(let y=t.width;y<i;y++)m.push(g);e.insert(e.mapping.slice(a).map(p-1+r),m)}if(o>t.height){const f=[];for(let m=0,g=(t.height-1)*t.width;m<Math.max(t.width,i);m++){const y=m>=t.width?!1:n.nodeAt(t.map[g+m]).type==l.header_cell;f.push(y?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const p=l.row.create(null,q.from(f)),h=[];for(let m=t.height;m<o;m++)h.push(p);e.insert(e.mapping.slice(a).map(r+n.nodeSize-2),h)}return!!(c||u)}function HD(e,t,n,r,i,o,a,s){if(a==0||a==t.height)return!1;let l=!1;for(let c=i;c<o;c++){const u=a*t.width+c,f=t.map[u];if(t.map[u-t.width]==f){l=!0;const p=n.nodeAt(f),{top:h,left:m}=t.findCell(f);e.setNodeMarkup(e.mapping.slice(s).map(f+r),null,{...p.attrs,rowspan:a-h}),e.insert(e.mapping.slice(s).map(t.positionAt(a,m,n)),p.type.createAndFill({...p.attrs,rowspan:h+p.attrs.rowspan-a})),c+=p.attrs.colspan-1}}return l}function YD(e,t,n,r,i,o,a,s){if(a==0||a==t.width)return!1;let l=!1;for(let c=i;c<o;c++){const u=c*t.width+a,f=t.map[u];if(t.map[u-1]==f){l=!0;const p=n.nodeAt(f),h=t.colCount(f),m=e.mapping.slice(s).map(f+r);e.setNodeMarkup(m,null,Oc(p.attrs,a-h,p.attrs.colspan-(a-h))),e.insert(m+p.nodeSize,p.type.createAndFill(Oc(p.attrs,0,a-h))),c+=p.attrs.rowspan-1}}return l}function GD(e,t,n,r,i){let o=n?e.doc.nodeAt(n-1):e.doc;if(!o)throw new Error("No table found");let a=vt.get(o);const{top:s,left:l}=r,c=l+i.width,u=s+i.height,f=e.tr;let p=0;function h(){if(o=n?f.doc.nodeAt(n-1):f.doc,!o)throw new Error("No table found");a=vt.get(o),p=f.mapping.maps.length}mqe(f,a,o,n,c,u,p)&&h(),HD(f,a,o,n,l,c,s,p)&&h(),HD(f,a,o,n,l,c,u,p)&&h(),YD(f,a,o,n,s,u,l,p)&&h(),YD(f,a,o,n,s,u,c,p)&&h();for(let m=s;m<u;m++){const g=a.positionAt(m,l,o),y=a.positionAt(m,c,o);f.replace(f.mapping.slice(p).map(g+n),f.mapping.slice(p).map(y+n),new V(i.rows[m-s],0,0))}h(),f.setSelection(new dt(f.doc.resolve(n+a.positionAt(s,l,o)),f.doc.resolve(n+a.positionAt(u-1,c-1,o)))),t(f)}var gqe=kG({ArrowLeft:Ug("horiz",-1),ArrowRight:Ug("horiz",1),ArrowUp:Ug("vert",-1),ArrowDown:Ug("vert",1),"Shift-ArrowLeft":Bg("horiz",-1),"Shift-ArrowRight":Bg("horiz",1),"Shift-ArrowUp":Bg("vert",-1),"Shift-ArrowDown":Bg("vert",1),Backspace:Dg,"Mod-Backspace":Dg,Delete:Dg,"Mod-Delete":Dg});function cv(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Ug(e,t){return(n,r,i)=>{if(!i)return!1;const o=n.selection;if(o instanceof dt)return cv(n,r,je.near(o.$headCell,t));if(e!="horiz"&&!o.empty)return!1;const a=eX(i,e,t);if(a==null)return!1;if(e=="horiz")return cv(n,r,je.near(n.doc.resolve(o.head+t),t));{const s=n.doc.resolve(a),l=YZ(s,e,t);let c;return l?c=je.near(l,1):t<0?c=je.near(n.doc.resolve(s.before(-1)),-1):c=je.near(n.doc.resolve(s.after(-1)),1),cv(n,r,c)}}}function Bg(e,t){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let a;if(o instanceof dt)a=o;else{const l=eX(i,e,t);if(l==null)return!1;a=new dt(n.doc.resolve(l))}const s=YZ(a.$headCell,e,t);return s?cv(n,r,new dt(a.$anchorCell,s)):!1}}function vqe(e,t){const n=e.state.doc,r=mp(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new dt(r))),!0):!1}function yqe(e,t,n){if(!ci(e.state))return!1;let r=pqe(n);const i=e.state.selection;if(i instanceof dt){r||(r={width:1,height:1,rows:[q.from(o_(nr(e.state.schema).cell,n))]});const o=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),s=vt.get(o).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=Aqe(r,s.right-s.left,s.bottom-s.top),GD(e.state,e.dispatch,a,s,r),!0}else if(r){const o=RC(e.state),a=o.start(-1);return GD(e.state,e.dispatch,a,vt.get(o.node(-1)).findCell(o.pos-a),r),!0}else return!1}function bqe(e,t){var n;if(t.ctrlKey||t.metaKey)return;const r=JD(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof dt)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&(i=mp(e.state.selection.$anchor))!=null&&((n=Iw(e,t))==null?void 0:n.pos)!=i.pos)o(i,t),t.preventDefault();else if(!r)return;function o(l,c){let u=Iw(e,c);const f=xs.getState(e.state)==null;if(!u||!ej(l,u))if(f)u=l;else return;const p=new dt(l,u);if(f||!e.state.selection.eq(p)){const h=e.state.tr.setSelection(p);f&&h.setMeta(xs,l.pos),e.dispatch(h)}}function a(){e.root.removeEventListener("mouseup",a),e.root.removeEventListener("dragstart",a),e.root.removeEventListener("mousemove",s),xs.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(xs,-1))}function s(l){const c=l,u=xs.getState(e.state);let f;if(u!=null)f=e.state.doc.resolve(u);else if(JD(e,c.target)!=r&&(f=Iw(e,t),!f))return a();f&&o(f,c)}e.root.addEventListener("mouseup",a),e.root.addEventListener("dragstart",a),e.root.addEventListener("mousemove",s)}function eX(e,t,n){if(!(e.state.selection instanceof Oe))return null;const{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){const o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const s=r.before(i),l=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(l)?s:null}}return null}function JD(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Iw(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?mp(e.state.doc.resolve(n.pos)):null}var tX=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),a_(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,a_(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function a_(e,t,n,r,i,o){var a;let s=0,l=!0,c=t.firstChild;const u=e.firstChild;if(u){for(let f=0,p=0;f<u.childCount;f++){const{colspan:h,colwidth:m}=u.child(f).attrs;for(let g=0;g<h;g++,p++){const y=i==p?o:m&&m[g],C=y?y+"px":"";if(s+=y||r,y||(l=!1),c)c.style.width!=C&&(c.style.width=C),c=c.nextSibling;else{const x=document.createElement("col");x.style.width=C,t.appendChild(x)}}}for(;c;){const f=c.nextSibling;(a=c.parentNode)==null||a.removeChild(c),c=f}l?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}var ti=new qn("tableColumnResizing");function Cqe({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=tX,lastColumnResizable:i=!0}={}){const o=new dn({key:ti,state:{init(a,s){var l,c;const u=(c=(l=o.spec)==null?void 0:l.props)==null?void 0:c.nodeViews,f=nr(s.schema).table.name;return r&&u&&(u[f]=(p,h)=>new r(p,n,h)),new Sqe(-1,!1)},apply(a,s){return s.apply(a)}},props:{attributes:a=>{const s=ti.getState(a);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,s)=>{wqe(a,s,e,i)},mouseleave:a=>{xqe(a)},mousedown:(a,s)=>{_qe(a,s,t,n)}},decorations:a=>{const s=ti.getState(a);if(s&&s.activeHandle>-1)return $qe(a,s.activeHandle)},nodeViews:{}}});return o}var Sqe=class uv{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,r=t.getMeta(ti);if(r&&r.setHandle!=null)return new uv(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new uv(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return i_(t.doc.resolve(i))||(i=-1),new uv(i,n.dragging)}return n}};function wqe(e,t,n,r){if(!e.editable)return;const i=ti.getState(e.state);if(i&&!i.dragging){const o=Iqe(t.target);let a=-1;if(o){const{left:s,right:l}=o.getBoundingClientRect();t.clientX-s<=n?a=ZD(e,t,"left",n):l-t.clientX<=n&&(a=ZD(e,t,"right",n))}if(a!=i.activeHandle){if(!r&&a!==-1){const s=e.state.doc.resolve(a),l=s.node(-1),c=vt.get(l),u=s.start(-1);if(c.colCount(s.pos-u)+s.nodeAfter.attrs.colspan-1==c.width-1)return}nX(e,a)}}}function xqe(e){if(!e.editable)return;const t=ti.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&nX(e,-1)}function _qe(e,t,n,r){var i;if(!e.editable)return!1;const o=(i=e.dom.ownerDocument.defaultView)!=null?i:window,a=ti.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const s=e.state.doc.nodeAt(a.activeHandle),l=Tqe(e,a.activeHandle,s.attrs);e.dispatch(e.state.tr.setMeta(ti,{setDragging:{startX:t.clientX,startWidth:l}}));function c(f){o.removeEventListener("mouseup",c),o.removeEventListener("mousemove",u);const p=ti.getState(e.state);p!=null&&p.dragging&&(Eqe(e,p.activeHandle,XD(p.dragging,f,n)),e.dispatch(e.state.tr.setMeta(ti,{setDragging:null})))}function u(f){if(!f.which)return c(f);const p=ti.getState(e.state);if(p&&p.dragging){const h=XD(p.dragging,f,n);eU(e,p.activeHandle,h,r)}}return eU(e,a.activeHandle,l,r),o.addEventListener("mouseup",c),o.addEventListener("mousemove",u),t.preventDefault(),!0}function Tqe(e,t,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const o=e.domAtPos(t);let s=o.node.childNodes[o.offset].offsetWidth,l=n;if(r)for(let c=0;c<n;c++)r[c]&&(s-=r[c],l--);return s/l}function Iqe(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function ZD(e,t,n,r){const i=n=="right"?-r:r,o=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!o)return-1;const{pos:a}=o,s=mp(e.state.doc.resolve(a));if(!s)return-1;if(n=="right")return s.pos;const l=vt.get(s.node(-1)),c=s.start(-1),u=l.map.indexOf(s.pos-c);return u%l.width==0?-1:c+l.map[u-1]}function XD(e,t,n){const r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function nX(e,t){e.dispatch(e.state.tr.setMeta(ti,{setHandle:t}))}function Eqe(e,t,n){const r=e.state.doc.resolve(t),i=r.node(-1),o=vt.get(i),a=r.start(-1),s=o.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let c=0;c<o.height;c++){const u=c*o.width+s;if(c&&o.map[u]==o.map[u-o.width])continue;const f=o.map[u],p=i.nodeAt(f).attrs,h=p.colspan==1?0:s-o.colCount(f);if(p.colwidth&&p.colwidth[h]==n)continue;const m=p.colwidth?p.colwidth.slice():Rqe(p.colspan);m[h]=n,l.setNodeMarkup(a+f,null,{...p,colwidth:m})}l.docChanged&&e.dispatch(l)}function eU(e,t,n,r){const i=e.state.doc.resolve(t),o=i.node(-1),a=i.start(-1),s=vt.get(o).colCount(i.pos-a)+i.nodeAfter.attrs.colspan-1;let l=e.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&a_(o,l.firstChild,l,r,s,n)}function Rqe(e){return Array(e).fill(0)}function $qe(e,t){var n;const r=[],i=e.doc.resolve(t),o=i.node(-1);if(!o)return Ot.empty;const a=vt.get(o),s=i.start(-1),l=a.colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1;for(let c=0;c<a.height;c++){const u=l+c*a.width;if((l==a.width-1||a.map[u]!=a.map[u+1])&&(c==0||a.map[u]!=a.map[u-a.width])){const f=a.map[u],p=s+f+o.nodeAt(f).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",(n=ti.getState(e))!=null&&n.dragging&&r.push(Jn.node(s+f,s+f+o.nodeAt(f).nodeSize,{class:"column-resize-dragging"})),r.push(Jn.widget(p,h))}}return Ot.create(e.doc,r)}function kqe({allowTableNodeSelection:e=!1}={}){return new dn({key:xs,state:{init(){return null},apply(t,n){const r=t.getMeta(xs);if(r!=null)return r==-1?null:r;if(n==null||!t.docChanged)return n;const{deleted:i,pos:o}=t.mapping.mapResult(n);return i?null:o}},props:{decorations:V8e,handleDOMEvents:{mousedown:bqe},createSelectionBetween(t){return xs.getState(t.state)!=null?t.state.selection:null},handleTripleClick:vqe,handleKeyDown:gqe,handlePaste:yqe},appendTransaction(t,n,r){return H8e(r,XZ(r,n),e)}})}function s_(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function tU(e,t,n,r,i,o){var a;let s=0,l=!0,c=t.firstChild;const u=e.firstChild;if(u!==null)for(let f=0,p=0;f<u.childCount;f+=1){const{colspan:h,colwidth:m}=u.child(f).attrs;for(let g=0;g<h;g+=1,p+=1){const y=i===p?o:m&&m[g],C=y?`${y}px`:"";if(s+=y||r,y||(l=!1),c){if(c.style.width!==C){const[x,b]=s_(r,y);c.style.setProperty(x,b)}c=c.nextSibling}else{const x=document.createElement("col"),[b,v]=s_(r,y);x.style.setProperty(b,v),t.appendChild(x)}}}for(;c;){const f=c.nextSibling;(a=c.parentNode)===null||a===void 0||a.removeChild(c),c=f}l?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}let Oqe=class{constructor(t,n){this.node=t,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),tU(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,tU(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type==="attributes"&&(t.target===this.table||this.colgroup.contains(t.target))}};function Mqe(e,t,n,r){let i=0,o=!0;const a=[],s=e.firstChild;if(!s)return{};for(let f=0,p=0;f<s.childCount;f+=1){const{colspan:h,colwidth:m}=s.child(f).attrs;for(let g=0;g<h;g+=1,p+=1){const y=n===p?r:m&&m[g];i+=y||t,y||(o=!1);const[C,x]=s_(t,y);a.push(["col",{style:`${C}: ${x}`}])}}const l=o?`${i}px`:"",c=o?"":`${i}px`;return{colgroup:["colgroup",{},...a],tableWidth:l,tableMinWidth:c}}function nU(e,t){return t?e.createChecked(null,t):e.createAndFill()}function Fqe(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function jqe(e,t,n,r,i){const o=Fqe(e),a=[],s=[];for(let c=0;c<n;c+=1){const u=nU(o.cell,i);if(u&&s.push(u),r){const f=nU(o.header_cell,i);f&&a.push(f)}}const l=[];for(let c=0;c<t;c+=1)l.push(o.row.createChecked(null,r&&c===0?a:s));return o.table.createChecked(null,l)}function Lqe(e){return e instanceof dt}const Pg=({editor:e})=>{const{selection:t}=e.state;if(!Lqe(t))return!1;let n=0;const r=gJ(t.ranges[0].$from,o=>o.type.name==="table");return r==null||r.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1},Dqe=gn.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:Oqe,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:e,HTMLAttributes:t}){const{colgroup:n,tableWidth:r,tableMinWidth:i}=Mqe(e,this.options.cellMinWidth);return["table",Ut(this.options.HTMLAttributes,t,{style:r?`width: ${r}`:`min-width: ${i}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{const a=jqe(o.schema,e,t,n);if(i){const s=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(Oe.near(r.doc.resolve(s)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>J8e(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>Z8e(e,t),deleteColumn:()=>({state:e,dispatch:t})=>eqe(e,t),addRowBefore:()=>({state:e,dispatch:t})=>nqe(e,t),addRowAfter:()=>({state:e,dispatch:t})=>rqe(e,t),deleteRow:()=>({state:e,dispatch:t})=>oqe(e,t),deleteTable:()=>({state:e,dispatch:t})=>fqe(e,t),mergeCells:()=>({state:e,dispatch:t})=>qD(e,t),splitCell:()=>({state:e,dispatch:t})=>VD(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>Gh("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>Gh("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>uqe(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>qD(e,t)?!0:VD(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>lqe(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>QD(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>QD(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&XZ(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){const r=dt.create(t.doc,e.anchorCell,e.headCell);t.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Pg,"Mod-Backspace":Pg,Delete:Pg,"Mod-Delete":Pg}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Cqe({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],kqe({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:We(de(e,"tableRole",t))}}}),Uqe=gn.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",Ut(this.options.HTMLAttributes,e),0]}}),Bqe=50,Pqe=25;function $C(e,t){const n=e.nodes[t];if(!n)throw new Error(`Unwanted state: ${t} not found in schema.`);return n}function Lu(e){return ng(t=>t.type.spec.tableRole&&t.type.spec.tableRole==="table")(e)}function rX(e){var n;const t=(n=Lu(e.state.selection))==null?void 0:n.node;return t&&t.firstChild&&t.type.name==="table"?t.firstChild.childCount:0}function iX(e){var n;const t=(n=Lu(e.state.selection))==null?void 0:n.node;return t&&t.type.name==="table"?t.childCount:0}function lc(e){return rX(e)>=Pqe}function cc(e){return iX(e)>=Bqe}function oX(e,t){switch(t.type){case"hyperlink":case"paragraph":case"strong":case"em":return Fr.converter.fromPrismic(e)(t);default:return}}function aX(e){const{title:t,className:n,onClick:r,tabIndex:i,disabled:o=!1,onMouseDown:a,...s}=e,l=document.createElement("button");return l.className=n,l.setAttribute("type","button"),l.setAttribute("title",t),l.setAttribute("aria-label",t),l.setAttribute("tabIndex","0"),o&&l.setAttribute("disabled","true"),a&&l.addEventListener("mousedown",c=>{const u=c.currentTarget;a(c,u)}),l.addEventListener("click",c=>{const u=c.currentTarget;r(c,u)}),Object.entries(s).forEach(([c,u])=>{l.setAttribute(c,u.toString())}),l}function sX(e){const t=document.createElement("div");return t.innerHTML=e,t.firstChild?t.firstChild:null}class kC extends CustomEvent{constructor({name:t,detail:n}){super(t,{detail:n})}static dispatch(t,n){const{editor:r,...i}=n;r.view.dom.dispatchEvent(new kC({name:t,detail:i}))}static listen(t,n){const{editor:r,callback:i}=n,o=new AbortController;return r.view.dom.addEventListener(t,a=>{const{detail:s}=a;s&&i(s)},{signal:o.signal}),()=>o.abort()}}const lX="data-prismic-table-handle";function Wqe(e){return t=>{const n=Lu(t);if(n){const r=vt.get(n.node);return(Array.isArray(e)?e:Array.from([e])).reduce((o,a)=>{if(a>=0&&a<=r.width-1){const s=r.cellsInRect({left:a,right:a+1,top:0,bottom:r.height});return o.concat(s.flatMap(l=>{const c=n.node.nodeAt(l),u=l+n.start;return{pos:u,start:u+1,node:c}}))}return o},[])}return null}}function Nqe(e){return t=>{const n=Lu(t);if(n){const r=vt.get(n.node);return(Array.isArray(e)?e:Array.from([e])).reduce((o,a)=>{if(a>=0&&a<=r.height-1){const s=r.cellsInRect({left:0,right:r.width,top:a,bottom:a+1});return o.concat(s.map(l=>{const c=n.node.nodeAt(l),u=l+n.start;return{pos:u,start:u+1,node:c}}))}return o},[])}return null}}function Kqe(e,t){const{index:n,tr:r}=t,i=Lu(r.selection);if(!i)return r;const o=vt.get(i.node),a=e==="row";if(n<0||n>=(a?o.height:o.width))return r;const s=a?0:n,l=a?n:0,c=a?o.width:n+1,u=a?n+1:o.height,f=o.map[l*o.width+s],p=o.map[(u-1)*o.width+(c-1)];if(!f||!p)return r;const h=i.start+f,m=i.start+p,g=r.doc.resolve(h),y=r.doc.resolve(m);return r.setSelection(new dt(y,g))}function rU(e){const{element:t,type:n}=e,r=t.querySelector(`[${lX}="${n}"]`);if(!r)throw new Error(`No ${n} handle found`);return r}function iU(e){const{type:t,editor:n,rowIndex:r,columnIndex:i}=e,o=aX({title:`Select ${t} & show options`,className:ZJ(A.tableFieldStyles.tableHandle,A.tableFieldStyles[`table${Zn.capitalize(t)}Handle`]),[lX]:t,"aria-expanded":!1,onMouseDown:s=>{s.preventDefault(),s.stopImmediatePropagation();const l=t==="row"?r:i;n.view.dispatch(Kqe(t,{index:l,tr:n.state.tr}))},onClick:(s,l)=>{s.preventDefault(),s.stopImmediatePropagation(),kC.dispatch("handleClick",{type:t,editor:n,referenceElement:l})}}),a=sX(A.rawDragIndicatorIcon);return a&&o.appendChild(a),o}class qqe{constructor(t){$t(this,"abortController",new AbortController);$t(this,"currentRowHandle",null);$t(this,"currentColumnHandle",null);$t(this,"showCurrentHandles",t=>{try{const n=t.target,r=t.currentTarget;zqe(r),this.hidePreviousHandles();const i=oU("cell",n),o=this.getRowHandle(i),a=this.getColumnHandle(r,i);this.displayHandle(o),this.displayHandle(a),this.currentColumnHandle=a,this.currentRowHandle=o}catch{}});$t(this,"hidePreviousHandles",()=>{this.currentRowHandle&&this.hideHandle(this.currentRowHandle),this.currentColumnHandle&&this.hideHandle(this.currentColumnHandle)});this.view=t,this.update(this.view)}update(t){this.attachEventListeners(t.dom)}destroy(){this.abortController.abort()}attachEventListeners(t){this.abortController.signal.aborted||this.abortController.abort(),this.abortController=new AbortController;const{signal:n}=this.abortController;t.querySelectorAll("table").forEach(r=>{r.addEventListener("mouseover",this.showCurrentHandles,{signal:n}),r.addEventListener("mouseleave",this.hidePreviousHandles,{signal:n})})}getRowHandle(t){const n=oU("row",t),r=rU({element:n,type:"row"});if(!r)throw new Error("No row handle found");return r}getColumnHandle(t,n){const r=n.cellIndex+1,i=t.querySelector(`tr > th:nth-child(${r}), tr > td:nth-child(${r})`);if(!i)throw new Error("No header cell found");const o=rU({element:i,type:"column"});if(!o)throw new Error("No column handle found");return o}displayHandle(t){t.classList.add(A.tableFieldStyles.tableHandleVisible)}hideHandle(t){t.classList.remove(A.tableFieldStyles.tableHandleVisible)}}const Vqe={cell:["TD","TH"],row:["TR"]};function oU(e,t){const n=Vqe[e];for(const r of n){const i=t.closest(r);if(i)return i}throw new Error(`Failed to find closest ${e}`)}function zqe(e){if(!e||e.tagName!=="TABLE")throw new Error("Element is not a table")}function cX(){return new dn({key:new qn("tableCellHandles"),view:e=>new qqe(e),state:{init:(e,t)=>aU.bind(this)(t),apply:(e,t,n,r)=>e.docChanged?aU.bind(this)(r):t.map(e.mapping,e.doc)},props:{decorations(e){return this.getState(e)}}})}function aU(e){const{editor:t}=this,n=[],r=Wqe(0)(e.selection);r&&r.forEach(({pos:o},a)=>{n.push(Jn.widget(o+1,()=>iU({type:"row",editor:t,columnIndex:0,rowIndex:a})))});const i=Nqe(0)(e.selection);return i&&i.forEach(({pos:o},a)=>{n.push(Jn.widget(o+1,()=>iU({type:"column",editor:t,columnIndex:a,rowIndex:0})))}),Ot.create(e.doc,n)}const uX=$.object({colspan:$.number().nullish(),rowspan:$.number().nullish(),colwidth:$.array($.number()).nullish()}),dX=Uqe.extend({name:"tableCell",addProseMirrorPlugins(){return[cX.bind(this)()]}}),sU={fromPrismic(e){return function(t){const n=$C(e,dX.name),r=t.columnWidth?[t.columnWidth]:null;return n.create({colspan:1,rowspan:1,colwidth:r},t.content.value.flatMap(i=>oX(e,i)??[]))}},toPrismic(e){const t=[];e.content.forEach(i=>{const o=Fr.converter.toPrismic(i);fe.TextBlock.is(o)&&t.push(o)});const n=uX.parse(e.attrs),[r]=n.colwidth??[];return{type:"tableCell",content:{__TYPE__:"StructuredTextContent",value:t},columnWidth:r}}},Qqe=gn.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",Ut(this.options.HTMLAttributes,e),0]}}),fX=Qqe.extend({name:"tableHeader",addProseMirrorPlugins(){return[cX.bind(this)()]}}),lU={fromPrismic(e){return function(t){const n=$C(e,fX.name),r=t.columnWidth?[t.columnWidth]:null;return n.create({colspan:1,rowspan:1,colwidth:r},t.content.value.flatMap(i=>oX(e,i)??[]))}},toPrismic(e){const t=[];e.content.forEach(i=>{const o=Fr.converter.toPrismic(i);fe.TextBlock.is(o)&&t.push(o)});const n=uX.parse(e.attrs),[r]=n.colwidth??[];return{type:"tableHeader",content:{__TYPE__:"StructuredTextContent",value:t},columnWidth:r}}},pX=gn.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",Ut(this.options.HTMLAttributes,e),0]}}),Hqe=pX.extend({name:"tableRow"}),cU={fromPrismic(e){return function(t){return $C(e,pX.name).create({},t.content.map(r=>{switch(r.type){case"tableHeader":return lU.fromPrismic(e)(r);case"tableCell":return sU.fromPrismic(e)(r)}}))}},toPrismic(e){const t=[];return e.content.forEach(n=>{switch(n.type.name){case"tableHeader":{t.push(lU.toPrismic(n));break}case"tableCell":{t.push(sU.toPrismic(n));break}}}),{type:"tableRow",content:t}}};class Yqe extends tX{constructor(t,n){const{node:r,editor:i}=t,{defaultCellMinWidth:o}=n;super(r,o);const a=document.createElement("div");a.classList.add(A.tableFieldStyles.tableWithControls);const s=document.createElement("div");s.classList.add(A.tableFieldStyles.tableOuterWrapper),s.appendChild(this.dom);const l=uU({editor:i,type:"column",onAfterCommand:()=>a.scrollLeft=a.scrollWidth,disabled:lc(i)});s.appendChild(l),a.appendChild(s);const c=uU({editor:i,type:"row",disabled:cc(i)});a.appendChild(c),this.dom=a,i.on("update",({editor:u})=>{c.disabled!==cc(u)&&(c.disabled=cc(u)),l.disabled!==lc(u)&&(l.disabled=lc(u))})}ignoreMutation(t){return t.target.closest(`.${A.tableFieldStyles.tableOuterWrapper}`)?super.ignoreMutation(t):!0}}function uU(e){const{type:t,editor:n,disabled:r,onAfterCommand:i}=e,o=Zn.capitalize(t),a=aX({title:`Add ${t}`,className:A.tableFieldStyles[`addTable${o}Button`],onClick:()=>{n.commands[`add${o}ToEnd`](),i==null||i()},disabled:r}),s=sX(A.rawAddIcon);return s&&a.appendChild(s),a}const my=Dqe.extend({name:"table",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),resizable:!0,defaultCellMinWidth:120}},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),addRowAfter:()=>t=>{var r,i,o;const{editor:n}=t;return cc(n)?!1:((o=(r=this.parent)==null?void 0:(i=r.call(this)).addRowAfter)==null?void 0:o.call(i)(t))??!1},addRowBefore:()=>t=>{var r,i,o;const{editor:n}=t;return cc(n)?!1:((o=(r=this.parent)==null?void 0:(i=r.call(this)).addRowBefore)==null?void 0:o.call(i)(t))??!1},addRowToEnd:()=>({dispatch:t,state:n,editor:r})=>{if(!ci(n)||cc(r))return!1;if(t){const i=Ri(n),o=i.map.height;t(nj(n.tr,i,o))}return!0},addColumnAfter:()=>t=>{var r,i,o;const{editor:n}=t;return lc(n)?!1:((o=(r=this.parent)==null?void 0:(i=r.call(this)).addColumnAfter)==null?void 0:o.call(i)(t))??!1},addColumnBefore:()=>t=>{var r,i,o;const{editor:n}=t;return lc(n)?!1:((o=(r=this.parent)==null?void 0:(i=r.call(this)).addColumnBefore)==null?void 0:o.call(i)(t))??!1},addColumnToEnd:()=>({dispatch:t,state:n,editor:r})=>{if(!ci(n)||lc(r))return!1;if(t){const i=Ri(n),o=i.map.width;t(tj(n.tr,i,o))}return!0}}},addNodeView(){return e=>new Yqe(e,this.options)},addKeyboardShortcuts(){var e;return{...(e=this.parent)==null?void 0:e.call(this),Backspace:()=>!1,"Mod-Backspace":()=>!1,Delete:()=>!1,"Mod-Delete":()=>!1}},addProseMirrorPlugins(){var t;return[...((t=this.parent)==null?void 0:t.call(this))||[],Gqe()]}});function Gqe(){return new dn({filterTransaction(e,t){for(const n of e.steps){const i=Jqe(t,n.from);if(i&&i.type.name===my.name)return!1}return!0}})}function Jqe(e,t){try{return e.doc.nodeAt(t)}catch{return null}}const Zqe={fromPrismic(e){return function(t){return $C(e,my.name).create({},t.content.map(cU.fromPrismic(e)))}},toPrismic(e){var n;const t=((n=e.content.firstChild)==null?void 0:n.type.name)===my.name?e.content.firstChild:e;return{type:"table",content:zs.children.map(t,r=>cU.toPrismic(r))}}},Xqe=new o4e([ac.table],ac.table,[my,Hqe,fX,dX],Zqe),hX=[qF,GF,LZ],AX=[...hX,JF];function mX(e){return Y6e(e)?[...hX,Fr,Xqe].filter(Qi.isDefined):[Fr,py,Ay,Wl.build(e),wZ,_Z,kZ,...AX].filter(Qi.isDefined)}const gX=[{nodeType:he.RichTextNodeType.paragraph,icon:"textFields",isActive:e=>e.isActive(Fr.name)&&!e.isActive(py.name)&&!e.isActive(Ay.name),runCommands:Wt((e,t)=>e.clearNodes().setDirection(Ki(t))),shortText:"par",text:"Paragraph"},{nodeType:he.RichTextNodeType.heading1,icon:"looks1",isActive:e=>e.isActive(Wl.name,{level:1}),runCommands:Wt((e,t)=>e.setHeading({level:1}).setDirection(Ki(t))),shortText:"h1",text:"Heading 1"},{nodeType:he.RichTextNodeType.heading2,icon:"looks2",isActive:e=>e.isActive(Wl.name,{level:2}),runCommands:Wt((e,t)=>e.setHeading({level:2}).setDirection(Ki(t))),shortText:"h2",text:"Heading 2"},{nodeType:he.RichTextNodeType.heading3,icon:"looks3",isActive:e=>e.isActive(Wl.name,{level:3}),runCommands:Wt((e,t)=>e.setHeading({level:3}).setDirection(Ki(t))),shortText:"h3",text:"Heading 3"},{nodeType:he.RichTextNodeType.heading4,icon:"looks4",isActive:e=>e.isActive(Wl.name,{level:4}),runCommands:Wt((e,t)=>e.setHeading({level:4}).setDirection(Ki(t))),shortText:"h4",text:"Heading 4"},{nodeType:he.RichTextNodeType.heading5,icon:"looks5",isActive:e=>e.isActive(Wl.name,{level:5}),runCommands:Wt((e,t)=>e.setHeading({level:5}).setDirection(Ki(t))),shortText:"h5",text:"Heading 5"},{nodeType:he.RichTextNodeType.heading6,icon:"looks6",isActive:e=>e.isActive(Wl.name,{level:6}),runCommands:Wt((e,t)=>e.setHeading({level:6}).setDirection(Ki(t))),shortText:"h6",text:"Heading 6"},{nodeType:he.RichTextNodeType.list,icon:"formatListBulleted",isActive:e=>e.isActive(py.name),runCommands:Wt((e,t)=>e.toggleBulletList().setDirection(Ki(t))),shortText:"bull",text:"Bulleted list"},{nodeType:he.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:e=>e.isActive(Ay.name),runCommands:Wt((e,t)=>e.toggleOrderedList().setDirection(Ki(t))),shortText:"num",text:"Numbered list"},{nodeType:he.RichTextNodeType.preformatted,icon:"dataObject",isActive:e=>e.isActive(wZ.name),runCommands:Wt((e,t)=>e.setCodeBlock().setDirection(Ki(t))),shortText:"code",text:"Code"},{nodeType:he.RichTextNodeType.embed,icon:"cloud",isActive:e=>e.isActive(_Z.name),runCommands:Wt(e=>e.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:he.RichTextNodeType.image,icon:"image",isActive:e=>e.isActive(kZ.name),runCommands:Wt(e=>e.setImage()),shortText:"img",text:"Image"}],e7e=[{nodeType:he.RichTextNodeType.strong,icon:"formatBold",isActive:e=>e.isActive(qF.name),runCommands:Wt(e=>e.toggleBold())},{nodeType:he.RichTextNodeType.em,icon:"formatItalic",isActive:e=>e.isActive(GF.name),runCommands:Wt(e=>e.toggleItalic())}],t7e=[{nodeType:he.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:e=>e.isActive({[ga]:Yl}),runCommands:Wt((e,t)=>e.toggleDirection(Ki(t)))}];function Wt(e){return(t,n={})=>{let r=n.can===!0?t.can().chain():t.chain().focus();return n.deleteRange!==void 0&&(r=r.deleteRange(n.deleteRange)),n.can?n7e(t,r,e):e(r,t).run()}}function Ki(e){const t=e.state.selection.$from.parent.attrs;return Ia.parseNodeAttrsDirection(t)}function dv(e,t){return e.filter(n=>t.includes(n.nodeType))}function n7e(e,t,n){try{return n(t,e).run()}catch{return!1}}function r7e(e){const{items:t,editor:n}=e;return t.length===0?null:d.jsxs(d.Fragment,{children:[t.map(r=>d.jsx(A.ToolbarToggleButton,{disabled:!r.runCommands(n,{can:!0}),onPressedChange:()=>{r.runCommands(n)},pressed:r.isActive(n),startIcon:r.icon},r.nodeType)),d.jsx(A.ToolbarSeparator,{})]})}function i7e(e){const{labels:t,editor:n}=e,r=n.getAttributes("label").label;return d.jsxs(d.Fragment,{children:[d.jsxs(A.DropdownMenu,{children:[d.jsx(A.DropdownMenuTrigger,{disabled:t.length===0,children:d.jsx(A.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:dU(r??"Labels")})}),d.jsx(A.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map((i,o)=>{const a=r===i;return d.jsx(A.DropdownMenuItem,{onSelect:()=>a?n.commands.unsetLabel():o7e(n,i),endIcon:a&&d.jsx(A.Icon,{name:"check",size:"extraSmall"}),children:dU(i)},`${i}-${o}`)})})]}),d.jsx(A.ToolbarSeparator,{})]})}function o7e(e,t){Wt(r=>r.setLabel({label:t}))(e)}function dU(e){return Zn.overflow(e,20)}function a7e(e){const{editor:t}=e,n=t.getAttributes("label");if(!n.label)return null;const r=n.label;return d.jsx(A.Box,{backgroundColor:"purple9",padding:{block:2,inline:4},alignItems:"center",borderRadius:{topLeft:2,topRight:2,bottomRight:2},maxWidth:125,children:d.jsx(A.Text,{color:"white",variant:"small",noWrap:!0,children:r})})}function s7e(e){const{disabled:t,showWebLinkModal:n,showDocumentsLinkModal:r,showMediaLinkModal:i}=l7e(e);return d.jsxs(d.Fragment,{children:[d.jsxs(A.ToolbarButtonGroup,{density:"compact",children:[d.jsx(A.ToolbarButton,{disabled:t,startIcon:"link",onClick:n},he.RichTextNodeType.hyperlink),d.jsxs(A.DropdownMenu,{children:[d.jsx(A.DropdownMenuTrigger,{children:d.jsx(A.ToolbarButton,{startIcon:"arrowDropDown"})}),d.jsxs(A.DropdownMenuContent,{align:"end",asPortal:!1,children:[d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:"public"}),onSelect:n,children:"Link to web page"}),d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:"description"}),onSelect:r,children:"Link to document"}),d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:"image"}),onSelect:i,children:"Link to media"})]})]})]}),d.jsx(A.ToolbarSeparator,{})]})}function l7e(e){const{editor:t,setModal:n}=e;function r(){n("webLink")}function i(){n("documentLink")}function o(){n("mediaLink")}return{disabled:!Wt(s=>s.setWebLink({href:""}))(t,{can:!0}),showWebLinkModal:r,showDocumentsLinkModal:i,showMediaLinkModal:o}}function c7e(e){const{docId:t,onEdit:n,onUnlink:r}=e,i=u7e(t),o=we();if(!i)return null;const a=i.versions[0],s=oF({status:a==null?void 0:a.status,releaseId:(a==null?void 0:a.status)==="release"?a.release_id:void 0,documentId:i.id,versionId:a==null?void 0:a.version_id,baseUrl:o.baseUrl}),l=(a==null?void 0:a.preview_summary)??"",c=(a==null?void 0:a.custom_type_label)??"";return d.jsx(xc,{url:s,title:i.title,subTitle:c,description:l,onEdit:n,onUnlink:r,largeIconName:"description"})}function u7e(e){const t=we();t.searchDocuments||mt("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return et.useRequest(Qm,[n,r,e])}function d7e(e){const{editor:t}=e,{searchDocuments:n}=we(),r=t.getAttributes(he.RichTextNodeType.hyperlink);if(r.id&&n){const i=r.id;return d.jsx(f7e,{docId:i,...e})}if(r.href){const i=r.href;return d.jsx(p7e,{url:i,...e})}if(r.media){const i=DZ(r.media);return d.jsx(h7e,{media:i,...e})}return null}function f7e(e){const{editor:t,onEditDocumentLink:n,docId:r}=e;return d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(xc,{title:"Failed to Load Linked Document Data",error:!0,onEdit:n,onUnlink:()=>uc(t)}),children:d.jsx(I.Suspense,{fallback:d.jsx(xc,{loading:!0,onEdit:n,onUnlink:()=>uc(t)}),children:d.jsx(c7e,{docId:r,onEdit:n,onUnlink:()=>uc(t)})})})}function p7e(e){const{url:t,editor:n,onEditWebLink:r}=e,i=ii.toURL(t);return i?d.jsx(xc,{url:t,title:ii.getUrlTitle(i),subTitle:t,onEdit:r,onUnlink:()=>uc(n)}):d.jsx(xc,{url:t,subTitle:t,onEdit:r,onUnlink:()=>uc(n)})}function h7e(e){const{media:t,editor:n,onEditMediaLink:r}=e;return fe.FilledImageLinkContent.is(t)?d.jsx(yY,{url:t.url,title:t.name,subTitle:`${t.width} x ${t.height} pixels`,onEdit:r,onUnlink:()=>uc(n)}):fe.FilledFileLinkContent.is(t)?d.jsx(xc,{url:t.url,title:t.name,subTitle:A7e({filename:t.name}),largeIconName:"insertDriveFile",onEdit:r,onUnlink:()=>uc(n)}):null}function uc(e){Wt(n=>n.unsetLink())(e)}function A7e(e){const{filename:t}=e,n=t.split(".").pop();return n?n.toLowerCase():""}function m7e(e){const{open:t}=e,{onOpenChange:n,onSelectDocument:r}=g7e(e);return d.jsx(AY,{open:t,onOpenChange:n,onSelectDocument:r})}function g7e(e){const{editor:t,setOpen:n}=e;function r(o){Wt(s=>s.extendMarkRange(he.RichTextNodeType.hyperlink).setDocumentLink({id:o}))(t),n(!1)}function i(o){n(o)}return{onSelectDocument:r,onOpenChange:i}}function v7e(e){const{open:t}=e,{onOpenChange:n,onMediaSelected:r}=y7e(e);return d.jsx(uF,{open:t,onOpenChange:n,onMediaSelected:r,assetType:"all"})}function y7e(e){const{editor:t,setOpen:n}=e;function r(i){Wt(a=>a.extendMarkRange(he.RichTextNodeType.hyperlink).setMediaLink({media:i}))(t),n(!1)}return{onMediaSelected:r,onOpenChange:n}}function b7e(e){const{open:t,setOpen:n}=e,{url:r,setUrl:i,openInNewTab:o,setOpenInNewTab:a,disabled:s,onUpdate:l}=C7e(e);return d.jsxs(A.Dialog,{open:t,onOpenChange:n,size:"small",noDescription:!0,children:[d.jsx(A.DialogHeader,{title:"Set Link URL"}),d.jsxs(A.DialogContent,{padding:16,children:[d.jsx(A.FormInput,{value:r,onValueChange:i,placeholder:"Paste URL",icon:"public"}),r&&d.jsx(A.InlineLabel,{value:"Open in new tab",children:d.jsx(A.Checkbox,{checked:o,onCheckedChange:a})})]}),d.jsxs(A.DialogActions,{children:[d.jsx(A.DialogCancelButton,{}),d.jsx(A.DialogActionButton,{onClick:l,disabled:s,children:"Update"})]})]})}function C7e(e){const{editor:t,open:n,setOpen:r}=e,i=S7e(t),[o,a]=I.useState(i.url),[s,l]=I.useState(i.openInNewTab);ze.useOnChange(n,()=>{n&&(a(i.url),l(i.openInNewTab))});const c=!o||o===i.url&&s===i.openInNewTab;function u(){const f=s?"_blank":"_self";Wt(p=>p.extendMarkRange(he.RichTextNodeType.hyperlink).setWebLink({href:o,target:f}))(t),r(!1)}return{url:o,setUrl:a,openInNewTab:s,disabled:c,setOpenInNewTab:l,onUpdate:u}}function S7e(e){const t=e.getAttributes(he.RichTextNodeType.hyperlink);return{url:t.href??"",openInNewTab:t.target==="_blank"}}function w7e(e){const{items:t,editor:n}=e;return t.length===0?null:d.jsxs(d.Fragment,{children:[d.jsx(A.ToolbarToggleButtonGroup,{onValueChange:r=>{t.forEach(i=>{(i.isActive(n)&&!r.includes(i.nodeType)||!i.isActive(n)&&r.includes(i.nodeType))&&i.runCommands(n)})},type:"multiple",value:t.filter(r=>r.isActive(n)).map(r=>r.nodeType),children:t.map(r=>d.jsx(A.ToolbarToggleButtonGroupItem,{disabled:!r.runCommands(n,{can:!0}),startIcon:r.icon,value:r.nodeType},r.nodeType))},"mark"),d.jsx(A.ToolbarSeparator,{})]})}function x7e(e){var r;const{items:t,editor:n}=e;return t.length===0?null:d.jsxs(d.Fragment,{children:[d.jsxs(A.DropdownMenu,{children:[d.jsx(A.DropdownMenuTrigger,{disabled:t.length===1,children:d.jsx(A.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:((r=t.find(i=>i.isActive(n)))==null?void 0:r.text)??""})}),d.jsx(A.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map(i=>d.jsx(A.DropdownMenuItem,{onSelect:()=>{i.runCommands(n)},children:i.text},i.nodeType))})]}),d.jsx(A.ToolbarSeparator,{})]})}function Ew(e){return{duration:100,hideOnClick:!0,offset:e,placement:"top-start",appendTo:document.querySelector("body > div")??"parent"}}function _7e(e){const{editor:t,nodeTypes:n,labels:r,hideDisabledOptions:i=!1}=e,[o,a]=I.useState(),s=n.includes(he.RichTextNodeType.hyperlink),l=!o,{shouldShowBubbleMenu:c,shouldshowPopover:u}=I7e({editor:t}),[f,p]=I.useState(!0);I.useEffect(()=>{p(!1)},[]);function h(y){a(y?"webLink":void 0)}function m(y){a(y?"documentLink":void 0)}function g(y){a(y?"mediaLink":void 0)}return f?null:d.jsxs(d.Fragment,{children:[d.jsx(hw,{editor:t,tippyOptions:Ew([-48,0]),shouldShow:c,children:l&&d.jsx(T7e,{editor:t,nodeTypes:n,labels:r,setModal:a,hideDisabledOptions:i})}),d.jsx(hw,{editor:t,tippyOptions:Ew([-48,0]),shouldShow:y=>u(y,"hyperlink"),children:l&&d.jsx(d7e,{editor:t,onEditWebLink:()=>a("webLink"),onEditDocumentLink:()=>a("documentLink"),onEditMediaLink:()=>a("mediaLink")})}),d.jsx(hw,{editor:t,tippyOptions:Ew([0,0]),shouldShow:y=>u(y,"label"),children:d.jsx(a7e,{editor:t})}),s&&d.jsxs(d.Fragment,{children:[d.jsx(b7e,{open:o==="webLink",setOpen:h,editor:t}),d.jsx(m7e,{open:o==="documentLink",setOpen:m,editor:t}),d.jsx(v7e,{open:o==="mediaLink",setOpen:g,editor:t})]})]})}function T7e(e){const{editor:t,nodeTypes:n,labels:r,setModal:i,hideDisabledOptions:o}=e,a=n.includes("hyperlink"),s=r.length>0,l=dv(gX,n),c=dv(e7e,n),u=dv(t7e,n),f=o&&l.length===1?0:l.length,p=f+c.length+u.length+Number(a);return p===0?null:d.jsxs(A.Toolbar,{children:[f>0&&d.jsx(x7e,{items:l,editor:t}),s&&d.jsx(i7e,{labels:r,editor:t}),d.jsx(w7e,{items:c,editor:t}),a&&d.jsx(s7e,{editor:t,setModal:i}),d.jsx(r7e,{items:u,editor:t}),p>1&&d.jsx(A.ToolbarButton,{onClick:()=>{t.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})}function I7e(e){const{editor:t}=e;function n(i){const{view:o,state:a,from:s,to:l}=i;if(!o.hasFocus())return!1;const{doc:c,selection:u}=a;return!(t.isActive(he.RichTextNodeType.preformatted)||u.empty||c.textBetween(s,l).length===0)}function r(i,o){const{view:a,state:s,from:l,to:c}=i,u=a.state.doc.nodeAt(l),{doc:f,selection:p}=s;return!p.empty||f.textBetween(l,c).length>0?!1:!!(u!=null&&u.marks.some(m=>m.type.name===o))}return{shouldShowBubbleMenu:n,shouldshowPopover:r}}const E7e=["id","data-state","aria-expanded","aria-controls","aria-haspopup"],vX=I.forwardRef(function(t,n){const{anchorElement:r,...i}=t;I.useEffect(()=>{if(r)for(const[a,s]of Object.entries(i))R7e(a,s)&&$7e(r,a,s)},[i,r]);function o(){!r||typeof n!="function"||n(r)}return d.jsx("div",{ref:o,style:{display:"none"}})});function R7e(e,t){return E7e.includes(e)?typeof t=="boolean"||typeof t=="number"||typeof t=="string":!1}function $7e(e,t,n){n!=null&&n!==""?e.setAttribute(t,n.toString()):e.removeAttribute(t)}const k7e=e=>{const t=e.state.selection.$head,n=t.node(-1);if(!n||n.type.name!=="tableRow")return!1;const r=t.node(-2);return!r||r.type.name!=="table"?!1:r.firstChild===n},yX=e=>{var r;const t=(r=Lu(e.state.selection))==null?void 0:r.node;if(!t||t.type.name!=="table")return!1;const n=t.firstChild;if(!n||n.type.name!=="tableRow")return!1;for(let i=0;i<n.childCount;i++){const o=n.child(i);if((o==null?void 0:o.type.name)!=="tableHeader")return!1}return!0},O7e=e=>iX(e)===1,M7e=e=>e.state.selection.$from.index(-1)===0,bX=e=>{var n;const t=(n=Lu(e.state.selection))==null?void 0:n.node;if(!t||t.type.name!=="table")return!1;for(let r=0;r<t.childCount;r++){const o=t.child(r).firstChild;if((o==null?void 0:o.type.name)!=="tableHeader")return!1}return!0},F7e=e=>rX(e)===1;function j7e(e){const{editor:t,open:n,onOpenChange:r,triggerElement:i}=e,o=bX(t),a=lc(t),s=F7e(t),l=M7e(t);function c(){const h=yX(t);t.commands.deleteColumn(),r==null||r(!1),s&&o&&(u(),h||t.commands.toggleHeaderRow())}function u(){t.commands.toggleHeaderColumn()}function f(){o&&l?t.chain().toggleHeaderColumn().addColumnBefore().toggleHeaderColumn().run():t.commands.addColumnBefore(),r==null||r(!1)}function p(){t.commands.addColumnAfter(),r==null||r(!1)}return d.jsxs(A.DropdownMenu,{open:n,onOpenChange:r,modal:!0,children:[d.jsx(A.DropdownMenuTrigger,{children:d.jsx(vX,{anchorElement:i})}),d.jsxs(A.DropdownMenuContent,{align:"start",side:"right",sideOffset:4,children:[d.jsx(A.DropdownMenuLabel,{children:d.jsx(A.Text,{color:"grey11",variant:"small",children:"Column options"})}),l&&d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:"viewDay"}),onSelect:u,disabled:s,children:d.jsxs(A.Box,{gap:12,alignItems:"center",children:["Header Column",d.jsx(A.Switch,{size:"extraSmall",checked:o})]})}),d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:"arrowBack"}),onSelect:f,disabled:a,children:"Insert Left"}),d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:"arrowForward"}),onSelect:p,disabled:a,children:"Insert Right"}),d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:"delete"}),onSelect:c,disabled:s,children:"Delete Column"})]})]})}function L7e(e){const{editor:t,open:n,onOpenChange:r,triggerElement:i}=e,o=yX(t),a=cc(t),s=O7e(t),l=k7e(t);function c(){const h=bX(t);t.commands.deleteRow(),r==null||r(!1),s&&o&&(u(),h||t.commands.toggleHeaderColumn())}function u(){t.commands.toggleHeaderRow()}function f(){o&&l?t.chain().toggleHeaderRow().addRowBefore().toggleHeaderRow().run():t.commands.addRowBefore(),r==null||r(!1)}function p(){t.commands.addRowAfter(),r==null||r(!1)}return d.jsxs(A.DropdownMenu,{open:n,onOpenChange:r,modal:!0,children:[d.jsx(A.DropdownMenuTrigger,{children:d.jsx(vX,{anchorElement:i})}),d.jsxs(A.DropdownMenuContent,{align:"start",side:"right",sideOffset:4,children:[d.jsx(A.DropdownMenuLabel,{children:d.jsx(A.Text,{color:"grey11",variant:"small",children:"Row options"})}),l&&d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:"viewDay"}),onSelect:u,disabled:s,children:d.jsxs(A.Box,{gap:12,alignItems:"center",children:[d.jsx(A.Text,{noWrap:!0,children:"Header row"}),d.jsx(A.Switch,{size:"extraSmall",checked:o})]})}),d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:"arrowUpward"}),onSelect:f,disabled:a,children:"Insert Above"}),d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:"arrowDownward"}),onSelect:p,disabled:a,children:"Insert Below"}),d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:"delete"}),onSelect:c,disabled:s,children:"Delete Row"})]})]})}function D7e(e){return d.jsxs(d.Fragment,{children:[d.jsx(U7e,{...e}),d.jsx(B7e,{...e})]})}function U7e(e){const{editor:t}=e,{triggerElement:n,open:r,onOpenChange:i}=CX("row",t);return d.jsx(L7e,{open:r,editor:t,triggerElement:n,onOpenChange:i})}function B7e(e){const{editor:t}=e,{triggerElement:n,open:r,onOpenChange:i}=CX("column",t);return d.jsx(j7e,{open:r,editor:t,triggerElement:n,onOpenChange:i})}function CX(e,t){const[n,r]=I.useState(),[i,o]=I.useState(!1);return I.useEffect(()=>kC.listen("handleClick",{editor:t,callback:a=>{a.type===e&&(r(a.referenceElement),setTimeout(()=>o(!0),0))}}),[t,e]),{open:i,onOpenChange:o,triggerElement:n}}function SX(e){const{content:t,field:n,id:r,readOnly:i,padding:o="normal",scroll:a="hidden",shouldReturnEmptyContent:s=!1}=e,l=P7e(n),c=t&&Wx.converter(l.nodeExtensions).fromPrismic(l.schema,l.nodeTypes,t),u=ze.useStableCallback(e.onContentChange),f=A.useEditor({content:c==null?void 0:c.toJSON(),editable:!i,editorProps:{attributes:{class:ZJ(o==="zero"?A.contentEditableNoPaddingClass:A.contentEditableClass,A.contentEditableMultilinePlaceholderClass),id:r,tabIndex:"0"}},extensions:l.allComponents,injectCSS:!1,onUpdate({editor:p}){if(p.isEmpty&&!s)return u(void 0);const h=Wx.converter(l.nodeExtensions).toPrismic(p.state.doc);u(h)}},[l,i]);return d.jsxs(A.Field,{display:a==="x-auto"?"grid":"flex",children:[d.jsx(A.FieldLabel,{htmlFor:r,children:_r(n)}),d.jsxs(A.FieldControl,{children:[f.isEditable&&d.jsx(_7e,{editor:f,nodeTypes:l.names,labels:l.labels,hideDisabledOptions:!0}),f.isEditable&&l.names.includes("table")&&d.jsx(D7e,{editor:f}),d.jsx(P6e,{editor:f,style:{width:"100%"}})]})]})}function P7e(e){var n,r;const t=`${((n=e.config)==null?void 0:n.multi)??""}-${((r=e.config)==null?void 0:r.single)??""}`;return I.useMemo(()=>{var m;const{extensions:i,nodeTypes:o}=s4e(e.config),a=i.filter(W7e),s=i.flatMap(g=>g.richTextNodeTypes);o.has(CD)&&s.push(CD);const l=i.flatMap(g=>g.component),c=i.filter(N7e).map(g=>g.name),u=[...l,...k9e(e,a),W4e.configure({supportedExtensionNames:c}),Z3e,z3e],f=u.map(g=>g.name),p=l3e(u),h=K7e((m=e.config)==null?void 0:m.labels);return{allComponents:u,extensionNames:f,nodeTypes:o,nodeExtensions:a,names:s,schema:p,labels:h}},[t])}function W7e(e){return e.extType===ju.Node}function N7e(e){return!(e.extType!==ju.Node||e.nodeType!==Hl.Text||e.lockedFormat)}function K7e(e){return Array.from(e??[])}function q7e(e){const{content:t,field:n,id:r,readOnly:i,onContentChange:o}=e,{placeholder:a,options:s}=n.config??{},l=!!(s!=null&&s.includes("")),c=Q7e(n),u=V7e({content:t,placeholder:a,defaultValue:c,canHaveEmptyValue:l}),f=a&&c===void 0||a===void 0&&!l;return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"arrowDropDownCircle"}),d.jsx(A.FieldLabel,{htmlFor:r,children:_r(n)}),d.jsx(A.FieldControl,{children:d.jsxs(A.Select,{id:r,size:"large",color:"grey",value:u,disabled:i,renderTrigger:()=>d.jsx(A.SelectGhostTrigger,{id:r}),onValueChange:p=>{o(z7e({value:p,placeholder:a}))},children:[f&&d.jsx(A.SelectItem,{value:a||gy,children:a||""}),s==null?void 0:s.map(p=>d.jsx(A.SelectItem,{value:p||gy,children:p},p))]})})]})}function V7e(e){const{content:t,placeholder:n,defaultValue:r,canHaveEmptyValue:i}=e;let{value:o}=t??{};return o===""&&i?gy:(o===""&&(o=void 0),o??r??n??"")}function z7e(e){const{placeholder:t}=e;let{value:n}=e;if(n!==t)return n===gy&&(n=""),{__TYPE__:"FieldContent",type:"Select",value:n}}function Q7e(e){var t,n;return((t=e.config)==null?void 0:t.default_value)===void 0||(n=e.config.options)==null?void 0:n[0]}const gy=" ",fU=wX(2,3),H7e={__TYPE__:"TableContent",content:wX(1,1)};function Y7e(e){const{field:t,content:n,onContentChange:r,...i}=e;function o(a){if(!a)return r(H7e);e.onContentChange(Z7e(a))}return d.jsx(SX,{...i,field:X7e(t),content:G7e(n),onContentChange:o,shouldReturnEmptyContent:!0,scroll:"x-auto",padding:"zero"})}function wX(e,t){return Array.from({length:e},()=>({type:"tableRow",content:Array.from({length:t},()=>({type:"tableCell",content:{__TYPE__:"StructuredTextContent",value:[{type:"paragraph",content:{text:""}}]}}))}))}function G7e(e){return{__TYPE__:"StructuredTextContent",value:[{type:"table",content:J7e(e)}]}}function J7e(e){const t=fe.TableContent.decode(e);return t._tag==="Left"||!t.right.content.some(r=>r.content.some(i=>i.content.value.some(({type:o})=>o)))?fU:t.right.content}function Z7e(e){return{__TYPE__:"TableContent",content:e.value.flatMap(t=>t.type==="table"?t.content:[])}}function X7e(e){var t;return{...he.TableCell,config:{...he.TableCell.config,label:(t=e.config)==null?void 0:t.label,allowTargetBlank:!0,multi:[he.TableCell.config.multi,ac.table].join(",")}}}function eVe(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=i!=null&&i.value?u_.dateFromISOString(i.value):void 0;return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"event"}),d.jsx(A.FieldLabel,{id:t,children:_r(r)}),d.jsx(A.FieldControl,{children:d.jsx(A.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:d.jsx(A.DateInput,{mode:"date-time","aria-labelledby":t,disabled:n,value:a,onValueChange:s=>o(tVe(s))})})})]})}function tVe(e){if(e)return{__TYPE__:"FieldContent",type:"Timestamp",value:nVe(e)}}function nVe(e){const t=`${e.getUTCFullYear()}`.padStart(4,"0"),n=`${e.getUTCMonth()+1}`.padStart(2,"0"),r=`${e.getUTCDate()}`.padStart(2,"0"),i=`${e.getUTCHours()}`.padStart(2,"0"),o=`${e.getUTCMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}T${i}:${o}:00+00:00`}function OC(e){const{id:t,readOnly:n,content:r,nestableWidget:i}=e,o=ze.useStableCallback(e.onContentChange);return I.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:o};return i.type==="Boolean"?d.jsx(TUe,{...a,field:i,content:fe.isBooleanContent(r)?r:void 0}):i.type==="Date"?d.jsx($Ue,{...a,field:i,content:fe.isDateContent(r)?r:void 0}):i.type==="Timestamp"?d.jsx(eVe,{...a,field:i,content:fe.isTimestampContent(r)?r:void 0}):i.type==="Image"?d.jsx(dPe,{...a,field:i,content:fe.isImageContent(r)?r:void 0}):i.type==="Link"?d.jsx(TPe,{...a,field:i,content:r}):i.type==="Number"?d.jsx(IPe,{...a,field:i,content:fe.isNumberContent(r)?r:void 0}):i.type==="StructuredText"?d.jsx(SX,{...a,field:i,content:fe.isRichTextContent(r)?r:void 0}):i.type==="Select"?d.jsx(q7e,{...a,field:i,content:fe.isSelectContent(r)?r:void 0}):i.type==="Text"?d.jsx(EY,{...a,field:i,content:fe.isTextContent(r)?r:void 0}):i.type==="Embed"?d.jsx(WUe,{...a,field:i,content:fe.isEmbedContent(r)?r:void 0}):i.type==="Color"?d.jsx(EUe,{...a,field:i,content:fe.isColorContent(r)?r:void 0}):i.type==="GeoPoint"?d.jsx(NUe,{...a,field:i,content:fe.isGeoPointContent(r)?r:void 0}):i.type==="IntegrationFields"?d.jsx(xPe,{...a,field:i,content:fe.isIntegrationFieldContent(r)?r:void 0}):i.type==="Table"?d.jsx(Y7e,{...a,field:i,content:fe.isTableContent(r)?r:void 0}):null},[r,t,i,o,n])}function rVe(e){const{content:t,id:n,nonRepeatableZone:r,onContentChange:i,readOnly:o}=e,a=I.useMemo(()=>Object.entries(r),[r]);return d.jsx(d.Fragment,{children:a.map(([s,l])=>{const c=t[s];return d.jsx(OC,{id:`${n}.${s}`,readOnly:o,nestableWidget:l,content:fe.isNestableContent(c)?c:void 0,onContentChange:u=>{i(iVe(t,s,u))}},s)})})}function iVe(e,t,n){return n?{...e,[t]:n}:Nd.removeKey(e,t)}function rj(e){var o,a;const{group:t,content:n,onContentChange:r,...i}=e;return d.jsx(SUe,{children:d.jsx(ij,{...i,title:l_(t),addItemButtonTitle:`Add item in "${l_(t)}"`,repeatable:((o=t.config)==null?void 0:o.repeat)!==!1,repeatableZone:((a=t.config)==null?void 0:a.fields)??{},content:n==null?void 0:n.value,onContentChange:s=>{r({__TYPE__:"GroupContentType",value:s})}})})}function l_(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}function xX(e){const{id:t,readOnly:n,content:r,widget:i}=e,o=ze.useStableCallback(e.onContentChange);return I.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:o};return i.type==="Group"?d.jsx(rj,{...a,group:i,content:fe.isGroupContent(r)?r:void 0}):d.jsx(OC,{...a,nestableWidget:i,content:fe.isNestableContent(r)?r:void 0})},[r,t,i,o,n])}function ij(e){const{id:t,title:n,addItemButtonTitle:r,content:i,onContentChange:o,readOnly:a,repeatable:s=!0,repeatableZone:l}=e,c=Object.entries(l);let u=i??[sVe];!s&&u.length>1&&(u=u.slice(0,1));const{scrollOffsetTop:f}=we(),p=I.useRef(new WeakMap);oVe(p.current,u);function h(x){return p.current.get(x)??"!bugged!"}function m(x){const b=c_();o(_t.insertAtIndex(u,x,b))}function g(x){const{index:b,offset:v}=x;o(_t.move(u,b,b+v))}function y(x){o(_t.removeIndex(u,x))}function C(x,b,v,S){const w=cVe(x,[v,S]),T=lVe(u,[b,w]);aVe(p.current,x,w),o(T)}return Object.keys(l).length===0?null:d.jsx(A.Group,{title:n??"Repeatable zone",addItemButtonTitle:r??"Add item in repeatable zone",items:u,maxItems:s?void 0:1,getItemKey:h,onAddItem:m,dnd:{scrollOffsetTop:f,onReorder:o,renderDragPreview:({index:x})=>d.jsx(uVe,{title:n??"Repeatable zone",index:x}),renderDropIndicator:dVe},children:(x,b)=>{const v=new Map(x.value),S=h(x);return d.jsx(A.LazyRender,{keepLoaded:!0,loadWhenSearching:!0,children:d.jsx(A.GroupItem,{index:b,title:`${b+1} • Item`,onMove:g,onDelete:y,children:c.map(([w,T])=>d.jsx(xX,{id:`${t}[${S}].${w}`,content:v.get(w),widget:T,onContentChange:E=>C(x,b,w,E),readOnly:a},w))})})}})}function oVe(e,t){t.forEach(n=>{e.has(n)||e.set(n,jX.uniqueNumber())})}function aVe(e,t,n){const r=e.get(t);r!==void 0&&e.set(n,r)}const sVe={__TYPE__:"GroupItemContent",value:[]};function lVe(e,t){const[n,r]=t;return r?e.map((i,o)=>o===n?r:i):e.filter((i,o)=>o!==n)}function cVe(e,t){const[n,r]=t;if(!r){const o=e.value.filter(([a])=>a!==n);return c_(o)}const i=Array.from(new Map(e.value).set(n,r));return c_(i)}function c_(e=[]){return{__TYPE__:"GroupItemContent",value:e}}function uVe(e){const{title:t,index:n}=e;return d.jsxs(A.Box,{padding:{block:8,inline:12},backgroundColor:"grey3",border:!0,borderRadius:6,alignItems:"center",justifyContent:"space-between",width:"100%",children:[d.jsxs("div",{children:[d.jsx(A.Text,{variant:"smallBold",color:"grey11",children:t??"Repeatable zone"}),d.jsxs(A.Text,{variant:"small",color:"grey11",children:[n+1," • Item"]})]}),d.jsx(A.Icon,{name:"dragIndicator",size:"small",color:"grey8"})]})}function dVe(e){const{isDropTarget:t,itemIndex:n,position:r}=e,i=t?d.jsx(A.Line,{color:"purple",thickness:2,sx:{position:"absolute",left:0,right:0,bottom:n===0&&r==="before"?0:void 0}},"line"):void 0;return d.jsx(A.AnimatedElement,{enterDuration:150,children:i})}function fVe(e){const{compositeSlice:t,content:n,onContentChange:r,sliceKey:i,id:o,readOnly:a,header:s}=e,l=lC();function c(){i&&l.update({id:i,requestedFrom:"sliceFieldSet"})}return d.jsxs(A.FieldSet,{id:i&&sC("sliceFieldSet",i),selected:i?l.isSelected(i):!1,onFocus:c,legend:pVe(t),header:s,children:[d.jsx(rVe,{id:o,readOnly:a,nonRepeatableZone:t["non-repeat"]??{},content:n.nonRepeat,onContentChange:u=>{r({...n,nonRepeat:u})}}),d.jsx(ij,{id:o,readOnly:a,repeatableZone:t.repeat??{},content:n.repeat,onContentChange:u=>{r({...n,repeat:u})}})]})}function pVe(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const _X={__TYPE__:"ImageContent",edit:{background:"",crop:{x:0,y:0},zoom:0},height:0,width:0,origin:{height:0,width:0,id:"",url:""},url:""};function hVe(e){const{field:t}=e;if(t.type==="Image")return _X}function AVe(e){const{content:t,legacySlice:n,sliceKey:r,id:i,readOnly:o,onContentChange:a,header:s}=e,l=lC();function c(){r&&l.update({id:r,requestedFrom:"sliceFieldSet"})}const u=n.type==="Group"?l_(n):_r(n);return d.jsx(A.FieldSet,{id:r&&sC("sliceFieldSet",r),selected:r?l.isSelected(r):!1,onFocus:c,legend:u,header:s,children:n.type==="Group"?d.jsx(rj,{id:i,readOnly:o,onContentChange:a,group:n,content:fe.isGroupContent(t)?t:void 0}):d.jsx(OC,{id:i,readOnly:o,nestableWidget:n,content:fe.isNestableContent(t)?t:void 0,onContentChange:f=>{const p=hVe({field:n});!f&&p&&a(p),f&&a(f)}})})}function mVe(e){const{content:t,id:n,slicePrimaryZone:r,onContentChange:i,readOnly:o}=e,a=I.useMemo(()=>Object.entries(r),[r]);return d.jsx(d.Fragment,{children:a.map(([s,l])=>{const c=t[s];return d.jsx(xX,{id:`${n}.${s}`,readOnly:o,widget:l,content:fe.isSlicePrimaryContent(c)?c:void 0,onContentChange:u=>{i(gVe(t,s,u))}},s)})})}function gVe(e,t,n){return n?{...e,[t]:n}:Nd.removeKey(e,t)}function TX(e){const{config:t,content:n,sliceKey:r,readOnly:i=!1,sharedSlice:o,onContentChange:a,...s}=e,l=vVe(o,n.variation),c=I.useId(),f={id:s.id??c,readOnly:i},p=lC();function h(){r&&p.update({id:r,requestedFrom:"sliceFieldSet"})}return l===void 0?null:d.jsx(by.Provider,{value:t,children:d.jsx(CUe,{children:d.jsxs(A.FieldSet,{id:r&&sC("sliceFieldSet",r),selected:r?p.isSelected(r):!1,onFocus:h,legend:yVe(o,l),children:[d.jsx(A.LazyRender,{heightEstimate:400,gap:16,keepLoaded:!0,loadWhenSearching:!0,children:d.jsx(mVe,{...f,slicePrimaryZone:l.primary??{},content:n.primary,onContentChange:m=>{a({...n,primary:m})}})}),d.jsx(ij,{...f,repeatableZone:l.items??{},content:n.items,onContentChange:m=>{a({...n,items:m})}})]})})})}function vVe(e,t){return I.useMemo(()=>e.variations.find(n=>n.id===t),[e,t])}function yVe(e,t){return[e.name,t.name].join(" • ")}function pU(e){var l,c;const{sliceZone:t,onChange:n,slices:r,sliceContent:i}=e,o=(c=(l=t.config)==null?void 0:l.labels)==null?void 0:c[i.name];if(!o)return null;const a=o.find(u=>u.name===i.maybeLabel);function s(u){const f=r.value.map(p=>p.key===i.key?{...p,maybeLabel:u}:p);n({...r,value:f})}return d.jsxs(d.Fragment,{children:[d.jsx(A.Text,{component:"span",variant:"smallBold",children:"•"}),d.jsxs(A.DropdownMenu,{children:[d.jsx(A.DropdownMenuTrigger,{children:d.jsx(A.Button,{color:"grey",size:"small",endIcon:"arrowDropDown",invisible:!0,children:(a==null?void 0:a.display)??"Slice variation"})}),d.jsxs(A.DropdownMenuContent,{align:"start",maxHeight:256,children:[d.jsx(A.DropdownMenuItem,{onSelect:()=>s(void 0),endIcon:i.maybeLabel===void 0?d.jsx(A.Icon,{name:"check"}):void 0,children:"..."}),o==null?void 0:o.map(u=>d.jsx(A.DropdownMenuItem,{onSelect:()=>s(u.name),endIcon:u.name===i.maybeLabel?d.jsx(A.Icon,{name:"check"}):void 0,children:u.display??"[Missing display value]"},u.name))]})]})]})}function bVe(e){const{content:t,id:n,onContentChange:r,readOnly:i,sliceZone:o}=e,a=we();return d.jsx(d.Fragment,{children:t==null?void 0:t.value.map((s,l)=>{var p,h;const c=(h=(p=o.config)==null?void 0:p.choices)==null?void 0:h[s.name];if(c===void 0)return null;const u=s.widget,f={id:`${n}[${s.key}]`,key:s.key,sliceKey:s.key,onContentChange:m=>{const g={...s,widget:m},y=CVe(t,[l,g]);r(y)},readOnly:i};return c.type==="SharedSlice"?fe.isSharedSliceContent(u)?d.jsx(TX,{...f,config:a,sharedSlice:c,content:u}):null:c.type==="Slice"?fe.isCompositeSliceContent(u)?d.jsx(fVe,{...f,compositeSlice:c,content:u,header:d.jsx(pU,{sliceContent:s,sliceZone:o,slices:t,onChange:r})}):null:fe.isSimpleSliceContent(u)?d.jsx(AVe,{...f,legacySlice:c,content:u,header:d.jsx(pU,{sliceContent:s,sliceZone:o,slices:t,onChange:r})}):null})})}function CVe(e,[t,n]){return{__TYPE__:"SliceContentType",value:e.value.map((r,i)=>i===t?n:r)}}function SVe(e){const{content:t,metadataFieldType:n,documentId:r,documentContent:i,documentCustomType:o,documentLocale:a,...s}=e,{showAlert:l}=A.useAlert(),[c,u]=I.useState(!1),f=we(),p=I.useMemo(()=>xQ(i,o),[i,o]),h=_Q(p);async function m(){if(!f.aiSeoMetadataEnabled)return;const{trackMetadataGeneration:g,authStrategy:y,documentBaseUrl:C,repository:x}=f;u(!0);try{const b=await wQ(x,C,y,{pageTextContent:p,contentLocale:a});e.onContentChange({__TYPE__:"FieldContent",type:"Text",value:b[n]}),g({documentId:r,locale:a,suggestion:b[n],type:n})}catch{l({id:n,title:"Error",subtitle:`Failed to generate SEO metadata for ${hU[n]}`})}u(!1)}return d.jsx(EY,{...s,content:t,placeholder:`${hU[n]}..`,endAdornment:d.jsxs(d.Fragment,{children:[d.jsx(YH,{type:n,value:(t==null?void 0:t.value)||""}),d.jsx(A.Tooltip,{content:h?"Generate SEO metadata from your page content.":"Your page content is too short to generate SEO metadata.",children:d.jsx(A.Button,{disabled:!h,onClick:m,size:"small",color:"grey",startIcon:"autoFixHigh",loading:c,sx:{alignSelf:"center",marginInline:8},children:"Generate"})})]})})}const hU={[ia]:"Meta title",[ps]:"Meta description"};function wVe(e){const{id:t,field:n,content:r,onContentChange:i}=e,o=ze.useDebounceState({state:(r==null?void 0:r.value)??"",synchronize:!0}),{onEditUID:a}=I.useContext(JH);function s(c){a();const u=Zn.slugify(c);i(TVe(u)),o.set(u)}function l(c){s(c.clipboardData.getData("Text").trim()),c.preventDefault()}return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"tag"}),d.jsx(A.FieldLabel,{htmlFor:t,children:_r(n)}),d.jsx(A.FieldControl,{children:d.jsx(Tl,{id:t,variant:"success",placeholder:Ou(n,"Enter a unique identifier"),value:o.value,onPaste:l,onValueChange:s,endAdornment:d.jsx(A.AnimatedElement,{enterDuration:150,children:d.jsx(xVe,{uid:o.debouncedValue})})})})]})}function xVe(e){const{uid:t}=e,n=we();return t?n.uidField?d.jsx(A.ErrorBoundary,{children:d.jsx(I.Suspense,{children:d.jsx(_Ve,{uid:t})})}):null:d.jsx(A.Badge,{color:"tomato",title:"Required",size:"medium"})}function _Ve(e){const t=IVe(e),n=we();if(!t.documentId)return null;const r=oF({status:t.status,releaseId:t.releaseId,documentId:t.documentId,versionId:t.versionId,baseUrl:n.baseUrl});return d.jsx("a",{href:r.href,target:"_blank",rel:"noreferrer",children:d.jsx(A.Badge,{color:"tomato",size:"medium",title:d.jsxs(A.Text,{color:"tomato11",variant:"small",children:["Value already used in"," ",d.jsx(A.Text,{color:"tomato11",variant:"small",underline:!0,children:"another document"})]})})})}function TVe(e){return e===""?void 0:{__TYPE__:"UIDContent",value:e}}function IVe(e){var p,h,m,g;const{uid:t}=e,n=we();n.uidField||mt("uidField");const{coreApiBaseUrl:r,authStrategy:i,customTypeId:o,localeId:a,documentId:s}=n,{data:l}=JM({baseUrl:r,authStrategy:i,uids:[t]}),c=l.results,f=XH({customTypeId:o,languageId:a,documentsWithUid:c,documentId:s,uid:t})[0];return f?{documentId:f.id,versionId:(p=f.versions[0])==null?void 0:p.version_id,status:(h=f.versions[0])==null?void 0:h.status,releaseId:((m=f.versions[0])==null?void 0:m.status)==="release"?(g=f.versions[0])==null?void 0:g.release_id:void 0}:{}}function EVe(e){const{id:t,readOnly:n,staticZone:r,content:i,onContentChange:o,documentId:a,documentContent:s,documentCustomType:l,documentLocale:c}=e,u=we(),f=I.useMemo(()=>Object.entries(r),[r]),p=I.useRef(i);if(I.useEffect(()=>{p.current=i},[i]),f.length===0)return null;const h=$Ve(f),m=Dv(i[ia])||"Meta title..",g=Dv(i[ps])||"Meta description..";return d.jsxs(A.FieldSet,{legend:"Page data",children:[h&&d.jsx(GH,{title:m,description:g}),f.map(([y,C])=>{const x={id:`${t}.${y}`,onContentChange:v=>{const{[y]:S,...w}=p.current;o({...w,...v!==void 0&&{[y]:v}})},readOnly:n},b=i[y];return C.type==="UID"?I.createElement(wVe,{...x,content:fe.isUIDContent(b)?b:void 0,key:y,field:C}):C.type==="Group"?I.createElement(rj,{...x,content:fe.isGroupContent(b)?b:void 0,group:C,key:y}):u.aiSeoMetadataEnabled&&RVe(y)&&C.type==="Text"?I.createElement(SVe,{...x,content:fe.isTextContent(b)?b:void 0,field:C,key:y,metadataFieldType:y,documentId:a,documentContent:s,documentCustomType:l,documentLocale:c}):I.createElement(OC,{...x,content:fe.isNestableContent(b)?b:void 0,key:y,nestableWidget:C})})]})}function RVe(e){return e===ia||e===ps}const $Ve=e=>{var t,n;return((t=e[0])==null?void 0:t[0])===ia&&((n=e[1])==null?void 0:n[0])===ps};function kVe(e){const{id:t,readOnly:n,section:r,content:i,onContentChange:o,documentId:a,documentContent:s,documentCustomType:l,documentLocale:c}=e,[u,f]=MVe(r),[p,h]=FVe(i);return d.jsxs("div",{style:{display:"flex",flexDirection:"column",position:"relative",zIndex:0},children:[d.jsx(EVe,{id:t,readOnly:n,staticZone:u,documentId:a,content:p,onContentChange:m=>o({...h,...m}),documentContent:s,documentCustomType:l,documentLocale:c}),f.map(([m,g])=>{const y=h[m];return d.jsx(bVe,{id:`${t}.${m}`,readOnly:n,sliceZone:g,content:y,onContentChange:C=>o({...p,...h,[m]:C})},m)})]})}function OVe(e){return e.type==="Choice"||e.type==="Slices"}function MVe(e){return Object.entries(e).reduce(([t,n],[r,i])=>(OVe(i)?n.push([r,i]):Object.assign(t,{[r]:i}),[t,n]),[{},[]])}function FVe(e){return Object.entries(e).reduce(([t,n],[r,i])=>{const o={[r]:i};return Object.assign(fe.isSlicesContent(i)?n:t,o),[t,n]},[{},{}])}function jVe(e){const{config:t,readOnly:n=!1,customType:r,sectionName:i,documentId:o,content:a,locale:s,onContentChange:l}=e,c=I.useId();if(Nd.isEmpty(r.json))return null;const u=LVe(r,i),[f,p]=DVe(u,a);return d.jsx(by.Provider,{value:t,children:d.jsx(bUe,{customTypeFormat:r.format,children:d.jsx(kVe,{id:c,readOnly:n,section:u,documentId:o,content:f,onContentChange:h=>l({...p,...h}),documentContent:a,documentCustomType:r,documentLocale:s})})})}function LVe(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function DVe(e,t){return Object.entries(t).reduce(([n,r],[i,o])=>{const a=e[i]!==void 0,s={[i]:o};return[{...n,...a?s:{}},{...r,...a?{}:s}]},[{},{}])}exports.APIExplorer=g2e;exports.DeferredCodeBlock=Uv;exports.DocumentEditor=jVe;exports.EditorConfigContext=by;exports.EditorErrorBoundary=S2e;exports.MediaLibrary=HH;exports.MetadataBadge=YH;exports.MetadataPreview=GH;exports.OnboardingGuide=dUe;exports.OnboardingStepId=Vje;exports.SelectionManagerProvider=gH;exports.SharedSliceEditor=TX;exports.SliceSelectionContext=eY;exports.TeamSpace=oC;exports.UIDContext=JH;exports.createSearchParams=jQ;exports.createTeamSpace=uLe;exports.defaultGroupContentWithOneItem=hH;exports.defaultImageContentWidget=_X;exports.deleteTeamSpace=fLe;exports.documentKeys=_o;exports.documentMetaSchema=YM;exports.documentSchema=Fje;exports.documentStatus=AH;exports.extractTextFromField=Dv;exports.fetchCustomTypes=wje;exports.frameworkCreateProjectCodeSnippet=gU;exports.frameworkLabels=mU;exports.generateSEOMetadata=wQ;exports.getConflictingUidDocuments=XH;exports.getCustomTypesOptions=zm;exports.getDocumentById=Qm;exports.getDocumentList=GM;exports.getDocumentListOptions=LQ;exports.getOnboarding=zje;exports.getPageTextContent=xQ;exports.getProfile=JQ;exports.getRepository=iC;exports.getRepositoryTags=NQ;exports.getRepositoryV2=qje;exports.getRoleLabel=Jje;exports.getRoles=QQ;exports.getRolesOptions=iLe;exports.getSliceSelectionDOMId=sC;exports.getTeamSpaces=HQ;exports.getTeamSpacesOptions=lLe;exports.hasUIDField=ZH;exports.invalidateCustomTypes=_je;exports.invalidateDocumentListData=Dje;exports.isAdminRole=Yje;exports.isDocumentSearchVersion=nx;exports.isDocumentVersion=kQ;exports.isMissingUID=gUe;exports.isPageContentRelevantForAISeo=_Q;exports.isValidSimulatorURL=WQ;exports.languageSchema=HM;exports.makeSearchFullTextDocumentsQueryString=FQ;exports.metaDescriptionConfig=Fh;exports.metaDescriptionProperty=ps;exports.metaTitleConfig=Mh;exports.metaTitleProperty=ia;exports.onboardingStateSchema=qQ;exports.onboardingToggleResultSchema=zQ;exports.onboardingToggleStepResultSchema=VQ;exports.prefetchCustomTypes=Sje;exports.prefetchStaticCustomType=Rje;exports.prepareDocumentForSave=v2e;exports.profileResponse=GQ;exports.repositoryFramework=rC;exports.repositorySchemaV2=KQ;exports.roleMap=ALe;exports.searchDocumentStatus=ax;exports.searchDocuments=DQ;exports.searchDocumentsQueryOptions=UQ;exports.searchFullTextDocuments=MQ;exports.sliceItemContentSchema=jje;exports.suppressErrors=Cte;exports.throwConfigError=mt;exports.toggleOnboarding=Hje;exports.toggleOnboardingStep=Qje;exports.updateDocumentListData=Lje;exports.updateRoles=oLe;exports.updateTeamSpace=dLe;exports.useCustomType=xje;exports.useCustomTypes=nC;exports.useDocumentList=JM;exports.useInvalidateRoles=aLe;exports.useInvalidateTeamSpaces=cLe;exports.useProfile=eF;exports.useSelectionManager=_l;exports.useSliceSelection=lC;exports.useStaticCustomType=Eje;