@junbyeol/tiptap-editor 1.0.5 → 1.0.6
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.
Potentially problematic release.
This version of @junbyeol/tiptap-editor might be problematic. Click here for more details.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),ot=require("@tiptap/react"),x=require("react"),Q=require("@tiptap/pm/state"),ne=require("@tiptap/pm/tables"),_c=require("react-dom"),w=require("@tiptap/core"),no=require("@tiptap/core/jsx-runtime"),Ch=require("@tiptap/pm/model"),nt=require("@tiptap/pm/view"),ri=require("@tiptap/pm/gapcursor"),wh=require("@tiptap/pm/dropcursor"),Cn=require("@tiptap/pm/history"),Za=require("react-dom/client"),Sc=require("@tiptap/react/menus");function Nc(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const y=Nc(x),Pi=Nc(_c),Ac=x.createContext(null);function xh(){return x.useContext(Ac)}function Tc(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Tc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Rc(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Tc(e))&&(r&&(r+=" "),r+=t);return r}const _h={mod:"⌘",command:"⌘",meta:"⌘",ctrl:"⌃",control:"⌃",alt:"⌥",option:"⌥",shift:"⇧",backspace:"Del",delete:"⌦",enter:"⏎",escape:"⎋",capslock:"⇪"};function ke(...e){return Rc(e)}function Sh(){return typeof navigator<"u"&&navigator.platform.toLowerCase().includes("mac")}const Nh=(e,t,n=!0)=>{if(t){const r=e.toLowerCase();return _h[r]||(n?e.toUpperCase():e)}return n?e.charAt(0).toUpperCase()+e.slice(1):e},Di=e=>{const{shortcutKeys:t,delimiter:n="+",capitalize:r=!0}=e;return t?t.split(n).map(o=>o.trim()).map(o=>Nh(o,Sh(),r)):[]},Bi=(e,t)=>t?.schema?t.schema.spec.marks.get(e)!==void 0:!1,Ah=(e,t)=>t?.schema?t.schema.spec.nodes.get(e)!==void 0:!1;function Mc(e,t){if(!e)return!1;const n=Array.isArray(t)?t:[t],r=n.some(o=>e.extensionManager.extensions.some(s=>s.name===o));return r||console.warn(`None of the extensions [${n.join(", ")}] were found in the editor schema. Ensure they are included in the editor configuration.`),r}function Ko(e,t=[],n=!1){if(!e||!e.state.selection)return!1;const{selection:r}=e.state;if(r.empty)return!1;if(r instanceof Q.NodeSelection){const o=r.node;return o?t.includes(o.type.name):!1}if(n){const{$from:o}=r;for(let s=o.depth;s>0;s--){const i=o.node(s);if(t.includes(i.type.name))return!0}}return!1}function Th(e,t=[]){if(!e||t.length===0)return!1;const{state:n}=e,{selection:r}=n,o=new Set(t);if(r instanceof Q.NodeSelection){const s=r.node?.type?.name;return!!s&&o.has(s)}if(r instanceof Q.TextSelection||r instanceof Q.AllSelection){let s=!0;return n.doc.nodesBetween(r.from,r.to,i=>i.isTextblock&&!o.has(i.type.name)?(s=!1,!1):s),s}return!1}const Rh=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Mh(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return!e||e.replace(Rh,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}function kh(e,t,n){try{const r=new URL(e,t);if(Mh(r.href,n))return r.href}catch{}return"#"}function Hi({decorative:e,orientation:t="vertical",className:n,...r}){const s=e?{role:"none"}:{"aria-orientation":t==="vertical"?t:void 0,role:"separator"};return u.jsx("div",{className:ke("tiptap-separator",n),"data-orientation":t,...s,...r})}function Oh({editor:e,containerRef:t,query:n,items:r,onSelect:o,onClose:s,orientation:i="vertical",autoSelectFirstItem:a=!0}){const[l,c]=x.useState(a?0:-1);return x.useEffect(()=>{const d=h=>{if(!r.length)return!1;const p=()=>c(g=>g===-1?0:(g+1)%r.length),m=()=>c(g=>g===-1?r.length-1:(g-1+r.length)%r.length);switch(h.key){case"ArrowUp":return i==="horizontal"?!1:(h.preventDefault(),m(),!0);case"ArrowDown":return i==="horizontal"?!1:(h.preventDefault(),p(),!0);case"ArrowLeft":return i==="vertical"?!1:(h.preventDefault(),m(),!0);case"ArrowRight":return i==="vertical"?!1:(h.preventDefault(),p(),!0);case"Tab":return h.preventDefault(),h.shiftKey?m():p(),!0;case"Home":return h.preventDefault(),c(0),!0;case"End":return h.preventDefault(),c(r.length-1),!0;case"Enter":return h.isComposing?!1:(h.preventDefault(),l!==-1&&r[l]&&o?.(r[l]),!0);case"Escape":return h.preventDefault(),s?.(),!0;default:return!1}};let f=null;if(e?f=e.view.dom:t?.current&&(f=t.current),f)return f.addEventListener("keydown",d,!0),()=>{f?.removeEventListener("keydown",d,!0)}},[e,t,r,l,o,s,i]),x.useEffect(()=>{n&&c(a?0:-1)},[n,a]),{selectedIndex:r.length?l:void 0,setSelectedIndex:c}}const qa=(e,t)=>{typeof e=="function"?e(t):e&&typeof e=="object"&&"current"in e&&(e.current=t)},Ih=(e,t)=>{const n=x.useRef(null);return x.useCallback(r=>{e&&"current"in e&&(e.current=r),n.current&&qa(n.current,null),n.current=t,t&&qa(t,r)},[e,t])},Lh=e=>{const[t,n]=x.useState([]),r=x.useCallback(()=>e.current?Array.from(e.current.querySelectorAll('button:not([disabled]), [role="button"]:not([disabled]), [tabindex="0"]:not([disabled])')):[],[e]);x.useEffect(()=>{const s=e.current;if(!s)return;const i=()=>n(r());i();const a=new MutationObserver(i);return a.observe(s,{childList:!0,subtree:!0}),()=>a.disconnect()},[r,e]);const{selectedIndex:o}=Oh({containerRef:e,items:t,orientation:"horizontal",onSelect:s=>s.click(),autoSelectFirstItem:!1});x.useEffect(()=>{const s=e.current;if(!s)return;const i=l=>{const c=l.target;s.contains(c)&&c.setAttribute("data-focus-visible","true")},a=l=>{const c=l.target;s.contains(c)&&c.removeAttribute("data-focus-visible")};return s.addEventListener("focus",i,!0),s.addEventListener("blur",a,!0),()=>{s.removeEventListener("focus",i,!0),s.removeEventListener("blur",a,!0)}},[e]),x.useEffect(()=>{o!==void 0&&t[o]&&t[o].focus()},[o,t])},Wo=x.forwardRef(({children:e,className:t,variant:n="fixed",...r},o)=>{const s=x.useRef(null),i=Ih(s,o);return Lh(s),u.jsx("div",{ref:i,role:"toolbar","aria-label":"toolbar","data-variant":n,className:ke("tiptap-toolbar",t),...r,children:e})});Wo.displayName="Toolbar";const Go=x.forwardRef(({children:e,className:t,...n},r)=>u.jsx("div",{ref:r,role:"group",className:ke("tiptap-toolbar-group",t),...n,children:e}));Go.displayName="ToolbarGroup";const ht=x.forwardRef(({...e},t)=>u.jsx(Hi,{ref:t,orientation:"vertical",decorative:!0,...e}));ht.displayName="ToolbarSeparator";function ae(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function Ya(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zo(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ya(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ya(e[o],null)}}}}function Oe(...e){return y.useCallback(Zo(...e),e)}function Rn(e,t=[]){let n=[];function r(s,i){const a=y.createContext(i),l=n.length;n=[...n,i];const c=f=>{const{scope:h,children:p,...m}=f,g=h?.[e]?.[l]||a,b=y.useMemo(()=>m,Object.values(m));return u.jsx(g.Provider,{value:b,children:p})};c.displayName=s+"Provider";function d(f,h){const p=h?.[e]?.[l]||a,m=y.useContext(p);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[c,d]}const o=()=>{const s=n.map(i=>y.createContext(i));return function(a){const l=a?.[e]||s;return y.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Ph(o,...t)]}function Ph(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(s)[`__scope${c}`];return{...a,...f}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function tr(e){const t=Dh(e),n=y.forwardRef((r,o)=>{const{children:s,...i}=r,a=y.Children.toArray(s),l=a.find(Hh);if(l){const c=l.props.children,d=a.map(f=>f===l?y.Children.count(c)>1?y.Children.only(null):y.isValidElement(c)?c.props.children:null:f);return u.jsx(t,{...i,ref:o,children:y.isValidElement(c)?y.cloneElement(c,void 0,d):null})}return u.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Dh(e){const t=y.forwardRef((n,r)=>{const{children:o,...s}=n;if(y.isValidElement(o)){const i=$h(o),a=Fh(s,o.props);return o.type!==y.Fragment&&(a.ref=r?Zo(r,i):i),y.cloneElement(o,a)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bh=Symbol("radix.slottable");function Hh(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Bh}function Fh(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function $h(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Uh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Re=Uh.reduce((e,t)=>{const n=tr(`Primitive.${t}`),r=y.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function kc(e,t){e&&Pi.flushSync(()=>e.dispatchEvent(t))}function vt(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>t.current?.(...n),[])}function jh(e,t=globalThis?.document){const n=vt(e);y.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var zh="DismissableLayer",oi="dismissableLayer.update",Vh="dismissableLayer.pointerDownOutside",Kh="dismissableLayer.focusOutside",Xa,Oc=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fi=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,c=y.useContext(Oc),[d,f]=y.useState(null),h=d?.ownerDocument??globalThis?.document,[,p]=y.useState({}),m=Oe(t,R=>f(R)),g=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(b),C=d?g.indexOf(d):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,S=C>=v,N=Zh(R=>{const O=R.target,D=[...c.branches].some(j=>j.contains(O));!S||D||(o?.(R),i?.(R),R.defaultPrevented||a?.())},h),A=qh(R=>{const O=R.target;[...c.branches].some(j=>j.contains(O))||(s?.(R),i?.(R),R.defaultPrevented||a?.())},h);return jh(R=>{C===c.layers.size-1&&(r?.(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},h),y.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Xa=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Ja(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Xa)}},[d,h,n,c]),y.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Ja())},[d,c]),y.useEffect(()=>{const R=()=>p({});return document.addEventListener(oi,R),()=>document.removeEventListener(oi,R)},[]),u.jsx(Re.div,{...l,ref:m,style:{pointerEvents:_?S?"auto":"none":void 0,...e.style},onFocusCapture:ae(e.onFocusCapture,A.onFocusCapture),onBlurCapture:ae(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:ae(e.onPointerDownCapture,N.onPointerDownCapture)})});Fi.displayName=zh;var Wh="DismissableLayerBranch",Gh=y.forwardRef((e,t)=>{const n=y.useContext(Oc),r=y.useRef(null),o=Oe(t,r);return y.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),u.jsx(Re.div,{...e,ref:o})});Gh.displayName=Wh;function Zh(e,t=globalThis?.document){const n=vt(e),r=y.useRef(!1),o=y.useRef(()=>{});return y.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){Ic(Vh,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function qh(e,t=globalThis?.document){const n=vt(e),r=y.useRef(!1);return y.useEffect(()=>{const o=s=>{s.target&&!r.current&&Ic(Kh,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ja(){const e=new CustomEvent(oi);document.dispatchEvent(e)}function Ic(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?kc(o,s):o.dispatchEvent(s)}var Es=0;function Lc(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Qa()),document.body.insertAdjacentElement("beforeend",e[1]??Qa()),Es++,()=>{Es===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Es--}},[])}function Qa(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Cs="focusScope.autoFocusOnMount",ws="focusScope.autoFocusOnUnmount",el={bubbles:!1,cancelable:!0},Yh="FocusScope",$i=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,l]=y.useState(null),c=vt(o),d=vt(s),f=y.useRef(null),h=Oe(t,g=>l(g)),p=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let g=function(_){if(p.paused||!a)return;const S=_.target;a.contains(S)?f.current=S:Ot(f.current,{select:!0})},b=function(_){if(p.paused||!a)return;const S=_.relatedTarget;S!==null&&(a.contains(S)||Ot(f.current,{select:!0}))},v=function(_){if(document.activeElement===document.body)for(const N of _)N.removedNodes.length>0&&Ot(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",b);const C=new MutationObserver(v);return a&&C.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",b),C.disconnect()}}},[r,a,p.paused]),y.useEffect(()=>{if(a){nl.add(p);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(Cs,el);a.addEventListener(Cs,c),a.dispatchEvent(v),v.defaultPrevented||(Xh(ng(Pc(a)),{select:!0}),document.activeElement===g&&Ot(a))}return()=>{a.removeEventListener(Cs,c),setTimeout(()=>{const v=new CustomEvent(ws,el);a.addEventListener(ws,d),a.dispatchEvent(v),v.defaultPrevented||Ot(g??document.body,{select:!0}),a.removeEventListener(ws,d),nl.remove(p)},0)}}},[a,c,d,p]);const m=y.useCallback(g=>{if(!n&&!r||p.paused)return;const b=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(b&&v){const C=g.currentTarget,[_,S]=Jh(C);_&&S?!g.shiftKey&&v===S?(g.preventDefault(),n&&Ot(_,{select:!0})):g.shiftKey&&v===_&&(g.preventDefault(),n&&Ot(S,{select:!0})):v===C&&g.preventDefault()}},[n,r,p.paused]);return u.jsx(Re.div,{tabIndex:-1,...i,ref:h,onKeyDown:m})});$i.displayName=Yh;function Xh(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ot(r,{select:t}),document.activeElement!==n)return}function Jh(e){const t=Pc(e),n=tl(t,e),r=tl(t.reverse(),e);return[n,r]}function Pc(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function tl(e,t){for(const n of e)if(!Qh(n,{upTo:t}))return n}function Qh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function eg(e){return e instanceof HTMLInputElement&&"select"in e}function Ot(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&eg(e)&&t&&e.select()}}var nl=tg();function tg(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=rl(e,t),e.unshift(t)},remove(t){e=rl(e,t),e[0]?.resume()}}}function rl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ng(e){return e.filter(t=>t.tagName!=="A")}var Ht=globalThis?.document?y.useLayoutEffect:()=>{},rg=y[" useId ".trim().toString()]||(()=>{}),og=0;function _n(e){const[t,n]=y.useState(rg());return Ht(()=>{n(r=>r??String(og++))},[e]),e||(t?`radix-${t}`:"")}const sg=["top","right","bottom","left"],Ft=Math.min,Ge=Math.max,ro=Math.round,Sr=Math.floor,bt=e=>({x:e,y:e}),ig={left:"right",right:"left",bottom:"top",top:"bottom"};function si(e,t,n){return Ge(e,Ft(t,n))}function St(e,t){return typeof e=="function"?e(t):e}function Nt(e){return e.split("-")[0]}function Mn(e){return e.split("-")[1]}function Ui(e){return e==="x"?"y":"x"}function ji(e){return e==="y"?"height":"width"}function gt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function zi(e){return Ui(gt(e))}function ag(e,t,n){n===void 0&&(n=!1);const r=Mn(e),o=zi(e),s=ji(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=oo(i)),[i,oo(i)]}function lg(e){const t=oo(e);return[ii(e),t,ii(t)]}function ii(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const ol=["left","right"],sl=["right","left"],cg=["top","bottom"],ug=["bottom","top"];function dg(e,t,n){switch(e){case"top":case"bottom":return n?t?sl:ol:t?ol:sl;case"left":case"right":return t?cg:ug;default:return[]}}function fg(e,t,n,r){const o=Mn(e);let s=dg(Nt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(ii)))),s}function oo(e){const t=Nt(e);return ig[t]+e.slice(t.length)}function pg(e){return{top:0,right:0,bottom:0,left:0,...e}}function Dc(e){return typeof e!="number"?pg(e):{top:e,right:e,bottom:e,left:e}}function so(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function il(e,t,n){let{reference:r,floating:o}=e;const s=gt(t),i=zi(t),a=ji(i),l=Nt(t),c=s==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Mn(t)){case"start":p[i]-=h*(n&&c?-1:1);break;case"end":p[i]+=h*(n&&c?-1:1);break}return p}async function hg(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=St(t,e),m=Dc(p),b=a[h?f==="floating"?"reference":"floating":f],v=so(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),C=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(_))?await(s.getScale==null?void 0:s.getScale(_))||{x:1,y:1}:{x:1,y:1},N=so(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:_,strategy:l}):C);return{top:(v.top-N.top+m.top)/S.y,bottom:(N.bottom-v.bottom+m.bottom)/S.y,left:(v.left-N.left+m.left)/S.x,right:(N.right-v.right+m.right)/S.x}}const gg=50,mg=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:hg},l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=il(c,r,l),h=r,p=0;const m={};for(let g=0;g<s.length;g++){const b=s[g];if(!b)continue;const{name:v,fn:C}=b,{x:_,y:S,data:N,reset:A}=await C({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:c,platform:a,elements:{reference:e,floating:t}});d=_??d,f=S??f,m[v]={...m[v],...N},A&&p<gg&&(p++,typeof A=="object"&&(A.placement&&(h=A.placement),A.rects&&(c=A.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):A.rects),{x:d,y:f}=il(c,h,l)),g=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:m}},bg=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=St(e,t)||{};if(c==null)return{};const f=Dc(d),h={x:n,y:r},p=zi(o),m=ji(p),g=await i.getDimensions(c),b=p==="y",v=b?"top":"left",C=b?"bottom":"right",_=b?"clientHeight":"clientWidth",S=s.reference[m]+s.reference[p]-h[p]-s.floating[m],N=h[p]-s.reference[p],A=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let R=A?A[_]:0;(!R||!await(i.isElement==null?void 0:i.isElement(A)))&&(R=a.floating[_]||s.floating[m]);const O=S/2-N/2,D=R/2-g[m]/2-1,j=Ft(f[v],D),Y=Ft(f[C],D),J=j,X=R-g[m]-Y,I=R/2-g[m]/2+O,$=si(J,I,X),U=!l.arrow&&Mn(o)!=null&&I!==$&&s.reference[m]/2-(I<J?j:Y)-g[m]/2<0,H=U?I<J?I-J:I-X:0;return{[p]:h[p]+H,data:{[p]:$,centerOffset:I-$-H,...U&&{alignmentOffset:H}},reset:U}}}),vg=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...b}=St(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Nt(o),C=gt(a),_=Nt(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),N=h||(_||!g?[oo(a)]:lg(a)),A=m!=="none";!h&&A&&N.push(...fg(a,g,m,S));const R=[a,...N],O=await l.detectOverflow(t,b),D=[];let j=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&D.push(O[v]),f){const I=ag(o,i,S);D.push(O[I[0]],O[I[1]])}if(j=[...j,{placement:o,overflows:D}],!D.every(I=>I<=0)){var Y,J;const I=(((Y=s.flip)==null?void 0:Y.index)||0)+1,$=R[I];if($&&(!(f==="alignment"?C!==gt($):!1)||j.every(T=>gt(T.placement)===C?T.overflows[0]>0:!0)))return{data:{index:I,overflows:j},reset:{placement:$}};let U=(J=j.filter(H=>H.overflows[0]<=0).sort((H,T)=>H.overflows[1]-T.overflows[1])[0])==null?void 0:J.placement;if(!U)switch(p){case"bestFit":{var X;const H=(X=j.filter(T=>{if(A){const k=gt(T.placement);return k===C||k==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(k=>k>0).reduce((k,K)=>k+K,0)]).sort((T,k)=>T[1]-k[1])[0])==null?void 0:X[0];H&&(U=H);break}case"initialPlacement":U=a;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function al(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ll(e){return sg.some(t=>e[t]>=0)}const yg=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=St(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=al(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ll(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=al(i,n.floating);return{data:{escapedOffsets:a,escaped:ll(a)}}}default:return{}}}}},Bc=new Set(["left","top"]);async function Eg(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Nt(n),a=Mn(n),l=gt(n)==="y",c=Bc.has(i)?-1:1,d=s&&l?-1:1,f=St(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),l?{x:p*d,y:h*c}:{x:h*c,y:p*d}}const Cg=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await Eg(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},wg=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:C,y:_}=v;return{x:C,y:_}}},...c}=St(e,t),d={x:n,y:r},f=await s.detectOverflow(t,c),h=gt(Nt(o)),p=Ui(h);let m=d[p],g=d[h];if(i){const v=p==="y"?"top":"left",C=p==="y"?"bottom":"right",_=m+f[v],S=m-f[C];m=si(_,m,S)}if(a){const v=h==="y"?"top":"left",C=h==="y"?"bottom":"right",_=g+f[v],S=g-f[C];g=si(_,g,S)}const b=l.fn({...t,[p]:m,[h]:g});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[p]:i,[h]:a}}}}}},xg=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=St(e,t),d={x:n,y:r},f=gt(o),h=Ui(f);let p=d[h],m=d[f];const g=St(a,t),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const _=h==="y"?"height":"width",S=s.reference[h]-s.floating[_]+b.mainAxis,N=s.reference[h]+s.reference[_]-b.mainAxis;p<S?p=S:p>N&&(p=N)}if(c){var v,C;const _=h==="y"?"width":"height",S=Bc.has(Nt(o)),N=s.reference[f]-s.floating[_]+(S&&((v=i.offset)==null?void 0:v[f])||0)+(S?0:b.crossAxis),A=s.reference[f]+s.reference[_]+(S?0:((C=i.offset)==null?void 0:C[f])||0)-(S?b.crossAxis:0);m<N?m=N:m>A&&(m=A)}return{[h]:p,[f]:m}}}},_g=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=St(e,t),d=await i.detectOverflow(t,c),f=Nt(o),h=Mn(o),p=gt(o)==="y",{width:m,height:g}=s.floating;let b,v;f==="top"||f==="bottom"?(b=f,v=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(v=f,b=h==="end"?"top":"bottom");const C=g-d.top-d.bottom,_=m-d.left-d.right,S=Ft(g-d[b],C),N=Ft(m-d[v],_),A=!t.middlewareData.shift;let R=S,O=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=C),A&&!h){const j=Ge(d.left,0),Y=Ge(d.right,0),J=Ge(d.top,0),X=Ge(d.bottom,0);p?O=m-2*(j!==0||Y!==0?j+Y:Ge(d.left,d.right)):R=g-2*(J!==0||X!==0?J+X:Ge(d.top,d.bottom))}await l({...t,availableWidth:O,availableHeight:R});const D=await i.getDimensions(a.floating);return m!==D.width||g!==D.height?{reset:{rects:!0}}:{}}}};function qo(){return typeof window<"u"}function kn(e){return Vi(e)?(e.nodeName||"").toLowerCase():"#document"}function Ve(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yt(e){var t;return(t=(Vi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Vi(e){return qo()?e instanceof Node||e instanceof Ve(e).Node:!1}function be(e){return qo()?e instanceof Element||e instanceof Ve(e).Element:!1}function et(e){return qo()?e instanceof HTMLElement||e instanceof Ve(e).HTMLElement:!1}function ai(e){return!qo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ve(e).ShadowRoot}function ur(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Qe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function Sg(e){return/^(table|td|th)$/.test(kn(e))}function Yo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Ng=/transform|translate|scale|rotate|perspective|filter/,Ag=/paint|layout|strict|content/,Xt=e=>!!e&&e!=="none";let xs;function Ki(e){const t=be(e)?Qe(e):e;return Xt(t.transform)||Xt(t.translate)||Xt(t.scale)||Xt(t.rotate)||Xt(t.perspective)||!Xo()&&(Xt(t.backdropFilter)||Xt(t.filter))||Ng.test(t.willChange||"")||Ag.test(t.contain||"")}function Tg(e){let t=At(e);for(;et(t)&&!_t(t);){if(Ki(t))return t;if(Yo(t))return null;t=At(t)}return null}function Xo(){return xs==null&&(xs=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),xs}function _t(e){return/^(html|body|#document)$/.test(kn(e))}function Qe(e){return Ve(e).getComputedStyle(e)}function Jo(e){return be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function At(e){if(kn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ai(e)&&e.host||yt(e);return ai(t)?t.host:t}function Hc(e){const t=At(e);return _t(t)?e.ownerDocument?e.ownerDocument.body:e.body:et(t)&&ur(t)?t:Hc(t)}function Bt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Hc(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ve(o);if(s){const a=li(i);return t.concat(i,i.visualViewport||[],ur(o)?o:[],a&&n?Bt(a):[])}else return t.concat(o,Bt(o,[],n))}function li(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fc(e){const t=Qe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=et(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=ro(n)!==s||ro(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Wi(e){return be(e)?e:e.contextElement}function wn(e){const t=Wi(e);if(!et(t))return bt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Fc(t);let i=(s?ro(n.width):n.width)/r,a=(s?ro(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Rg=bt(0);function $c(e){const t=Ve(e);return!Xo()||!t.visualViewport?Rg:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mg(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ve(e)?!1:t}function nn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Wi(e);let i=bt(1);t&&(r?be(r)&&(i=wn(r)):i=wn(e));const a=Mg(s,n,r)?$c(s):bt(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(s){const h=Ve(s),p=r&&be(r)?Ve(r):r;let m=h,g=li(m);for(;g&&r&&p!==m;){const b=wn(g),v=g.getBoundingClientRect(),C=Qe(g),_=v.left+(g.clientLeft+parseFloat(C.paddingLeft))*b.x,S=v.top+(g.clientTop+parseFloat(C.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,f*=b.y,l+=_,c+=S,m=Ve(g),g=li(m)}}return so({width:d,height:f,x:l,y:c})}function Qo(e,t){const n=Jo(e).scrollLeft;return t?t.left+n:nn(yt(e)).left+n}function Uc(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Qo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function kg(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=yt(r),a=t?Yo(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=bt(1);const d=bt(0),f=et(r);if((f||!f&&!s)&&((kn(r)!=="body"||ur(i))&&(l=Jo(r)),f)){const p=nn(r);c=wn(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=i&&!f&&!s?Uc(i,l):bt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}}function Og(e){return Array.from(e.getClientRects())}function Ig(e){const t=yt(e),n=Jo(e),r=e.ownerDocument.body,o=Ge(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ge(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Qo(e);const a=-n.scrollTop;return Qe(r).direction==="rtl"&&(i+=Ge(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const cl=25;function Lg(e,t){const n=Ve(e),r=yt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const d=Xo();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=Qo(r);if(c<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-f.clientWidth-p);m<=cl&&(s-=m)}else c<=cl&&(s+=c);return{width:s,height:i,x:a,y:l}}function Pg(e,t){const n=nn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=et(e)?wn(e):bt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function ul(e,t,n){let r;if(t==="viewport")r=Lg(e,n);else if(t==="document")r=Ig(yt(e));else if(be(t))r=Pg(t,n);else{const o=$c(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return so(r)}function jc(e,t){const n=At(e);return n===t||!be(n)||_t(n)?!1:Qe(n).position==="fixed"||jc(n,t)}function Dg(e,t){const n=t.get(e);if(n)return n;let r=Bt(e,[],!1).filter(a=>be(a)&&kn(a)!=="body"),o=null;const s=Qe(e).position==="fixed";let i=s?At(e):e;for(;be(i)&&!_t(i);){const a=Qe(i),l=Ki(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||ur(i)&&!l&&jc(e,i))?r=r.filter(d=>d!==i):o=a,i=At(i)}return t.set(e,r),r}function Bg(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Yo(t)?[]:Dg(t,this._c):[].concat(n),r],a=ul(t,i[0],o);let l=a.top,c=a.right,d=a.bottom,f=a.left;for(let h=1;h<i.length;h++){const p=ul(t,i[h],o);l=Ge(p.top,l),c=Ft(p.right,c),d=Ft(p.bottom,d),f=Ge(p.left,f)}return{width:c-f,height:d-l,x:f,y:l}}function Hg(e){const{width:t,height:n}=Fc(e);return{width:t,height:n}}function Fg(e,t,n){const r=et(t),o=yt(t),s=n==="fixed",i=nn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=bt(0);function c(){l.x=Qo(o)}if(r||!r&&!s)if((kn(t)!=="body"||ur(o))&&(a=Jo(t)),r){const p=nn(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&c();s&&!r&&o&&c();const d=o&&!r&&!s?Uc(o,a):bt(0),f=i.left+a.scrollLeft-l.x-d.x,h=i.top+a.scrollTop-l.y-d.y;return{x:f,y:h,width:i.width,height:i.height}}function _s(e){return Qe(e).position==="static"}function dl(e,t){if(!et(e)||Qe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return yt(e)===n&&(n=n.ownerDocument.body),n}function zc(e,t){const n=Ve(e);if(Yo(e))return n;if(!et(e)){let o=At(e);for(;o&&!_t(o);){if(be(o)&&!_s(o))return o;o=At(o)}return n}let r=dl(e,t);for(;r&&Sg(r)&&_s(r);)r=dl(r,t);return r&&_t(r)&&_s(r)&&!Ki(r)?n:r||Tg(e)||n}const $g=async function(e){const t=this.getOffsetParent||zc,n=this.getDimensions,r=await n(e.floating);return{reference:Fg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ug(e){return Qe(e).direction==="rtl"}const jg={convertOffsetParentRelativeRectToViewportRelativeRect:kg,getDocumentElement:yt,getClippingRect:Bg,getOffsetParent:zc,getElementRects:$g,getClientRects:Og,getDimensions:Hg,getScale:wn,isElement:be,isRTL:Ug};function Vc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zg(e,t){let n=null,r;const o=yt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:d,top:f,width:h,height:p}=c;if(a||t(),!h||!p)return;const m=Sr(f),g=Sr(o.clientWidth-(d+h)),b=Sr(o.clientHeight-(f+p)),v=Sr(d),_={rootMargin:-m+"px "+-g+"px "+-b+"px "+-v+"px",threshold:Ge(0,Ft(1,l))||1};let S=!0;function N(A){const R=A[0].intersectionRatio;if(R!==l){if(!S)return i();R?i(!1,R):r=setTimeout(()=>{i(!1,1e-7)},1e3)}R===1&&!Vc(c,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(N,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(N,_)}n.observe(e)}return i(!0),s}function Kc(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Wi(e),d=o||s?[...c?Bt(c):[],...t?Bt(t):[]]:[];d.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const f=c&&a?zg(c,n):null;let h=-1,p=null;i&&(p=new ResizeObserver(v=>{let[C]=v;C&&C.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var _;(_=p)==null||_.observe(t)})),n()}),c&&!l&&p.observe(c),t&&p.observe(t));let m,g=l?nn(e):null;l&&b();function b(){const v=nn(e);g&&!Vc(g,v)&&n(),g=v,m=requestAnimationFrame(b)}return n(),()=>{var v;d.forEach(C=>{o&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),f?.(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Vg=Cg,Kg=wg,Wg=vg,Gg=_g,Zg=yg,fl=bg,qg=xg,Yg=(e,t,n)=>{const r=new Map,o={platform:jg,...n},s={...o.platform,_c:r};return mg(e,t,{...o,platform:s})};var Xg=typeof document<"u",Jg=function(){},Wr=Xg?x.useLayoutEffect:Jg;function io(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!io(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!io(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Wc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pl(e,t){const n=Wc(e);return Math.round(t*n)/n}function Ss(e){const t=y.useRef(e);return Wr(()=>{t.current=e}),t}function Gc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,f]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=y.useState(r);io(h,r)||p(r);const[m,g]=y.useState(null),[b,v]=y.useState(null),C=y.useCallback(T=>{T!==A.current&&(A.current=T,g(T))},[]),_=y.useCallback(T=>{T!==R.current&&(R.current=T,v(T))},[]),S=s||m,N=i||b,A=y.useRef(null),R=y.useRef(null),O=y.useRef(d),D=l!=null,j=Ss(l),Y=Ss(o),J=Ss(c),X=y.useCallback(()=>{if(!A.current||!R.current)return;const T={placement:t,strategy:n,middleware:h};Y.current&&(T.platform=Y.current),Yg(A.current,R.current,T).then(k=>{const K={...k,isPositioned:J.current!==!1};I.current&&!io(O.current,K)&&(O.current=K,Pi.flushSync(()=>{f(K)}))})},[h,t,n,Y,J]);Wr(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,f(T=>({...T,isPositioned:!1})))},[c]);const I=y.useRef(!1);Wr(()=>(I.current=!0,()=>{I.current=!1}),[]),Wr(()=>{if(S&&(A.current=S),N&&(R.current=N),S&&N){if(j.current)return j.current(S,N,X);X()}},[S,N,X,j,D]);const $=y.useMemo(()=>({reference:A,floating:R,setReference:C,setFloating:_}),[C,_]),U=y.useMemo(()=>({reference:S,floating:N}),[S,N]),H=y.useMemo(()=>{const T={position:n,left:0,top:0};if(!U.floating)return T;const k=pl(U.floating,d.x),K=pl(U.floating,d.y);return a?{...T,transform:"translate("+k+"px, "+K+"px)",...Wc(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:K}},[n,a,U.floating,d.x,d.y]);return y.useMemo(()=>({...d,update:X,refs:$,elements:U,floatingStyles:H}),[d,X,$,U,H])}const Qg=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?fl({element:r.current,padding:o}).fn(n):{}:r?fl({element:r,padding:o}).fn(n):{}}}},Zc=(e,t)=>{const n=Vg(e);return{name:n.name,fn:n.fn,options:[e,t]}},qc=(e,t)=>{const n=Kg(e);return{name:n.name,fn:n.fn,options:[e,t]}},em=(e,t)=>({fn:qg(e).fn,options:[e,t]}),Yc=(e,t)=>{const n=Wg(e);return{name:n.name,fn:n.fn,options:[e,t]}},tm=(e,t)=>{const n=Gg(e);return{name:n.name,fn:n.fn,options:[e,t]}},nm=(e,t)=>{const n=Zg(e);return{name:n.name,fn:n.fn,options:[e,t]}},rm=(e,t)=>{const n=Qg(e);return{name:n.name,fn:n.fn,options:[e,t]}};var om="Arrow",Xc=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return u.jsx(Re.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});Xc.displayName=om;var sm=Xc;function im(e){const[t,n]=y.useState(void 0);return Ht(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Gi="Popper",[Jc,es]=Rn(Gi),[am,Qc]=Jc(Gi),eu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=y.useState(null);return u.jsx(am,{scope:t,anchor:r,onAnchorChange:o,children:n})};eu.displayName=Gi;var tu="PopperAnchor",nu=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Qc(tu,n),i=y.useRef(null),a=Oe(t,i),l=y.useRef(null);return y.useEffect(()=>{const c=l.current;l.current=r?.current||i.current,c!==l.current&&s.onAnchorChange(l.current)}),r?null:u.jsx(Re.div,{...o,ref:a})});nu.displayName=tu;var Zi="PopperContent",[lm,cm]=Jc(Zi),ru=y.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,b=Qc(Zi,n),[v,C]=y.useState(null),_=Oe(t,ue=>C(ue)),[S,N]=y.useState(null),A=im(S),R=A?.width??0,O=A?.height??0,D=r+(s!=="center"?"-"+s:""),j=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},Y=Array.isArray(c)?c:[c],J=Y.length>0,X={padding:j,boundary:Y.filter(dm),altBoundary:J},{refs:I,floatingStyles:$,placement:U,isPositioned:H,middlewareData:T}=Gc({strategy:"fixed",placement:D,whileElementsMounted:(...ue)=>Kc(...ue,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[Zc({mainAxis:o+O,alignmentAxis:i}),l&&qc({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?em():void 0,...X}),l&&Yc({...X}),tm({...X,apply:({elements:ue,rects:Ze,availableWidth:an,availableHeight:st})=>{const{width:Wt,height:Gt}=Ze.reference,it=ue.floating.style;it.setProperty("--radix-popper-available-width",`${an}px`),it.setProperty("--radix-popper-available-height",`${st}px`),it.setProperty("--radix-popper-anchor-width",`${Wt}px`),it.setProperty("--radix-popper-anchor-height",`${Gt}px`)}}),S&&rm({element:S,padding:a}),fm({arrowWidth:R,arrowHeight:O}),h&&nm({strategy:"referenceHidden",...X})]}),[k,K]=iu(U),oe=vt(m);Ht(()=>{H&&oe?.()},[H,oe]);const Z=T.arrow?.x,ce=T.arrow?.y,Ke=T.arrow?.centerOffset!==0,[he,ye]=y.useState();return Ht(()=>{v&&ye(window.getComputedStyle(v).zIndex)},[v]),u.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:H?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[T.transformOrigin?.x,T.transformOrigin?.y].join(" "),...T.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(lm,{scope:n,placedSide:k,onArrowChange:N,arrowX:Z,arrowY:ce,shouldHideArrow:Ke,children:u.jsx(Re.div,{"data-side":k,"data-align":K,...g,ref:_,style:{...g.style,animation:H?void 0:"none"}})})})});ru.displayName=Zi;var ou="PopperArrow",um={top:"bottom",right:"left",bottom:"top",left:"right"},su=y.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=cm(ou,r),i=um[s.placedSide];return u.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:u.jsx(sm,{...o,ref:n,style:{...o.style,display:"block"}})})});su.displayName=ou;function dm(e){return e!==null}var fm=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,d]=iu(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(o.arrow?.x??0)+a/2,p=(o.arrow?.y??0)+l/2;let m="",g="";return c==="bottom"?(m=i?f:`${h}px`,g=`${-l}px`):c==="top"?(m=i?f:`${h}px`,g=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,g=i?f:`${p}px`):c==="left"&&(m=`${r.floating.width+l}px`,g=i?f:`${p}px`),{data:{x:m,y:g}}}});function iu(e){const[t,n="center"]=e.split("-");return[t,n]}var qi=eu,Yi=nu,au=ru,lu=su,pm="Portal",Xi=y.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=y.useState(!1);Ht(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?_c.createPortal(u.jsx(Re.div,{...r,ref:t}),i):null});Xi.displayName=pm;function hm(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var on=e=>{const{present:t,children:n}=e,r=gm(t),o=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),s=Oe(r.ref,mm(o));return typeof n=="function"||r.isPresent?y.cloneElement(o,{ref:s}):null};on.displayName="Presence";function gm(e){const[t,n]=y.useState(),r=y.useRef(null),o=y.useRef(e),s=y.useRef("none"),i=e?"mounted":"unmounted",[a,l]=hm(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const c=Nr(r.current);s.current=a==="mounted"?c:"none"},[a]),Ht(()=>{const c=r.current,d=o.current;if(d!==e){const h=s.current,p=Nr(c);e?l("MOUNT"):p==="none"||c?.display==="none"?l("UNMOUNT"):l(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ht(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,f=p=>{const g=Nr(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&g&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(s.current=Nr(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:y.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Nr(e){return e?.animationName||"none"}function mm(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var bm=y[" useInsertionEffect ".trim().toString()]||Ht;function ts({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=vm({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const d=y.useRef(e!==void 0);y.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const c=y.useCallback(d=>{if(a){const f=ym(d)?d(e):d;f!==e&&i.current?.(f)}else s(d)},[a,e,s,i]);return[l,c]}function vm({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),o=y.useRef(n),s=y.useRef(t);return bm(()=>{s.current=t},[t]),y.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function ym(e){return typeof e=="function"}var Em=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},dn=new WeakMap,Ar=new WeakMap,Tr={},Ns=0,cu=function(e){return e&&(e.host||cu(e.parentNode))},Cm=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=cu(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},wm=function(e,t,n,r){var o=Cm(t,Array.isArray(e)?e:[e]);Tr[n]||(Tr[n]=new WeakMap);var s=Tr[n],i=[],a=new Set,l=new Set(o),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};o.forEach(c);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))d(h);else try{var p=h.getAttribute(r),m=p!==null&&p!=="false",g=(dn.get(h)||0)+1,b=(s.get(h)||0)+1;dn.set(h,g),s.set(h,b),i.push(h),g===1&&m&&Ar.set(h,!0),b===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return d(t),a.clear(),Ns++,function(){i.forEach(function(f){var h=dn.get(f)-1,p=s.get(f)-1;dn.set(f,h),s.set(f,p),h||(Ar.has(f)||f.removeAttribute(r),Ar.delete(f)),p||f.removeAttribute(n)}),Ns--,Ns||(dn=new WeakMap,dn=new WeakMap,Ar=new WeakMap,Tr={})}},uu=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Em(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),wm(r,o,n,"aria-hidden")):function(){return null}},ft=function(){return ft=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ft.apply(this,arguments)};function du(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function xm(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Gr="right-scroll-bar-position",Zr="width-before-scroll-bar",_m="with-scroll-bars-hidden",Sm="--removed-body-scroll-bar-size";function As(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Nm(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Am=typeof window<"u"?y.useLayoutEffect:y.useEffect,hl=new WeakMap;function Tm(e,t){var n=Nm(null,function(r){return e.forEach(function(o){return As(o,r)})});return Am(function(){var r=hl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||As(a,null)}),s.forEach(function(a){o.has(a)||As(a,i)})}hl.set(n,e)},[e]),n}function Rm(e){return e}function Mm(e,t){t===void 0&&(t=Rm);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var l=function(){var d=i;i=[],d.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){i.push(d),c()},filter:function(d){return i=i.filter(d),n}}}};return o}function km(e){e===void 0&&(e={});var t=Mm(null);return t.options=ft({async:!0,ssr:!1},e),t}var fu=function(e){var t=e.sideCar,n=du(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,ft({},n))};fu.isSideCarExport=!0;function Om(e,t){return e.useMedium(t),fu}var pu=km(),Ts=function(){},ns=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Ts,onWheelCapture:Ts,onTouchMoveCapture:Ts}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,m=e.noIsolation,g=e.inert,b=e.allowPinchZoom,v=e.as,C=v===void 0?"div":v,_=e.gapMode,S=du(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=h,A=Tm([n,t]),R=ft(ft({},S),o);return y.createElement(y.Fragment,null,d&&y.createElement(N,{sideCar:pu,removeScrollBar:c,shards:f,noRelative:p,noIsolation:m,inert:g,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:_}),i?y.cloneElement(y.Children.only(a),ft(ft({},R),{ref:A})):y.createElement(C,ft({},R,{className:l,ref:A}),a))});ns.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ns.classNames={fullWidth:Zr,zeroRight:Gr};var Im=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Lm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Im();return t&&e.setAttribute("nonce",t),e}function Pm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Dm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Bm=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Lm())&&(Pm(t,n),Dm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Hm=function(){var e=Bm();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hu=function(){var e=Hm(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Fm={left:0,top:0,right:0,gap:0},Rs=function(e){return parseInt(e||"",10)||0},$m=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Rs(n),Rs(r),Rs(o)]},Um=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Fm;var t=$m(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},jm=hu(),xn="data-scroll-locked",zm=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),ot=require("@tiptap/react"),x=require("react"),Q=require("@tiptap/pm/state"),ne=require("@tiptap/pm/tables"),_c=require("react-dom"),w=require("@tiptap/core"),no=require("@tiptap/core/jsx-runtime"),Ch=require("@tiptap/pm/model"),nt=require("@tiptap/pm/view"),ri=require("@tiptap/pm/gapcursor"),wh=require("@tiptap/pm/dropcursor"),Cn=require("@tiptap/pm/history"),Za=require("react-dom/client"),Sc=require("@tiptap/react/menus");function Nc(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const y=Nc(x),Pi=Nc(_c),Ac=x.createContext(null);function xh(){return x.useContext(Ac)}function Tc(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Tc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Rc(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Tc(e))&&(r&&(r+=" "),r+=t);return r}const _h={mod:"⌘",command:"⌘",meta:"⌘",ctrl:"⌃",control:"⌃",alt:"⌥",option:"⌥",shift:"⇧",backspace:"Del",delete:"⌦",enter:"⏎",escape:"⎋",capslock:"⇪"};function ke(...e){return Rc(e)}function Sh(){return typeof navigator<"u"&&navigator.platform.toLowerCase().includes("mac")}const Nh=(e,t,n=!0)=>{if(t){const r=e.toLowerCase();return _h[r]||(n?e.toUpperCase():e)}return n?e.charAt(0).toUpperCase()+e.slice(1):e},Di=e=>{const{shortcutKeys:t,delimiter:n="+",capitalize:r=!0}=e;return t?t.split(n).map(o=>o.trim()).map(o=>Nh(o,Sh(),r)):[]},Bi=(e,t)=>t?.schema?t.schema.spec.marks.get(e)!==void 0:!1,Ah=(e,t)=>t?.schema?t.schema.spec.nodes.get(e)!==void 0:!1;function Mc(e,t){if(!e||!e.extensionManager)return!1;const n=Array.isArray(t)?t:[t],r=n.some(o=>e.extensionManager.extensions.some(s=>s.name===o));return r||console.warn(`None of the extensions [${n.join(", ")}] were found in the editor schema. Ensure they are included in the editor configuration.`),r}function Ko(e,t=[],n=!1){if(!e||!e.state.selection)return!1;const{selection:r}=e.state;if(r.empty)return!1;if(r instanceof Q.NodeSelection){const o=r.node;return o?t.includes(o.type.name):!1}if(n){const{$from:o}=r;for(let s=o.depth;s>0;s--){const i=o.node(s);if(t.includes(i.type.name))return!0}}return!1}function Th(e,t=[]){if(!e||t.length===0)return!1;const{state:n}=e,{selection:r}=n,o=new Set(t);if(r instanceof Q.NodeSelection){const s=r.node?.type?.name;return!!s&&o.has(s)}if(r instanceof Q.TextSelection||r instanceof Q.AllSelection){let s=!0;return n.doc.nodesBetween(r.from,r.to,i=>i.isTextblock&&!o.has(i.type.name)?(s=!1,!1):s),s}return!1}const Rh=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Mh(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return!e||e.replace(Rh,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}function kh(e,t,n){try{const r=new URL(e,t);if(Mh(r.href,n))return r.href}catch{}return"#"}function Hi({decorative:e,orientation:t="vertical",className:n,...r}){const s=e?{role:"none"}:{"aria-orientation":t==="vertical"?t:void 0,role:"separator"};return u.jsx("div",{className:ke("tiptap-separator",n),"data-orientation":t,...s,...r})}function Oh({editor:e,containerRef:t,query:n,items:r,onSelect:o,onClose:s,orientation:i="vertical",autoSelectFirstItem:a=!0}){const[l,c]=x.useState(a?0:-1);return x.useEffect(()=>{const d=h=>{if(!r.length)return!1;const p=()=>c(g=>g===-1?0:(g+1)%r.length),m=()=>c(g=>g===-1?r.length-1:(g-1+r.length)%r.length);switch(h.key){case"ArrowUp":return i==="horizontal"?!1:(h.preventDefault(),m(),!0);case"ArrowDown":return i==="horizontal"?!1:(h.preventDefault(),p(),!0);case"ArrowLeft":return i==="vertical"?!1:(h.preventDefault(),m(),!0);case"ArrowRight":return i==="vertical"?!1:(h.preventDefault(),p(),!0);case"Tab":return h.preventDefault(),h.shiftKey?m():p(),!0;case"Home":return h.preventDefault(),c(0),!0;case"End":return h.preventDefault(),c(r.length-1),!0;case"Enter":return h.isComposing?!1:(h.preventDefault(),l!==-1&&r[l]&&o?.(r[l]),!0);case"Escape":return h.preventDefault(),s?.(),!0;default:return!1}};let f=null;if(e?f=e.view.dom:t?.current&&(f=t.current),f)return f.addEventListener("keydown",d,!0),()=>{f?.removeEventListener("keydown",d,!0)}},[e,t,r,l,o,s,i]),x.useEffect(()=>{n&&c(a?0:-1)},[n,a]),{selectedIndex:r.length?l:void 0,setSelectedIndex:c}}const qa=(e,t)=>{typeof e=="function"?e(t):e&&typeof e=="object"&&"current"in e&&(e.current=t)},Ih=(e,t)=>{const n=x.useRef(null);return x.useCallback(r=>{e&&"current"in e&&(e.current=r),n.current&&qa(n.current,null),n.current=t,t&&qa(t,r)},[e,t])},Lh=e=>{const[t,n]=x.useState([]),r=x.useCallback(()=>e.current?Array.from(e.current.querySelectorAll('button:not([disabled]), [role="button"]:not([disabled]), [tabindex="0"]:not([disabled])')):[],[e]);x.useEffect(()=>{const s=e.current;if(!s)return;const i=()=>n(r());i();const a=new MutationObserver(i);return a.observe(s,{childList:!0,subtree:!0}),()=>a.disconnect()},[r,e]);const{selectedIndex:o}=Oh({containerRef:e,items:t,orientation:"horizontal",onSelect:s=>s.click(),autoSelectFirstItem:!1});x.useEffect(()=>{const s=e.current;if(!s)return;const i=l=>{const c=l.target;s.contains(c)&&c.setAttribute("data-focus-visible","true")},a=l=>{const c=l.target;s.contains(c)&&c.removeAttribute("data-focus-visible")};return s.addEventListener("focus",i,!0),s.addEventListener("blur",a,!0),()=>{s.removeEventListener("focus",i,!0),s.removeEventListener("blur",a,!0)}},[e]),x.useEffect(()=>{o!==void 0&&t[o]&&t[o].focus()},[o,t])},Wo=x.forwardRef(({children:e,className:t,variant:n="fixed",...r},o)=>{const s=x.useRef(null),i=Ih(s,o);return Lh(s),u.jsx("div",{ref:i,role:"toolbar","aria-label":"toolbar","data-variant":n,className:ke("tiptap-toolbar",t),...r,children:e})});Wo.displayName="Toolbar";const Go=x.forwardRef(({children:e,className:t,...n},r)=>u.jsx("div",{ref:r,role:"group",className:ke("tiptap-toolbar-group",t),...n,children:e}));Go.displayName="ToolbarGroup";const ht=x.forwardRef(({...e},t)=>u.jsx(Hi,{ref:t,orientation:"vertical",decorative:!0,...e}));ht.displayName="ToolbarSeparator";function ae(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function Ya(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zo(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ya(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ya(e[o],null)}}}}function Oe(...e){return y.useCallback(Zo(...e),e)}function Rn(e,t=[]){let n=[];function r(s,i){const a=y.createContext(i),l=n.length;n=[...n,i];const c=f=>{const{scope:h,children:p,...m}=f,g=h?.[e]?.[l]||a,b=y.useMemo(()=>m,Object.values(m));return u.jsx(g.Provider,{value:b,children:p})};c.displayName=s+"Provider";function d(f,h){const p=h?.[e]?.[l]||a,m=y.useContext(p);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[c,d]}const o=()=>{const s=n.map(i=>y.createContext(i));return function(a){const l=a?.[e]||s;return y.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Ph(o,...t)]}function Ph(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(s)[`__scope${c}`];return{...a,...f}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function tr(e){const t=Dh(e),n=y.forwardRef((r,o)=>{const{children:s,...i}=r,a=y.Children.toArray(s),l=a.find(Hh);if(l){const c=l.props.children,d=a.map(f=>f===l?y.Children.count(c)>1?y.Children.only(null):y.isValidElement(c)?c.props.children:null:f);return u.jsx(t,{...i,ref:o,children:y.isValidElement(c)?y.cloneElement(c,void 0,d):null})}return u.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Dh(e){const t=y.forwardRef((n,r)=>{const{children:o,...s}=n;if(y.isValidElement(o)){const i=$h(o),a=Fh(s,o.props);return o.type!==y.Fragment&&(a.ref=r?Zo(r,i):i),y.cloneElement(o,a)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bh=Symbol("radix.slottable");function Hh(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Bh}function Fh(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function $h(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Uh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Re=Uh.reduce((e,t)=>{const n=tr(`Primitive.${t}`),r=y.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function kc(e,t){e&&Pi.flushSync(()=>e.dispatchEvent(t))}function vt(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>t.current?.(...n),[])}function jh(e,t=globalThis?.document){const n=vt(e);y.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var zh="DismissableLayer",oi="dismissableLayer.update",Vh="dismissableLayer.pointerDownOutside",Kh="dismissableLayer.focusOutside",Xa,Oc=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fi=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,c=y.useContext(Oc),[d,f]=y.useState(null),h=d?.ownerDocument??globalThis?.document,[,p]=y.useState({}),m=Oe(t,R=>f(R)),g=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(b),C=d?g.indexOf(d):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,S=C>=v,N=Zh(R=>{const O=R.target,D=[...c.branches].some(j=>j.contains(O));!S||D||(o?.(R),i?.(R),R.defaultPrevented||a?.())},h),A=qh(R=>{const O=R.target;[...c.branches].some(j=>j.contains(O))||(s?.(R),i?.(R),R.defaultPrevented||a?.())},h);return jh(R=>{C===c.layers.size-1&&(r?.(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},h),y.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Xa=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Ja(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Xa)}},[d,h,n,c]),y.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Ja())},[d,c]),y.useEffect(()=>{const R=()=>p({});return document.addEventListener(oi,R),()=>document.removeEventListener(oi,R)},[]),u.jsx(Re.div,{...l,ref:m,style:{pointerEvents:_?S?"auto":"none":void 0,...e.style},onFocusCapture:ae(e.onFocusCapture,A.onFocusCapture),onBlurCapture:ae(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:ae(e.onPointerDownCapture,N.onPointerDownCapture)})});Fi.displayName=zh;var Wh="DismissableLayerBranch",Gh=y.forwardRef((e,t)=>{const n=y.useContext(Oc),r=y.useRef(null),o=Oe(t,r);return y.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),u.jsx(Re.div,{...e,ref:o})});Gh.displayName=Wh;function Zh(e,t=globalThis?.document){const n=vt(e),r=y.useRef(!1),o=y.useRef(()=>{});return y.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){Ic(Vh,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function qh(e,t=globalThis?.document){const n=vt(e),r=y.useRef(!1);return y.useEffect(()=>{const o=s=>{s.target&&!r.current&&Ic(Kh,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ja(){const e=new CustomEvent(oi);document.dispatchEvent(e)}function Ic(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?kc(o,s):o.dispatchEvent(s)}var Es=0;function Lc(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Qa()),document.body.insertAdjacentElement("beforeend",e[1]??Qa()),Es++,()=>{Es===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Es--}},[])}function Qa(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Cs="focusScope.autoFocusOnMount",ws="focusScope.autoFocusOnUnmount",el={bubbles:!1,cancelable:!0},Yh="FocusScope",$i=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,l]=y.useState(null),c=vt(o),d=vt(s),f=y.useRef(null),h=Oe(t,g=>l(g)),p=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let g=function(_){if(p.paused||!a)return;const S=_.target;a.contains(S)?f.current=S:Ot(f.current,{select:!0})},b=function(_){if(p.paused||!a)return;const S=_.relatedTarget;S!==null&&(a.contains(S)||Ot(f.current,{select:!0}))},v=function(_){if(document.activeElement===document.body)for(const N of _)N.removedNodes.length>0&&Ot(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",b);const C=new MutationObserver(v);return a&&C.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",b),C.disconnect()}}},[r,a,p.paused]),y.useEffect(()=>{if(a){nl.add(p);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(Cs,el);a.addEventListener(Cs,c),a.dispatchEvent(v),v.defaultPrevented||(Xh(ng(Pc(a)),{select:!0}),document.activeElement===g&&Ot(a))}return()=>{a.removeEventListener(Cs,c),setTimeout(()=>{const v=new CustomEvent(ws,el);a.addEventListener(ws,d),a.dispatchEvent(v),v.defaultPrevented||Ot(g??document.body,{select:!0}),a.removeEventListener(ws,d),nl.remove(p)},0)}}},[a,c,d,p]);const m=y.useCallback(g=>{if(!n&&!r||p.paused)return;const b=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(b&&v){const C=g.currentTarget,[_,S]=Jh(C);_&&S?!g.shiftKey&&v===S?(g.preventDefault(),n&&Ot(_,{select:!0})):g.shiftKey&&v===_&&(g.preventDefault(),n&&Ot(S,{select:!0})):v===C&&g.preventDefault()}},[n,r,p.paused]);return u.jsx(Re.div,{tabIndex:-1,...i,ref:h,onKeyDown:m})});$i.displayName=Yh;function Xh(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ot(r,{select:t}),document.activeElement!==n)return}function Jh(e){const t=Pc(e),n=tl(t,e),r=tl(t.reverse(),e);return[n,r]}function Pc(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function tl(e,t){for(const n of e)if(!Qh(n,{upTo:t}))return n}function Qh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function eg(e){return e instanceof HTMLInputElement&&"select"in e}function Ot(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&eg(e)&&t&&e.select()}}var nl=tg();function tg(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=rl(e,t),e.unshift(t)},remove(t){e=rl(e,t),e[0]?.resume()}}}function rl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ng(e){return e.filter(t=>t.tagName!=="A")}var Ht=globalThis?.document?y.useLayoutEffect:()=>{},rg=y[" useId ".trim().toString()]||(()=>{}),og=0;function _n(e){const[t,n]=y.useState(rg());return Ht(()=>{n(r=>r??String(og++))},[e]),e||(t?`radix-${t}`:"")}const sg=["top","right","bottom","left"],Ft=Math.min,Ge=Math.max,ro=Math.round,Sr=Math.floor,bt=e=>({x:e,y:e}),ig={left:"right",right:"left",bottom:"top",top:"bottom"};function si(e,t,n){return Ge(e,Ft(t,n))}function St(e,t){return typeof e=="function"?e(t):e}function Nt(e){return e.split("-")[0]}function Mn(e){return e.split("-")[1]}function Ui(e){return e==="x"?"y":"x"}function ji(e){return e==="y"?"height":"width"}function gt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function zi(e){return Ui(gt(e))}function ag(e,t,n){n===void 0&&(n=!1);const r=Mn(e),o=zi(e),s=ji(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=oo(i)),[i,oo(i)]}function lg(e){const t=oo(e);return[ii(e),t,ii(t)]}function ii(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const ol=["left","right"],sl=["right","left"],cg=["top","bottom"],ug=["bottom","top"];function dg(e,t,n){switch(e){case"top":case"bottom":return n?t?sl:ol:t?ol:sl;case"left":case"right":return t?cg:ug;default:return[]}}function fg(e,t,n,r){const o=Mn(e);let s=dg(Nt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(ii)))),s}function oo(e){const t=Nt(e);return ig[t]+e.slice(t.length)}function pg(e){return{top:0,right:0,bottom:0,left:0,...e}}function Dc(e){return typeof e!="number"?pg(e):{top:e,right:e,bottom:e,left:e}}function so(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function il(e,t,n){let{reference:r,floating:o}=e;const s=gt(t),i=zi(t),a=ji(i),l=Nt(t),c=s==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Mn(t)){case"start":p[i]-=h*(n&&c?-1:1);break;case"end":p[i]+=h*(n&&c?-1:1);break}return p}async function hg(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=St(t,e),m=Dc(p),b=a[h?f==="floating"?"reference":"floating":f],v=so(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),C=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(_))?await(s.getScale==null?void 0:s.getScale(_))||{x:1,y:1}:{x:1,y:1},N=so(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:_,strategy:l}):C);return{top:(v.top-N.top+m.top)/S.y,bottom:(N.bottom-v.bottom+m.bottom)/S.y,left:(v.left-N.left+m.left)/S.x,right:(N.right-v.right+m.right)/S.x}}const gg=50,mg=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:hg},l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=il(c,r,l),h=r,p=0;const m={};for(let g=0;g<s.length;g++){const b=s[g];if(!b)continue;const{name:v,fn:C}=b,{x:_,y:S,data:N,reset:A}=await C({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:c,platform:a,elements:{reference:e,floating:t}});d=_??d,f=S??f,m[v]={...m[v],...N},A&&p<gg&&(p++,typeof A=="object"&&(A.placement&&(h=A.placement),A.rects&&(c=A.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):A.rects),{x:d,y:f}=il(c,h,l)),g=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:m}},bg=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=St(e,t)||{};if(c==null)return{};const f=Dc(d),h={x:n,y:r},p=zi(o),m=ji(p),g=await i.getDimensions(c),b=p==="y",v=b?"top":"left",C=b?"bottom":"right",_=b?"clientHeight":"clientWidth",S=s.reference[m]+s.reference[p]-h[p]-s.floating[m],N=h[p]-s.reference[p],A=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let R=A?A[_]:0;(!R||!await(i.isElement==null?void 0:i.isElement(A)))&&(R=a.floating[_]||s.floating[m]);const O=S/2-N/2,D=R/2-g[m]/2-1,j=Ft(f[v],D),Y=Ft(f[C],D),J=j,X=R-g[m]-Y,I=R/2-g[m]/2+O,$=si(J,I,X),U=!l.arrow&&Mn(o)!=null&&I!==$&&s.reference[m]/2-(I<J?j:Y)-g[m]/2<0,H=U?I<J?I-J:I-X:0;return{[p]:h[p]+H,data:{[p]:$,centerOffset:I-$-H,...U&&{alignmentOffset:H}},reset:U}}}),vg=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...b}=St(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Nt(o),C=gt(a),_=Nt(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),N=h||(_||!g?[oo(a)]:lg(a)),A=m!=="none";!h&&A&&N.push(...fg(a,g,m,S));const R=[a,...N],O=await l.detectOverflow(t,b),D=[];let j=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&D.push(O[v]),f){const I=ag(o,i,S);D.push(O[I[0]],O[I[1]])}if(j=[...j,{placement:o,overflows:D}],!D.every(I=>I<=0)){var Y,J;const I=(((Y=s.flip)==null?void 0:Y.index)||0)+1,$=R[I];if($&&(!(f==="alignment"?C!==gt($):!1)||j.every(T=>gt(T.placement)===C?T.overflows[0]>0:!0)))return{data:{index:I,overflows:j},reset:{placement:$}};let U=(J=j.filter(H=>H.overflows[0]<=0).sort((H,T)=>H.overflows[1]-T.overflows[1])[0])==null?void 0:J.placement;if(!U)switch(p){case"bestFit":{var X;const H=(X=j.filter(T=>{if(A){const k=gt(T.placement);return k===C||k==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(k=>k>0).reduce((k,K)=>k+K,0)]).sort((T,k)=>T[1]-k[1])[0])==null?void 0:X[0];H&&(U=H);break}case"initialPlacement":U=a;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function al(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ll(e){return sg.some(t=>e[t]>=0)}const yg=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=St(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=al(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ll(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=al(i,n.floating);return{data:{escapedOffsets:a,escaped:ll(a)}}}default:return{}}}}},Bc=new Set(["left","top"]);async function Eg(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Nt(n),a=Mn(n),l=gt(n)==="y",c=Bc.has(i)?-1:1,d=s&&l?-1:1,f=St(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),l?{x:p*d,y:h*c}:{x:h*c,y:p*d}}const Cg=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await Eg(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},wg=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:C,y:_}=v;return{x:C,y:_}}},...c}=St(e,t),d={x:n,y:r},f=await s.detectOverflow(t,c),h=gt(Nt(o)),p=Ui(h);let m=d[p],g=d[h];if(i){const v=p==="y"?"top":"left",C=p==="y"?"bottom":"right",_=m+f[v],S=m-f[C];m=si(_,m,S)}if(a){const v=h==="y"?"top":"left",C=h==="y"?"bottom":"right",_=g+f[v],S=g-f[C];g=si(_,g,S)}const b=l.fn({...t,[p]:m,[h]:g});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[p]:i,[h]:a}}}}}},xg=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=St(e,t),d={x:n,y:r},f=gt(o),h=Ui(f);let p=d[h],m=d[f];const g=St(a,t),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const _=h==="y"?"height":"width",S=s.reference[h]-s.floating[_]+b.mainAxis,N=s.reference[h]+s.reference[_]-b.mainAxis;p<S?p=S:p>N&&(p=N)}if(c){var v,C;const _=h==="y"?"width":"height",S=Bc.has(Nt(o)),N=s.reference[f]-s.floating[_]+(S&&((v=i.offset)==null?void 0:v[f])||0)+(S?0:b.crossAxis),A=s.reference[f]+s.reference[_]+(S?0:((C=i.offset)==null?void 0:C[f])||0)-(S?b.crossAxis:0);m<N?m=N:m>A&&(m=A)}return{[h]:p,[f]:m}}}},_g=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=St(e,t),d=await i.detectOverflow(t,c),f=Nt(o),h=Mn(o),p=gt(o)==="y",{width:m,height:g}=s.floating;let b,v;f==="top"||f==="bottom"?(b=f,v=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(v=f,b=h==="end"?"top":"bottom");const C=g-d.top-d.bottom,_=m-d.left-d.right,S=Ft(g-d[b],C),N=Ft(m-d[v],_),A=!t.middlewareData.shift;let R=S,O=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=C),A&&!h){const j=Ge(d.left,0),Y=Ge(d.right,0),J=Ge(d.top,0),X=Ge(d.bottom,0);p?O=m-2*(j!==0||Y!==0?j+Y:Ge(d.left,d.right)):R=g-2*(J!==0||X!==0?J+X:Ge(d.top,d.bottom))}await l({...t,availableWidth:O,availableHeight:R});const D=await i.getDimensions(a.floating);return m!==D.width||g!==D.height?{reset:{rects:!0}}:{}}}};function qo(){return typeof window<"u"}function kn(e){return Vi(e)?(e.nodeName||"").toLowerCase():"#document"}function Ve(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yt(e){var t;return(t=(Vi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Vi(e){return qo()?e instanceof Node||e instanceof Ve(e).Node:!1}function be(e){return qo()?e instanceof Element||e instanceof Ve(e).Element:!1}function et(e){return qo()?e instanceof HTMLElement||e instanceof Ve(e).HTMLElement:!1}function ai(e){return!qo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ve(e).ShadowRoot}function ur(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Qe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function Sg(e){return/^(table|td|th)$/.test(kn(e))}function Yo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Ng=/transform|translate|scale|rotate|perspective|filter/,Ag=/paint|layout|strict|content/,Xt=e=>!!e&&e!=="none";let xs;function Ki(e){const t=be(e)?Qe(e):e;return Xt(t.transform)||Xt(t.translate)||Xt(t.scale)||Xt(t.rotate)||Xt(t.perspective)||!Xo()&&(Xt(t.backdropFilter)||Xt(t.filter))||Ng.test(t.willChange||"")||Ag.test(t.contain||"")}function Tg(e){let t=At(e);for(;et(t)&&!_t(t);){if(Ki(t))return t;if(Yo(t))return null;t=At(t)}return null}function Xo(){return xs==null&&(xs=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),xs}function _t(e){return/^(html|body|#document)$/.test(kn(e))}function Qe(e){return Ve(e).getComputedStyle(e)}function Jo(e){return be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function At(e){if(kn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ai(e)&&e.host||yt(e);return ai(t)?t.host:t}function Hc(e){const t=At(e);return _t(t)?e.ownerDocument?e.ownerDocument.body:e.body:et(t)&&ur(t)?t:Hc(t)}function Bt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Hc(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ve(o);if(s){const a=li(i);return t.concat(i,i.visualViewport||[],ur(o)?o:[],a&&n?Bt(a):[])}else return t.concat(o,Bt(o,[],n))}function li(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fc(e){const t=Qe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=et(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=ro(n)!==s||ro(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Wi(e){return be(e)?e:e.contextElement}function wn(e){const t=Wi(e);if(!et(t))return bt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Fc(t);let i=(s?ro(n.width):n.width)/r,a=(s?ro(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Rg=bt(0);function $c(e){const t=Ve(e);return!Xo()||!t.visualViewport?Rg:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mg(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ve(e)?!1:t}function nn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Wi(e);let i=bt(1);t&&(r?be(r)&&(i=wn(r)):i=wn(e));const a=Mg(s,n,r)?$c(s):bt(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(s){const h=Ve(s),p=r&&be(r)?Ve(r):r;let m=h,g=li(m);for(;g&&r&&p!==m;){const b=wn(g),v=g.getBoundingClientRect(),C=Qe(g),_=v.left+(g.clientLeft+parseFloat(C.paddingLeft))*b.x,S=v.top+(g.clientTop+parseFloat(C.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,f*=b.y,l+=_,c+=S,m=Ve(g),g=li(m)}}return so({width:d,height:f,x:l,y:c})}function Qo(e,t){const n=Jo(e).scrollLeft;return t?t.left+n:nn(yt(e)).left+n}function Uc(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Qo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function kg(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=yt(r),a=t?Yo(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=bt(1);const d=bt(0),f=et(r);if((f||!f&&!s)&&((kn(r)!=="body"||ur(i))&&(l=Jo(r)),f)){const p=nn(r);c=wn(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=i&&!f&&!s?Uc(i,l):bt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}}function Og(e){return Array.from(e.getClientRects())}function Ig(e){const t=yt(e),n=Jo(e),r=e.ownerDocument.body,o=Ge(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ge(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Qo(e);const a=-n.scrollTop;return Qe(r).direction==="rtl"&&(i+=Ge(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const cl=25;function Lg(e,t){const n=Ve(e),r=yt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const d=Xo();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=Qo(r);if(c<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-f.clientWidth-p);m<=cl&&(s-=m)}else c<=cl&&(s+=c);return{width:s,height:i,x:a,y:l}}function Pg(e,t){const n=nn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=et(e)?wn(e):bt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function ul(e,t,n){let r;if(t==="viewport")r=Lg(e,n);else if(t==="document")r=Ig(yt(e));else if(be(t))r=Pg(t,n);else{const o=$c(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return so(r)}function jc(e,t){const n=At(e);return n===t||!be(n)||_t(n)?!1:Qe(n).position==="fixed"||jc(n,t)}function Dg(e,t){const n=t.get(e);if(n)return n;let r=Bt(e,[],!1).filter(a=>be(a)&&kn(a)!=="body"),o=null;const s=Qe(e).position==="fixed";let i=s?At(e):e;for(;be(i)&&!_t(i);){const a=Qe(i),l=Ki(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||ur(i)&&!l&&jc(e,i))?r=r.filter(d=>d!==i):o=a,i=At(i)}return t.set(e,r),r}function Bg(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Yo(t)?[]:Dg(t,this._c):[].concat(n),r],a=ul(t,i[0],o);let l=a.top,c=a.right,d=a.bottom,f=a.left;for(let h=1;h<i.length;h++){const p=ul(t,i[h],o);l=Ge(p.top,l),c=Ft(p.right,c),d=Ft(p.bottom,d),f=Ge(p.left,f)}return{width:c-f,height:d-l,x:f,y:l}}function Hg(e){const{width:t,height:n}=Fc(e);return{width:t,height:n}}function Fg(e,t,n){const r=et(t),o=yt(t),s=n==="fixed",i=nn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=bt(0);function c(){l.x=Qo(o)}if(r||!r&&!s)if((kn(t)!=="body"||ur(o))&&(a=Jo(t)),r){const p=nn(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&c();s&&!r&&o&&c();const d=o&&!r&&!s?Uc(o,a):bt(0),f=i.left+a.scrollLeft-l.x-d.x,h=i.top+a.scrollTop-l.y-d.y;return{x:f,y:h,width:i.width,height:i.height}}function _s(e){return Qe(e).position==="static"}function dl(e,t){if(!et(e)||Qe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return yt(e)===n&&(n=n.ownerDocument.body),n}function zc(e,t){const n=Ve(e);if(Yo(e))return n;if(!et(e)){let o=At(e);for(;o&&!_t(o);){if(be(o)&&!_s(o))return o;o=At(o)}return n}let r=dl(e,t);for(;r&&Sg(r)&&_s(r);)r=dl(r,t);return r&&_t(r)&&_s(r)&&!Ki(r)?n:r||Tg(e)||n}const $g=async function(e){const t=this.getOffsetParent||zc,n=this.getDimensions,r=await n(e.floating);return{reference:Fg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ug(e){return Qe(e).direction==="rtl"}const jg={convertOffsetParentRelativeRectToViewportRelativeRect:kg,getDocumentElement:yt,getClippingRect:Bg,getOffsetParent:zc,getElementRects:$g,getClientRects:Og,getDimensions:Hg,getScale:wn,isElement:be,isRTL:Ug};function Vc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zg(e,t){let n=null,r;const o=yt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:d,top:f,width:h,height:p}=c;if(a||t(),!h||!p)return;const m=Sr(f),g=Sr(o.clientWidth-(d+h)),b=Sr(o.clientHeight-(f+p)),v=Sr(d),_={rootMargin:-m+"px "+-g+"px "+-b+"px "+-v+"px",threshold:Ge(0,Ft(1,l))||1};let S=!0;function N(A){const R=A[0].intersectionRatio;if(R!==l){if(!S)return i();R?i(!1,R):r=setTimeout(()=>{i(!1,1e-7)},1e3)}R===1&&!Vc(c,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(N,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(N,_)}n.observe(e)}return i(!0),s}function Kc(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Wi(e),d=o||s?[...c?Bt(c):[],...t?Bt(t):[]]:[];d.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const f=c&&a?zg(c,n):null;let h=-1,p=null;i&&(p=new ResizeObserver(v=>{let[C]=v;C&&C.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var _;(_=p)==null||_.observe(t)})),n()}),c&&!l&&p.observe(c),t&&p.observe(t));let m,g=l?nn(e):null;l&&b();function b(){const v=nn(e);g&&!Vc(g,v)&&n(),g=v,m=requestAnimationFrame(b)}return n(),()=>{var v;d.forEach(C=>{o&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),f?.(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Vg=Cg,Kg=wg,Wg=vg,Gg=_g,Zg=yg,fl=bg,qg=xg,Yg=(e,t,n)=>{const r=new Map,o={platform:jg,...n},s={...o.platform,_c:r};return mg(e,t,{...o,platform:s})};var Xg=typeof document<"u",Jg=function(){},Wr=Xg?x.useLayoutEffect:Jg;function io(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!io(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!io(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Wc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pl(e,t){const n=Wc(e);return Math.round(t*n)/n}function Ss(e){const t=y.useRef(e);return Wr(()=>{t.current=e}),t}function Gc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,f]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=y.useState(r);io(h,r)||p(r);const[m,g]=y.useState(null),[b,v]=y.useState(null),C=y.useCallback(T=>{T!==A.current&&(A.current=T,g(T))},[]),_=y.useCallback(T=>{T!==R.current&&(R.current=T,v(T))},[]),S=s||m,N=i||b,A=y.useRef(null),R=y.useRef(null),O=y.useRef(d),D=l!=null,j=Ss(l),Y=Ss(o),J=Ss(c),X=y.useCallback(()=>{if(!A.current||!R.current)return;const T={placement:t,strategy:n,middleware:h};Y.current&&(T.platform=Y.current),Yg(A.current,R.current,T).then(k=>{const K={...k,isPositioned:J.current!==!1};I.current&&!io(O.current,K)&&(O.current=K,Pi.flushSync(()=>{f(K)}))})},[h,t,n,Y,J]);Wr(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,f(T=>({...T,isPositioned:!1})))},[c]);const I=y.useRef(!1);Wr(()=>(I.current=!0,()=>{I.current=!1}),[]),Wr(()=>{if(S&&(A.current=S),N&&(R.current=N),S&&N){if(j.current)return j.current(S,N,X);X()}},[S,N,X,j,D]);const $=y.useMemo(()=>({reference:A,floating:R,setReference:C,setFloating:_}),[C,_]),U=y.useMemo(()=>({reference:S,floating:N}),[S,N]),H=y.useMemo(()=>{const T={position:n,left:0,top:0};if(!U.floating)return T;const k=pl(U.floating,d.x),K=pl(U.floating,d.y);return a?{...T,transform:"translate("+k+"px, "+K+"px)",...Wc(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:K}},[n,a,U.floating,d.x,d.y]);return y.useMemo(()=>({...d,update:X,refs:$,elements:U,floatingStyles:H}),[d,X,$,U,H])}const Qg=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?fl({element:r.current,padding:o}).fn(n):{}:r?fl({element:r,padding:o}).fn(n):{}}}},Zc=(e,t)=>{const n=Vg(e);return{name:n.name,fn:n.fn,options:[e,t]}},qc=(e,t)=>{const n=Kg(e);return{name:n.name,fn:n.fn,options:[e,t]}},em=(e,t)=>({fn:qg(e).fn,options:[e,t]}),Yc=(e,t)=>{const n=Wg(e);return{name:n.name,fn:n.fn,options:[e,t]}},tm=(e,t)=>{const n=Gg(e);return{name:n.name,fn:n.fn,options:[e,t]}},nm=(e,t)=>{const n=Zg(e);return{name:n.name,fn:n.fn,options:[e,t]}},rm=(e,t)=>{const n=Qg(e);return{name:n.name,fn:n.fn,options:[e,t]}};var om="Arrow",Xc=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return u.jsx(Re.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});Xc.displayName=om;var sm=Xc;function im(e){const[t,n]=y.useState(void 0);return Ht(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Gi="Popper",[Jc,es]=Rn(Gi),[am,Qc]=Jc(Gi),eu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=y.useState(null);return u.jsx(am,{scope:t,anchor:r,onAnchorChange:o,children:n})};eu.displayName=Gi;var tu="PopperAnchor",nu=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Qc(tu,n),i=y.useRef(null),a=Oe(t,i),l=y.useRef(null);return y.useEffect(()=>{const c=l.current;l.current=r?.current||i.current,c!==l.current&&s.onAnchorChange(l.current)}),r?null:u.jsx(Re.div,{...o,ref:a})});nu.displayName=tu;var Zi="PopperContent",[lm,cm]=Jc(Zi),ru=y.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,b=Qc(Zi,n),[v,C]=y.useState(null),_=Oe(t,ue=>C(ue)),[S,N]=y.useState(null),A=im(S),R=A?.width??0,O=A?.height??0,D=r+(s!=="center"?"-"+s:""),j=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},Y=Array.isArray(c)?c:[c],J=Y.length>0,X={padding:j,boundary:Y.filter(dm),altBoundary:J},{refs:I,floatingStyles:$,placement:U,isPositioned:H,middlewareData:T}=Gc({strategy:"fixed",placement:D,whileElementsMounted:(...ue)=>Kc(...ue,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[Zc({mainAxis:o+O,alignmentAxis:i}),l&&qc({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?em():void 0,...X}),l&&Yc({...X}),tm({...X,apply:({elements:ue,rects:Ze,availableWidth:an,availableHeight:st})=>{const{width:Wt,height:Gt}=Ze.reference,it=ue.floating.style;it.setProperty("--radix-popper-available-width",`${an}px`),it.setProperty("--radix-popper-available-height",`${st}px`),it.setProperty("--radix-popper-anchor-width",`${Wt}px`),it.setProperty("--radix-popper-anchor-height",`${Gt}px`)}}),S&&rm({element:S,padding:a}),fm({arrowWidth:R,arrowHeight:O}),h&&nm({strategy:"referenceHidden",...X})]}),[k,K]=iu(U),oe=vt(m);Ht(()=>{H&&oe?.()},[H,oe]);const Z=T.arrow?.x,ce=T.arrow?.y,Ke=T.arrow?.centerOffset!==0,[he,ye]=y.useState();return Ht(()=>{v&&ye(window.getComputedStyle(v).zIndex)},[v]),u.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:H?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[T.transformOrigin?.x,T.transformOrigin?.y].join(" "),...T.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(lm,{scope:n,placedSide:k,onArrowChange:N,arrowX:Z,arrowY:ce,shouldHideArrow:Ke,children:u.jsx(Re.div,{"data-side":k,"data-align":K,...g,ref:_,style:{...g.style,animation:H?void 0:"none"}})})})});ru.displayName=Zi;var ou="PopperArrow",um={top:"bottom",right:"left",bottom:"top",left:"right"},su=y.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=cm(ou,r),i=um[s.placedSide];return u.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:u.jsx(sm,{...o,ref:n,style:{...o.style,display:"block"}})})});su.displayName=ou;function dm(e){return e!==null}var fm=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,d]=iu(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(o.arrow?.x??0)+a/2,p=(o.arrow?.y??0)+l/2;let m="",g="";return c==="bottom"?(m=i?f:`${h}px`,g=`${-l}px`):c==="top"?(m=i?f:`${h}px`,g=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,g=i?f:`${p}px`):c==="left"&&(m=`${r.floating.width+l}px`,g=i?f:`${p}px`),{data:{x:m,y:g}}}});function iu(e){const[t,n="center"]=e.split("-");return[t,n]}var qi=eu,Yi=nu,au=ru,lu=su,pm="Portal",Xi=y.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=y.useState(!1);Ht(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?_c.createPortal(u.jsx(Re.div,{...r,ref:t}),i):null});Xi.displayName=pm;function hm(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var on=e=>{const{present:t,children:n}=e,r=gm(t),o=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),s=Oe(r.ref,mm(o));return typeof n=="function"||r.isPresent?y.cloneElement(o,{ref:s}):null};on.displayName="Presence";function gm(e){const[t,n]=y.useState(),r=y.useRef(null),o=y.useRef(e),s=y.useRef("none"),i=e?"mounted":"unmounted",[a,l]=hm(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const c=Nr(r.current);s.current=a==="mounted"?c:"none"},[a]),Ht(()=>{const c=r.current,d=o.current;if(d!==e){const h=s.current,p=Nr(c);e?l("MOUNT"):p==="none"||c?.display==="none"?l("UNMOUNT"):l(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ht(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,f=p=>{const g=Nr(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&g&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(s.current=Nr(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:y.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Nr(e){return e?.animationName||"none"}function mm(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var bm=y[" useInsertionEffect ".trim().toString()]||Ht;function ts({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=vm({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const d=y.useRef(e!==void 0);y.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const c=y.useCallback(d=>{if(a){const f=ym(d)?d(e):d;f!==e&&i.current?.(f)}else s(d)},[a,e,s,i]);return[l,c]}function vm({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),o=y.useRef(n),s=y.useRef(t);return bm(()=>{s.current=t},[t]),y.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function ym(e){return typeof e=="function"}var Em=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},dn=new WeakMap,Ar=new WeakMap,Tr={},Ns=0,cu=function(e){return e&&(e.host||cu(e.parentNode))},Cm=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=cu(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},wm=function(e,t,n,r){var o=Cm(t,Array.isArray(e)?e:[e]);Tr[n]||(Tr[n]=new WeakMap);var s=Tr[n],i=[],a=new Set,l=new Set(o),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};o.forEach(c);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))d(h);else try{var p=h.getAttribute(r),m=p!==null&&p!=="false",g=(dn.get(h)||0)+1,b=(s.get(h)||0)+1;dn.set(h,g),s.set(h,b),i.push(h),g===1&&m&&Ar.set(h,!0),b===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return d(t),a.clear(),Ns++,function(){i.forEach(function(f){var h=dn.get(f)-1,p=s.get(f)-1;dn.set(f,h),s.set(f,p),h||(Ar.has(f)||f.removeAttribute(r),Ar.delete(f)),p||f.removeAttribute(n)}),Ns--,Ns||(dn=new WeakMap,dn=new WeakMap,Ar=new WeakMap,Tr={})}},uu=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Em(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),wm(r,o,n,"aria-hidden")):function(){return null}},ft=function(){return ft=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ft.apply(this,arguments)};function du(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function xm(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Gr="right-scroll-bar-position",Zr="width-before-scroll-bar",_m="with-scroll-bars-hidden",Sm="--removed-body-scroll-bar-size";function As(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Nm(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Am=typeof window<"u"?y.useLayoutEffect:y.useEffect,hl=new WeakMap;function Tm(e,t){var n=Nm(null,function(r){return e.forEach(function(o){return As(o,r)})});return Am(function(){var r=hl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||As(a,null)}),s.forEach(function(a){o.has(a)||As(a,i)})}hl.set(n,e)},[e]),n}function Rm(e){return e}function Mm(e,t){t===void 0&&(t=Rm);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var l=function(){var d=i;i=[],d.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){i.push(d),c()},filter:function(d){return i=i.filter(d),n}}}};return o}function km(e){e===void 0&&(e={});var t=Mm(null);return t.options=ft({async:!0,ssr:!1},e),t}var fu=function(e){var t=e.sideCar,n=du(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,ft({},n))};fu.isSideCarExport=!0;function Om(e,t){return e.useMedium(t),fu}var pu=km(),Ts=function(){},ns=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Ts,onWheelCapture:Ts,onTouchMoveCapture:Ts}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,m=e.noIsolation,g=e.inert,b=e.allowPinchZoom,v=e.as,C=v===void 0?"div":v,_=e.gapMode,S=du(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=h,A=Tm([n,t]),R=ft(ft({},S),o);return y.createElement(y.Fragment,null,d&&y.createElement(N,{sideCar:pu,removeScrollBar:c,shards:f,noRelative:p,noIsolation:m,inert:g,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:_}),i?y.cloneElement(y.Children.only(a),ft(ft({},R),{ref:A})):y.createElement(C,ft({},R,{className:l,ref:A}),a))});ns.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ns.classNames={fullWidth:Zr,zeroRight:Gr};var Im=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Lm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Im();return t&&e.setAttribute("nonce",t),e}function Pm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Dm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Bm=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Lm())&&(Pm(t,n),Dm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Hm=function(){var e=Bm();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hu=function(){var e=Hm(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Fm={left:0,top:0,right:0,gap:0},Rs=function(e){return parseInt(e||"",10)||0},$m=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Rs(n),Rs(r),Rs(o)]},Um=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Fm;var t=$m(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},jm=hu(),xn="data-scroll-locked",zm=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
2
2
|
.`.concat(_m,` {
|
|
3
3
|
overflow: hidden `).concat(r,`;
|
|
4
4
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
`)},gl=function(){var e=parseInt(document.body.getAttribute(xn)||"0",10);return isFinite(e)?e:0},Vm=function(){y.useEffect(function(){return document.body.setAttribute(xn,(gl()+1).toString()),function(){var e=gl()-1;e<=0?document.body.removeAttribute(xn):document.body.setAttribute(xn,e.toString())}},[])},Km=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Vm();var s=y.useMemo(function(){return Um(o)},[o]);return y.createElement(jm,{styles:zm(s,!t,o,n?"":"!important")})},ci=!1;if(typeof window<"u")try{var Rr=Object.defineProperty({},"passive",{get:function(){return ci=!0,!0}});window.addEventListener("test",Rr,Rr),window.removeEventListener("test",Rr,Rr)}catch{ci=!1}var fn=ci?{passive:!1}:!1,Wm=function(e){return e.tagName==="TEXTAREA"},gu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Wm(e)&&n[t]==="visible")},Gm=function(e){return gu(e,"overflowY")},Zm=function(e){return gu(e,"overflowX")},ml=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=mu(e,r);if(o){var s=bu(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},qm=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Ym=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},mu=function(e,t){return e==="v"?Gm(t):Zm(t)},bu=function(e,t){return e==="v"?qm(t):Ym(t)},Xm=function(e,t){return e==="h"&&t==="rtl"?-1:1},Jm=function(e,t,n,r,o){var s=Xm(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,l=t.contains(a),c=!1,d=i>0,f=0,h=0;do{if(!a)break;var p=bu(e,a),m=p[0],g=p[1],b=p[2],v=g-b-s*m;(m||v)&&mu(e,a)&&(f+=v,h+=m);var C=a.parentNode;a=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(c=!0),c},Mr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},bl=function(e){return[e.deltaX,e.deltaY]},vl=function(e){return e&&"current"in e?e.current:e},Qm=function(e,t){return e[0]===t[0]&&e[1]===t[1]},e1=function(e){return`
|
|
39
39
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
40
40
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
41
|
-
`)},t1=0,pn=[];function n1(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),o=y.useState(t1++)[0],s=y.useState(hu)[0],i=y.useRef(e);y.useEffect(function(){i.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=xm([e.lockRef.current],(e.shards||[]).map(vl),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=y.useCallback(function(g,b){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var v=Mr(g),C=n.current,_="deltaX"in g?g.deltaX:C[0]-v[0],S="deltaY"in g?g.deltaY:C[1]-v[1],N,A=g.target,R=Math.abs(_)>Math.abs(S)?"h":"v";if("touches"in g&&R==="h"&&A.type==="range")return!1;var O=window.getSelection(),D=O&&O.anchorNode,j=D?D===A||D.contains(A):!1;if(j)return!1;var Y=ml(R,A);if(!Y)return!0;if(Y?N=R:(N=R==="v"?"h":"v",Y=ml(R,A)),!Y)return!1;if(!r.current&&"changedTouches"in g&&(_||S)&&(r.current=N),!N)return!0;var J=r.current||N;return Jm(J,b,g,J==="h"?_:S)},[]),l=y.useCallback(function(g){var b=g;if(!(!pn.length||pn[pn.length-1]!==s)){var v="deltaY"in b?bl(b):Mr(b),C=t.current.filter(function(N){return N.name===b.type&&(N.target===b.target||b.target===N.shadowParent)&&Qm(N.delta,v)})[0];if(C&&C.should){b.cancelable&&b.preventDefault();return}if(!C){var _=(i.current.shards||[]).map(vl).filter(Boolean).filter(function(N){return N.contains(b.target)}),S=_.length>0?a(b,_[0]):!i.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),c=y.useCallback(function(g,b,v,C){var _={name:g,delta:b,target:v,should:C,shadowParent:r1(v)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(S){return S!==_})},1)},[]),d=y.useCallback(function(g){n.current=Mr(g),r.current=void 0},[]),f=y.useCallback(function(g){c(g.type,bl(g),g.target,a(g,e.lockRef.current))},[]),h=y.useCallback(function(g){c(g.type,Mr(g),g.target,a(g,e.lockRef.current))},[]);y.useEffect(function(){return pn.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,fn),document.addEventListener("touchmove",l,fn),document.addEventListener("touchstart",d,fn),function(){pn=pn.filter(function(g){return g!==s}),document.removeEventListener("wheel",l,fn),document.removeEventListener("touchmove",l,fn),document.removeEventListener("touchstart",d,fn)}},[]);var p=e.removeScrollBar,m=e.inert;return y.createElement(y.Fragment,null,m?y.createElement(s,{styles:e1(o)}):null,p?y.createElement(Km,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function r1(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const o1=Om(pu,n1);var Ji=y.forwardRef(function(e,t){return y.createElement(ns,ft({},e,{ref:t,sideCar:o1}))});Ji.classNames=ns.classNames;var rs="Popover",[vu]=Rn(rs,[es]),dr=es(),[s1,Ut]=vu(rs),yu=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=dr(t),l=y.useRef(null),[c,d]=y.useState(!1),[f,h]=ts({prop:r,defaultProp:o??!1,onChange:s,caller:rs});return u.jsx(qi,{...a,children:u.jsx(s1,{scope:t,contentId:_n(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:y.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:c,onCustomAnchorAdd:y.useCallback(()=>d(!0),[]),onCustomAnchorRemove:y.useCallback(()=>d(!1),[]),modal:i,children:n})})};yu.displayName=rs;var Eu="PopoverAnchor",i1=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ut(Eu,n),s=dr(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return y.useEffect(()=>(i(),()=>a()),[i,a]),u.jsx(Yi,{...s,...r,ref:t})});i1.displayName=Eu;var Cu="PopoverTrigger",wu=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ut(Cu,n),s=dr(n),i=Oe(t,o.triggerRef),a=u.jsx(Re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Au(o.open),...r,ref:i,onClick:ae(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:u.jsx(Yi,{asChild:!0,...s,children:a})});wu.displayName=Cu;var Qi="PopoverPortal",[a1,l1]=vu(Qi,{forceMount:void 0}),xu=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Ut(Qi,t);return u.jsx(a1,{scope:t,forceMount:n,children:u.jsx(on,{present:n||s.open,children:u.jsx(Xi,{asChild:!0,container:o,children:r})})})};xu.displayName=Qi;var Sn="PopoverContent",_u=y.forwardRef((e,t)=>{const n=l1(Sn,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Ut(Sn,e.__scopePopover);return u.jsx(on,{present:r||s.open,children:s.modal?u.jsx(u1,{...o,ref:t}):u.jsx(d1,{...o,ref:t})})});_u.displayName=Sn;var c1=tr("PopoverContent.RemoveScroll"),u1=y.forwardRef((e,t)=>{const n=Ut(Sn,e.__scopePopover),r=y.useRef(null),o=Oe(t,r),s=y.useRef(!1);return y.useEffect(()=>{const i=r.current;if(i)return uu(i)},[]),u.jsx(Ji,{as:c1,allowPinchZoom:!0,children:u.jsx(Su,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ae(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:ae(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ae(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),d1=y.forwardRef((e,t)=>{const n=Ut(Sn,e.__scopePopover),r=y.useRef(!1),o=y.useRef(!1);return u.jsx(Su,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Su=y.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...f}=e,h=Ut(Sn,n),p=dr(n);return Lc(),u.jsx($i,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:u.jsx(Fi,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1),children:u.jsx(au,{"data-state":Au(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Nu="PopoverClose",f1=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ut(Nu,n);return u.jsx(Re.button,{type:"button",...r,ref:t,onClick:ae(e.onClick,()=>o.onOpenChange(!1))})});f1.displayName=Nu;var p1="PopoverArrow",h1=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=dr(n);return u.jsx(lu,{...o,...r,ref:t})});h1.displayName=p1;function Au(e){return e?"open":"closed"}var g1=yu,m1=wu,b1=xu,v1=_u;function jt({...e}){return u.jsx(g1,{...e})}function zt({...e}){return u.jsx(m1,{...e})}function Vt({className:e,align:t="center",sideOffset:n=4,...r}){return u.jsx(b1,{children:u.jsx(v1,{align:t,sideOffset:n,className:ke("tiptap-popover",e),...r})})}var y1=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ui=y1.join(","),Tu=typeof Element>"u",nr=Tu?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ao=!Tu&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},lo=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):lo(t.parentNode));return i},E1=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},C1=function(t,n,r){if(lo(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(ui));return n&&nr.call(t,ui)&&o.unshift(t),o=o.filter(r),o},di=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!lo(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=di(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var d=nr.call(i,ui);d&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var f=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),h=!lo(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(f&&h){var p=di(f===!0?i.children:f.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:i,candidates:p})}else s.unshift.apply(s,i.children)}}return o},Ru=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Mu=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||E1(t))&&!Ru(t)?0:t.tabIndex},w1=function(t,n){var r=Mu(t);return r<0&&n&&!Ru(t)?0:r},x1=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ku=function(t){return t.tagName==="INPUT"},_1=function(t){return ku(t)&&t.type==="hidden"},S1=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},N1=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},A1=function(t){if(!t.name)return!0;var n=t.form||ao(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=N1(o,t.form);return!s||s===t},T1=function(t){return ku(t)&&t.type==="radio"},R1=function(t){return T1(t)&&!A1(t)},M1=function(t){var n,r=t&&ao(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var c,d,f;r=ao(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((d=o)!==null&&d!==void 0&&(f=d.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return s},yl=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},k1=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=nr.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(nr.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var c=t.parentElement,d=ao(t);if(c&&!c.shadowRoot&&o(c)===!0)return yl(t);t.assignedSlot?t=t.assignedSlot:!c&&d!==t.ownerDocument?t=d.host:t=c}t=l}if(M1(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return yl(t);return!1},O1=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return nr.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},I1=function(t,n){return!(n.disabled||_1(n)||k1(n,t)||S1(n)||O1(n))},El=function(t,n){return!(R1(n)||Mu(n)<0||!I1(t,n))},L1=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ou=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=w1(a,i),c=i?Ou(o.candidates):a;l===0?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:c})}),r.sort(x1).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Iu=function(t,n){n=n||{};var r;return n.getShadowRoot?r=di([t],n.includeContainer,{filter:El.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:L1}):r=C1(t,n.includeContainer,El.bind(null,n)),Ou(r)};function P1(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function D1(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Lu(){return/apple/i.test(navigator.vendor)}function B1(){return P1().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function H1(){return D1().includes("jsdom/")}const Cl="data-floating-ui-focusable",F1="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function fi(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Nn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ai(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function hn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ms(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function $1(e){return e.matches("html,body")}function mt(e){return e?.ownerDocument||document}function U1(e){return et(e)&&e.matches(F1)}function j1(e){if(!e||H1())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function z1(e){return e?e.hasAttribute(Cl)?e:e.querySelector("["+Cl+"]")||e:null}function qr(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...qr(e,o.id,n)])}function V1(e){return"nativeEvent"in e}function pi(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var K1=typeof document<"u",W1=function(){},rt=K1?x.useLayoutEffect:W1;const G1={...y};function kr(e){const t=y.useRef(e);return rt(()=>{t.current=e}),t}const Z1=G1.useInsertionEffect,q1=Z1||(e=>e());function pt(e){const t=y.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return q1(()=>{t.current=e}),y.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Pu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Du(e,t){const n=Iu(e,Pu()),r=n.length;if(r===0)return;const o=fi(mt(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function Y1(e){return Du(mt(e).body,1)||e}function X1(e){return Du(mt(e).body,-1)||e}function ks(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Nn(n,r)}function J1(e){Iu(e,Pu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function wl(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Bu(e){const t=y.useRef(void 0),n=y.useCallback(r=>{const o=e.map(s=>{if(s!=null){if(typeof s=="function"){const i=s,a=i(r);return typeof a=="function"?a:()=>{i(null)}}return s.current=r,()=>{s.current=null}}});return()=>{o.forEach(s=>s?.())}},e);return y.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const Q1="data-floating-ui-focusable",xl="active",_l="selected",eb={...y};let Sl=!1,tb=0;const Nl=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+tb++;function nb(){const[e,t]=y.useState(()=>Sl?Nl():void 0);return rt(()=>{e==null&&t(Nl())},[]),y.useEffect(()=>{Sl=!0},[]),e}const rb=eb.useId,ea=rb||nb;let hi;process.env.NODE_ENV!=="production"&&(hi=new Set);function ob(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=hi)!=null&&e.has(o))){var s;(s=hi)==null||s.add(o),console.error(o)}}function sb(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const ib=y.createContext(null),ab=y.createContext(null),ta=()=>{var e;return((e=y.useContext(ib))==null?void 0:e.id)||null},na=()=>y.useContext(ab);function fr(e){return"data-floating-ui-"+e}function Ye(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Al=fr("safe-polygon");function Os(e,t,n){if(n&&!pi(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function Is(e){return typeof e=="function"?e():e}function lb(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:d=!1,restMs:f=0,move:h=!0}=t,p=na(),m=ta(),g=kr(c),b=kr(l),v=kr(n),C=kr(f),_=y.useRef(),S=y.useRef(-1),N=y.useRef(),A=y.useRef(-1),R=y.useRef(!0),O=y.useRef(!1),D=y.useRef(()=>{}),j=y.useRef(!1),Y=pt(()=>{var H;const T=(H=o.current.openEvent)==null?void 0:H.type;return T?.includes("mouse")&&T!=="mousedown"});y.useEffect(()=>{if(!a)return;function H(T){let{open:k}=T;k||(Ye(S),Ye(A),R.current=!0,j.current=!1)}return s.on("openchange",H),()=>{s.off("openchange",H)}},[a,s]),y.useEffect(()=>{if(!a||!g.current||!n)return;function H(k){Y()&&r(!1,k,"hover")}const T=mt(i.floating).documentElement;return T.addEventListener("mouseleave",H),()=>{T.removeEventListener("mouseleave",H)}},[i.floating,n,r,a,g,Y]);const J=y.useCallback(function(H,T,k){T===void 0&&(T=!0),k===void 0&&(k="hover");const K=Os(b.current,"close",_.current);K&&!N.current?(Ye(S),S.current=window.setTimeout(()=>r(!1,H,k),K)):T&&(Ye(S),r(!1,H,k))},[b,r]),X=pt(()=>{D.current(),N.current=void 0}),I=pt(()=>{if(O.current){const H=mt(i.floating).body;H.style.pointerEvents="",H.removeAttribute(Al),O.current=!1}}),$=pt(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);y.useEffect(()=>{if(!a)return;function H(Z){if(Ye(S),R.current=!1,d&&!pi(_.current)||Is(C.current)>0&&!Os(b.current,"open"))return;const ce=Os(b.current,"open",_.current);ce?S.current=window.setTimeout(()=>{v.current||r(!0,Z,"hover")},ce):n||r(!0,Z,"hover")}function T(Z){if($()){I();return}D.current();const ce=mt(i.floating);if(Ye(A),j.current=!1,g.current&&o.current.floatingContext){n||Ye(S),N.current=g.current({...o.current.floatingContext,tree:p,x:Z.clientX,y:Z.clientY,onClose(){I(),X(),$()||J(Z,!0,"safe-polygon")}});const he=N.current;ce.addEventListener("mousemove",he),D.current=()=>{ce.removeEventListener("mousemove",he)};return}(_.current!=="touch"||!Nn(i.floating,Z.relatedTarget))&&J(Z)}function k(Z){$()||o.current.floatingContext&&(g.current==null||g.current({...o.current.floatingContext,tree:p,x:Z.clientX,y:Z.clientY,onClose(){I(),X(),$()||J(Z)}})(Z))}function K(){Ye(S)}function oe(Z){$()||J(Z,!1)}if(be(i.domReference)){const Z=i.domReference,ce=i.floating;return n&&Z.addEventListener("mouseleave",k),h&&Z.addEventListener("mousemove",H,{once:!0}),Z.addEventListener("mouseenter",H),Z.addEventListener("mouseleave",T),ce&&(ce.addEventListener("mouseleave",k),ce.addEventListener("mouseenter",K),ce.addEventListener("mouseleave",oe)),()=>{n&&Z.removeEventListener("mouseleave",k),h&&Z.removeEventListener("mousemove",H),Z.removeEventListener("mouseenter",H),Z.removeEventListener("mouseleave",T),ce&&(ce.removeEventListener("mouseleave",k),ce.removeEventListener("mouseenter",K),ce.removeEventListener("mouseleave",oe))}}},[i,a,e,d,h,J,X,I,r,n,v,p,b,g,o,$,C]),rt(()=>{var H;if(a&&n&&(H=g.current)!=null&&(H=H.__options)!=null&&H.blockPointerEvents&&Y()){O.current=!0;const k=i.floating;if(be(i.domReference)&&k){var T;const K=mt(i.floating).body;K.setAttribute(Al,"");const oe=i.domReference,Z=p==null||(T=p.nodesRef.current.find(ce=>ce.id===m))==null||(T=T.context)==null?void 0:T.elements.floating;return Z&&(Z.style.pointerEvents=""),K.style.pointerEvents="none",oe.style.pointerEvents="auto",k.style.pointerEvents="auto",()=>{K.style.pointerEvents="",oe.style.pointerEvents="",k.style.pointerEvents=""}}}},[a,n,m,i,p,g,Y]),rt(()=>{n||(_.current=void 0,j.current=!1,X(),I())},[n,X,I]),y.useEffect(()=>()=>{X(),Ye(S),Ye(A),I()},[a,i.domReference,X,I]);const U=y.useMemo(()=>{function H(T){_.current=T.pointerType}return{onPointerDown:H,onPointerEnter:H,onMouseMove(T){const{nativeEvent:k}=T;function K(){!R.current&&!v.current&&r(!0,k,"hover")}d&&!pi(_.current)||n||Is(C.current)===0||j.current&&T.movementX**2+T.movementY**2<2||(Ye(A),_.current==="touch"?K():(j.current=!0,A.current=window.setTimeout(K,Is(C.current))))}}},[d,r,n,v,C]);return y.useMemo(()=>a?{reference:U}:{},[a,U])}const Tl=()=>{},cb=y.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Tl,setState:Tl,isInstantPhase:!1});function ub(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,s]=y.useReducer((l,c)=>({...l,...c}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),i=y.useRef(null),a=y.useCallback(l=>{s({currentId:l})},[]);return rt(()=>{o.currentId?i.current===null?i.current=o.currentId:o.isInstantPhase||s({isInstantPhase:!0}):(o.isInstantPhase&&s({isInstantPhase:!1}),i.current=null)},[o.currentId,o.isInstantPhase]),u.jsx(cb.Provider,{value:y.useMemo(()=>({...o,setState:s,setCurrentId:a}),[o,a]),children:t})}const db={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Rl=y.forwardRef(function(t,n){const[r,o]=y.useState();rt(()=>{Lu()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[fr("focus-guard")]:"",style:db};return u.jsx("span",{...t,...s})}),fb={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Hu=y.createContext(null),Ml=fr("portal");function pb(e){e===void 0&&(e={});const{id:t,root:n}=e,r=ea(),o=gb(),[s,i]=y.useState(null),a=y.useRef(null);return rt(()=>()=>{s?.remove(),queueMicrotask(()=>{a.current=null})},[s]),rt(()=>{if(!r||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const c=document.createElement("div");c.id=r,c.setAttribute(Ml,""),l.appendChild(c),a.current=c,i(c)},[t,r]),rt(()=>{if(n===null||!r||a.current)return;let l=n||o?.portalNode;l&&!Vi(l)&&(l=l.current),l=l||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,l.appendChild(c));const d=document.createElement("div");d.id=r,d.setAttribute(Ml,""),l=c||l,l.appendChild(d),a.current=d,i(d)},[t,n,r,o]),s}function hb(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=pb({id:n,root:r}),[i,a]=y.useState(null),l=y.useRef(null),c=y.useRef(null),d=y.useRef(null),f=y.useRef(null),h=i?.modal,p=i?.open,m=!!i&&!i.modal&&i.open&&o&&!!(r||s);return y.useEffect(()=>{if(!s||!o||h)return;function g(b){s&&ks(b)&&(b.type==="focusin"?wl:J1)(s)}return s.addEventListener("focusin",g,!0),s.addEventListener("focusout",g,!0),()=>{s.removeEventListener("focusin",g,!0),s.removeEventListener("focusout",g,!0)}},[s,o,h]),y.useEffect(()=>{s&&(p||wl(s))},[p,s]),u.jsxs(Hu.Provider,{value:y.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:f,portalNode:s,setFocusManagerState:a}),[o,s]),children:[m&&s&&u.jsx(Rl,{"data-type":"outside",ref:l,onFocus:g=>{if(ks(g,s)){var b;(b=d.current)==null||b.focus()}else{const v=i?i.domReference:null,C=X1(v);C?.focus()}}}),m&&s&&u.jsx("span",{"aria-owns":s.id,style:fb}),s&&Pi.createPortal(t,s),m&&s&&u.jsx(Rl,{"data-type":"outside",ref:c,onFocus:g=>{if(ks(g,s)){var b;(b=f.current)==null||b.focus()}else{const v=i?i.domReference:null,C=Y1(v);C?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,g.nativeEvent,"focus-out")}}})]})}const gb=()=>y.useContext(Hu),mb={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},bb={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},kl=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function vb(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:p,capture:m}=t,g=na(),b=pt(typeof l=="function"?l:()=>!1),v=typeof l=="function"?b:l,C=y.useRef(!1),{escapeKey:_,outsidePress:S}=kl(p),{escapeKey:N,outsidePress:A}=kl(m),R=y.useRef(!1),O=pt(I=>{var $;if(!n||!i||!a||I.key!=="Escape"||R.current)return;const U=($=s.current.floatingContext)==null?void 0:$.nodeId,H=g?qr(g.nodesRef.current,U):[];if(!_&&(I.stopPropagation(),H.length>0)){let T=!0;if(H.forEach(k=>{var K;if((K=k.context)!=null&&K.open&&!k.context.dataRef.current.__escapeKeyBubbles){T=!1;return}}),!T)return}r(!1,V1(I)?I.nativeEvent:I,"escape-key")}),D=pt(I=>{var $;const U=()=>{var H;O(I),(H=hn(I))==null||H.removeEventListener("keydown",U)};($=hn(I))==null||$.addEventListener("keydown",U)}),j=pt(I=>{var $;const U=s.current.insideReactTree;s.current.insideReactTree=!1;const H=C.current;if(C.current=!1,c==="click"&&H||U||typeof v=="function"&&!v(I))return;const T=hn(I),k="["+fr("inert")+"]",K=mt(o.floating).querySelectorAll(k);let oe=be(T)?T:null;for(;oe&&!_t(oe);){const he=At(oe);if(_t(he)||!be(he))break;oe=he}if(K.length&&be(T)&&!$1(T)&&!Nn(T,o.floating)&&Array.from(K).every(he=>!Nn(oe,he)))return;if(et(T)&&X){const he=_t(T),ye=Qe(T),ue=/auto|scroll/,Ze=he||ue.test(ye.overflowX),an=he||ue.test(ye.overflowY),st=Ze&&T.clientWidth>0&&T.scrollWidth>T.clientWidth,Wt=an&&T.clientHeight>0&&T.scrollHeight>T.clientHeight,Gt=ye.direction==="rtl",it=Wt&&(Gt?I.offsetX<=T.offsetWidth-T.clientWidth:I.offsetX>T.clientWidth),Ln=st&&I.offsetY>T.clientHeight;if(it||Ln)return}const Z=($=s.current.floatingContext)==null?void 0:$.nodeId,ce=g&&qr(g.nodesRef.current,Z).some(he=>{var ye;return Ms(I,(ye=he.context)==null?void 0:ye.elements.floating)});if(Ms(I,o.floating)||Ms(I,o.domReference)||ce)return;const Ke=g?qr(g.nodesRef.current,Z):[];if(Ke.length>0){let he=!0;if(Ke.forEach(ye=>{var ue;if((ue=ye.context)!=null&&ue.open&&!ye.context.dataRef.current.__outsidePressBubbles){he=!1;return}}),!he)return}r(!1,I,"outside-press")}),Y=pt(I=>{var $;const U=()=>{var H;j(I),(H=hn(I))==null||H.removeEventListener(c,U)};($=hn(I))==null||$.addEventListener(c,U)});y.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=_,s.current.__outsidePressBubbles=S;let I=-1;function $(K){r(!1,K,"ancestor-scroll")}function U(){window.clearTimeout(I),R.current=!0}function H(){I=window.setTimeout(()=>{R.current=!1},Xo()?5:0)}const T=mt(o.floating);a&&(T.addEventListener("keydown",N?D:O,N),T.addEventListener("compositionstart",U),T.addEventListener("compositionend",H)),v&&T.addEventListener(c,A?Y:j,A);let k=[];return h&&(be(o.domReference)&&(k=Bt(o.domReference)),be(o.floating)&&(k=k.concat(Bt(o.floating))),!be(o.reference)&&o.reference&&o.reference.contextElement&&(k=k.concat(Bt(o.reference.contextElement)))),k=k.filter(K=>{var oe;return K!==((oe=T.defaultView)==null?void 0:oe.visualViewport)}),k.forEach(K=>{K.addEventListener("scroll",$,{passive:!0})}),()=>{a&&(T.removeEventListener("keydown",N?D:O,N),T.removeEventListener("compositionstart",U),T.removeEventListener("compositionend",H)),v&&T.removeEventListener(c,A?Y:j,A),k.forEach(K=>{K.removeEventListener("scroll",$)}),window.clearTimeout(I)}},[s,o,a,v,c,n,r,h,i,_,S,O,N,D,j,A,Y]),y.useEffect(()=>{s.current.insideReactTree=!1},[s,v,c]);const J=y.useMemo(()=>({onKeyDown:O,...d&&{[mb[f]]:I=>{r(!1,I.nativeEvent,"reference-press")},...f!=="click"&&{onClick(I){r(!1,I.nativeEvent,"reference-press")}}}}),[O,r,d,f]),X=y.useMemo(()=>{function I($){$.button===0&&(C.current=!0)}return{onKeyDown:O,onMouseDown:I,onMouseUp:I,[bb[c]]:()=>{s.current.insideReactTree=!0}}},[O,c,s]);return y.useMemo(()=>i?{reference:J,floating:X}:{},[i,J,X])}function yb(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=ea(),s=y.useRef({}),[i]=y.useState(()=>sb()),a=ta()!=null;if(process.env.NODE_ENV!=="production"){const p=r.reference;p&&!be(p)&&ob("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=y.useState(r.reference),d=pt((p,m,g)=>{s.current.openEvent=p?m:void 0,i.emit("openchange",{open:p,event:m,reason:g,nested:a}),n?.(p,m,g)}),f=y.useMemo(()=>({setPositionReference:c}),[]),h=y.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return y.useMemo(()=>({dataRef:s,open:t,onOpenChange:d,elements:h,events:i,floatingId:o,refs:f}),[t,d,h,i,o,f])}function Eb(e){e===void 0&&(e={});const{nodeId:t}=e,n=yb({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=y.useState(null),[a,l]=y.useState(null),d=o?.domReference||s,f=y.useRef(null),h=na();rt(()=>{d&&(f.current=d)},[d]);const p=Gc({...e,elements:{...o,...a&&{reference:a}}}),m=y.useCallback(_=>{const S=be(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),getClientRects:()=>_.getClientRects(),contextElement:_}:_;l(S),p.refs.setReference(S)},[p.refs]),g=y.useCallback(_=>{(be(_)||_===null)&&(f.current=_,i(_)),(be(p.refs.reference.current)||p.refs.reference.current===null||_!==null&&!be(_))&&p.refs.setReference(_)},[p.refs]),b=y.useMemo(()=>({...p.refs,setReference:g,setPositionReference:m,domReference:f}),[p.refs,g,m]),v=y.useMemo(()=>({...p.elements,domReference:d}),[p.elements,d]),C=y.useMemo(()=>({...p,...r,refs:b,elements:v,nodeId:t}),[p,b,v,t,r]);return rt(()=>{r.dataRef.current.floatingContext=C;const _=h?.nodesRef.current.find(S=>S.id===t);_&&(_.context=C)}),y.useMemo(()=>({...p,context:C,refs:b,elements:v}),[p,b,v,C])}function Ls(){return B1()&&Lu()}function Cb(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=y.useRef(!1),d=y.useRef(-1),f=y.useRef(!0);y.useEffect(()=>{if(!a)return;const p=Ve(i.domReference);function m(){!n&&et(i.domReference)&&i.domReference===fi(mt(i.domReference))&&(c.current=!0)}function g(){f.current=!0}function b(){f.current=!1}return p.addEventListener("blur",m),Ls()&&(p.addEventListener("keydown",g,!0),p.addEventListener("pointerdown",b,!0)),()=>{p.removeEventListener("blur",m),Ls()&&(p.removeEventListener("keydown",g,!0),p.removeEventListener("pointerdown",b,!0))}},[i.domReference,n,a]),y.useEffect(()=>{if(!a)return;function p(m){let{reason:g}=m;(g==="reference-press"||g==="escape-key")&&(c.current=!0)}return o.on("openchange",p),()=>{o.off("openchange",p)}},[o,a]),y.useEffect(()=>()=>{Ye(d)},[]);const h=y.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(p){if(c.current)return;const m=hn(p.nativeEvent);if(l&&be(m)){if(Ls()&&!p.relatedTarget){if(!f.current&&!U1(m))return}else if(!j1(m))return}r(!0,p.nativeEvent,"focus")},onBlur(p){c.current=!1;const m=p.relatedTarget,g=p.nativeEvent,b=be(m)&&m.hasAttribute(fr("focus-guard"))&&m.getAttribute("data-type")==="outside";d.current=window.setTimeout(()=>{var v;const C=fi(i.domReference?i.domReference.ownerDocument:document);!m&&C===i.domReference||Nn((v=s.current.floatingContext)==null?void 0:v.refs.floating.current,C)||Nn(i.domReference,C)||b||r(!1,g,"focus")})}}),[s,i.domReference,r,l]);return y.useMemo(()=>a?{reference:h}:{},[a,h])}function Ps(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[xl]:i,[_l]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1,[Q1]:""},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,d]=l;if(!(o&&[xl,_l].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof d=="function"){var f;(f=r.get(c))==null||f.push(d),i[c]=function(){for(var h,p=arguments.length,m=new Array(p),g=0;g<p;g++)m[g]=arguments[g];return(h=r.get(c))==null?void 0:h.map(b=>b(...m)).find(b=>b!==void 0)}}}else i[c]=d}),i),{})}}function wb(e){e===void 0&&(e=[]);const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),o=y.useCallback(a=>Ps(a,e,"reference"),t),s=y.useCallback(a=>Ps(a,e,"floating"),n),i=y.useCallback(a=>Ps(a,e,"item"),r);return y.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const xb=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function _b(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:s,floatingId:i}=e,{enabled:a=!0,role:l="dialog"}=t,c=ea(),d=((n=s.domReference)==null?void 0:n.id)||c,f=y.useMemo(()=>{var C;return((C=z1(s.floating))==null?void 0:C.id)||i},[s.floating,i]),h=(r=xb.get(l))!=null?r:l,m=ta()!=null,g=y.useMemo(()=>h==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":h==="alertdialog"?"dialog":h,"aria-controls":o?f:void 0,...h==="listbox"&&{role:"combobox"},...h==="menu"&&{id:d},...h==="menu"&&m&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[h,f,m,o,d,l]),b=y.useMemo(()=>{const C={id:f,...h&&{role:h}};return h==="tooltip"||l==="label"?C:{...C,...h==="menu"&&{"aria-labelledby":d}}},[h,f,d,l]),v=y.useCallback(C=>{let{active:_,selected:S}=C;const N={role:"option",..._&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{...N,"aria-selected":S}}return{}},[f,l]);return y.useMemo(()=>a?{reference:g,floating:b,item:v}:{},[a,g,b,v])}function Sb({initialOpen:e=!1,placement:t="top",open:n,onOpenChange:r,delay:o=600,closeDelay:s=0}={}){const[i,a]=x.useState(e),l=n??i,c=r??a,d=Eb({placement:t,open:l,onOpenChange:c,whileElementsMounted:Kc,middleware:[Zc(4),Yc({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:4}),qc({padding:4})]}),f=d.context,h=lb(f,{mouseOnly:!0,move:!1,restMs:o,enabled:n==null,delay:{close:s}}),p=Cb(f,{enabled:n==null}),m=vb(f),g=_b(f,{role:"tooltip"}),b=wb([h,p,m,g]);return x.useMemo(()=>({open:l,setOpen:c,...b,...d}),[l,c,b,d])}const gi=x.createContext(null);function Fu(){const e=x.useContext(gi);if(e==null)throw new Error("Tooltip components must be wrapped in <TooltipProvider />");return e}function $u({children:e,...t}){const n=Sb(t);return t.useDelayGroup?u.jsx(ub,{delay:{open:t.delay??0,close:t.closeDelay??0},timeoutMs:t.timeout,children:u.jsx(gi.Provider,{value:n,children:e})}):u.jsx(gi.Provider,{value:n,children:e})}const Uu=x.forwardRef(function({children:t,asChild:n=!1,...r},o){const s=Fu(),i=x.isValidElement(t)?parseInt(x.version,10)>=19?t.props.ref:t.ref:void 0,a=Bu([s.refs.setReference,o,i]);if(n&&x.isValidElement(t)){const l={"data-tooltip-state":s.open?"open":"closed"};return x.cloneElement(t,s.getReferenceProps({ref:a,...r,...typeof t.props=="object"?t.props:{},...l}))}return u.jsx("button",{ref:a,"data-tooltip-state":s.open?"open":"closed",...s.getReferenceProps(r),children:t})}),ju=x.forwardRef(function({style:t,children:n,portal:r=!0,portalProps:o={},...s},i){const a=Fu(),l=Bu([a.refs.setFloating,i]);if(!a.open)return null;const c=u.jsx("div",{ref:l,style:{...a.floatingStyles,...t},...a.getFloatingProps(s),className:"tiptap-tooltip",children:n});return r?u.jsx(hb,{...o,children:c}):c});$u.displayName="Tooltip";Uu.displayName="TooltipTrigger";ju.displayName="TooltipContent";const Nb=({shortcuts:e})=>e.length===0?null:u.jsx("div",{children:e.map((t,n)=>u.jsxs(x.Fragment,{children:[n>0&&u.jsx("kbd",{children:"+"}),u.jsx("kbd",{children:t})]},n))}),V=x.forwardRef(({className:e,children:t,tooltip:n,showTooltip:r=!0,shortcutKeys:o,variant:s,size:i,...a},l)=>{const c=x.useMemo(()=>Di({shortcutKeys:o}),[o]);return!n||!r?u.jsx("button",{"data-slot":"tiptap-button",className:ke("tiptap-button",e),ref:l,"data-style":s,"data-size":i,...a,children:t}):u.jsxs($u,{delay:200,children:[u.jsx(Uu,{"data-slot":"tiptap-button",className:ke("tiptap-button",e),ref:l,"data-style":s,"data-size":i,...a,children:t}),u.jsxs(ju,{children:[n,u.jsx(Nb,{shortcuts:c})]})]})});V.displayName="Button";const Fe=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ke("tiptap-card",e),...t}));Fe.displayName="Card";const Ab=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ke("tiptap-card-header",e),...t}));Ab.displayName="CardHeader";const $e=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ke("tiptap-card-body",e),...t}));$e.displayName="CardBody";const Be=x.forwardRef(({className:e,orientation:t="vertical",...n},r)=>u.jsx("div",{ref:r,"data-orientation":t,className:ke("tiptap-card-item-group",e),...n}));Be.displayName="CardItemGroup";const Gn=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ke("tiptap-card-group-label",e),...t}));Gn.displayName="CardGroupLabel";const Tb=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ke("tiptap-card-footer",e),...t}));Tb.displayName="CardFooter";function Rb(e){const n=e.storage.pages;return!n||!("activeEditor"in n)?null:n.activeEditor??null}function Ue(e){const t=xh(),n=e??t,[r,o]=x.useState(null);return x.useEffect(()=>{if(!n){o(null);return}const i=()=>o(Rb(n));return i(),n.on("update",i),n.on("selectionUpdate",i),()=>{n.off("update",i),n.off("selectionUpdate",i)}},[n]),x.useEffect(()=>{if(!r)return;const i=()=>o(null);return r.on("destroy",i),()=>{r.off("destroy",i)}},[r]),ot.useEditorState({editor:r??n,selector(i){return i.editor?{editor:i.editor,editorState:i.editor.state,canCommand:i.editor.can}:{editor:null,editorState:void 0,canCommand:void 0}}})??{editor:null}}const Mb=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})),kb=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})),zu=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z"})),Vu=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M12 3C12.5523 3 13 3.44772 13 4L12.9998 11.9998C13.8355 11.372 14.8743 11 16 11C18.7614 11 21 13.2386 21 16C21 18.7614 18.7614 21 16 21C14.9681 21 14.0092 20.6874 13.2129 20.1518L13 20C13 20.5523 12.5523 21 12 21H6C5.44772 21 5 20.5523 5 20V4C5 3.44772 5.44772 3 6 3H12ZM11 5H7V19H11V5ZM19 15H13V17H19V15Z"})),Ku=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M20 5C20.5523 5 21 5.44772 21 6V12C21 12.5523 20.5523 13 20 13C20.628 13.8355 21 14.8743 21 16C21 18.7614 18.7614 21 16 21C13.2386 21 11 18.7614 11 16C11 14.8743 11.372 13.8355 11.9998 12.9998L4 13C3.44772 13 3 12.5523 3 12V6C3 5.44772 3.44772 5 4 5H20ZM13 15V17H19V15H13ZM19 7H5V11H19V7Z"})),Wu=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H14C13.4477 21 13 20.5523 13 20V4C13 3.44772 13.4477 3 14 3H20ZM19 5H15V19H19V5ZM6 7C8.76142 7 11 9.23858 11 12C11 14.7614 8.76142 17 6 17C3.23858 17 1 14.7614 1 12C1 9.23858 3.23858 7 6 7ZM7 9H5V10.999L3 11V13L5 12.999V15H7V12.999L9 13V11L7 10.999V9Z"})),Gu=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M10 3C10.5523 3 11 3.44772 11 4V20C11 20.5523 10.5523 21 10 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H10ZM9 5H5V19H9V5ZM18 7C20.7614 7 23 9.23858 23 12C23 14.7614 20.7614 17 18 17C15.2386 17 13 14.7614 13 12C13 9.23858 15.2386 7 18 7ZM19 9H17V10.999L15 11V13L17 12.999V15H19V12.999L21 13V11L19 10.999V9Z"})),Zu=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M12 13C14.7614 13 17 15.2386 17 18C17 20.7614 14.7614 23 12 23C9.23858 23 7 20.7614 7 18C7 15.2386 9.23858 13 12 13ZM13 15H11V16.999L9 17V19L11 18.999V21H13V18.999L15 19V17L13 16.999V15ZM20 3C20.5523 3 21 3.44772 21 4V10C21 10.5523 20.5523 11 20 11H4C3.44772 11 3 10.5523 3 10V4C3 3.44772 3.44772 3 4 3H20ZM5 5V9H19V5H5Z"})),qu=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M20 13C20.5523 13 21 13.4477 21 14V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V14C3 13.4477 3.44772 13 4 13H20ZM19 15H5V19H19V15ZM12 1C14.7614 1 17 3.23858 17 6C17 8.76142 14.7614 11 12 11C9.23858 11 7 8.76142 7 6C7 3.23858 9.23858 1 12 1ZM13 3H11V4.999L9 5V7L11 6.999V9H13V6.999L15 7V5L13 4.999V3Z"})),Yu=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M21 3C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H21ZM7 5H4V19H7V5ZM20 5H9V19H20V5Z"})),Xu=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M21 3C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H21ZM4 10V19H20V10H4ZM4 8H20V5H4V8Z"})),Ob=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V10.999H7V9L10 12L7 15V13H5V19H11V17H13V19H19V13H17V15L14 12L17 9V10.999H19V5H13V7H11V5ZM13 13V15H11V13H13ZM13 9V11H11V9H13Z"})),Ju=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M19.2277 18.7323L20.9955 16.9645L22.7632 18.7323C23.7395 19.7086 23.7395 21.2915 22.7632 22.2678C21.7869 23.2441 20.204 23.2441 19.2277 22.2678C18.2514 21.2915 18.2514 19.7086 19.2277 18.7323ZM8.87861 1.07971L20.1923 12.3934C20.5828 12.7839 20.5828 13.4171 20.1923 13.8076L11.707 22.2929C11.3165 22.6834 10.6833 22.6834 10.2928 22.2929L1.80754 13.8076C1.41702 13.4171 1.41702 12.7839 1.80754 12.3934L9.58572 4.61525L7.4644 2.49393L8.87861 1.07971ZM10.9999 6.02946L3.92886 13.1005H18.071L10.9999 6.02946Z"})),Dt=[{name:"Default",color:"#ffffff",contrastColor:"#374151"},{name:"Gray",color:"#f3f4f6",contrastColor:"#6b7280"},{name:"Brown",color:"#f4eef8",contrastColor:"#92400e"},{name:"Orange",color:"#fff7ed",contrastColor:"#ea580c"},{name:"Yellow",color:"#fef9c3",contrastColor:"#ca8a04"},{name:"Green",color:"#dcfce7",contrastColor:"#16a34a"},{name:"Blue",color:"#e0f2fe",contrastColor:"#0284c7"},{name:"Purple",color:"#f3e8ff",contrastColor:"#7c3aed"},{name:"Pink",color:"#fce7f3",contrastColor:"#db2777"},{name:"Red",color:"#ffe4e6",contrastColor:"#dc2626"}],ra=3,Or=({textColorHex:e,backgroundColorHex:t,className:n=""})=>{const r=e??"#374151",o=t??"#ffffff",s=e??"#e5e7eb";return u.jsx("span",{className:n,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1.5rem",height:"1.5rem",borderRadius:"50%",border:`1px solid ${s}`,backgroundColor:o,color:r,fontSize:"0.75rem",fontWeight:700},"aria-hidden":!0,children:"A"})},Qu="color-text-popover-recent",Ib=()=>{try{const e=localStorage.getItem(Qu);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.slice(0,ra):[]}catch{return[]}},Lb=e=>{try{localStorage.setItem(Qu,JSON.stringify(e.slice(0,ra)))}catch{}},ed=x.forwardRef(({editor:e,...t},n)=>{const{editor:r}=Ue(e),[o,s]=x.useState(Ib),i=ot.useEditorState({editor:r??null,selector:p=>{if(!p.editor)return{color:null,backgroundColor:null};const m=p.editor.getAttributes("textStyle");return{color:m.color??null,backgroundColor:m.backgroundColor??null}}}),a=i?.color??null,l=i?.backgroundColor??null,c=x.useCallback((p,m)=>{s(g=>{const b=[{textColor:p,backgroundColor:m},...g.filter(v=>!(v.textColor===p&&v.backgroundColor===m))].slice(0,ra);return Lb(b),b})},[]),d=x.useCallback(p=>{if(!r)return;p===null?r.chain().focus().unsetColor().run():r.chain().focus().setColor(p).run();const m=r.getAttributes("textStyle").backgroundColor??null;c(p,m)},[r,c]),f=x.useCallback(p=>{if(!r)return;p===null?r.chain().focus().unsetBackgroundColor().run():r.chain().focus().setBackgroundColor(p).run();const m=r.getAttributes("textStyle").color??null;c(m,p)},[r,c]),h=x.useCallback(p=>{r&&(p.textColor!==null?r.chain().focus().setColor(p.textColor).run():r.chain().focus().unsetColor().run(),p.backgroundColor!==null?r.chain().focus().setBackgroundColor(p.backgroundColor).run():r.chain().focus().unsetBackgroundColor().run(),c(p.textColor,p.backgroundColor))},[r,c]);return u.jsxs(jt,{children:[u.jsx(zt,{asChild:!0,children:u.jsxs(V,{ref:n,"data-style":"ghost",role:"button",tooltip:"글자 색상",...t,children:[u.jsx(Or,{textColorHex:a,backgroundColorHex:l,className:"tiptap-color-trigger-icon"}),u.jsx(Mb,{className:"tiptap-color-trigger-chevron","aria-hidden":!0})]})}),u.jsx(Vt,{align:"start",children:u.jsx(Fe,{children:u.jsxs($e,{children:[u.jsx(Gn,{children:"Recently Used"}),u.jsx(Be,{orientation:"horizontal",children:o.map((p,m)=>u.jsx(V,{"data-style":"ghost",type:"button",onClick:()=>h(p),"aria-label":`Apply recent color combination ${m+1}`,className:"tiptap-color-recent-button",children:u.jsx(Or,{textColorHex:p.textColor,backgroundColorHex:p.backgroundColor})},`${p.textColor??""}-${p.backgroundColor??""}-${m}`))}),u.jsx(Gn,{children:"Text Color"}),u.jsx(Be,{orientation:"horizontal",children:Dt.slice(0,5).map((p,m)=>{const g=m===0,b=g?null:p.contrastColor,v=a===b||g&&a===null;return u.jsx(V,{"data-style":"ghost",type:"button",onClick:()=>d(b),"aria-label":`Text color: ${p.name}`,"aria-pressed":v,className:"tiptap-color-text-button",children:u.jsx(Or,{textColorHex:b,backgroundColorHex:"#ffffff"})},p.name)})}),u.jsx(Be,{orientation:"horizontal",children:Dt.slice(5,10).map(p=>{const m=p.contrastColor,g=a===m;return u.jsx(V,{"data-style":"ghost",type:"button",onClick:()=>d(m),"aria-label":`Text color: ${p.name}`,"aria-pressed":g,className:"tiptap-color-text-button",children:u.jsx(Or,{textColorHex:m,backgroundColorHex:"#ffffff"})},p.name)})}),u.jsx(Gn,{children:"Highlight Color"}),u.jsx(Be,{orientation:"horizontal",children:Dt.slice(0,5).map((p,m)=>{const g=m===0,b=g?null:p.color,v=l===b||g&&l===null;return u.jsx(V,{"data-style":"ghost",type:"button",onClick:()=>f(b),"aria-label":`Highlight color: ${p.name}`,"aria-pressed":v,className:"tiptap-color-highlight-button",children:u.jsx("span",{style:{display:"inline-block",width:"1.5rem",height:"1.5rem",borderRadius:"50%",backgroundColor:b??"#ffffff",border:`1px solid ${b?p.contrastColor:"#e5e7eb"}`},"aria-hidden":!0})},p.name)})}),u.jsx(Be,{orientation:"horizontal",children:Dt.slice(5,10).map(p=>{const m=p.color,g=l===m;return u.jsx(V,{"data-style":"ghost",type:"button",onClick:()=>f(m),"aria-label":`Highlight color: ${p.name}`,"aria-pressed":g,className:"tiptap-color-highlight-button",children:u.jsx("span",{style:{display:"inline-block",width:"1.5rem",height:"1.5rem",borderRadius:"50%",backgroundColor:m??"#ffffff",border:`1px solid ${m?p.contrastColor:"#e5e7eb"}`},"aria-hidden":!0})},p.name)})})]})})})]})});ed.displayName="ColorTextPopover";const td=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{d:"M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z",fill:"currentColor"}),u.jsx("path",{d:"M21.0001 10C21.0001 9.63121 20.7971 9.29235 20.472 9.11833C20.1468 8.94431 19.7523 8.96338 19.4454 9.16795L16.4454 11.168C15.9859 11.4743 15.8617 12.0952 16.1681 12.5547C16.4744 13.0142 17.0953 13.1384 17.5548 12.8321L19.0001 11.8685V18C19.0001 18.5523 19.4478 19 20.0001 19C20.5524 19 21.0001 18.5523 21.0001 18V10Z",fill:"currentColor"})]}));td.displayName="HeadingOneIcon";const nd=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{d:"M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z",fill:"currentColor"}),u.jsx("path",{d:"M22.0001 12C22.0001 10.7611 21.1663 9.79297 20.0663 9.42632C18.9547 9.05578 17.6171 9.28724 16.4001 10.2C15.9582 10.5314 15.8687 11.1582 16.2001 11.6C16.5314 12.0418 17.1582 12.1314 17.6001 11.8C18.383 11.2128 19.0455 11.1942 19.4338 11.3237C19.8339 11.457 20.0001 11.7389 20.0001 12C20.0001 12.4839 19.8554 12.7379 19.6537 12.9481C19.4275 13.1837 19.1378 13.363 18.7055 13.6307C18.6313 13.6767 18.553 13.7252 18.4701 13.777C17.9572 14.0975 17.3128 14.5261 16.8163 15.2087C16.3007 15.9177 16.0001 16.8183 16.0001 18C16.0001 18.5523 16.4478 19 17.0001 19H21.0001C21.5523 19 22.0001 18.5523 22.0001 18C22.0001 17.4477 21.5523 17 21.0001 17H18.131C18.21 16.742 18.3176 16.5448 18.4338 16.385C18.6873 16.0364 19.0429 15.7775 19.5301 15.473C19.5898 15.4357 19.6536 15.3966 19.7205 15.3556C20.139 15.0992 20.6783 14.7687 21.0964 14.3332C21.6447 13.7621 22.0001 13.0161 22.0001 12Z",fill:"currentColor"})]}));nd.displayName="HeadingTwoIcon";const rd=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{d:"M4 5C4.55228 5 5 5.44772 5 6V11H11V6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H5V18C5 18.5523 4.55228 19 4 19C3.44772 19 3 18.5523 3 18V6C3 5.44772 3.44772 5 4 5Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.4608 11.2169C19.1135 11.0531 18.5876 11.0204 18.0069 11.3619C17.5309 11.642 16.918 11.4831 16.638 11.007C16.358 10.531 16.5169 9.91809 16.9929 9.63807C18.1123 8.97962 19.3364 8.94691 20.314 9.40808C21.2839 9.86558 21.9999 10.818 21.9999 12C21.9999 12.7957 21.6838 13.5587 21.1212 14.1213C20.5586 14.6839 19.7956 15 18.9999 15C18.4476 15 17.9999 14.5523 17.9999 14C17.9999 13.4477 18.4476 13 18.9999 13C19.2651 13 19.5195 12.8947 19.707 12.7071C19.8946 12.5196 19.9999 12.2652 19.9999 12C19.9999 11.6821 19.8159 11.3844 19.4608 11.2169Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0001 14C18.0001 13.4477 18.4478 13 19.0001 13C19.7957 13 20.5588 13.3161 21.1214 13.8787C21.684 14.4413 22.0001 15.2043 22.0001 16C22.0001 17.2853 21.2767 18.3971 20.1604 18.8994C19.0257 19.41 17.642 19.2315 16.4001 18.3C15.9582 17.9686 15.8687 17.3418 16.2001 16.9C16.5314 16.4582 17.1582 16.3686 17.6001 16.7C18.3581 17.2685 18.9744 17.24 19.3397 17.0756C19.7234 16.9029 20.0001 16.5147 20.0001 16C20.0001 15.7348 19.8947 15.4804 19.7072 15.2929C19.5196 15.1054 19.2653 15 19.0001 15C18.4478 15 18.0001 14.5523 18.0001 14Z",fill:"currentColor"})]}));rd.displayName="HeadingThreeIcon";const Yr=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{d:"M12 6V21H10V16C6.68629 16 4 13.3137 4 10C4 6.68629 6.68629 4 10 4H20V6H17V21H15V6H12ZM10 6C7.79086 6 6 7.79086 6 10C6 12.2091 7.79086 14 10 14V6Z"})}));Yr.displayName="ParagraphIcon";const Pb=["paragraph","heading","bulletList","orderedList","taskList","blockquote","codeBlock"],$t={heading1:{value:"heading1",label:"제목 1",nodeType:"heading",attrs:{level:1},Icon:td},heading2:{value:"heading2",label:"제목 2",nodeType:"heading",attrs:{level:2},Icon:nd},heading3:{value:"heading3",label:"제목 3",nodeType:"heading",attrs:{level:3},Icon:rd},paragraphLarge:{value:"paragraphLarge",label:"본문 큼",nodeType:"paragraph",attrs:{size:"large"},Icon:Yr},paragraphNormal:{value:"paragraphNormal",label:"본문 보통",nodeType:"paragraph",attrs:{size:"normal"},Icon:Yr},paragraphSmall:{value:"paragraphSmall",label:"본문 작음",nodeType:"paragraph",attrs:{size:"small"},Icon:Yr}},co=Object.keys($t);function Db(e){const{nodeType:t,attrs:n}=$t[e];if(t==="heading"){const{level:o}=n;return{Tag:`h${o}`,attrs:{}}}const{size:r}=n;return{Tag:"p",attrs:{"data-size":r}}}function os(e,t){if(!e||!e.isEditable)return!1;const{nodeType:n,attrs:r}=$t[t];return e.isActive(n,r)}function ss(e,t){if(!e||!e.isEditable)return!1;const{nodeType:n,attrs:r}=$t[t];return!Ah(n,e)||Ko(e,["image"])||!Th(e,Pb)?!1:os(e,t)?!0:e.can().setNode(n,r)}function Bb(e,t){if(!e||!ss(e,t))return!1;if(os(e,t))return!0;const{nodeType:n,attrs:r}=$t[t];return e.chain().focus().setNode(n,r).run()}function od(e){const{editor:t,hideWhenUnavailable:n}=e;return t?n?t.isEditable?t.isActive("code")?!0:co.some(r=>ss(t,r)):!1:!0:!1}function Hb(e){const{editor:t,value:n,hideWhenUnavailable:r=!1,onApplied:o}=e,{editor:s}=Ue(t),[i,a]=x.useState(!0),l=ss(s,n),c=os(s,n);x.useEffect(()=>{if(!s)return;const h=()=>{a(od({editor:s,hideWhenUnavailable:r}))};return h(),s.on("selectionUpdate",h),()=>{s.off("selectionUpdate",h)}},[s,r]);const d=x.useCallback(()=>{if(!s)return!1;const h=Bb(s,n);return h&&o?.(),h},[s,n,o]),f=$t[n];return{isVisible:i,isActive:c,canApply:l,handleApply:d,label:f.label,Icon:f.Icon}}const sd=x.forwardRef(({editor:e,value:t,text:n,hideWhenUnavailable:r=!1,onApplied:o,onClick:s,children:i,...a},l)=>{const{editor:c}=Ue(e),{isVisible:d,canApply:f,isActive:h,handleApply:p,label:m}=Hb({editor:c,value:t,hideWhenUnavailable:r,onApplied:o}),g=x.useCallback(C=>{s?.(C),!C.defaultPrevented&&p()},[p,s]);if(!d)return null;const{Tag:b,attrs:v}=Db(t);return u.jsx(V,{type:"button",variant:"ghost","data-active-state":h?"on":"off",role:"button",tabIndex:-1,disabled:!f,"data-disabled":!f,"aria-label":m,"aria-pressed":h,tooltip:m,onClick:g,...a,ref:l,children:i??u.jsx(b,{...v,className:"tiptap-button-text",children:n??m})})});sd.displayName="TextStyleButton";const pr=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.29289 8.29289C5.68342 7.90237 6.31658 7.90237 6.70711 8.29289L12 13.5858L17.2929 8.29289C17.6834 7.90237 18.3166 7.90237 18.7071 8.29289C19.0976 8.68342 19.0976 9.31658 18.7071 9.70711L12.7071 15.7071C12.3166 16.0976 11.6834 16.0976 11.2929 15.7071L5.29289 9.70711C4.90237 9.31658 4.90237 8.68342 5.29289 8.29289Z",fill:"currentColor"})}));pr.displayName="ChevronDownIcon";const Fb="paragraphNormal";function $b(e,t=co){if(!(!e||!e.isEditable))return t.find(n=>os(e,n))}function Ub(e){const{editor:t,hideWhenUnavailable:n=!1}=e||{},{editor:r}=Ue(t),[o,s]=x.useState(!0),i=$b(r)??Fb,a=$t[i],l=co.some(c=>ss(r,c));return x.useEffect(()=>{if(!r)return;const c=()=>{s(od({editor:r,hideWhenUnavailable:n}))};return c(),r.on("selectionUpdate",c),()=>{r.off("selectionUpdate",c)}},[r,n]),{isVisible:o,activeValue:i,canApply:l,label:a.label,Icon:a.Icon,options:co.map(c=>$t[c])}}const Ol=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Il=Rc,jb=(e,t)=>n=>{var r;if(t?.variants==null)return Il(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const d=n?.[c],f=s?.[c];if(d===null)return null;const h=Ol(d)||Ol(f);return o[c][h]}),a=n&&Object.entries(n).reduce((c,d)=>{let[f,h]=d;return h===void 0||(c[f]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(m=>{let[g,b]=m;return Array.isArray(b)?b.includes({...s,...a}[g]):{...s,...a}[g]===b})?[...c,f,h]:c},[]);return Il(e,i,l,n?.class,n?.className)},zb=jb("tiptap-button-group",{variants:{orientation:{horizontal:"tiptap-button-group-horizontal",vertical:"tiptap-button-group-vertical"}},defaultVariants:{orientation:"horizontal"}});function Qt({className:e,orientation:t,...n}){return u.jsx("div",{role:"group","data-slot":"tiptap-button-group","data-orientation":t,className:ke(zb({orientation:t}),e),...n})}function id(e){const t=e+"CollectionProvider",[n,r]=Rn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:b,children:v}=g,C=x.useRef(null),_=x.useRef(new Map).current;return u.jsx(o,{scope:b,itemMap:_,collectionRef:C,children:v})};i.displayName=t;const a=e+"CollectionSlot",l=tr(a),c=x.forwardRef((g,b)=>{const{scope:v,children:C}=g,_=s(a,v),S=Oe(b,_.collectionRef);return u.jsx(l,{ref:S,children:C})});c.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=tr(d),p=x.forwardRef((g,b)=>{const{scope:v,children:C,..._}=g,S=x.useRef(null),N=Oe(b,S),A=s(d,v);return x.useEffect(()=>(A.itemMap.set(S,{ref:S,..._}),()=>{A.itemMap.delete(S)})),u.jsx(h,{[f]:"",ref:N,children:C})});p.displayName=d;function m(g){const b=s(e+"CollectionConsumer",g);return x.useCallback(()=>{const C=b.collectionRef.current;if(!C)return[];const _=Array.from(C.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((A,R)=>_.indexOf(A.ref.current)-_.indexOf(R.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:c,ItemSlot:p},m,r]}var Vb=y.createContext(void 0);function ad(e){const t=y.useContext(Vb);return e||t||"ltr"}var Ds="rovingFocusGroup.onEntryFocus",Kb={bubbles:!1,cancelable:!0},hr="RovingFocusGroup",[mi,ld,Wb]=id(hr),[Gb,cd]=Rn(hr,[Wb]),[Zb,qb]=Gb(hr),ud=y.forwardRef((e,t)=>u.jsx(mi.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(mi.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(Yb,{...e,ref:t})})}));ud.displayName=hr;var Yb=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...f}=e,h=y.useRef(null),p=Oe(t,h),m=ad(s),[g,b]=ts({prop:i,defaultProp:a??null,onChange:l,caller:hr}),[v,C]=y.useState(!1),_=vt(c),S=ld(n),N=y.useRef(!1),[A,R]=y.useState(0);return y.useEffect(()=>{const O=h.current;if(O)return O.addEventListener(Ds,_),()=>O.removeEventListener(Ds,_)},[_]),u.jsx(Zb,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:g,onItemFocus:y.useCallback(O=>b(O),[b]),onItemShiftTab:y.useCallback(()=>C(!0),[]),onFocusableItemAdd:y.useCallback(()=>R(O=>O+1),[]),onFocusableItemRemove:y.useCallback(()=>R(O=>O-1),[]),children:u.jsx(Re.div,{tabIndex:v||A===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:ae(e.onMouseDown,()=>{N.current=!0}),onFocus:ae(e.onFocus,O=>{const D=!N.current;if(O.target===O.currentTarget&&D&&!v){const j=new CustomEvent(Ds,Kb);if(O.currentTarget.dispatchEvent(j),!j.defaultPrevented){const Y=S().filter(U=>U.focusable),J=Y.find(U=>U.active),X=Y.find(U=>U.id===g),$=[J,X,...Y].filter(Boolean).map(U=>U.ref.current);pd($,d)}}N.current=!1}),onBlur:ae(e.onBlur,()=>C(!1))})})}),dd="RovingFocusGroupItem",fd=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,l=_n(),c=s||l,d=qb(dd,n),f=d.currentTabStopId===c,h=ld(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:g}=d;return y.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),u.jsx(mi.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:u.jsx(Re.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:ae(e.onMouseDown,b=>{r?d.onItemFocus(c):b.preventDefault()}),onFocus:ae(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:ae(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const v=Qb(b,d.orientation,d.dir);if(v!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let _=h().filter(S=>S.focusable).map(S=>S.ref.current);if(v==="last")_.reverse();else if(v==="prev"||v==="next"){v==="prev"&&_.reverse();const S=_.indexOf(b.currentTarget);_=d.loop?e0(_,S+1):_.slice(S+1)}setTimeout(()=>pd(_))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:g!=null}):i})})});fd.displayName=dd;var Xb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Jb(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Qb(e,t,n){const r=Jb(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Xb[r]}function pd(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function e0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var t0=ud,n0=fd,bi=["Enter"," "],r0=["ArrowDown","PageUp","Home"],hd=["ArrowUp","PageDown","End"],o0=[...r0,...hd],s0={ltr:[...bi,"ArrowRight"],rtl:[...bi,"ArrowLeft"]},i0={ltr:["ArrowLeft"],rtl:["ArrowRight"]},gr="Menu",[rr,a0,l0]=id(gr),[sn,gd]=Rn(gr,[l0,es,cd]),mr=es(),md=cd(),[bd,Kt]=sn(gr),[c0,br]=sn(gr),vd=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=mr(t),[l,c]=y.useState(null),d=y.useRef(!1),f=vt(s),h=ad(o);return y.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),u.jsx(qi,{...a,children:u.jsx(bd,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c,children:u.jsx(c0,{scope:t,onClose:y.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:i,children:r})})})};vd.displayName=gr;var u0="MenuAnchor",oa=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=mr(n);return u.jsx(Yi,{...o,...r,ref:t})});oa.displayName=u0;var sa="MenuPortal",[d0,yd]=sn(sa,{forceMount:void 0}),Ed=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Kt(sa,t);return u.jsx(d0,{scope:t,forceMount:n,children:u.jsx(on,{present:n||s.open,children:u.jsx(Xi,{asChild:!0,container:o,children:r})})})};Ed.displayName=sa;var Je="MenuContent",[f0,ia]=sn(Je),Cd=y.forwardRef((e,t)=>{const n=yd(Je,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Kt(Je,e.__scopeMenu),i=br(Je,e.__scopeMenu);return u.jsx(rr.Provider,{scope:e.__scopeMenu,children:u.jsx(on,{present:r||s.open,children:u.jsx(rr.Slot,{scope:e.__scopeMenu,children:i.modal?u.jsx(p0,{...o,ref:t}):u.jsx(h0,{...o,ref:t})})})})}),p0=y.forwardRef((e,t)=>{const n=Kt(Je,e.__scopeMenu),r=y.useRef(null),o=Oe(t,r);return y.useEffect(()=>{const s=r.current;if(s)return uu(s)},[]),u.jsx(aa,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ae(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),h0=y.forwardRef((e,t)=>{const n=Kt(Je,e.__scopeMenu);return u.jsx(aa,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),g0=tr("MenuContent.ScrollLock"),aa=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:m,...g}=e,b=Kt(Je,n),v=br(Je,n),C=mr(n),_=md(n),S=a0(n),[N,A]=y.useState(null),R=y.useRef(null),O=Oe(t,R,b.onContentChange),D=y.useRef(0),j=y.useRef(""),Y=y.useRef(0),J=y.useRef(null),X=y.useRef("right"),I=y.useRef(0),$=m?Ji:y.Fragment,U=m?{as:g0,allowPinchZoom:!0}:void 0,H=k=>{const K=j.current+k,oe=S().filter(ue=>!ue.disabled),Z=document.activeElement,ce=oe.find(ue=>ue.ref.current===Z)?.textValue,Ke=oe.map(ue=>ue.textValue),he=A0(Ke,K,ce),ye=oe.find(ue=>ue.textValue===he)?.ref.current;(function ue(Ze){j.current=Ze,window.clearTimeout(D.current),Ze!==""&&(D.current=window.setTimeout(()=>ue(""),1e3))})(K),ye&&setTimeout(()=>ye.focus())};y.useEffect(()=>()=>window.clearTimeout(D.current),[]),Lc();const T=y.useCallback(k=>X.current===J.current?.side&&R0(k,J.current?.area),[]);return u.jsx(f0,{scope:n,searchRef:j,onItemEnter:y.useCallback(k=>{T(k)&&k.preventDefault()},[T]),onItemLeave:y.useCallback(k=>{T(k)||(R.current?.focus(),A(null))},[T]),onTriggerLeave:y.useCallback(k=>{T(k)&&k.preventDefault()},[T]),pointerGraceTimerRef:Y,onPointerGraceIntentChange:y.useCallback(k=>{J.current=k},[]),children:u.jsx($,{...U,children:u.jsx($i,{asChild:!0,trapped:o,onMountAutoFocus:ae(s,k=>{k.preventDefault(),R.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:u.jsx(Fi,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:u.jsx(t0,{asChild:!0,..._,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:A,onEntryFocus:ae(l,k=>{v.isUsingKeyboardRef.current||k.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(au,{role:"menu","aria-orientation":"vertical","data-state":Hd(b.open),"data-radix-menu-content":"",dir:v.dir,...C,...g,ref:O,style:{outline:"none",...g.style},onKeyDown:ae(g.onKeyDown,k=>{const oe=k.target.closest("[data-radix-menu-content]")===k.currentTarget,Z=k.ctrlKey||k.altKey||k.metaKey,ce=k.key.length===1;oe&&(k.key==="Tab"&&k.preventDefault(),!Z&&ce&&H(k.key));const Ke=R.current;if(k.target!==Ke||!o0.includes(k.key))return;k.preventDefault();const ye=S().filter(ue=>!ue.disabled).map(ue=>ue.ref.current);hd.includes(k.key)&&ye.reverse(),S0(ye)}),onBlur:ae(e.onBlur,k=>{k.currentTarget.contains(k.target)||(window.clearTimeout(D.current),j.current="")}),onPointerMove:ae(e.onPointerMove,or(k=>{const K=k.target,oe=I.current!==k.clientX;if(k.currentTarget.contains(K)&&oe){const Z=k.clientX>I.current?"right":"left";X.current=Z,I.current=k.clientX}}))})})})})})})});Cd.displayName=Je;var m0="MenuGroup",la=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Re.div,{role:"group",...r,ref:t})});la.displayName=m0;var b0="MenuLabel",wd=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Re.div,{...r,ref:t})});wd.displayName=b0;var uo="MenuItem",Ll="menu.itemSelect",is=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=y.useRef(null),i=br(uo,e.__scopeMenu),a=ia(uo,e.__scopeMenu),l=Oe(t,s),c=y.useRef(!1),d=()=>{const f=s.current;if(!n&&f){const h=new CustomEvent(Ll,{bubbles:!0,cancelable:!0});f.addEventListener(Ll,p=>r?.(p),{once:!0}),kc(f,h),h.defaultPrevented?c.current=!1:i.onClose()}};return u.jsx(xd,{...o,ref:l,disabled:n,onClick:ae(e.onClick,d),onPointerDown:f=>{e.onPointerDown?.(f),c.current=!0},onPointerUp:ae(e.onPointerUp,f=>{c.current||f.currentTarget?.click()}),onKeyDown:ae(e.onKeyDown,f=>{const h=a.searchRef.current!=="";n||h&&f.key===" "||bi.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});is.displayName=uo;var xd=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=ia(uo,n),a=md(n),l=y.useRef(null),c=Oe(t,l),[d,f]=y.useState(!1),[h,p]=y.useState("");return y.useEffect(()=>{const m=l.current;m&&p((m.textContent??"").trim())},[s.children]),u.jsx(rr.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:u.jsx(n0,{asChild:!0,...a,focusable:!r,children:u.jsx(Re.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:ae(e.onPointerMove,or(m=>{r?i.onItemLeave(m):(i.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ae(e.onPointerLeave,or(m=>i.onItemLeave(m))),onFocus:ae(e.onFocus,()=>f(!0)),onBlur:ae(e.onBlur,()=>f(!1))})})})}),v0="MenuCheckboxItem",_d=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return u.jsx(Rd,{scope:e.__scopeMenu,checked:n,children:u.jsx(is,{role:"menuitemcheckbox","aria-checked":fo(n)?"mixed":n,...o,ref:t,"data-state":da(n),onSelect:ae(o.onSelect,()=>r?.(fo(n)?!0:!n),{checkForDefaultPrevented:!1})})})});_d.displayName=v0;var Sd="MenuRadioGroup",[y0,E0]=sn(Sd,{value:void 0,onValueChange:()=>{}}),Nd=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=vt(r);return u.jsx(y0,{scope:e.__scopeMenu,value:n,onValueChange:s,children:u.jsx(la,{...o,ref:t})})});Nd.displayName=Sd;var Ad="MenuRadioItem",Td=y.forwardRef((e,t)=>{const{value:n,...r}=e,o=E0(Ad,e.__scopeMenu),s=n===o.value;return u.jsx(Rd,{scope:e.__scopeMenu,checked:s,children:u.jsx(is,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":da(s),onSelect:ae(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Td.displayName=Ad;var ca="MenuItemIndicator",[Rd,C0]=sn(ca,{checked:!1}),Md=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=C0(ca,n);return u.jsx(on,{present:r||fo(s.checked)||s.checked===!0,children:u.jsx(Re.span,{...o,ref:t,"data-state":da(s.checked)})})});Md.displayName=ca;var w0="MenuSeparator",kd=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Re.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});kd.displayName=w0;var x0="MenuArrow",Od=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=mr(n);return u.jsx(lu,{...o,...r,ref:t})});Od.displayName=x0;var ua="MenuSub",[_0,Id]=sn(ua),Ld=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=Kt(ua,t),i=mr(t),[a,l]=y.useState(null),[c,d]=y.useState(null),f=vt(o);return y.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),u.jsx(qi,{...i,children:u.jsx(bd,{scope:t,open:r,onOpenChange:f,content:c,onContentChange:d,children:u.jsx(_0,{scope:t,contentId:_n(),triggerId:_n(),trigger:a,onTriggerChange:l,children:n})})})};Ld.displayName=ua;var Hn="MenuSubTrigger",Pd=y.forwardRef((e,t)=>{const n=Kt(Hn,e.__scopeMenu),r=br(Hn,e.__scopeMenu),o=Id(Hn,e.__scopeMenu),s=ia(Hn,e.__scopeMenu),i=y.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},d=y.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return y.useEffect(()=>d,[d]),y.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),u.jsx(oa,{asChild:!0,...c,children:u.jsx(xd,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Hd(n.open),...e,ref:Zo(t,o.onTriggerChange),onClick:f=>{e.onClick?.(f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ae(e.onPointerMove,or(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:ae(e.onPointerLeave,or(f=>{d();const h=n.content?.getBoundingClientRect();if(h){const p=n.content?.dataset.side,m=p==="right",g=m?-5:5,b=h[m?"left":"right"],v=h[m?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+g,y:f.clientY},{x:b,y:h.top},{x:v,y:h.top},{x:v,y:h.bottom},{x:b,y:h.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ae(e.onKeyDown,f=>{const h=s.searchRef.current!=="";e.disabled||h&&f.key===" "||s0[r.dir].includes(f.key)&&(n.onOpenChange(!0),n.content?.focus(),f.preventDefault())})})})});Pd.displayName=Hn;var Dd="MenuSubContent",Bd=y.forwardRef((e,t)=>{const n=yd(Je,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Kt(Je,e.__scopeMenu),i=br(Je,e.__scopeMenu),a=Id(Dd,e.__scopeMenu),l=y.useRef(null),c=Oe(t,l);return u.jsx(rr.Provider,{scope:e.__scopeMenu,children:u.jsx(on,{present:r||s.open,children:u.jsx(rr.Slot,{scope:e.__scopeMenu,children:u.jsx(aa,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{i.isUsingKeyboardRef.current&&l.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ae(e.onFocusOutside,d=>{d.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ae(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:ae(e.onKeyDown,d=>{const f=d.currentTarget.contains(d.target),h=i0[i.dir].includes(d.key);f&&h&&(s.onOpenChange(!1),a.trigger?.focus(),d.preventDefault())})})})})})});Bd.displayName=Dd;function Hd(e){return e?"open":"closed"}function fo(e){return e==="indeterminate"}function da(e){return fo(e)?"indeterminate":e?"checked":"unchecked"}function S0(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function N0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function A0(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=N0(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==n));const l=i.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function T0(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],c=a.x,d=a.y,f=l.x,h=l.y;d>r!=h>r&&n<(f-c)*(r-d)/(h-d)+c&&(o=!o)}return o}function R0(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return T0(n,t)}function or(e){return t=>t.pointerType==="mouse"?e(t):void 0}var M0=vd,k0=oa,O0=Ed,I0=Cd,L0=la,P0=wd,D0=is,B0=_d,H0=Nd,F0=Td,$0=Md,U0=kd,j0=Od,z0=Ld,V0=Pd,K0=Bd,as="DropdownMenu",[W0]=Rn(as,[gd]),Ie=gd(),[G0,Fd]=W0(as),$d=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,l=Ie(t),c=y.useRef(null),[d,f]=ts({prop:o,defaultProp:s??!1,onChange:i,caller:as});return u.jsx(G0,{scope:t,triggerId:_n(),triggerRef:c,contentId:_n(),open:d,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(h=>!h),[f]),modal:a,children:u.jsx(M0,{...l,open:d,onOpenChange:f,dir:r,modal:a,children:n})})};$d.displayName=as;var Ud="DropdownMenuTrigger",jd=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Fd(Ud,n),i=Ie(n);return u.jsx(k0,{asChild:!0,...i,children:u.jsx(Re.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Zo(t,s.triggerRef),onPointerDown:ae(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:ae(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});jd.displayName=Ud;var Z0="DropdownMenuPortal",zd=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ie(t);return u.jsx(O0,{...r,...n})};zd.displayName=Z0;var Vd="DropdownMenuContent",Kd=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fd(Vd,n),s=Ie(n),i=y.useRef(!1);return u.jsx(I0,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:ae(e.onCloseAutoFocus,a=>{i.current||o.triggerRef.current?.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:ae(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!o.modal||d)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Kd.displayName=Vd;var q0="DropdownMenuGroup",Y0=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(L0,{...o,...r,ref:t})});Y0.displayName=q0;var X0="DropdownMenuLabel",J0=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(P0,{...o,...r,ref:t})});J0.displayName=X0;var Q0="DropdownMenuItem",Wd=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(D0,{...o,...r,ref:t})});Wd.displayName=Q0;var ev="DropdownMenuCheckboxItem",tv=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(B0,{...o,...r,ref:t})});tv.displayName=ev;var nv="DropdownMenuRadioGroup",rv=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(H0,{...o,...r,ref:t})});rv.displayName=nv;var ov="DropdownMenuRadioItem",sv=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(F0,{...o,...r,ref:t})});sv.displayName=ov;var iv="DropdownMenuItemIndicator",av=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx($0,{...o,...r,ref:t})});av.displayName=iv;var lv="DropdownMenuSeparator",cv=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(U0,{...o,...r,ref:t})});cv.displayName=lv;var uv="DropdownMenuArrow",dv=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(j0,{...o,...r,ref:t})});dv.displayName=uv;var fv=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,i=Ie(t),[a,l]=ts({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return u.jsx(z0,{...i,open:a,onOpenChange:l,children:n})},pv="DropdownMenuSubTrigger",Gd=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(V0,{...o,...r,ref:t})});Gd.displayName=pv;var hv="DropdownMenuSubContent",Zd=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(K0,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zd.displayName=hv;var gv=$d,qd=jd,mv=zd,Yd=Kd,bv=Wd,vv=fv,yv=Gd,Xd=Zd;function vr({...e}){return u.jsx(gv,{modal:!1,...e})}function Jd({...e}){return u.jsx(mv,{...e})}const On=x.forwardRef(({...e},t)=>u.jsx(qd,{ref:t,...e}));On.displayName=qd.displayName;const Ev=vv,je=bv,Cv=yv,Qd=x.forwardRef(({className:e,portal:t=!0,...n},r)=>{const o=u.jsx(Xd,{ref:r,className:ke("tiptap-dropdown-menu",e),...n});return t?u.jsx(Jd,{...typeof t=="object"?t:{},children:o}):o});Qd.displayName=Xd.displayName;const In=x.forwardRef(({className:e,sideOffset:t=4,portal:n=!1,...r},o)=>{const s=u.jsx(Yd,{ref:o,sideOffset:t,onCloseAutoFocus:i=>i.preventDefault(),className:ke("tiptap-dropdown-menu",e),...r});return n?u.jsx(Jd,{...typeof n=="object"?n:{},children:s}):s});In.displayName=Yd.displayName;const ef=x.forwardRef(({editor:e,hideWhenUnavailable:t=!1,portal:n=!1,onOpenChange:r,children:o,...s},i)=>{const{editor:a}=Ue(e),[l,c]=x.useState(!1),{isVisible:d,canApply:f,label:h,Icon:p,options:m}=Ub({editor:a,hideWhenUnavailable:t}),g=x.useCallback(b=>{!a||!f||(c(b),r?.(b))},[f,a,r]);return d?u.jsxs(vr,{modal:!0,open:l,onOpenChange:g,children:[u.jsx(On,{asChild:!0,children:u.jsx(V,{type:"button",variant:"ghost",role:"button",tabIndex:-1,disabled:!f,"data-disabled":!f,"aria-label":h,tooltip:"문단 모양",...s,ref:i,children:o||u.jsxs(u.Fragment,{children:[u.jsx(p,{className:"tiptap-button-icon"}),u.jsx("span",{className:"tiptap-button-text",children:h}),u.jsx(pr,{className:"tiptap-button-dropdown-small"})]})})}),u.jsx(In,{align:"start",portal:n,children:u.jsx(Fe,{className:"tiptap-typography",children:u.jsx($e,{children:u.jsx(Qt,{children:m.map(b=>u.jsx(je,{asChild:!0,children:u.jsx(sd,{editor:a,value:b.value,text:b.label,showTooltip:!1})},b.value))})})})})]}):null});ef.displayName="TextStyleDropdownMenu";const wv=[10,11,12,13,14,16,18,20,24,28,36],tf=x.forwardRef(({editor:e,portal:t=!1,onOpenChange:n,children:r,...o},s)=>{const{editor:i}=Ue(e),[a,l]=x.useState(!1),c=ot.useEditorState({editor:i,selector:({editor:m})=>m?m.getAttributes("textStyle").fontSize??null:null}),d=!!i,f=x.useCallback(m=>{d&&(l(m),n?.(m))},[d,n]),h=x.useCallback(()=>{i?.chain().focus().unsetFontSize().run()},[i]),p=x.useCallback(m=>{i&&(c===m?i.chain().focus().unsetFontSize().run():i.chain().focus().setFontSize(`${m}px`).run())},[i,c]);return i?u.jsxs(vr,{modal:!0,open:a,onOpenChange:f,children:[u.jsx(On,{asChild:!0,children:u.jsx(V,{type:"button",variant:"ghost",role:"button",tabIndex:-1,disabled:!d,"data-disabled":!d,"aria-label":"글자 크기",tooltip:"글자 크기",...o,ref:s,children:r??u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"tiptap-button-text",children:c??"-"}),u.jsx(pr,{className:"tiptap-button-dropdown-small"})]})})}),u.jsx(In,{align:"start",portal:t,children:u.jsx(Fe,{children:u.jsx($e,{children:u.jsxs(Qt,{children:[u.jsx(je,{asChild:!0,onSelect:h,children:u.jsx(V,{type:"button",variant:"ghost","data-active-state":c===null?"on":"off","aria-pressed":c===null,children:u.jsx("span",{className:"tiptap-button-text",children:"기본값"})})}),wv.map(m=>u.jsx(je,{asChild:!0,onSelect:()=>p(m),children:u.jsx(V,{type:"button",variant:"ghost","data-active-state":c===m?"on":"off","aria-pressed":c===m,children:u.jsx("span",{className:"tiptap-button-text",children:m})})},m))]})})})})]}):null});tf.displayName="FontSizeDropdownMenu";const fa=x.forwardRef(({variant:e,size:t="default",appearance:n="default",trimText:r=!1,className:o,children:s,...i},a)=>u.jsx("div",{ref:a,className:`tiptap-badge ${o||""}`,"data-style":e,"data-size":t,"data-appearance":n,"data-text-trim":r?"on":"off",...i,children:s}));fa.displayName="Badge";function xv({align:e,shortcutKeys:t=sf[e]}){return u.jsx(fa,{children:Di({shortcutKeys:t})})}const Fn=x.forwardRef(({editor:e,align:t,text:n,hideWhenUnavailable:r=!1,onAligned:o,showShortcut:s=!1,onClick:i,icon:a,children:l,...c},d)=>{const{editor:f}=Ue(e),{isVisible:h,handleTextAlign:p,label:m,canAlign:g,isActive:b,Icon:v,shortcutKeys:C}=Mv({editor:f,align:t,hideWhenUnavailable:r,onAligned:o}),_=x.useCallback(N=>{i?.(N),!N.defaultPrevented&&p()},[p,i]);if(!h)return null;const S=a??v;return u.jsx(V,{type:"button",disabled:!g,variant:"ghost","data-active-state":b?"on":"off","data-disabled":!g,role:"button",tabIndex:-1,"aria-label":m,"aria-pressed":b,tooltip:m,onClick:_,...c,ref:d,children:l??u.jsxs(u.Fragment,{children:[u.jsx(S,{className:"tiptap-button-icon"}),n&&u.jsx("span",{className:"tiptap-button-text",children:n}),s&&u.jsx(xv,{align:t,shortcutKeys:C})]})})});Fn.displayName="TextAlignButton";const nf=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 18C4 17.4477 4.44772 17 5 17H19C19.5523 17 20 17.4477 20 18C20 18.5523 19.5523 19 19 19H5C4.44772 19 4 18.5523 4 18Z",fill:"currentColor"})]}));nf.displayName="AlignCenterIcon";const ls=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 12C2 11.4477 2.44772 11 3 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H3C2.44772 13 2 12.5523 2 12Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 18C2 17.4477 2.44772 17 3 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H3C2.44772 19 2 18.5523 2 18Z",fill:"currentColor"})]}));ls.displayName="AlignJustifyIcon";const rf=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 12C2 11.4477 2.44772 11 3 11H15C15.5523 11 16 11.4477 16 12C16 12.5523 15.5523 13 15 13H3C2.44772 13 2 12.5523 2 12Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 18C2 17.4477 2.44772 17 3 17H17C17.5523 17 18 17.4477 18 18C18 18.5523 17.5523 19 17 19H3C2.44772 19 2 18.5523 2 18Z",fill:"currentColor"})]}));rf.displayName="AlignLeftIcon";const of=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 12C8 11.4477 8.44772 11 9 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H9C8.44772 13 8 12.5523 8 12Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 18C6 17.4477 6.44772 17 7 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H7C6.44772 19 6 18.5523 6 18Z",fill:"currentColor"})]}));of.displayName="AlignRightIcon";const sf={left:"mod+shift+l",center:"mod+shift+e",right:"mod+shift+r",justify:"mod+shift+j"},_v={left:rf,center:nf,right:of,justify:ls},Sv={left:"왼쪽 정렬",center:"중앙 정렬",right:"오른쪽 정렬",justify:"양쪽 정렬"};function pa(e,t){return!e||!e.isEditable||!Mc(e,"textAlign")||Ko(e,["image","horizontalRule"])?!1:e.can().setTextAlign(t)}function Nv(e){return"setTextAlign"in e}function Av(e,t){return!e||!e.isEditable?!1:e.isActive({textAlign:t})}function Tv(e,t){if(!e||!e.isEditable||!pa(e,t))return!1;const n=e.chain().focus();return Nv(n)?n.setTextAlign(t).run():!1}function Rv(e){const{editor:t,hideWhenUnavailable:n,align:r}=e;return t?n?!t.isEditable||!Mc(t,"textAlign")?!1:t.isActive("code")?!0:pa(t,r):!0:!1}function Mv(e){const{editor:t,align:n,hideWhenUnavailable:r=!1,onAligned:o}=e,{editor:s}=Ue(t),[i,a]=x.useState(!0),l=pa(s,n),c=Av(s,n);x.useEffect(()=>{if(!s)return;const f=()=>{a(Rv({editor:s,align:n,hideWhenUnavailable:r}))};return f(),s.on("selectionUpdate",f),()=>{s.off("selectionUpdate",f)}},[s,r,n]);const d=x.useCallback(()=>{if(!s)return!1;const f=Tv(s,n);return f&&o?.(),f},[s,n,o]);return{isVisible:i,isActive:c,handleTextAlign:d,canAlign:l,label:Sv[n],shortcutKeys:sf[n],Icon:_v[n]}}function kv({type:e,shortcutKeys:t=hf[e]}){return u.jsx(fa,{children:Di({shortcutKeys:t})})}const It=x.forwardRef(({editor:e,type:t,text:n,hideWhenUnavailable:r=!1,onToggled:o,showShortcut:s=!1,onClick:i,children:a,...l},c)=>{const{editor:d}=Ue(e),{isVisible:f,handleMark:h,label:p,canToggle:m,isActive:g,Icon:b,shortcutKeys:v}=Bv({editor:d,type:t,hideWhenUnavailable:r,onToggled:o}),C=x.useCallback(_=>{i?.(_),!_.defaultPrevented&&h()},[h,i]);return f?u.jsx(V,{type:"button",disabled:!m,variant:"ghost","data-active-state":g?"on":"off","data-disabled":!m,role:"button",tabIndex:-1,"aria-label":p,"aria-pressed":g,tooltip:p,onClick:C,...l,ref:c,children:a??u.jsxs(u.Fragment,{children:[u.jsx(b,{className:"tiptap-button-icon"}),n&&u.jsx("span",{className:"tiptap-button-text",children:n}),s&&u.jsx(kv,{type:t,shortcutKeys:v})]})}):null});It.displayName="MarkButton";const af=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 2.5C5.17157 2.5 4.5 3.17157 4.5 4V20C4.5 20.8284 5.17157 21.5 6 21.5H15C16.4587 21.5 17.8576 20.9205 18.8891 19.8891C19.9205 18.8576 20.5 17.4587 20.5 16C20.5 14.5413 19.9205 13.1424 18.8891 12.1109C18.6781 11.9 18.4518 11.7079 18.2128 11.5359C19.041 10.5492 19.5 9.29829 19.5 8C19.5 6.54131 18.9205 5.14236 17.8891 4.11091C16.8576 3.07946 15.4587 2.5 14 2.5H6ZM14 10.5C14.663 10.5 15.2989 10.2366 15.7678 9.76777C16.2366 9.29893 16.5 8.66304 16.5 8C16.5 7.33696 16.2366 6.70107 15.7678 6.23223C15.2989 5.76339 14.663 5.5 14 5.5H7.5V10.5H14ZM7.5 18.5V13.5H15C15.663 13.5 16.2989 13.7634 16.7678 14.2322C17.2366 14.7011 17.5 15.337 17.5 16C17.5 16.663 17.2366 17.2989 16.7678 17.7678C16.2989 18.2366 15.663 18.5 15 18.5H7.5Z",fill:"currentColor"})}));af.displayName="BoldIcon";const lf=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{d:"M15.4545 4.2983C15.6192 3.77115 15.3254 3.21028 14.7983 3.04554C14.2712 2.88081 13.7103 3.1746 13.5455 3.70175L8.54554 19.7017C8.38081 20.2289 8.6746 20.7898 9.20175 20.9545C9.72889 21.1192 10.2898 20.8254 10.4545 20.2983L15.4545 4.2983Z",fill:"currentColor"}),u.jsx("path",{d:"M6.70711 7.29289C7.09763 7.68342 7.09763 8.31658 6.70711 8.70711L3.41421 12L6.70711 15.2929C7.09763 15.6834 7.09763 16.3166 6.70711 16.7071C6.31658 17.0976 5.68342 17.0976 5.29289 16.7071L1.29289 12.7071C0.902369 12.3166 0.902369 11.6834 1.29289 11.2929L5.29289 7.29289C5.68342 6.90237 6.31658 6.90237 6.70711 7.29289Z",fill:"currentColor"}),u.jsx("path",{d:"M17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289L22.7071 11.2929C23.0976 11.6834 23.0976 12.3166 22.7071 12.7071L18.7071 16.7071C18.3166 17.0976 17.6834 17.0976 17.2929 16.7071C16.9024 16.3166 16.9024 15.6834 17.2929 15.2929L20.5858 12L17.2929 8.70711C16.9024 8.31658 16.9024 7.68342 17.2929 7.29289Z",fill:"currentColor"})]}));lf.displayName="Code2Icon";const cf=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{d:"M15.0222 3H19C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H15.693L10.443 19H14C14.5523 19 15 19.4477 15 20C15 20.5523 14.5523 21 14 21H9.02418C9.00802 21.0004 8.99181 21.0004 8.97557 21H5C4.44772 21 4 20.5523 4 20C4 19.4477 4.44772 19 5 19H8.30704L13.557 5H10C9.44772 5 9 4.55228 9 4C9 3.44772 9.44772 3 10 3H14.9782C14.9928 2.99968 15.0075 2.99967 15.0222 3Z",fill:"currentColor"})}));cf.displayName="ItalicIcon";const uf=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{d:"M9.00039 3H16.0001C16.5524 3 17.0001 3.44772 17.0001 4C17.0001 4.55229 16.5524 5 16.0001 5H9.00011C8.68006 4.99983 8.36412 5.07648 8.07983 5.22349C7.79555 5.37051 7.55069 5.5836 7.36585 5.84487C7.181 6.10614 7.06155 6.40796 7.01754 6.72497C6.97352 7.04198 7.00623 7.36492 7.11292 7.66667C7.29701 8.18737 7.02414 8.75872 6.50344 8.94281C5.98274 9.1269 5.4114 8.85403 5.2273 8.33333C5.01393 7.72984 4.94851 7.08396 5.03654 6.44994C5.12456 5.81592 5.36346 5.21229 5.73316 4.68974C6.10285 4.1672 6.59256 3.74101 7.16113 3.44698C7.72955 3.15303 8.36047 2.99975 9.00039 3Z",fill:"currentColor"}),u.jsx("path",{d:"M18 13H20C20.5523 13 21 12.5523 21 12C21 11.4477 20.5523 11 20 11H4C3.44772 11 3 11.4477 3 12C3 12.5523 3.44772 13 4 13H14C14.7956 13 15.5587 13.3161 16.1213 13.8787C16.6839 14.4413 17 15.2044 17 16C17 16.7956 16.6839 17.5587 16.1213 18.1213C15.5587 18.6839 14.7956 19 14 19H6C5.44772 19 5 19.4477 5 20C5 20.5523 5.44772 21 6 21H14C15.3261 21 16.5979 20.4732 17.5355 19.5355C18.4732 18.5979 19 17.3261 19 16C19 14.9119 18.6453 13.8604 18 13Z",fill:"currentColor"})]}));uf.displayName="StrikeIcon";const df=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.29289 7.29289C3.68342 6.90237 4.31658 6.90237 4.70711 7.29289L12.7071 15.2929C13.0976 15.6834 13.0976 16.3166 12.7071 16.7071C12.3166 17.0976 11.6834 17.0976 11.2929 16.7071L3.29289 8.70711C2.90237 8.31658 2.90237 7.68342 3.29289 7.29289Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.7071 7.29289C13.0976 7.68342 13.0976 8.31658 12.7071 8.70711L4.70711 16.7071C4.31658 17.0976 3.68342 17.0976 3.29289 16.7071C2.90237 16.3166 2.90237 15.6834 3.29289 15.2929L11.2929 7.29289C11.6834 6.90237 12.3166 6.90237 12.7071 7.29289Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.4079 14.3995C18.0284 14.0487 18.7506 13.9217 19.4536 14.0397C20.1566 14.1578 20.7977 14.5138 21.2696 15.0481L21.2779 15.0574L21.2778 15.0575C21.7439 15.5988 22 16.2903 22 17C22 18.0823 21.3962 18.8401 20.7744 19.3404C20.194 19.8073 19.4858 20.141 18.9828 20.378C18.9638 20.387 18.9451 20.3958 18.9266 20.4045C18.4473 20.6306 18.2804 20.7817 18.1922 20.918C18.1773 20.9412 18.1619 20.9681 18.1467 21H21C21.5523 21 22 21.4477 22 22C22 22.5523 21.5523 23 21 23H17C16.4477 23 16 22.5523 16 22C16 21.1708 16.1176 20.4431 16.5128 19.832C16.9096 19.2184 17.4928 18.8695 18.0734 18.5956C18.6279 18.334 19.138 18.0901 19.5207 17.7821C19.8838 17.49 20 17.2477 20 17C20 16.7718 19.9176 16.5452 19.7663 16.3672C19.5983 16.1792 19.3712 16.0539 19.1224 16.0121C18.8722 15.9701 18.6152 16.015 18.3942 16.1394C18.1794 16.2628 18.0205 16.4549 17.9422 16.675C17.7572 17.1954 17.1854 17.4673 16.665 17.2822C16.1446 17.0972 15.8728 16.5254 16.0578 16.005C16.2993 15.3259 16.7797 14.7584 17.4039 14.4018L17.4079 14.3995L17.4079 14.3995Z",fill:"currentColor"})]}));df.displayName="SubscriptIcon";const ff=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.7071 7.29289C13.0976 7.68342 13.0976 8.31658 12.7071 8.70711L4.70711 16.7071C4.31658 17.0976 3.68342 17.0976 3.29289 16.7071C2.90237 16.3166 2.90237 15.6834 3.29289 15.2929L11.2929 7.29289C11.6834 6.90237 12.3166 6.90237 12.7071 7.29289Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.29289 7.29289C3.68342 6.90237 4.31658 6.90237 4.70711 7.29289L12.7071 15.2929C13.0976 15.6834 13.0976 16.3166 12.7071 16.7071C12.3166 17.0976 11.6834 17.0976 11.2929 16.7071L3.29289 8.70711C2.90237 8.31658 2.90237 7.68342 3.29289 7.29289Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.405 1.40657C18.0246 1.05456 18.7463 0.92634 19.4492 1.04344C20.1521 1.16054 20.7933 1.51583 21.2652 2.0497L21.2697 2.05469L21.2696 2.05471C21.7431 2.5975 22 3.28922 22 4.00203C22 5.08579 21.3952 5.84326 20.7727 6.34289C20.1966 6.80531 19.4941 7.13675 18.9941 7.37261C18.9714 7.38332 18.9491 7.39383 18.9273 7.40415C18.4487 7.63034 18.2814 7.78152 18.1927 7.91844C18.1778 7.94155 18.1625 7.96834 18.1473 8.00003H21C21.5523 8.00003 22 8.44774 22 9.00003C22 9.55231 21.5523 10 21 10H17C16.4477 10 16 9.55231 16 9.00003C16 8.17007 16.1183 7.44255 16.5138 6.83161C16.9107 6.21854 17.4934 5.86971 18.0728 5.59591C18.6281 5.33347 19.1376 5.09075 19.5208 4.78316C19.8838 4.49179 20 4.25026 20 4.00203C20 3.77192 19.9178 3.54865 19.7646 3.37182C19.5968 3.18324 19.3696 3.05774 19.1205 3.01625C18.8705 2.97459 18.6137 3.02017 18.3933 3.14533C18.1762 3.26898 18.0191 3.45826 17.9406 3.67557C17.7531 4.19504 17.18 4.46414 16.6605 4.27662C16.141 4.0891 15.8719 3.51596 16.0594 2.99649C16.303 2.3219 16.7817 1.76125 17.4045 1.40689L17.405 1.40657Z",fill:"currentColor"})]}));ff.displayName="SuperscriptIcon";const pf=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4C7 3.44772 6.55228 3 6 3C5.44772 3 5 3.44772 5 4V10C5 11.8565 5.7375 13.637 7.05025 14.9497C8.36301 16.2625 10.1435 17 12 17C13.8565 17 15.637 16.2625 16.9497 14.9497C18.2625 13.637 19 11.8565 19 10V4C19 3.44772 18.5523 3 18 3C17.4477 3 17 3.44772 17 4V10C17 11.3261 16.4732 12.5979 15.5355 13.5355C14.5979 14.4732 13.3261 15 12 15C10.6739 15 9.40215 14.4732 8.46447 13.5355C7.52678 12.5979 7 11.3261 7 10V4ZM4 19C3.44772 19 3 19.4477 3 20C3 20.5523 3.44772 21 4 21H20C20.5523 21 21 20.5523 21 20C21 19.4477 20.5523 19 20 19H4Z",fill:"currentColor"})}));pf.displayName="UnderlineIcon";const Ov={bold:af,italic:cf,underline:pf,strike:uf,code:lf,superscript:ff,subscript:df},hf={bold:"mod+b",italic:"mod+i",underline:"mod+u",strike:"mod+shift+s",code:"mod+e",superscript:"mod+.",subscript:"mod+,"};function ha(e,t){return!e||!e.isEditable||!Bi(t,e)||Ko(e,["image"])?!1:e.can().toggleMark(t)}function Iv(e,t){return!e||!e.isEditable?!1:e.isActive(t)}function Lv(e,t){return!e||!e.isEditable||!ha(e,t)?!1:e.chain().focus().toggleMark(t).run()}function Pv(e){const{editor:t,type:n,hideWhenUnavailable:r}=e;return t?r?!t.isEditable||!Bi(n,t)?!1:t.isActive("code")?!0:ha(t,n):!0:!1}function Dv(e){return{bold:"굵게",italic:"기울임꼴",strike:"취소선",code:"코드",underline:"밑줄",superscript:"위첨자",subscript:"아래첨자"}[e]}function Bv(e){const{editor:t,type:n,hideWhenUnavailable:r=!1,onToggled:o}=e,{editor:s}=Ue(t),[i,a]=x.useState(!0),l=ha(s,n),c=Iv(s,n);x.useEffect(()=>{if(!s)return;const f=()=>{a(Pv({editor:s,type:n,hideWhenUnavailable:r}))};return f(),s.on("selectionUpdate",f),()=>{s.off("selectionUpdate",f)}},[s,n,r]);const d=x.useCallback(()=>{if(!s)return!1;const f=Lv(s,n);return f&&o?.(),f},[s,n,o]);return{isVisible:i,isActive:c,handleMark:d,canToggle:l,label:Dv(n),shortcutKeys:hf[n],Icon:Ov[n]}}function Hv(e="max",t=768){const[n,r]=x.useState(void 0);return x.useEffect(()=>{const o=e==="min"?`(min-width: ${t}px)`:`(max-width: ${t-1}px)`,s=window.matchMedia(o),i=a=>r(a.matches);return r(s.matches),s.addEventListener("change",i),()=>s.removeEventListener("change",i)},[e,t]),!!n}const gf=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 4C21 3.44772 20.5523 3 20 3C19.4477 3 19 3.44772 19 4V11C19 11.7956 18.6839 12.5587 18.1213 13.1213C17.5587 13.6839 16.7956 14 16 14H6.41421L9.70711 10.7071C10.0976 10.3166 10.0976 9.68342 9.70711 9.29289C9.31658 8.90237 8.68342 8.90237 8.29289 9.29289L3.29289 14.2929C2.90237 14.6834 2.90237 15.3166 3.29289 15.7071L8.29289 20.7071C8.68342 21.0976 9.31658 21.0976 9.70711 20.7071C10.0976 20.3166 10.0976 19.6834 9.70711 19.2929L6.41421 16H16C17.3261 16 18.5979 15.4732 19.5355 14.5355C20.4732 13.5979 21 12.3261 21 11V4Z",fill:"currentColor"})}));gf.displayName="CornerDownLeftIcon";const mf=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{d:"M14 3C14 2.44772 14.4477 2 15 2H21C21.5523 2 22 2.44772 22 3V9C22 9.55228 21.5523 10 21 10C20.4477 10 20 9.55228 20 9V5.41421L10.7071 14.7071C10.3166 15.0976 9.68342 15.0976 9.29289 14.7071C8.90237 14.3166 8.90237 13.6834 9.29289 13.2929L18.5858 4H15C14.4477 4 14 3.55228 14 3Z",fill:"currentColor"}),u.jsx("path",{d:"M4.29289 7.29289C4.48043 7.10536 4.73478 7 5 7H11C11.5523 7 12 6.55228 12 6C12 5.44772 11.5523 5 11 5H5C4.20435 5 3.44129 5.31607 2.87868 5.87868C2.31607 6.44129 2 7.20435 2 8V19C2 19.7957 2.31607 20.5587 2.87868 21.1213C3.44129 21.6839 4.20435 22 5 22H16C16.7957 22 17.5587 21.6839 18.1213 21.1213C18.6839 20.5587 19 19.7957 19 19V13C19 12.4477 18.5523 12 18 12C17.4477 12 17 12.4477 17 13V19C17 19.2652 16.8946 19.5196 16.7071 19.7071C16.5196 19.8946 16.2652 20 16 20H5C4.73478 20 4.48043 19.8946 4.29289 19.7071C4.10536 19.5196 4 19.2652 4 19V8C4 7.73478 4.10536 7.48043 4.29289 7.29289Z",fill:"currentColor"})]}));mf.displayName="ExternalLinkIcon";const ga=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{d:"M16.9958 1.06669C15.4226 1.05302 13.907 1.65779 12.7753 2.75074L12.765 2.76086L11.045 4.47086C10.6534 4.86024 10.6515 5.49341 11.0409 5.88507C11.4303 6.27673 12.0634 6.27858 12.4551 5.88919L14.1697 4.18456C14.9236 3.45893 15.9319 3.05752 16.9784 3.06662C18.0272 3.07573 19.0304 3.49641 19.772 4.23804C20.5137 4.97967 20.9344 5.98292 20.9435 7.03171C20.9526 8.07776 20.5515 9.08563 19.8265 9.83941L16.833 12.8329C16.4274 13.2386 15.9393 13.5524 15.4019 13.7529C14.8645 13.9533 14.2903 14.0359 13.7181 13.9949C13.146 13.9539 12.5894 13.7904 12.0861 13.5154C11.5827 13.2404 11.1444 12.8604 10.8008 12.401C10.47 11.9588 9.84333 11.8685 9.40108 12.1993C8.95883 12.5301 8.86849 13.1568 9.1993 13.599C9.71464 14.288 10.3721 14.858 11.1272 15.2705C11.8822 15.683 12.7171 15.9283 13.5753 15.9898C14.4334 16.0513 15.2948 15.9274 16.1009 15.6267C16.907 15.326 17.639 14.8555 18.2473 14.247L21.2472 11.2471L21.2593 11.2347C22.3523 10.1031 22.9571 8.58751 22.9434 7.01433C22.9297 5.44115 22.2987 3.93628 21.1863 2.82383C20.0738 1.71138 18.5689 1.08036 16.9958 1.06669Z",fill:"currentColor"}),u.jsx("path",{d:"M10.4247 8.0102C9.56657 7.94874 8.70522 8.07256 7.89911 8.37326C7.09305 8.67395 6.36096 9.14458 5.75272 9.753L2.75285 12.7529L2.74067 12.7653C1.64772 13.8969 1.04295 15.4125 1.05662 16.9857C1.07029 18.5589 1.70131 20.0637 2.81376 21.1762C3.9262 22.2886 5.43108 22.9196 7.00426 22.9333C8.57744 22.947 10.0931 22.3422 11.2247 21.2493L11.2371 21.2371L12.9471 19.5271C13.3376 19.1366 13.3376 18.5034 12.9471 18.1129C12.5565 17.7223 11.9234 17.7223 11.5328 18.1129L9.82932 19.8164C9.07555 20.5414 8.06768 20.9425 7.02164 20.9334C5.97285 20.9243 4.9696 20.5036 4.22797 19.762C3.48634 19.0203 3.06566 18.0171 3.05655 16.9683C3.04746 15.9222 3.44851 14.9144 4.17355 14.1606L7.16719 11.167C7.5727 10.7613 8.06071 10.4476 8.59811 10.2471C9.13552 10.0467 9.70976 9.96412 10.2819 10.0051C10.854 10.0461 11.4106 10.2096 11.9139 10.4846C12.4173 10.7596 12.8556 11.1397 13.1992 11.599C13.53 12.0412 14.1567 12.1316 14.5989 11.8007C15.0412 11.4699 15.1315 10.8433 14.8007 10.401C14.2854 9.71205 13.6279 9.14198 12.8729 8.72948C12.1178 8.31697 11.2829 8.07166 10.4247 8.0102Z",fill:"currentColor"})]}));ga.displayName="LinkIcon";const bf=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 5V4C7 3.17477 7.40255 2.43324 7.91789 1.91789C8.43324 1.40255 9.17477 1 10 1H14C14.8252 1 15.5668 1.40255 16.0821 1.91789C16.5975 2.43324 17 3.17477 17 4V5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H20V20C20 20.8252 19.5975 21.5668 19.0821 22.0821C18.5668 22.5975 17.8252 23 17 23H7C6.17477 23 5.43324 22.5975 4.91789 22.0821C4.40255 21.5668 4 20.8252 4 20V7H3C2.44772 7 2 6.55228 2 6C2 5.44772 2.44772 5 3 5H7ZM9 4C9 3.82523 9.09745 3.56676 9.33211 3.33211C9.56676 3.09745 9.82523 3 10 3H14C14.1748 3 14.4332 3.09745 14.6679 3.33211C14.9025 3.56676 15 3.82523 15 4V5H9V4ZM6 7V20C6 20.1748 6.09745 20.4332 6.33211 20.6679C6.56676 20.9025 6.82523 21 7 21H17C17.1748 21 17.4332 20.9025 17.6679 20.6679C17.9025 20.4332 18 20.1748 18 20V7H6Z",fill:"currentColor"})}));bf.displayName="TrashIcon";function vf({className:e,type:t,...n}){return u.jsx("input",{type:t,"data-slot":"tiptap-input",className:ke("tiptap-input",e),...n})}const yf=x.forwardRef(({className:e,children:t,...n},r)=>u.jsx(V,{type:"button",className:e,variant:"ghost",role:"button",tabIndex:-1,"aria-label":"Link",tooltip:"링크",ref:r,...n,children:t||u.jsx(ga,{className:"tiptap-button-icon"})}));yf.displayName="LinkButton";const Fv=({url:e,setUrl:t,setLink:n,removeLink:r,openLink:o,isActive:s})=>{const i=Hv(),a=l=>{l.key==="Enter"&&(l.preventDefault(),n())};return u.jsx(Fe,{style:{...i?{boxShadow:"none",border:0}:{}},children:u.jsx($e,{style:{...i?{padding:0}:{}},children:u.jsxs(Be,{orientation:"horizontal",children:[u.jsx(vf,{type:"url",placeholder:"Paste a link...",value:e,onChange:l=>t(l.target.value),onKeyDown:a,autoFocus:!0,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",className:"tiptap-link-input"}),u.jsx(Qt,{children:u.jsx(V,{type:"button",onClick:n,title:"Apply link",disabled:!e&&!s,variant:"ghost",children:u.jsx(gf,{className:"tiptap-button-icon"})})}),u.jsx(Hi,{}),u.jsxs(Qt,{children:[u.jsx(Qt,{children:u.jsx(V,{type:"button",onClick:o,title:"Open in new window",disabled:!e&&!s,variant:"ghost",children:u.jsx(mf,{className:"tiptap-button-icon"})})}),u.jsx(Qt,{children:u.jsx(V,{type:"button",onClick:r,title:"Remove link",disabled:!e&&!s,variant:"ghost",children:u.jsx(bf,{className:"tiptap-button-icon"})})})]})]})})})},Ef=x.forwardRef(({editor:e,hideWhenUnavailable:t=!1,onSetLink:n,onOpenChange:r,autoOpenOnLinkActive:o=!0,onClick:s,children:i,...a},l)=>{const{editor:c}=Ue(e),[d,f]=x.useState(!1),{isVisible:h,canSet:p,isActive:m,url:g,setUrl:b,setLink:v,removeLink:C,openLink:_,label:S,Icon:N}=zv({editor:c,hideWhenUnavailable:t,onSetLink:n}),A=x.useCallback(D=>{f(D),r?.(D)},[r]),R=x.useCallback(()=>{v(),f(!1)},[v]),O=x.useCallback(D=>{s?.(D),!D.defaultPrevented&&f(!d)},[s,d]);return x.useEffect(()=>{o&&m&&f(!0)},[o,m]),h?u.jsxs(jt,{open:d,onOpenChange:A,children:[u.jsx(zt,{asChild:!0,children:u.jsx(yf,{disabled:!p,"data-active-state":m?"on":"off","data-disabled":!p,"aria-label":S,"aria-pressed":m,onClick:O,...a,ref:l,children:i??u.jsx(N,{className:"tiptap-button-icon"})})}),u.jsx(Vt,{collisionPadding:4,children:u.jsx(Fv,{url:g,setUrl:b,setLink:R,removeLink:C,openLink:_,isActive:m})})]}):null});Ef.displayName="LinkPopover";function Cf(e){if(!e||!e.isEditable||Ko(e,["image"],!0))return!1;try{return e.can().setMark("link")}catch{return!1}}function wf(e){return!e||!e.isEditable?!1:e.isActive("link")}function $v(e){const{editor:t,hideWhenUnavailable:n}=e;if(!t||!t.isEditable)return!1;const r=Bi("link",t);return n?r?t.isActive("code")?!0:Cf(t):!1:!0}function Uv(e){const{editor:t,onSetLink:n}=e,[r,o]=x.useState(null);x.useEffect(()=>{if(!t)return;const{href:l}=t.getAttributes("link");wf(t)&&r===null&&o(l||"")},[t,r]),x.useEffect(()=>{if(!t)return;const l=()=>{const{href:c}=t.getAttributes("link");o(c||"")};return t.on("selectionUpdate",l),()=>{t.off("selectionUpdate",l)}},[t]);const s=x.useCallback(()=>{if(!r||!t)return;const{selection:l}=t.state,c=l.empty;let d=t.chain().focus();d=d.extendMarkRange("link").setLink({href:r}),c&&(d=d.insertContent({type:"text",text:r})),d.run(),o(null),n?.()},[t,n,r]),i=x.useCallback(()=>{t&&(t.chain().focus().extendMarkRange("link").unsetLink().setMeta("preventAutolink",!0).run(),o(""))},[t]),a=x.useCallback((l="_blank",c="noopener,noreferrer")=>{if(!r)return;const d=kh(r,window.location.href);d!=="#"&&window.open(d,l,c)},[r]);return{url:r||"",setUrl:o,setLink:s,removeLink:i,openLink:a}}function jv(e){const{editor:t,hideWhenUnavailable:n=!1}=e,r=Cf(t),o=wf(t),[s,i]=x.useState(!0);return x.useEffect(()=>{if(!t)return;const a=()=>{i($v({editor:t,hideWhenUnavailable:n}))};return a(),t.on("selectionUpdate",a),()=>{t.off("selectionUpdate",a)}},[t,n]),{isVisible:s,canSet:r,isActive:o}}function zv(e){const{editor:t,hideWhenUnavailable:n=!1,onSetLink:r}=e||{},{editor:o}=Ue(t),{isVisible:s,canSet:i,isActive:a}=jv({editor:o,hideWhenUnavailable:n}),l=Uv({editor:o,onSetLink:r});return{isVisible:s,canSet:i,isActive:a,label:"Link",Icon:ga,...l}}const xf=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{d:"M4 5V19H20V7H11.5858L9.58579 5H4ZM12.4142 5H21C21.5523 5 22 5.44772 22 6V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H10.4142L12.4142 5ZM10 10.5C10 11.3284 9.32843 12 8.5 12C7.67157 12 7 11.3284 7 10.5C7 9.67157 7.67157 9 8.5 9C9.32843 9 10 9.67157 10 10.5ZM18 17L14 11L7 17H18Z"})}));xf.displayName="UploadableIcon";const _f=x.createContext(null);function Sf(){const e=x.useContext(_f);if(!e)throw new Error("useFileHandlerContext는 FileHandlerContext.Provider 안에서만 사용할 수 있습니다.");return e}const Nf=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{d:"M14 13.5V8C14 5.79086 12.2091 4 10 4C7.79086 4 6 5.79086 6 8V13.5C6 17.0899 8.91015 20 12.5 20C16.0899 20 19 17.0899 19 13.5V4H21V13.5C21 18.1944 17.1944 22 12.5 22C7.80558 22 4 18.1944 4 13.5V8C4 4.68629 6.68629 2 10 2C13.3137 2 16 4.68629 16 8V13.5C16 15.433 14.433 17 12.5 17C10.567 17 9 15.433 9 13.5V8H11V13.5C11 14.3284 11.6716 15 12.5 15C13.3284 15 14 14.3284 14 13.5Z"})}));Nf.displayName="UploadableFileIcon";const Af=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{d:"M15 8V4H5V20H19V8H15ZM3 2.9918C3 2.44405 3.44749 2 3.9985 2H16L20.9997 7L21 20.9925C21 21.5489 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5447 3 21.0082V2.9918ZM11 9.5C11 10.3284 10.3284 11 9.5 11C8.67157 11 8 10.3284 8 9.5C8 8.67157 8.67157 8 9.5 8C10.3284 8 11 8.67157 11 9.5ZM17.5 17L13.5 10L8 17H17.5Z"})}));Af.displayName="UploadableImageIcon";const vi=x.forwardRef(({editor:e,uploadType:t,text:n,onClick:r,externalInputRef:o,...s},i)=>{const{editor:a}=Ue(e),{resolveFileUrl:l,insertFile:c}=Sf(),d=x.useRef(null),f=o??d,h=x.useCallback(v=>{r?.(v),!v.defaultPrevented&&f.current?.click()},[r,f]),p=x.useCallback(async v=>{if(!a)return;const C=Array.from(v.target.files??[]);if(C.length===0)return;const _=a.state.selection.anchor;for(const S of C){const N=await l(S);if(!N)return;c(a,S,N,_)}v.target.value=""},[a,l,c]),m=t==="image"?"image/*":"*/*",g=t==="image"?"이미지 업로드":"파일 업로드",b=t==="image"?Af:Nf;return u.jsxs(u.Fragment,{children:[u.jsxs(V,{type:"button",variant:"ghost",role:"button",tabIndex:-1,"aria-label":g,tooltip:g,onClick:h,...s,ref:i,children:[u.jsx(b,{className:"tiptap-button-icon"}),n&&u.jsx("span",{className:"tiptap-button-text",children:n})]}),!o&&u.jsx("input",{ref:d,type:"file",accept:m,style:{display:"none"},onChange:p})]})});vi.displayName="UploadableButton";const Tf=x.forwardRef(({editor:e,portal:t=!1,onOpenChange:n,...r},o)=>{const{editor:s}=Ue(e),{resolveFileUrl:i,insertFile:a}=Sf(),[l,c]=x.useState(!1),d=x.useRef(null),f=x.useRef(null),h=x.useCallback(m=>{s&&(c(m),n?.(m))},[s,n]),p=x.useCallback(async m=>{if(!s)return;const g=Array.from(m.target.files??[]);if(g.length===0)return;const b=s.state.selection.anchor;for(const v of g){const C=await i(v);if(!C)return;a(s,v,C,b)}m.target.value=""},[s,i,a]);return u.jsxs(u.Fragment,{children:[u.jsxs(vr,{modal:!0,open:l,onOpenChange:h,children:[u.jsx(On,{asChild:!0,children:u.jsxs(V,{type:"button",variant:"ghost",role:"button",tabIndex:-1,"aria-label":"첨부",tooltip:"첨부",...r,ref:o,children:[u.jsx(xf,{className:"tiptap-button-icon"}),u.jsx(pr,{className:"tiptap-button-dropdown-small"})]})}),u.jsx(In,{align:"start",portal:t,children:u.jsx(Fe,{children:u.jsx($e,{children:u.jsxs(Qt,{children:[u.jsx(je,{asChild:!0,children:u.jsx(vi,{editor:s,uploadType:"image",text:"사진",externalInputRef:d})}),u.jsx(je,{asChild:!0,children:u.jsx(vi,{editor:s,uploadType:"file",text:"파일",externalInputRef:f})})]})})})})]}),u.jsx("input",{ref:d,type:"file",accept:"image/*",style:{display:"none"},onChange:p}),u.jsx("input",{ref:f,type:"file",accept:"*/*",style:{display:"none"},onChange:p})]})});Tf.displayName="UploadableDropdownMenu";const Rf=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{d:"M21 3C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H21ZM11 13H4V19H11V13ZM20 13H13V19H20V13ZM11 5H4V11H11V5ZM20 5H13V11H20V5Z"})}));Rf.displayName="TableIcon";const Vv=10,Kv=10;function Wv({editor:e}){const[t,n]=x.useState(null),r=(i,a)=>{e.chain().focus().insertTable({rows:i,cols:a,withHeaderRow:!1}).run()},o=t?.row??0,s=t?.col??0;return u.jsxs(jt,{children:[u.jsx(zt,{asChild:!0,children:u.jsx(V,{"data-style":"ghost",tooltip:"표 삽입",children:u.jsx(Rf,{className:"tiptap-button-icon"})})}),u.jsx(Vt,{align:"start",children:u.jsx(Fe,{children:u.jsxs($e,{children:[u.jsx("div",{className:"tiptap-table-picker-grid",onMouseLeave:()=>n(null),children:Array.from({length:Vv},(i,a)=>Array.from({length:Kv},(l,c)=>{const d=a+1,f=c+1,h=d<=o&&f<=s;return u.jsx("div",{className:`tiptap-table-picker-cell${h?" is-selected":""}`,onMouseEnter:()=>n({row:d,col:f}),onClick:()=>r(d,f)},`${d}-${f}`)}))}),u.jsx("p",{className:"tiptap-table-picker-label",children:o>0&&s>0?`${o} × ${s}`:" "})]})})})]})}const yi=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 6C7 5.44772 7.44772 5 8 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H8C7.44772 7 7 6.55228 7 6Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 12C7 11.4477 7.44772 11 8 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H8C7.44772 13 7 12.5523 7 12Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 18C7 17.4477 7.44772 17 8 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H8C7.44772 19 7 18.5523 7 18Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H3.01C3.56228 5 4.01 5.44772 4.01 6C4.01 6.55228 3.56228 7 3.01 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 12C2 11.4477 2.44772 11 3 11H3.01C3.56228 11 4.01 11.4477 4.01 12C4.01 12.5523 3.56228 13 3.01 13H3C2.44772 13 2 12.5523 2 12Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 18C2 17.4477 2.44772 17 3 17H3.01C3.56228 17 4.01 17.4477 4.01 18C4.01 18.5523 3.56228 19 3.01 19H3C2.44772 19 2 18.5523 2 18Z",fill:"currentColor"})]}));yi.displayName="ListIcon";const Mf=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 6C9 5.44772 9.44772 5 10 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H10C9.44772 7 9 6.55228 9 6Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 12C9 11.4477 9.44772 11 10 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H10C9.44772 13 9 12.5523 9 12Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 18C9 17.4477 9.44772 17 10 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H10C9.44772 19 9 18.5523 9 18Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 6C3 5.44772 3.44772 5 4 5H5C5.55228 5 6 5.44772 6 6V10C6 10.5523 5.55228 11 5 11C4.44772 11 4 10.5523 4 10V7C3.44772 7 3 6.55228 3 6Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 10C3 9.44772 3.44772 9 4 9H6C6.55228 9 7 9.44772 7 10C7 10.5523 6.55228 11 6 11H4C3.44772 11 3 10.5523 3 10Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.82219 13.0431C6.54543 13.4047 6.99997 14.1319 6.99997 15C6.99997 15.5763 6.71806 16.0426 6.48747 16.35C6.31395 16.5814 6.1052 16.8044 5.91309 17H5.99997C6.55226 17 6.99997 17.4477 6.99997 18C6.99997 18.5523 6.55226 19 5.99997 19H3.99997C3.44769 19 2.99997 18.5523 2.99997 18C2.99997 17.4237 3.28189 16.9575 3.51247 16.65C3.74323 16.3424 4.03626 16.0494 4.26965 15.8161C4.27745 15.8083 4.2852 15.8006 4.29287 15.7929C4.55594 15.5298 4.75095 15.3321 4.88748 15.15C4.96287 15.0495 4.99021 14.9922 4.99911 14.9714C4.99535 14.9112 4.9803 14.882 4.9739 14.8715C4.96613 14.8588 4.95382 14.845 4.92776 14.8319C4.87723 14.8067 4.71156 14.7623 4.44719 14.8944C3.95321 15.1414 3.35254 14.9412 3.10555 14.4472C2.85856 13.9533 3.05878 13.3526 3.55276 13.1056C4.28839 12.7378 5.12272 12.6934 5.82219 13.0431Z",fill:"currentColor"})]}));Mf.displayName="ListOrderedIcon";function Gv({editor:e}){const[t,n]=x.useState(!1),r=ot.useEditorState({editor:e,selector:({editor:s})=>({bulletList:s.isActive("bulletList"),orderedList:s.isActive("orderedList"),paragraph:s.isActive("paragraph")})}),o=s=>{s(),n(!1)};return u.jsxs(jt,{open:t,onOpenChange:n,children:[u.jsx(zt,{asChild:!0,children:u.jsx(V,{"data-style":"ghost",tooltip:"목록",children:u.jsx(yi,{className:"tiptap-button-icon"})})}),u.jsx(Vt,{align:"start",children:u.jsx(Fe,{children:u.jsx($e,{children:u.jsxs(Be,{orientation:"horizontal",children:[u.jsx(V,{"data-style":"ghost",tooltip:"글머리 기호 목록","aria-pressed":r.bulletList,onClick:()=>o(()=>e.chain().focus().toggleBulletList().run()),children:u.jsx(yi,{className:"tiptap-button-icon"})}),u.jsx(V,{"data-style":"ghost",tooltip:"번호 매기기 목록","aria-pressed":r.orderedList,onClick:()=>o(()=>e.chain().focus().toggleOrderedList().run()),children:u.jsx(Mf,{className:"tiptap-button-icon"})}),u.jsx(V,{"data-style":"ghost",tooltip:"단락","aria-pressed":r.paragraph,onClick:()=>o(()=>e.chain().focus().clearNodes().run()),children:u.jsx(ls,{className:"tiptap-button-icon"})})]})})})})]})}const kf=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{d:"M2 11H4V13H2V11ZM6 11H18V13H6V11ZM20 11H22V13H20V11Z"})}));kf.displayName="SeparatorIcon";const Ir={flex:1,height:"1px",background:"var(--tt-gray-light-a-400)"},Pl={fontSize:"0.65rem",color:"var(--tt-gray-light-a-600)"};function Zv({style:e}){switch(e){case"thin":return u.jsx("span",{style:{display:"block",width:"80%",height:"1px",background:"var(--tt-gray-light-a-400)"}});case"thick":return u.jsx("span",{style:{display:"block",width:"80%",height:"3px",background:"var(--tt-gray-light-a-700)"}});case"dashed":return u.jsx("span",{style:{display:"block",width:"80%",borderTop:"1px dashed var(--tt-gray-light-a-400)"}});case"short":return u.jsx("span",{style:{display:"block",width:"30%",height:"1px",background:"var(--tt-gray-light-a-400)"}});case"dots":return u.jsx("span",{style:{letterSpacing:"0.4em",fontSize:"1rem",color:"var(--tt-gray-light-a-600)"},children:"· · ·"});case"diamond":return u.jsxs("span",{style:{display:"flex",alignItems:"center",width:"80%",gap:"6px"},children:[u.jsx("span",{style:Ir}),u.jsx("span",{style:Pl,children:"◆"}),u.jsx("span",{style:Ir})]});case"circle":return u.jsxs("span",{style:{display:"flex",alignItems:"center",width:"80%",gap:"6px"},children:[u.jsx("span",{style:Ir}),u.jsx("span",{style:{...Pl,fontSize:"0.75rem"},children:"○"}),u.jsx("span",{style:Ir})]})}}const qv=["thin","thick","dashed","short","dots","diamond","circle"];function Yv({editor:e}){const[t,n]=x.useState(!1),r=o=>{e.chain().focus().setHr({style:o}).run(),n(!1)};return u.jsxs(jt,{open:t,onOpenChange:n,children:[u.jsx(zt,{asChild:!0,children:u.jsx(V,{"data-style":"ghost",tooltip:"구분선 삽입",children:u.jsx(kf,{className:"tiptap-button-icon"})})}),u.jsx(Vt,{align:"start",children:u.jsx(Fe,{children:u.jsx($e,{children:u.jsx(Be,{orientation:"vertical",children:qv.map(o=>u.jsx(V,{"data-style":"ghost",className:"tiptap-hr-style-button",onClick:()=>r(o),children:u.jsx(Zv,{style:o})},o))})})})})]})}const ma=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{d:"M4.58341 17.3211C3.55316 16.2274 3 15 3 13.0103C3 9.51086 5.45651 6.37366 9.03059 4.82318L9.92328 6.20079C6.58804 8.00539 5.93618 10.346 5.67564 11.822C6.21263 11.5443 6.91558 11.4466 7.60471 11.5105C9.40908 11.6778 10.8312 13.159 10.8312 15C10.8312 16.933 9.26416 18.5 7.33116 18.5C6.2581 18.5 5.23196 18.0095 4.58341 17.3211ZM14.5834 17.3211C13.5532 16.2274 13 15 13 13.0103C13 9.51086 15.4565 6.37366 19.0306 4.82318L19.9233 6.20079C16.588 8.00539 15.9362 10.346 15.6756 11.822C16.2126 11.5443 16.9156 11.4466 17.6047 11.5105C19.4091 11.6778 20.8312 13.159 20.8312 15C20.8312 16.933 19.2642 18.5 17.3312 18.5C16.2581 18.5 15.232 18.0095 14.5834 17.3211Z"})}));ma.displayName="DoubleQuotesIcon";const Dl={height:"2px",borderRadius:"2px",background:"var(--tt-gray-light-a-300)"};function Xv({style:e}){if(e==="quote")return u.jsx("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",width:"80%"},children:u.jsx(ma,{style:{width:"14px",height:"14px",color:"var(--tt-gray-light-a-500)"}})});if(e==="bar")return u.jsxs("span",{style:{display:"flex",gap:"2px",width:"80%",alignItems:"center"},children:[u.jsx("span",{style:{height:"12px",width:"2px",borderRadius:"2px",background:"var(--tt-gray-light-a-500)",flexShrink:0}}),u.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:"4px",flex:1,alignItems:"flex-start"},children:[u.jsx("span",{style:{...Dl,width:"100%"}}),u.jsx("span",{style:{...Dl,width:"70%"}})]})]});if(e==="box")return u.jsx("span",{style:{display:"flex",flexDirection:"column",gap:"4px",width:"80%",border:"1px dotted var(--tt-gray-light-a-400)",borderRadius:"3px",padding:"6px 8px",backgroundColor:"var(--tt-gray-light-a-100)"}})}function Jv({editor:e}){const[t,n]=x.useState(!1),r=ot.useEditorState({editor:e,selector:({editor:i})=>({quote:i.isActive("blockquote",{style:"quote"}),bar:i.isActive("blockquote",{style:"bar"}),box:i.isActive("blockquote",{style:"box"})})}),o=i=>{r[i]?e.chain().focus().toggleBlockquote().run():e.isActive("blockquote")?e.chain().focus().updateAttributes("blockquote",{style:i}).run():e.chain().focus().toggleBlockquote().updateAttributes("blockquote",{style:i}).run(),n(!1)},s=()=>{e.chain().focus().clearNodes().run(),n(!1)};return u.jsxs(jt,{open:t,onOpenChange:n,children:[u.jsx(zt,{asChild:!0,children:u.jsx(V,{"data-style":"ghost",tooltip:"인용구 삽입",children:u.jsx(ma,{className:"tiptap-button-icon"})})}),u.jsx(Vt,{align:"start",children:u.jsx(Fe,{children:u.jsx($e,{children:u.jsxs(Be,{orientation:"vertical",children:[["quote","bar","box"].map(i=>u.jsx(V,{"data-style":"ghost",className:"tiptap-hr-style-button","aria-pressed":r[i],onClick:()=>o(i),children:u.jsx(Xv,{style:i})},i)),u.jsx(V,{"data-style":"ghost",className:"tiptap-hr-style-button",onClick:s,children:u.jsx(ls,{className:"tiptap-button-icon"})})]})})})})]})}const Bs={basic:"기본 모드",expert:"전문가 모드"};function Qv({mode:e,onModeChange:t}){return u.jsxs(vr,{children:[u.jsx(On,{asChild:!0,children:u.jsxs(V,{"data-style":"ghost",children:[Bs[e],u.jsx(pr,{})]})}),u.jsx(In,{portal:!1,children:u.jsx(Fe,{children:u.jsx($e,{children:Object.keys(Bs).map(n=>u.jsx(je,{"data-active-state":e===n?"on":"off",onSelect:()=>t(n),asChild:!0,children:u.jsx(V,{"data-style":"ghost","data-active-state":e===n?"on":"off",children:Bs[n]})},n))})})})]})}function e2({editor:e}){const[t,n]=x.useState("basic");return u.jsx(Wo,{className:"my-toolbar",children:u.jsxs(Go,{children:[u.jsx(Tf,{editor:e,portal:!1}),t==="basic"?u.jsx(u.Fragment,{children:u.jsx(ef,{editor:e,portal:!1})}):u.jsx(u.Fragment,{children:u.jsx(tf,{editor:e,portal:!1})}),u.jsx(ht,{}),u.jsx(It,{type:"bold"}),u.jsx(It,{type:"italic"}),u.jsx(It,{type:"strike"}),u.jsx(It,{type:"superscript"}),u.jsx(It,{type:"subscript"}),u.jsx(It,{type:"underline"}),u.jsx(It,{type:"code"}),u.jsx(Ef,{}),u.jsx(ed,{editor:e}),u.jsx(ht,{}),u.jsx(Fn,{editor:e,align:"left"}),u.jsx(Fn,{editor:e,align:"center"}),u.jsx(Fn,{editor:e,align:"right"}),u.jsx(Fn,{editor:e,align:"justify"}),u.jsx(ht,{}),u.jsx(Wv,{editor:e}),u.jsx(Gv,{editor:e}),u.jsx(Yv,{editor:e}),u.jsx(Jv,{editor:e}),u.jsx(ht,{}),u.jsx(Qv,{mode:t,onModeChange:n})]})})}var t2=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:o})=>new Q.Plugin({key:e||new Q.PluginKey("fileHandler"),props:{handleDrop(s,i){var a,l;if(!r||(a=i.dataTransfer)!=null&&a.types.includes("application/x-prosemirror-slice")||!((l=i.dataTransfer)!=null&&l.files.length))return!1;const c=s.posAtCoords({left:i.clientX,top:i.clientY});let d=Array.from(i.dataTransfer.files);return o&&(d=d.filter(f=>o.includes(f.type))),d.length===0?!1:(i.preventDefault(),i.stopPropagation(),r(t,d,c?.pos||0),!0)},handlePaste(s,i){var a;if(!n||!((a=i.clipboardData)!=null&&a.files.length))return!1;let l=Array.from(i.clipboardData.files);const c=i.clipboardData.getData("text/html");return o&&(l=l.filter(d=>o.includes(d.type))),!(l.length===0||(i.preventDefault(),i.stopPropagation(),n(t,l,c),c.length>0))}}}),n2=w.Extension.create({name:"fileHandler",addOptions(){return{onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0}},addProseMirrorPlugins(){return[t2({key:new Q.PluginKey(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}}),r2=n2,o2=w.Node.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
41
|
+
`)},t1=0,pn=[];function n1(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),o=y.useState(t1++)[0],s=y.useState(hu)[0],i=y.useRef(e);y.useEffect(function(){i.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=xm([e.lockRef.current],(e.shards||[]).map(vl),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=y.useCallback(function(g,b){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var v=Mr(g),C=n.current,_="deltaX"in g?g.deltaX:C[0]-v[0],S="deltaY"in g?g.deltaY:C[1]-v[1],N,A=g.target,R=Math.abs(_)>Math.abs(S)?"h":"v";if("touches"in g&&R==="h"&&A.type==="range")return!1;var O=window.getSelection(),D=O&&O.anchorNode,j=D?D===A||D.contains(A):!1;if(j)return!1;var Y=ml(R,A);if(!Y)return!0;if(Y?N=R:(N=R==="v"?"h":"v",Y=ml(R,A)),!Y)return!1;if(!r.current&&"changedTouches"in g&&(_||S)&&(r.current=N),!N)return!0;var J=r.current||N;return Jm(J,b,g,J==="h"?_:S)},[]),l=y.useCallback(function(g){var b=g;if(!(!pn.length||pn[pn.length-1]!==s)){var v="deltaY"in b?bl(b):Mr(b),C=t.current.filter(function(N){return N.name===b.type&&(N.target===b.target||b.target===N.shadowParent)&&Qm(N.delta,v)})[0];if(C&&C.should){b.cancelable&&b.preventDefault();return}if(!C){var _=(i.current.shards||[]).map(vl).filter(Boolean).filter(function(N){return N.contains(b.target)}),S=_.length>0?a(b,_[0]):!i.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),c=y.useCallback(function(g,b,v,C){var _={name:g,delta:b,target:v,should:C,shadowParent:r1(v)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(S){return S!==_})},1)},[]),d=y.useCallback(function(g){n.current=Mr(g),r.current=void 0},[]),f=y.useCallback(function(g){c(g.type,bl(g),g.target,a(g,e.lockRef.current))},[]),h=y.useCallback(function(g){c(g.type,Mr(g),g.target,a(g,e.lockRef.current))},[]);y.useEffect(function(){return pn.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,fn),document.addEventListener("touchmove",l,fn),document.addEventListener("touchstart",d,fn),function(){pn=pn.filter(function(g){return g!==s}),document.removeEventListener("wheel",l,fn),document.removeEventListener("touchmove",l,fn),document.removeEventListener("touchstart",d,fn)}},[]);var p=e.removeScrollBar,m=e.inert;return y.createElement(y.Fragment,null,m?y.createElement(s,{styles:e1(o)}):null,p?y.createElement(Km,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function r1(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const o1=Om(pu,n1);var Ji=y.forwardRef(function(e,t){return y.createElement(ns,ft({},e,{ref:t,sideCar:o1}))});Ji.classNames=ns.classNames;var rs="Popover",[vu]=Rn(rs,[es]),dr=es(),[s1,Ut]=vu(rs),yu=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=dr(t),l=y.useRef(null),[c,d]=y.useState(!1),[f,h]=ts({prop:r,defaultProp:o??!1,onChange:s,caller:rs});return u.jsx(qi,{...a,children:u.jsx(s1,{scope:t,contentId:_n(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:y.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:c,onCustomAnchorAdd:y.useCallback(()=>d(!0),[]),onCustomAnchorRemove:y.useCallback(()=>d(!1),[]),modal:i,children:n})})};yu.displayName=rs;var Eu="PopoverAnchor",i1=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ut(Eu,n),s=dr(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return y.useEffect(()=>(i(),()=>a()),[i,a]),u.jsx(Yi,{...s,...r,ref:t})});i1.displayName=Eu;var Cu="PopoverTrigger",wu=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ut(Cu,n),s=dr(n),i=Oe(t,o.triggerRef),a=u.jsx(Re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Au(o.open),...r,ref:i,onClick:ae(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:u.jsx(Yi,{asChild:!0,...s,children:a})});wu.displayName=Cu;var Qi="PopoverPortal",[a1,l1]=vu(Qi,{forceMount:void 0}),xu=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Ut(Qi,t);return u.jsx(a1,{scope:t,forceMount:n,children:u.jsx(on,{present:n||s.open,children:u.jsx(Xi,{asChild:!0,container:o,children:r})})})};xu.displayName=Qi;var Sn="PopoverContent",_u=y.forwardRef((e,t)=>{const n=l1(Sn,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Ut(Sn,e.__scopePopover);return u.jsx(on,{present:r||s.open,children:s.modal?u.jsx(u1,{...o,ref:t}):u.jsx(d1,{...o,ref:t})})});_u.displayName=Sn;var c1=tr("PopoverContent.RemoveScroll"),u1=y.forwardRef((e,t)=>{const n=Ut(Sn,e.__scopePopover),r=y.useRef(null),o=Oe(t,r),s=y.useRef(!1);return y.useEffect(()=>{const i=r.current;if(i)return uu(i)},[]),u.jsx(Ji,{as:c1,allowPinchZoom:!0,children:u.jsx(Su,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ae(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:ae(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ae(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),d1=y.forwardRef((e,t)=>{const n=Ut(Sn,e.__scopePopover),r=y.useRef(!1),o=y.useRef(!1);return u.jsx(Su,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Su=y.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...f}=e,h=Ut(Sn,n),p=dr(n);return Lc(),u.jsx($i,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:u.jsx(Fi,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1),children:u.jsx(au,{"data-state":Au(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Nu="PopoverClose",f1=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ut(Nu,n);return u.jsx(Re.button,{type:"button",...r,ref:t,onClick:ae(e.onClick,()=>o.onOpenChange(!1))})});f1.displayName=Nu;var p1="PopoverArrow",h1=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=dr(n);return u.jsx(lu,{...o,...r,ref:t})});h1.displayName=p1;function Au(e){return e?"open":"closed"}var g1=yu,m1=wu,b1=xu,v1=_u;function jt({...e}){return u.jsx(g1,{...e})}function zt({...e}){return u.jsx(m1,{...e})}function Vt({className:e,align:t="center",sideOffset:n=4,...r}){return u.jsx(b1,{children:u.jsx(v1,{align:t,sideOffset:n,className:ke("tiptap-popover",e),...r})})}var y1=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ui=y1.join(","),Tu=typeof Element>"u",nr=Tu?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ao=!Tu&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},lo=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):lo(t.parentNode));return i},E1=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},C1=function(t,n,r){if(lo(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(ui));return n&&nr.call(t,ui)&&o.unshift(t),o=o.filter(r),o},di=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!lo(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=di(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var d=nr.call(i,ui);d&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var f=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),h=!lo(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(f&&h){var p=di(f===!0?i.children:f.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:i,candidates:p})}else s.unshift.apply(s,i.children)}}return o},Ru=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Mu=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||E1(t))&&!Ru(t)?0:t.tabIndex},w1=function(t,n){var r=Mu(t);return r<0&&n&&!Ru(t)?0:r},x1=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ku=function(t){return t.tagName==="INPUT"},_1=function(t){return ku(t)&&t.type==="hidden"},S1=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},N1=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},A1=function(t){if(!t.name)return!0;var n=t.form||ao(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=N1(o,t.form);return!s||s===t},T1=function(t){return ku(t)&&t.type==="radio"},R1=function(t){return T1(t)&&!A1(t)},M1=function(t){var n,r=t&&ao(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var c,d,f;r=ao(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((d=o)!==null&&d!==void 0&&(f=d.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return s},yl=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},k1=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=nr.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(nr.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var c=t.parentElement,d=ao(t);if(c&&!c.shadowRoot&&o(c)===!0)return yl(t);t.assignedSlot?t=t.assignedSlot:!c&&d!==t.ownerDocument?t=d.host:t=c}t=l}if(M1(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return yl(t);return!1},O1=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return nr.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},I1=function(t,n){return!(n.disabled||_1(n)||k1(n,t)||S1(n)||O1(n))},El=function(t,n){return!(R1(n)||Mu(n)<0||!I1(t,n))},L1=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ou=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=w1(a,i),c=i?Ou(o.candidates):a;l===0?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:c})}),r.sort(x1).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Iu=function(t,n){n=n||{};var r;return n.getShadowRoot?r=di([t],n.includeContainer,{filter:El.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:L1}):r=C1(t,n.includeContainer,El.bind(null,n)),Ou(r)};function P1(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function D1(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Lu(){return/apple/i.test(navigator.vendor)}function B1(){return P1().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function H1(){return D1().includes("jsdom/")}const Cl="data-floating-ui-focusable",F1="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function fi(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Nn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ai(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function hn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ms(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function $1(e){return e.matches("html,body")}function mt(e){return e?.ownerDocument||document}function U1(e){return et(e)&&e.matches(F1)}function j1(e){if(!e||H1())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function z1(e){return e?e.hasAttribute(Cl)?e:e.querySelector("["+Cl+"]")||e:null}function qr(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...qr(e,o.id,n)])}function V1(e){return"nativeEvent"in e}function pi(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var K1=typeof document<"u",W1=function(){},rt=K1?x.useLayoutEffect:W1;const G1={...y};function kr(e){const t=y.useRef(e);return rt(()=>{t.current=e}),t}const Z1=G1.useInsertionEffect,q1=Z1||(e=>e());function pt(e){const t=y.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return q1(()=>{t.current=e}),y.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Pu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Du(e,t){const n=Iu(e,Pu()),r=n.length;if(r===0)return;const o=fi(mt(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function Y1(e){return Du(mt(e).body,1)||e}function X1(e){return Du(mt(e).body,-1)||e}function ks(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Nn(n,r)}function J1(e){Iu(e,Pu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function wl(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Bu(e){const t=y.useRef(void 0),n=y.useCallback(r=>{const o=e.map(s=>{if(s!=null){if(typeof s=="function"){const i=s,a=i(r);return typeof a=="function"?a:()=>{i(null)}}return s.current=r,()=>{s.current=null}}});return()=>{o.forEach(s=>s?.())}},e);return y.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const Q1="data-floating-ui-focusable",xl="active",_l="selected",eb={...y};let Sl=!1,tb=0;const Nl=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+tb++;function nb(){const[e,t]=y.useState(()=>Sl?Nl():void 0);return rt(()=>{e==null&&t(Nl())},[]),y.useEffect(()=>{Sl=!0},[]),e}const rb=eb.useId,ea=rb||nb;let hi;process.env.NODE_ENV!=="production"&&(hi=new Set);function ob(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=hi)!=null&&e.has(o))){var s;(s=hi)==null||s.add(o),console.error(o)}}function sb(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const ib=y.createContext(null),ab=y.createContext(null),ta=()=>{var e;return((e=y.useContext(ib))==null?void 0:e.id)||null},na=()=>y.useContext(ab);function fr(e){return"data-floating-ui-"+e}function Ye(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Al=fr("safe-polygon");function Os(e,t,n){if(n&&!pi(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function Is(e){return typeof e=="function"?e():e}function lb(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:d=!1,restMs:f=0,move:h=!0}=t,p=na(),m=ta(),g=kr(c),b=kr(l),v=kr(n),C=kr(f),_=y.useRef(),S=y.useRef(-1),N=y.useRef(),A=y.useRef(-1),R=y.useRef(!0),O=y.useRef(!1),D=y.useRef(()=>{}),j=y.useRef(!1),Y=pt(()=>{var H;const T=(H=o.current.openEvent)==null?void 0:H.type;return T?.includes("mouse")&&T!=="mousedown"});y.useEffect(()=>{if(!a)return;function H(T){let{open:k}=T;k||(Ye(S),Ye(A),R.current=!0,j.current=!1)}return s.on("openchange",H),()=>{s.off("openchange",H)}},[a,s]),y.useEffect(()=>{if(!a||!g.current||!n)return;function H(k){Y()&&r(!1,k,"hover")}const T=mt(i.floating).documentElement;return T.addEventListener("mouseleave",H),()=>{T.removeEventListener("mouseleave",H)}},[i.floating,n,r,a,g,Y]);const J=y.useCallback(function(H,T,k){T===void 0&&(T=!0),k===void 0&&(k="hover");const K=Os(b.current,"close",_.current);K&&!N.current?(Ye(S),S.current=window.setTimeout(()=>r(!1,H,k),K)):T&&(Ye(S),r(!1,H,k))},[b,r]),X=pt(()=>{D.current(),N.current=void 0}),I=pt(()=>{if(O.current){const H=mt(i.floating).body;H.style.pointerEvents="",H.removeAttribute(Al),O.current=!1}}),$=pt(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);y.useEffect(()=>{if(!a)return;function H(Z){if(Ye(S),R.current=!1,d&&!pi(_.current)||Is(C.current)>0&&!Os(b.current,"open"))return;const ce=Os(b.current,"open",_.current);ce?S.current=window.setTimeout(()=>{v.current||r(!0,Z,"hover")},ce):n||r(!0,Z,"hover")}function T(Z){if($()){I();return}D.current();const ce=mt(i.floating);if(Ye(A),j.current=!1,g.current&&o.current.floatingContext){n||Ye(S),N.current=g.current({...o.current.floatingContext,tree:p,x:Z.clientX,y:Z.clientY,onClose(){I(),X(),$()||J(Z,!0,"safe-polygon")}});const he=N.current;ce.addEventListener("mousemove",he),D.current=()=>{ce.removeEventListener("mousemove",he)};return}(_.current!=="touch"||!Nn(i.floating,Z.relatedTarget))&&J(Z)}function k(Z){$()||o.current.floatingContext&&(g.current==null||g.current({...o.current.floatingContext,tree:p,x:Z.clientX,y:Z.clientY,onClose(){I(),X(),$()||J(Z)}})(Z))}function K(){Ye(S)}function oe(Z){$()||J(Z,!1)}if(be(i.domReference)){const Z=i.domReference,ce=i.floating;return n&&Z.addEventListener("mouseleave",k),h&&Z.addEventListener("mousemove",H,{once:!0}),Z.addEventListener("mouseenter",H),Z.addEventListener("mouseleave",T),ce&&(ce.addEventListener("mouseleave",k),ce.addEventListener("mouseenter",K),ce.addEventListener("mouseleave",oe)),()=>{n&&Z.removeEventListener("mouseleave",k),h&&Z.removeEventListener("mousemove",H),Z.removeEventListener("mouseenter",H),Z.removeEventListener("mouseleave",T),ce&&(ce.removeEventListener("mouseleave",k),ce.removeEventListener("mouseenter",K),ce.removeEventListener("mouseleave",oe))}}},[i,a,e,d,h,J,X,I,r,n,v,p,b,g,o,$,C]),rt(()=>{var H;if(a&&n&&(H=g.current)!=null&&(H=H.__options)!=null&&H.blockPointerEvents&&Y()){O.current=!0;const k=i.floating;if(be(i.domReference)&&k){var T;const K=mt(i.floating).body;K.setAttribute(Al,"");const oe=i.domReference,Z=p==null||(T=p.nodesRef.current.find(ce=>ce.id===m))==null||(T=T.context)==null?void 0:T.elements.floating;return Z&&(Z.style.pointerEvents=""),K.style.pointerEvents="none",oe.style.pointerEvents="auto",k.style.pointerEvents="auto",()=>{K.style.pointerEvents="",oe.style.pointerEvents="",k.style.pointerEvents=""}}}},[a,n,m,i,p,g,Y]),rt(()=>{n||(_.current=void 0,j.current=!1,X(),I())},[n,X,I]),y.useEffect(()=>()=>{X(),Ye(S),Ye(A),I()},[a,i.domReference,X,I]);const U=y.useMemo(()=>{function H(T){_.current=T.pointerType}return{onPointerDown:H,onPointerEnter:H,onMouseMove(T){const{nativeEvent:k}=T;function K(){!R.current&&!v.current&&r(!0,k,"hover")}d&&!pi(_.current)||n||Is(C.current)===0||j.current&&T.movementX**2+T.movementY**2<2||(Ye(A),_.current==="touch"?K():(j.current=!0,A.current=window.setTimeout(K,Is(C.current))))}}},[d,r,n,v,C]);return y.useMemo(()=>a?{reference:U}:{},[a,U])}const Tl=()=>{},cb=y.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Tl,setState:Tl,isInstantPhase:!1});function ub(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,s]=y.useReducer((l,c)=>({...l,...c}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),i=y.useRef(null),a=y.useCallback(l=>{s({currentId:l})},[]);return rt(()=>{o.currentId?i.current===null?i.current=o.currentId:o.isInstantPhase||s({isInstantPhase:!0}):(o.isInstantPhase&&s({isInstantPhase:!1}),i.current=null)},[o.currentId,o.isInstantPhase]),u.jsx(cb.Provider,{value:y.useMemo(()=>({...o,setState:s,setCurrentId:a}),[o,a]),children:t})}const db={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Rl=y.forwardRef(function(t,n){const[r,o]=y.useState();rt(()=>{Lu()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[fr("focus-guard")]:"",style:db};return u.jsx("span",{...t,...s})}),fb={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Hu=y.createContext(null),Ml=fr("portal");function pb(e){e===void 0&&(e={});const{id:t,root:n}=e,r=ea(),o=gb(),[s,i]=y.useState(null),a=y.useRef(null);return rt(()=>()=>{s?.remove(),queueMicrotask(()=>{a.current=null})},[s]),rt(()=>{if(!r||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const c=document.createElement("div");c.id=r,c.setAttribute(Ml,""),l.appendChild(c),a.current=c,i(c)},[t,r]),rt(()=>{if(n===null||!r||a.current)return;let l=n||o?.portalNode;l&&!Vi(l)&&(l=l.current),l=l||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,l.appendChild(c));const d=document.createElement("div");d.id=r,d.setAttribute(Ml,""),l=c||l,l.appendChild(d),a.current=d,i(d)},[t,n,r,o]),s}function hb(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=pb({id:n,root:r}),[i,a]=y.useState(null),l=y.useRef(null),c=y.useRef(null),d=y.useRef(null),f=y.useRef(null),h=i?.modal,p=i?.open,m=!!i&&!i.modal&&i.open&&o&&!!(r||s);return y.useEffect(()=>{if(!s||!o||h)return;function g(b){s&&ks(b)&&(b.type==="focusin"?wl:J1)(s)}return s.addEventListener("focusin",g,!0),s.addEventListener("focusout",g,!0),()=>{s.removeEventListener("focusin",g,!0),s.removeEventListener("focusout",g,!0)}},[s,o,h]),y.useEffect(()=>{s&&(p||wl(s))},[p,s]),u.jsxs(Hu.Provider,{value:y.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:f,portalNode:s,setFocusManagerState:a}),[o,s]),children:[m&&s&&u.jsx(Rl,{"data-type":"outside",ref:l,onFocus:g=>{if(ks(g,s)){var b;(b=d.current)==null||b.focus()}else{const v=i?i.domReference:null,C=X1(v);C?.focus()}}}),m&&s&&u.jsx("span",{"aria-owns":s.id,style:fb}),s&&Pi.createPortal(t,s),m&&s&&u.jsx(Rl,{"data-type":"outside",ref:c,onFocus:g=>{if(ks(g,s)){var b;(b=f.current)==null||b.focus()}else{const v=i?i.domReference:null,C=Y1(v);C?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,g.nativeEvent,"focus-out")}}})]})}const gb=()=>y.useContext(Hu),mb={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},bb={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},kl=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function vb(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:p,capture:m}=t,g=na(),b=pt(typeof l=="function"?l:()=>!1),v=typeof l=="function"?b:l,C=y.useRef(!1),{escapeKey:_,outsidePress:S}=kl(p),{escapeKey:N,outsidePress:A}=kl(m),R=y.useRef(!1),O=pt(I=>{var $;if(!n||!i||!a||I.key!=="Escape"||R.current)return;const U=($=s.current.floatingContext)==null?void 0:$.nodeId,H=g?qr(g.nodesRef.current,U):[];if(!_&&(I.stopPropagation(),H.length>0)){let T=!0;if(H.forEach(k=>{var K;if((K=k.context)!=null&&K.open&&!k.context.dataRef.current.__escapeKeyBubbles){T=!1;return}}),!T)return}r(!1,V1(I)?I.nativeEvent:I,"escape-key")}),D=pt(I=>{var $;const U=()=>{var H;O(I),(H=hn(I))==null||H.removeEventListener("keydown",U)};($=hn(I))==null||$.addEventListener("keydown",U)}),j=pt(I=>{var $;const U=s.current.insideReactTree;s.current.insideReactTree=!1;const H=C.current;if(C.current=!1,c==="click"&&H||U||typeof v=="function"&&!v(I))return;const T=hn(I),k="["+fr("inert")+"]",K=mt(o.floating).querySelectorAll(k);let oe=be(T)?T:null;for(;oe&&!_t(oe);){const he=At(oe);if(_t(he)||!be(he))break;oe=he}if(K.length&&be(T)&&!$1(T)&&!Nn(T,o.floating)&&Array.from(K).every(he=>!Nn(oe,he)))return;if(et(T)&&X){const he=_t(T),ye=Qe(T),ue=/auto|scroll/,Ze=he||ue.test(ye.overflowX),an=he||ue.test(ye.overflowY),st=Ze&&T.clientWidth>0&&T.scrollWidth>T.clientWidth,Wt=an&&T.clientHeight>0&&T.scrollHeight>T.clientHeight,Gt=ye.direction==="rtl",it=Wt&&(Gt?I.offsetX<=T.offsetWidth-T.clientWidth:I.offsetX>T.clientWidth),Ln=st&&I.offsetY>T.clientHeight;if(it||Ln)return}const Z=($=s.current.floatingContext)==null?void 0:$.nodeId,ce=g&&qr(g.nodesRef.current,Z).some(he=>{var ye;return Ms(I,(ye=he.context)==null?void 0:ye.elements.floating)});if(Ms(I,o.floating)||Ms(I,o.domReference)||ce)return;const Ke=g?qr(g.nodesRef.current,Z):[];if(Ke.length>0){let he=!0;if(Ke.forEach(ye=>{var ue;if((ue=ye.context)!=null&&ue.open&&!ye.context.dataRef.current.__outsidePressBubbles){he=!1;return}}),!he)return}r(!1,I,"outside-press")}),Y=pt(I=>{var $;const U=()=>{var H;j(I),(H=hn(I))==null||H.removeEventListener(c,U)};($=hn(I))==null||$.addEventListener(c,U)});y.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=_,s.current.__outsidePressBubbles=S;let I=-1;function $(K){r(!1,K,"ancestor-scroll")}function U(){window.clearTimeout(I),R.current=!0}function H(){I=window.setTimeout(()=>{R.current=!1},Xo()?5:0)}const T=mt(o.floating);a&&(T.addEventListener("keydown",N?D:O,N),T.addEventListener("compositionstart",U),T.addEventListener("compositionend",H)),v&&T.addEventListener(c,A?Y:j,A);let k=[];return h&&(be(o.domReference)&&(k=Bt(o.domReference)),be(o.floating)&&(k=k.concat(Bt(o.floating))),!be(o.reference)&&o.reference&&o.reference.contextElement&&(k=k.concat(Bt(o.reference.contextElement)))),k=k.filter(K=>{var oe;return K!==((oe=T.defaultView)==null?void 0:oe.visualViewport)}),k.forEach(K=>{K.addEventListener("scroll",$,{passive:!0})}),()=>{a&&(T.removeEventListener("keydown",N?D:O,N),T.removeEventListener("compositionstart",U),T.removeEventListener("compositionend",H)),v&&T.removeEventListener(c,A?Y:j,A),k.forEach(K=>{K.removeEventListener("scroll",$)}),window.clearTimeout(I)}},[s,o,a,v,c,n,r,h,i,_,S,O,N,D,j,A,Y]),y.useEffect(()=>{s.current.insideReactTree=!1},[s,v,c]);const J=y.useMemo(()=>({onKeyDown:O,...d&&{[mb[f]]:I=>{r(!1,I.nativeEvent,"reference-press")},...f!=="click"&&{onClick(I){r(!1,I.nativeEvent,"reference-press")}}}}),[O,r,d,f]),X=y.useMemo(()=>{function I($){$.button===0&&(C.current=!0)}return{onKeyDown:O,onMouseDown:I,onMouseUp:I,[bb[c]]:()=>{s.current.insideReactTree=!0}}},[O,c,s]);return y.useMemo(()=>i?{reference:J,floating:X}:{},[i,J,X])}function yb(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=ea(),s=y.useRef({}),[i]=y.useState(()=>sb()),a=ta()!=null;if(process.env.NODE_ENV!=="production"){const p=r.reference;p&&!be(p)&&ob("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=y.useState(r.reference),d=pt((p,m,g)=>{s.current.openEvent=p?m:void 0,i.emit("openchange",{open:p,event:m,reason:g,nested:a}),n?.(p,m,g)}),f=y.useMemo(()=>({setPositionReference:c}),[]),h=y.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return y.useMemo(()=>({dataRef:s,open:t,onOpenChange:d,elements:h,events:i,floatingId:o,refs:f}),[t,d,h,i,o,f])}function Eb(e){e===void 0&&(e={});const{nodeId:t}=e,n=yb({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=y.useState(null),[a,l]=y.useState(null),d=o?.domReference||s,f=y.useRef(null),h=na();rt(()=>{d&&(f.current=d)},[d]);const p=Gc({...e,elements:{...o,...a&&{reference:a}}}),m=y.useCallback(_=>{const S=be(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),getClientRects:()=>_.getClientRects(),contextElement:_}:_;l(S),p.refs.setReference(S)},[p.refs]),g=y.useCallback(_=>{(be(_)||_===null)&&(f.current=_,i(_)),(be(p.refs.reference.current)||p.refs.reference.current===null||_!==null&&!be(_))&&p.refs.setReference(_)},[p.refs]),b=y.useMemo(()=>({...p.refs,setReference:g,setPositionReference:m,domReference:f}),[p.refs,g,m]),v=y.useMemo(()=>({...p.elements,domReference:d}),[p.elements,d]),C=y.useMemo(()=>({...p,...r,refs:b,elements:v,nodeId:t}),[p,b,v,t,r]);return rt(()=>{r.dataRef.current.floatingContext=C;const _=h?.nodesRef.current.find(S=>S.id===t);_&&(_.context=C)}),y.useMemo(()=>({...p,context:C,refs:b,elements:v}),[p,b,v,C])}function Ls(){return B1()&&Lu()}function Cb(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=y.useRef(!1),d=y.useRef(-1),f=y.useRef(!0);y.useEffect(()=>{if(!a)return;const p=Ve(i.domReference);function m(){!n&&et(i.domReference)&&i.domReference===fi(mt(i.domReference))&&(c.current=!0)}function g(){f.current=!0}function b(){f.current=!1}return p.addEventListener("blur",m),Ls()&&(p.addEventListener("keydown",g,!0),p.addEventListener("pointerdown",b,!0)),()=>{p.removeEventListener("blur",m),Ls()&&(p.removeEventListener("keydown",g,!0),p.removeEventListener("pointerdown",b,!0))}},[i.domReference,n,a]),y.useEffect(()=>{if(!a)return;function p(m){let{reason:g}=m;(g==="reference-press"||g==="escape-key")&&(c.current=!0)}return o.on("openchange",p),()=>{o.off("openchange",p)}},[o,a]),y.useEffect(()=>()=>{Ye(d)},[]);const h=y.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(p){if(c.current)return;const m=hn(p.nativeEvent);if(l&&be(m)){if(Ls()&&!p.relatedTarget){if(!f.current&&!U1(m))return}else if(!j1(m))return}r(!0,p.nativeEvent,"focus")},onBlur(p){c.current=!1;const m=p.relatedTarget,g=p.nativeEvent,b=be(m)&&m.hasAttribute(fr("focus-guard"))&&m.getAttribute("data-type")==="outside";d.current=window.setTimeout(()=>{var v;const C=fi(i.domReference?i.domReference.ownerDocument:document);!m&&C===i.domReference||Nn((v=s.current.floatingContext)==null?void 0:v.refs.floating.current,C)||Nn(i.domReference,C)||b||r(!1,g,"focus")})}}),[s,i.domReference,r,l]);return y.useMemo(()=>a?{reference:h}:{},[a,h])}function Ps(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[xl]:i,[_l]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1,[Q1]:""},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,d]=l;if(!(o&&[xl,_l].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof d=="function"){var f;(f=r.get(c))==null||f.push(d),i[c]=function(){for(var h,p=arguments.length,m=new Array(p),g=0;g<p;g++)m[g]=arguments[g];return(h=r.get(c))==null?void 0:h.map(b=>b(...m)).find(b=>b!==void 0)}}}else i[c]=d}),i),{})}}function wb(e){e===void 0&&(e=[]);const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),o=y.useCallback(a=>Ps(a,e,"reference"),t),s=y.useCallback(a=>Ps(a,e,"floating"),n),i=y.useCallback(a=>Ps(a,e,"item"),r);return y.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const xb=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function _b(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:s,floatingId:i}=e,{enabled:a=!0,role:l="dialog"}=t,c=ea(),d=((n=s.domReference)==null?void 0:n.id)||c,f=y.useMemo(()=>{var C;return((C=z1(s.floating))==null?void 0:C.id)||i},[s.floating,i]),h=(r=xb.get(l))!=null?r:l,m=ta()!=null,g=y.useMemo(()=>h==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":h==="alertdialog"?"dialog":h,"aria-controls":o?f:void 0,...h==="listbox"&&{role:"combobox"},...h==="menu"&&{id:d},...h==="menu"&&m&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[h,f,m,o,d,l]),b=y.useMemo(()=>{const C={id:f,...h&&{role:h}};return h==="tooltip"||l==="label"?C:{...C,...h==="menu"&&{"aria-labelledby":d}}},[h,f,d,l]),v=y.useCallback(C=>{let{active:_,selected:S}=C;const N={role:"option",..._&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{...N,"aria-selected":S}}return{}},[f,l]);return y.useMemo(()=>a?{reference:g,floating:b,item:v}:{},[a,g,b,v])}function Sb({initialOpen:e=!1,placement:t="top",open:n,onOpenChange:r,delay:o=600,closeDelay:s=0}={}){const[i,a]=x.useState(e),l=n??i,c=r??a,d=Eb({placement:t,open:l,onOpenChange:c,whileElementsMounted:Kc,middleware:[Zc(4),Yc({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:4}),qc({padding:4})]}),f=d.context,h=lb(f,{mouseOnly:!0,move:!1,restMs:o,enabled:n==null,delay:{close:s}}),p=Cb(f,{enabled:n==null}),m=vb(f),g=_b(f,{role:"tooltip"}),b=wb([h,p,m,g]);return x.useMemo(()=>({open:l,setOpen:c,...b,...d}),[l,c,b,d])}const gi=x.createContext(null);function Fu(){const e=x.useContext(gi);if(e==null)throw new Error("Tooltip components must be wrapped in <TooltipProvider />");return e}function $u({children:e,...t}){const n=Sb(t);return t.useDelayGroup?u.jsx(ub,{delay:{open:t.delay??0,close:t.closeDelay??0},timeoutMs:t.timeout,children:u.jsx(gi.Provider,{value:n,children:e})}):u.jsx(gi.Provider,{value:n,children:e})}const Uu=x.forwardRef(function({children:t,asChild:n=!1,...r},o){const s=Fu(),i=x.isValidElement(t)?parseInt(x.version,10)>=19?t.props.ref:t.ref:void 0,a=Bu([s.refs.setReference,o,i]);if(n&&x.isValidElement(t)){const l={"data-tooltip-state":s.open?"open":"closed"};return x.cloneElement(t,s.getReferenceProps({ref:a,...r,...typeof t.props=="object"?t.props:{},...l}))}return u.jsx("button",{ref:a,"data-tooltip-state":s.open?"open":"closed",...s.getReferenceProps(r),children:t})}),ju=x.forwardRef(function({style:t,children:n,portal:r=!0,portalProps:o={},...s},i){const a=Fu(),l=Bu([a.refs.setFloating,i]);if(!a.open)return null;const c=u.jsx("div",{ref:l,style:{...a.floatingStyles,...t},...a.getFloatingProps(s),className:"tiptap-tooltip",children:n});return r?u.jsx(hb,{...o,children:c}):c});$u.displayName="Tooltip";Uu.displayName="TooltipTrigger";ju.displayName="TooltipContent";const Nb=({shortcuts:e})=>e.length===0?null:u.jsx("div",{children:e.map((t,n)=>u.jsxs(x.Fragment,{children:[n>0&&u.jsx("kbd",{children:"+"}),u.jsx("kbd",{children:t})]},n))}),V=x.forwardRef(({className:e,children:t,tooltip:n,showTooltip:r=!0,shortcutKeys:o,variant:s,size:i,...a},l)=>{const c=x.useMemo(()=>Di({shortcutKeys:o}),[o]);return!n||!r?u.jsx("button",{"data-slot":"tiptap-button",className:ke("tiptap-button",e),ref:l,"data-style":s,"data-size":i,...a,children:t}):u.jsxs($u,{delay:200,children:[u.jsx(Uu,{"data-slot":"tiptap-button",className:ke("tiptap-button",e),ref:l,"data-style":s,"data-size":i,...a,children:t}),u.jsxs(ju,{children:[n,u.jsx(Nb,{shortcuts:c})]})]})});V.displayName="Button";const Fe=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ke("tiptap-card",e),...t}));Fe.displayName="Card";const Ab=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ke("tiptap-card-header",e),...t}));Ab.displayName="CardHeader";const $e=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ke("tiptap-card-body",e),...t}));$e.displayName="CardBody";const Be=x.forwardRef(({className:e,orientation:t="vertical",...n},r)=>u.jsx("div",{ref:r,"data-orientation":t,className:ke("tiptap-card-item-group",e),...n}));Be.displayName="CardItemGroup";const Gn=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ke("tiptap-card-group-label",e),...t}));Gn.displayName="CardGroupLabel";const Tb=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ke("tiptap-card-footer",e),...t}));Tb.displayName="CardFooter";function Rb(e){const n=e.storage.pages;return!n||!("activeEditor"in n)?null:n.activeEditor??null}function Ue(e){const t=xh(),n=e??t,[r,o]=x.useState(null);return x.useEffect(()=>{if(!n){o(null);return}const i=()=>o(Rb(n));return i(),n.on("update",i),n.on("selectionUpdate",i),()=>{n.off("update",i),n.off("selectionUpdate",i)}},[n]),x.useEffect(()=>{if(!r)return;const i=()=>o(null);return r.on("destroy",i),()=>{r.off("destroy",i)}},[r]),ot.useEditorState({editor:r??n,selector(i){return!i.editor||i.editor.isDestroyed?{editor:null,editorState:void 0,canCommand:void 0}:{editor:i.editor,editorState:i.editor.state,canCommand:i.editor.can}}})??{editor:null}}const Mb=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})),kb=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})),zu=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z"})),Vu=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M12 3C12.5523 3 13 3.44772 13 4L12.9998 11.9998C13.8355 11.372 14.8743 11 16 11C18.7614 11 21 13.2386 21 16C21 18.7614 18.7614 21 16 21C14.9681 21 14.0092 20.6874 13.2129 20.1518L13 20C13 20.5523 12.5523 21 12 21H6C5.44772 21 5 20.5523 5 20V4C5 3.44772 5.44772 3 6 3H12ZM11 5H7V19H11V5ZM19 15H13V17H19V15Z"})),Ku=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M20 5C20.5523 5 21 5.44772 21 6V12C21 12.5523 20.5523 13 20 13C20.628 13.8355 21 14.8743 21 16C21 18.7614 18.7614 21 16 21C13.2386 21 11 18.7614 11 16C11 14.8743 11.372 13.8355 11.9998 12.9998L4 13C3.44772 13 3 12.5523 3 12V6C3 5.44772 3.44772 5 4 5H20ZM13 15V17H19V15H13ZM19 7H5V11H19V7Z"})),Wu=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H14C13.4477 21 13 20.5523 13 20V4C13 3.44772 13.4477 3 14 3H20ZM19 5H15V19H19V5ZM6 7C8.76142 7 11 9.23858 11 12C11 14.7614 8.76142 17 6 17C3.23858 17 1 14.7614 1 12C1 9.23858 3.23858 7 6 7ZM7 9H5V10.999L3 11V13L5 12.999V15H7V12.999L9 13V11L7 10.999V9Z"})),Gu=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M10 3C10.5523 3 11 3.44772 11 4V20C11 20.5523 10.5523 21 10 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H10ZM9 5H5V19H9V5ZM18 7C20.7614 7 23 9.23858 23 12C23 14.7614 20.7614 17 18 17C15.2386 17 13 14.7614 13 12C13 9.23858 15.2386 7 18 7ZM19 9H17V10.999L15 11V13L17 12.999V15H19V12.999L21 13V11L19 10.999V9Z"})),Zu=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M12 13C14.7614 13 17 15.2386 17 18C17 20.7614 14.7614 23 12 23C9.23858 23 7 20.7614 7 18C7 15.2386 9.23858 13 12 13ZM13 15H11V16.999L9 17V19L11 18.999V21H13V18.999L15 19V17L13 16.999V15ZM20 3C20.5523 3 21 3.44772 21 4V10C21 10.5523 20.5523 11 20 11H4C3.44772 11 3 10.5523 3 10V4C3 3.44772 3.44772 3 4 3H20ZM5 5V9H19V5H5Z"})),qu=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M20 13C20.5523 13 21 13.4477 21 14V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V14C3 13.4477 3.44772 13 4 13H20ZM19 15H5V19H19V15ZM12 1C14.7614 1 17 3.23858 17 6C17 8.76142 14.7614 11 12 11C9.23858 11 7 8.76142 7 6C7 3.23858 9.23858 1 12 1ZM13 3H11V4.999L9 5V7L11 6.999V9H13V6.999L15 7V5L13 4.999V3Z"})),Yu=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M21 3C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H21ZM7 5H4V19H7V5ZM20 5H9V19H20V5Z"})),Xu=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M21 3C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H21ZM4 10V19H20V10H4ZM4 8H20V5H4V8Z"})),Ob=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V10.999H7V9L10 12L7 15V13H5V19H11V17H13V19H19V13H17V15L14 12L17 9V10.999H19V5H13V7H11V5ZM13 13V15H11V13H13ZM13 9V11H11V9H13Z"})),Ju=({color:e="currentColor",size:t=24,className:n,...r})=>x.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...r,className:"remixicon "+(n||"")},x.createElement("path",{d:"M19.2277 18.7323L20.9955 16.9645L22.7632 18.7323C23.7395 19.7086 23.7395 21.2915 22.7632 22.2678C21.7869 23.2441 20.204 23.2441 19.2277 22.2678C18.2514 21.2915 18.2514 19.7086 19.2277 18.7323ZM8.87861 1.07971L20.1923 12.3934C20.5828 12.7839 20.5828 13.4171 20.1923 13.8076L11.707 22.2929C11.3165 22.6834 10.6833 22.6834 10.2928 22.2929L1.80754 13.8076C1.41702 13.4171 1.41702 12.7839 1.80754 12.3934L9.58572 4.61525L7.4644 2.49393L8.87861 1.07971ZM10.9999 6.02946L3.92886 13.1005H18.071L10.9999 6.02946Z"})),Dt=[{name:"Default",color:"#ffffff",contrastColor:"#374151"},{name:"Gray",color:"#f3f4f6",contrastColor:"#6b7280"},{name:"Brown",color:"#f4eef8",contrastColor:"#92400e"},{name:"Orange",color:"#fff7ed",contrastColor:"#ea580c"},{name:"Yellow",color:"#fef9c3",contrastColor:"#ca8a04"},{name:"Green",color:"#dcfce7",contrastColor:"#16a34a"},{name:"Blue",color:"#e0f2fe",contrastColor:"#0284c7"},{name:"Purple",color:"#f3e8ff",contrastColor:"#7c3aed"},{name:"Pink",color:"#fce7f3",contrastColor:"#db2777"},{name:"Red",color:"#ffe4e6",contrastColor:"#dc2626"}],ra=3,Or=({textColorHex:e,backgroundColorHex:t,className:n=""})=>{const r=e??"#374151",o=t??"#ffffff",s=e??"#e5e7eb";return u.jsx("span",{className:n,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1.5rem",height:"1.5rem",borderRadius:"50%",border:`1px solid ${s}`,backgroundColor:o,color:r,fontSize:"0.75rem",fontWeight:700},"aria-hidden":!0,children:"A"})},Qu="color-text-popover-recent",Ib=()=>{try{const e=localStorage.getItem(Qu);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.slice(0,ra):[]}catch{return[]}},Lb=e=>{try{localStorage.setItem(Qu,JSON.stringify(e.slice(0,ra)))}catch{}},ed=x.forwardRef(({editor:e,...t},n)=>{const{editor:r}=Ue(e),[o,s]=x.useState(Ib),i=ot.useEditorState({editor:r??null,selector:p=>{if(!p.editor)return{color:null,backgroundColor:null};const m=p.editor.getAttributes("textStyle");return{color:m.color??null,backgroundColor:m.backgroundColor??null}}}),a=i?.color??null,l=i?.backgroundColor??null,c=x.useCallback((p,m)=>{s(g=>{const b=[{textColor:p,backgroundColor:m},...g.filter(v=>!(v.textColor===p&&v.backgroundColor===m))].slice(0,ra);return Lb(b),b})},[]),d=x.useCallback(p=>{if(!r)return;p===null?r.chain().focus().unsetColor().run():r.chain().focus().setColor(p).run();const m=r.getAttributes("textStyle").backgroundColor??null;c(p,m)},[r,c]),f=x.useCallback(p=>{if(!r)return;p===null?r.chain().focus().unsetBackgroundColor().run():r.chain().focus().setBackgroundColor(p).run();const m=r.getAttributes("textStyle").color??null;c(m,p)},[r,c]),h=x.useCallback(p=>{r&&(p.textColor!==null?r.chain().focus().setColor(p.textColor).run():r.chain().focus().unsetColor().run(),p.backgroundColor!==null?r.chain().focus().setBackgroundColor(p.backgroundColor).run():r.chain().focus().unsetBackgroundColor().run(),c(p.textColor,p.backgroundColor))},[r,c]);return u.jsxs(jt,{children:[u.jsx(zt,{asChild:!0,children:u.jsxs(V,{ref:n,"data-style":"ghost",role:"button",tooltip:"글자 색상",...t,children:[u.jsx(Or,{textColorHex:a,backgroundColorHex:l,className:"tiptap-color-trigger-icon"}),u.jsx(Mb,{className:"tiptap-color-trigger-chevron","aria-hidden":!0})]})}),u.jsx(Vt,{align:"start",children:u.jsx(Fe,{children:u.jsxs($e,{children:[u.jsx(Gn,{children:"Recently Used"}),u.jsx(Be,{orientation:"horizontal",children:o.map((p,m)=>u.jsx(V,{"data-style":"ghost",type:"button",onClick:()=>h(p),"aria-label":`Apply recent color combination ${m+1}`,className:"tiptap-color-recent-button",children:u.jsx(Or,{textColorHex:p.textColor,backgroundColorHex:p.backgroundColor})},`${p.textColor??""}-${p.backgroundColor??""}-${m}`))}),u.jsx(Gn,{children:"Text Color"}),u.jsx(Be,{orientation:"horizontal",children:Dt.slice(0,5).map((p,m)=>{const g=m===0,b=g?null:p.contrastColor,v=a===b||g&&a===null;return u.jsx(V,{"data-style":"ghost",type:"button",onClick:()=>d(b),"aria-label":`Text color: ${p.name}`,"aria-pressed":v,className:"tiptap-color-text-button",children:u.jsx(Or,{textColorHex:b,backgroundColorHex:"#ffffff"})},p.name)})}),u.jsx(Be,{orientation:"horizontal",children:Dt.slice(5,10).map(p=>{const m=p.contrastColor,g=a===m;return u.jsx(V,{"data-style":"ghost",type:"button",onClick:()=>d(m),"aria-label":`Text color: ${p.name}`,"aria-pressed":g,className:"tiptap-color-text-button",children:u.jsx(Or,{textColorHex:m,backgroundColorHex:"#ffffff"})},p.name)})}),u.jsx(Gn,{children:"Highlight Color"}),u.jsx(Be,{orientation:"horizontal",children:Dt.slice(0,5).map((p,m)=>{const g=m===0,b=g?null:p.color,v=l===b||g&&l===null;return u.jsx(V,{"data-style":"ghost",type:"button",onClick:()=>f(b),"aria-label":`Highlight color: ${p.name}`,"aria-pressed":v,className:"tiptap-color-highlight-button",children:u.jsx("span",{style:{display:"inline-block",width:"1.5rem",height:"1.5rem",borderRadius:"50%",backgroundColor:b??"#ffffff",border:`1px solid ${b?p.contrastColor:"#e5e7eb"}`},"aria-hidden":!0})},p.name)})}),u.jsx(Be,{orientation:"horizontal",children:Dt.slice(5,10).map(p=>{const m=p.color,g=l===m;return u.jsx(V,{"data-style":"ghost",type:"button",onClick:()=>f(m),"aria-label":`Highlight color: ${p.name}`,"aria-pressed":g,className:"tiptap-color-highlight-button",children:u.jsx("span",{style:{display:"inline-block",width:"1.5rem",height:"1.5rem",borderRadius:"50%",backgroundColor:m??"#ffffff",border:`1px solid ${m?p.contrastColor:"#e5e7eb"}`},"aria-hidden":!0})},p.name)})})]})})})]})});ed.displayName="ColorTextPopover";const td=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{d:"M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z",fill:"currentColor"}),u.jsx("path",{d:"M21.0001 10C21.0001 9.63121 20.7971 9.29235 20.472 9.11833C20.1468 8.94431 19.7523 8.96338 19.4454 9.16795L16.4454 11.168C15.9859 11.4743 15.8617 12.0952 16.1681 12.5547C16.4744 13.0142 17.0953 13.1384 17.5548 12.8321L19.0001 11.8685V18C19.0001 18.5523 19.4478 19 20.0001 19C20.5524 19 21.0001 18.5523 21.0001 18V10Z",fill:"currentColor"})]}));td.displayName="HeadingOneIcon";const nd=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{d:"M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z",fill:"currentColor"}),u.jsx("path",{d:"M22.0001 12C22.0001 10.7611 21.1663 9.79297 20.0663 9.42632C18.9547 9.05578 17.6171 9.28724 16.4001 10.2C15.9582 10.5314 15.8687 11.1582 16.2001 11.6C16.5314 12.0418 17.1582 12.1314 17.6001 11.8C18.383 11.2128 19.0455 11.1942 19.4338 11.3237C19.8339 11.457 20.0001 11.7389 20.0001 12C20.0001 12.4839 19.8554 12.7379 19.6537 12.9481C19.4275 13.1837 19.1378 13.363 18.7055 13.6307C18.6313 13.6767 18.553 13.7252 18.4701 13.777C17.9572 14.0975 17.3128 14.5261 16.8163 15.2087C16.3007 15.9177 16.0001 16.8183 16.0001 18C16.0001 18.5523 16.4478 19 17.0001 19H21.0001C21.5523 19 22.0001 18.5523 22.0001 18C22.0001 17.4477 21.5523 17 21.0001 17H18.131C18.21 16.742 18.3176 16.5448 18.4338 16.385C18.6873 16.0364 19.0429 15.7775 19.5301 15.473C19.5898 15.4357 19.6536 15.3966 19.7205 15.3556C20.139 15.0992 20.6783 14.7687 21.0964 14.3332C21.6447 13.7621 22.0001 13.0161 22.0001 12Z",fill:"currentColor"})]}));nd.displayName="HeadingTwoIcon";const rd=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{d:"M4 5C4.55228 5 5 5.44772 5 6V11H11V6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H5V18C5 18.5523 4.55228 19 4 19C3.44772 19 3 18.5523 3 18V6C3 5.44772 3.44772 5 4 5Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.4608 11.2169C19.1135 11.0531 18.5876 11.0204 18.0069 11.3619C17.5309 11.642 16.918 11.4831 16.638 11.007C16.358 10.531 16.5169 9.91809 16.9929 9.63807C18.1123 8.97962 19.3364 8.94691 20.314 9.40808C21.2839 9.86558 21.9999 10.818 21.9999 12C21.9999 12.7957 21.6838 13.5587 21.1212 14.1213C20.5586 14.6839 19.7956 15 18.9999 15C18.4476 15 17.9999 14.5523 17.9999 14C17.9999 13.4477 18.4476 13 18.9999 13C19.2651 13 19.5195 12.8947 19.707 12.7071C19.8946 12.5196 19.9999 12.2652 19.9999 12C19.9999 11.6821 19.8159 11.3844 19.4608 11.2169Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0001 14C18.0001 13.4477 18.4478 13 19.0001 13C19.7957 13 20.5588 13.3161 21.1214 13.8787C21.684 14.4413 22.0001 15.2043 22.0001 16C22.0001 17.2853 21.2767 18.3971 20.1604 18.8994C19.0257 19.41 17.642 19.2315 16.4001 18.3C15.9582 17.9686 15.8687 17.3418 16.2001 16.9C16.5314 16.4582 17.1582 16.3686 17.6001 16.7C18.3581 17.2685 18.9744 17.24 19.3397 17.0756C19.7234 16.9029 20.0001 16.5147 20.0001 16C20.0001 15.7348 19.8947 15.4804 19.7072 15.2929C19.5196 15.1054 19.2653 15 19.0001 15C18.4478 15 18.0001 14.5523 18.0001 14Z",fill:"currentColor"})]}));rd.displayName="HeadingThreeIcon";const Yr=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{d:"M12 6V21H10V16C6.68629 16 4 13.3137 4 10C4 6.68629 6.68629 4 10 4H20V6H17V21H15V6H12ZM10 6C7.79086 6 6 7.79086 6 10C6 12.2091 7.79086 14 10 14V6Z"})}));Yr.displayName="ParagraphIcon";const Pb=["paragraph","heading","bulletList","orderedList","taskList","blockquote","codeBlock"],$t={heading1:{value:"heading1",label:"제목 1",nodeType:"heading",attrs:{level:1},Icon:td},heading2:{value:"heading2",label:"제목 2",nodeType:"heading",attrs:{level:2},Icon:nd},heading3:{value:"heading3",label:"제목 3",nodeType:"heading",attrs:{level:3},Icon:rd},paragraphLarge:{value:"paragraphLarge",label:"본문 큼",nodeType:"paragraph",attrs:{size:"large"},Icon:Yr},paragraphNormal:{value:"paragraphNormal",label:"본문 보통",nodeType:"paragraph",attrs:{size:"normal"},Icon:Yr},paragraphSmall:{value:"paragraphSmall",label:"본문 작음",nodeType:"paragraph",attrs:{size:"small"},Icon:Yr}},co=Object.keys($t);function Db(e){const{nodeType:t,attrs:n}=$t[e];if(t==="heading"){const{level:o}=n;return{Tag:`h${o}`,attrs:{}}}const{size:r}=n;return{Tag:"p",attrs:{"data-size":r}}}function os(e,t){if(!e||!e.isEditable)return!1;const{nodeType:n,attrs:r}=$t[t];return e.isActive(n,r)}function ss(e,t){if(!e||!e.isEditable)return!1;const{nodeType:n,attrs:r}=$t[t];return!Ah(n,e)||Ko(e,["image"])||!Th(e,Pb)?!1:os(e,t)?!0:e.can().setNode(n,r)}function Bb(e,t){if(!e||!ss(e,t))return!1;if(os(e,t))return!0;const{nodeType:n,attrs:r}=$t[t];return e.chain().focus().setNode(n,r).run()}function od(e){const{editor:t,hideWhenUnavailable:n}=e;return t?n?t.isEditable?t.isActive("code")?!0:co.some(r=>ss(t,r)):!1:!0:!1}function Hb(e){const{editor:t,value:n,hideWhenUnavailable:r=!1,onApplied:o}=e,{editor:s}=Ue(t),[i,a]=x.useState(!0),l=ss(s,n),c=os(s,n);x.useEffect(()=>{if(!s)return;const h=()=>{a(od({editor:s,hideWhenUnavailable:r}))};return h(),s.on("selectionUpdate",h),()=>{s.off("selectionUpdate",h)}},[s,r]);const d=x.useCallback(()=>{if(!s)return!1;const h=Bb(s,n);return h&&o?.(),h},[s,n,o]),f=$t[n];return{isVisible:i,isActive:c,canApply:l,handleApply:d,label:f.label,Icon:f.Icon}}const sd=x.forwardRef(({editor:e,value:t,text:n,hideWhenUnavailable:r=!1,onApplied:o,onClick:s,children:i,...a},l)=>{const{editor:c}=Ue(e),{isVisible:d,canApply:f,isActive:h,handleApply:p,label:m}=Hb({editor:c,value:t,hideWhenUnavailable:r,onApplied:o}),g=x.useCallback(C=>{s?.(C),!C.defaultPrevented&&p()},[p,s]);if(!d)return null;const{Tag:b,attrs:v}=Db(t);return u.jsx(V,{type:"button",variant:"ghost","data-active-state":h?"on":"off",role:"button",tabIndex:-1,disabled:!f,"data-disabled":!f,"aria-label":m,"aria-pressed":h,tooltip:m,onClick:g,...a,ref:l,children:i??u.jsx(b,{...v,className:"tiptap-button-text",children:n??m})})});sd.displayName="TextStyleButton";const pr=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.29289 8.29289C5.68342 7.90237 6.31658 7.90237 6.70711 8.29289L12 13.5858L17.2929 8.29289C17.6834 7.90237 18.3166 7.90237 18.7071 8.29289C19.0976 8.68342 19.0976 9.31658 18.7071 9.70711L12.7071 15.7071C12.3166 16.0976 11.6834 16.0976 11.2929 15.7071L5.29289 9.70711C4.90237 9.31658 4.90237 8.68342 5.29289 8.29289Z",fill:"currentColor"})}));pr.displayName="ChevronDownIcon";const Fb="paragraphNormal";function $b(e,t=co){if(!(!e||!e.isEditable))return t.find(n=>os(e,n))}function Ub(e){const{editor:t,hideWhenUnavailable:n=!1}=e||{},{editor:r}=Ue(t),[o,s]=x.useState(!0),i=$b(r)??Fb,a=$t[i],l=co.some(c=>ss(r,c));return x.useEffect(()=>{if(!r)return;const c=()=>{s(od({editor:r,hideWhenUnavailable:n}))};return c(),r.on("selectionUpdate",c),()=>{r.off("selectionUpdate",c)}},[r,n]),{isVisible:o,activeValue:i,canApply:l,label:a.label,Icon:a.Icon,options:co.map(c=>$t[c])}}const Ol=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Il=Rc,jb=(e,t)=>n=>{var r;if(t?.variants==null)return Il(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const d=n?.[c],f=s?.[c];if(d===null)return null;const h=Ol(d)||Ol(f);return o[c][h]}),a=n&&Object.entries(n).reduce((c,d)=>{let[f,h]=d;return h===void 0||(c[f]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(m=>{let[g,b]=m;return Array.isArray(b)?b.includes({...s,...a}[g]):{...s,...a}[g]===b})?[...c,f,h]:c},[]);return Il(e,i,l,n?.class,n?.className)},zb=jb("tiptap-button-group",{variants:{orientation:{horizontal:"tiptap-button-group-horizontal",vertical:"tiptap-button-group-vertical"}},defaultVariants:{orientation:"horizontal"}});function Qt({className:e,orientation:t,...n}){return u.jsx("div",{role:"group","data-slot":"tiptap-button-group","data-orientation":t,className:ke(zb({orientation:t}),e),...n})}function id(e){const t=e+"CollectionProvider",[n,r]=Rn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:b,children:v}=g,C=x.useRef(null),_=x.useRef(new Map).current;return u.jsx(o,{scope:b,itemMap:_,collectionRef:C,children:v})};i.displayName=t;const a=e+"CollectionSlot",l=tr(a),c=x.forwardRef((g,b)=>{const{scope:v,children:C}=g,_=s(a,v),S=Oe(b,_.collectionRef);return u.jsx(l,{ref:S,children:C})});c.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=tr(d),p=x.forwardRef((g,b)=>{const{scope:v,children:C,..._}=g,S=x.useRef(null),N=Oe(b,S),A=s(d,v);return x.useEffect(()=>(A.itemMap.set(S,{ref:S,..._}),()=>{A.itemMap.delete(S)})),u.jsx(h,{[f]:"",ref:N,children:C})});p.displayName=d;function m(g){const b=s(e+"CollectionConsumer",g);return x.useCallback(()=>{const C=b.collectionRef.current;if(!C)return[];const _=Array.from(C.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((A,R)=>_.indexOf(A.ref.current)-_.indexOf(R.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:c,ItemSlot:p},m,r]}var Vb=y.createContext(void 0);function ad(e){const t=y.useContext(Vb);return e||t||"ltr"}var Ds="rovingFocusGroup.onEntryFocus",Kb={bubbles:!1,cancelable:!0},hr="RovingFocusGroup",[mi,ld,Wb]=id(hr),[Gb,cd]=Rn(hr,[Wb]),[Zb,qb]=Gb(hr),ud=y.forwardRef((e,t)=>u.jsx(mi.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(mi.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(Yb,{...e,ref:t})})}));ud.displayName=hr;var Yb=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...f}=e,h=y.useRef(null),p=Oe(t,h),m=ad(s),[g,b]=ts({prop:i,defaultProp:a??null,onChange:l,caller:hr}),[v,C]=y.useState(!1),_=vt(c),S=ld(n),N=y.useRef(!1),[A,R]=y.useState(0);return y.useEffect(()=>{const O=h.current;if(O)return O.addEventListener(Ds,_),()=>O.removeEventListener(Ds,_)},[_]),u.jsx(Zb,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:g,onItemFocus:y.useCallback(O=>b(O),[b]),onItemShiftTab:y.useCallback(()=>C(!0),[]),onFocusableItemAdd:y.useCallback(()=>R(O=>O+1),[]),onFocusableItemRemove:y.useCallback(()=>R(O=>O-1),[]),children:u.jsx(Re.div,{tabIndex:v||A===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:ae(e.onMouseDown,()=>{N.current=!0}),onFocus:ae(e.onFocus,O=>{const D=!N.current;if(O.target===O.currentTarget&&D&&!v){const j=new CustomEvent(Ds,Kb);if(O.currentTarget.dispatchEvent(j),!j.defaultPrevented){const Y=S().filter(U=>U.focusable),J=Y.find(U=>U.active),X=Y.find(U=>U.id===g),$=[J,X,...Y].filter(Boolean).map(U=>U.ref.current);pd($,d)}}N.current=!1}),onBlur:ae(e.onBlur,()=>C(!1))})})}),dd="RovingFocusGroupItem",fd=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,l=_n(),c=s||l,d=qb(dd,n),f=d.currentTabStopId===c,h=ld(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:g}=d;return y.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),u.jsx(mi.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:u.jsx(Re.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:ae(e.onMouseDown,b=>{r?d.onItemFocus(c):b.preventDefault()}),onFocus:ae(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:ae(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const v=Qb(b,d.orientation,d.dir);if(v!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let _=h().filter(S=>S.focusable).map(S=>S.ref.current);if(v==="last")_.reverse();else if(v==="prev"||v==="next"){v==="prev"&&_.reverse();const S=_.indexOf(b.currentTarget);_=d.loop?e0(_,S+1):_.slice(S+1)}setTimeout(()=>pd(_))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:g!=null}):i})})});fd.displayName=dd;var Xb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Jb(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Qb(e,t,n){const r=Jb(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Xb[r]}function pd(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function e0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var t0=ud,n0=fd,bi=["Enter"," "],r0=["ArrowDown","PageUp","Home"],hd=["ArrowUp","PageDown","End"],o0=[...r0,...hd],s0={ltr:[...bi,"ArrowRight"],rtl:[...bi,"ArrowLeft"]},i0={ltr:["ArrowLeft"],rtl:["ArrowRight"]},gr="Menu",[rr,a0,l0]=id(gr),[sn,gd]=Rn(gr,[l0,es,cd]),mr=es(),md=cd(),[bd,Kt]=sn(gr),[c0,br]=sn(gr),vd=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=mr(t),[l,c]=y.useState(null),d=y.useRef(!1),f=vt(s),h=ad(o);return y.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),u.jsx(qi,{...a,children:u.jsx(bd,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c,children:u.jsx(c0,{scope:t,onClose:y.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:i,children:r})})})};vd.displayName=gr;var u0="MenuAnchor",oa=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=mr(n);return u.jsx(Yi,{...o,...r,ref:t})});oa.displayName=u0;var sa="MenuPortal",[d0,yd]=sn(sa,{forceMount:void 0}),Ed=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Kt(sa,t);return u.jsx(d0,{scope:t,forceMount:n,children:u.jsx(on,{present:n||s.open,children:u.jsx(Xi,{asChild:!0,container:o,children:r})})})};Ed.displayName=sa;var Je="MenuContent",[f0,ia]=sn(Je),Cd=y.forwardRef((e,t)=>{const n=yd(Je,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Kt(Je,e.__scopeMenu),i=br(Je,e.__scopeMenu);return u.jsx(rr.Provider,{scope:e.__scopeMenu,children:u.jsx(on,{present:r||s.open,children:u.jsx(rr.Slot,{scope:e.__scopeMenu,children:i.modal?u.jsx(p0,{...o,ref:t}):u.jsx(h0,{...o,ref:t})})})})}),p0=y.forwardRef((e,t)=>{const n=Kt(Je,e.__scopeMenu),r=y.useRef(null),o=Oe(t,r);return y.useEffect(()=>{const s=r.current;if(s)return uu(s)},[]),u.jsx(aa,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ae(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),h0=y.forwardRef((e,t)=>{const n=Kt(Je,e.__scopeMenu);return u.jsx(aa,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),g0=tr("MenuContent.ScrollLock"),aa=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:m,...g}=e,b=Kt(Je,n),v=br(Je,n),C=mr(n),_=md(n),S=a0(n),[N,A]=y.useState(null),R=y.useRef(null),O=Oe(t,R,b.onContentChange),D=y.useRef(0),j=y.useRef(""),Y=y.useRef(0),J=y.useRef(null),X=y.useRef("right"),I=y.useRef(0),$=m?Ji:y.Fragment,U=m?{as:g0,allowPinchZoom:!0}:void 0,H=k=>{const K=j.current+k,oe=S().filter(ue=>!ue.disabled),Z=document.activeElement,ce=oe.find(ue=>ue.ref.current===Z)?.textValue,Ke=oe.map(ue=>ue.textValue),he=A0(Ke,K,ce),ye=oe.find(ue=>ue.textValue===he)?.ref.current;(function ue(Ze){j.current=Ze,window.clearTimeout(D.current),Ze!==""&&(D.current=window.setTimeout(()=>ue(""),1e3))})(K),ye&&setTimeout(()=>ye.focus())};y.useEffect(()=>()=>window.clearTimeout(D.current),[]),Lc();const T=y.useCallback(k=>X.current===J.current?.side&&R0(k,J.current?.area),[]);return u.jsx(f0,{scope:n,searchRef:j,onItemEnter:y.useCallback(k=>{T(k)&&k.preventDefault()},[T]),onItemLeave:y.useCallback(k=>{T(k)||(R.current?.focus(),A(null))},[T]),onTriggerLeave:y.useCallback(k=>{T(k)&&k.preventDefault()},[T]),pointerGraceTimerRef:Y,onPointerGraceIntentChange:y.useCallback(k=>{J.current=k},[]),children:u.jsx($,{...U,children:u.jsx($i,{asChild:!0,trapped:o,onMountAutoFocus:ae(s,k=>{k.preventDefault(),R.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:u.jsx(Fi,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:u.jsx(t0,{asChild:!0,..._,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:A,onEntryFocus:ae(l,k=>{v.isUsingKeyboardRef.current||k.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(au,{role:"menu","aria-orientation":"vertical","data-state":Hd(b.open),"data-radix-menu-content":"",dir:v.dir,...C,...g,ref:O,style:{outline:"none",...g.style},onKeyDown:ae(g.onKeyDown,k=>{const oe=k.target.closest("[data-radix-menu-content]")===k.currentTarget,Z=k.ctrlKey||k.altKey||k.metaKey,ce=k.key.length===1;oe&&(k.key==="Tab"&&k.preventDefault(),!Z&&ce&&H(k.key));const Ke=R.current;if(k.target!==Ke||!o0.includes(k.key))return;k.preventDefault();const ye=S().filter(ue=>!ue.disabled).map(ue=>ue.ref.current);hd.includes(k.key)&&ye.reverse(),S0(ye)}),onBlur:ae(e.onBlur,k=>{k.currentTarget.contains(k.target)||(window.clearTimeout(D.current),j.current="")}),onPointerMove:ae(e.onPointerMove,or(k=>{const K=k.target,oe=I.current!==k.clientX;if(k.currentTarget.contains(K)&&oe){const Z=k.clientX>I.current?"right":"left";X.current=Z,I.current=k.clientX}}))})})})})})})});Cd.displayName=Je;var m0="MenuGroup",la=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Re.div,{role:"group",...r,ref:t})});la.displayName=m0;var b0="MenuLabel",wd=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Re.div,{...r,ref:t})});wd.displayName=b0;var uo="MenuItem",Ll="menu.itemSelect",is=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=y.useRef(null),i=br(uo,e.__scopeMenu),a=ia(uo,e.__scopeMenu),l=Oe(t,s),c=y.useRef(!1),d=()=>{const f=s.current;if(!n&&f){const h=new CustomEvent(Ll,{bubbles:!0,cancelable:!0});f.addEventListener(Ll,p=>r?.(p),{once:!0}),kc(f,h),h.defaultPrevented?c.current=!1:i.onClose()}};return u.jsx(xd,{...o,ref:l,disabled:n,onClick:ae(e.onClick,d),onPointerDown:f=>{e.onPointerDown?.(f),c.current=!0},onPointerUp:ae(e.onPointerUp,f=>{c.current||f.currentTarget?.click()}),onKeyDown:ae(e.onKeyDown,f=>{const h=a.searchRef.current!=="";n||h&&f.key===" "||bi.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});is.displayName=uo;var xd=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=ia(uo,n),a=md(n),l=y.useRef(null),c=Oe(t,l),[d,f]=y.useState(!1),[h,p]=y.useState("");return y.useEffect(()=>{const m=l.current;m&&p((m.textContent??"").trim())},[s.children]),u.jsx(rr.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:u.jsx(n0,{asChild:!0,...a,focusable:!r,children:u.jsx(Re.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:ae(e.onPointerMove,or(m=>{r?i.onItemLeave(m):(i.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ae(e.onPointerLeave,or(m=>i.onItemLeave(m))),onFocus:ae(e.onFocus,()=>f(!0)),onBlur:ae(e.onBlur,()=>f(!1))})})})}),v0="MenuCheckboxItem",_d=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return u.jsx(Rd,{scope:e.__scopeMenu,checked:n,children:u.jsx(is,{role:"menuitemcheckbox","aria-checked":fo(n)?"mixed":n,...o,ref:t,"data-state":da(n),onSelect:ae(o.onSelect,()=>r?.(fo(n)?!0:!n),{checkForDefaultPrevented:!1})})})});_d.displayName=v0;var Sd="MenuRadioGroup",[y0,E0]=sn(Sd,{value:void 0,onValueChange:()=>{}}),Nd=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=vt(r);return u.jsx(y0,{scope:e.__scopeMenu,value:n,onValueChange:s,children:u.jsx(la,{...o,ref:t})})});Nd.displayName=Sd;var Ad="MenuRadioItem",Td=y.forwardRef((e,t)=>{const{value:n,...r}=e,o=E0(Ad,e.__scopeMenu),s=n===o.value;return u.jsx(Rd,{scope:e.__scopeMenu,checked:s,children:u.jsx(is,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":da(s),onSelect:ae(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Td.displayName=Ad;var ca="MenuItemIndicator",[Rd,C0]=sn(ca,{checked:!1}),Md=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=C0(ca,n);return u.jsx(on,{present:r||fo(s.checked)||s.checked===!0,children:u.jsx(Re.span,{...o,ref:t,"data-state":da(s.checked)})})});Md.displayName=ca;var w0="MenuSeparator",kd=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Re.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});kd.displayName=w0;var x0="MenuArrow",Od=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=mr(n);return u.jsx(lu,{...o,...r,ref:t})});Od.displayName=x0;var ua="MenuSub",[_0,Id]=sn(ua),Ld=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=Kt(ua,t),i=mr(t),[a,l]=y.useState(null),[c,d]=y.useState(null),f=vt(o);return y.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),u.jsx(qi,{...i,children:u.jsx(bd,{scope:t,open:r,onOpenChange:f,content:c,onContentChange:d,children:u.jsx(_0,{scope:t,contentId:_n(),triggerId:_n(),trigger:a,onTriggerChange:l,children:n})})})};Ld.displayName=ua;var Hn="MenuSubTrigger",Pd=y.forwardRef((e,t)=>{const n=Kt(Hn,e.__scopeMenu),r=br(Hn,e.__scopeMenu),o=Id(Hn,e.__scopeMenu),s=ia(Hn,e.__scopeMenu),i=y.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},d=y.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return y.useEffect(()=>d,[d]),y.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),u.jsx(oa,{asChild:!0,...c,children:u.jsx(xd,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Hd(n.open),...e,ref:Zo(t,o.onTriggerChange),onClick:f=>{e.onClick?.(f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ae(e.onPointerMove,or(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:ae(e.onPointerLeave,or(f=>{d();const h=n.content?.getBoundingClientRect();if(h){const p=n.content?.dataset.side,m=p==="right",g=m?-5:5,b=h[m?"left":"right"],v=h[m?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+g,y:f.clientY},{x:b,y:h.top},{x:v,y:h.top},{x:v,y:h.bottom},{x:b,y:h.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ae(e.onKeyDown,f=>{const h=s.searchRef.current!=="";e.disabled||h&&f.key===" "||s0[r.dir].includes(f.key)&&(n.onOpenChange(!0),n.content?.focus(),f.preventDefault())})})})});Pd.displayName=Hn;var Dd="MenuSubContent",Bd=y.forwardRef((e,t)=>{const n=yd(Je,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Kt(Je,e.__scopeMenu),i=br(Je,e.__scopeMenu),a=Id(Dd,e.__scopeMenu),l=y.useRef(null),c=Oe(t,l);return u.jsx(rr.Provider,{scope:e.__scopeMenu,children:u.jsx(on,{present:r||s.open,children:u.jsx(rr.Slot,{scope:e.__scopeMenu,children:u.jsx(aa,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{i.isUsingKeyboardRef.current&&l.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ae(e.onFocusOutside,d=>{d.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ae(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:ae(e.onKeyDown,d=>{const f=d.currentTarget.contains(d.target),h=i0[i.dir].includes(d.key);f&&h&&(s.onOpenChange(!1),a.trigger?.focus(),d.preventDefault())})})})})})});Bd.displayName=Dd;function Hd(e){return e?"open":"closed"}function fo(e){return e==="indeterminate"}function da(e){return fo(e)?"indeterminate":e?"checked":"unchecked"}function S0(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function N0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function A0(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=N0(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==n));const l=i.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function T0(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],c=a.x,d=a.y,f=l.x,h=l.y;d>r!=h>r&&n<(f-c)*(r-d)/(h-d)+c&&(o=!o)}return o}function R0(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return T0(n,t)}function or(e){return t=>t.pointerType==="mouse"?e(t):void 0}var M0=vd,k0=oa,O0=Ed,I0=Cd,L0=la,P0=wd,D0=is,B0=_d,H0=Nd,F0=Td,$0=Md,U0=kd,j0=Od,z0=Ld,V0=Pd,K0=Bd,as="DropdownMenu",[W0]=Rn(as,[gd]),Ie=gd(),[G0,Fd]=W0(as),$d=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,l=Ie(t),c=y.useRef(null),[d,f]=ts({prop:o,defaultProp:s??!1,onChange:i,caller:as});return u.jsx(G0,{scope:t,triggerId:_n(),triggerRef:c,contentId:_n(),open:d,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(h=>!h),[f]),modal:a,children:u.jsx(M0,{...l,open:d,onOpenChange:f,dir:r,modal:a,children:n})})};$d.displayName=as;var Ud="DropdownMenuTrigger",jd=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Fd(Ud,n),i=Ie(n);return u.jsx(k0,{asChild:!0,...i,children:u.jsx(Re.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Zo(t,s.triggerRef),onPointerDown:ae(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:ae(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});jd.displayName=Ud;var Z0="DropdownMenuPortal",zd=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ie(t);return u.jsx(O0,{...r,...n})};zd.displayName=Z0;var Vd="DropdownMenuContent",Kd=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fd(Vd,n),s=Ie(n),i=y.useRef(!1);return u.jsx(I0,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:ae(e.onCloseAutoFocus,a=>{i.current||o.triggerRef.current?.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:ae(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!o.modal||d)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Kd.displayName=Vd;var q0="DropdownMenuGroup",Y0=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(L0,{...o,...r,ref:t})});Y0.displayName=q0;var X0="DropdownMenuLabel",J0=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(P0,{...o,...r,ref:t})});J0.displayName=X0;var Q0="DropdownMenuItem",Wd=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(D0,{...o,...r,ref:t})});Wd.displayName=Q0;var ev="DropdownMenuCheckboxItem",tv=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(B0,{...o,...r,ref:t})});tv.displayName=ev;var nv="DropdownMenuRadioGroup",rv=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(H0,{...o,...r,ref:t})});rv.displayName=nv;var ov="DropdownMenuRadioItem",sv=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(F0,{...o,...r,ref:t})});sv.displayName=ov;var iv="DropdownMenuItemIndicator",av=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx($0,{...o,...r,ref:t})});av.displayName=iv;var lv="DropdownMenuSeparator",cv=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(U0,{...o,...r,ref:t})});cv.displayName=lv;var uv="DropdownMenuArrow",dv=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(j0,{...o,...r,ref:t})});dv.displayName=uv;var fv=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,i=Ie(t),[a,l]=ts({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return u.jsx(z0,{...i,open:a,onOpenChange:l,children:n})},pv="DropdownMenuSubTrigger",Gd=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(V0,{...o,...r,ref:t})});Gd.displayName=pv;var hv="DropdownMenuSubContent",Zd=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return u.jsx(K0,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zd.displayName=hv;var gv=$d,qd=jd,mv=zd,Yd=Kd,bv=Wd,vv=fv,yv=Gd,Xd=Zd;function vr({...e}){return u.jsx(gv,{modal:!1,...e})}function Jd({...e}){return u.jsx(mv,{...e})}const On=x.forwardRef(({...e},t)=>u.jsx(qd,{ref:t,...e}));On.displayName=qd.displayName;const Ev=vv,je=bv,Cv=yv,Qd=x.forwardRef(({className:e,portal:t=!0,...n},r)=>{const o=u.jsx(Xd,{ref:r,className:ke("tiptap-dropdown-menu",e),...n});return t?u.jsx(Jd,{...typeof t=="object"?t:{},children:o}):o});Qd.displayName=Xd.displayName;const In=x.forwardRef(({className:e,sideOffset:t=4,portal:n=!1,...r},o)=>{const s=u.jsx(Yd,{ref:o,sideOffset:t,onCloseAutoFocus:i=>i.preventDefault(),className:ke("tiptap-dropdown-menu",e),...r});return n?u.jsx(Jd,{...typeof n=="object"?n:{},children:s}):s});In.displayName=Yd.displayName;const ef=x.forwardRef(({editor:e,hideWhenUnavailable:t=!1,portal:n=!1,onOpenChange:r,children:o,...s},i)=>{const{editor:a}=Ue(e),[l,c]=x.useState(!1),{isVisible:d,canApply:f,label:h,Icon:p,options:m}=Ub({editor:a,hideWhenUnavailable:t}),g=x.useCallback(b=>{!a||!f||(c(b),r?.(b))},[f,a,r]);return d?u.jsxs(vr,{modal:!0,open:l,onOpenChange:g,children:[u.jsx(On,{asChild:!0,children:u.jsx(V,{type:"button",variant:"ghost",role:"button",tabIndex:-1,disabled:!f,"data-disabled":!f,"aria-label":h,tooltip:"문단 모양",...s,ref:i,children:o||u.jsxs(u.Fragment,{children:[u.jsx(p,{className:"tiptap-button-icon"}),u.jsx("span",{className:"tiptap-button-text",children:h}),u.jsx(pr,{className:"tiptap-button-dropdown-small"})]})})}),u.jsx(In,{align:"start",portal:n,children:u.jsx(Fe,{className:"tiptap-typography",children:u.jsx($e,{children:u.jsx(Qt,{children:m.map(b=>u.jsx(je,{asChild:!0,children:u.jsx(sd,{editor:a,value:b.value,text:b.label,showTooltip:!1})},b.value))})})})})]}):null});ef.displayName="TextStyleDropdownMenu";const wv=[10,11,12,13,14,16,18,20,24,28,36],tf=x.forwardRef(({editor:e,portal:t=!1,onOpenChange:n,children:r,...o},s)=>{const{editor:i}=Ue(e),[a,l]=x.useState(!1),c=ot.useEditorState({editor:i,selector:({editor:m})=>m?m.getAttributes("textStyle").fontSize??null:null}),d=!!i,f=x.useCallback(m=>{d&&(l(m),n?.(m))},[d,n]),h=x.useCallback(()=>{i?.chain().focus().unsetFontSize().run()},[i]),p=x.useCallback(m=>{i&&(c===m?i.chain().focus().unsetFontSize().run():i.chain().focus().setFontSize(`${m}px`).run())},[i,c]);return i?u.jsxs(vr,{modal:!0,open:a,onOpenChange:f,children:[u.jsx(On,{asChild:!0,children:u.jsx(V,{type:"button",variant:"ghost",role:"button",tabIndex:-1,disabled:!d,"data-disabled":!d,"aria-label":"글자 크기",tooltip:"글자 크기",...o,ref:s,children:r??u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"tiptap-button-text",children:c??"-"}),u.jsx(pr,{className:"tiptap-button-dropdown-small"})]})})}),u.jsx(In,{align:"start",portal:t,children:u.jsx(Fe,{children:u.jsx($e,{children:u.jsxs(Qt,{children:[u.jsx(je,{asChild:!0,onSelect:h,children:u.jsx(V,{type:"button",variant:"ghost","data-active-state":c===null?"on":"off","aria-pressed":c===null,children:u.jsx("span",{className:"tiptap-button-text",children:"기본값"})})}),wv.map(m=>u.jsx(je,{asChild:!0,onSelect:()=>p(m),children:u.jsx(V,{type:"button",variant:"ghost","data-active-state":c===m?"on":"off","aria-pressed":c===m,children:u.jsx("span",{className:"tiptap-button-text",children:m})})},m))]})})})})]}):null});tf.displayName="FontSizeDropdownMenu";const fa=x.forwardRef(({variant:e,size:t="default",appearance:n="default",trimText:r=!1,className:o,children:s,...i},a)=>u.jsx("div",{ref:a,className:`tiptap-badge ${o||""}`,"data-style":e,"data-size":t,"data-appearance":n,"data-text-trim":r?"on":"off",...i,children:s}));fa.displayName="Badge";function xv({align:e,shortcutKeys:t=sf[e]}){return u.jsx(fa,{children:Di({shortcutKeys:t})})}const Fn=x.forwardRef(({editor:e,align:t,text:n,hideWhenUnavailable:r=!1,onAligned:o,showShortcut:s=!1,onClick:i,icon:a,children:l,...c},d)=>{const{editor:f}=Ue(e),{isVisible:h,handleTextAlign:p,label:m,canAlign:g,isActive:b,Icon:v,shortcutKeys:C}=Mv({editor:f,align:t,hideWhenUnavailable:r,onAligned:o}),_=x.useCallback(N=>{i?.(N),!N.defaultPrevented&&p()},[p,i]);if(!h)return null;const S=a??v;return u.jsx(V,{type:"button",disabled:!g,variant:"ghost","data-active-state":b?"on":"off","data-disabled":!g,role:"button",tabIndex:-1,"aria-label":m,"aria-pressed":b,tooltip:m,onClick:_,...c,ref:d,children:l??u.jsxs(u.Fragment,{children:[u.jsx(S,{className:"tiptap-button-icon"}),n&&u.jsx("span",{className:"tiptap-button-text",children:n}),s&&u.jsx(xv,{align:t,shortcutKeys:C})]})})});Fn.displayName="TextAlignButton";const nf=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 18C4 17.4477 4.44772 17 5 17H19C19.5523 17 20 17.4477 20 18C20 18.5523 19.5523 19 19 19H5C4.44772 19 4 18.5523 4 18Z",fill:"currentColor"})]}));nf.displayName="AlignCenterIcon";const ls=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 12C2 11.4477 2.44772 11 3 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H3C2.44772 13 2 12.5523 2 12Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 18C2 17.4477 2.44772 17 3 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H3C2.44772 19 2 18.5523 2 18Z",fill:"currentColor"})]}));ls.displayName="AlignJustifyIcon";const rf=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 12C2 11.4477 2.44772 11 3 11H15C15.5523 11 16 11.4477 16 12C16 12.5523 15.5523 13 15 13H3C2.44772 13 2 12.5523 2 12Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 18C2 17.4477 2.44772 17 3 17H17C17.5523 17 18 17.4477 18 18C18 18.5523 17.5523 19 17 19H3C2.44772 19 2 18.5523 2 18Z",fill:"currentColor"})]}));rf.displayName="AlignLeftIcon";const of=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 12C8 11.4477 8.44772 11 9 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H9C8.44772 13 8 12.5523 8 12Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 18C6 17.4477 6.44772 17 7 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H7C6.44772 19 6 18.5523 6 18Z",fill:"currentColor"})]}));of.displayName="AlignRightIcon";const sf={left:"mod+shift+l",center:"mod+shift+e",right:"mod+shift+r",justify:"mod+shift+j"},_v={left:rf,center:nf,right:of,justify:ls},Sv={left:"왼쪽 정렬",center:"중앙 정렬",right:"오른쪽 정렬",justify:"양쪽 정렬"};function pa(e,t){return!e||!e.isEditable||!Mc(e,"textAlign")||Ko(e,["image","horizontalRule"])?!1:e.can().setTextAlign(t)}function Nv(e){return"setTextAlign"in e}function Av(e,t){return!e||!e.isEditable?!1:e.isActive({textAlign:t})}function Tv(e,t){if(!e||!e.isEditable||!pa(e,t))return!1;const n=e.chain().focus();return Nv(n)?n.setTextAlign(t).run():!1}function Rv(e){const{editor:t,hideWhenUnavailable:n,align:r}=e;return t?n?!t.isEditable||!Mc(t,"textAlign")?!1:t.isActive("code")?!0:pa(t,r):!0:!1}function Mv(e){const{editor:t,align:n,hideWhenUnavailable:r=!1,onAligned:o}=e,{editor:s}=Ue(t),[i,a]=x.useState(!0),l=pa(s,n),c=Av(s,n);x.useEffect(()=>{if(!s)return;const f=()=>{a(Rv({editor:s,align:n,hideWhenUnavailable:r}))};return f(),s.on("selectionUpdate",f),()=>{s.off("selectionUpdate",f)}},[s,r,n]);const d=x.useCallback(()=>{if(!s)return!1;const f=Tv(s,n);return f&&o?.(),f},[s,n,o]);return{isVisible:i,isActive:c,handleTextAlign:d,canAlign:l,label:Sv[n],shortcutKeys:sf[n],Icon:_v[n]}}function kv({type:e,shortcutKeys:t=hf[e]}){return u.jsx(fa,{children:Di({shortcutKeys:t})})}const It=x.forwardRef(({editor:e,type:t,text:n,hideWhenUnavailable:r=!1,onToggled:o,showShortcut:s=!1,onClick:i,children:a,...l},c)=>{const{editor:d}=Ue(e),{isVisible:f,handleMark:h,label:p,canToggle:m,isActive:g,Icon:b,shortcutKeys:v}=Bv({editor:d,type:t,hideWhenUnavailable:r,onToggled:o}),C=x.useCallback(_=>{i?.(_),!_.defaultPrevented&&h()},[h,i]);return f?u.jsx(V,{type:"button",disabled:!m,variant:"ghost","data-active-state":g?"on":"off","data-disabled":!m,role:"button",tabIndex:-1,"aria-label":p,"aria-pressed":g,tooltip:p,onClick:C,...l,ref:c,children:a??u.jsxs(u.Fragment,{children:[u.jsx(b,{className:"tiptap-button-icon"}),n&&u.jsx("span",{className:"tiptap-button-text",children:n}),s&&u.jsx(kv,{type:t,shortcutKeys:v})]})}):null});It.displayName="MarkButton";const af=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 2.5C5.17157 2.5 4.5 3.17157 4.5 4V20C4.5 20.8284 5.17157 21.5 6 21.5H15C16.4587 21.5 17.8576 20.9205 18.8891 19.8891C19.9205 18.8576 20.5 17.4587 20.5 16C20.5 14.5413 19.9205 13.1424 18.8891 12.1109C18.6781 11.9 18.4518 11.7079 18.2128 11.5359C19.041 10.5492 19.5 9.29829 19.5 8C19.5 6.54131 18.9205 5.14236 17.8891 4.11091C16.8576 3.07946 15.4587 2.5 14 2.5H6ZM14 10.5C14.663 10.5 15.2989 10.2366 15.7678 9.76777C16.2366 9.29893 16.5 8.66304 16.5 8C16.5 7.33696 16.2366 6.70107 15.7678 6.23223C15.2989 5.76339 14.663 5.5 14 5.5H7.5V10.5H14ZM7.5 18.5V13.5H15C15.663 13.5 16.2989 13.7634 16.7678 14.2322C17.2366 14.7011 17.5 15.337 17.5 16C17.5 16.663 17.2366 17.2989 16.7678 17.7678C16.2989 18.2366 15.663 18.5 15 18.5H7.5Z",fill:"currentColor"})}));af.displayName="BoldIcon";const lf=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{d:"M15.4545 4.2983C15.6192 3.77115 15.3254 3.21028 14.7983 3.04554C14.2712 2.88081 13.7103 3.1746 13.5455 3.70175L8.54554 19.7017C8.38081 20.2289 8.6746 20.7898 9.20175 20.9545C9.72889 21.1192 10.2898 20.8254 10.4545 20.2983L15.4545 4.2983Z",fill:"currentColor"}),u.jsx("path",{d:"M6.70711 7.29289C7.09763 7.68342 7.09763 8.31658 6.70711 8.70711L3.41421 12L6.70711 15.2929C7.09763 15.6834 7.09763 16.3166 6.70711 16.7071C6.31658 17.0976 5.68342 17.0976 5.29289 16.7071L1.29289 12.7071C0.902369 12.3166 0.902369 11.6834 1.29289 11.2929L5.29289 7.29289C5.68342 6.90237 6.31658 6.90237 6.70711 7.29289Z",fill:"currentColor"}),u.jsx("path",{d:"M17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289L22.7071 11.2929C23.0976 11.6834 23.0976 12.3166 22.7071 12.7071L18.7071 16.7071C18.3166 17.0976 17.6834 17.0976 17.2929 16.7071C16.9024 16.3166 16.9024 15.6834 17.2929 15.2929L20.5858 12L17.2929 8.70711C16.9024 8.31658 16.9024 7.68342 17.2929 7.29289Z",fill:"currentColor"})]}));lf.displayName="Code2Icon";const cf=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{d:"M15.0222 3H19C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H15.693L10.443 19H14C14.5523 19 15 19.4477 15 20C15 20.5523 14.5523 21 14 21H9.02418C9.00802 21.0004 8.99181 21.0004 8.97557 21H5C4.44772 21 4 20.5523 4 20C4 19.4477 4.44772 19 5 19H8.30704L13.557 5H10C9.44772 5 9 4.55228 9 4C9 3.44772 9.44772 3 10 3H14.9782C14.9928 2.99968 15.0075 2.99967 15.0222 3Z",fill:"currentColor"})}));cf.displayName="ItalicIcon";const uf=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{d:"M9.00039 3H16.0001C16.5524 3 17.0001 3.44772 17.0001 4C17.0001 4.55229 16.5524 5 16.0001 5H9.00011C8.68006 4.99983 8.36412 5.07648 8.07983 5.22349C7.79555 5.37051 7.55069 5.5836 7.36585 5.84487C7.181 6.10614 7.06155 6.40796 7.01754 6.72497C6.97352 7.04198 7.00623 7.36492 7.11292 7.66667C7.29701 8.18737 7.02414 8.75872 6.50344 8.94281C5.98274 9.1269 5.4114 8.85403 5.2273 8.33333C5.01393 7.72984 4.94851 7.08396 5.03654 6.44994C5.12456 5.81592 5.36346 5.21229 5.73316 4.68974C6.10285 4.1672 6.59256 3.74101 7.16113 3.44698C7.72955 3.15303 8.36047 2.99975 9.00039 3Z",fill:"currentColor"}),u.jsx("path",{d:"M18 13H20C20.5523 13 21 12.5523 21 12C21 11.4477 20.5523 11 20 11H4C3.44772 11 3 11.4477 3 12C3 12.5523 3.44772 13 4 13H14C14.7956 13 15.5587 13.3161 16.1213 13.8787C16.6839 14.4413 17 15.2044 17 16C17 16.7956 16.6839 17.5587 16.1213 18.1213C15.5587 18.6839 14.7956 19 14 19H6C5.44772 19 5 19.4477 5 20C5 20.5523 5.44772 21 6 21H14C15.3261 21 16.5979 20.4732 17.5355 19.5355C18.4732 18.5979 19 17.3261 19 16C19 14.9119 18.6453 13.8604 18 13Z",fill:"currentColor"})]}));uf.displayName="StrikeIcon";const df=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.29289 7.29289C3.68342 6.90237 4.31658 6.90237 4.70711 7.29289L12.7071 15.2929C13.0976 15.6834 13.0976 16.3166 12.7071 16.7071C12.3166 17.0976 11.6834 17.0976 11.2929 16.7071L3.29289 8.70711C2.90237 8.31658 2.90237 7.68342 3.29289 7.29289Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.7071 7.29289C13.0976 7.68342 13.0976 8.31658 12.7071 8.70711L4.70711 16.7071C4.31658 17.0976 3.68342 17.0976 3.29289 16.7071C2.90237 16.3166 2.90237 15.6834 3.29289 15.2929L11.2929 7.29289C11.6834 6.90237 12.3166 6.90237 12.7071 7.29289Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.4079 14.3995C18.0284 14.0487 18.7506 13.9217 19.4536 14.0397C20.1566 14.1578 20.7977 14.5138 21.2696 15.0481L21.2779 15.0574L21.2778 15.0575C21.7439 15.5988 22 16.2903 22 17C22 18.0823 21.3962 18.8401 20.7744 19.3404C20.194 19.8073 19.4858 20.141 18.9828 20.378C18.9638 20.387 18.9451 20.3958 18.9266 20.4045C18.4473 20.6306 18.2804 20.7817 18.1922 20.918C18.1773 20.9412 18.1619 20.9681 18.1467 21H21C21.5523 21 22 21.4477 22 22C22 22.5523 21.5523 23 21 23H17C16.4477 23 16 22.5523 16 22C16 21.1708 16.1176 20.4431 16.5128 19.832C16.9096 19.2184 17.4928 18.8695 18.0734 18.5956C18.6279 18.334 19.138 18.0901 19.5207 17.7821C19.8838 17.49 20 17.2477 20 17C20 16.7718 19.9176 16.5452 19.7663 16.3672C19.5983 16.1792 19.3712 16.0539 19.1224 16.0121C18.8722 15.9701 18.6152 16.015 18.3942 16.1394C18.1794 16.2628 18.0205 16.4549 17.9422 16.675C17.7572 17.1954 17.1854 17.4673 16.665 17.2822C16.1446 17.0972 15.8728 16.5254 16.0578 16.005C16.2993 15.3259 16.7797 14.7584 17.4039 14.4018L17.4079 14.3995L17.4079 14.3995Z",fill:"currentColor"})]}));df.displayName="SubscriptIcon";const ff=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.7071 7.29289C13.0976 7.68342 13.0976 8.31658 12.7071 8.70711L4.70711 16.7071C4.31658 17.0976 3.68342 17.0976 3.29289 16.7071C2.90237 16.3166 2.90237 15.6834 3.29289 15.2929L11.2929 7.29289C11.6834 6.90237 12.3166 6.90237 12.7071 7.29289Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.29289 7.29289C3.68342 6.90237 4.31658 6.90237 4.70711 7.29289L12.7071 15.2929C13.0976 15.6834 13.0976 16.3166 12.7071 16.7071C12.3166 17.0976 11.6834 17.0976 11.2929 16.7071L3.29289 8.70711C2.90237 8.31658 2.90237 7.68342 3.29289 7.29289Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.405 1.40657C18.0246 1.05456 18.7463 0.92634 19.4492 1.04344C20.1521 1.16054 20.7933 1.51583 21.2652 2.0497L21.2697 2.05469L21.2696 2.05471C21.7431 2.5975 22 3.28922 22 4.00203C22 5.08579 21.3952 5.84326 20.7727 6.34289C20.1966 6.80531 19.4941 7.13675 18.9941 7.37261C18.9714 7.38332 18.9491 7.39383 18.9273 7.40415C18.4487 7.63034 18.2814 7.78152 18.1927 7.91844C18.1778 7.94155 18.1625 7.96834 18.1473 8.00003H21C21.5523 8.00003 22 8.44774 22 9.00003C22 9.55231 21.5523 10 21 10H17C16.4477 10 16 9.55231 16 9.00003C16 8.17007 16.1183 7.44255 16.5138 6.83161C16.9107 6.21854 17.4934 5.86971 18.0728 5.59591C18.6281 5.33347 19.1376 5.09075 19.5208 4.78316C19.8838 4.49179 20 4.25026 20 4.00203C20 3.77192 19.9178 3.54865 19.7646 3.37182C19.5968 3.18324 19.3696 3.05774 19.1205 3.01625C18.8705 2.97459 18.6137 3.02017 18.3933 3.14533C18.1762 3.26898 18.0191 3.45826 17.9406 3.67557C17.7531 4.19504 17.18 4.46414 16.6605 4.27662C16.141 4.0891 15.8719 3.51596 16.0594 2.99649C16.303 2.3219 16.7817 1.76125 17.4045 1.40689L17.405 1.40657Z",fill:"currentColor"})]}));ff.displayName="SuperscriptIcon";const pf=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4C7 3.44772 6.55228 3 6 3C5.44772 3 5 3.44772 5 4V10C5 11.8565 5.7375 13.637 7.05025 14.9497C8.36301 16.2625 10.1435 17 12 17C13.8565 17 15.637 16.2625 16.9497 14.9497C18.2625 13.637 19 11.8565 19 10V4C19 3.44772 18.5523 3 18 3C17.4477 3 17 3.44772 17 4V10C17 11.3261 16.4732 12.5979 15.5355 13.5355C14.5979 14.4732 13.3261 15 12 15C10.6739 15 9.40215 14.4732 8.46447 13.5355C7.52678 12.5979 7 11.3261 7 10V4ZM4 19C3.44772 19 3 19.4477 3 20C3 20.5523 3.44772 21 4 21H20C20.5523 21 21 20.5523 21 20C21 19.4477 20.5523 19 20 19H4Z",fill:"currentColor"})}));pf.displayName="UnderlineIcon";const Ov={bold:af,italic:cf,underline:pf,strike:uf,code:lf,superscript:ff,subscript:df},hf={bold:"mod+b",italic:"mod+i",underline:"mod+u",strike:"mod+shift+s",code:"mod+e",superscript:"mod+.",subscript:"mod+,"};function ha(e,t){return!e||!e.isEditable||!Bi(t,e)||Ko(e,["image"])?!1:e.can().toggleMark(t)}function Iv(e,t){return!e||!e.isEditable?!1:e.isActive(t)}function Lv(e,t){return!e||!e.isEditable||!ha(e,t)?!1:e.chain().focus().toggleMark(t).run()}function Pv(e){const{editor:t,type:n,hideWhenUnavailable:r}=e;return t?r?!t.isEditable||!Bi(n,t)?!1:t.isActive("code")?!0:ha(t,n):!0:!1}function Dv(e){return{bold:"굵게",italic:"기울임꼴",strike:"취소선",code:"코드",underline:"밑줄",superscript:"위첨자",subscript:"아래첨자"}[e]}function Bv(e){const{editor:t,type:n,hideWhenUnavailable:r=!1,onToggled:o}=e,{editor:s}=Ue(t),[i,a]=x.useState(!0),l=ha(s,n),c=Iv(s,n);x.useEffect(()=>{if(!s)return;const f=()=>{a(Pv({editor:s,type:n,hideWhenUnavailable:r}))};return f(),s.on("selectionUpdate",f),()=>{s.off("selectionUpdate",f)}},[s,n,r]);const d=x.useCallback(()=>{if(!s)return!1;const f=Lv(s,n);return f&&o?.(),f},[s,n,o]);return{isVisible:i,isActive:c,handleMark:d,canToggle:l,label:Dv(n),shortcutKeys:hf[n],Icon:Ov[n]}}function Hv(e="max",t=768){const[n,r]=x.useState(void 0);return x.useEffect(()=>{const o=e==="min"?`(min-width: ${t}px)`:`(max-width: ${t-1}px)`,s=window.matchMedia(o),i=a=>r(a.matches);return r(s.matches),s.addEventListener("change",i),()=>s.removeEventListener("change",i)},[e,t]),!!n}const gf=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 4C21 3.44772 20.5523 3 20 3C19.4477 3 19 3.44772 19 4V11C19 11.7956 18.6839 12.5587 18.1213 13.1213C17.5587 13.6839 16.7956 14 16 14H6.41421L9.70711 10.7071C10.0976 10.3166 10.0976 9.68342 9.70711 9.29289C9.31658 8.90237 8.68342 8.90237 8.29289 9.29289L3.29289 14.2929C2.90237 14.6834 2.90237 15.3166 3.29289 15.7071L8.29289 20.7071C8.68342 21.0976 9.31658 21.0976 9.70711 20.7071C10.0976 20.3166 10.0976 19.6834 9.70711 19.2929L6.41421 16H16C17.3261 16 18.5979 15.4732 19.5355 14.5355C20.4732 13.5979 21 12.3261 21 11V4Z",fill:"currentColor"})}));gf.displayName="CornerDownLeftIcon";const mf=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{d:"M14 3C14 2.44772 14.4477 2 15 2H21C21.5523 2 22 2.44772 22 3V9C22 9.55228 21.5523 10 21 10C20.4477 10 20 9.55228 20 9V5.41421L10.7071 14.7071C10.3166 15.0976 9.68342 15.0976 9.29289 14.7071C8.90237 14.3166 8.90237 13.6834 9.29289 13.2929L18.5858 4H15C14.4477 4 14 3.55228 14 3Z",fill:"currentColor"}),u.jsx("path",{d:"M4.29289 7.29289C4.48043 7.10536 4.73478 7 5 7H11C11.5523 7 12 6.55228 12 6C12 5.44772 11.5523 5 11 5H5C4.20435 5 3.44129 5.31607 2.87868 5.87868C2.31607 6.44129 2 7.20435 2 8V19C2 19.7957 2.31607 20.5587 2.87868 21.1213C3.44129 21.6839 4.20435 22 5 22H16C16.7957 22 17.5587 21.6839 18.1213 21.1213C18.6839 20.5587 19 19.7957 19 19V13C19 12.4477 18.5523 12 18 12C17.4477 12 17 12.4477 17 13V19C17 19.2652 16.8946 19.5196 16.7071 19.7071C16.5196 19.8946 16.2652 20 16 20H5C4.73478 20 4.48043 19.8946 4.29289 19.7071C4.10536 19.5196 4 19.2652 4 19V8C4 7.73478 4.10536 7.48043 4.29289 7.29289Z",fill:"currentColor"})]}));mf.displayName="ExternalLinkIcon";const ga=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{d:"M16.9958 1.06669C15.4226 1.05302 13.907 1.65779 12.7753 2.75074L12.765 2.76086L11.045 4.47086C10.6534 4.86024 10.6515 5.49341 11.0409 5.88507C11.4303 6.27673 12.0634 6.27858 12.4551 5.88919L14.1697 4.18456C14.9236 3.45893 15.9319 3.05752 16.9784 3.06662C18.0272 3.07573 19.0304 3.49641 19.772 4.23804C20.5137 4.97967 20.9344 5.98292 20.9435 7.03171C20.9526 8.07776 20.5515 9.08563 19.8265 9.83941L16.833 12.8329C16.4274 13.2386 15.9393 13.5524 15.4019 13.7529C14.8645 13.9533 14.2903 14.0359 13.7181 13.9949C13.146 13.9539 12.5894 13.7904 12.0861 13.5154C11.5827 13.2404 11.1444 12.8604 10.8008 12.401C10.47 11.9588 9.84333 11.8685 9.40108 12.1993C8.95883 12.5301 8.86849 13.1568 9.1993 13.599C9.71464 14.288 10.3721 14.858 11.1272 15.2705C11.8822 15.683 12.7171 15.9283 13.5753 15.9898C14.4334 16.0513 15.2948 15.9274 16.1009 15.6267C16.907 15.326 17.639 14.8555 18.2473 14.247L21.2472 11.2471L21.2593 11.2347C22.3523 10.1031 22.9571 8.58751 22.9434 7.01433C22.9297 5.44115 22.2987 3.93628 21.1863 2.82383C20.0738 1.71138 18.5689 1.08036 16.9958 1.06669Z",fill:"currentColor"}),u.jsx("path",{d:"M10.4247 8.0102C9.56657 7.94874 8.70522 8.07256 7.89911 8.37326C7.09305 8.67395 6.36096 9.14458 5.75272 9.753L2.75285 12.7529L2.74067 12.7653C1.64772 13.8969 1.04295 15.4125 1.05662 16.9857C1.07029 18.5589 1.70131 20.0637 2.81376 21.1762C3.9262 22.2886 5.43108 22.9196 7.00426 22.9333C8.57744 22.947 10.0931 22.3422 11.2247 21.2493L11.2371 21.2371L12.9471 19.5271C13.3376 19.1366 13.3376 18.5034 12.9471 18.1129C12.5565 17.7223 11.9234 17.7223 11.5328 18.1129L9.82932 19.8164C9.07555 20.5414 8.06768 20.9425 7.02164 20.9334C5.97285 20.9243 4.9696 20.5036 4.22797 19.762C3.48634 19.0203 3.06566 18.0171 3.05655 16.9683C3.04746 15.9222 3.44851 14.9144 4.17355 14.1606L7.16719 11.167C7.5727 10.7613 8.06071 10.4476 8.59811 10.2471C9.13552 10.0467 9.70976 9.96412 10.2819 10.0051C10.854 10.0461 11.4106 10.2096 11.9139 10.4846C12.4173 10.7596 12.8556 11.1397 13.1992 11.599C13.53 12.0412 14.1567 12.1316 14.5989 11.8007C15.0412 11.4699 15.1315 10.8433 14.8007 10.401C14.2854 9.71205 13.6279 9.14198 12.8729 8.72948C12.1178 8.31697 11.2829 8.07166 10.4247 8.0102Z",fill:"currentColor"})]}));ga.displayName="LinkIcon";const bf=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 5V4C7 3.17477 7.40255 2.43324 7.91789 1.91789C8.43324 1.40255 9.17477 1 10 1H14C14.8252 1 15.5668 1.40255 16.0821 1.91789C16.5975 2.43324 17 3.17477 17 4V5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H20V20C20 20.8252 19.5975 21.5668 19.0821 22.0821C18.5668 22.5975 17.8252 23 17 23H7C6.17477 23 5.43324 22.5975 4.91789 22.0821C4.40255 21.5668 4 20.8252 4 20V7H3C2.44772 7 2 6.55228 2 6C2 5.44772 2.44772 5 3 5H7ZM9 4C9 3.82523 9.09745 3.56676 9.33211 3.33211C9.56676 3.09745 9.82523 3 10 3H14C14.1748 3 14.4332 3.09745 14.6679 3.33211C14.9025 3.56676 15 3.82523 15 4V5H9V4ZM6 7V20C6 20.1748 6.09745 20.4332 6.33211 20.6679C6.56676 20.9025 6.82523 21 7 21H17C17.1748 21 17.4332 20.9025 17.6679 20.6679C17.9025 20.4332 18 20.1748 18 20V7H6Z",fill:"currentColor"})}));bf.displayName="TrashIcon";function vf({className:e,type:t,...n}){return u.jsx("input",{type:t,"data-slot":"tiptap-input",className:ke("tiptap-input",e),...n})}const yf=x.forwardRef(({className:e,children:t,...n},r)=>u.jsx(V,{type:"button",className:e,variant:"ghost",role:"button",tabIndex:-1,"aria-label":"Link",tooltip:"링크",ref:r,...n,children:t||u.jsx(ga,{className:"tiptap-button-icon"})}));yf.displayName="LinkButton";const Fv=({url:e,setUrl:t,setLink:n,removeLink:r,openLink:o,isActive:s})=>{const i=Hv(),a=l=>{l.key==="Enter"&&(l.preventDefault(),n())};return u.jsx(Fe,{style:{...i?{boxShadow:"none",border:0}:{}},children:u.jsx($e,{style:{...i?{padding:0}:{}},children:u.jsxs(Be,{orientation:"horizontal",children:[u.jsx(vf,{type:"url",placeholder:"Paste a link...",value:e,onChange:l=>t(l.target.value),onKeyDown:a,autoFocus:!0,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",className:"tiptap-link-input"}),u.jsx(Qt,{children:u.jsx(V,{type:"button",onClick:n,title:"Apply link",disabled:!e&&!s,variant:"ghost",children:u.jsx(gf,{className:"tiptap-button-icon"})})}),u.jsx(Hi,{}),u.jsxs(Qt,{children:[u.jsx(Qt,{children:u.jsx(V,{type:"button",onClick:o,title:"Open in new window",disabled:!e&&!s,variant:"ghost",children:u.jsx(mf,{className:"tiptap-button-icon"})})}),u.jsx(Qt,{children:u.jsx(V,{type:"button",onClick:r,title:"Remove link",disabled:!e&&!s,variant:"ghost",children:u.jsx(bf,{className:"tiptap-button-icon"})})})]})]})})})},Ef=x.forwardRef(({editor:e,hideWhenUnavailable:t=!1,onSetLink:n,onOpenChange:r,autoOpenOnLinkActive:o=!0,onClick:s,children:i,...a},l)=>{const{editor:c}=Ue(e),[d,f]=x.useState(!1),{isVisible:h,canSet:p,isActive:m,url:g,setUrl:b,setLink:v,removeLink:C,openLink:_,label:S,Icon:N}=zv({editor:c,hideWhenUnavailable:t,onSetLink:n}),A=x.useCallback(D=>{f(D),r?.(D)},[r]),R=x.useCallback(()=>{v(),f(!1)},[v]),O=x.useCallback(D=>{s?.(D),!D.defaultPrevented&&f(!d)},[s,d]);return x.useEffect(()=>{o&&m&&f(!0)},[o,m]),h?u.jsxs(jt,{open:d,onOpenChange:A,children:[u.jsx(zt,{asChild:!0,children:u.jsx(yf,{disabled:!p,"data-active-state":m?"on":"off","data-disabled":!p,"aria-label":S,"aria-pressed":m,onClick:O,...a,ref:l,children:i??u.jsx(N,{className:"tiptap-button-icon"})})}),u.jsx(Vt,{collisionPadding:4,children:u.jsx(Fv,{url:g,setUrl:b,setLink:R,removeLink:C,openLink:_,isActive:m})})]}):null});Ef.displayName="LinkPopover";function Cf(e){if(!e||!e.isEditable||Ko(e,["image"],!0))return!1;try{return e.can().setMark("link")}catch{return!1}}function wf(e){return!e||!e.isEditable?!1:e.isActive("link")}function $v(e){const{editor:t,hideWhenUnavailable:n}=e;if(!t||!t.isEditable)return!1;const r=Bi("link",t);return n?r?t.isActive("code")?!0:Cf(t):!1:!0}function Uv(e){const{editor:t,onSetLink:n}=e,[r,o]=x.useState(null);x.useEffect(()=>{if(!t)return;const{href:l}=t.getAttributes("link");wf(t)&&r===null&&o(l||"")},[t,r]),x.useEffect(()=>{if(!t)return;const l=()=>{const{href:c}=t.getAttributes("link");o(c||"")};return t.on("selectionUpdate",l),()=>{t.off("selectionUpdate",l)}},[t]);const s=x.useCallback(()=>{if(!r||!t)return;const{selection:l}=t.state,c=l.empty;let d=t.chain().focus();d=d.extendMarkRange("link").setLink({href:r}),c&&(d=d.insertContent({type:"text",text:r})),d.run(),o(null),n?.()},[t,n,r]),i=x.useCallback(()=>{t&&(t.chain().focus().extendMarkRange("link").unsetLink().setMeta("preventAutolink",!0).run(),o(""))},[t]),a=x.useCallback((l="_blank",c="noopener,noreferrer")=>{if(!r)return;const d=kh(r,window.location.href);d!=="#"&&window.open(d,l,c)},[r]);return{url:r||"",setUrl:o,setLink:s,removeLink:i,openLink:a}}function jv(e){const{editor:t,hideWhenUnavailable:n=!1}=e,r=Cf(t),o=wf(t),[s,i]=x.useState(!0);return x.useEffect(()=>{if(!t)return;const a=()=>{i($v({editor:t,hideWhenUnavailable:n}))};return a(),t.on("selectionUpdate",a),()=>{t.off("selectionUpdate",a)}},[t,n]),{isVisible:s,canSet:r,isActive:o}}function zv(e){const{editor:t,hideWhenUnavailable:n=!1,onSetLink:r}=e||{},{editor:o}=Ue(t),{isVisible:s,canSet:i,isActive:a}=jv({editor:o,hideWhenUnavailable:n}),l=Uv({editor:o,onSetLink:r});return{isVisible:s,canSet:i,isActive:a,label:"Link",Icon:ga,...l}}const xf=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{d:"M4 5V19H20V7H11.5858L9.58579 5H4ZM12.4142 5H21C21.5523 5 22 5.44772 22 6V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H10.4142L12.4142 5ZM10 10.5C10 11.3284 9.32843 12 8.5 12C7.67157 12 7 11.3284 7 10.5C7 9.67157 7.67157 9 8.5 9C9.32843 9 10 9.67157 10 10.5ZM18 17L14 11L7 17H18Z"})}));xf.displayName="UploadableIcon";const _f=x.createContext(null);function Sf(){const e=x.useContext(_f);if(!e)throw new Error("useFileHandlerContext는 FileHandlerContext.Provider 안에서만 사용할 수 있습니다.");return e}const Nf=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{d:"M14 13.5V8C14 5.79086 12.2091 4 10 4C7.79086 4 6 5.79086 6 8V13.5C6 17.0899 8.91015 20 12.5 20C16.0899 20 19 17.0899 19 13.5V4H21V13.5C21 18.1944 17.1944 22 12.5 22C7.80558 22 4 18.1944 4 13.5V8C4 4.68629 6.68629 2 10 2C13.3137 2 16 4.68629 16 8V13.5C16 15.433 14.433 17 12.5 17C10.567 17 9 15.433 9 13.5V8H11V13.5C11 14.3284 11.6716 15 12.5 15C13.3284 15 14 14.3284 14 13.5Z"})}));Nf.displayName="UploadableFileIcon";const Af=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{d:"M15 8V4H5V20H19V8H15ZM3 2.9918C3 2.44405 3.44749 2 3.9985 2H16L20.9997 7L21 20.9925C21 21.5489 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5447 3 21.0082V2.9918ZM11 9.5C11 10.3284 10.3284 11 9.5 11C8.67157 11 8 10.3284 8 9.5C8 8.67157 8.67157 8 9.5 8C10.3284 8 11 8.67157 11 9.5ZM17.5 17L13.5 10L8 17H17.5Z"})}));Af.displayName="UploadableImageIcon";const vi=x.forwardRef(({editor:e,uploadType:t,text:n,onClick:r,externalInputRef:o,...s},i)=>{const{editor:a}=Ue(e),{resolveFileUrl:l,insertFile:c}=Sf(),d=x.useRef(null),f=o??d,h=x.useCallback(v=>{r?.(v),!v.defaultPrevented&&f.current?.click()},[r,f]),p=x.useCallback(async v=>{if(!a)return;const C=Array.from(v.target.files??[]);if(C.length===0)return;const _=a.state.selection.anchor;for(const S of C){const N=await l(S);if(!N)return;c(a,S,N,_)}v.target.value=""},[a,l,c]),m=t==="image"?"image/*":"*/*",g=t==="image"?"이미지 업로드":"파일 업로드",b=t==="image"?Af:Nf;return u.jsxs(u.Fragment,{children:[u.jsxs(V,{type:"button",variant:"ghost",role:"button",tabIndex:-1,"aria-label":g,tooltip:g,onClick:h,...s,ref:i,children:[u.jsx(b,{className:"tiptap-button-icon"}),n&&u.jsx("span",{className:"tiptap-button-text",children:n})]}),!o&&u.jsx("input",{ref:d,type:"file",accept:m,style:{display:"none"},onChange:p})]})});vi.displayName="UploadableButton";const Tf=x.forwardRef(({editor:e,portal:t=!1,onOpenChange:n,...r},o)=>{const{editor:s}=Ue(e),{resolveFileUrl:i,insertFile:a}=Sf(),[l,c]=x.useState(!1),d=x.useRef(null),f=x.useRef(null),h=x.useCallback(m=>{s&&(c(m),n?.(m))},[s,n]),p=x.useCallback(async m=>{if(!s)return;const g=Array.from(m.target.files??[]);if(g.length===0)return;const b=s.state.selection.anchor;for(const v of g){const C=await i(v);if(!C)return;a(s,v,C,b)}m.target.value=""},[s,i,a]);return u.jsxs(u.Fragment,{children:[u.jsxs(vr,{modal:!0,open:l,onOpenChange:h,children:[u.jsx(On,{asChild:!0,children:u.jsxs(V,{type:"button",variant:"ghost",role:"button",tabIndex:-1,"aria-label":"첨부",tooltip:"첨부",...r,ref:o,children:[u.jsx(xf,{className:"tiptap-button-icon"}),u.jsx(pr,{className:"tiptap-button-dropdown-small"})]})}),u.jsx(In,{align:"start",portal:t,children:u.jsx(Fe,{children:u.jsx($e,{children:u.jsxs(Qt,{children:[u.jsx(je,{asChild:!0,children:u.jsx(vi,{editor:s,uploadType:"image",text:"사진",externalInputRef:d})}),u.jsx(je,{asChild:!0,children:u.jsx(vi,{editor:s,uploadType:"file",text:"파일",externalInputRef:f})})]})})})})]}),u.jsx("input",{ref:d,type:"file",accept:"image/*",style:{display:"none"},onChange:p}),u.jsx("input",{ref:f,type:"file",accept:"*/*",style:{display:"none"},onChange:p})]})});Tf.displayName="UploadableDropdownMenu";const Rf=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{d:"M21 3C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H21ZM11 13H4V19H11V13ZM20 13H13V19H20V13ZM11 5H4V11H11V5ZM20 5H13V11H20V5Z"})}));Rf.displayName="TableIcon";const Vv=10,Kv=10;function Wv({editor:e}){const[t,n]=x.useState(null),r=(i,a)=>{e.chain().focus().insertTable({rows:i,cols:a,withHeaderRow:!1}).run()},o=t?.row??0,s=t?.col??0;return u.jsxs(jt,{children:[u.jsx(zt,{asChild:!0,children:u.jsx(V,{"data-style":"ghost",tooltip:"표 삽입",children:u.jsx(Rf,{className:"tiptap-button-icon"})})}),u.jsx(Vt,{align:"start",children:u.jsx(Fe,{children:u.jsxs($e,{children:[u.jsx("div",{className:"tiptap-table-picker-grid",onMouseLeave:()=>n(null),children:Array.from({length:Vv},(i,a)=>Array.from({length:Kv},(l,c)=>{const d=a+1,f=c+1,h=d<=o&&f<=s;return u.jsx("div",{className:`tiptap-table-picker-cell${h?" is-selected":""}`,onMouseEnter:()=>n({row:d,col:f}),onClick:()=>r(d,f)},`${d}-${f}`)}))}),u.jsx("p",{className:"tiptap-table-picker-label",children:o>0&&s>0?`${o} × ${s}`:" "})]})})})]})}const yi=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 6C7 5.44772 7.44772 5 8 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H8C7.44772 7 7 6.55228 7 6Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 12C7 11.4477 7.44772 11 8 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H8C7.44772 13 7 12.5523 7 12Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 18C7 17.4477 7.44772 17 8 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H8C7.44772 19 7 18.5523 7 18Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H3.01C3.56228 5 4.01 5.44772 4.01 6C4.01 6.55228 3.56228 7 3.01 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 12C2 11.4477 2.44772 11 3 11H3.01C3.56228 11 4.01 11.4477 4.01 12C4.01 12.5523 3.56228 13 3.01 13H3C2.44772 13 2 12.5523 2 12Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 18C2 17.4477 2.44772 17 3 17H3.01C3.56228 17 4.01 17.4477 4.01 18C4.01 18.5523 3.56228 19 3.01 19H3C2.44772 19 2 18.5523 2 18Z",fill:"currentColor"})]}));yi.displayName="ListIcon";const Mf=x.memo(({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 6C9 5.44772 9.44772 5 10 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H10C9.44772 7 9 6.55228 9 6Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 12C9 11.4477 9.44772 11 10 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H10C9.44772 13 9 12.5523 9 12Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 18C9 17.4477 9.44772 17 10 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H10C9.44772 19 9 18.5523 9 18Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 6C3 5.44772 3.44772 5 4 5H5C5.55228 5 6 5.44772 6 6V10C6 10.5523 5.55228 11 5 11C4.44772 11 4 10.5523 4 10V7C3.44772 7 3 6.55228 3 6Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 10C3 9.44772 3.44772 9 4 9H6C6.55228 9 7 9.44772 7 10C7 10.5523 6.55228 11 6 11H4C3.44772 11 3 10.5523 3 10Z",fill:"currentColor"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.82219 13.0431C6.54543 13.4047 6.99997 14.1319 6.99997 15C6.99997 15.5763 6.71806 16.0426 6.48747 16.35C6.31395 16.5814 6.1052 16.8044 5.91309 17H5.99997C6.55226 17 6.99997 17.4477 6.99997 18C6.99997 18.5523 6.55226 19 5.99997 19H3.99997C3.44769 19 2.99997 18.5523 2.99997 18C2.99997 17.4237 3.28189 16.9575 3.51247 16.65C3.74323 16.3424 4.03626 16.0494 4.26965 15.8161C4.27745 15.8083 4.2852 15.8006 4.29287 15.7929C4.55594 15.5298 4.75095 15.3321 4.88748 15.15C4.96287 15.0495 4.99021 14.9922 4.99911 14.9714C4.99535 14.9112 4.9803 14.882 4.9739 14.8715C4.96613 14.8588 4.95382 14.845 4.92776 14.8319C4.87723 14.8067 4.71156 14.7623 4.44719 14.8944C3.95321 15.1414 3.35254 14.9412 3.10555 14.4472C2.85856 13.9533 3.05878 13.3526 3.55276 13.1056C4.28839 12.7378 5.12272 12.6934 5.82219 13.0431Z",fill:"currentColor"})]}));Mf.displayName="ListOrderedIcon";function Gv({editor:e}){const[t,n]=x.useState(!1),r=ot.useEditorState({editor:e,selector:({editor:s})=>({bulletList:s.isActive("bulletList"),orderedList:s.isActive("orderedList"),paragraph:s.isActive("paragraph")})}),o=s=>{s(),n(!1)};return u.jsxs(jt,{open:t,onOpenChange:n,children:[u.jsx(zt,{asChild:!0,children:u.jsx(V,{"data-style":"ghost",tooltip:"목록",children:u.jsx(yi,{className:"tiptap-button-icon"})})}),u.jsx(Vt,{align:"start",children:u.jsx(Fe,{children:u.jsx($e,{children:u.jsxs(Be,{orientation:"horizontal",children:[u.jsx(V,{"data-style":"ghost",tooltip:"글머리 기호 목록","aria-pressed":r.bulletList,onClick:()=>o(()=>e.chain().focus().toggleBulletList().run()),children:u.jsx(yi,{className:"tiptap-button-icon"})}),u.jsx(V,{"data-style":"ghost",tooltip:"번호 매기기 목록","aria-pressed":r.orderedList,onClick:()=>o(()=>e.chain().focus().toggleOrderedList().run()),children:u.jsx(Mf,{className:"tiptap-button-icon"})}),u.jsx(V,{"data-style":"ghost",tooltip:"단락","aria-pressed":r.paragraph,onClick:()=>o(()=>e.chain().focus().clearNodes().run()),children:u.jsx(ls,{className:"tiptap-button-icon"})})]})})})})]})}const kf=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{d:"M2 11H4V13H2V11ZM6 11H18V13H6V11ZM20 11H22V13H20V11Z"})}));kf.displayName="SeparatorIcon";const Ir={flex:1,height:"1px",background:"var(--tt-gray-light-a-400)"},Pl={fontSize:"0.65rem",color:"var(--tt-gray-light-a-600)"};function Zv({style:e}){switch(e){case"thin":return u.jsx("span",{style:{display:"block",width:"80%",height:"1px",background:"var(--tt-gray-light-a-400)"}});case"thick":return u.jsx("span",{style:{display:"block",width:"80%",height:"3px",background:"var(--tt-gray-light-a-700)"}});case"dashed":return u.jsx("span",{style:{display:"block",width:"80%",borderTop:"1px dashed var(--tt-gray-light-a-400)"}});case"short":return u.jsx("span",{style:{display:"block",width:"30%",height:"1px",background:"var(--tt-gray-light-a-400)"}});case"dots":return u.jsx("span",{style:{letterSpacing:"0.4em",fontSize:"1rem",color:"var(--tt-gray-light-a-600)"},children:"· · ·"});case"diamond":return u.jsxs("span",{style:{display:"flex",alignItems:"center",width:"80%",gap:"6px"},children:[u.jsx("span",{style:Ir}),u.jsx("span",{style:Pl,children:"◆"}),u.jsx("span",{style:Ir})]});case"circle":return u.jsxs("span",{style:{display:"flex",alignItems:"center",width:"80%",gap:"6px"},children:[u.jsx("span",{style:Ir}),u.jsx("span",{style:{...Pl,fontSize:"0.75rem"},children:"○"}),u.jsx("span",{style:Ir})]})}}const qv=["thin","thick","dashed","short","dots","diamond","circle"];function Yv({editor:e}){const[t,n]=x.useState(!1),r=o=>{e.chain().focus().setHr({style:o}).run(),n(!1)};return u.jsxs(jt,{open:t,onOpenChange:n,children:[u.jsx(zt,{asChild:!0,children:u.jsx(V,{"data-style":"ghost",tooltip:"구분선 삽입",children:u.jsx(kf,{className:"tiptap-button-icon"})})}),u.jsx(Vt,{align:"start",children:u.jsx(Fe,{children:u.jsx($e,{children:u.jsx(Be,{orientation:"vertical",children:qv.map(o=>u.jsx(V,{"data-style":"ghost",className:"tiptap-hr-style-button",onClick:()=>r(o),children:u.jsx(Zv,{style:o})},o))})})})})]})}const ma=x.memo(({className:e,...t})=>u.jsx("svg",{width:"24",height:"24",className:e,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:u.jsx("path",{d:"M4.58341 17.3211C3.55316 16.2274 3 15 3 13.0103C3 9.51086 5.45651 6.37366 9.03059 4.82318L9.92328 6.20079C6.58804 8.00539 5.93618 10.346 5.67564 11.822C6.21263 11.5443 6.91558 11.4466 7.60471 11.5105C9.40908 11.6778 10.8312 13.159 10.8312 15C10.8312 16.933 9.26416 18.5 7.33116 18.5C6.2581 18.5 5.23196 18.0095 4.58341 17.3211ZM14.5834 17.3211C13.5532 16.2274 13 15 13 13.0103C13 9.51086 15.4565 6.37366 19.0306 4.82318L19.9233 6.20079C16.588 8.00539 15.9362 10.346 15.6756 11.822C16.2126 11.5443 16.9156 11.4466 17.6047 11.5105C19.4091 11.6778 20.8312 13.159 20.8312 15C20.8312 16.933 19.2642 18.5 17.3312 18.5C16.2581 18.5 15.232 18.0095 14.5834 17.3211Z"})}));ma.displayName="DoubleQuotesIcon";const Dl={height:"2px",borderRadius:"2px",background:"var(--tt-gray-light-a-300)"};function Xv({style:e}){if(e==="quote")return u.jsx("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",width:"80%"},children:u.jsx(ma,{style:{width:"14px",height:"14px",color:"var(--tt-gray-light-a-500)"}})});if(e==="bar")return u.jsxs("span",{style:{display:"flex",gap:"2px",width:"80%",alignItems:"center"},children:[u.jsx("span",{style:{height:"12px",width:"2px",borderRadius:"2px",background:"var(--tt-gray-light-a-500)",flexShrink:0}}),u.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:"4px",flex:1,alignItems:"flex-start"},children:[u.jsx("span",{style:{...Dl,width:"100%"}}),u.jsx("span",{style:{...Dl,width:"70%"}})]})]});if(e==="box")return u.jsx("span",{style:{display:"flex",flexDirection:"column",gap:"4px",width:"80%",border:"1px dotted var(--tt-gray-light-a-400)",borderRadius:"3px",padding:"6px 8px",backgroundColor:"var(--tt-gray-light-a-100)"}})}function Jv({editor:e}){const[t,n]=x.useState(!1),r=ot.useEditorState({editor:e,selector:({editor:i})=>({quote:i.isActive("blockquote",{style:"quote"}),bar:i.isActive("blockquote",{style:"bar"}),box:i.isActive("blockquote",{style:"box"})})}),o=i=>{r[i]?e.chain().focus().toggleBlockquote().run():e.isActive("blockquote")?e.chain().focus().updateAttributes("blockquote",{style:i}).run():e.chain().focus().toggleBlockquote().updateAttributes("blockquote",{style:i}).run(),n(!1)},s=()=>{e.chain().focus().clearNodes().run(),n(!1)};return u.jsxs(jt,{open:t,onOpenChange:n,children:[u.jsx(zt,{asChild:!0,children:u.jsx(V,{"data-style":"ghost",tooltip:"인용구 삽입",children:u.jsx(ma,{className:"tiptap-button-icon"})})}),u.jsx(Vt,{align:"start",children:u.jsx(Fe,{children:u.jsx($e,{children:u.jsxs(Be,{orientation:"vertical",children:[["quote","bar","box"].map(i=>u.jsx(V,{"data-style":"ghost",className:"tiptap-hr-style-button","aria-pressed":r[i],onClick:()=>o(i),children:u.jsx(Xv,{style:i})},i)),u.jsx(V,{"data-style":"ghost",className:"tiptap-hr-style-button",onClick:s,children:u.jsx(ls,{className:"tiptap-button-icon"})})]})})})})]})}const Bs={basic:"기본 모드",expert:"전문가 모드"};function Qv({mode:e,onModeChange:t}){return u.jsxs(vr,{children:[u.jsx(On,{asChild:!0,children:u.jsxs(V,{"data-style":"ghost",children:[Bs[e],u.jsx(pr,{})]})}),u.jsx(In,{portal:!1,children:u.jsx(Fe,{children:u.jsx($e,{children:Object.keys(Bs).map(n=>u.jsx(je,{"data-active-state":e===n?"on":"off",onSelect:()=>t(n),asChild:!0,children:u.jsx(V,{"data-style":"ghost","data-active-state":e===n?"on":"off",children:Bs[n]})},n))})})})]})}function e2({editor:e}){const[t,n]=x.useState("basic");return u.jsx(Wo,{className:"my-toolbar",children:u.jsxs(Go,{children:[u.jsx(Tf,{editor:e,portal:!1}),t==="basic"?u.jsx(u.Fragment,{children:u.jsx(ef,{editor:e,portal:!1})}):u.jsx(u.Fragment,{children:u.jsx(tf,{editor:e,portal:!1})}),u.jsx(ht,{}),u.jsx(It,{type:"bold"}),u.jsx(It,{type:"italic"}),u.jsx(It,{type:"strike"}),u.jsx(It,{type:"superscript"}),u.jsx(It,{type:"subscript"}),u.jsx(It,{type:"underline"}),u.jsx(It,{type:"code"}),u.jsx(Ef,{}),u.jsx(ed,{editor:e}),u.jsx(ht,{}),u.jsx(Fn,{editor:e,align:"left"}),u.jsx(Fn,{editor:e,align:"center"}),u.jsx(Fn,{editor:e,align:"right"}),u.jsx(Fn,{editor:e,align:"justify"}),u.jsx(ht,{}),u.jsx(Wv,{editor:e}),u.jsx(Gv,{editor:e}),u.jsx(Yv,{editor:e}),u.jsx(Jv,{editor:e}),u.jsx(ht,{}),u.jsx(Qv,{mode:t,onModeChange:n})]})})}var t2=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:o})=>new Q.Plugin({key:e||new Q.PluginKey("fileHandler"),props:{handleDrop(s,i){var a,l;if(!r||(a=i.dataTransfer)!=null&&a.types.includes("application/x-prosemirror-slice")||!((l=i.dataTransfer)!=null&&l.files.length))return!1;const c=s.posAtCoords({left:i.clientX,top:i.clientY});let d=Array.from(i.dataTransfer.files);return o&&(d=d.filter(f=>o.includes(f.type))),d.length===0?!1:(i.preventDefault(),i.stopPropagation(),r(t,d,c?.pos||0),!0)},handlePaste(s,i){var a;if(!n||!((a=i.clipboardData)!=null&&a.files.length))return!1;let l=Array.from(i.clipboardData.files);const c=i.clipboardData.getData("text/html");return o&&(l=l.filter(d=>o.includes(d.type))),!(l.length===0||(i.preventDefault(),i.stopPropagation(),n(t,l,c),c.length>0))}}}),n2=w.Extension.create({name:"fileHandler",addOptions(){return{onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0}},addProseMirrorPlugins(){return[t2({key:new Q.PluginKey(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}}),r2=n2,o2=w.Node.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
42
42
|
|
|
43
43
|
`):""}),s2=o2,i2=w.Node.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),a2=i2,Lr=" ",Hs=" ",l2=w.Node.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",w.mergeAttributes(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(n.length===1&&n[0].type==="image")return t.parseChildren([n[0]]);const r=t.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===Lr||n[0].text===Lr||n[0].raw===Hs||n[0].text===Hs)&&r.length===1&&r[0].type==="text"&&(r[0].text===Lr||r[0].text===Hs)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t,n)=>{var r,o;if(!e)return"";const s=Array.isArray(e.content)?e.content:[];if(s.length===0){const i=Array.isArray((r=n?.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((o=n?.previousNode)==null?void 0:o.type)==="paragraph"&&i.length===0?Lr:""}return t.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),c2=l2;const u2=c2.extend({addAttributes(){return{...this.parent?.(),size:{default:"normal",parseHTML:e=>e.getAttribute("data-size")||"normal",renderHTML:e=>({"data-size":e.size})}}}});var d2=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,f2=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,p2=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,h2=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,g2=w.Mark.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return no.jsx("strong",{...w.mergeAttributes(this.options.HTMLAttributes,e),children:no.jsx("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[w.markInputRule({find:d2,type:this.type}),w.markInputRule({find:p2,type:this.type})]},addPasteRules(){return[w.markPasteRule({find:f2,type:this.type}),w.markPasteRule({find:h2,type:this.type})]}}),m2=g2,b2=e=>{const t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},v2=e=>{const t=/`([^`]+)`(?!`)/g,n=[];let r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},y2=w.Mark.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",w.mergeAttributes(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[w.markInputRule({find:b2,type:this.type})]},addPasteRules(){return[w.markPasteRule({find:v2,type:this.type})]}}),E2=y2,C2=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,w2=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,x2=w.Mark.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||w.getStyleProperty(e,"background-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:e}){return["mark",w.mergeAttributes(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark("highlight",t.parseInline(e.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:e=>e.indexOf("=="),tokenize(e,t,n){const o=/^(==)([^=]+)(==)/.exec(e);if(o){const s=o[2].trim(),i=n.inlineTokens(s);return{type:"highlight",raw:o[0],text:s,tokens:i}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[w.markInputRule({find:C2,type:this.type})]},addPasteRules(){return[w.markPasteRule({find:w2,type:this.type})]}}),_2=x2,S2=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,N2=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,A2=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,T2=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,R2=w.Mark.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",w.mergeAttributes(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[w.markInputRule({find:S2,type:this.type}),w.markInputRule({find:A2,type:this.type})]},addPasteRules(){return[w.markPasteRule({find:N2,type:this.type}),w.markPasteRule({find:T2,type:this.type})]}}),M2=R2;const k2="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",O2="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Ei="numeric",Ci="ascii",wi="alpha",Zn="asciinumeric",$n="alphanumeric",xi="domain",Of="emoji",I2="scheme",L2="slashscheme",Fs="whitespace";function P2(e,t){return e in t||(t[e]=[]),t[e]}function en(e,t,n){t[Ei]&&(t[Zn]=!0,t[$n]=!0),t[Ci]&&(t[Zn]=!0,t[wi]=!0),t[Zn]&&(t[$n]=!0),t[wi]&&(t[$n]=!0),t[$n]&&(t[xi]=!0),t[Of]&&(t[xi]=!0);for(const r in t){const o=P2(r,n);o.indexOf(e)<0&&o.push(e)}}function D2(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function ze(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}ze.groups={};ze.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const o=t.jr[r][0],s=t.jr[r][1];if(s&&o.test(e))return s}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){r=r||ze.groups;let o;return t&&t.j?o=t:(o=new ze(t),n&&r&&en(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this;const s=e.length;if(!s)return o;for(let i=0;i<s-1;i++)o=o.tt(e[i]);return o.tt(e[s-1],t,n,r)},tt(e,t,n,r){r=r||ze.groups;const o=this;if(t&&t.j)return o.j[e]=t,t;const s=t;let i,a=o.go(e);if(a?(i=new ze,Object.assign(i.j,a.j),i.jr.push.apply(i.jr,a.jr),i.jd=a.jd,i.t=a.t):i=new ze,s){if(r)if(i.t&&typeof i.t=="string"){const l=Object.assign(D2(i.t,r),n);en(s,l,r)}else n&&en(s,n,r);i.t=s}return o.j[e]=i,i}};const ie=(e,t,n,r,o)=>e.ta(t,n,r,o),Ee=(e,t,n,r,o)=>e.tr(t,n,r,o),Bl=(e,t,n,r,o)=>e.ts(t,n,r,o),L=(e,t,n,r,o)=>e.tt(t,n,r,o),xt="WORD",_i="UWORD",If="ASCIINUMERICAL",Lf="ALPHANUMERICAL",sr="LOCALHOST",Si="TLD",Ni="UTLD",Xr="SCHEME",gn="SLASH_SCHEME",ba="NUM",Ai="WS",va="NL",qn="OPENBRACE",Yn="CLOSEBRACE",po="OPENBRACKET",ho="CLOSEBRACKET",go="OPENPAREN",mo="CLOSEPAREN",bo="OPENANGLEBRACKET",vo="CLOSEANGLEBRACKET",yo="FULLWIDTHLEFTPAREN",Eo="FULLWIDTHRIGHTPAREN",Co="LEFTCORNERBRACKET",wo="RIGHTCORNERBRACKET",xo="LEFTWHITECORNERBRACKET",_o="RIGHTWHITECORNERBRACKET",So="FULLWIDTHLESSTHAN",No="FULLWIDTHGREATERTHAN",Ao="AMPERSAND",To="APOSTROPHE",Ro="ASTERISK",Pt="AT",Mo="BACKSLASH",ko="BACKTICK",Oo="CARET",tn="COLON",ya="COMMA",Io="DOLLAR",ut="DOT",Lo="EQUALS",Ea="EXCLAMATION",Xe="HYPHEN",Xn="PERCENT",Po="PIPE",Do="PLUS",Bo="POUND",Jn="QUERY",Ca="QUOTE",Pf="FULLWIDTHMIDDLEDOT",wa="SEMI",dt="SLASH",Qn="TILDE",Ho="UNDERSCORE",Df="EMOJI",Fo="SYM";var Bf=Object.freeze({__proto__:null,ALPHANUMERICAL:Lf,AMPERSAND:Ao,APOSTROPHE:To,ASCIINUMERICAL:If,ASTERISK:Ro,AT:Pt,BACKSLASH:Mo,BACKTICK:ko,CARET:Oo,CLOSEANGLEBRACKET:vo,CLOSEBRACE:Yn,CLOSEBRACKET:ho,CLOSEPAREN:mo,COLON:tn,COMMA:ya,DOLLAR:Io,DOT:ut,EMOJI:Df,EQUALS:Lo,EXCLAMATION:Ea,FULLWIDTHGREATERTHAN:No,FULLWIDTHLEFTPAREN:yo,FULLWIDTHLESSTHAN:So,FULLWIDTHMIDDLEDOT:Pf,FULLWIDTHRIGHTPAREN:Eo,HYPHEN:Xe,LEFTCORNERBRACKET:Co,LEFTWHITECORNERBRACKET:xo,LOCALHOST:sr,NL:va,NUM:ba,OPENANGLEBRACKET:bo,OPENBRACE:qn,OPENBRACKET:po,OPENPAREN:go,PERCENT:Xn,PIPE:Po,PLUS:Do,POUND:Bo,QUERY:Jn,QUOTE:Ca,RIGHTCORNERBRACKET:wo,RIGHTWHITECORNERBRACKET:_o,SCHEME:Xr,SEMI:wa,SLASH:dt,SLASH_SCHEME:gn,SYM:Fo,TILDE:Qn,TLD:Si,UNDERSCORE:Ho,UTLD:Ni,UWORD:_i,WORD:xt,WS:Ai});const Ct=/[a-z]/,Dn=new RegExp("\\p{L}","u"),$s=new RegExp("\\p{Emoji}","u"),wt=/\d/,Us=/\s/,Hl="\r",js=`
|
|
44
44
|
`,B2="️",H2="",zs="";let Pr=null,Dr=null;function F2(e=[]){const t={};ze.groups=t;const n=new ze;Pr==null&&(Pr=Fl(k2)),Dr==null&&(Dr=Fl(O2)),L(n,"'",To),L(n,"{",qn),L(n,"}",Yn),L(n,"[",po),L(n,"]",ho),L(n,"(",go),L(n,")",mo),L(n,"<",bo),L(n,">",vo),L(n,"(",yo),L(n,")",Eo),L(n,"「",Co),L(n,"」",wo),L(n,"『",xo),L(n,"』",_o),L(n,"<",So),L(n,">",No),L(n,"&",Ao),L(n,"*",Ro),L(n,"@",Pt),L(n,"`",ko),L(n,"^",Oo),L(n,":",tn),L(n,",",ya),L(n,"$",Io),L(n,".",ut),L(n,"=",Lo),L(n,"!",Ea),L(n,"-",Xe),L(n,"%",Xn),L(n,"|",Po),L(n,"+",Do),L(n,"#",Bo),L(n,"?",Jn),L(n,'"',Ca),L(n,"/",dt),L(n,";",wa),L(n,"~",Qn),L(n,"_",Ho),L(n,"\\",Mo),L(n,"・",Pf);const r=Ee(n,wt,ba,{[Ei]:!0});Ee(r,wt,r);const o=Ee(r,Ct,If,{[Zn]:!0}),s=Ee(r,Dn,Lf,{[$n]:!0}),i=Ee(n,Ct,xt,{[Ci]:!0});Ee(i,wt,o),Ee(i,Ct,i),Ee(o,wt,o),Ee(o,Ct,o);const a=Ee(n,Dn,_i,{[wi]:!0});Ee(a,Ct),Ee(a,wt,s),Ee(a,Dn,a),Ee(s,wt,s),Ee(s,Ct),Ee(s,Dn,s);const l=L(n,js,va,{[Fs]:!0}),c=L(n,Hl,Ai,{[Fs]:!0}),d=Ee(n,Us,Ai,{[Fs]:!0});L(n,zs,d),L(c,js,l),L(c,zs,d),Ee(c,Us,d),L(d,Hl),L(d,js),Ee(d,Us,d),L(d,zs,d);const f=Ee(n,$s,Df,{[Of]:!0});L(f,"#"),Ee(f,$s,f),L(f,B2,f);const h=L(f,H2);L(h,"#"),Ee(h,$s,f);const p=[[Ct,i],[wt,o]],m=[[Ct,null],[Dn,a],[wt,s]];for(let g=0;g<Pr.length;g++)kt(n,Pr[g],Si,xt,p);for(let g=0;g<Dr.length;g++)kt(n,Dr[g],Ni,_i,m);en(Si,{tld:!0,ascii:!0},t),en(Ni,{utld:!0,alpha:!0},t),kt(n,"file",Xr,xt,p),kt(n,"mailto",Xr,xt,p),kt(n,"http",gn,xt,p),kt(n,"https",gn,xt,p),kt(n,"ftp",gn,xt,p),kt(n,"ftps",gn,xt,p),en(Xr,{scheme:!0,ascii:!0},t),en(gn,{slashscheme:!0,ascii:!0},t),e=e.sort((g,b)=>g[0]>b[0]?1:-1);for(let g=0;g<e.length;g++){const b=e[g][0],C=e[g][1]?{[I2]:!0}:{[L2]:!0};b.indexOf("-")>=0?C[xi]=!0:Ct.test(b)?wt.test(b)?C[Zn]=!0:C[Ci]=!0:C[Ei]=!0,Bl(n,b,b,C)}return Bl(n,"localhost",sr,{ascii:!0}),n.jd=new ze(Fo),{start:n,tokens:Object.assign({groups:t},Bf)}}function Hf(e,t){const n=$2(t.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,o=[];let s=0,i=0;for(;i<r;){let a=e,l=null,c=0,d=null,f=-1,h=-1;for(;i<r&&(l=a.go(n[i]));)a=l,a.accepts()?(f=0,h=0,d=a):f>=0&&(f+=n[i].length,h++),c+=n[i].length,s+=n[i].length,i++;s-=f,i-=h,c-=f,o.push({t:d.t,v:t.slice(s-c,s),s:s-c,e:s})}return o}function $2(e){const t=[],n=e.length;let r=0;for(;r<n;){let o=e.charCodeAt(r),s,i=o<55296||o>56319||r+1===n||(s=e.charCodeAt(r+1))<56320||s>57343?e[r]:e.slice(r,r+2);t.push(i),r+=i.length}return t}function kt(e,t,n,r,o){let s;const i=t.length;for(let a=0;a<i-1;a++){const l=t[a];e.j[l]?s=e.j[l]:(s=new ze(r),s.jr=o.slice(),e.j[l]=s),e=s}return s=new ze(n),s.jr=o.slice(),e.j[t[i-1]]=s,s}function Fl(e){const t=[],n=[];let r=0,o="0123456789";for(;r<e.length;){let s=0;for(;o.indexOf(e[r+s])>=0;)s++;if(s>0){t.push(n.join(""));for(let i=parseInt(e.substring(r,r+s),10);i>0;i--)n.pop();r+=s}else n.push(e[r]),r++}return t}const ir={defaultProtocol:"http",events:null,format:$l,formatHref:$l,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function xa(e,t=null){let n=Object.assign({},ir);e&&(n=Object.assign(n,e instanceof xa?e.o:e));const r=n.ignoreTags,o=[];for(let s=0;s<r.length;s++)o.push(r[s].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}xa.prototype={o:ir,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let o=this.o[e];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:ir[e],typeof o=="function"&&r&&(o=o(t,n))):typeof o=="function"&&r&&(o=o(t,n.t,n)),o)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function $l(e){return e}function Ff(e,t){this.t="token",this.v=e,this.tk=t}Ff.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=ir.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),s=this.toFormattedString(e),i={},a=e.get("className",n,t),l=e.get("target",n,t),c=e.get("rel",n,t),d=e.getObj("attributes",n,t),f=e.getObj("events",n,t);return i.href=r,a&&(i.class=a),l&&(i.target=l),c&&(i.rel=c),d&&Object.assign(i,d),{tagName:o,attributes:i,content:s,eventListeners:f}}};function cs(e,t){class n extends Ff{constructor(o,s){super(o,s),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}const U2=cs("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Ul=cs("text"),j2=cs("nl"),Br=cs("url",{isLink:!0,toHref(e=ir.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==sr&&e[1].t===tn}}),qe=e=>new ze(e);function z2({groups:e}){const t=e.domain.concat([Ao,Ro,Pt,Mo,ko,Oo,Io,Lo,Xe,ba,Xn,Po,Do,Bo,dt,Fo,Qn,Ho]),n=[To,tn,ya,ut,Ea,Xn,Jn,Ca,wa,bo,vo,qn,Yn,ho,po,go,mo,yo,Eo,Co,wo,xo,_o,So,No],r=[Ao,To,Ro,Mo,ko,Oo,Io,Lo,Xe,qn,Yn,Xn,Po,Do,Bo,Jn,dt,Fo,Qn,Ho],o=qe(),s=L(o,Qn);ie(s,r,s),ie(s,e.domain,s);const i=qe(),a=qe(),l=qe();ie(o,e.domain,i),ie(o,e.scheme,a),ie(o,e.slashscheme,l),ie(i,r,s),ie(i,e.domain,i);const c=L(i,Pt);L(s,Pt,c),L(a,Pt,c),L(l,Pt,c);const d=L(s,ut);ie(d,r,s),ie(d,e.domain,s);const f=qe();ie(c,e.domain,f),ie(f,e.domain,f);const h=L(f,ut);ie(h,e.domain,f);const p=qe(U2);ie(h,e.tld,p),ie(h,e.utld,p),L(c,sr,p);const m=L(f,Xe);L(m,Xe,m),ie(m,e.domain,f),ie(p,e.domain,f),L(p,ut,h),L(p,Xe,m);const g=L(i,Xe),b=L(i,ut);L(g,Xe,g),ie(g,e.domain,i),ie(b,r,s),ie(b,e.domain,i);const v=qe(Br);ie(b,e.tld,v),ie(b,e.utld,v),ie(v,e.domain,i),ie(v,r,s),L(v,ut,b),L(v,Xe,g),L(v,Pt,c);const C=L(v,tn),_=qe(Br);ie(C,e.numeric,_);const S=qe(Br),N=qe();ie(S,t,S),ie(S,n,N),ie(N,t,S),ie(N,n,N),L(v,dt,S),L(_,dt,S);const A=L(a,tn),R=L(l,tn),O=L(R,dt),D=L(O,dt);ie(a,e.domain,i),L(a,ut,b),L(a,Xe,g),ie(l,e.domain,i),L(l,ut,b),L(l,Xe,g),ie(A,e.domain,S),L(A,dt,S),L(A,Jn,S),ie(D,e.domain,S),ie(D,t,S),L(D,dt,S);const j=[[qn,Yn],[po,ho],[go,mo],[bo,vo],[yo,Eo],[Co,wo],[xo,_o],[So,No]];for(let Y=0;Y<j.length;Y++){const[J,X]=j[Y],I=L(S,J);L(N,J,I);const $=qe(Br);ie(I,t,$);const U=qe();ie(I,n,U),L(I,X,S),ie($,t,$),ie($,n,U),ie(U,t,$),ie(U,n,U),L($,X,S),L(U,X,S)}return L(o,sr,v),L(o,va,j2),{start:o,tokens:Bf}}function V2(e,t,n){let r=n.length,o=0,s=[],i=[];for(;o<r;){let a=e,l=null,c=null,d=0,f=null,h=-1;for(;o<r&&!(l=a.go(n[o].t));)i.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(h=0,f=a):h>=0&&h++,o++,d++;if(h<0)o-=d,o<r&&(i.push(n[o]),o++);else{i.length>0&&(s.push(Vs(Ul,t,i)),i=[]),o-=h,d-=h;const p=f.t,m=n.slice(o-d,o);s.push(Vs(p,t,m))}}return i.length>0&&s.push(Vs(Ul,t,i)),s}function Vs(e,t,n){const r=n[0].s,o=n[n.length-1].e,s=t.slice(r,o);return new e(s,n)}const K2=typeof console<"u"&&console&&console.warn||(()=>{}),W2="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ve={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function G2(){return ze.groups={},ve.scanner=null,ve.parser=null,ve.tokenQueue=[],ve.pluginQueue=[],ve.customSchemes=[],ve.initialized=!1,ve}function jl(e,t=!1){if(ve.initialized&&K2(`linkifyjs: already initialized - will not register custom scheme "${e}" ${W2}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
|