@solibo/solibo-ui 1.1.5 → 1.1.7

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 (43) hide show
  1. package/dist/assets/index25.css +1 -1
  2. package/dist/components/avatar/index.cjs +1 -1
  3. package/dist/components/avatar/index.cjs.map +1 -1
  4. package/dist/components/avatar/index.js +43 -45
  5. package/dist/components/avatar/index.js.map +1 -1
  6. package/dist/components/checkbox/index.cjs +1 -1
  7. package/dist/components/checkbox/index.js +1 -1
  8. package/dist/components/dropdown/index.cjs +1 -1
  9. package/dist/components/dropdown/index.js +3 -3
  10. package/dist/components/editor/index.cjs +2 -2
  11. package/dist/components/editor/index.cjs.map +1 -1
  12. package/dist/components/editor/index.js +2 -2
  13. package/dist/components/editor/index.js.map +1 -1
  14. package/dist/components/icon/index.cjs +1 -1
  15. package/dist/components/icon/index.js +1 -1
  16. package/dist/components/input/index.cjs +1 -1
  17. package/dist/components/input/index.js +2 -2
  18. package/dist/components/nav/index.cjs +1 -1
  19. package/dist/components/nav/index.js +1 -1
  20. package/dist/components/search/index.cjs +1 -1
  21. package/dist/components/search/index.js +1 -1
  22. package/dist/components/select/index.cjs +1 -1
  23. package/dist/components/select/index.js +2 -2
  24. package/dist/icons-Dv_p0bUF.cjs +2 -0
  25. package/dist/icons-Dv_p0bUF.cjs.map +1 -0
  26. package/dist/{icons-BpYV3Qdj.js → icons-dUP7sKyt.js} +3 -2
  27. package/dist/icons-dUP7sKyt.js.map +1 -0
  28. package/dist/{index-CfdjkXVw.cjs → index-5yOssOic.cjs} +2 -2
  29. package/dist/{index-CfdjkXVw.cjs.map → index-5yOssOic.cjs.map} +1 -1
  30. package/dist/{index-Dk9p49nt.cjs → index-CXaYq0By.cjs} +2 -2
  31. package/dist/{index-Dk9p49nt.cjs.map → index-CXaYq0By.cjs.map} +1 -1
  32. package/dist/{index-C9_dM53L.js → index-Cv6TtBnd.js} +2 -2
  33. package/dist/{index-C9_dM53L.js.map → index-Cv6TtBnd.js.map} +1 -1
  34. package/dist/{index-ky7bIz5x.js → index-CwIzKfBo.js} +2 -2
  35. package/dist/{index-ky7bIz5x.js.map → index-CwIzKfBo.js.map} +1 -1
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.d.ts +1 -0
  38. package/dist/index.js +2 -2
  39. package/dist/tokens.json +1 -1
  40. package/package.json +1 -1
  41. package/dist/icons-BpYV3Qdj.js.map +0 -1
  42. package/dist/icons-DTP9D75O.cjs +0 -2
  43. package/dist/icons-DTP9D75O.cjs.map +0 -1
@@ -1 +1 @@
1
- ._avatar_12qzb_1{--avatar-size: var(--scale-40);align-items:center;display:inline-flex;gap:var(--scale-8);margin:0 var(--scale-4)}:is(._color-1_12qzb_10,._color-solibo_12qzb_10) :is(._media_12qzb_10,._role_12qzb_10){background-color:var(--colors-semantic-roles-bg-solibo);color:var(--colors-semantic-roles-content-solibo)}:is(._color-2_12qzb_15,._color-board_12qzb_15) :is(._media_12qzb_10,._role_12qzb_10){background-color:var(--colors-semantic-roles-bg-board);color:var(--colors-semantic-roles-content-board)}:is(._color-3_12qzb_20,._color-owner_12qzb_20) :is(._media_12qzb_10,._role_12qzb_10){background-color:var(--colors-semantic-roles-bg-owner);color:var(--colors-semantic-roles-content-owner)}:is(._color-4_12qzb_25,._color-renter_12qzb_25) :is(._media_12qzb_10,._role_12qzb_10){background-color:var(--colors-semantic-roles-bg-renter);color:var(--colors-semantic-roles-content-renter)}:is(._color-5_12qzb_30,._color-external_12qzb_30) :is(._media_12qzb_10,._role_12qzb_10){background-color:var(--colors-semantic-roles-bg-external);color:var(--colors-semantic-roles-content-external)}._media_12qzb_10{align-items:center;background-color:var(--colors-semantic-interactive-disabled);border-radius:var(--shape-border-radius-radius-md);display:inline-flex;flex:0 0 var(--avatar-size);height:var(--avatar-size);justify-content:center;overflow:hidden;width:var(--avatar-size)}._media_12qzb_10>figure{align-items:center;display:flex;height:100%;justify-content:center;width:100%}._media_12qzb_10>figure>img{height:100%}._details_12qzb_59{display:flex;flex-direction:column;min-width:0}._details_12qzb_59>strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._secondary_12qzb_71{align-items:center;display:flex;gap:var(--scale-8);justify-content:space-between;min-width:0}._text_12qzb_79{color:var(--colors-semantic-content-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._role_12qzb_10,._role-name_12qzb_87{text-transform:capitalize}._role_12qzb_10{background-color:var(--colors-semantic-interactive-disabled);border-radius:var(--scale-32);color:var(--colors-semantic-content-secondary);display:block;overflow:hidden;padding:var(--shape-spacing-2xs) var(--shape-spacing-xs);text-overflow:ellipsis;white-space:nowrap;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}._initials_12qzb_103{font-weight:var(--font-font-weight-semibold)}._small_12qzb_107{--avatar-size: var(--scale-40)}._small_12qzb_107 ._initials_12qzb_103{font-size:var(--typography-font-sizes-label-sm)}._medium_12qzb_115{--avatar-size: var(--scale-56)}._medium_12qzb_115 ._details_12qzb_59{gap:var(--shape-spacing-xs)}._medium_12qzb_115 ._initials_12qzb_103{font-size:var(--typography-font-sizes-label-lg)}._large_12qzb_127{--avatar-size: var(--scale-96)}._large_12qzb_127 ._details_12qzb_59{gap:var(--shape-spacing-sm)}._large_12qzb_127 ._details_12qzb_59>strong{font-size:var(--typography-font-sizes-h3)}._large_12qzb_127 ._initials_12qzb_103{font-size:var(--typography-font-sizes-h3)}._large_12qzb_127 ._text_12qzb_79{font-size:var(--typography-font-sizes-label-lg)}._link_12qzb_147{text-decoration:none}._link_12qzb_147>._avatar_12qzb_1{background-color:transparent}
1
+ ._avatar_yz2kp_1{--avatar-size: var(--scale-40);align-items:center;display:inline-flex;gap:var(--scale-8);margin:0 var(--scale-4)}._avatar_yz2kp_1:has(._secondary_yz2kp_9){width:100%}:is(._color-1_yz2kp_14,._color-solibo_yz2kp_14) :is(._media_yz2kp_14,._role_yz2kp_14){background-color:var(--colors-semantic-roles-bg-solibo);color:var(--colors-semantic-roles-content-solibo)}:is(._color-2_yz2kp_19,._color-board_yz2kp_19) :is(._media_yz2kp_14,._role_yz2kp_14){background-color:var(--colors-semantic-roles-bg-board);color:var(--colors-semantic-roles-content-board)}:is(._color-3_yz2kp_24,._color-owner_yz2kp_24) :is(._media_yz2kp_14,._role_yz2kp_14){background-color:var(--colors-semantic-roles-bg-owner);color:var(--colors-semantic-roles-content-owner)}:is(._color-4_yz2kp_29,._color-renter_yz2kp_29) :is(._media_yz2kp_14,._role_yz2kp_14){background-color:var(--colors-semantic-roles-bg-renter);color:var(--colors-semantic-roles-content-renter)}:is(._color-5_yz2kp_34,._color-external_yz2kp_34) :is(._media_yz2kp_14,._role_yz2kp_14){background-color:var(--colors-semantic-roles-bg-external);color:var(--colors-semantic-roles-content-external)}._media_yz2kp_14{align-items:center;background-color:var(--colors-semantic-interactive-disabled);border-radius:var(--shape-border-radius-radius-md);display:inline-flex;flex:0 0 var(--avatar-size);height:var(--avatar-size);justify-content:center;overflow:hidden;width:var(--avatar-size)}._media_yz2kp_14>figure{align-items:center;display:flex;height:100%;justify-content:center;width:100%}._media_yz2kp_14>figure>img{height:100%}._details_yz2kp_63{display:flex;flex-direction:column;min-width:0;width:100%}._details_yz2kp_63>strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._secondary_yz2kp_9{align-items:center;display:flex;gap:var(--scale-8);justify-content:space-between;min-width:0;width:100%}._text_yz2kp_85{color:var(--colors-semantic-content-tertiary);font-size:var(--typography-font-sizes-label-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._role_yz2kp_14,._role-name_yz2kp_94{text-transform:capitalize}._role_yz2kp_14{background-color:var(--colors-semantic-interactive-disabled);border-radius:var(--scale-32);color:var(--colors-semantic-content-secondary);display:block;overflow:hidden;padding:var(--shape-spacing-2xs) var(--shape-spacing-xs);text-overflow:ellipsis;white-space:nowrap;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}._initials_yz2kp_110{font-weight:var(--font-font-weight-semibold)}._small_yz2kp_114{--avatar-size: var(--scale-40)}._small_yz2kp_114 ._initials_yz2kp_110{font-size:var(--typography-font-sizes-label-sm)}._medium_yz2kp_122{--avatar-size: var(--scale-56)}._medium_yz2kp_122 ._details_yz2kp_63{gap:var(--shape-spacing-xs)}._medium_yz2kp_122 ._initials_yz2kp_110{font-size:var(--typography-font-sizes-label-lg)}._large_yz2kp_134{--avatar-size: var(--scale-96)}._large_yz2kp_134 ._details_yz2kp_63{gap:var(--shape-spacing-sm)}._large_yz2kp_134 ._details_yz2kp_63>strong{font-size:var(--typography-font-sizes-h3)}._large_yz2kp_134 ._initials_yz2kp_110{font-size:var(--typography-font-sizes-h3)}._large_yz2kp_134 ._text_yz2kp_85{font-size:var(--typography-font-sizes-label-lg)}._link_yz2kp_154{text-decoration:none}._link_yz2kp_154>._avatar_yz2kp_1{background-color:transparent}@media (width <= 480px){._secondary_yz2kp_9{flex-direction:column;align-items:start}}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index25.css');const s=require("react/jsx-runtime"),x=require("../../classix-5H4IWnMA.cjs"),z=require("../figure/index.cjs"),q=require("../icon/index.cjs"),j=require("../link/index.cjs"),g="_avatar_12qzb_1",p="_media_12qzb_10",h="_role_12qzb_10",v="_details_12qzb_59",N="_secondary_12qzb_71",y="_text_12qzb_79",f="_initials_12qzb_103",k="_small_12qzb_107",A="_medium_12qzb_115",I="_large_12qzb_127",L="_link_12qzb_147",a={avatar:g,"color-1":"_color-1_12qzb_10","color-solibo":"_color-solibo_12qzb_10",media:p,role:h,"color-2":"_color-2_12qzb_15","color-board":"_color-board_12qzb_15","color-3":"_color-3_12qzb_20","color-owner":"_color-owner_12qzb_20","color-4":"_color-4_12qzb_25","color-renter":"_color-renter_12qzb_25","color-5":"_color-5_12qzb_30","color-external":"_color-external_12qzb_30",details:v,secondary:N,text:y,"role-name":"_role-name_12qzb_87",initials:f,small:k,medium:A,large:I,link:L},S={large:a.large,medium:a.medium,small:a.small},u={large:"large",medium:"medium",small:"medium"},$=i=>{const l=i.trim().split(/\s+/).filter(Boolean),c=Array.from(l[0]??"")[0]??"",t=l.length>1?Array.from(l[l.length-1])[0]:"";return`${c}${t}`.toLocaleUpperCase()},w=({accessibleLabel:i,color:l,icon:c,imageUrl:t,link:_,name:n,role:e,size:r="small",text:o})=>{const m=i||n||"User Avatar",d=n?$(n):"",b=s.jsxs("div",{className:x.t(a.avatar,S[r],l&&a[`color-${l}`]),"data-color":l,"data-size":r,children:[s.jsx("span",{className:a.media,children:s.jsx(z.Figure,{accessibleLabel:m,children:c?s.jsx(q.Icon,{name:c,size:u[r]}):t?s.jsx("img",{src:t,alt:m}):d?s.jsx("span",{"aria-hidden":"true",className:a.initials,children:d}):s.jsx(q.Icon,{name:"User",size:u[r]})})}),(n||e||o)&&s.jsxs("span",{className:a.details,children:[n&&s.jsx("strong",{children:n}),r==="small"&&(o||e)&&s.jsxs("span",{className:a.text,children:[o,o&&e&&" | ",e&&s.jsx("span",{className:a["role-name"],children:e})]}),r==="medium"&&s.jsxs("span",{className:a.secondary,children:[o&&s.jsx("span",{className:a.text,children:o}),e&&s.jsx("span",{className:a.role,children:e})]}),r==="large"&&e&&s.jsx("span",{className:a.role,children:e}),r==="large"&&o&&s.jsx("span",{className:a.text,children:o})]})]});return _?s.jsx(j.Link,{className:a.link,to:_,"data-component":"avatar",children:b}):b};exports.Avatar=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index25.css');const s=require("react/jsx-runtime"),u=require("../../classix-5H4IWnMA.cjs"),x=require("../figure/index.cjs"),y=require("../icon/index.cjs"),z=require("../link/index.cjs"),g="_avatar_yz2kp_1",j="_secondary_yz2kp_9",h="_media_yz2kp_14",v="_role_yz2kp_14",N="_details_yz2kp_63",b="_text_yz2kp_85",f="_initials_yz2kp_110",q="_small_yz2kp_114",A="_medium_yz2kp_122",I="_large_yz2kp_134",L="_link_yz2kp_154",a={avatar:g,secondary:j,"color-1":"_color-1_yz2kp_14","color-solibo":"_color-solibo_yz2kp_14",media:h,role:v,"color-2":"_color-2_yz2kp_19","color-board":"_color-board_yz2kp_19","color-3":"_color-3_yz2kp_24","color-owner":"_color-owner_yz2kp_24","color-4":"_color-4_yz2kp_29","color-renter":"_color-renter_yz2kp_29","color-5":"_color-5_yz2kp_34","color-external":"_color-external_yz2kp_34",details:N,text:b,"role-name":"_role-name_yz2kp_94",initials:f,small:q,medium:A,large:I,link:L},S={large:a.large,medium:a.medium,small:a.small},k={large:"large",medium:"medium",small:"medium"},$=i=>{const e=i.trim().split(/\s+/).filter(Boolean),c=Array.from(e[0]??"")[0]??"",t=e.length>1?Array.from(e[e.length-1])[0]:"";return`${c}${t}`.toLocaleUpperCase()},w=({accessibleLabel:i,color:e,icon:c,imageUrl:t,link:_,name:r,role:o,size:l="small",text:n})=>{const m=i||r||"User Avatar",d=r?$(r):"",p=s.jsxs("div",{className:u.t(a.avatar,S[l],e&&a[`color-${e}`]),"data-color":e,"data-size":l,children:[s.jsx("span",{className:a.media,children:s.jsx(x.Figure,{accessibleLabel:m,children:c?s.jsx(y.Icon,{name:c,size:k[l]}):t?s.jsx("img",{src:t,alt:m}):d?s.jsx("span",{"aria-hidden":"true",className:a.initials,children:d}):s.jsx(y.Icon,{name:"User",size:k[l]})})}),(r||o||n)&&s.jsxs("span",{className:a.details,children:[r&&s.jsx("strong",{children:r}),l==="small"&&(n||o)&&s.jsxs("span",{className:a.text,children:[n,n&&o&&" | ",o&&s.jsx("span",{className:a["role-name"],children:o})]}),(l==="medium"||l==="large")&&s.jsxs("span",{className:a.secondary,children:[n&&s.jsx("span",{className:a.text,children:n}),o&&s.jsx("span",{className:a.role,children:o})]})]})]});return _?s.jsx(z.Link,{className:a.link,to:_,"data-component":"avatar",children:p}):p};exports.Avatar=w;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/avatar/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { Figure } from '@/components/figure';\nimport { Icon, type IconProps } from '@/components/icon';\nimport { Link } from '@/components/link';\n\nimport styles from './styles.module.css';\n\nexport type AvatarColor =\n | 'solibo'\n | 'board'\n | 'owner'\n | 'renter'\n | 'external'\n | '1'\n | '2'\n | '3'\n | '4'\n | '5';\n\nexport type AvatarSize = 'small' | 'medium' | 'large';\n\nexport type AvatarProps = {\n accessibleLabel?: string;\n color?: AvatarColor;\n icon?: IconProps['name'];\n imageUrl?: string;\n link?: string;\n name?: string;\n role?: string;\n size?: AvatarSize;\n text?: string;\n};\n\nconst sizes: Record<AvatarSize, string> = {\n large: styles.large,\n medium: styles.medium,\n small: styles.small,\n};\n\nconst iconSizes: Record<AvatarSize, NonNullable<IconProps['size']>> = {\n large: 'large',\n medium: 'medium',\n small: 'medium',\n};\n\nconst getInitials = (name: string) => {\n const nameParts = name.trim().split(/\\s+/).filter(Boolean);\n const firstInitial = Array.from(nameParts[0] ?? '')[0] ?? '';\n const lastInitial = nameParts.length > 1 ? Array.from(nameParts[nameParts.length - 1])[0] : '';\n\n return `${firstInitial}${lastInitial}`.toLocaleUpperCase();\n};\n\nexport const Avatar = ({\n accessibleLabel,\n color,\n icon,\n imageUrl,\n link,\n name,\n role,\n size = 'small',\n text,\n}: AvatarProps) => {\n const avatarLabel = accessibleLabel || name || 'User Avatar';\n const initials = name ? getInitials(name) : '';\n\n const avatarFigure = (\n <div\n className={cx(styles.avatar, sizes[size], color && styles[`color-${color}`])}\n data-color={color}\n data-size={size}\n >\n <span className={styles.media}>\n <Figure accessibleLabel={avatarLabel}>\n {icon ? (\n <Icon\n name={icon}\n size={iconSizes[size]}\n />\n ) : imageUrl ? (\n <img\n src={imageUrl}\n alt={avatarLabel}\n />\n ) : initials ? (\n <span\n aria-hidden='true'\n className={styles.initials}\n >\n {initials}\n </span>\n ) : (\n <Icon\n name='User'\n size={iconSizes[size]}\n />\n )}\n </Figure>\n </span>\n {(name || role || text) && (\n <span className={styles.details}>\n {name && <strong>{name}</strong>}\n {size === 'small' && (text || role) && (\n <span className={styles.text}>\n {text}\n {text && role && ' | '}\n {role && <span className={styles['role-name']}>{role}</span>}\n </span>\n )}\n {size === 'medium' && (\n <span className={styles.secondary}>\n {text && <span className={styles.text}>{text}</span>}\n {role && <span className={styles.role}>{role}</span>}\n </span>\n )}\n {size === 'large' && role && <span className={styles.role}>{role}</span>}\n {size === 'large' && text && <span className={styles.text}>{text}</span>}\n </span>\n )}\n </div>\n );\n\n return link ? (\n <Link\n className={styles.link}\n to={link}\n >\n {avatarFigure}\n </Link>\n ) : (\n avatarFigure\n );\n};\n"],"names":["sizes","large","styles","medium","small","iconSizes","getInitials","name","nameParts","trim","split","filter","Boolean","firstInitial","Array","from","lastInitial","length","toLocaleUpperCase","Avatar","accessibleLabel","color","icon","imageUrl","link","role","size","text","avatarLabel","initials","avatarFigure","cx","avatar","jsx","media","Figure","Icon","details","jsxs","secondary","Link"],"mappings":"w8BAkCMA,EAAoC,CACxCC,MAAOC,EAAOD,MACdE,OAAQD,EAAOC,OACfC,MAAOF,EAAOE,KAChB,EAEMC,EAAgE,CACpEJ,MAAO,QACPE,OAAQ,SACRC,MAAO,QACT,EAEME,EAAeC,GAAiB,CACpC,MAAMC,EAAYD,EAAKE,KAAAA,EAAOC,MAAM,KAAK,EAAEC,OAAOC,OAAO,EACnDC,EAAeC,MAAMC,KAAKP,EAAU,CAAC,GAAK,EAAE,EAAE,CAAC,GAAK,GACpDQ,EAAcR,EAAUS,OAAS,EAAIH,MAAMC,KAAKP,EAAUA,EAAUS,OAAS,CAAC,CAAC,EAAE,CAAC,EAAI,GAE5F,MAAO,GAAGJ,CAAY,GAAGG,CAAW,GAAGE,kBAAAA,CACzC,EAEaC,EAASA,CAAC,CACrBC,gBAAAA,EACAC,MAAAA,EACAC,KAAAA,EACAC,SAAAA,EACAC,KAAAA,EACAjB,KAAAA,EACAkB,KAAAA,EACAC,KAAAA,EAAO,QACPC,KAAAA,CACW,IAAM,CACjB,MAAMC,EAAcR,GAAmBb,GAAQ,cACzCsB,EAAWtB,EAAOD,EAAYC,CAAI,EAAI,GAEtCuB,SACH,MAAA,CACC,UAAWC,EAAAA,EAAG7B,EAAO8B,OAAQhC,EAAM0B,CAAI,EAAGL,GAASnB,EAAO,SAASmB,CAAK,EAAE,CAAC,EAC3E,aAAYA,EACZ,YAAWK,EAEX,SAAA,CAAAO,EAAAA,IAAC,OAAA,CAAK,UAAW/B,EAAOgC,MACtB,eAACC,EAAAA,OAAA,CAAO,gBAAiBP,EACtBN,SAAAA,EACCW,EAAAA,IAACG,QACC,KAAMd,EACN,KAAMjB,EAAUqB,CAAI,EAAE,EAEtBH,QACD,MAAA,CACC,IAAKA,EACL,IAAKK,EAAY,EAEjBC,EACFI,EAAAA,IAAC,QACC,cAAY,OACZ,UAAW/B,EAAO2B,SAEjBA,WACH,EAEAI,EAAAA,IAACG,EAAAA,MACC,KAAK,OACL,KAAM/B,EAAUqB,CAAI,EAAE,CAAA,CAG5B,CAAA,CACF,GACEnB,GAAQkB,GAAQE,WACf,OAAA,CAAK,UAAWzB,EAAOmC,QACrB9B,SAAAA,CAAAA,GAAQ0B,EAAAA,IAAC,UAAQ1B,SAAAA,CAAAA,CAAK,EACtBmB,IAAS,UAAYC,GAAQF,WAC3B,OAAA,CAAK,UAAWvB,EAAOyB,KACrBA,SAAAA,CAAAA,EACAA,GAAQF,GAAQ,MAChBA,GAAQQ,EAAAA,IAAC,OAAA,CAAK,UAAW/B,EAAO,WAAW,EAAIuB,SAAAA,CAAAA,CAAK,CAAA,EACvD,EAEDC,IAAS,UACRY,EAAAA,KAAC,OAAA,CAAK,UAAWpC,EAAOqC,UACrBZ,SAAAA,CAAAA,GAAQM,EAAAA,IAAC,OAAA,CAAK,UAAW/B,EAAOyB,KAAOA,SAAAA,EAAK,EAC5CF,GAAQQ,EAAAA,IAAC,OAAA,CAAK,UAAW/B,EAAOuB,KAAOA,SAAAA,CAAAA,CAAK,CAAA,EAC/C,EAEDC,IAAS,SAAWD,GAAQQ,EAAAA,IAAC,QAAK,UAAW/B,EAAOuB,KAAOA,SAAAA,CAAAA,CAAK,EAChEC,IAAS,SAAWC,GAAQM,EAAAA,IAAC,QAAK,UAAW/B,EAAOyB,KAAOA,SAAAA,CAAAA,CAAK,CAAA,CAAA,CACnE,CAAA,EAEJ,EAGF,OAAOH,EACLS,EAAAA,IAACO,EAAAA,KAAA,CACC,UAAWtC,EAAOsB,KAClB,GAAIA,EAAK,iBAAA,SAERM,SAAAA,CAAAA,CACH,EAEAA,CAEJ"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/avatar/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { Figure } from '@/components/figure';\nimport { Icon, type IconProps } from '@/components/icon';\nimport { Link } from '@/components/link';\n\nimport styles from './styles.module.css';\n\nexport type AvatarColor =\n | 'solibo'\n | 'board'\n | 'owner'\n | 'renter'\n | 'external'\n | '1'\n | '2'\n | '3'\n | '4'\n | '5';\n\nexport type AvatarSize = 'small' | 'medium' | 'large';\n\nexport type AvatarProps = {\n accessibleLabel?: string;\n color?: AvatarColor;\n icon?: IconProps['name'];\n imageUrl?: string;\n link?: string;\n name?: string;\n role?: string;\n size?: AvatarSize;\n text?: string;\n};\n\nconst sizes: Record<AvatarSize, string> = {\n large: styles.large,\n medium: styles.medium,\n small: styles.small,\n};\n\nconst iconSizes: Record<AvatarSize, NonNullable<IconProps['size']>> = {\n large: 'large',\n medium: 'medium',\n small: 'medium',\n};\n\nconst getInitials = (name: string) => {\n const nameParts = name.trim().split(/\\s+/).filter(Boolean);\n const firstInitial = Array.from(nameParts[0] ?? '')[0] ?? '';\n const lastInitial = nameParts.length > 1 ? Array.from(nameParts[nameParts.length - 1])[0] : '';\n\n return `${firstInitial}${lastInitial}`.toLocaleUpperCase();\n};\n\nexport const Avatar = ({\n accessibleLabel,\n color,\n icon,\n imageUrl,\n link,\n name,\n role,\n size = 'small',\n text,\n}: AvatarProps) => {\n const avatarLabel = accessibleLabel || name || 'User Avatar';\n const initials = name ? getInitials(name) : '';\n\n const avatarFigure = (\n <div\n className={cx(styles.avatar, sizes[size], color && styles[`color-${color}`])}\n data-color={color}\n data-size={size}\n >\n <span className={styles.media}>\n <Figure accessibleLabel={avatarLabel}>\n {icon ? (\n <Icon\n name={icon}\n size={iconSizes[size]}\n />\n ) : imageUrl ? (\n <img\n src={imageUrl}\n alt={avatarLabel}\n />\n ) : initials ? (\n <span\n aria-hidden='true'\n className={styles.initials}\n >\n {initials}\n </span>\n ) : (\n <Icon\n name='User'\n size={iconSizes[size]}\n />\n )}\n </Figure>\n </span>\n {(name || role || text) && (\n <span className={styles.details}>\n {name && <strong>{name}</strong>}\n {size === 'small' && (text || role) && (\n <span className={styles.text}>\n {text}\n {text && role && ' | '}\n {role && <span className={styles['role-name']}>{role}</span>}\n </span>\n )}\n {(size === 'medium' || size === 'large') && (\n <span className={styles.secondary}>\n {text && <span className={styles.text}>{text}</span>}\n {role && <span className={styles.role}>{role}</span>}\n </span>\n )}\n </span>\n )}\n </div>\n );\n\n return link ? (\n <Link\n className={styles.link}\n to={link}\n >\n {avatarFigure}\n </Link>\n ) : (\n avatarFigure\n );\n};\n"],"names":["sizes","large","styles","medium","small","iconSizes","getInitials","name","nameParts","trim","split","filter","Boolean","firstInitial","Array","from","lastInitial","length","toLocaleUpperCase","Avatar","accessibleLabel","color","icon","imageUrl","link","role","size","text","avatarLabel","initials","avatarFigure","cx","avatar","jsx","media","Figure","Icon","details","secondary","Link"],"mappings":"u8BAkCMA,EAAoC,CACxCC,MAAOC,EAAOD,MACdE,OAAQD,EAAOC,OACfC,MAAOF,EAAOE,KAChB,EAEMC,EAAgE,CACpEJ,MAAO,QACPE,OAAQ,SACRC,MAAO,QACT,EAEME,EAAeC,GAAiB,CACpC,MAAMC,EAAYD,EAAKE,KAAAA,EAAOC,MAAM,KAAK,EAAEC,OAAOC,OAAO,EACnDC,EAAeC,MAAMC,KAAKP,EAAU,CAAC,GAAK,EAAE,EAAE,CAAC,GAAK,GACpDQ,EAAcR,EAAUS,OAAS,EAAIH,MAAMC,KAAKP,EAAUA,EAAUS,OAAS,CAAC,CAAC,EAAE,CAAC,EAAI,GAE5F,MAAO,GAAGJ,CAAY,GAAGG,CAAW,GAAGE,kBAAAA,CACzC,EAEaC,EAASA,CAAC,CACrBC,gBAAAA,EACAC,MAAAA,EACAC,KAAAA,EACAC,SAAAA,EACAC,KAAAA,EACAjB,KAAAA,EACAkB,KAAAA,EACAC,KAAAA,EAAO,QACPC,KAAAA,CACW,IAAM,CACjB,MAAMC,EAAcR,GAAmBb,GAAQ,cACzCsB,EAAWtB,EAAOD,EAAYC,CAAI,EAAI,GAEtCuB,SACH,MAAA,CACC,UAAWC,EAAAA,EAAG7B,EAAO8B,OAAQhC,EAAM0B,CAAI,EAAGL,GAASnB,EAAO,SAASmB,CAAK,EAAE,CAAC,EAC3E,aAAYA,EACZ,YAAWK,EAEX,SAAA,CAAAO,EAAAA,IAAC,OAAA,CAAK,UAAW/B,EAAOgC,MACtB,eAACC,EAAAA,OAAA,CAAO,gBAAiBP,EACtBN,SAAAA,EACCW,EAAAA,IAACG,QACC,KAAMd,EACN,KAAMjB,EAAUqB,CAAI,EAAE,EAEtBH,QACD,MAAA,CACC,IAAKA,EACL,IAAKK,EAAY,EAEjBC,EACFI,EAAAA,IAAC,QACC,cAAY,OACZ,UAAW/B,EAAO2B,SAEjBA,WACH,EAEAI,EAAAA,IAACG,EAAAA,MACC,KAAK,OACL,KAAM/B,EAAUqB,CAAI,EAAE,CAAA,CAG5B,CAAA,CACF,GACEnB,GAAQkB,GAAQE,WACf,OAAA,CAAK,UAAWzB,EAAOmC,QACrB9B,SAAAA,CAAAA,GAAQ0B,EAAAA,IAAC,UAAQ1B,SAAAA,CAAAA,CAAK,EACtBmB,IAAS,UAAYC,GAAQF,WAC3B,OAAA,CAAK,UAAWvB,EAAOyB,KACrBA,SAAAA,CAAAA,EACAA,GAAQF,GAAQ,MAChBA,GAAQQ,EAAAA,IAAC,OAAA,CAAK,UAAW/B,EAAO,WAAW,EAAIuB,SAAAA,CAAAA,CAAK,CAAA,EACvD,GAEAC,IAAS,UAAYA,IAAS,iBAC7B,OAAA,CAAK,UAAWxB,EAAOoC,UACrBX,SAAAA,CAAAA,GAAQM,EAAAA,IAAC,OAAA,CAAK,UAAW/B,EAAOyB,KAAOA,SAAAA,EAAK,EAC5CF,GAAQQ,EAAAA,IAAC,OAAA,CAAK,UAAW/B,EAAOuB,KAAOA,SAAAA,CAAAA,CAAK,CAAA,CAAA,CAC/C,CAAA,CAAA,CAEJ,CAAA,EAEJ,EAGF,OAAOD,EACLS,EAAAA,IAACM,EAAAA,KAAA,CACC,UAAWrC,EAAOsB,KAClB,GAAIA,EAAK,iBAAA,SAERM,SAAAA,CAAAA,CACH,EAEAA,CAEJ"}
@@ -1,32 +1,32 @@
1
1
  import { jsx as l, jsxs as i } from "react/jsx-runtime";
2
2
  import { t as h } from "../../classix-DG18itHa.js";
3
3
  import { Figure as g } from "../figure/index.js";
4
- import { Icon as p } from "../icon/index.js";
4
+ import { Icon as k } from "../icon/index.js";
5
5
  import { Link as u } from "../link/index.js";
6
- import '../../assets/index25.css';const N = "_avatar_12qzb_1", v = "_media_12qzb_10", f = "_role_12qzb_10", y = "_details_12qzb_59", k = "_secondary_12qzb_71", x = "_text_12qzb_79", A = "_initials_12qzb_103", I = "_small_12qzb_107", L = "_medium_12qzb_115", $ = "_large_12qzb_127", j = "_link_12qzb_147", a = {
7
- avatar: N,
8
- "color-1": "_color-1_12qzb_10",
9
- "color-solibo": "_color-solibo_12qzb_10",
10
- media: v,
11
- role: f,
12
- "color-2": "_color-2_12qzb_15",
13
- "color-board": "_color-board_12qzb_15",
14
- "color-3": "_color-3_12qzb_20",
15
- "color-owner": "_color-owner_12qzb_20",
16
- "color-4": "_color-4_12qzb_25",
17
- "color-renter": "_color-renter_12qzb_25",
18
- "color-5": "_color-5_12qzb_30",
19
- "color-external": "_color-external_12qzb_30",
20
- details: y,
21
- secondary: k,
22
- text: x,
23
- "role-name": "_role-name_12qzb_87",
24
- initials: A,
25
- small: I,
26
- medium: L,
27
- large: $,
28
- link: j
29
- }, w = {
6
+ import '../../assets/index25.css';const v = "_avatar_yz2kp_1", N = "_secondary_yz2kp_9", f = "_media_yz2kp_14", b = "_role_yz2kp_14", x = "_details_yz2kp_63", A = "_text_yz2kp_85", I = "_initials_yz2kp_110", L = "_small_yz2kp_114", $ = "_medium_yz2kp_122", j = "_large_yz2kp_134", w = "_link_yz2kp_154", a = {
7
+ avatar: v,
8
+ secondary: N,
9
+ "color-1": "_color-1_yz2kp_14",
10
+ "color-solibo": "_color-solibo_yz2kp_14",
11
+ media: f,
12
+ role: b,
13
+ "color-2": "_color-2_yz2kp_19",
14
+ "color-board": "_color-board_yz2kp_19",
15
+ "color-3": "_color-3_yz2kp_24",
16
+ "color-owner": "_color-owner_yz2kp_24",
17
+ "color-4": "_color-4_yz2kp_29",
18
+ "color-renter": "_color-renter_yz2kp_29",
19
+ "color-5": "_color-5_yz2kp_34",
20
+ "color-external": "_color-external_yz2kp_34",
21
+ details: x,
22
+ text: A,
23
+ "role-name": "_role-name_yz2kp_94",
24
+ initials: I,
25
+ small: L,
26
+ medium: $,
27
+ large: j,
28
+ link: w
29
+ }, F = {
30
30
  large: a.large,
31
31
  medium: a.medium,
32
32
  small: a.small
@@ -34,38 +34,36 @@ import '../../assets/index25.css';const N = "_avatar_12qzb_1", v = "_media_12qzb
34
34
  large: "large",
35
35
  medium: "medium",
36
36
  small: "medium"
37
- }, F = (_) => {
38
- const o = _.trim().split(/\s+/).filter(Boolean), c = Array.from(o[0] ?? "")[0] ?? "", t = o.length > 1 ? Array.from(o[o.length - 1])[0] : "";
39
- return `${c}${t}`.toLocaleUpperCase();
37
+ }, U = (_) => {
38
+ const o = _.trim().split(/\s+/).filter(Boolean), t = Array.from(o[0] ?? "")[0] ?? "", c = o.length > 1 ? Array.from(o[o.length - 1])[0] : "";
39
+ return `${t}${c}`.toLocaleUpperCase();
40
40
  }, D = ({
41
41
  accessibleLabel: _,
42
42
  color: o,
43
- icon: c,
44
- imageUrl: t,
43
+ icon: t,
44
+ imageUrl: c,
45
45
  link: m,
46
- name: n,
46
+ name: e,
47
47
  role: r,
48
48
  size: s = "small",
49
- text: e
49
+ text: n
50
50
  }) => {
51
- const d = _ || n || "User Avatar", b = n ? F(n) : "", q = /* @__PURE__ */ i("div", { className: h(a.avatar, w[s], o && a[`color-${o}`]), "data-color": o, "data-size": s, children: [
52
- /* @__PURE__ */ l("span", { className: a.media, children: /* @__PURE__ */ l(g, { accessibleLabel: d, children: c ? /* @__PURE__ */ l(p, { name: c, size: z[s] }) : t ? /* @__PURE__ */ l("img", { src: t, alt: d }) : b ? /* @__PURE__ */ l("span", { "aria-hidden": "true", className: a.initials, children: b }) : /* @__PURE__ */ l(p, { name: "User", size: z[s] }) }) }),
53
- (n || r || e) && /* @__PURE__ */ i("span", { className: a.details, children: [
54
- n && /* @__PURE__ */ l("strong", { children: n }),
55
- s === "small" && (e || r) && /* @__PURE__ */ i("span", { className: a.text, children: [
56
- e,
57
- e && r && " | ",
51
+ const d = _ || e || "User Avatar", p = e ? U(e) : "", y = /* @__PURE__ */ i("div", { className: h(a.avatar, F[s], o && a[`color-${o}`]), "data-color": o, "data-size": s, children: [
52
+ /* @__PURE__ */ l("span", { className: a.media, children: /* @__PURE__ */ l(g, { accessibleLabel: d, children: t ? /* @__PURE__ */ l(k, { name: t, size: z[s] }) : c ? /* @__PURE__ */ l("img", { src: c, alt: d }) : p ? /* @__PURE__ */ l("span", { "aria-hidden": "true", className: a.initials, children: p }) : /* @__PURE__ */ l(k, { name: "User", size: z[s] }) }) }),
53
+ (e || r || n) && /* @__PURE__ */ i("span", { className: a.details, children: [
54
+ e && /* @__PURE__ */ l("strong", { children: e }),
55
+ s === "small" && (n || r) && /* @__PURE__ */ i("span", { className: a.text, children: [
56
+ n,
57
+ n && r && " | ",
58
58
  r && /* @__PURE__ */ l("span", { className: a["role-name"], children: r })
59
59
  ] }),
60
- s === "medium" && /* @__PURE__ */ i("span", { className: a.secondary, children: [
61
- e && /* @__PURE__ */ l("span", { className: a.text, children: e }),
60
+ (s === "medium" || s === "large") && /* @__PURE__ */ i("span", { className: a.secondary, children: [
61
+ n && /* @__PURE__ */ l("span", { className: a.text, children: n }),
62
62
  r && /* @__PURE__ */ l("span", { className: a.role, children: r })
63
- ] }),
64
- s === "large" && r && /* @__PURE__ */ l("span", { className: a.role, children: r }),
65
- s === "large" && e && /* @__PURE__ */ l("span", { className: a.text, children: e })
63
+ ] })
66
64
  ] })
67
65
  ] });
68
- return m ? /* @__PURE__ */ l(u, { className: a.link, to: m, "data-component": "avatar", children: q }) : q;
66
+ return m ? /* @__PURE__ */ l(u, { className: a.link, to: m, "data-component": "avatar", children: y }) : y;
69
67
  };
70
68
  export {
71
69
  D as Avatar
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/avatar/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { Figure } from '@/components/figure';\nimport { Icon, type IconProps } from '@/components/icon';\nimport { Link } from '@/components/link';\n\nimport styles from './styles.module.css';\n\nexport type AvatarColor =\n | 'solibo'\n | 'board'\n | 'owner'\n | 'renter'\n | 'external'\n | '1'\n | '2'\n | '3'\n | '4'\n | '5';\n\nexport type AvatarSize = 'small' | 'medium' | 'large';\n\nexport type AvatarProps = {\n accessibleLabel?: string;\n color?: AvatarColor;\n icon?: IconProps['name'];\n imageUrl?: string;\n link?: string;\n name?: string;\n role?: string;\n size?: AvatarSize;\n text?: string;\n};\n\nconst sizes: Record<AvatarSize, string> = {\n large: styles.large,\n medium: styles.medium,\n small: styles.small,\n};\n\nconst iconSizes: Record<AvatarSize, NonNullable<IconProps['size']>> = {\n large: 'large',\n medium: 'medium',\n small: 'medium',\n};\n\nconst getInitials = (name: string) => {\n const nameParts = name.trim().split(/\\s+/).filter(Boolean);\n const firstInitial = Array.from(nameParts[0] ?? '')[0] ?? '';\n const lastInitial = nameParts.length > 1 ? Array.from(nameParts[nameParts.length - 1])[0] : '';\n\n return `${firstInitial}${lastInitial}`.toLocaleUpperCase();\n};\n\nexport const Avatar = ({\n accessibleLabel,\n color,\n icon,\n imageUrl,\n link,\n name,\n role,\n size = 'small',\n text,\n}: AvatarProps) => {\n const avatarLabel = accessibleLabel || name || 'User Avatar';\n const initials = name ? getInitials(name) : '';\n\n const avatarFigure = (\n <div\n className={cx(styles.avatar, sizes[size], color && styles[`color-${color}`])}\n data-color={color}\n data-size={size}\n >\n <span className={styles.media}>\n <Figure accessibleLabel={avatarLabel}>\n {icon ? (\n <Icon\n name={icon}\n size={iconSizes[size]}\n />\n ) : imageUrl ? (\n <img\n src={imageUrl}\n alt={avatarLabel}\n />\n ) : initials ? (\n <span\n aria-hidden='true'\n className={styles.initials}\n >\n {initials}\n </span>\n ) : (\n <Icon\n name='User'\n size={iconSizes[size]}\n />\n )}\n </Figure>\n </span>\n {(name || role || text) && (\n <span className={styles.details}>\n {name && <strong>{name}</strong>}\n {size === 'small' && (text || role) && (\n <span className={styles.text}>\n {text}\n {text && role && ' | '}\n {role && <span className={styles['role-name']}>{role}</span>}\n </span>\n )}\n {size === 'medium' && (\n <span className={styles.secondary}>\n {text && <span className={styles.text}>{text}</span>}\n {role && <span className={styles.role}>{role}</span>}\n </span>\n )}\n {size === 'large' && role && <span className={styles.role}>{role}</span>}\n {size === 'large' && text && <span className={styles.text}>{text}</span>}\n </span>\n )}\n </div>\n );\n\n return link ? (\n <Link\n className={styles.link}\n to={link}\n >\n {avatarFigure}\n </Link>\n ) : (\n avatarFigure\n );\n};\n"],"names":["sizes","large","styles","medium","small","iconSizes","getInitials","name","nameParts","trim","split","filter","Boolean","firstInitial","Array","from","lastInitial","length","toLocaleUpperCase","Avatar","accessibleLabel","color","icon","imageUrl","link","role","size","text","avatarLabel","initials","avatarFigure","cx","avatar","jsx","media","Figure","Icon","details","jsxs","secondary","Link"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCMA,IAAoC;AAAA,EACxCC,OAAOC,EAAOD;AAAAA,EACdE,QAAQD,EAAOC;AAAAA,EACfC,OAAOF,EAAOE;AAChB,GAEMC,IAAgE;AAAA,EACpEJ,OAAO;AAAA,EACPE,QAAQ;AAAA,EACRC,OAAO;AACT,GAEME,IAAcA,CAACC,MAAiB;AACpC,QAAMC,IAAYD,EAAKE,KAAAA,EAAOC,MAAM,KAAK,EAAEC,OAAOC,OAAO,GACnDC,IAAeC,MAAMC,KAAKP,EAAU,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IACpDQ,IAAcR,EAAUS,SAAS,IAAIH,MAAMC,KAAKP,EAAUA,EAAUS,SAAS,CAAC,CAAC,EAAE,CAAC,IAAI;AAE5F,SAAO,GAAGJ,CAAY,GAAGG,CAAW,GAAGE,kBAAAA;AACzC,GAEaC,IAASA,CAAC;AAAA,EACrBC,iBAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,MAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,MAAAA;AAAAA,EACAjB,MAAAA;AAAAA,EACAkB,MAAAA;AAAAA,EACAC,MAAAA,IAAO;AAAA,EACPC,MAAAA;AACW,MAAM;AACjB,QAAMC,IAAcR,KAAmBb,KAAQ,eACzCsB,IAAWtB,IAAOD,EAAYC,CAAI,IAAI,IAEtCuB,sBACH,OAAA,EACC,WAAWC,EAAG7B,EAAO8B,QAAQhC,EAAM0B,CAAI,GAAGL,KAASnB,EAAO,SAASmB,CAAK,EAAE,CAAC,GAC3E,cAAYA,GACZ,aAAWK,GAEX,UAAA;AAAA,IAAA,gBAAAO,EAAC,QAAA,EAAK,WAAW/B,EAAOgC,OACtB,4BAACC,GAAA,EAAO,iBAAiBP,GACtBN,UAAAA,IACC,gBAAAW,EAACG,KACC,MAAMd,GACN,MAAMjB,EAAUqB,CAAI,GAAE,IAEtBH,sBACD,OAAA,EACC,KAAKA,GACL,KAAKK,GAAY,IAEjBC,IACF,gBAAAI,EAAC,UACC,eAAY,QACZ,WAAW/B,EAAO2B,UAEjBA,aACH,IAEA,gBAAAI,EAACG,KACC,MAAK,QACL,MAAM/B,EAAUqB,CAAI,GAAE,EAAA,CAG5B,EAAA,CACF;AAAA,KACEnB,KAAQkB,KAAQE,wBACf,QAAA,EAAK,WAAWzB,EAAOmC,SACrB9B,UAAAA;AAAAA,MAAAA,KAAQ,gBAAA0B,EAAC,YAAQ1B,UAAAA,EAAAA,CAAK;AAAA,MACtBmB,MAAS,YAAYC,KAAQF,wBAC3B,QAAA,EAAK,WAAWvB,EAAOyB,MACrBA,UAAAA;AAAAA,QAAAA;AAAAA,QACAA,KAAQF,KAAQ;AAAA,QAChBA,KAAQ,gBAAAQ,EAAC,QAAA,EAAK,WAAW/B,EAAO,WAAW,GAAIuB,UAAAA,EAAAA,CAAK;AAAA,MAAA,GACvD;AAAA,MAEDC,MAAS,YACR,gBAAAY,EAAC,QAAA,EAAK,WAAWpC,EAAOqC,WACrBZ,UAAAA;AAAAA,QAAAA,KAAQ,gBAAAM,EAAC,QAAA,EAAK,WAAW/B,EAAOyB,MAAOA,UAAAA,GAAK;AAAA,QAC5CF,KAAQ,gBAAAQ,EAAC,QAAA,EAAK,WAAW/B,EAAOuB,MAAOA,UAAAA,EAAAA,CAAK;AAAA,MAAA,GAC/C;AAAA,MAEDC,MAAS,WAAWD,KAAQ,gBAAAQ,EAAC,UAAK,WAAW/B,EAAOuB,MAAOA,UAAAA,EAAAA,CAAK;AAAA,MAChEC,MAAS,WAAWC,KAAQ,gBAAAM,EAAC,UAAK,WAAW/B,EAAOyB,MAAOA,UAAAA,EAAAA,CAAK;AAAA,IAAA,EAAA,CACnE;AAAA,EAAA,GAEJ;AAGF,SAAOH,IACL,gBAAAS,EAACO,GAAA,EACC,WAAWtC,EAAOsB,MAClB,IAAIA,GAAK,kBAAA,UAERM,UAAAA,EAAAA,CACH,IAEAA;AAEJ;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/avatar/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { Figure } from '@/components/figure';\nimport { Icon, type IconProps } from '@/components/icon';\nimport { Link } from '@/components/link';\n\nimport styles from './styles.module.css';\n\nexport type AvatarColor =\n | 'solibo'\n | 'board'\n | 'owner'\n | 'renter'\n | 'external'\n | '1'\n | '2'\n | '3'\n | '4'\n | '5';\n\nexport type AvatarSize = 'small' | 'medium' | 'large';\n\nexport type AvatarProps = {\n accessibleLabel?: string;\n color?: AvatarColor;\n icon?: IconProps['name'];\n imageUrl?: string;\n link?: string;\n name?: string;\n role?: string;\n size?: AvatarSize;\n text?: string;\n};\n\nconst sizes: Record<AvatarSize, string> = {\n large: styles.large,\n medium: styles.medium,\n small: styles.small,\n};\n\nconst iconSizes: Record<AvatarSize, NonNullable<IconProps['size']>> = {\n large: 'large',\n medium: 'medium',\n small: 'medium',\n};\n\nconst getInitials = (name: string) => {\n const nameParts = name.trim().split(/\\s+/).filter(Boolean);\n const firstInitial = Array.from(nameParts[0] ?? '')[0] ?? '';\n const lastInitial = nameParts.length > 1 ? Array.from(nameParts[nameParts.length - 1])[0] : '';\n\n return `${firstInitial}${lastInitial}`.toLocaleUpperCase();\n};\n\nexport const Avatar = ({\n accessibleLabel,\n color,\n icon,\n imageUrl,\n link,\n name,\n role,\n size = 'small',\n text,\n}: AvatarProps) => {\n const avatarLabel = accessibleLabel || name || 'User Avatar';\n const initials = name ? getInitials(name) : '';\n\n const avatarFigure = (\n <div\n className={cx(styles.avatar, sizes[size], color && styles[`color-${color}`])}\n data-color={color}\n data-size={size}\n >\n <span className={styles.media}>\n <Figure accessibleLabel={avatarLabel}>\n {icon ? (\n <Icon\n name={icon}\n size={iconSizes[size]}\n />\n ) : imageUrl ? (\n <img\n src={imageUrl}\n alt={avatarLabel}\n />\n ) : initials ? (\n <span\n aria-hidden='true'\n className={styles.initials}\n >\n {initials}\n </span>\n ) : (\n <Icon\n name='User'\n size={iconSizes[size]}\n />\n )}\n </Figure>\n </span>\n {(name || role || text) && (\n <span className={styles.details}>\n {name && <strong>{name}</strong>}\n {size === 'small' && (text || role) && (\n <span className={styles.text}>\n {text}\n {text && role && ' | '}\n {role && <span className={styles['role-name']}>{role}</span>}\n </span>\n )}\n {(size === 'medium' || size === 'large') && (\n <span className={styles.secondary}>\n {text && <span className={styles.text}>{text}</span>}\n {role && <span className={styles.role}>{role}</span>}\n </span>\n )}\n </span>\n )}\n </div>\n );\n\n return link ? (\n <Link\n className={styles.link}\n to={link}\n >\n {avatarFigure}\n </Link>\n ) : (\n avatarFigure\n );\n};\n"],"names":["sizes","large","styles","medium","small","iconSizes","getInitials","name","nameParts","trim","split","filter","Boolean","firstInitial","Array","from","lastInitial","length","toLocaleUpperCase","Avatar","accessibleLabel","color","icon","imageUrl","link","role","size","text","avatarLabel","initials","avatarFigure","cx","avatar","jsx","media","Figure","Icon","details","secondary","Link"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCMA,IAAoC;AAAA,EACxCC,OAAOC,EAAOD;AAAAA,EACdE,QAAQD,EAAOC;AAAAA,EACfC,OAAOF,EAAOE;AAChB,GAEMC,IAAgE;AAAA,EACpEJ,OAAO;AAAA,EACPE,QAAQ;AAAA,EACRC,OAAO;AACT,GAEME,IAAcA,CAACC,MAAiB;AACpC,QAAMC,IAAYD,EAAKE,KAAAA,EAAOC,MAAM,KAAK,EAAEC,OAAOC,OAAO,GACnDC,IAAeC,MAAMC,KAAKP,EAAU,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IACpDQ,IAAcR,EAAUS,SAAS,IAAIH,MAAMC,KAAKP,EAAUA,EAAUS,SAAS,CAAC,CAAC,EAAE,CAAC,IAAI;AAE5F,SAAO,GAAGJ,CAAY,GAAGG,CAAW,GAAGE,kBAAAA;AACzC,GAEaC,IAASA,CAAC;AAAA,EACrBC,iBAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,MAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,MAAAA;AAAAA,EACAjB,MAAAA;AAAAA,EACAkB,MAAAA;AAAAA,EACAC,MAAAA,IAAO;AAAA,EACPC,MAAAA;AACW,MAAM;AACjB,QAAMC,IAAcR,KAAmBb,KAAQ,eACzCsB,IAAWtB,IAAOD,EAAYC,CAAI,IAAI,IAEtCuB,sBACH,OAAA,EACC,WAAWC,EAAG7B,EAAO8B,QAAQhC,EAAM0B,CAAI,GAAGL,KAASnB,EAAO,SAASmB,CAAK,EAAE,CAAC,GAC3E,cAAYA,GACZ,aAAWK,GAEX,UAAA;AAAA,IAAA,gBAAAO,EAAC,QAAA,EAAK,WAAW/B,EAAOgC,OACtB,4BAACC,GAAA,EAAO,iBAAiBP,GACtBN,UAAAA,IACC,gBAAAW,EAACG,KACC,MAAMd,GACN,MAAMjB,EAAUqB,CAAI,GAAE,IAEtBH,sBACD,OAAA,EACC,KAAKA,GACL,KAAKK,GAAY,IAEjBC,IACF,gBAAAI,EAAC,UACC,eAAY,QACZ,WAAW/B,EAAO2B,UAEjBA,aACH,IAEA,gBAAAI,EAACG,KACC,MAAK,QACL,MAAM/B,EAAUqB,CAAI,GAAE,EAAA,CAG5B,EAAA,CACF;AAAA,KACEnB,KAAQkB,KAAQE,wBACf,QAAA,EAAK,WAAWzB,EAAOmC,SACrB9B,UAAAA;AAAAA,MAAAA,KAAQ,gBAAA0B,EAAC,YAAQ1B,UAAAA,EAAAA,CAAK;AAAA,MACtBmB,MAAS,YAAYC,KAAQF,wBAC3B,QAAA,EAAK,WAAWvB,EAAOyB,MACrBA,UAAAA;AAAAA,QAAAA;AAAAA,QACAA,KAAQF,KAAQ;AAAA,QAChBA,KAAQ,gBAAAQ,EAAC,QAAA,EAAK,WAAW/B,EAAO,WAAW,GAAIuB,UAAAA,EAAAA,CAAK;AAAA,MAAA,GACvD;AAAA,OAEAC,MAAS,YAAYA,MAAS,8BAC7B,QAAA,EAAK,WAAWxB,EAAOoC,WACrBX,UAAAA;AAAAA,QAAAA,KAAQ,gBAAAM,EAAC,QAAA,EAAK,WAAW/B,EAAOyB,MAAOA,UAAAA,GAAK;AAAA,QAC5CF,KAAQ,gBAAAQ,EAAC,QAAA,EAAK,WAAW/B,EAAOuB,MAAOA,UAAAA,EAAAA,CAAK;AAAA,MAAA,EAAA,CAC/C;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GAEJ;AAGF,SAAOD,IACL,gBAAAS,EAACM,GAAA,EACC,WAAWrC,EAAOsB,MAClB,IAAIA,GAAK,kBAAA,UAERM,UAAAA,EAAAA,CACH,IAEAA;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index31.css');const e=require("react/jsx-runtime"),x=require("../../icons-DTP9D75O.cjs"),b=require("../loading/index.cjs"),h="_checkbox_qf257_3",l={checkbox:h},a=({checked:s,disabled:t,isLoading:c,label:o,onChange:n,...i})=>{const r={"--icon-svg":x.iconSVG("Check")};return e.jsxs("label",{className:l.checkbox,"data-component":"checkbox",children:[e.jsx("input",{checked:s,disabled:t||c,onChange:n,type:"checkbox",style:r,...i}),c&&e.jsx(b.Loading,{size:"small",sticky:!0}),o&&o]})};exports.Checkbox=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index31.css');const e=require("react/jsx-runtime"),x=require("../../icons-Dv_p0bUF.cjs"),b=require("../loading/index.cjs"),h="_checkbox_qf257_3",l={checkbox:h},a=({checked:s,disabled:t,isLoading:c,label:o,onChange:n,...i})=>{const r={"--icon-svg":x.iconSVG("Check")};return e.jsxs("label",{className:l.checkbox,"data-component":"checkbox",children:[e.jsx("input",{checked:s,disabled:t||c,onChange:n,type:"checkbox",style:r,...i}),c&&e.jsx(b.Loading,{size:"small",sticky:!0}),o&&o]})};exports.Checkbox=a;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,5 +1,5 @@
1
1
  import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
- import { i as x } from "../../icons-BpYV3Qdj.js";
2
+ import { i as x } from "../../icons-dUP7sKyt.js";
3
3
  import { Loading as k } from "../loading/index.js";
4
4
  import '../../assets/index31.css';const m = "_checkbox_qf257_3", a = {
5
5
  checkbox: m
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index37.css');const l=require("react/jsx-runtime"),j=require("../../classix-5H4IWnMA.cjs"),a=require("react"),k=require("../button/index.cjs"),de=require("../../icons-DTP9D75O.cjs"),X=require("../../index-CfdjkXVw.cjs"),pe=require("../list/index.cjs"),E=require("../../index-Dk9p49nt.cjs");function V(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(V).join(" "):a.isValidElement(t)?V(t.props.children):""}function fe(t){return a.isValidElement(t)&&t.type==="option"}function me(t){return a.isValidElement(t)&&t.type==="optgroup"}function _e(t){return a.isValidElement(t)&&t.type===a.Fragment}function he(t){return a.isValidElement(t)&&t.type===E.Select}function F(t,i,r=!1){const s=[];return a.Children.forEach(t,n=>{if(_e(n))s.push(...F(n.props.children,i,r));else if(fe(n)){const c=V(n.props.children).trim(),f=n.props.value!=null?String(n.props.value):c;s.push({disabled:r||!!n.props.disabled,groupLabel:i,hidden:!!n.props.hidden,isPlaceholder:!!(n.props.hidden&&f===""),label:n.props.children,selected:!!n.props.selected,text:c,value:f})}else me(n)&&s.push(...F(n.props.children,n.props.label,r||!!n.props.disabled))}),s}function ge(t){const i=t.trim();if(!i)return null;const s=[.../[*?]/.test(i)?i:`*${i}*`].map(n=>n==="*"?".*":n==="?"?".":n.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${s}$`,"i")}function xe(t,i){const r=ge(i),s=t.filter(n=>!n.hidden&&!n.isPlaceholder);return r?s.filter(n=>r.test([n.groupLabel,n.text,n.value].filter(Boolean).join(" "))):s}function be(t,i){return t.find(r=>r.value===i)??t.find(r=>r.isPlaceholder)??t[0]}function je(t,i,r){var s,n;return i!=null?String(i):r!=null?String(r):((s=t.find(c=>c.selected))==null?void 0:s.value)??((n=t[0])==null?void 0:n.value)??""}function ve(t){if(he(t)){const{children:i,placeholder:r,...s}=t.props;return{children:l.jsxs(l.Fragment,{children:[r&&l.jsx("option",{hidden:!0,value:"",children:r}),i]}),props:s}}return{children:t.props.children,props:t.props}}const ye="_combobox_149jz_3",we="_dropdown_149jz_27",Se="_empty_149jz_32",ze="_group_149jz_33",Ne="_placeholder_149jz_34",Ce="_filter_149jz_42",Ee="_native_149jz_53",Ve="_option_149jz_63",Le="_options_149jz_84",Re="_panel_149jz_108",$e="_selected_149jz_133",Be="_text_149jz_137",Ie="_trigger_149jz_145",qe="_minimal_149jz_182",De="_inline_149jz_241",Pe="_label_149jz_273",o={combobox:ye,"combobox-input":"_combobox-input_149jz_12",dropdown:we,empty:Se,group:ze,placeholder:Ne,filter:Ce,native:Ee,option:Ve,options:Le,panel:Re,selected:$e,text:Be,trigger:Ie,minimal:qe,inline:De,label:Pe,"inline-field":"_inline-field_149jz_279"};function Y(t,i){return{"--icon-svg":de.iconSVG(t,i)}}const ke=({children:t,className:i,combobox:r=!1,createOption:s,emptyLabel:n="No matches found",label:c,renderOption:f,searchPlaceholder:L="Filter",selectedItems:Z,variant:g="default",...ee})=>{const R=ve(t),{defaultValue:te,onChange:$,value:B,...ne}=R.props,v=E.sanitizeSelectProps(ne),{className:re,...se}=v,M=a.useRef(null),W=a.useRef(null),y=a.useId(),G=a.useRef(null),m=a.useRef(null),x=F(R.children),b=B!=null,I=je(x,B,te),[q,D]=a.useState(()=>I),[u,p]=a.useState(!1),[w,S]=a.useState(""),z=b?String(B):q,Q={default:E.resolveColor("--colors-semantic-content-secondary"),white:E.resolveColor("--color-white","white")},O=g==="minimal"?Q.white:Q.default,N=be(x,z),le=Y("CaretDown",O),oe=Y("MagnifyingGlass",O),T=xe(x,w),_=w.trim(),C=!!(r&&s&&_&&s.isValid(_)),ie=c&&g==="inline"?X.formatInlineLabel(c):c,A=e=>e?(f==null?void 0:f({groupLabel:e.groupLabel,isSelected:e.value===z,label:e.label,text:e.text,value:e.value}))??e.label:"Select an option";a.useEffect(()=>{!b&&!x.some(e=>e.value===q)&&D(I)},[I,q,b,x]),a.useEffect(()=>{var e;if(!u){S("");return}(e=m.current)==null||e.focus()},[u]),a.useEffect(()=>{if(!u)return;const e=d=>{var h;(h=W.current)!=null&&h.contains(d.target)||p(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]);const ae=e=>{b||D(e.target.value),$==null||$(e)},P=()=>{var e;p(!1),r||(e=M.current)==null||e.focus()},K=()=>{var e;S(""),p(!0),(e=m.current)==null||e.focus()},H=()=>{!s||!C||(s.onCreate(_),K())},ce=e=>{var U;b||D(e);const d=G.current;if(!d){P();return}const h=(U=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"))==null?void 0:U.set;h==null||h.call(d,e),d.dispatchEvent(new Event("change",{bubbles:!0})),r?K():P()},ue=e=>{e.key==="Escape"&&P(),e.key==="Enter"&&e.target===m.current&&C&&(e.preventDefault(),H())},J=l.jsxs("div",{className:j.t(o.dropdown,g==="inline"&&o.inline,g==="minimal"&&o.minimal,i),onKeyDown:ue,ref:W,...ee,children:[l.jsx("select",{...se,"aria-hidden":"true",className:j.t(o.native,re),onChange:ae,ref:G,tabIndex:-1,value:z,children:R.children}),r?l.jsxs("div",{className:o.combobox,onClick:()=>{var e;return(e=m.current)==null?void 0:e.focus()},children:[Z,l.jsx("input",{"aria-autocomplete":"list","aria-expanded":u,"aria-label":v["aria-label"]??c??L,className:o["combobox-input"],disabled:v.disabled,onChange:e=>{S(e.target.value),p(!0)},onClick:()=>p(!0),onFocus:()=>p(!0),placeholder:L||void 0,ref:m,role:"combobox",type:"text",value:w})]}):l.jsx(k.Button,{"aria-expanded":u,"aria-haspopup":"dialog","aria-labelledby":c?`${y} ${y}-value`:void 0,className:j.t(o.trigger,(N==null?void 0:N.isPlaceholder)&&o.placeholder),"data-open":u?"true":void 0,disabled:v.disabled,onClick:()=>p(e=>!e),ref:M,style:le,variant:"tertiary",children:l.jsx("span",{className:o.text,id:`${y}-value`,children:A(N)})}),u&&l.jsxs("div",{className:o.panel,children:[!r&&l.jsx(X.Input,{"aria-label":"Filter",className:o.filter,icon:"MagnifyingGlass",onChange:e=>S(e.target.value),placeholder:L,ref:m,style:oe,type:"search",value:w}),l.jsxs(pe.List,{"aria-label":"Dropdown",className:o.options,children:[T.map(e=>{const d=e.value===z;return l.jsx("li",{"data-component":"dropdown",children:l.jsxs(k.Button,{"aria-label":d?`${e.text}, selected`:e.text,className:j.t(o.option,d&&o.selected),disabled:e.disabled,onClick:()=>ce(e.value),variant:"tertiary",children:[l.jsx("span",{className:o.text,children:A(e)}),e.groupLabel&&l.jsx("small",{className:o.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),C&&s&&l.jsx("li",{children:l.jsx(k.Button,{"aria-label":V(s.render(_))||_,className:o.option,onClick:H,variant:"tertiary",children:l.jsx("span",{className:o.text,children:s.render(_)})})}),T.length===0&&!C&&l.jsx("li",{className:o.empty,children:n})]})]})]});return c?l.jsxs("div",{className:j.t(o.label,g==="inline"&&o["inline-field"]),"data-component":"dropdown",children:[l.jsx("span",{id:y,children:ie}),J]}):J};exports.Dropdown=ke;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index37.css');const l=require("react/jsx-runtime"),j=require("../../classix-5H4IWnMA.cjs"),a=require("react"),k=require("../button/index.cjs"),de=require("../../icons-Dv_p0bUF.cjs"),X=require("../../index-5yOssOic.cjs"),pe=require("../list/index.cjs"),E=require("../../index-CXaYq0By.cjs");function V(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(V).join(" "):a.isValidElement(t)?V(t.props.children):""}function fe(t){return a.isValidElement(t)&&t.type==="option"}function me(t){return a.isValidElement(t)&&t.type==="optgroup"}function _e(t){return a.isValidElement(t)&&t.type===a.Fragment}function he(t){return a.isValidElement(t)&&t.type===E.Select}function F(t,i,r=!1){const s=[];return a.Children.forEach(t,n=>{if(_e(n))s.push(...F(n.props.children,i,r));else if(fe(n)){const c=V(n.props.children).trim(),f=n.props.value!=null?String(n.props.value):c;s.push({disabled:r||!!n.props.disabled,groupLabel:i,hidden:!!n.props.hidden,isPlaceholder:!!(n.props.hidden&&f===""),label:n.props.children,selected:!!n.props.selected,text:c,value:f})}else me(n)&&s.push(...F(n.props.children,n.props.label,r||!!n.props.disabled))}),s}function ge(t){const i=t.trim();if(!i)return null;const s=[.../[*?]/.test(i)?i:`*${i}*`].map(n=>n==="*"?".*":n==="?"?".":n.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${s}$`,"i")}function xe(t,i){const r=ge(i),s=t.filter(n=>!n.hidden&&!n.isPlaceholder);return r?s.filter(n=>r.test([n.groupLabel,n.text,n.value].filter(Boolean).join(" "))):s}function be(t,i){return t.find(r=>r.value===i)??t.find(r=>r.isPlaceholder)??t[0]}function je(t,i,r){var s,n;return i!=null?String(i):r!=null?String(r):((s=t.find(c=>c.selected))==null?void 0:s.value)??((n=t[0])==null?void 0:n.value)??""}function ve(t){if(he(t)){const{children:i,placeholder:r,...s}=t.props;return{children:l.jsxs(l.Fragment,{children:[r&&l.jsx("option",{hidden:!0,value:"",children:r}),i]}),props:s}}return{children:t.props.children,props:t.props}}const ye="_combobox_149jz_3",we="_dropdown_149jz_27",Se="_empty_149jz_32",ze="_group_149jz_33",Ne="_placeholder_149jz_34",Ce="_filter_149jz_42",Ee="_native_149jz_53",Ve="_option_149jz_63",Le="_options_149jz_84",Re="_panel_149jz_108",$e="_selected_149jz_133",Be="_text_149jz_137",Ie="_trigger_149jz_145",qe="_minimal_149jz_182",De="_inline_149jz_241",Pe="_label_149jz_273",o={combobox:ye,"combobox-input":"_combobox-input_149jz_12",dropdown:we,empty:Se,group:ze,placeholder:Ne,filter:Ce,native:Ee,option:Ve,options:Le,panel:Re,selected:$e,text:Be,trigger:Ie,minimal:qe,inline:De,label:Pe,"inline-field":"_inline-field_149jz_279"};function Y(t,i){return{"--icon-svg":de.iconSVG(t,i)}}const ke=({children:t,className:i,combobox:r=!1,createOption:s,emptyLabel:n="No matches found",label:c,renderOption:f,searchPlaceholder:L="Filter",selectedItems:Z,variant:g="default",...ee})=>{const R=ve(t),{defaultValue:te,onChange:$,value:B,...ne}=R.props,v=E.sanitizeSelectProps(ne),{className:re,...se}=v,M=a.useRef(null),W=a.useRef(null),y=a.useId(),G=a.useRef(null),m=a.useRef(null),x=F(R.children),b=B!=null,I=je(x,B,te),[q,D]=a.useState(()=>I),[u,p]=a.useState(!1),[w,S]=a.useState(""),z=b?String(B):q,Q={default:E.resolveColor("--colors-semantic-content-secondary"),white:E.resolveColor("--color-white","white")},O=g==="minimal"?Q.white:Q.default,N=be(x,z),le=Y("CaretDown",O),oe=Y("MagnifyingGlass",O),T=xe(x,w),_=w.trim(),C=!!(r&&s&&_&&s.isValid(_)),ie=c&&g==="inline"?X.formatInlineLabel(c):c,A=e=>e?(f==null?void 0:f({groupLabel:e.groupLabel,isSelected:e.value===z,label:e.label,text:e.text,value:e.value}))??e.label:"Select an option";a.useEffect(()=>{!b&&!x.some(e=>e.value===q)&&D(I)},[I,q,b,x]),a.useEffect(()=>{var e;if(!u){S("");return}(e=m.current)==null||e.focus()},[u]),a.useEffect(()=>{if(!u)return;const e=d=>{var h;(h=W.current)!=null&&h.contains(d.target)||p(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]);const ae=e=>{b||D(e.target.value),$==null||$(e)},P=()=>{var e;p(!1),r||(e=M.current)==null||e.focus()},K=()=>{var e;S(""),p(!0),(e=m.current)==null||e.focus()},H=()=>{!s||!C||(s.onCreate(_),K())},ce=e=>{var U;b||D(e);const d=G.current;if(!d){P();return}const h=(U=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"))==null?void 0:U.set;h==null||h.call(d,e),d.dispatchEvent(new Event("change",{bubbles:!0})),r?K():P()},ue=e=>{e.key==="Escape"&&P(),e.key==="Enter"&&e.target===m.current&&C&&(e.preventDefault(),H())},J=l.jsxs("div",{className:j.t(o.dropdown,g==="inline"&&o.inline,g==="minimal"&&o.minimal,i),onKeyDown:ue,ref:W,...ee,children:[l.jsx("select",{...se,"aria-hidden":"true",className:j.t(o.native,re),onChange:ae,ref:G,tabIndex:-1,value:z,children:R.children}),r?l.jsxs("div",{className:o.combobox,onClick:()=>{var e;return(e=m.current)==null?void 0:e.focus()},children:[Z,l.jsx("input",{"aria-autocomplete":"list","aria-expanded":u,"aria-label":v["aria-label"]??c??L,className:o["combobox-input"],disabled:v.disabled,onChange:e=>{S(e.target.value),p(!0)},onClick:()=>p(!0),onFocus:()=>p(!0),placeholder:L||void 0,ref:m,role:"combobox",type:"text",value:w})]}):l.jsx(k.Button,{"aria-expanded":u,"aria-haspopup":"dialog","aria-labelledby":c?`${y} ${y}-value`:void 0,className:j.t(o.trigger,(N==null?void 0:N.isPlaceholder)&&o.placeholder),"data-open":u?"true":void 0,disabled:v.disabled,onClick:()=>p(e=>!e),ref:M,style:le,variant:"tertiary",children:l.jsx("span",{className:o.text,id:`${y}-value`,children:A(N)})}),u&&l.jsxs("div",{className:o.panel,children:[!r&&l.jsx(X.Input,{"aria-label":"Filter",className:o.filter,icon:"MagnifyingGlass",onChange:e=>S(e.target.value),placeholder:L,ref:m,style:oe,type:"search",value:w}),l.jsxs(pe.List,{"aria-label":"Dropdown",className:o.options,children:[T.map(e=>{const d=e.value===z;return l.jsx("li",{"data-component":"dropdown",children:l.jsxs(k.Button,{"aria-label":d?`${e.text}, selected`:e.text,className:j.t(o.option,d&&o.selected),disabled:e.disabled,onClick:()=>ce(e.value),variant:"tertiary",children:[l.jsx("span",{className:o.text,children:A(e)}),e.groupLabel&&l.jsx("small",{className:o.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),C&&s&&l.jsx("li",{children:l.jsx(k.Button,{"aria-label":V(s.render(_))||_,className:o.option,onClick:H,variant:"tertiary",children:l.jsx("span",{className:o.text,children:s.render(_)})})}),T.length===0&&!C&&l.jsx("li",{className:o.empty,children:n})]})]})]});return c?l.jsxs("div",{className:j.t(o.label,g==="inline"&&o["inline-field"]),"data-component":"dropdown",children:[l.jsx("span",{id:y,children:ie}),J]}):J};exports.Dropdown=ke;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -2,10 +2,10 @@ import { jsxs as p, Fragment as me, jsx as i } from "react/jsx-runtime";
2
2
  import { t as y } from "../../classix-DG18itHa.js";
3
3
  import _e, { Children as he, isValidElement as x, useRef as V, useId as ge, useState as M, useEffect as W } from "react";
4
4
  import { Button as G } from "../button/index.js";
5
- import { i as be } from "../../icons-BpYV3Qdj.js";
6
- import { f as ve, I as ye } from "../../index-C9_dM53L.js";
5
+ import { i as be } from "../../icons-dUP7sKyt.js";
6
+ import { f as ve, I as ye } from "../../index-Cv6TtBnd.js";
7
7
  import { List as xe } from "../list/index.js";
8
- import { S as we, s as je, r as ee } from "../../index-ky7bIz5x.js";
8
+ import { S as we, s as je, r as ee } from "../../index-CwIzKfBo.js";
9
9
  import '../../assets/index37.css';function I(t) {
10
10
  return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(I).join(" ") : x(t) ? I(t.props.children) : "";
11
11
  }
@@ -1,4 +1,4 @@
1
- "use strict";require('../../assets/index39.css');var E0=Object.defineProperty;var k0=(n,e,t)=>e in n?E0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Mt=(n,e,t)=>k0(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react/jsx-runtime"),R=require("react"),eo=require("react-dom"),Jr=require("../../classix-5H4IWnMA.cjs"),N0=require("../file/index.cjs"),Le=require("../button/index.cjs"),Je=require("../icon/index.cjs"),to=require("../../index-CfdjkXVw.cjs"),A0=require("../toolbar/index.cjs");function O0(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const Zu=O0(R);function xn(n){return{}}const Cu={},I0={},Ua={},jt={},ln={},zn={},cn={},rr={},mi={},$n={},Wn={},We={},is={},ss={},D0={},za={},P0={},$a={},L0={},Wa={},Ha={},Zr={},M0={},Va={},Ga={},Ka={},R0={},B0={},F0={},no={},Ja={},j0={},Za={},Xa={},q0={},Eu={},os={},bi={},U0={},z0={},Tr={},Cr={},$0={},W0={},H0={},Ve=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,V0=Ve&&"documentMode"in document?document.documentMode:null,je=Ve&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ct=Ve&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Xr=!(!Ve||!("InputEvent"in window)||V0)&&"getTargetRanges"in new window.InputEvent("input"),ku=Ve&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ur=Ve&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,G0=Ve&&/Android/.test(navigator.userAgent),Qa=Ve&&/^(?=.*Chrome).*/i.test(navigator.userAgent),K0=Ve&&G0&&Qa,as=Ve&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Qa,ir=1,Nt=3,Ut=0,Ya=1,hn=2,J0=0,Z0=1,X0=2,Qr=4,Yr=8,ls=128,Q0=112|(3|Qr|Yr)|ls,cs=1,fs=2,ds=3,hs=4,ps=5,gs=6,Nu=ku||ur||as?" ":"​",lt=`
1
+ "use strict";require('../../assets/index39.css');var E0=Object.defineProperty;var k0=(n,e,t)=>e in n?E0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Mt=(n,e,t)=>k0(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react/jsx-runtime"),R=require("react"),eo=require("react-dom"),Jr=require("../../classix-5H4IWnMA.cjs"),N0=require("../file/index.cjs"),Le=require("../button/index.cjs"),Je=require("../icon/index.cjs"),to=require("../../index-5yOssOic.cjs"),A0=require("../toolbar/index.cjs");function O0(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const Zu=O0(R);function xn(n){return{}}const Cu={},I0={},Ua={},jt={},ln={},zn={},cn={},rr={},mi={},$n={},Wn={},We={},is={},ss={},D0={},za={},P0={},$a={},L0={},Wa={},Ha={},Zr={},M0={},Va={},Ga={},Ka={},R0={},B0={},F0={},no={},Ja={},j0={},Za={},Xa={},q0={},Eu={},os={},bi={},U0={},z0={},Tr={},Cr={},$0={},W0={},H0={},Ve=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,V0=Ve&&"documentMode"in document?document.documentMode:null,je=Ve&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ct=Ve&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Xr=!(!Ve||!("InputEvent"in window)||V0)&&"getTargetRanges"in new window.InputEvent("input"),ku=Ve&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ur=Ve&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,G0=Ve&&/Android/.test(navigator.userAgent),Qa=Ve&&/^(?=.*Chrome).*/i.test(navigator.userAgent),K0=Ve&&G0&&Qa,as=Ve&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Qa,ir=1,Nt=3,Ut=0,Ya=1,hn=2,J0=0,Z0=1,X0=2,Qr=4,Yr=8,ls=128,Q0=112|(3|Qr|Yr)|ls,cs=1,fs=2,ds=3,hs=4,ps=5,gs=6,Nu=ku||ur||as?" ":"​",lt=`
2
2
 
3
3
  `,Y0=Ct?" ":Nu,el="֑-߿יִ-﷽ﹰ-ﻼ",tl="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",ef=new RegExp("^[^"+tl+"]*["+el+"]"),tf=new RegExp("^[^"+el+"]*["+tl+"]"),zt={bold:1,code:16,highlight:ls,italic:2,strikethrough:Qr,subscript:32,superscript:64,underline:Yr},nf={directionless:1,unmergeable:2},ro={center:fs,end:gs,justify:hs,left:cs,right:ds,start:ps},rf={[fs]:"center",[gs]:"end",[hs]:"justify",[cs]:"left",[ds]:"right",[ps]:"start"},uf={normal:0,segmented:2,token:1},sf={[J0]:"normal",[X0]:"segmented",[Z0]:"token"};function of(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var M=of(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function eu(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const af=100;let yi=!1,ms=0;function lf(n){ms=n.timeStamp}function Xu(n,e,t){const r=n.nodeName==="BR",u=e.__lexicalLineBreak;return u&&(n===u||r&&n.previousSibling===u)||r&&Ou(n,t)!==void 0}function cf(n,e,t){const r=Be(t._window);let u=null,i=null;r!==null&&r.anchorNode===n&&(u=r.anchorOffset,i=r.focusOffset);const s=n.nodeValue;s!==null&&vs(e,s,u,i,!1)}function ff(n,e,t){if(D(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===Nt&&t.isAttached()}function df(n,e,t,r){for(let u=n;u&&!Ef(u);u=or(u)){const i=Ou(u,e);if(i!==void 0){const s=he(i,t);if(s)return ue(s)?void 0:[u,s]}else if(u===r)return[r,cl(t)]}}function nl(n,e,t){yi=!0;const r=performance.now()-ms>af;try{Ae(n,()=>{const u=z()||function(c){return c.getEditorState().read(()=>{const d=z();return d!==null?d.clone():null})}(n),i=new Map,s=n.getRootElement(),o=n._editorState,a=n._blockCursorElement;let l=!1,f="";for(let c=0;c<e.length;c++){const d=e[c],p=d.type,m=d.target,g=df(m,n,o,s);if(!g)continue;const[y,b]=g;if(p==="characterData")r&&P(b)&&ff(u,m,b)&&cf(m,b,n);else if(p==="childList"){l=!0;const v=d.addedNodes;for(let T=0;T<v.length;T++){const I=v[T],C=al(I),L=I.parentNode;if(L!=null&&I!==a&&C===null&&!Xu(I,L,n)){if(Ct){const $=I.innerText||I.nodeValue;$&&(f+=$)}L.removeChild(I)}}const w=d.removedNodes,S=w.length;if(S>0){let T=0;for(let I=0;I<S;I++){const C=w[I];(Xu(C,m,n)||a===C)&&(m.appendChild(C),T++)}S!==T&&i.set(y,b)}}}if(i.size>0)for(const[c,d]of i)d.reconcileObservedMutation(c,n);const h=t.takeRecords();if(h.length>0){for(let c=0;c<h.length;c++){const d=h[c],p=d.addedNodes,m=d.target;for(let g=0;g<p.length;g++){const y=p[g],b=y.parentNode;b==null||y.nodeName!=="BR"||Xu(y,m,n)||b.removeChild(y)}}t.takeRecords()}u!==null&&(l&&(u.dirty=!0,Re(u)),Ct&&pl(n)&&u.insertRawText(f))})}finally{yi=!1}}function rl(n){const e=n._observer;e!==null&&nl(n,e.takeRecords(),e)}function ul(n){(function(e){ms===0&&Du(e).addEventListener("textInput",lf,!0)})(n),n._observer=new MutationObserver((e,t)=>{nl(n,e,t)})}function uo(n,e){const t=n.__mode,r=n.__format,u=n.__style,i=e.__mode,s=e.__format,o=e.__style;return!(t!==null&&t!==i||r!==null&&r!==s||u!==null&&u!==o)}function io(n,e){const t=n.mergeWithSibling(e),r=le()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function so(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&P(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(uo(e,r)){r=io(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&P(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(uo(r,t)){r=io(r,t);break}break}t.remove()}}else r.remove()}function il(n){return oo(n.anchor),oo(n.focus),n}function oo(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,u;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),u=!0):(r=e.getChildAtIndex(t),u=!1),P(r)){n.set(r.__key,u?r.getTextContentSize():0,"text");break}if(!k(r))break;n.set(r.__key,u?r.getChildrenSize():0,"element")}}let hf=1;const pf=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function bs(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return ue(pn(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Au(e)==null)}function sr(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!bs(e)&&sl(e)===n}catch{return!1}}function ys(n){return n instanceof Fu}function sl(n){let e=n;for(;e!=null;){const t=Au(e);if(ys(t))return t;e=or(e)}return null}function Au(n){return n?n.__lexicalEditor:null}function Bt(n){return n.isToken()||n.isSegmented()}function gf(n){return n.nodeType===Nt}function tu(n){let e=n;for(;e!=null;){if(gf(e))return e;e=e.firstChild}return null}function nu(n,e,t){const r=zt[e];if(t!==null&&(n&r)==(t&r))return n;let u=n^r;return e==="subscript"?u&=-65:e==="superscript"&&(u&=-33),u}function ol(n){return P(n)||Et(n)||ue(n)}function mf(n,e){if(e!=null)return void(n.__key=e);Ce(),Ll();const t=le(),r=ht(),u=""+hf++;r._nodeMap.set(u,n),k(n)?t._dirtyElements.set(u,!0):t._dirtyLeaves.add(u),t._cloneNotNeeded.add(u),t._dirtyType=Ya,n.__key=u}function qt(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),u=n.getPreviousSibling(),i=n.getNextSibling();if(u===null)if(i!==null){const s=i.getWritable();r.__first=i.__key,s.__prev=null}else r.__first=null;else{const s=u.getWritable();if(i!==null){const o=i.getWritable();o.__prev=s.__key,s.__next=o.__key}else s.__next=null;t.__prev=null}if(i===null)if(u!==null){const s=u.getWritable();r.__last=u.__key,s.__next=null}else r.__last=null;else{const s=i.getWritable();if(u!==null){const o=u.getWritable();o.__next=s.__key,s.__prev=o.__key}else s.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function ru(n){Ll();const e=n.getLatest(),t=e.__parent,r=ht(),u=le(),i=r._nodeMap,s=u._dirtyElements;t!==null&&function(a,l,f){let h=a;for(;h!==null;){if(f.has(h))return;const c=l.get(h);if(c===void 0)break;f.set(h,!1),h=c.__parent}}(t,i,s);const o=e.__key;u._dirtyType=Ya,k(n)?s.set(o,!0):u._dirtyLeaves.add(o)}function _e(n){Ce();const e=le(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=he(t);r!==null&&r.getWritable()}if(n!==null){const r=he(n);r!==null&&r.getWritable()}}}function vt(){return dr()?null:le()._compositionKey}function he(n,e){const t=(e||ht())._nodeMap.get(n);return t===void 0?null:t}function al(n,e){const t=Ou(n,le());return t!==void 0?he(t,e):null}function Ou(n,e){return n[`__lexicalKey_${e._key}`]}function pn(n,e){let t=n;for(;t!=null;){const r=al(t,e);if(r!==null)return r;t=or(t)}return null}function ll(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function ao(n){return n.read(()=>fe().getTextContent())}function fe(){return cl(ht())}function cl(n){return n._nodeMap.get("root")}function Re(n){Ce();const e=ht();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function on(n){const e=le(),t=function(r,u){let i=r;for(;i!=null;){const s=Ou(i,u);if(s!==void 0)return s;i=or(i)}return null}(n,e);return t===null?n===e.getRootElement()?he("root"):null:he(t)}function lo(n,e){return e?n.getTextContentSize():0}function fl(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function _s(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function dl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function hl(n){return n.nodeType===Nt?n.nodeValue:null}function xs(n,e,t){const r=Be(e._window);if(r===null)return;const u=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(u!==null){let o=hl(u);const a=pn(u);if(o!==null&&P(a)){if(o===Nu&&t){const l=t.length;o=t,i=l,s=l}o!==null&&vs(a,o,i,s,n)}}}function vs(n,e,t,r,u){let i=n;if(i.isAttached()&&(u||!i.isDirty())){const s=i.isComposing();let o=e;(s||u)&&e[e.length-1]===Nu&&(o=e.slice(0,-1));const a=i.getTextContent();if(u||o!==a){if(o===""){if(_e(null),ku||ur||as)i.remove();else{const m=le();setTimeout(()=>{m.update(()=>{i.isAttached()&&i.remove()})},20)}return}const l=i.getParent(),f=fr(),h=i.getTextContentSize(),c=vt(),d=i.getKey();if(i.isToken()||c!==null&&d===c&&!s||D(f)&&(l!==null&&!l.canInsertTextBefore()&&f.anchor.offset===0||f.anchor.key===n.__key&&f.anchor.offset===0&&!i.canInsertTextBefore()&&!s||f.focus.key===n.__key&&f.focus.offset===h&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const p=z();if(!D(p)||t===null||r===null)return void i.setTextContent(o);if(p.setTextNodeRange(i,t,i,r),i.isSegmented()){const m=ce(i.getTextContent());i.replace(m),i=m}i.setTextContent(o)}}}function bf(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),u=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||u||function(i){const s=i.getPreviousSibling();return(P(s)||k(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||u)}function co(n){return n==="ArrowLeft"}function fo(n){return n==="ArrowRight"}function Pn(n,e){return je?n:e}function ho(n){return n==="Enter"}function En(n){return n==="Backspace"}function kn(n){return n==="Delete"}function po(n,e,t){return n.toLowerCase()==="a"&&Pn(e,t)}function yf(){const n=fe();Re(il(n.select(0,n.getChildrenSize())))}function Mn(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const u=n[e];if(typeof u=="string"){const i=eu(u);return t[e]=i,i}return u}function ws(n,e,t,r,u){if(t.size===0)return;const i=r.__type,s=r.__key,o=e.get(i);o===void 0&&M(33,i);const a=o.klass;let l=n.get(a);l===void 0&&(l=new Map,n.set(a,l));const f=l.get(s),h=f==="destroyed"&&u==="created";(f===void 0||h)&&l.set(s,h?"updated":u)}function go(n,e,t){const r=n.getParent();let u=t,i=n;return r!==null&&(e&&t===0?(u=i.getIndexWithinParent(),i=r):e||t!==i.getChildrenSize()||(u=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(e?u-1:u)}function Hn(n,e){const t=n.offset;if(n.type==="element")return go(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const u=e?r.getPreviousSibling():r.getNextSibling();return u===null?go(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):u}}return null}function pl(n){const e=Du(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function q(n,e,t){return Bl(n,e,t)}function Iu(n){return!we(n)&&!n.isLastChild()&&!n.isInline()}function uu(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&M(75,e),t}function or(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function Rn(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Du(n){const e=n._window;return e===null&&M(78),e}function _f(n){let e=n.getParentOrThrow();for(;e!==null;){if(ct(e))return e;e=e.getParentOrThrow()}return e}function ct(n){return we(n)||k(n)&&n.isShadowRoot()}function At(n){const e=le(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&M(200,n.constructor.name,t);const{replace:u,replaceWithKlass:i}=r;if(u!==null){const s=u(n),o=s.constructor;return i!==null?s instanceof i||M(201,i.name,i.getType(),o.name,o.getType(),n.constructor.name,t):s instanceof n.constructor&&o!==n.constructor||M(202,o.name,o.getType(),n.constructor.name,t),s.__key===n.__key&&M(203,n.constructor.name,t,o.name,o.getType()),s}return n}function Qu(n,e){!we(n.getParent())||k(e)||ue(e)||M(99)}function Yu(n){return(ue(n)||k(n)&&!n.canBeEmpty())&&!n.isInline()}function Ss(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function xf(n,e,t){let r=n._blockCursorElement;if(D(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const u=t.anchor,i=u.getNode(),s=u.offset;let o=!1,a=null;if(s===i.getChildrenSize())Yu(i.getChildAtIndex(s-1))&&(o=!0);else{const l=i.getChildAtIndex(s);if(l!==null&&Yu(l)){const f=l.getPreviousSibling();(f===null||Yu(f))&&(o=!0,a=n.getElementByKey(l.__key))}}if(o){const l=n.getElementByKey(i.__key);return r===null&&(n._blockCursorElement=r=function(f){const h=f.theme,c=document.createElement("div");c.contentEditable="false",c.setAttribute("data-lexical-cursor","true");let d=h.blockCursor;if(d!==void 0){if(typeof d=="string"){const p=eu(d);d=h.blockCursor=p}d!==void 0&&c.classList.add(...d)}return c}(n._config)),e.style.caretColor="transparent",void(a===null?l.appendChild(r):l.insertBefore(r,a))}}r!==null&&Ss(r,n,e)}function Be(n){return Ve?(n||window).getSelection():null}function vf(n){return Jt(n)&&n.tagName==="A"}function Jt(n){return n.nodeType===1}function mo(n){return n.nodeType===11}function _i(n){const e=new RegExp(/^(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|#text)$/,"i");return n.nodeName.match(e)!==null}function iu(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function _t(n){if(ue(n)&&!n.isInline())return!0;if(!k(n)||ct(n))return!1;const e=n.getFirstChild(),t=e===null||Et(e)||P(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function Nn(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function wf(){return le()}const bo=new WeakMap,Sf=new Map;function Tf(n){if(!n._readOnly&&n.isEmpty())return Sf;n._readOnly||M(192);let e=bo.get(n);if(!e){e=new Map,bo.set(n,e);for(const[t,r]of n._nodeMap){const u=r.__type;let i=e.get(u);i||(i=new Map,e.set(u,i)),i.set(t,r)}}return e}function Ts(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function Cf(n,e){const t=(parseInt(n.style.paddingInlineStart,10)||0)/40;e.setIndent(t)}function Ef(n){return n.__lexicalUnmanaged===!0}function gl(n,e,t,r,u,i){let s=n.getFirstChild();for(;s!==null;){const o=s.__key;s.__parent===e&&(k(s)&&gl(s,o,t,r,u,i),t.has(o)||i.delete(o),u.push(o)),s=s.getNextSibling()}}let kt,Se,Vn,Pu,xi,vi,$t,He,wi,Gn,de="",ve="",Xe=null,qe="",ot="",ml=!1,Kn=!1,zr=null;function su(n,e){const t=$t.get(n);if(e!==null){const r=Ci(n);r.parentNode===e&&e.removeChild(r)}if(He.has(n)||Se._keyToDOMMap.delete(n),k(t)){const r=au(t,$t);Si(r,0,r.length-1,null)}t!==void 0&&ws(Gn,Vn,Pu,t,"destroyed")}function Si(n,e,t,r){let u=e;for(;u<=t;++u){const i=n[u];i!==void 0&&su(i,r)}}function Rt(n,e){n.setProperty("text-align",e)}const kf="40px";function bl(n,e){const t=kt.theme.indent;if(typeof t=="string"){const u=n.classList.contains(t);e>0&&!u?n.classList.add(t):e<1&&u&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||kf;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function yl(n,e){const t=n.style;e===0?Rt(t,""):e===cs?Rt(t,"left"):e===fs?Rt(t,"center"):e===ds?Rt(t,"right"):e===hs?Rt(t,"justify"):e===ps?Rt(t,"start"):e===gs&&Rt(t,"end")}function ou(n,e){const t=He.get(n);t===void 0&&M(60);const r=t.createDOM(kt,Se);if(function(u,i,s){const o=s._keyToDOMMap;(function(a,l,f){a[`__lexicalKey_${l._key}`]=f})(i,s,u),o.set(u,i)}(n,r,Se),P(t)?r.setAttribute("data-lexical-text","true"):ue(t)&&r.setAttribute("data-lexical-decorator","true"),k(t)){const u=t.__indent,i=t.__size;if(u!==0&&bl(r,u),i!==0){const o=i-1;(function(a,l,f,h){const c=ve;ve="",Ti(a,f,0,l,f.getDOMSlot(h)),xl(f,h),ve=c})(au(t,He),o,t,r)}const s=t.__format;s!==0&&yl(r,s),t.isInline()||_l(null,t,r),Iu(t)&&(de+=lt,ot+=lt)}else{const u=t.getTextContent();if(ue(t)){const i=t.decorate(Se,kt);i!==null&&vl(n,i),r.contentEditable="false"}else P(t)&&(t.isDirectionless()||(ve+=u));de+=u,ot+=u}return e!==null&&e.insertChild(r),ws(Gn,Vn,Pu,t,"created"),r}function Ti(n,e,t,r,u){const i=de;de="";let s=t;for(;s<=r;++s){ou(n[s],u);const o=He.get(n[s]);o!==null&&P(o)&&(Xe===null&&(Xe=o.getFormat()),qe===""&&(qe=o.getStyle()))}Iu(e)&&(de+=lt),u.element.__lexicalTextContent=de,de=i+de}function yo(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return Et(r)?"line-break":ue(r)&&r.isInline()?"decorator":null}return"empty"}return null}function _l(n,e,t){const r=yo(n,$t),u=yo(e,He);r!==u&&e.getDOMSlot(t).setManagedLineBreak(u)}function xl(n,e){const t=e.__lexicalDirTextContent||"",r=e.__lexicalDir||"";if(t!==ve||r!==zr){const i=ve==="",s=i?zr:(u=ve,ef.test(u)?"rtl":tf.test(u)?"ltr":null);if(s!==r){const o=e.classList,a=kt.theme;let l=r!==null?a[r]:void 0,f=s!==null?a[s]:void 0;if(l!==void 0){if(typeof l=="string"){const h=eu(l);l=a[r]=h}o.remove(...l)}if(s===null||i&&s==="ltr")e.removeAttribute("dir");else{if(f!==void 0){if(typeof f=="string"){const h=eu(f);f=a[s]=h}f!==void 0&&o.add(...f)}e.dir=s}Kn||(n.getWritable().__dir=s)}zr=s,e.__lexicalDirTextContent=ve,e.__lexicalDir=s}var u}function Nf(n,e,t){const r=ve;var u;ve="",Xe=null,qe="",function(i,s,o){const a=de,l=i.__size,f=s.__size;de="";const h=o.element;if(l===1&&f===1){const c=i.__first,d=s.__first;if(c===d)Ln(c,h);else{const m=Ci(c),g=ou(d,null);try{h.replaceChild(g,m)}catch(y){if(typeof y=="object"&&y!=null){const b=`${y.toString()} Parent: ${h.tagName}, new child: {tag: ${g.tagName} key: ${d}}, old child: {tag: ${m.tagName}, key: ${c}}.`;throw new Error(b)}throw y}su(c,null)}const p=He.get(d);P(p)&&(Xe===null&&(Xe=p.getFormat()),qe===""&&(qe=p.getStyle()))}else{const c=au(i,$t),d=au(s,He);if(c.length!==l&&M(227),d.length!==f&&M(228),l===0)f!==0&&Ti(d,s,0,f-1,o);else if(f===0){if(l!==0){const p=o.after==null&&o.before==null&&o.element.__lexicalLineBreak==null;Si(c,0,l-1,p?null:h),p&&(h.textContent="")}}else(function(p,m,g,y,b,v){const w=y-1,S=b-1;let T,I,C=v.getFirstChild(),L=0,$=0;for(;L<=w&&$<=S;){const A=m[L],B=g[$];if(A===B)C=ei(Ln(B,v.element)),L++,$++;else{T===void 0&&(T=new Set(m)),I===void 0&&(I=new Set(g));const O=I.has(A),N=T.has(B);if(O)if(N){const U=uu(Se,B);U===C?C=ei(Ln(B,v.element)):(v.withBefore(C).insertChild(U),Ln(B,v.element)),L++,$++}else ou(B,v.withBefore(C)),$++;else C=ei(Ci(A)),su(A,v.element),L++}const _=He.get(B);_!==null&&P(_)&&(Xe===null&&(Xe=_.getFormat()),qe===""&&(qe=_.getStyle()))}const x=L>w,E=$>S;if(x&&!E){const A=g[S+1],B=A===void 0?null:Se.getElementByKey(A);Ti(g,p,$,S,v.withBefore(B))}else E&&!x&&Si(m,L,w,v.element)})(s,c,d,l,f,o)}Iu(s)&&(de+=lt),h.__lexicalTextContent=de,de=a+de}(n,e,e.getDOMSlot(t)),xl(e,t),Ht(u=e)&&Xe!=null&&Xe!==u.__textFormat&&!Kn&&(u.setTextFormat(Xe),u.setTextStyle(qe)),function(i){Ht(i)&&qe!==""&&qe!==i.__textStyle&&!Kn&&i.setTextStyle(qe)}(e),ve=r}function au(n,e){const t=[];let r=n.__first;for(;r!==null;){const u=e.get(r);u===void 0&&M(101),t.push(r),r=u.__next}return t}function Ln(n,e){const t=$t.get(n);let r=He.get(n);t!==void 0&&r!==void 0||M(61);const u=ml||vi.has(n)||xi.has(n),i=uu(Se,n);if(t===r&&!u){if(k(t)){const s=i.__lexicalTextContent;s!==void 0&&(de+=s,ot+=s);const o=i.__lexicalDirTextContent;o!==void 0&&(ve+=o)}else{const s=t.getTextContent();P(t)&&!t.isDirectionless()&&(ve+=s),ot+=s,de+=s}return i}if(t!==r&&u&&ws(Gn,Vn,Pu,r,"updated"),r.updateDOM(t,i,kt)){const s=ou(n,null);return e===null&&M(62),e.replaceChild(s,i),su(n,null),s}if(k(t)&&k(r)){const s=r.__indent;s!==t.__indent&&bl(i,s);const o=r.__format;o!==t.__format&&yl(i,o),u&&(Nf(t,r,i),we(r)||r.isInline()||_l(t,r,i)),Iu(r)&&(de+=lt,ot+=lt)}else{const s=r.getTextContent();if(ue(r)){const o=r.decorate(Se,kt);o!==null&&vl(n,o)}else P(r)&&!r.isDirectionless()&&(ve+=s);de+=s,ot+=s}if(!Kn&&we(r)&&r.__cachedText!==ot){const s=r.getWritable();s.__cachedText=ot,r=s}return i}function vl(n,e){let t=Se._pendingDecorators;const r=Se._decorators;if(t===null){if(r[n]===e)return;t=ll(Se)}t[n]=e}function ei(n){let e=n.nextSibling;return e!==null&&e===Se._blockCursorElement&&(e=e.nextSibling),e}function Af(n,e,t,r,u,i){de="",ot="",ve="",ml=r===hn,zr=null,Se=t,kt=t._config,Vn=t._nodes,Pu=Se._listeners.mutation,xi=u,vi=i,$t=n._nodeMap,He=e._nodeMap,Kn=e._readOnly,wi=new Map(t._keyToDOMMap);const s=new Map;return Gn=s,Ln("root",null),Se=void 0,Vn=void 0,xi=void 0,vi=void 0,$t=void 0,He=void 0,kt=void 0,wi=void 0,Gn=void 0,s}function Ci(n){const e=wi.get(n);return e===void 0&&M(75,n),e}const rt=Object.freeze({}),Ei=30,ki=[["keydown",function(n,e){if(Bn=n.timeStamp,wl=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:u,metaKey:i,altKey:s}=n;if(!q(e,D0,n)&&t!=null){if(function(o,a,l,f){return fo(o)&&!a&&!f&&!l}(t,u,s,i))q(e,za,n);else if(function(o,a,l,f,h){return fo(o)&&!f&&!l&&(a||h)}(t,u,r,s,i))q(e,P0,n);else if(function(o,a,l,f){return co(o)&&!a&&!f&&!l}(t,u,s,i))q(e,$a,n);else if(function(o,a,l,f,h){return co(o)&&!f&&!l&&(a||h)}(t,u,r,s,i))q(e,L0,n);else if(function(o,a,l){return function(f){return f==="ArrowUp"}(o)&&!a&&!l}(t,u,i))q(e,Wa,n);else if(function(o,a,l){return function(f){return f==="ArrowDown"}(o)&&!a&&!l}(t,u,i))q(e,Ha,n);else if(function(o,a){return ho(o)&&a}(t,r))Fn=!0,q(e,Zr,n);else if(function(o){return o===" "}(t))q(e,M0,n);else if(function(o,a){return je&&a&&o.toLowerCase()==="o"}(t,u))n.preventDefault(),Fn=!0,q(e,ln,!0);else if(function(o,a){return ho(o)&&!a}(t,r))Fn=!1,q(e,Zr,n);else if(function(o,a,l,f){return je?!a&&!l&&(En(o)||o.toLowerCase()==="h"&&f):!(f||a||l)&&En(o)}(t,s,i,u))En(t)?q(e,Va,n):(n.preventDefault(),q(e,jt,!0));else if(function(o){return o==="Escape"}(t))q(e,Ga,n);else if(function(o,a,l,f,h){return je?!(l||f||h)&&(kn(o)||o.toLowerCase()==="d"&&a):!(a||f||h)&&kn(o)}(t,u,r,s,i))kn(t)?q(e,Ka,n):(n.preventDefault(),q(e,jt,!1));else if(function(o,a,l){return En(o)&&(je?a:l)}(t,s,u))n.preventDefault(),q(e,$n,!0);else if(function(o,a,l){return kn(o)&&(je?a:l)}(t,s,u))n.preventDefault(),q(e,$n,!1);else if(function(o,a){return je&&a&&En(o)}(t,i))n.preventDefault(),q(e,Wn,!0);else if(function(o,a){return je&&a&&kn(o)}(t,i))n.preventDefault(),q(e,Wn,!1);else if(function(o,a,l,f){return o.toLowerCase()==="b"&&!a&&Pn(l,f)}(t,s,i,u))n.preventDefault(),q(e,We,"bold");else if(function(o,a,l,f){return o.toLowerCase()==="u"&&!a&&Pn(l,f)}(t,s,i,u))n.preventDefault(),q(e,We,"underline");else if(function(o,a,l,f){return o.toLowerCase()==="i"&&!a&&Pn(l,f)}(t,s,i,u))n.preventDefault(),q(e,We,"italic");else if(function(o,a,l,f){return o==="Tab"&&!a&&!l&&!f}(t,s,u,i))q(e,R0,n);else if(function(o,a,l,f){return o.toLowerCase()==="z"&&!a&&Pn(l,f)}(t,r,i,u))n.preventDefault(),q(e,is,void 0);else if(function(o,a,l,f){return je?o.toLowerCase()==="z"&&l&&a:o.toLowerCase()==="y"&&f||o.toLowerCase()==="z"&&f&&a}(t,r,i,u))n.preventDefault(),q(e,ss,void 0);else{const o=e._editorState._selection;o===null||D(o)?!Ct&&po(t,i,u)&&(n.preventDefault(),q(e,bi,n)):function(a,l,f,h){return!l&&a.toLowerCase()==="c"&&(je?f:h)}(t,r,i,u)?(n.preventDefault(),q(e,Eu,n)):function(a,l,f,h){return!l&&a.toLowerCase()==="x"&&(je?f:h)}(t,r,i,u)?(n.preventDefault(),q(e,os,n)):po(t,i,u)&&(n.preventDefault(),q(e,bi,n))}(function(o,a,l,f){return o||a||l||f})(u,r,s,i)&&q(e,H0,n)}}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&Ae(e,()=>{ue(pn(t))||(Ai=!0)})}],["compositionstart",function(n,e){Ae(e,()=>{const t=z();if(D(t)&&!e.isComposing()){const r=t.anchor,u=t.anchor.getNode();_e(r.key),(n.timeStamp<Bn+Ei||r.type==="element"||!t.isCollapsed()||u.getFormat()!==t.format||P(u)&&u.getStyle()!==t.style)&&q(e,cn,Y0)}})}],["compositionend",function(n,e){Ct?An=!0:Ae(e,()=>{ti(e,n.data)})}],["input",function(n,e){n.stopPropagation(),Ae(e,()=>{const t=z(),r=n.data,u=El(n);if(r!=null&&D(t)&&Cl(t,u,r,n.timeStamp,!1)){An&&(ti(e,r),An=!1);const i=t.anchor.getNode(),s=Be(e._window);if(s===null)return;const o=t.isBackward(),a=o?t.anchor.offset:t.focus.offset,l=o?t.focus.offset:t.anchor.offset;Xr&&!t.isCollapsed()&&P(i)&&s.anchorNode!==null&&i.getTextContent().slice(0,a)+r+i.getTextContent().slice(a+l)===hl(s.anchorNode)||q(e,cn,r);const f=r.length;Ct&&f>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=f),ku||ur||as||!e.isComposing()||(Bn=0,_e(null))}else xs(!1,e,r!==null?r:void 0),An&&(ti(e,r||void 0),An=!1);Ce(),rl(le())}),rn=null}],["click",function(n,e){Ae(e,()=>{const t=z(),r=Be(e._window),u=fr();if(r){if(D(t)){const i=t.anchor,s=i.getNode();i.type==="element"&&i.offset===0&&t.isCollapsed()&&!we(s)&&fe().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&u!==null&&t.is(u)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()&&(k(s)?s.select(0):s.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const i=r.anchorNode;if(i!==null){const s=i.nodeType;(s===ir||s===Nt)&&Re(Es(u,r,e,n))}}}q(e,Ua,n)})}],["cut",rt],["copy",rt],["dragstart",rt],["dragover",rt],["dragend",rt],["paste",rt],["focus",rt],["blur",rt],["drop",rt]];Xr&&ki.push(["beforeinput",(n,e)=>function(t,r){const u=t.inputType,i=El(t);u==="deleteCompositionText"||Ct&&pl(r)||u!=="insertCompositionText"&&Ae(r,()=>{const s=z();if(u==="deleteContentBackward"){if(s===null){const d=fr();if(!D(d))return;Re(d.clone())}if(D(s)){const d=s.anchor.key===s.focus.key;if(o=t.timeStamp,wl==="MediaLast"&&o<Bn+Ei&&r.isComposing()&&d){if(_e(null),Bn=0,setTimeout(()=>{Ae(r,()=>{_e(null)})},Ei),D(s)){const p=s.anchor.getNode();p.markDirty(),s.format=p.getFormat(),P(p)||M(142),s.style=p.getStyle()}}else{_e(null),t.preventDefault();const p=s.anchor.getNode(),m=p.getTextContent(),g=p.canInsertTextAfter(),y=s.anchor.offset===0&&s.focus.offset===m.length;K0&&d&&!y&&g||q(r,jt,!0)}return}}var o;if(!D(s))return;const a=t.data;rn!==null&&xs(!1,r,rn),s.dirty&&rn===null||!s.isCollapsed()||we(s.anchor.getNode())||i===null||s.applyDOMRange(i),rn=null;const l=s.anchor,f=s.focus,h=l.getNode(),c=f.getNode();if(u!=="insertText"&&u!=="insertTranspose")switch(t.preventDefault(),u){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":q(r,cn,t);break;case"insertFromComposition":_e(null),q(r,cn,t);break;case"insertLineBreak":_e(null),q(r,ln,!1);break;case"insertParagraph":_e(null),Fn&&!ur?(Fn=!1,q(r,ln,!1)):q(r,zn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":q(r,rr,t);break;case"deleteByComposition":(function(d,p){return d!==p||k(d)||k(p)||!d.isToken()||!p.isToken()})(h,c)&&q(r,mi,t);break;case"deleteByDrag":case"deleteByCut":q(r,mi,t);break;case"deleteContent":q(r,jt,!1);break;case"deleteWordBackward":q(r,$n,!0);break;case"deleteWordForward":q(r,$n,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":q(r,Wn,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":q(r,Wn,!1);break;case"formatStrikeThrough":q(r,We,"strikethrough");break;case"formatBold":q(r,We,"bold");break;case"formatItalic":q(r,We,"italic");break;case"formatUnderline":q(r,We,"underline");break;case"historyUndo":q(r,is,void 0);break;case"historyRedo":q(r,ss,void 0)}else{if(a===`
4
4
  `)t.preventDefault(),q(r,ln,!1);else if(a===lt)t.preventDefault(),q(r,zn,void 0);else if(a==null&&t.dataTransfer){const d=t.dataTransfer.getData("text/plain");t.preventDefault(),s.insertRawText(d)}else a!=null&&Cl(s,i,a,t.timeStamp,!0)?(t.preventDefault(),q(r,cn,a)):rn=a;Sl=t.timeStamp}})}(n,e)]);let Bn=0,wl=null,Sl=0,rn=null;const lu=new WeakMap;let Ni=!1,Ai=!1,Fn=!1,An=!1,Tl=[0,"",0,"root",0];function Cl(n,e,t,r,u){const i=n.anchor,s=n.focus,o=i.getNode(),a=le(),l=Be(a._window),f=l!==null?l.anchorNode:null,h=i.key,c=a.getElementByKey(h),d=t.length;return h!==s.key||!P(o)||(!u&&(!Xr||Sl<r+50)||o.isDirty()&&d<2||fl(t))&&i.offset!==s.offset&&!o.isComposing()||Bt(o)||o.isDirty()&&d>1||(u||!Xr)&&c!==null&&!o.isComposing()&&f!==tu(c)||l!==null&&e!==null&&(!e.collapsed||e.startContainer!==l.anchorNode||e.startOffset!==l.anchorOffset)||o.getFormat()!==n.format||o.getStyle()!==n.style||bf(n,o)}function _o(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===Nt&&e!==0&&e!==n.nodeValue.length}function xo(n,e,t){const{anchorNode:r,anchorOffset:u,focusNode:i,focusOffset:s}=n;Ni&&(Ni=!1,_o(r,u)&&_o(i,s))||Ae(e,()=>{if(!t)return void Re(null);if(!sr(e,r,i))return;const o=z();if(D(o)){const a=o.anchor,l=a.getNode();if(o.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(o.dirty=!0);const f=Du(e).event,h=f?f.timeStamp:performance.now(),[c,d,p,m,g]=Tl,y=fe(),b=e.isComposing()===!1&&y.getTextContent()==="";if(h<g+200&&a.offset===p&&a.key===m)o.format=c,o.style=d;else if(a.type==="text")P(l)||M(141),o.format=l.getFormat(),o.style=l.getStyle();else if(a.type==="element"&&!b){const v=a.getNode();o.style="",v instanceof vn&&v.getChildrenSize()===0?(o.format=v.getTextFormat(),o.style=v.getTextStyle()):o.format=0}}else{const f=a.key,h=o.focus.key,c=o.getNodes(),d=c.length,p=o.isBackward(),m=p?s:u,g=p?u:s,y=p?h:f,b=p?f:h;let v=Q0,w=!1;for(let S=0;S<d;S++){const T=c[S],I=T.getTextContentSize();if(P(T)&&I!==0&&!(S===0&&T.__key===y&&m===I||S===d-1&&T.__key===b&&g===0)&&(w=!0,v&=T.getFormat(),v===0))break}o.format=w?v:0}}q(e,Cu,void 0)})}function El(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function ti(n,e){const t=n._compositionKey;if(_e(null),t!==null&&e!=null){if(e===""){const r=he(t),u=tu(n.getElementByKey(t));return void(u!==null&&u.nodeValue!==null&&P(r)&&vs(r,u.nodeValue,null,null,!0))}if(e[e.length-1]===`
@@ -54,5 +54,5 @@ vulnerable to XSS attacks. Please remove it from \`allowedTags\`.
54
54
  Or, to disable this warning, add the \`allowVulnerableTags\` option
55
55
  and ensure you are accounting for this risk.
56
56
 
57
- `)});const o=e.nonTextTags||["script","style","textarea","option"];let a,l;e.allowedAttributes&&(a={},l={},sn(e.allowedAttributes,function(_,O){a[O]=[];const N=[];_.forEach(function(U){typeof U=="string"&&U.indexOf("*")>=0?N.push(Fa(U).replace(/\\\*/g,".*")):a[O].push(U)}),N.length&&(l[O]=new RegExp("^("+N.join("|")+")$"))}));const f={},h={},c={};sn(e.allowedClasses,function(_,O){if(a&&(st(a,O)||(a[O]=[]),a[O].push("class")),f[O]=_,Array.isArray(_)){const N=[];f[O]=[],c[O]=[],_.forEach(function(U){typeof U=="string"&&U.indexOf("*")>=0?N.push(Fa(U).replace(/\\\*/g,".*")):U instanceof RegExp?c[O].push(U):f[O].push(U)}),N.length&&(h[O]=new RegExp("^("+N.join("|")+")$"))}});const d={};let p;sn(e.transformTags,function(_,O){let N;typeof _=="function"?N=_:typeof _=="string"&&(N=nr.simpleTransform(_)),O==="*"?p=N:d[O]=N});let m,g,y,b,v,w,S=!1;I();const T=new R1.Parser({onopentag:function(_,O){if(e.onOpenTag&&e.onOpenTag(_,O),e.enforceHtmlBoundary&&_==="html"&&I(),v){w++;return}const N=new i(_,O);g.push(N);let U=!1;const Y=!!N.text;let ee;if(st(d,_)&&(ee=d[_](_,O),N.attribs=O=ee.attribs,ee.text!==void 0&&(N.innerText=ee.text),_!==ee.tagName&&(N.name=_=ee.tagName,b[m]=ee.tagName)),p&&(ee=p(_,O),N.attribs=O=ee.attribs,_!==ee.tagName&&(N.name=_=ee.tagName,b[m]=ee.tagName)),(!s(_)||e.disallowedTagsMode==="recursiveEscape"&&!z1(y)||e.nestingLimit!=null&&m>=e.nestingLimit)&&(U=!0,y[m]=!0,(e.disallowedTagsMode==="discard"||e.disallowedTagsMode==="completelyDiscard")&&o.indexOf(_)!==-1&&(v=!0,w=1)),m++,U){if(e.disallowedTagsMode==="discard"||e.disallowedTagsMode==="completelyDiscard"){if(N.innerText&&!Y){const H=C(N.innerText);e.textFilter?r+=e.textFilter(H,_):r+=H,S=!0}return}u=r,r=""}r+="<"+_,_==="script"&&(e.allowedScriptHostnames||e.allowedScriptDomains)&&(N.innerText=""),U&&(e.disallowedTagsMode==="escape"||e.disallowedTagsMode==="recursiveEscape")&&e.preserveEscapedAttributes?sn(O,function(H,W){r+=" "+W+'="'+C(H||"",!0)+'"'}):(!a||st(a,_)||a["*"])&&sn(O,function(H,W){if(!H1.test(W)){delete N.attribs[W];return}if(H===""&&!e.allowedEmptyAttributes.includes(W)&&(e.nonBooleanAttributes.includes(W)||e.nonBooleanAttributes.includes("*"))){delete N.attribs[W];return}let pe=!1;if(!a||st(a,_)&&a[_].indexOf(W)!==-1||a["*"]&&a["*"].indexOf(W)!==-1||st(l,_)&&l[_].test(W)||l["*"]&&l["*"].test(W))pe=!0;else if(a&&a[_]){for(const K of a[_])if(B1(K)&&K.name&&K.name===W){pe=!0;let X="";if(K.multiple===!0){const ye=H.split(" ");for(const ge of ye)K.values.indexOf(ge)!==-1&&(X===""?X=ge:X+=" "+ge)}else K.values.indexOf(H)>=0&&(X=H);H=X}}if(pe){if(e.allowedSchemesAppliedToAttributes.indexOf(W)!==-1&&L(_,H)){delete N.attribs[W];return}if(_==="script"&&W==="src"){let K=!0;try{const X=$(H);if(e.allowedScriptHostnames||e.allowedScriptDomains){const ye=(e.allowedScriptHostnames||[]).find(function(xe){return xe===X.url.hostname}),ge=(e.allowedScriptDomains||[]).find(function(xe){return X.url.hostname===xe||X.url.hostname.endsWith(`.${xe}`)});K=ye||ge}}catch{K=!1}if(!K){delete N.attribs[W];return}}if(_==="iframe"&&W==="src"){let K=!0;try{const X=$(H);if(X.isRelativeUrl)K=st(e,"allowIframeRelativeUrls")?e.allowIframeRelativeUrls:!e.allowedIframeHostnames&&!e.allowedIframeDomains;else if(e.allowedIframeHostnames||e.allowedIframeDomains){const ye=(e.allowedIframeHostnames||[]).find(function(xe){return xe===X.url.hostname}),ge=(e.allowedIframeDomains||[]).find(function(xe){return X.url.hostname===xe||X.url.hostname.endsWith(`.${xe}`)});K=ye||ge}}catch{K=!1}if(!K){delete N.attribs[W];return}}if(W==="srcset")try{let K=F1(H);if(K.forEach(function(X){L("srcset",X.url)&&(X.evil=!0)}),K=qa(K,function(X){return!X.evil}),K.length)H=$1(qa(K,function(X){return!X.evil})),N.attribs[W]=H;else{delete N.attribs[W];return}}catch{delete N.attribs[W];return}if(W==="class"){const K=f[_],X=f["*"],ye=h[_],ge=c[_],xe=c["*"],Ju=h["*"],Sr=[ye,Ju].concat(ge,xe).filter(function(Cn){return Cn});if(K&&X?H=B(H,ja(K,X),Sr):H=B(H,K||X,Sr),!H.length){delete N.attribs[W];return}}if(W==="style"){if(e.parseStyleAttributes)try{const K=j1(_+" {"+H+"}",{map:!1}),X=x(K,e.allowedStyles);if(H=E(X),H.length===0){delete N.attribs[W];return}}catch{typeof window<"u"&&console.warn('Failed to parse "'+_+" {"+H+`}", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547`),delete N.attribs[W];return}else if(e.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.")}r+=" "+W,H&&H.length?r+='="'+C(H,!0)+'"':e.allowedEmptyAttributes.includes(W)&&(r+='=""')}else delete N.attribs[W]}),e.selfClosing.indexOf(_)!==-1?r+=" />":(r+=">",N.innerText&&!Y&&!e.textFilter&&(r+=C(N.innerText),S=!0)),U&&(r=u+C(r),u=""),N.openingTagLength=r.length-N.tagPosition},ontext:function(_){if(v)return;const O=g[g.length-1];let N;if(O&&(N=O.tag,_=O.innerText!==void 0?O.innerText:_),e.disallowedTagsMode==="completelyDiscard"&&!s(N))_="";else if((e.disallowedTagsMode==="discard"||e.disallowedTagsMode==="completelyDiscard")&&(N==="script"||N==="style"))r+=_;else if(!S){const U=C(_,!1);e.textFilter?r+=e.textFilter(U,N):r+=U}if(g.length){const U=g[g.length-1];U.text+=_}},onclosetag:function(_,O){if(e.onCloseTag&&e.onCloseTag(_,O),v)if(w--,!w)v=!1;else return;const N=g.pop();if(!N)return;if(N.tag!==_){g.push(N);return}v=e.enforceHtmlBoundary?_==="html":!1,m--;const U=y[m];if(U){if(delete y[m],e.disallowedTagsMode==="discard"||e.disallowedTagsMode==="completelyDiscard"){N.updateParentNodeText();return}u=r,r=""}if(b[m]&&(_=b[m],delete b[m]),e.exclusiveFilter){const Y=e.exclusiveFilter(N);if(Y==="excludeTag"){U&&(r=u,u=""),r=r.substring(0,N.tagPosition)+r.substring(N.tagPosition+N.openingTagLength);return}else if(Y){r=r.substring(0,N.tagPosition);return}}if(N.updateParentNodeMediaChildren(),N.updateParentNodeText(),e.selfClosing.indexOf(_)!==-1||O&&!s(_)&&["escape","recursiveEscape"].indexOf(e.disallowedTagsMode)>=0){U&&(r=u,u="");return}r+="</"+_+">",U&&(r=u+C(r),u=""),S=!1}},e.parser);if(T.write(n),T.end(),e.disallowedTagsMode==="escape"||e.disallowedTagsMode==="recursiveEscape"){const _=T.endIndex;if(_!=null&&_>=0&&_<n.length){const O=n.substring(_);r+=C(O)}else(_==null||_<0)&&n.length>0&&r===""&&(r=C(n))}return r;function I(){r="",m=0,g=[],y={},b={},v=!1,w=0}function C(_,O){return typeof _!="string"&&(_=_+""),e.parser.decodeEntities&&(_=_.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),O&&(_=_.replace(/"/g,"&quot;"))),_=_.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),O&&(_=_.replace(/"/g,"&quot;")),_}function L(_,O){for(O=O.replace(/[\x00-\x20]+/g,"");;){const Y=O.indexOf("<!--");if(Y===-1)break;const ee=O.indexOf("-->",Y+4);if(ee===-1)break;O=O.substring(0,Y)+O.substring(ee+3)}const N=O.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!N)return O.match(/^[/\\]{2}/)?!e.allowProtocolRelative:!1;const U=N[1].toLowerCase();return st(e.allowedSchemesByTag,_)?e.allowedSchemesByTag[_].indexOf(U)===-1:!e.allowedSchemes||e.allowedSchemes.indexOf(U)===-1}function $(_){if(_=_.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//"),_.startsWith("relative:"))throw new Error("relative: exploit attempt");let O="relative://relative-site";for(let Y=0;Y<100;Y++)O+=`/${Y}`;const N=new URL(_,O);return{isRelativeUrl:N&&N.hostname==="relative-site"&&N.protocol==="relative:",url:N}}function x(_,O){if(!O)return _;const N=_.nodes[0];let U;return O[N.selector]&&O["*"]?U=ja(O[N.selector],O["*"]):U=O[N.selector]||O["*"],U&&(_.nodes[0].nodes=N.nodes.reduce(A(U),[])),_}function E(_){return _.nodes[0].nodes.reduce(function(O,N){return O.push(`${N.prop}:${N.value}${N.important?" !important":""}`),O},[]).join(";")}function A(_){return function(O,N){return st(_,N.prop)&&_[N.prop].some(function(Y){return Y.test(N.value)})&&O.push(N),O}}function B(_,O,N){return O?(_=_.split(/\s+/),_.filter(function(U){return O.indexOf(U)!==-1||N.some(function(Y){return Y.test(U)})}).join(" ")):_}}const V1={decodeEntities:!0};nr.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","menu","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},allowedEmptyAttributes:["alt"],selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0,preserveEscapedAttributes:!1};nr.simpleTransform=function(n,e,t){return t=t===void 0?!0:t,e=e||{},function(r,u){let i;if(t)for(i in e)u[i]=e[i];else u=e;return{tagName:n,attribs:u}}};const pi=wh(W1),C0=xn();class wr extends jl{constructor(t,r,u,i,s,o,a){super(s);Mt(this,"__src");Mt(this,"__alt");Mt(this,"__width");Mt(this,"__height");Mt(this,"__soliboDocumentId");Mt(this,"__soliboDocumentSlot");this.__src=t,this.__alt=r,this.__width=u,this.__height=i,this.__soliboDocumentId=o,this.__soliboDocumentSlot=a}static getType(){return"image"}static clone(t){return new wr(t.__src,t.__alt,t.__width,t.__height,t.__key,t.__soliboDocumentId,t.__soliboDocumentSlot)}static importJSON(t){return Tu({alt:t.alt,height:t.height,soliboDocumentId:t.soliboDocumentId,soliboDocumentSlot:t.soliboDocumentSlot,src:t.src,width:t.width})}exportJSON(){return{alt:this.__alt,height:this.__height,...this.__soliboDocumentId?{soliboDocumentId:this.__soliboDocumentId}:void 0,...this.__soliboDocumentSlot?{soliboDocumentSlot:this.__soliboDocumentSlot}:void 0,src:this.__src,type:"image",version:1,width:this.__width}}static importDOM(){return{img:t=>({conversion:r=>{if(!(r instanceof HTMLImageElement))return null;const u=r.getAttribute("src")??"";if(!u)return null;const i=r.getAttribute("width"),s=r.getAttribute("height");return{node:Tu({alt:r.getAttribute("alt")??"",height:s?Number(s):void 0,soliboDocumentId:r.getAttribute("data-solibo-document-id")??void 0,soliboDocumentSlot:r.getAttribute("data-solibo-document-slot")??void 0,src:u,width:i?Number(i):void 0})}},priority:0})}}exportDOM(){const t=document.createElement("img");return this.__soliboDocumentSlot||t.setAttribute("src",this.__src),this.__soliboDocumentId&&t.setAttribute("data-solibo-document-id",this.__soliboDocumentId),this.__soliboDocumentSlot&&t.setAttribute("data-solibo-document-slot",this.__soliboDocumentSlot),this.__alt&&t.setAttribute("alt",this.__alt),this.__width&&t.setAttribute("width",String(this.__width)),this.__height&&t.setAttribute("height",String(this.__height)),{element:t}}createDOM(){return document.createElement("span")}updateDOM(){return!1}isInline(){return!0}getSrc(){return this.__src}setSrc(t){const r=this.getWritable();return r.__src=t,r}setWidth(t){const r=this.getWritable();return r.__width=t,r.__height=void 0,r}decorate(t){return j.jsx("img",{alt:this.__alt,height:this.__height,"data-solibo-document-id":this.__soliboDocumentId,"data-solibo-document-slot":this.__soliboDocumentSlot,onClick:r=>{r.preventDefault(),t.dispatchCommand(C0,{key:this.getKey(),soliboDocumentSlot:this.__soliboDocumentSlot,src:this.__src,width:this.__width})},src:this.__src,width:this.__width})}}function Tu({alt:n="",height:e,soliboDocumentId:t,soliboDocumentSlot:r,src:u,width:i}){return new wr(u,n,i,e,void 0,t,r)}function gi(n){return n instanceof wr}const G1=({createImages:n})=>{const[e]=De();return R.useEffect(()=>e.registerCommand(rr,t=>{var s;if(!("clipboardData"in t))return!1;const r=t,u=Array.from(((s=r.clipboardData)==null?void 0:s.items)??[]).flatMap(o=>{if(o.kind!=="file"||!o.type.startsWith("image/"))return[];const a=o.getAsFile();return a?[a]:[]});if(u.length===0)return!1;r.preventDefault();const i=n(u);return e.update(()=>{Ru(i.map(o=>Tu(o)))}),!0},Hf),[n,e]),null},K1=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,J1=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,Z1=[n=>{const e=K1.exec(n);return e!=null&&e.length?{index:e.index,length:e[0].length,text:e[0],url:`mailto:${e[0]}`}:null},n=>{const e=J1.exec(n);return e!=null&&e.length?{index:e.index,length:e[0].length,text:e[0],url:e[0].startsWith("http")?e[0]:`https://${e[0]}`}:null}];function us(n){try{const e=new URL(n);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}const X1="_field_h3lp5_3",Q1="_editor_h3lp5_8",Y1="_invalid_h3lp5_46",em="_error_h3lp5_50",tm="_content_h3lp5_56",nm="_files_h3lp5_60",rm="_placeholder_h3lp5_68",um="_fill_h3lp5_76",im="_meta_h3lp5_99",sm="_active_h3lp5_108",om="_submit_h3lp5_127",am="_bold_h3lp5_131",lm="_italic_h3lp5_135",cm="_underline_h3lp5_139",fm="_link_h3lp5_143",dm="_list_h3lp5_149",hm="_paragraph_h3lp5_150",ae={field:X1,editor:Q1,"has-files":"_has-files_h3lp5_42",invalid:Y1,error:em,content:tm,files:nm,placeholder:rm,fill:um,"fill-editor":"_fill-editor_h3lp5_83",meta:im,active:sm,"image-sizes":"_image-sizes_h3lp5_120",submit:om,bold:am,italic:lm,underline:cm,link:fm,list:dm,paragraph:hm},pm=[{label:"Small",width:320},{label:"Medium",width:640},{label:"Large",width:960},{label:"Original",width:void 0}],gm=({disabled:n=!1,isSubmitting:e=!1,onFilesSelected:t,onInlineImageRemove:r,onSubmit:u,submitLabel:i="Submit"})=>{const[s]=De(),[o,a]=R.useState(!1),[l,f]=R.useState(!1),[h,c]=R.useState(!1),[d,p]=R.useState(!1),[m,g]=R.useState(!1),[y,b]=R.useState(!1),[v,w]=R.useState(""),[S,T]=R.useState(null),[I,C]=R.useState(null),[L,$]=R.useState(void 0),[x,E]=R.useState(""),A=us(x.trim()),B=R.useRef(null),_=R.useRef(null),O=R.useRef(null),N=R.useRef(null),U=R.useRef(!1),Y=F=>F.preventDefault(),ee=R.useCallback(F=>{N.current=D(F)?F.clone():null},[]),G=R.useCallback(F=>{s.update(()=>{N.current&&Re(N.current),F()}),N.current=null},[s]),ie=F=>{U.current=!0,F.preventDefault()},H=()=>{if(U.current){U.current=!1;return}ge()},W=R.useCallback(()=>{f(!1),w(""),T(null),C(null),$(void 0)},[]),pe=R.useCallback(()=>{g(!1),E("")},[]),K=R.useCallback(F=>{f(!0),w((F==null?void 0:F.src)??""),T((F==null?void 0:F.key)??null),C((F==null?void 0:F.soliboDocumentSlot)??null),$(F==null?void 0:F.width),pe(),F!=null&&F.soliboDocumentSlot||setTimeout(()=>{var se;return(se=_.current)==null?void 0:se.focus()},0)},[pe]),X=R.useCallback(F=>{s.getEditorState().read(()=>{ee(z())}),g(!0),E(F),W(),setTimeout(()=>{var se;return(se=O.current)==null?void 0:se.focus()},0)},[W,s,ee]),ye=R.useCallback(()=>{const F=x.trim();us(F)&&(G(()=>{s.dispatchCommand(dn,{url:F,target:"_blank"});const se=z();if(!D(se))return;const Ke=se.getNodes().at(-1)??null,Lt=(Ke==null?void 0:Ke.getParent())??null,Pe=$e(Ke)?Ke:$e(Lt)?Lt:null;if(Pe){const bt=Pe.getLastChild();if(P(bt)){const Qs=bt.getTextContent(),Ys=Qs.replace(/\s+$/,"");Ys!==Qs&&bt.setTextContent(Ys)}const en=Pe.getNextSibling();if(P(en)&&/^\s/.test(en.getTextContent())){en.select(1,1);return}const Fe=ce(" ");Pe.insertAfter(Fe),Fe.selectEnd()}}),pe())},[pe,s,x,G]),ge=R.useCallback(()=>{const F=v.trim();if(!F){W();return}s.update(()=>{if(S){const se=he(S);gi(se)&&se.setSrc(F);return}Ru([Tu({src:F})])}),W()},[W,s,S,v]),xe=R.useCallback(()=>{if(!S){W();return}s.update(()=>{const F=he(S);if(gi(F)){const se=F.getParent();Ht(se)&&se.getChildrenSize()===1?se.remove():F.remove(),I&&(r==null||r(I))}}),W()},[W,s,S,I,r]),Ju=R.useCallback(F=>{S&&(s.update(()=>{const se=he(S);gi(se)&&se.setWidth(F)}),$(F))},[s,S]),Sr=R.useCallback(()=>{G(()=>{s.dispatchCommand(dn,null)}),pe()},[pe,s,G]),Cn=R.useCallback(()=>{const F=z();if(!D(F)){if(Me(F)){const Lt=F.getNodes(),Pe=Lt[0]??null,bt=(Pe==null?void 0:Pe.getParent())??null;a(Lt.some(Fe=>P(Fe)&&Fe.hasFormat("bold"))),c(Lt.some(Fe=>P(Fe)&&Fe.hasFormat("italic"))),p(Lt.some(Fe=>P(Fe)&&Fe.hasFormat("underline"))),b(Q(bt)||oe(bt)||Q(Pe)||oe(Pe));const en=$e(Pe)?Pe:$e(bt)?bt:null;if(en){g(!0),E(en.getURL());return}g(!1),E(""),N.current=null;return}a(!1),c(!1),p(!1),b(!1),g(!1),E(""),N.current=null;return}const[se]=F.getNodes(),Ke=(se==null?void 0:se.getParent())??null;if(a(F.hasFormat("bold")),c(F.hasFormat("italic")),p(F.hasFormat("underline")),b(Q(Ke)||oe(Ke)),$e(Ke)){g(!0),E(Ke.getURL()),ee(F);return}g(!1),E(""),N.current=null},[ee]);return R.useEffect(()=>pt(s.registerUpdateListener(({editorState:F})=>{F.read(()=>{Cn()})}),s.registerCommand(C0,F=>(K(F),!0),at),s.registerCommand(Cu,()=>(s.getEditorState().read(()=>{Cn()}),!1),at)),[s,K,Cn]),j.jsxs(A0.Toolbar,{variant:"editor","data-component":"editortoolbar",children:[j.jsx(Le.Button,{"aria-label":"Bold","data-active":o,onClick:()=>{s.dispatchCommand(We,"bold")},title:"Bold",variant:"tertiary",children:j.jsx(Je.Icon,{name:"TextB"})}),j.jsx(Le.Button,{"aria-label":"Italic","data-active":h,onClick:()=>{s.dispatchCommand(We,"italic")},title:"Italic",variant:"tertiary",children:j.jsx(Je.Icon,{name:"TextItalic"})}),j.jsx(Le.Button,{"aria-label":"Underline","data-active":d,onClick:()=>{s.dispatchCommand(We,"underline")},title:"Underline",variant:"tertiary",children:j.jsx(Je.Icon,{name:"TextUnderline"})}),j.jsx(Le.Button,{"aria-label":"List","data-active":y,onClick:()=>{y?s.dispatchCommand(uc,void 0):s.dispatchCommand(rc,void 0)},title:"List",variant:"tertiary",children:j.jsx(Je.Icon,{name:"ListBullets"})}),j.jsx(Le.Button,{"aria-label":"Link","data-active":m,onClick:()=>{m?X(x):(s.dispatchCommand(dn,{url:"https://"}),X("https://"))},title:"Link",variant:"tertiary",children:j.jsx(Je.Icon,{name:"Link"})}),t&&j.jsxs(j.Fragment,{children:[j.jsx("input",{hidden:!0,multiple:!0,onChange:F=>{F.target.files&&t(F.target.files),F.target.value=""},ref:B,type:"file"}),j.jsx(Le.Button,{"aria-label":"Upload files",onClick:()=>{var F;return(F=B.current)==null?void 0:F.click()},title:"Upload files",variant:"tertiary",children:j.jsx(Je.Icon,{name:"Paperclip"})})]}),u&&j.jsx(Le.Button,{"aria-label":i,className:ae.submit,disabled:n,icon:"PaperPlaneTilt",isLoading:e,onClick:()=>u(),variant:"primary",children:j.jsx("span",{children:i})}),j.jsxs("div",{className:Jr.t(ae.meta,m||l?ae.active:""),children:[m&&j.jsxs(j.Fragment,{children:[j.jsx(to.Input,{"aria-invalid":!A,onBlur:()=>ye(),onChange:F=>E(F.target.value),onKeyDown:F=>{F.key==="Enter"&&(F.preventDefault(),ye())},ref:O,value:x}),j.jsx(Le.Button,{"aria-label":"Apply link",disabled:!A,onClick:()=>{ye()},onMouseDown:Y,variant:"tertiary",children:j.jsx(Je.Icon,{name:"Check"})}),j.jsx(Le.Button,{"aria-label":"Remove link",onClick:()=>Sr(),onMouseDown:Y,variant:"tertiary",children:j.jsx(Je.Icon,{name:"Trash",variant:"danger"})})]}),l&&j.jsxs(j.Fragment,{children:[!I&&j.jsxs(j.Fragment,{children:[j.jsx(to.Input,{className:Jr.t(ae.active),onBlur:H,onChange:F=>w(F.target.value),onKeyDown:F=>{F.key==="Enter"&&(F.preventDefault(),U.current=!0,ge())},ref:_,value:v}),j.jsx(Le.Button,{"aria-label":"Apply image",onClick:()=>ge(),onMouseDown:ie,variant:"tertiary",children:j.jsx(Je.Icon,{name:"Check"})})]}),j.jsx("div",{className:ae["image-sizes"],children:pm.map(({label:F,width:se})=>j.jsx(Le.Button,{"aria-label":`${F} image`,"data-active":L===se,onClick:()=>Ju(se),onMouseDown:Y,variant:"tertiary",children:F},F))}),j.jsx(Le.Button,{"aria-label":"Remove image",onClick:()=>xe(),onMouseDown:ie,variant:"tertiary",children:j.jsx(Je.Icon,{name:"Trash",variant:"danger"})})]})]})]})};function mm({autofocus:n,content:e="",lastEmittedContentRef:t}){const[r]=De();return R.useEffect(()=>{t.current!==e&&r.update(()=>{const i=new DOMParser().parseFromString(e,"text/html"),s=Gl(r,i),o=fe();o.clear().select(),Ru(s),n?o.selectEnd():Re(null)})},[n,e,r,t]),null}const bm=({autofocus:n=!1,autolink:e=!1,content:t,disabled:r=!1,errorMessage:u,fill:i=!1,files:s,inline:o=!1,inlineImages:a,invalid:l=!1,isSubmitting:f=!1,maxRows:h=12,minRows:c=1,onChange:d,onFilesChange:p,onInlineImagesChange:m,onSubmit:g,onUpload:y,placeholder:b,required:v=!1,submitLabel:w})=>{const S=R.useId(),T=R.useRef(void 0),[I,C]=R.useState([]),[L,$]=R.useState([]),x=R.useRef(new Map),E=s??I,A=a??L,B=G=>{s===void 0&&C(G),p==null||p(G)},_=R.useCallback(G=>{a===void 0&&$(G),m==null||m(G)},[a,m]),O=R.useCallback(G=>{const ie=G.map(H=>{const W=`pasted-${crypto.randomUUID()}`,pe=URL.createObjectURL(H);return x.current.set(W,pe),{image:{alt:H.name,soliboDocumentSlot:W,src:pe},pending:{file:H,slot:W}}});return _([...A,...ie.map(({pending:H})=>H)]),ie.map(({image:H})=>H)},[A,_]),N=R.useCallback(G=>{_(A.filter(H=>H.slot!==G));const ie=x.current.get(G);ie&&URL.revokeObjectURL(ie),x.current.delete(G)},[A,_]);R.useEffect(()=>()=>{x.current.forEach(G=>URL.revokeObjectURL(G)),x.current.clear()},[]),R.useEffect(()=>{const G=new Set(A.map(ie=>ie.slot));x.current.forEach((ie,H)=>{G.has(H)||(URL.revokeObjectURL(ie),x.current.delete(H))})},[A]);const U=G=>{if(typeof DataTransfer<"u"){const ie=new DataTransfer;return G.forEach(H=>ie.items.add(H)),ie.files}return Object.assign([...G],{item:ie=>G[ie]??null})},Y=async()=>{try{E.length>0&&await(y==null?void 0:y(U(E))),await(g==null?void 0:g()),E.length>0&&B([])}catch{return}},ee={namespace:"Editor",theme:{link:ae.link,list:{ol:ae.list,ul:ae.list},paragraph:ae.paragraph,text:{bold:ae.bold,italic:ae.italic,underline:ae.underline}},onError(G){throw G},nodes:[qu,pr,wn,gr,wr]};return j.jsxs("div",{className:Jr.t(ae.field,i&&ae.fill),"data-component":"editor","data-max-rows":h,"data-min-rows":c,children:[j.jsx("div",{className:Jr.t(ae.editor,i&&ae["fill-editor"],l&&ae.invalid,E.length>0&&ae["has-files"]),style:{"--editor-max-height":`calc(${h*1.25}em + (2 * var(--scale-8)))`,"--editor-min-height":`calc(${c*1.25}em + (2 * var(--scale-8)))`},children:j.jsxs(Dd,{initialConfig:ee,children:[!o&&j.jsx(gm,{disabled:r,isSubmitting:f,onInlineImageRemove:N,onFilesSelected:y||p?G=>{B([...E,...Array.from(G)])}:void 0,onSubmit:g?()=>void Y():void 0,submitLabel:w}),j.jsx("div",{className:ae.content,children:j.jsx(xh,{contentEditable:j.jsx(jd,{"aria-placeholder":b??"",ariaErrorMessage:l&&u?S:void 0,ariaInvalid:l||void 0,ariaRequired:v||void 0,placeholder:()=>b?j.jsx("div",{className:ae.placeholder,children:b}):null}),ErrorBoundary:$d})}),E.length>0&&j.jsx("div",{"aria-label":"Files to upload",className:ae.files,role:"region",children:E.map((G,ie)=>j.jsx(N0.File,{deleteAccessibleLabel:`Remove ${G.name} from upload queue`,name:G.name,onDelete:()=>B(E.filter((H,W)=>W!==ie))},`${G.name}-${G.size}-${G.lastModified}-${ie}`))}),n&&j.jsx(wd,{}),e&&j.jsx(Od,{matchers:Z1}),j.jsx(Xd,{}),m&&j.jsx(G1,{createImages:O}),t!==void 0&&j.jsx(mm,{autofocus:n,content:t,lastEmittedContentRef:T}),j.jsx(Qd,{validateUrl:us}),j.jsx(Yd,{}),d&&j.jsx(th,{onChange:(G,ie)=>{G.read(()=>{const H=Kl(ie,null),W=pi(H,{allowedAttributes:{...pi.defaults.allowedAttributes,img:[...pi.defaults.allowedAttributes.img??[],"data-solibo-document-id","data-solibo-document-slot"]},allowedTags:["a","b","br","i","img","li","ol","p","u","ul"]});T.current=W,d(W)})}})]})}),l&&u&&j.jsx("div",{className:ae.error,id:S,children:u})]})};exports.Editor=bm;
57
+ `)});const o=e.nonTextTags||["script","style","textarea","option"];let a,l;e.allowedAttributes&&(a={},l={},sn(e.allowedAttributes,function(_,O){a[O]=[];const N=[];_.forEach(function(U){typeof U=="string"&&U.indexOf("*")>=0?N.push(Fa(U).replace(/\\\*/g,".*")):a[O].push(U)}),N.length&&(l[O]=new RegExp("^("+N.join("|")+")$"))}));const f={},h={},c={};sn(e.allowedClasses,function(_,O){if(a&&(st(a,O)||(a[O]=[]),a[O].push("class")),f[O]=_,Array.isArray(_)){const N=[];f[O]=[],c[O]=[],_.forEach(function(U){typeof U=="string"&&U.indexOf("*")>=0?N.push(Fa(U).replace(/\\\*/g,".*")):U instanceof RegExp?c[O].push(U):f[O].push(U)}),N.length&&(h[O]=new RegExp("^("+N.join("|")+")$"))}});const d={};let p;sn(e.transformTags,function(_,O){let N;typeof _=="function"?N=_:typeof _=="string"&&(N=nr.simpleTransform(_)),O==="*"?p=N:d[O]=N});let m,g,y,b,v,w,S=!1;I();const T=new R1.Parser({onopentag:function(_,O){if(e.onOpenTag&&e.onOpenTag(_,O),e.enforceHtmlBoundary&&_==="html"&&I(),v){w++;return}const N=new i(_,O);g.push(N);let U=!1;const Y=!!N.text;let ee;if(st(d,_)&&(ee=d[_](_,O),N.attribs=O=ee.attribs,ee.text!==void 0&&(N.innerText=ee.text),_!==ee.tagName&&(N.name=_=ee.tagName,b[m]=ee.tagName)),p&&(ee=p(_,O),N.attribs=O=ee.attribs,_!==ee.tagName&&(N.name=_=ee.tagName,b[m]=ee.tagName)),(!s(_)||e.disallowedTagsMode==="recursiveEscape"&&!z1(y)||e.nestingLimit!=null&&m>=e.nestingLimit)&&(U=!0,y[m]=!0,(e.disallowedTagsMode==="discard"||e.disallowedTagsMode==="completelyDiscard")&&o.indexOf(_)!==-1&&(v=!0,w=1)),m++,U){if(e.disallowedTagsMode==="discard"||e.disallowedTagsMode==="completelyDiscard"){if(N.innerText&&!Y){const H=C(N.innerText);e.textFilter?r+=e.textFilter(H,_):r+=H,S=!0}return}u=r,r=""}r+="<"+_,_==="script"&&(e.allowedScriptHostnames||e.allowedScriptDomains)&&(N.innerText=""),U&&(e.disallowedTagsMode==="escape"||e.disallowedTagsMode==="recursiveEscape")&&e.preserveEscapedAttributes?sn(O,function(H,W){r+=" "+W+'="'+C(H||"",!0)+'"'}):(!a||st(a,_)||a["*"])&&sn(O,function(H,W){if(!H1.test(W)){delete N.attribs[W];return}if(H===""&&!e.allowedEmptyAttributes.includes(W)&&(e.nonBooleanAttributes.includes(W)||e.nonBooleanAttributes.includes("*"))){delete N.attribs[W];return}let pe=!1;if(!a||st(a,_)&&a[_].indexOf(W)!==-1||a["*"]&&a["*"].indexOf(W)!==-1||st(l,_)&&l[_].test(W)||l["*"]&&l["*"].test(W))pe=!0;else if(a&&a[_]){for(const K of a[_])if(B1(K)&&K.name&&K.name===W){pe=!0;let X="";if(K.multiple===!0){const ye=H.split(" ");for(const ge of ye)K.values.indexOf(ge)!==-1&&(X===""?X=ge:X+=" "+ge)}else K.values.indexOf(H)>=0&&(X=H);H=X}}if(pe){if(e.allowedSchemesAppliedToAttributes.indexOf(W)!==-1&&L(_,H)){delete N.attribs[W];return}if(_==="script"&&W==="src"){let K=!0;try{const X=$(H);if(e.allowedScriptHostnames||e.allowedScriptDomains){const ye=(e.allowedScriptHostnames||[]).find(function(xe){return xe===X.url.hostname}),ge=(e.allowedScriptDomains||[]).find(function(xe){return X.url.hostname===xe||X.url.hostname.endsWith(`.${xe}`)});K=ye||ge}}catch{K=!1}if(!K){delete N.attribs[W];return}}if(_==="iframe"&&W==="src"){let K=!0;try{const X=$(H);if(X.isRelativeUrl)K=st(e,"allowIframeRelativeUrls")?e.allowIframeRelativeUrls:!e.allowedIframeHostnames&&!e.allowedIframeDomains;else if(e.allowedIframeHostnames||e.allowedIframeDomains){const ye=(e.allowedIframeHostnames||[]).find(function(xe){return xe===X.url.hostname}),ge=(e.allowedIframeDomains||[]).find(function(xe){return X.url.hostname===xe||X.url.hostname.endsWith(`.${xe}`)});K=ye||ge}}catch{K=!1}if(!K){delete N.attribs[W];return}}if(W==="srcset")try{let K=F1(H);if(K.forEach(function(X){L("srcset",X.url)&&(X.evil=!0)}),K=qa(K,function(X){return!X.evil}),K.length)H=$1(qa(K,function(X){return!X.evil})),N.attribs[W]=H;else{delete N.attribs[W];return}}catch{delete N.attribs[W];return}if(W==="class"){const K=f[_],X=f["*"],ye=h[_],ge=c[_],xe=c["*"],Ju=h["*"],Sr=[ye,Ju].concat(ge,xe).filter(function(Cn){return Cn});if(K&&X?H=B(H,ja(K,X),Sr):H=B(H,K||X,Sr),!H.length){delete N.attribs[W];return}}if(W==="style"){if(e.parseStyleAttributes)try{const K=j1(_+" {"+H+"}",{map:!1}),X=x(K,e.allowedStyles);if(H=E(X),H.length===0){delete N.attribs[W];return}}catch{typeof window<"u"&&console.warn('Failed to parse "'+_+" {"+H+`}", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547`),delete N.attribs[W];return}else if(e.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.")}r+=" "+W,H&&H.length?r+='="'+C(H,!0)+'"':e.allowedEmptyAttributes.includes(W)&&(r+='=""')}else delete N.attribs[W]}),e.selfClosing.indexOf(_)!==-1?r+=" />":(r+=">",N.innerText&&!Y&&!e.textFilter&&(r+=C(N.innerText),S=!0)),U&&(r=u+C(r),u=""),N.openingTagLength=r.length-N.tagPosition},ontext:function(_){if(v)return;const O=g[g.length-1];let N;if(O&&(N=O.tag,_=O.innerText!==void 0?O.innerText:_),e.disallowedTagsMode==="completelyDiscard"&&!s(N))_="";else if((e.disallowedTagsMode==="discard"||e.disallowedTagsMode==="completelyDiscard")&&(N==="script"||N==="style"))r+=_;else if(!S){const U=C(_,!1);e.textFilter?r+=e.textFilter(U,N):r+=U}if(g.length){const U=g[g.length-1];U.text+=_}},onclosetag:function(_,O){if(e.onCloseTag&&e.onCloseTag(_,O),v)if(w--,!w)v=!1;else return;const N=g.pop();if(!N)return;if(N.tag!==_){g.push(N);return}v=e.enforceHtmlBoundary?_==="html":!1,m--;const U=y[m];if(U){if(delete y[m],e.disallowedTagsMode==="discard"||e.disallowedTagsMode==="completelyDiscard"){N.updateParentNodeText();return}u=r,r=""}if(b[m]&&(_=b[m],delete b[m]),e.exclusiveFilter){const Y=e.exclusiveFilter(N);if(Y==="excludeTag"){U&&(r=u,u=""),r=r.substring(0,N.tagPosition)+r.substring(N.tagPosition+N.openingTagLength);return}else if(Y){r=r.substring(0,N.tagPosition);return}}if(N.updateParentNodeMediaChildren(),N.updateParentNodeText(),e.selfClosing.indexOf(_)!==-1||O&&!s(_)&&["escape","recursiveEscape"].indexOf(e.disallowedTagsMode)>=0){U&&(r=u,u="");return}r+="</"+_+">",U&&(r=u+C(r),u=""),S=!1}},e.parser);if(T.write(n),T.end(),e.disallowedTagsMode==="escape"||e.disallowedTagsMode==="recursiveEscape"){const _=T.endIndex;if(_!=null&&_>=0&&_<n.length){const O=n.substring(_);r+=C(O)}else(_==null||_<0)&&n.length>0&&r===""&&(r=C(n))}return r;function I(){r="",m=0,g=[],y={},b={},v=!1,w=0}function C(_,O){return typeof _!="string"&&(_=_+""),e.parser.decodeEntities&&(_=_.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),O&&(_=_.replace(/"/g,"&quot;"))),_=_.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),O&&(_=_.replace(/"/g,"&quot;")),_}function L(_,O){for(O=O.replace(/[\x00-\x20]+/g,"");;){const Y=O.indexOf("<!--");if(Y===-1)break;const ee=O.indexOf("-->",Y+4);if(ee===-1)break;O=O.substring(0,Y)+O.substring(ee+3)}const N=O.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!N)return O.match(/^[/\\]{2}/)?!e.allowProtocolRelative:!1;const U=N[1].toLowerCase();return st(e.allowedSchemesByTag,_)?e.allowedSchemesByTag[_].indexOf(U)===-1:!e.allowedSchemes||e.allowedSchemes.indexOf(U)===-1}function $(_){if(_=_.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//"),_.startsWith("relative:"))throw new Error("relative: exploit attempt");let O="relative://relative-site";for(let Y=0;Y<100;Y++)O+=`/${Y}`;const N=new URL(_,O);return{isRelativeUrl:N&&N.hostname==="relative-site"&&N.protocol==="relative:",url:N}}function x(_,O){if(!O)return _;const N=_.nodes[0];let U;return O[N.selector]&&O["*"]?U=ja(O[N.selector],O["*"]):U=O[N.selector]||O["*"],U&&(_.nodes[0].nodes=N.nodes.reduce(A(U),[])),_}function E(_){return _.nodes[0].nodes.reduce(function(O,N){return O.push(`${N.prop}:${N.value}${N.important?" !important":""}`),O},[]).join(";")}function A(_){return function(O,N){return st(_,N.prop)&&_[N.prop].some(function(Y){return Y.test(N.value)})&&O.push(N),O}}function B(_,O,N){return O?(_=_.split(/\s+/),_.filter(function(U){return O.indexOf(U)!==-1||N.some(function(Y){return Y.test(U)})}).join(" ")):_}}const V1={decodeEntities:!0};nr.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","menu","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},allowedEmptyAttributes:["alt"],selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0,preserveEscapedAttributes:!1};nr.simpleTransform=function(n,e,t){return t=t===void 0?!0:t,e=e||{},function(r,u){let i;if(t)for(i in e)u[i]=e[i];else u=e;return{tagName:n,attribs:u}}};const pi=wh(W1),C0=xn();class wr extends jl{constructor(t,r,u,i,s,o,a){super(s);Mt(this,"__src");Mt(this,"__alt");Mt(this,"__width");Mt(this,"__height");Mt(this,"__soliboDocumentId");Mt(this,"__soliboDocumentSlot");this.__src=t,this.__alt=r,this.__width=u,this.__height=i,this.__soliboDocumentId=o,this.__soliboDocumentSlot=a}static getType(){return"image"}static clone(t){return new wr(t.__src,t.__alt,t.__width,t.__height,t.__key,t.__soliboDocumentId,t.__soliboDocumentSlot)}static importJSON(t){return Tu({alt:t.alt,height:t.height,soliboDocumentId:t.soliboDocumentId,soliboDocumentSlot:t.soliboDocumentSlot,src:t.src,width:t.width})}exportJSON(){return{alt:this.__alt,height:this.__height,...this.__soliboDocumentId?{soliboDocumentId:this.__soliboDocumentId}:void 0,...this.__soliboDocumentSlot?{soliboDocumentSlot:this.__soliboDocumentSlot}:void 0,src:this.__src,type:"image",version:1,width:this.__width}}static importDOM(){return{img:t=>({conversion:r=>{if(!(r instanceof HTMLImageElement))return null;const u=r.getAttribute("src")??"";if(!u)return null;const i=r.getAttribute("width"),s=r.getAttribute("height");return{node:Tu({alt:r.getAttribute("alt")??"",height:s?Number(s):void 0,soliboDocumentId:r.getAttribute("data-solibo-document-id")??void 0,soliboDocumentSlot:r.getAttribute("data-solibo-document-slot")??void 0,src:u,width:i?Number(i):void 0})}},priority:0})}}exportDOM(){const t=document.createElement("img");return this.__soliboDocumentSlot||t.setAttribute("src",this.__src),this.__soliboDocumentId&&t.setAttribute("data-solibo-document-id",this.__soliboDocumentId),this.__soliboDocumentSlot&&t.setAttribute("data-solibo-document-slot",this.__soliboDocumentSlot),this.__alt&&t.setAttribute("alt",this.__alt),this.__width&&t.setAttribute("width",String(this.__width)),this.__height&&t.setAttribute("height",String(this.__height)),{element:t}}createDOM(){return document.createElement("span")}updateDOM(){return!1}isInline(){return!0}getSrc(){return this.__src}setSrc(t){const r=this.getWritable();return r.__src=t,r}setWidth(t){const r=this.getWritable();return r.__width=t,r.__height=void 0,r}decorate(t){return j.jsx("img",{alt:this.__alt,height:this.__height,"data-solibo-document-id":this.__soliboDocumentId,"data-solibo-document-slot":this.__soliboDocumentSlot,onClick:r=>{r.preventDefault(),t.dispatchCommand(C0,{key:this.getKey(),soliboDocumentSlot:this.__soliboDocumentSlot,src:this.__src,width:this.__width})},src:this.__src,width:this.__width})}}function Tu({alt:n="",height:e,soliboDocumentId:t,soliboDocumentSlot:r,src:u,width:i}){return new wr(u,n,i,e,void 0,t,r)}function gi(n){return n instanceof wr}const G1=({createImages:n})=>{const[e]=De();return R.useEffect(()=>e.registerCommand(rr,t=>{var s;if(!("clipboardData"in t))return!1;const r=t,u=Array.from(((s=r.clipboardData)==null?void 0:s.items)??[]).flatMap(o=>{if(o.kind!=="file"||!o.type.startsWith("image/"))return[];const a=o.getAsFile();return a?[a]:[]});if(u.length===0)return!1;r.preventDefault();const i=n(u);return e.update(()=>{Ru(i.map(o=>Tu(o)))}),!0},Hf),[n,e]),null},K1=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,J1=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,Z1=[n=>{const e=K1.exec(n);return e!=null&&e.length?{index:e.index,length:e[0].length,text:e[0],url:`mailto:${e[0]}`}:null},n=>{const e=J1.exec(n);return e!=null&&e.length?{index:e.index,length:e[0].length,text:e[0],url:e[0].startsWith("http")?e[0]:`https://${e[0]}`}:null}];function us(n){try{const e=new URL(n);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}const X1="_field_h3lp5_3",Q1="_editor_h3lp5_8",Y1="_invalid_h3lp5_46",em="_error_h3lp5_50",tm="_content_h3lp5_56",nm="_files_h3lp5_60",rm="_placeholder_h3lp5_68",um="_fill_h3lp5_76",im="_meta_h3lp5_99",sm="_active_h3lp5_108",om="_submit_h3lp5_127",am="_bold_h3lp5_131",lm="_italic_h3lp5_135",cm="_underline_h3lp5_139",fm="_link_h3lp5_143",dm="_list_h3lp5_149",hm="_paragraph_h3lp5_150",ae={field:X1,editor:Q1,"has-files":"_has-files_h3lp5_42",invalid:Y1,error:em,content:tm,files:nm,placeholder:rm,fill:um,"fill-editor":"_fill-editor_h3lp5_83",meta:im,active:sm,"image-sizes":"_image-sizes_h3lp5_120",submit:om,bold:am,italic:lm,underline:cm,link:fm,list:dm,paragraph:hm},pm=[{label:"Small",width:320},{label:"Medium",width:640},{label:"Large",width:960},{label:"Original",width:void 0}],gm=({disabled:n=!1,isSubmitting:e=!1,onFilesSelected:t,onInlineImageRemove:r,onSubmit:u,submitLabel:i="Submit"})=>{const[s]=De(),[o,a]=R.useState(!1),[l,f]=R.useState(!1),[h,c]=R.useState(!1),[d,p]=R.useState(!1),[m,g]=R.useState(!1),[y,b]=R.useState(!1),[v,w]=R.useState(""),[S,T]=R.useState(null),[I,C]=R.useState(null),[L,$]=R.useState(void 0),[x,E]=R.useState(""),A=us(x.trim()),B=R.useRef(null),_=R.useRef(null),O=R.useRef(null),N=R.useRef(null),U=R.useRef(!1),Y=F=>F.preventDefault(),ee=R.useCallback(F=>{N.current=D(F)?F.clone():null},[]),G=R.useCallback(F=>{s.update(()=>{N.current&&Re(N.current),F()}),N.current=null},[s]),ie=F=>{U.current=!0,F.preventDefault()},H=()=>{if(U.current){U.current=!1;return}ge()},W=R.useCallback(()=>{f(!1),w(""),T(null),C(null),$(void 0)},[]),pe=R.useCallback(()=>{g(!1),E("")},[]),K=R.useCallback(F=>{f(!0),w((F==null?void 0:F.src)??""),T((F==null?void 0:F.key)??null),C((F==null?void 0:F.soliboDocumentSlot)??null),$(F==null?void 0:F.width),pe(),F!=null&&F.soliboDocumentSlot||setTimeout(()=>{var se;return(se=_.current)==null?void 0:se.focus()},0)},[pe]),X=R.useCallback(F=>{s.getEditorState().read(()=>{ee(z())}),g(!0),E(F),W(),setTimeout(()=>{var se;return(se=O.current)==null?void 0:se.focus()},0)},[W,s,ee]),ye=R.useCallback(()=>{const F=x.trim();us(F)&&(G(()=>{s.dispatchCommand(dn,{url:F,target:"_blank"});const se=z();if(!D(se))return;const Ke=se.getNodes().at(-1)??null,Lt=(Ke==null?void 0:Ke.getParent())??null,Pe=$e(Ke)?Ke:$e(Lt)?Lt:null;if(Pe){const bt=Pe.getLastChild();if(P(bt)){const Qs=bt.getTextContent(),Ys=Qs.replace(/\s+$/,"");Ys!==Qs&&bt.setTextContent(Ys)}const en=Pe.getNextSibling();if(P(en)&&/^\s/.test(en.getTextContent())){en.select(1,1);return}const Fe=ce(" ");Pe.insertAfter(Fe),Fe.selectEnd()}}),pe())},[pe,s,x,G]),ge=R.useCallback(()=>{const F=v.trim();if(!F){W();return}s.update(()=>{if(S){const se=he(S);gi(se)&&se.setSrc(F);return}Ru([Tu({src:F})])}),W()},[W,s,S,v]),xe=R.useCallback(()=>{if(!S){W();return}s.update(()=>{const F=he(S);if(gi(F)){const se=F.getParent();Ht(se)&&se.getChildrenSize()===1?se.remove():F.remove(),I&&(r==null||r(I))}}),W()},[W,s,S,I,r]),Ju=R.useCallback(F=>{S&&(s.update(()=>{const se=he(S);gi(se)&&se.setWidth(F)}),$(F))},[s,S]),Sr=R.useCallback(()=>{G(()=>{s.dispatchCommand(dn,null)}),pe()},[pe,s,G]),Cn=R.useCallback(()=>{const F=z();if(!D(F)){if(Me(F)){const Lt=F.getNodes(),Pe=Lt[0]??null,bt=(Pe==null?void 0:Pe.getParent())??null;a(Lt.some(Fe=>P(Fe)&&Fe.hasFormat("bold"))),c(Lt.some(Fe=>P(Fe)&&Fe.hasFormat("italic"))),p(Lt.some(Fe=>P(Fe)&&Fe.hasFormat("underline"))),b(Q(bt)||oe(bt)||Q(Pe)||oe(Pe));const en=$e(Pe)?Pe:$e(bt)?bt:null;if(en){g(!0),E(en.getURL());return}g(!1),E(""),N.current=null;return}a(!1),c(!1),p(!1),b(!1),g(!1),E(""),N.current=null;return}const[se]=F.getNodes(),Ke=(se==null?void 0:se.getParent())??null;if(a(F.hasFormat("bold")),c(F.hasFormat("italic")),p(F.hasFormat("underline")),b(Q(Ke)||oe(Ke)),$e(Ke)){g(!0),E(Ke.getURL()),ee(F);return}g(!1),E(""),N.current=null},[ee]);return R.useEffect(()=>pt(s.registerUpdateListener(({editorState:F})=>{F.read(()=>{Cn()})}),s.registerCommand(C0,F=>(K(F),!0),at),s.registerCommand(Cu,()=>(s.getEditorState().read(()=>{Cn()}),!1),at)),[s,K,Cn]),j.jsxs(A0.Toolbar,{variant:"editor","data-component":"editortoolbar",children:[j.jsx(Le.Button,{"aria-label":"Bold","data-active":o,onClick:()=>{s.dispatchCommand(We,"bold")},title:"Bold",variant:"tertiary",children:j.jsx(Je.Icon,{name:"TextB"})}),j.jsx(Le.Button,{"aria-label":"Italic","data-active":h,onClick:()=>{s.dispatchCommand(We,"italic")},title:"Italic",variant:"tertiary",children:j.jsx(Je.Icon,{name:"TextItalic"})}),j.jsx(Le.Button,{"aria-label":"Underline","data-active":d,onClick:()=>{s.dispatchCommand(We,"underline")},title:"Underline",variant:"tertiary",children:j.jsx(Je.Icon,{name:"TextUnderline"})}),j.jsx(Le.Button,{"aria-label":"List","data-active":y,onClick:()=>{y?s.dispatchCommand(uc,void 0):s.dispatchCommand(rc,void 0)},title:"List",variant:"tertiary",children:j.jsx(Je.Icon,{name:"ListBullets"})}),j.jsx(Le.Button,{"aria-label":"Link","data-active":m,onClick:()=>{m?X(x):(s.dispatchCommand(dn,{url:"https://"}),X("https://"))},title:"Link",variant:"tertiary",children:j.jsx(Je.Icon,{name:"Link"})}),t&&j.jsxs(j.Fragment,{children:[j.jsx("input",{hidden:!0,multiple:!0,onChange:F=>{F.target.files&&t(F.target.files),F.target.value=""},ref:B,type:"file"}),j.jsx(Le.Button,{"aria-label":"Upload files",onClick:()=>{var F;return(F=B.current)==null?void 0:F.click()},title:"Upload files",variant:"tertiary",children:j.jsx(Je.Icon,{name:"Paperclip"})})]}),u&&j.jsx(Le.Button,{"aria-label":i,className:ae.submit,"data-cy":"toolbar-submit-button",disabled:n,icon:"PaperPlaneTilt",isLoading:e,onClick:()=>u(),variant:"primary",children:j.jsx("span",{children:i})}),j.jsxs("div",{className:Jr.t(ae.meta,m||l?ae.active:""),children:[m&&j.jsxs(j.Fragment,{children:[j.jsx(to.Input,{"aria-invalid":!A,onBlur:()=>ye(),onChange:F=>E(F.target.value),onKeyDown:F=>{F.key==="Enter"&&(F.preventDefault(),ye())},ref:O,value:x}),j.jsx(Le.Button,{"aria-label":"Apply link",disabled:!A,onClick:()=>{ye()},onMouseDown:Y,variant:"tertiary",children:j.jsx(Je.Icon,{name:"Check"})}),j.jsx(Le.Button,{"aria-label":"Remove link",onClick:()=>Sr(),onMouseDown:Y,variant:"tertiary",children:j.jsx(Je.Icon,{name:"Trash",variant:"danger"})})]}),l&&j.jsxs(j.Fragment,{children:[!I&&j.jsxs(j.Fragment,{children:[j.jsx(to.Input,{className:Jr.t(ae.active),onBlur:H,onChange:F=>w(F.target.value),onKeyDown:F=>{F.key==="Enter"&&(F.preventDefault(),U.current=!0,ge())},ref:_,value:v}),j.jsx(Le.Button,{"aria-label":"Apply image",onClick:()=>ge(),onMouseDown:ie,variant:"tertiary",children:j.jsx(Je.Icon,{name:"Check"})})]}),j.jsx("div",{className:ae["image-sizes"],children:pm.map(({label:F,width:se})=>j.jsx(Le.Button,{"aria-label":`${F} image`,"data-active":L===se,onClick:()=>Ju(se),onMouseDown:Y,variant:"tertiary",children:F},F))}),j.jsx(Le.Button,{"aria-label":"Remove image",onClick:()=>xe(),onMouseDown:ie,variant:"tertiary",children:j.jsx(Je.Icon,{name:"Trash",variant:"danger"})})]})]})]})};function mm({autofocus:n,content:e="",lastEmittedContentRef:t}){const[r]=De();return R.useEffect(()=>{t.current!==e&&r.update(()=>{const i=new DOMParser().parseFromString(e,"text/html"),s=Gl(r,i),o=fe();o.clear().select(),Ru(s),n?o.selectEnd():Re(null)})},[n,e,r,t]),null}const bm=({autofocus:n=!1,autolink:e=!1,content:t,disabled:r=!1,errorMessage:u,fill:i=!1,files:s,inline:o=!1,inlineImages:a,invalid:l=!1,isSubmitting:f=!1,maxRows:h=12,minRows:c=1,onChange:d,onFilesChange:p,onInlineImagesChange:m,onSubmit:g,onUpload:y,placeholder:b,required:v=!1,submitLabel:w})=>{const S=R.useId(),T=R.useRef(void 0),[I,C]=R.useState([]),[L,$]=R.useState([]),x=R.useRef(new Map),E=s??I,A=a??L,B=G=>{s===void 0&&C(G),p==null||p(G)},_=R.useCallback(G=>{a===void 0&&$(G),m==null||m(G)},[a,m]),O=R.useCallback(G=>{const ie=G.map(H=>{const W=`pasted-${crypto.randomUUID()}`,pe=URL.createObjectURL(H);return x.current.set(W,pe),{image:{alt:H.name,soliboDocumentSlot:W,src:pe},pending:{file:H,slot:W}}});return _([...A,...ie.map(({pending:H})=>H)]),ie.map(({image:H})=>H)},[A,_]),N=R.useCallback(G=>{_(A.filter(H=>H.slot!==G));const ie=x.current.get(G);ie&&URL.revokeObjectURL(ie),x.current.delete(G)},[A,_]);R.useEffect(()=>()=>{x.current.forEach(G=>URL.revokeObjectURL(G)),x.current.clear()},[]),R.useEffect(()=>{const G=new Set(A.map(ie=>ie.slot));x.current.forEach((ie,H)=>{G.has(H)||(URL.revokeObjectURL(ie),x.current.delete(H))})},[A]);const U=G=>{if(typeof DataTransfer<"u"){const ie=new DataTransfer;return G.forEach(H=>ie.items.add(H)),ie.files}return Object.assign([...G],{item:ie=>G[ie]??null})},Y=async()=>{try{E.length>0&&await(y==null?void 0:y(U(E))),await(g==null?void 0:g()),E.length>0&&B([])}catch{return}},ee={namespace:"Editor",theme:{link:ae.link,list:{ol:ae.list,ul:ae.list},paragraph:ae.paragraph,text:{bold:ae.bold,italic:ae.italic,underline:ae.underline}},onError(G){throw G},nodes:[qu,pr,wn,gr,wr]};return j.jsxs("div",{className:Jr.t(ae.field,i&&ae.fill),"data-component":"editor","data-max-rows":h,"data-min-rows":c,children:[j.jsx("div",{className:Jr.t(ae.editor,i&&ae["fill-editor"],l&&ae.invalid,E.length>0&&ae["has-files"]),style:{"--editor-max-height":`calc(${h*1.25}em + (2 * var(--scale-8)))`,"--editor-min-height":`calc(${c*1.25}em + (2 * var(--scale-8)))`},children:j.jsxs(Dd,{initialConfig:ee,children:[!o&&j.jsx(gm,{disabled:r,isSubmitting:f,onInlineImageRemove:N,onFilesSelected:y||p?G=>{B([...E,...Array.from(G)])}:void 0,onSubmit:g?()=>void Y():void 0,submitLabel:w}),j.jsx("div",{className:ae.content,children:j.jsx(xh,{contentEditable:j.jsx(jd,{"aria-placeholder":b??"",ariaErrorMessage:l&&u?S:void 0,ariaInvalid:l||void 0,ariaRequired:v||void 0,placeholder:()=>b?j.jsx("div",{className:ae.placeholder,children:b}):null}),ErrorBoundary:$d})}),E.length>0&&j.jsx("div",{"aria-label":"Files to upload",className:ae.files,role:"region",children:E.map((G,ie)=>j.jsx(N0.File,{deleteAccessibleLabel:`Remove ${G.name} from upload queue`,name:G.name,onDelete:()=>B(E.filter((H,W)=>W!==ie))},`${G.name}-${G.size}-${G.lastModified}-${ie}`))}),n&&j.jsx(wd,{}),e&&j.jsx(Od,{matchers:Z1}),j.jsx(Xd,{}),m&&j.jsx(G1,{createImages:O}),t!==void 0&&j.jsx(mm,{autofocus:n,content:t,lastEmittedContentRef:T}),j.jsx(Qd,{validateUrl:us}),j.jsx(Yd,{}),d&&j.jsx(th,{onChange:(G,ie)=>{G.read(()=>{const H=Kl(ie,null),W=pi(H,{allowedAttributes:{...pi.defaults.allowedAttributes,img:[...pi.defaults.allowedAttributes.img??[],"data-solibo-document-id","data-solibo-document-slot"]},allowedTags:["a","b","br","i","img","li","ol","p","u","ul"]});T.current=W,d(W)})}})]})}),l&&u&&j.jsx("div",{className:ae.error,id:S,children:u})]})};exports.Editor=bm;
58
58
  //# sourceMappingURL=index.cjs.map