@abduljebar/text-editor 2.5.2 → 2.6.2

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.
@@ -1,15 +1,15 @@
1
- (function(le,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react"),require("lucide-react")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react"],b):(le=typeof globalThis<"u"?globalThis:le||self,b(le.TextEditor={},le.React,le.LucideReact))})(this,(function(le,b,L){"use strict";var We=document.createElement("style");We.textContent=`@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-600:oklch(64.6% .222 41.116);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.-top-2{top:calc(var(--spacing)*-2)}.top-6{top:calc(var(--spacing)*6)}.-right-2{right:calc(var(--spacing)*-2)}.right-2{right:calc(var(--spacing)*2)}.bottom-2{bottom:calc(var(--spacing)*2)}.left-6{left:calc(var(--spacing)*6)}.order-1{order:1}.order-2{order:2}.order-3{order:3}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-0\\.5{margin-inline:calc(var(--spacing)*.5)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-2{margin-right:calc(var(--spacing)*2)}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.h-2{height:calc(var(--spacing)*2)}.h-4{height:calc(var(--spacing)*4)}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.h-auto{height:auto}.min-h-\\[200px\\]{min-height:200px}.min-h-\\[400px\\]{min-height:400px}.w-2{width:calc(var(--spacing)*2)}.w-4{width:calc(var(--spacing)*4)}.w-full{width:100%}.w-px{width:1px}.max-w-full{max-width:100%}.min-w-\\[36px\\]{min-width:36px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-text{cursor:text}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-6{gap:calc(var(--spacing)*6)}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-blue-100{border-color:var(--color-blue-100)}.border-blue-300{border-color:var(--color-blue-300)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-green-100{border-color:var(--color-green-100)}.border-red-100{border-color:var(--color-red-100)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-600{background-color:var(--color-green-600)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-600{background-color:var(--color-red-600)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\\/80{background-color:color-mix(in oklab,var(--color-white)80%,transparent)}}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-gray-50{--tw-gradient-from:var(--color-gray-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-white{--tw-gradient-to:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-10{padding:calc(var(--spacing)*10)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.pr-2{padding-right:calc(var(--spacing)*2)}.text-right{text-align:right}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-amber-600{color:var(--color-amber-600)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-orange-600{color:var(--color-orange-600)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.italic{font-style:italic}.underline{text-decoration-line:underline}.opacity-80{opacity:.8}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-text{-webkit-user-select:text;-moz-user-select:text;user-select:text}.placeholder\\:text-gray-400::-moz-placeholder{color:var(--color-gray-400)}.placeholder\\:text-gray-400::placeholder{color:var(--color-gray-400)}.last\\:mr-0:last-child{margin-right:calc(var(--spacing)*0)}.last\\:border-r-0:last-child{border-right-style:var(--tw-border-style);border-right-width:0}.last\\:pr-0:last-child{padding-right:calc(var(--spacing)*0)}@media(hover:hover){.hover\\:border-gray-400:hover{border-color:var(--color-gray-400)}.hover\\:bg-blue-200:hover{background-color:var(--color-blue-200)}.hover\\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\\:bg-red-700:hover{background-color:var(--color-red-700)}}.active\\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-blue-300:disabled{background-color:var(--color-blue-300)}.disabled\\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\\:order-2{order:2}.sm\\:order-3{order:3}.sm\\:mt-0{margin-top:calc(var(--spacing)*0)}.sm\\:inline{display:inline}.sm\\:w-auto{width:auto}.sm\\:flex-row{flex-direction:row}.sm\\:items-center{align-items:center}}@media(min-width:48rem){.md\\:block{display:block}.md\\:p-6{padding:calc(var(--spacing)*6)}.md\\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}
2
- /*$vite$:1*/`,document.head.appendChild(We);var ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function At(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var we={exports:{}},he={};var Ve;function zt(){if(Ve)return he;Ve=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(o,a,d){var l=null;if(d!==void 0&&(l=""+d),a.key!==void 0&&(l=""+a.key),"key"in a){d={};for(var i in a)i!=="key"&&(d[i]=a[i])}else d=a;return a=d.ref,{$$typeof:e,type:o,key:l,ref:a!==void 0?a:null,props:d}}return he.Fragment=t,he.jsx=r,he.jsxs=r,he}var be={};var He;function _t(){return He||(He=1,process.env.NODE_ENV!=="production"&&(function(){function e(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===S?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case M:return"Fragment";case H:return"Profiler";case K:return"StrictMode";case J:return"Suspense";case Q:return"SuspenseList";case y:return"Activity"}if(typeof n=="object")switch(typeof n.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),n.$$typeof){case W:return"Portal";case I:return n.displayName||"Context";case C:return(n._context.displayName||"Context")+".Consumer";case q:var j=n.render;return n=n.displayName,n||(n=j.displayName||j.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case p:return j=n.displayName||null,j!==null?j:e(n.type)||"Memo";case c:j=n._payload,n=n._init;try{return e(n(j))}catch{}}return null}function t(n){return""+n}function r(n){try{t(n);var j=!1}catch{j=!0}if(j){j=console;var k=j.error,E=typeof Symbol=="function"&&Symbol.toStringTag&&n[Symbol.toStringTag]||n.constructor.name||"Object";return k.call(j,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",E),t(n)}}function o(n){if(n===M)return"<>";if(typeof n=="object"&&n!==null&&n.$$typeof===c)return"<...>";try{var j=e(n);return j?"<"+j+">":"<...>"}catch{return"<...>"}}function a(){var n=v.A;return n===null?null:n.getOwner()}function d(){return Error("react-stack-top-frame")}function l(n){if(w.call(n,"key")){var j=Object.getOwnPropertyDescriptor(n,"key").get;if(j&&j.isReactWarning)return!1}return n.key!==void 0}function i(n,j){function k(){P||(P=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",j))}k.isReactWarning=!0,Object.defineProperty(n,"key",{get:k,configurable:!0})}function u(){var n=e(this.type);return V[n]||(V[n]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),n=this.props.ref,n!==void 0?n:null}function m(n,j,k,E,Z,ae){var T=k.ref;return n={$$typeof:R,type:n,key:j,props:k,_owner:E},(T!==void 0?T:null)!==null?Object.defineProperty(n,"ref",{enumerable:!1,get:u}):Object.defineProperty(n,"ref",{enumerable:!1,value:null}),n._store={},Object.defineProperty(n._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(n,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(n,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.defineProperty(n,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ae}),Object.freeze&&(Object.freeze(n.props),Object.freeze(n)),n}function A(n,j,k,E,Z,ae){var T=j.children;if(T!==void 0)if(E)if(z(T)){for(E=0;E<T.length;E++)O(T[E]);Object.freeze&&Object.freeze(T)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else O(T);if(w.call(j,"key")){T=e(n);var $=Object.keys(j).filter(function(re){return re!=="key"});E=0<$.length?"{key: someKey, "+$.join(": ..., ")+": ...}":"{key: someKey}",te[T+E]||($=0<$.length?"{"+$.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(ce,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("lucide-react")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react"],x):(ce=typeof globalThis<"u"?globalThis:ce||self,x(ce.TextEditor={},ce.React,ce.LucideReact))})(this,(function(ce,x,L){"use strict";var He=document.createElement("style");He.textContent=`@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-600:oklch(64.6% .222 41.116);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.-top-2{top:calc(var(--spacing)*-2)}.top-6{top:calc(var(--spacing)*6)}.-right-2{right:calc(var(--spacing)*-2)}.right-2{right:calc(var(--spacing)*2)}.bottom-2{bottom:calc(var(--spacing)*2)}.left-6{left:calc(var(--spacing)*6)}.z-0{z-index:0}.z-10{z-index:10}.order-1{order:1}.order-2{order:2}.order-3{order:3}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-0\\.5{margin-inline:calc(var(--spacing)*.5)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-2{margin-right:calc(var(--spacing)*2)}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.h-2{height:calc(var(--spacing)*2)}.h-4{height:calc(var(--spacing)*4)}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.h-auto{height:auto}.min-h-\\[200px\\]{min-height:200px}.min-h-\\[400px\\]{min-height:400px}.w-2{width:calc(var(--spacing)*2)}.w-4{width:calc(var(--spacing)*4)}.w-full{width:100%}.w-px{width:1px}.max-w-full{max-width:100%}.min-w-\\[36px\\]{min-width:36px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-text{cursor:text}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-6{gap:calc(var(--spacing)*6)}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-blue-100{border-color:var(--color-blue-100)}.border-blue-300{border-color:var(--color-blue-300)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-green-100{border-color:var(--color-green-100)}.border-red-100{border-color:var(--color-red-100)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-600{background-color:var(--color-green-600)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-600{background-color:var(--color-red-600)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\\/80{background-color:color-mix(in oklab,var(--color-white)80%,transparent)}}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-gray-50{--tw-gradient-from:var(--color-gray-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-white{--tw-gradient-to:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-10{padding:calc(var(--spacing)*10)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.pr-2{padding-right:calc(var(--spacing)*2)}.text-right{text-align:right}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-amber-600{color:var(--color-amber-600)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-orange-600{color:var(--color-orange-600)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.italic{font-style:italic}.underline{text-decoration-line:underline}.opacity-80{opacity:.8}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-text{-webkit-user-select:text;-moz-user-select:text;user-select:text}.placeholder\\:text-gray-400::-moz-placeholder{color:var(--color-gray-400)}.placeholder\\:text-gray-400::placeholder{color:var(--color-gray-400)}.last\\:mr-0:last-child{margin-right:calc(var(--spacing)*0)}.last\\:border-r-0:last-child{border-right-style:var(--tw-border-style);border-right-width:0}.last\\:pr-0:last-child{padding-right:calc(var(--spacing)*0)}@media(hover:hover){.hover\\:border-gray-400:hover{border-color:var(--color-gray-400)}.hover\\:bg-blue-200:hover{background-color:var(--color-blue-200)}.hover\\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\\:bg-red-700:hover{background-color:var(--color-red-700)}}.active\\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-blue-300:disabled{background-color:var(--color-blue-300)}.disabled\\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\\:order-2{order:2}.sm\\:order-3{order:3}.sm\\:mt-0{margin-top:calc(var(--spacing)*0)}.sm\\:inline{display:inline}.sm\\:w-auto{width:auto}.sm\\:flex-row{flex-direction:row}.sm\\:items-center{align-items:center}}@media(min-width:48rem){.md\\:block{display:block}.md\\:p-6{padding:calc(var(--spacing)*6)}.md\\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}
2
+ /*$vite$:1*/`,document.head.appendChild(He);var we=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function At(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ye={exports:{}},be={};var Ve;function _t(){if(Ve)return be;Ve=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(o,i,c){var l=null;if(c!==void 0&&(l=""+c),i.key!==void 0&&(l=""+i.key),"key"in i){c={};for(var a in i)a!=="key"&&(c[a]=i[a])}else c=i;return i=c.ref,{$$typeof:e,type:o,key:l,ref:i!==void 0?i:null,props:c}}return be.Fragment=t,be.jsx=r,be.jsxs=r,be}var xe={};var Ye;function It(){return Ye||(Ye=1,process.env.NODE_ENV!=="production"&&(function(){function e(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===w?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case M:return"Fragment";case H:return"Profiler";case J:return"StrictMode";case Y:return"Suspense";case q:return"SuspenseList";case d:return"Activity"}if(typeof n=="object")switch(typeof n.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),n.$$typeof){case G:return"Portal";case I:return n.displayName||"Context";case C:return(n._context.displayName||"Context")+".Consumer";case X:var y=n.render;return n=n.displayName,n||(n=y.displayName||y.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case v:return y=n.displayName||null,y!==null?y:e(n.type)||"Memo";case U:y=n._payload,n=n._init;try{return e(n(y))}catch{}}return null}function t(n){return""+n}function r(n){try{t(n);var y=!1}catch{y=!0}if(y){y=console;var k=y.error,S=typeof Symbol=="function"&&Symbol.toStringTag&&n[Symbol.toStringTag]||n.constructor.name||"Object";return k.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",S),t(n)}}function o(n){if(n===M)return"<>";if(typeof n=="object"&&n!==null&&n.$$typeof===U)return"<...>";try{var y=e(n);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function i(){var n=j.A;return n===null?null:n.getOwner()}function c(){return Error("react-stack-top-frame")}function l(n){if(u.call(n,"key")){var y=Object.getOwnPropertyDescriptor(n,"key").get;if(y&&y.isReactWarning)return!1}return n.key!==void 0}function a(n,y){function k(){B||(B=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}k.isReactWarning=!0,Object.defineProperty(n,"key",{get:k,configurable:!0})}function m(){var n=e(this.type);return W[n]||(W[n]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),n=this.props.ref,n!==void 0?n:null}function f(n,y,k,S,ee,re){var A=k.ref;return n={$$typeof:R,type:n,key:y,props:k,_owner:S},(A!==void 0?A:null)!==null?Object.defineProperty(n,"ref",{enumerable:!1,get:m}):Object.defineProperty(n,"ref",{enumerable:!1,value:null}),n._store={},Object.defineProperty(n._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(n,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(n,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.defineProperty(n,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.freeze&&(Object.freeze(n.props),Object.freeze(n)),n}function E(n,y,k,S,ee,re){var A=y.children;if(A!==void 0)if(S)if(T(A)){for(S=0;S<A.length;S++)O(A[S]);Object.freeze&&Object.freeze(A)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else O(A);if(u.call(y,"key")){A=e(n);var $=Object.keys(y).filter(function(oe){return oe!=="key"});S=0<$.length?"{key: someKey, "+$.join(": ..., ")+": ...}":"{key: someKey}",V[A+S]||($=0<$.length?"{"+$.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
3
3
  let props = %s;
4
4
  <%s {...props} />
5
5
  React keys must be passed directly to JSX without using spread:
6
6
  let props = %s;
7
- <%s key={someKey} {...props} />`,E,T,$,T),te[T+E]=!0)}if(T=null,k!==void 0&&(r(k),T=""+k),l(j)&&(r(j.key),T=""+j.key),"key"in j){k={};for(var ee in j)ee!=="key"&&(k[ee]=j[ee])}else k=j;return T&&i(k,typeof n=="function"?n.displayName||n.name||"Unknown":n),m(n,T,k,a(),Z,ae)}function O(n){F(n)?n._store&&(n._store.validated=1):typeof n=="object"&&n!==null&&n.$$typeof===c&&(n._payload.status==="fulfilled"?F(n._payload.value)&&n._payload.value._store&&(n._payload.value._store.validated=1):n._store&&(n._store.validated=1))}function F(n){return typeof n=="object"&&n!==null&&n.$$typeof===R}var B=b,R=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),I=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),S=Symbol.for("react.client.reference"),v=B.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,w=Object.prototype.hasOwnProperty,z=Array.isArray,D=console.createTask?console.createTask:function(){return null};B={react_stack_bottom_frame:function(n){return n()}};var P,V={},x=B.react_stack_bottom_frame.bind(B,d)(),Y=D(o(d)),te={};be.Fragment=M,be.jsx=function(n,j,k){var E=1e4>v.recentlyCreatedOwnerStacks++;return A(n,j,k,!1,E?Error("react-stack-top-frame"):x,E?D(o(n)):Y)},be.jsxs=function(n,j,k){var E=1e4>v.recentlyCreatedOwnerStacks++;return A(n,j,k,!0,E?Error("react-stack-top-frame"):x,E?D(o(n)):Y)}})()),be}var Ye;function It(){return Ye||(Ye=1,process.env.NODE_ENV==="production"?we.exports=zt():we.exports=_t()),we.exports}var s=It();const Nt=({onCommand:e,onSave:t,onExport:r,onClear:o,onImageUpload:a,showButtons:d=!1,hasUnsavedChanges:l,pendingImagesCount:i=0})=>{const[u,m]=b.useState([]),[A,O]=b.useState("p"),[F,B]=b.useState(!1),[R,W]=b.useState(!1),[M,K]=b.useState(!1),[H,C]=b.useState(!1),[I,q]=b.useState(!1),[J,Q]=b.useState(!1),[p,c]=b.useState("left"),y=b.useRef(null),S=b.useCallback(()=>{if(typeof window>"u"||typeof document>"u")return;const U=window.getSelection();if(!U||U.rangeCount===0||U.isCollapsed)return;const de=U.getRangeAt(0).commonAncestorContainer;B(document.queryCommandState("bold")),W(document.queryCommandState("italic")),K(document.queryCommandState("underline")),C(document.queryCommandState("strikeThrough")),q(document.queryCommandState("insertUnorderedList")),Q(document.queryCommandState("insertOrderedList")),document.queryCommandState("justifyLeft")?c("left"):document.queryCommandState("justifyCenter")?c("center"):document.queryCommandState("justifyRight")&&c("right");let oe=de,h="p";for(;oe&&oe!==document.body;){if(oe.nodeType===Node.ELEMENT_NODE){const ne=oe.tagName.toLowerCase();if(["h1","h2","h3","h4","h5","h6","p","div","blockquote","pre"].includes(ne)){["h1","h2"].includes(ne)&&(h=ne);break}}oe=oe.parentNode}O(h);const G=[];F&&G.push("bold"),R&&G.push("italic"),M&&G.push("underline"),H&&G.push("strikeThrough"),I&&G.push("insertUnorderedList"),J&&G.push("insertOrderedList"),p==="left"&&G.push("justifyLeft"),p==="center"&&G.push("justifyCenter"),p==="right"&&G.push("justifyRight"),(h==="h1"||h==="h2")&&G.push(`formatBlock:${h}`),m(G)},[F,R,M,H,I,J,p]);b.useEffect(()=>{const U=()=>{requestAnimationFrame(S)},N=()=>{setTimeout(S,10)},de=()=>{setTimeout(S,10)};return document.addEventListener("selectionchange",U),document.addEventListener("mouseup",N),document.addEventListener("keyup",de),S(),()=>{document.removeEventListener("selectionchange",U),document.removeEventListener("mouseup",N),document.removeEventListener("keyup",de)}},[S]);const v=()=>{const U=prompt("Enter URL:","https://");U&&e("createLink",U)},w=()=>{a()},z=U=>{e("formatBlock",U)},D=()=>{e("indent")},P=()=>{e("outdent")},V=()=>{e("undo")},x=()=>{e("redo")},Y=()=>{e("formatBlock","pre")},te=()=>{e("formatBlock","blockquote")},n=()=>{e("superscript")},j=()=>{e("subscript")},k=[{id:"undo",command:"undo",icon:s.jsx(L.Undo,{size:18}),title:"Undo",onClick:V},{id:"redo",command:"redo",icon:s.jsx(L.Redo,{size:18}),title:"Redo",onClick:x},{id:"separator-1",separator:!0},{id:"bold",command:"bold",icon:s.jsx(L.Bold,{size:18}),title:"Bold (Ctrl+B)",isActive:F},{id:"italic",command:"italic",icon:s.jsx(L.Italic,{size:18}),title:"Italic (Ctrl+I)",isActive:R},{id:"underline",command:"underline",icon:s.jsx(L.Underline,{size:18}),title:"Underline (Ctrl+U)",isActive:M},{id:"strikeThrough",command:"strikeThrough",icon:s.jsx(L.Strikethrough,{size:18}),title:"Strikethrough",isActive:H},{id:"separator-2",separator:!0},{id:"heading-1",command:"formatBlock",value:"h1",icon:s.jsx(L.Heading1,{size:18}),title:"Heading 1",isActive:A==="h1"},{id:"heading-2",command:"formatBlock",value:"h2",icon:s.jsx(L.Heading2,{size:18}),title:"Heading 2",isActive:A==="h2"},{id:"paragraph",command:"formatBlock",value:"p",icon:s.jsx(L.Type,{size:18}),title:"Paragraph",isActive:A==="p"},{id:"code",command:"formatBlock",value:"pre",icon:s.jsx(L.Code,{size:18}),title:"Code Block",onClick:Y},{id:"quote",command:"formatBlock",value:"blockquote",icon:s.jsx(L.Quote,{size:18}),title:"Blockquote",onClick:te},{id:"separator-3",separator:!0},{id:"unordered-list",command:"insertUnorderedList",icon:s.jsx(L.List,{size:18}),title:"Bullet List",isActive:I},{id:"ordered-list",command:"insertOrderedList",icon:s.jsx(L.ListOrdered,{size:18}),title:"Numbered List",isActive:J},{id:"indent",command:"indent",icon:s.jsx(L.Indent,{size:18}),title:"Indent",onClick:D},{id:"outdent",command:"outdent",icon:s.jsx(L.Outdent,{size:18}),title:"Outdent",onClick:P},{id:"separator-4",separator:!0},{id:"align-left",command:"justifyLeft",icon:s.jsx(L.AlignLeft,{size:18}),title:"Align Left",isActive:p==="left"},{id:"align-center",command:"justifyCenter",icon:s.jsx(L.AlignCenter,{size:18}),title:"Center",isActive:p==="center"},{id:"align-right",command:"justifyRight",icon:s.jsx(L.AlignRight,{size:18}),title:"Align Right",isActive:p==="right"},{id:"separator-5",separator:!0},{id:"superscript",command:"superscript",icon:s.jsx(L.Superscript,{size:18}),title:"Superscript",onClick:n},{id:"subscript",command:"subscript",icon:s.jsx(L.Subscript,{size:18}),title:"Subscript",onClick:j},{id:"link",command:"createLink",icon:s.jsx(L.Link,{size:18}),title:"Insert Link",onClick:v},{id:"image",command:"insertImage",icon:i>0?s.jsxs("div",{className:"relative",children:[s.jsx(L.Image,{size:18}),s.jsx("span",{className:"absolute -top-2 -right-2 bg-blue-600 text-white text-xs rounded-full w-4 h-4 flex items-center justify-center",children:i})]}):s.jsx(L.Image,{size:18}),title:"Insert Image",onClick:w}],E=U=>s.jsx("div",{className:"flex items-center border-r border-gray-200 pr-2 mr-2 last:border-r-0 last:pr-0 last:mr-0",children:U.map(N=>{if(N.separator)return s.jsx("div",{className:"w-px h-6 bg-gray-300 mx-2"},N.id);const de=N.isActive!==void 0?N.isActive:N.command?u.includes(N.command)||N.command==="formatBlock"&&N.value===A:!1;return s.jsx("button",{onClick:oe=>{oe.preventDefault(),oe.stopPropagation(),N.onClick?N.onClick():N.command==="formatBlock"&&N.value?z(N.value):N.command&&e(N.command,N.value),setTimeout(()=>{const h=document.querySelector('[contenteditable="true"]');h&&h.focus()},10)},title:N.title,type:"button",className:`min-w-[36px] h-9 flex items-center justify-center rounded-md border transition-all duration-150 ${de?"bg-blue-100 text-blue-600 border-blue-300 hover:bg-blue-200 shadow-sm":"bg-white border-gray-300 text-gray-700 hover:bg-gray-100 hover:border-gray-400"} active:scale-95 mx-0.5`,disabled:N.disabled,children:N.icon},N.id)})}),Z=k.slice(0,3),ae=k.slice(3,10),T=k.slice(10,16),$=k.slice(16,20),ee=k.slice(20,24),re=k.slice(24,28),se=k.slice(28);return s.jsxs("div",{ref:y,className:"flex flex-col sm:flex-row flex-wrap items-start sm:items-center justify-between p-3 bg-gray-50 border-b border-gray-200 gap-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1 order-1 w-full sm:w-auto",children:[E(Z),E(ae),E(T),E($),E(ee),E(re),E(se)]}),d&&s.jsxs("div",{className:"flex items-center gap-2 order-2 sm:order-3 mt-2 sm:mt-0 flex-shrink-0",children:[s.jsxs("button",{onClick:U=>{U.preventDefault(),U.stopPropagation(),t(),setTimeout(()=>{const N=document.querySelector('[contenteditable="true"]');N&&N.focus()},10)},disabled:!l,title:"Save Document (Ctrl+S)",className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed transition-colors duration-200 active:scale-95",children:[s.jsx(L.Save,{size:16}),s.jsx("span",{className:"hidden sm:inline",children:"Save"})]}),s.jsxs("button",{onClick:U=>{U.preventDefault(),U.stopPropagation(),r(),setTimeout(()=>{const N=document.querySelector('[contenteditable="true"]');N&&N.focus()},10)},title:"Export as HTML",className:"flex items-center gap-2 px-4 py-2 bg-green-600 text-white text-sm font-medium rounded-md hover:bg-green-700 transition-colors duration-200 active:scale-95",children:[s.jsx(L.FileDown,{size:16}),s.jsx("span",{className:"hidden sm:inline",children:"Export"})]}),s.jsxs("button",{onClick:U=>{U.preventDefault(),U.stopPropagation(),o(),setTimeout(()=>{const N=document.querySelector('[contenteditable="true"]');N&&N.focus()},10)},title:"Clear Editor",className:"flex items-center gap-2 px-4 py-2 bg-red-600 text-white text-sm font-medium rounded-md hover:bg-red-700 transition-colors duration-200 active:scale-95",children:[s.jsx(L.Trash2,{size:16}),s.jsx("span",{className:"hidden sm:inline",children:"Clear"})]})]}),s.jsxs("div",{className:"flex items-center gap-3 text-sm text-gray-500 order-3 sm:order-2 mt-2 sm:mt-0 flex-shrink-0",children:[i>0&&s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(L.Image,{size:14}),s.jsxs("span",{children:[i," pending"]})]}),l&&s.jsxs("span",{className:"flex items-center gap-1 text-amber-600",children:[s.jsx("span",{className:"w-2 h-2 bg-amber-500 rounded-full animate-pulse"}),s.jsx("span",{children:"Unsaved changes"})]})]})]})},Lt=({wordCount:e,characterCount:t,hasUnsavedChanges:r,pendingImagesCount:o=0})=>s.jsxs("div",{className:"flex justify-between items-center px-5 py-3 bg-gray-50 border-t border-gray-200 text-sm text-gray-600",children:[s.jsxs("div",{className:"flex items-center gap-6",children:[s.jsxs("div",{children:["Words: ",s.jsx("strong",{className:"text-gray-800",children:e})]}),s.jsxs("div",{children:["Characters: ",s.jsx("strong",{className:"text-gray-800",children:t})]}),o>0&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(L.Image,{size:14,className:"text-blue-600"}),s.jsxs("span",{className:"text-blue-600",children:[o," image",o!==1?"s":""]})]})]}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs("div",{className:`flex items-center gap-1 ${r?"text-orange-600":"text-green-600"}`,children:[r&&s.jsx(L.Save,{size:14,className:"animate-pulse"}),s.jsx("strong",{children:r?"Unsaved Changes":"Saved"})]})})]}),Ot=({initialContent:e="",onImageUpload:t,imageUploadEndpoint:r,allowedImageTypes:o=["image/jpeg","image/png","image/gif","image/webp"],maxImageSize:a=5*1024*1024})=>{const[d,l]=b.useState({content:e,title:"Untitled Document",wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length,hasUnsavedChanges:!1,pendingImages:[]}),i=b.useRef(null),u=b.useRef(new Map),m=b.useRef(e),A=b.useRef(!0),O=b.useCallback(()=>{if(!i.current)return;i.current.focus();const c=window.getSelection();if(c&&c.rangeCount>0){const v=c.getRangeAt(0);if(i.current.contains(v.commonAncestorContainer))return}const y=document.createRange();y.selectNodeContents(i.current),y.collapse(!1);const S=window.getSelection();S?.removeAllRanges(),S?.addRange(y)},[]),F=b.useCallback(()=>{const c=window.getSelection();if(!c||c.rangeCount===0||!i.current)return null;const y=c.getRangeAt(0);return i.current.contains(y.commonAncestorContainer)?y.cloneRange():null},[]),B=b.useCallback(c=>{if(!c||!i.current)return;i.current.focus();const y=window.getSelection();y?.removeAllRanges(),y?.addRange(c)},[]);b.useEffect(()=>{i.current&&A.current&&(i.current.innerHTML=e||"",A.current=!1)},[e]),b.useEffect(()=>{e!==m.current&&i.current&&(i.current.innerHTML!==e&&(i.current.innerHTML=e),m.current=e,l(c=>({...c,content:e,wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length,hasUnsavedChanges:!1})))},[e]);const R=b.useCallback(c=>{const y=c.trim()?c.trim().split(/\s+/).length:0,S=c.length;l(v=>({...v,content:c,wordCount:y,characterCount:S,hasUnsavedChanges:!0})),m.current=c},[]),W=b.useCallback(c=>{l(y=>({...y,title:c,hasUnsavedChanges:!0}))},[]),M=b.useCallback((c,y)=>{if(!i.current)return;const S=F();if(i.current.focus(),S)B(S);else{const v=window.getSelection();if(!v||v.rangeCount===0){const w=document.createRange();w.selectNodeContents(i.current),w.collapse(!1),v?.removeAllRanges(),v?.addRange(w)}}try{let v=!1;if(c==="formatBlock"&&y)v=document.execCommand("formatBlock",!1,`<${y}>`);else if(c==="createLink"&&y){const w=window.getSelection();w&&!w.isCollapsed?v=document.execCommand("createLink",!1,y):(document.execCommand("insertHTML",!1,`<a href="${y}" target="_blank">${y}</a>`),v=!0)}else v=document.execCommand(c,!1,y);v||console.warn(`Command ${c} failed to execute`),setTimeout(()=>{i.current&&R(i.current.innerHTML)},0)}catch(v){console.error(`Command ${c} failed:`,v)}i.current.focus()},[R,F,B]),K=b.useCallback(c=>o.includes(c.type)?c.size>a?{valid:!1,error:`File too large. Maximum size: ${Math.round(a/(1024*1024))}MB`}:{valid:!0}:{valid:!1,error:`Invalid file type. Allowed types: ${o.join(", ")}`},[o,a]),H=b.useCallback(async(c,y=!0)=>{const S=K(c);if(!S.valid){alert(S.error);return}if(!i.current)return;const v=`image-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,w=new FileReader;w.onload=z=>{const D=z.target?.result;u.current.set(v,{originalUrl:D,fileName:c.name,size:c.size,type:c.type});const P=document.createElement("img");P.src=D,P.alt=c.name,P.className="max-w-full h-auto border rounded",P.setAttribute("data-image-id",v),P.setAttribute("data-file-name",c.name),P.style.maxWidth="100%",P.style.height="auto";const V=F();if(y&&V){V.deleteContents(),V.insertNode(P);const x=document.createRange();x.setStartAfter(P),x.collapse(!0);const Y=window.getSelection();Y?.removeAllRanges(),Y?.addRange(x)}else i.current?.appendChild(P);i.current&&R(i?.current?.innerHTML),(t||r)&&l(x=>({...x,pendingImages:[...x.pendingImages,{id:v,file:c,placeholderUrl:D,status:"pending"}]})),i.current?.focus()},w.readAsDataURL(c)},[K,R,t,r,F]),C=b.useCallback(async()=>{if(!t&&!r)return;const c=d.pendingImages.filter(y=>y.status==="pending");if(c.length!==0){for(const y of c)try{l(w=>({...w,pendingImages:w.pendingImages.map(z=>z.id===y.id?{...z,status:"uploading"}:z)}));let S;if(t)S=await t(y.file);else if(r){const w=new FormData;w.append("image",y.file);const z=await fetch(r,{method:"POST",body:w});if(!z.ok)throw new Error(`Upload failed: ${z.statusText}`);const D=await z.json();S=D.url||D.imageUrl||D.data}else throw new Error("No upload method provided");const v=i.current?.querySelector(`img[data-image-id="${y.id}"]`);if(v){v.src=S,v.classList.add("uploaded");const w=u.current.get(y.id);w&&u.current.set(y.id,{...w,uploadedUrl:S})}l(w=>({...w,pendingImages:w.pendingImages.map(z=>z.id===y.id?{...z,status:"uploaded"}:z)}))}catch(S){console.error("Image upload failed:",S);const v=i.current?.querySelector(`img[data-image-id="${y.id}"]`);v&&v.classList.add("failed"),l(w=>({...w,pendingImages:w.pendingImages.map(z=>z.id===y.id?{...z,status:"failed"}:z)}))}i.current&&R(i.current.innerHTML)}},[d.pendingImages,t,r,R]),I=b.useCallback(c=>{const y=c.clipboardData.items;let S=!1;for(const v of y)if(v.type.indexOf("image")!==-1){c.preventDefault();const w=v.getAsFile();w&&(S=!0,H(w));break}S||setTimeout(()=>{i.current&&R(i.current.innerHTML)},0)},[H,R]),q=b.useCallback(c=>{c.preventDefault();const y=Array.from(c.dataTransfer.files);let S=!1;for(const v of y)v.type.startsWith("image/")&&(S=!0,H(v,!1));if(!S&&i.current){const v=window.getSelection();if(v&&v.rangeCount>0){const w=v.getRangeAt(0);i.current.contains(w.commonAncestorContainer)&&setTimeout(()=>{i.current&&R(i.current.innerHTML)},0)}}},[H,R]),J=b.useCallback(()=>{try{const c=i.current?.innerHTML||d.content;return{success:!0,data:{title:d.title,content:c,metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),wordCount:d.wordCount,characterCount:d.characterCount}}}}catch(c){return{success:!1,error:c instanceof Error?c.message:"Validation failed"}}},[d]),Q=b.useCallback((c={includeStyles:!0,includeMeta:!0})=>{const y=J();if(!y.success)throw new Error(y.error);const{data:S}=y;let v=`<!DOCTYPE html>
7
+ <%s key={someKey} {...props} />`,S,A,$,A),V[A+S]=!0)}if(A=null,k!==void 0&&(r(k),A=""+k),l(y)&&(r(y.key),A=""+y.key),"key"in y){k={};for(var te in y)te!=="key"&&(k[te]=y[te])}else k=y;return A&&a(k,typeof n=="function"?n.displayName||n.name||"Unknown":n),f(n,A,k,i(),ee,re)}function O(n){F(n)?n._store&&(n._store.validated=1):typeof n=="object"&&n!==null&&n.$$typeof===U&&(n._payload.status==="fulfilled"?F(n._payload.value)&&n._payload.value._store&&(n._payload.value._store.validated=1):n._store&&(n._store.validated=1))}function F(n){return typeof n=="object"&&n!==null&&n.$$typeof===R}var D=x,R=Symbol.for("react.transitional.element"),G=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),J=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),I=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),w=Symbol.for("react.client.reference"),j=D.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,u=Object.prototype.hasOwnProperty,T=Array.isArray,z=console.createTask?console.createTask:function(){return null};D={react_stack_bottom_frame:function(n){return n()}};var B,W={},p=D.react_stack_bottom_frame.bind(D,c)(),Z=z(o(c)),V={};xe.Fragment=M,xe.jsx=function(n,y,k){var S=1e4>j.recentlyCreatedOwnerStacks++;return E(n,y,k,!1,S?Error("react-stack-top-frame"):p,S?z(o(n)):Z)},xe.jsxs=function(n,y,k){var S=1e4>j.recentlyCreatedOwnerStacks++;return E(n,y,k,!0,S?Error("react-stack-top-frame"):p,S?z(o(n)):Z)}})()),xe}var Je;function Nt(){return Je||(Je=1,process.env.NODE_ENV==="production"?ye.exports=_t():ye.exports=It()),ye.exports}var s=Nt();const Lt=({onCommand:e,onSave:t,onExport:r,onClear:o,onImageUpload:i,showButtons:c=!1,hasUnsavedChanges:l,pendingImagesCount:a=0})=>{const[m,f]=x.useState([]),[E,O]=x.useState("p"),[F,D]=x.useState(!1),[R,G]=x.useState(!1),[M,J]=x.useState(!1),[H,C]=x.useState(!1),[I,X]=x.useState(!1),[Y,q]=x.useState(!1),[v,U]=x.useState("left"),d=x.useRef(null),w=x.useCallback(()=>{if(typeof window>"u"||typeof document>"u")return;const P=window.getSelection();if(!P||P.rangeCount===0||P.isCollapsed)return;const ue=P.getRangeAt(0).commonAncestorContainer;D(document.queryCommandState("bold")),G(document.queryCommandState("italic")),J(document.queryCommandState("underline")),C(document.queryCommandState("strikeThrough")),X(document.queryCommandState("insertUnorderedList")),q(document.queryCommandState("insertOrderedList")),document.queryCommandState("justifyLeft")?U("left"):document.queryCommandState("justifyCenter")?U("center"):document.queryCommandState("justifyRight")&&U("right");let ne=ue,ie="p";for(;ne&&ne!==document.body;){if(ne.nodeType===Node.ELEMENT_NODE){const ae=ne.tagName.toLowerCase();if(["h1","h2","h3","h4","h5","h6","p","div","blockquote","pre"].includes(ae)){["h1","h2"].includes(ae)&&(ie=ae);break}}ne=ne.parentNode}O(ie);const g=[];F&&g.push("bold"),R&&g.push("italic"),M&&g.push("underline"),H&&g.push("strikeThrough"),I&&g.push("insertUnorderedList"),Y&&g.push("insertOrderedList"),v==="left"&&g.push("justifyLeft"),v==="center"&&g.push("justifyCenter"),v==="right"&&g.push("justifyRight"),(ie==="h1"||ie==="h2")&&g.push(`formatBlock:${ie}`),f(g)},[F,R,M,H,I,Y,v]);x.useEffect(()=>{const P=()=>{requestAnimationFrame(w)},N=()=>{setTimeout(w,10)},ue=()=>{setTimeout(w,10)};return document.addEventListener("selectionchange",P),document.addEventListener("mouseup",N),document.addEventListener("keyup",ue),w(),()=>{document.removeEventListener("selectionchange",P),document.removeEventListener("mouseup",N),document.removeEventListener("keyup",ue)}},[w]);const j=()=>{const P=prompt("Enter URL:","https://");P&&e("createLink",P)},u=()=>{i()},T=P=>{e("formatBlock",P)},z=()=>{e("indent")},B=()=>{e("outdent")},W=()=>{e("undo")},p=()=>{e("redo")},Z=()=>{e("formatBlock","pre")},V=()=>{e("formatBlock","blockquote")},n=()=>{e("superscript")},y=()=>{e("subscript")},k=[{id:"undo",command:"undo",icon:s.jsx(L.Undo,{size:18}),title:"Undo",onClick:W},{id:"redo",command:"redo",icon:s.jsx(L.Redo,{size:18}),title:"Redo",onClick:p},{id:"separator-1",separator:!0},{id:"bold",command:"bold",icon:s.jsx(L.Bold,{size:18}),title:"Bold (Ctrl+B)",isActive:F},{id:"italic",command:"italic",icon:s.jsx(L.Italic,{size:18}),title:"Italic (Ctrl+I)",isActive:R},{id:"underline",command:"underline",icon:s.jsx(L.Underline,{size:18}),title:"Underline (Ctrl+U)",isActive:M},{id:"strikeThrough",command:"strikeThrough",icon:s.jsx(L.Strikethrough,{size:18}),title:"Strikethrough",isActive:H},{id:"separator-2",separator:!0},{id:"heading-1",command:"formatBlock",value:"h1",icon:s.jsx(L.Heading1,{size:18}),title:"Heading 1",isActive:E==="h1"},{id:"heading-2",command:"formatBlock",value:"h2",icon:s.jsx(L.Heading2,{size:18}),title:"Heading 2",isActive:E==="h2"},{id:"paragraph",command:"formatBlock",value:"p",icon:s.jsx(L.Type,{size:18}),title:"Paragraph",isActive:E==="p"},{id:"code",command:"formatBlock",value:"pre",icon:s.jsx(L.Code,{size:18}),title:"Code Block",onClick:Z},{id:"quote",command:"formatBlock",value:"blockquote",icon:s.jsx(L.Quote,{size:18}),title:"Blockquote",onClick:V},{id:"separator-3",separator:!0},{id:"unordered-list",command:"insertUnorderedList",icon:s.jsx(L.List,{size:18}),title:"Bullet List",isActive:I},{id:"ordered-list",command:"insertOrderedList",icon:s.jsx(L.ListOrdered,{size:18}),title:"Numbered List",isActive:Y},{id:"indent",command:"indent",icon:s.jsx(L.Indent,{size:18}),title:"Indent",onClick:z},{id:"outdent",command:"outdent",icon:s.jsx(L.Outdent,{size:18}),title:"Outdent",onClick:B},{id:"separator-4",separator:!0},{id:"align-left",command:"justifyLeft",icon:s.jsx(L.AlignLeft,{size:18}),title:"Align Left",isActive:v==="left"},{id:"align-center",command:"justifyCenter",icon:s.jsx(L.AlignCenter,{size:18}),title:"Center",isActive:v==="center"},{id:"align-right",command:"justifyRight",icon:s.jsx(L.AlignRight,{size:18}),title:"Align Right",isActive:v==="right"},{id:"separator-5",separator:!0},{id:"superscript",command:"superscript",icon:s.jsx(L.Superscript,{size:18}),title:"Superscript",onClick:n},{id:"subscript",command:"subscript",icon:s.jsx(L.Subscript,{size:18}),title:"Subscript",onClick:y},{id:"link",command:"createLink",icon:s.jsx(L.Link,{size:18}),title:"Insert Link",onClick:j},{id:"image",command:"insertImage",icon:a>0?s.jsxs("div",{className:"relative",children:[s.jsx(L.Image,{size:18}),s.jsx("span",{className:"absolute -top-2 -right-2 bg-blue-600 text-white text-xs rounded-full w-4 h-4 flex items-center justify-center",children:a})]}):s.jsx(L.Image,{size:18}),title:"Insert Image",onClick:u}],S=P=>s.jsx("div",{className:"flex items-center border-r border-gray-200 pr-2 mr-2 last:border-r-0 last:pr-0 last:mr-0",children:P.map(N=>{if(N.separator)return s.jsx("div",{className:"w-px h-6 bg-gray-300 mx-2"},N.id);const ue=N.isActive!==void 0?N.isActive:N.command?m.includes(N.command)||N.command==="formatBlock"&&N.value===E:!1;return s.jsx("button",{onClick:ne=>{ne.preventDefault(),ne.stopPropagation(),N.onClick?N.onClick():N.command==="formatBlock"&&N.value?T(N.value):N.command&&e(N.command,N.value),setTimeout(()=>{const ie=document.querySelector('[contenteditable="true"]');ie&&ie.focus()},10)},title:N.title,type:"button",className:`min-w-[36px] h-9 flex items-center justify-center rounded-md border transition-all duration-150 ${ue?"bg-blue-100 text-blue-600 border-blue-300 hover:bg-blue-200 shadow-sm":"bg-white border-gray-300 text-gray-700 hover:bg-gray-100 hover:border-gray-400"} active:scale-95 mx-0.5`,disabled:N.disabled,children:N.icon},N.id)})}),ee=k.slice(0,3),re=k.slice(3,10),A=k.slice(10,16),$=k.slice(16,20),te=k.slice(20,24),oe=k.slice(24,28),le=k.slice(28);return s.jsxs("div",{ref:d,className:"flex flex-col sm:flex-row flex-wrap items-start sm:items-center justify-between p-3 bg-gray-50 border-b border-gray-200 gap-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1 order-1 w-full sm:w-auto",children:[S(ee),S(re),S(A),S($),S(te),S(oe),S(le)]}),c&&s.jsxs("div",{className:"flex items-center gap-2 order-2 sm:order-3 mt-2 sm:mt-0 flex-shrink-0",children:[s.jsxs("button",{onClick:P=>{P.preventDefault(),P.stopPropagation(),t(),setTimeout(()=>{const N=document.querySelector('[contenteditable="true"]');N&&N.focus()},10)},disabled:!l,title:"Save Document (Ctrl+S)",className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed transition-colors duration-200 active:scale-95",children:[s.jsx(L.Save,{size:16}),s.jsx("span",{className:"hidden sm:inline",children:"Save"})]}),s.jsxs("button",{onClick:P=>{P.preventDefault(),P.stopPropagation(),r(),setTimeout(()=>{const N=document.querySelector('[contenteditable="true"]');N&&N.focus()},10)},title:"Export as HTML",className:"flex items-center gap-2 px-4 py-2 bg-green-600 text-white text-sm font-medium rounded-md hover:bg-green-700 transition-colors duration-200 active:scale-95",children:[s.jsx(L.FileDown,{size:16}),s.jsx("span",{className:"hidden sm:inline",children:"Export"})]}),s.jsxs("button",{onClick:P=>{P.preventDefault(),P.stopPropagation(),o(),setTimeout(()=>{const N=document.querySelector('[contenteditable="true"]');N&&N.focus()},10)},title:"Clear Editor",className:"flex items-center gap-2 px-4 py-2 bg-red-600 text-white text-sm font-medium rounded-md hover:bg-red-700 transition-colors duration-200 active:scale-95",children:[s.jsx(L.Trash2,{size:16}),s.jsx("span",{className:"hidden sm:inline",children:"Clear"})]})]}),s.jsxs("div",{className:"flex items-center gap-3 text-sm text-gray-500 order-3 sm:order-2 mt-2 sm:mt-0 flex-shrink-0",children:[a>0&&s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(L.Image,{size:14}),s.jsxs("span",{children:[a," pending"]})]}),l&&s.jsxs("span",{className:"flex items-center gap-1 text-amber-600",children:[s.jsx("span",{className:"w-2 h-2 bg-amber-500 rounded-full animate-pulse"}),s.jsx("span",{children:"Unsaved changes"})]})]})]})},Ot=({wordCount:e,characterCount:t,hasUnsavedChanges:r,pendingImagesCount:o=0})=>s.jsxs("div",{className:"flex justify-between items-center px-5 py-3 bg-gray-50 border-t border-gray-200 text-sm text-gray-600",children:[s.jsxs("div",{className:"flex items-center gap-6",children:[s.jsxs("div",{children:["Words: ",s.jsx("strong",{className:"text-gray-800",children:e})]}),s.jsxs("div",{children:["Characters: ",s.jsx("strong",{className:"text-gray-800",children:t})]}),o>0&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(L.Image,{size:14,className:"text-blue-600"}),s.jsxs("span",{className:"text-blue-600",children:[o," image",o!==1?"s":""]})]})]}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs("div",{className:`flex items-center gap-1 ${r?"text-orange-600":"text-green-600"}`,children:[r&&s.jsx(L.Save,{size:14,className:"animate-pulse"}),s.jsx("strong",{children:r?"Unsaved Changes":"Saved"})]})})]}),Mt=({initialContent:e="",onImageUpload:t,imageUploadEndpoint:r,allowedImageTypes:o=["image/jpeg","image/png","image/gif","image/webp"],maxImageSize:i=5*1024*1024})=>{const[c,l]=x.useState({content:e,title:"Untitled Document",wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length,hasUnsavedChanges:!1,pendingImages:[]}),a=x.useRef(null),m=x.useRef(new Map),f=x.useRef(e),E=x.useRef(!0),O=x.useCallback(()=>{if(!a.current)return;a.current.focus();const d=window.getSelection();if(d&&d.rangeCount>0){const u=d.getRangeAt(0);if(a.current.contains(u.commonAncestorContainer))return}const w=document.createRange();w.selectNodeContents(a.current),w.collapse(!1);const j=window.getSelection();j?.removeAllRanges(),j?.addRange(w)},[]),F=x.useCallback(()=>{const d=window.getSelection();if(!d||d.rangeCount===0||!a.current)return null;const w=d.getRangeAt(0);return a.current.contains(w.commonAncestorContainer)?w.cloneRange():null},[]),D=x.useCallback(d=>{if(!d||!a.current)return;a.current.focus();const w=window.getSelection();w?.removeAllRanges(),w?.addRange(d)},[]);x.useEffect(()=>{a.current&&E.current&&(a.current.innerHTML=e||"",E.current=!1)},[e]),x.useEffect(()=>{e!==f.current&&a.current&&(a.current.innerHTML!==e&&(a.current.innerHTML=e),f.current=e,l(d=>({...d,content:e,wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length,hasUnsavedChanges:!1})))},[e]);const R=x.useCallback(d=>{const w=d.trim()?d.trim().split(/\s+/).length:0,j=d.length;l(u=>({...u,content:d,wordCount:w,characterCount:j,hasUnsavedChanges:!0})),f.current=d},[]),G=x.useCallback(d=>{l(w=>({...w,title:d,hasUnsavedChanges:!0}))},[]),M=x.useCallback((d,w)=>{if(!a.current)return;const j=F();if(a.current.focus(),j)D(j);else{const u=window.getSelection();if(!u||u.rangeCount===0){const T=document.createRange();T.selectNodeContents(a.current),T.collapse(!1),u?.removeAllRanges(),u?.addRange(T)}}try{let u=!1;if(d==="formatBlock"&&w)u=document.execCommand("formatBlock",!1,`<${w}>`);else if(d==="createLink"&&w){const T=window.getSelection();T&&!T.isCollapsed?u=document.execCommand("createLink",!1,w):(document.execCommand("insertHTML",!1,`<a href="${w}" target="_blank">${w}</a>`),u=!0)}else u=document.execCommand(d,!1,w);u||console.warn(`Command ${d} failed to execute`),setTimeout(()=>{a.current&&R(a.current.innerHTML)},0)}catch(u){console.error(`Command ${d} failed:`,u)}a.current.focus()},[R,F,D]),J=x.useCallback(d=>o.includes(d.type)?d.size>i?{valid:!1,error:`File too large. Maximum size: ${Math.round(i/(1024*1024))}MB`}:{valid:!0}:{valid:!1,error:`Invalid file type. Allowed types: ${o.join(", ")}`},[o,i]),H=x.useCallback(async(d,w=!0)=>{const j=J(d);if(!j.valid){alert(j.error);return}if(!a.current)return;const u=`image-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,T=new FileReader;T.onload=z=>{const B=z.target?.result;m.current.set(u,{originalUrl:B,fileName:d.name,size:d.size,type:d.type});const W=document.createElement("img");W.src=B,W.alt=d.name,W.className="max-w-full h-auto border rounded",W.setAttribute("data-image-id",u),W.setAttribute("data-file-name",d.name),W.style.maxWidth="100%",W.style.height="auto";const p=F();if(w&&p){p.deleteContents(),p.insertNode(W);const Z=document.createRange();Z.setStartAfter(W),Z.collapse(!0);const V=window.getSelection();V?.removeAllRanges(),V?.addRange(Z)}else a.current?.appendChild(W);a.current&&R(a?.current?.innerHTML),(t||r)&&l(Z=>({...Z,pendingImages:[...Z.pendingImages,{id:u,file:d,placeholderUrl:B,status:"pending"}]})),a.current?.focus()},T.readAsDataURL(d)},[J,R,t,r,F]),C=x.useCallback(async()=>{if(!t&&!r)return;const d=c.pendingImages.filter(w=>w.status==="pending");if(d.length!==0){for(const w of d)try{l(T=>({...T,pendingImages:T.pendingImages.map(z=>z.id===w.id?{...z,status:"uploading"}:z)}));let j;if(t)j=await t(w.file);else if(r){const T=new FormData;T.append("image",w.file);const z=await fetch(r,{method:"POST",body:T});if(!z.ok)throw new Error(`Upload failed: ${z.statusText}`);const B=await z.json();j=B.url||B.imageUrl||B.data}else throw new Error("No upload method provided");const u=a.current?.querySelector(`img[data-image-id="${w.id}"]`);if(u){u.src=j,u.classList.add("uploaded");const T=m.current.get(w.id);T&&m.current.set(w.id,{...T,uploadedUrl:j})}l(T=>({...T,pendingImages:T.pendingImages.map(z=>z.id===w.id?{...z,status:"uploaded"}:z)}))}catch(j){console.error("Image upload failed:",j);const u=a.current?.querySelector(`img[data-image-id="${w.id}"]`);u&&u.classList.add("failed"),l(T=>({...T,pendingImages:T.pendingImages.map(z=>z.id===w.id?{...z,status:"failed"}:z)}))}a.current&&R(a.current.innerHTML)}},[c.pendingImages,t,r,R]),I=x.useCallback(d=>{const w=d.clipboardData.items;let j=!1;for(const u of w)if(u.type.indexOf("image")!==-1){d.preventDefault();const T=u.getAsFile();T&&(j=!0,H(T));break}j||setTimeout(()=>{a.current&&R(a.current.innerHTML)},0)},[H,R]),X=x.useCallback(d=>{d.preventDefault();const w=Array.from(d.dataTransfer.files);let j=!1;for(const u of w)u.type.startsWith("image/")&&(j=!0,H(u,!1));if(!j&&a.current){const u=window.getSelection();if(u&&u.rangeCount>0){const T=u.getRangeAt(0);a.current.contains(T.commonAncestorContainer)&&setTimeout(()=>{a.current&&R(a.current.innerHTML)},0)}}},[H,R]),Y=x.useCallback(()=>{try{const d=a.current?.innerHTML||c.content;return{success:!0,data:{title:c.title,content:d,metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),wordCount:c.wordCount,characterCount:c.characterCount}}}}catch(d){return{success:!1,error:d instanceof Error?d.message:"Validation failed"}}},[c]),q=x.useCallback((d={includeStyles:!0,includeMeta:!0})=>{const w=Y();if(!w.success)throw new Error(w.error);const{data:j}=w;let u=`<!DOCTYPE html>
8
8
  <html>
9
9
  <head>
10
10
  <meta charset="UTF-8">
11
11
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
12
- <title>${S?.title||"Document"}</title>`;return c.includeStyles&&(v+=`
12
+ <title>${j?.title||"Document"}</title>`;return d.includeStyles&&(u+=`
13
13
  <style>
14
14
  body {
15
15
  font-family: system-ui, -apple-system, sans-serif;
@@ -44,18 +44,18 @@ React keys must be passed directly to JSX without using spread:
44
44
  a { color: #2563eb; text-decoration: underline; }
45
45
  .image-uploading { opacity: 0.7; }
46
46
  .image-failed { border: 2px solid #ef4444; }
47
- </style>`),v+=`
47
+ </style>`),u+=`
48
48
  </head>
49
- <body>`,c.includeMeta&&S&&(v+=`
49
+ <body>`,d.includeMeta&&j&&(u+=`
50
50
  <div class="document-meta">
51
- <h1>${S.title}</h1>
52
- <p><small>Created: ${new Date(S.metadata.createdAt).toLocaleString()} |
53
- Words: ${S.metadata.wordCount} |
54
- Characters: ${S.metadata.characterCount}</small></p>
51
+ <h1>${j.title}</h1>
52
+ <p><small>Created: ${new Date(j.metadata.createdAt).toLocaleString()} |
53
+ Words: ${j.metadata.wordCount} |
54
+ Characters: ${j.metadata.characterCount}</small></p>
55
55
  <hr>
56
- </div>`),v+=`
57
- <div class="${c.includeStyles?"readonly-content":""}">
58
- ${S?.content||""}
56
+ </div>`),u+=`
57
+ <div class="${d.includeStyles?"readonly-content":""}">
58
+ ${j?.content||""}
59
59
  </div>
60
60
  </body>
61
- </html>`,v},[J]),p=b.useCallback(()=>{l({content:"",title:"Untitled Document",wordCount:0,characterCount:0,hasUnsavedChanges:!1,pendingImages:[]}),u.current.clear(),i.current&&(i.current.innerHTML="",O()),m.current=""},[O]);return{editorState:d,editorRef:i,updateContent:R,updateTitle:W,executeCommand:M,getValidationResult:J,exportToHTML:Q,clearEditor:p,handlePaste:I,handleDrop:q,insertImage:H,uploadPendingImages:C}},Mt=(e,t)=>{const r=new Array(e.length+t.length);for(let o=0;o<e.length;o++)r[o]=e[o];for(let o=0;o<t.length;o++)r[e.length+o]=t[o];return r},Pt=(e,t)=>({classGroupId:e,validator:t}),Je=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),ye="-",Ke=[],Ut="arbitrary..",Ft=e=>{const t=Bt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Dt(l);const i=l.split(ye),u=i[0]===""&&i.length>1?1:0;return Xe(i,u,t)},getConflictingClassGroupIds:(l,i)=>{if(i){const u=o[l],m=r[l];return u?m?Mt(m,u):u:m||Ke}return r[l]||Ke}}},Xe=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const a=e[t],d=r.nextPart.get(a);if(d){const m=Xe(e,t+1,d);if(m)return m}const l=r.validators;if(l===null)return;const i=t===0?e.join(ye):e.slice(t).join(ye),u=l.length;for(let m=0;m<u;m++){const A=l[m];if(A.validator(i))return A.classGroupId}},Dt=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),o=t.slice(0,r);return o?Ut+o:void 0})(),Bt=e=>{const{theme:t,classGroups:r}=e;return Gt(r,t)},Gt=(e,t)=>{const r=Je();for(const o in e){const a=e[o];je(a,r,o,t)}return r},je=(e,t,r,o)=>{const a=e.length;for(let d=0;d<a;d++){const l=e[d];Wt(l,t,r,o)}},Wt=(e,t,r,o)=>{if(typeof e=="string"){Vt(e,t,r);return}if(typeof e=="function"){Ht(e,t,r,o);return}Yt(e,t,r,o)},Vt=(e,t,r)=>{const o=e===""?t:qe(t,e);o.classGroupId=r},Ht=(e,t,r,o)=>{if(Jt(e)){je(e(o),t,r,o);return}t.validators===null&&(t.validators=[]),t.validators.push(Pt(r,e))},Yt=(e,t,r,o)=>{const a=Object.entries(e),d=a.length;for(let l=0;l<d;l++){const[i,u]=a[l];je(u,qe(t,i),r,o)}},qe=(e,t)=>{let r=e;const o=t.split(ye),a=o.length;for(let d=0;d<a;d++){const l=o[d];let i=r.nextPart.get(l);i||(i=Je(),r.nextPart.set(l,i)),r=i}return r},Jt=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Kt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),o=Object.create(null);const a=(d,l)=>{r[d]=l,t++,t>e&&(t=0,o=r,r=Object.create(null))};return{get(d){let l=r[d];if(l!==void 0)return l;if((l=o[d])!==void 0)return a(d,l),l},set(d,l){d in r?r[d]=l:a(d,l)}}},Se="!",Qe=":",Xt=[],Ze=(e,t,r,o,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:o,isExternal:a}),qt=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=a=>{const d=[];let l=0,i=0,u=0,m;const A=a.length;for(let W=0;W<A;W++){const M=a[W];if(l===0&&i===0){if(M===Qe){d.push(a.slice(u,W)),u=W+1;continue}if(M==="/"){m=W;continue}}M==="["?l++:M==="]"?l--:M==="("?i++:M===")"&&i--}const O=d.length===0?a:a.slice(u);let F=O,B=!1;O.endsWith(Se)?(F=O.slice(0,-1),B=!0):O.startsWith(Se)&&(F=O.slice(1),B=!0);const R=m&&m>u?m-u:void 0;return Ze(d,B,F,R)};if(t){const a=t+Qe,d=o;o=l=>l.startsWith(a)?d(l.slice(a.length)):Ze(Xt,!1,l,void 0,!0)}if(r){const a=o;o=d=>r({className:d,parseClassName:a})}return o},Qt=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,o)=>{t.set(r,1e6+o)}),r=>{const o=[];let a=[];for(let d=0;d<r.length;d++){const l=r[d],i=l[0]==="[",u=t.has(l);i||u?(a.length>0&&(a.sort(),o.push(...a),a=[]),o.push(l)):a.push(l)}return a.length>0&&(a.sort(),o.push(...a)),o}},Zt=e=>({cache:Kt(e.cacheSize),parseClassName:qt(e),sortModifiers:Qt(e),...Ft(e)}),$t=/\s+/,er=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:a,sortModifiers:d}=t,l=[],i=e.trim().split($t);let u="";for(let m=i.length-1;m>=0;m-=1){const A=i[m],{isExternal:O,modifiers:F,hasImportantModifier:B,baseClassName:R,maybePostfixModifierPosition:W}=r(A);if(O){u=A+(u.length>0?" "+u:u);continue}let M=!!W,K=o(M?R.substring(0,W):R);if(!K){if(!M){u=A+(u.length>0?" "+u:u);continue}if(K=o(R),!K){u=A+(u.length>0?" "+u:u);continue}M=!1}const H=F.length===0?"":F.length===1?F[0]:d(F).join(":"),C=B?H+Se:H,I=C+K;if(l.indexOf(I)>-1)continue;l.push(I);const q=a(K,M);for(let J=0;J<q.length;++J){const Q=q[J];l.push(C+Q)}u=A+(u.length>0?" "+u:u)}return u},tr=(...e)=>{let t=0,r,o,a="";for(;t<e.length;)(r=e[t++])&&(o=$e(r))&&(a&&(a+=" "),a+=o);return a},$e=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=$e(e[o]))&&(r&&(r+=" "),r+=t);return r},rr=(e,...t)=>{let r,o,a,d;const l=u=>{const m=t.reduce((A,O)=>O(A),e());return r=Zt(m),o=r.cache.get,a=r.cache.set,d=i,i(u)},i=u=>{const m=o(u);if(m)return m;const A=er(u,r);return a(u,A),A};return d=l,(...u)=>d(tr(...u))},or=[],X=e=>{const t=r=>r[e]||or;return t.isThemeGetter=!0,t},et=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nr=/^\d+\/\d+$/,ar=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ir=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fe=e=>nr.test(e),_=e=>!!e&&!Number.isNaN(Number(e)),ce=e=>!!e&&Number.isInteger(Number(e)),Te=e=>e.endsWith("%")&&_(e.slice(0,-1)),ie=e=>ar.test(e),dr=()=>!0,ur=e=>ir.test(e)&&!sr.test(e),rt=()=>!1,mr=e=>lr.test(e),fr=e=>cr.test(e),gr=e=>!f(e)&&!g(e),pr=e=>ge(e,st,rt),f=e=>et.test(e),me=e=>ge(e,lt,ur),Re=e=>ge(e,wr,_),ot=e=>ge(e,at,rt),hr=e=>ge(e,it,fr),ke=e=>ge(e,ct,mr),g=e=>tt.test(e),xe=e=>pe(e,lt),br=e=>pe(e,yr),nt=e=>pe(e,at),xr=e=>pe(e,st),vr=e=>pe(e,it),Ce=e=>pe(e,ct,!0),ge=(e,t,r)=>{const o=et.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},pe=(e,t,r=!1)=>{const o=tt.exec(e);return o?o[1]?t(o[1]):r:!1},at=e=>e==="position"||e==="percentage",it=e=>e==="image"||e==="url",st=e=>e==="length"||e==="size"||e==="bg-size",lt=e=>e==="length",wr=e=>e==="number",yr=e=>e==="family-name",ct=e=>e==="shadow",kr=rr(()=>{const e=X("color"),t=X("font"),r=X("text"),o=X("font-weight"),a=X("tracking"),d=X("leading"),l=X("breakpoint"),i=X("container"),u=X("spacing"),m=X("radius"),A=X("shadow"),O=X("inset-shadow"),F=X("text-shadow"),B=X("drop-shadow"),R=X("blur"),W=X("perspective"),M=X("aspect"),K=X("ease"),H=X("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],q=()=>[...I(),g,f],J=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto","contain","none"],p=()=>[g,f,u],c=()=>[fe,"full","auto",...p()],y=()=>[ce,"none","subgrid",g,f],S=()=>["auto",{span:["full",ce,g,f]},ce,g,f],v=()=>[ce,"auto",g,f],w=()=>["auto","min","max","fr",g,f],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],D=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...p()],V=()=>[fe,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...p()],x=()=>[e,g,f],Y=()=>[...I(),nt,ot,{position:[g,f]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],n=()=>["auto","cover","contain",xr,pr,{size:[g,f]}],j=()=>[Te,xe,me],k=()=>["","none","full",m,g,f],E=()=>["",_,xe,me],Z=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>[_,Te,nt,ot],$=()=>["","none",R,g,f],ee=()=>["none",_,g,f],re=()=>["none",_,g,f],se=()=>[_,g,f],U=()=>[fe,"full",...p()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ie],breakpoint:[ie],color:[dr],container:[ie],"drop-shadow":[ie],ease:["in","out","in-out"],font:[gr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ie],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ie],shadow:[ie],spacing:["px",_],text:[ie],"text-shadow":[ie],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fe,f,g,M]}],container:["container"],columns:[{columns:[_,f,g,i]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:q()}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:Q()}],"overscroll-x":[{"overscroll-x":Q()}],"overscroll-y":[{"overscroll-y":Q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:c()}],"inset-x":[{"inset-x":c()}],"inset-y":[{"inset-y":c()}],start:[{start:c()}],end:[{end:c()}],top:[{top:c()}],right:[{right:c()}],bottom:[{bottom:c()}],left:[{left:c()}],visibility:["visible","invisible","collapse"],z:[{z:[ce,"auto",g,f]}],basis:[{basis:[fe,"full","auto",i,...p()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_,fe,"auto","initial","none",f]}],grow:[{grow:["",_,g,f]}],shrink:[{shrink:["",_,g,f]}],order:[{order:[ce,"first","last","none",g,f]}],"grid-cols":[{"grid-cols":y()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":v()}],"col-end":[{"col-end":v()}],"grid-rows":[{"grid-rows":y()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":v()}],"row-end":[{"row-end":v()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":w()}],"auto-rows":[{"auto-rows":w()}],gap:[{gap:p()}],"gap-x":[{"gap-x":p()}],"gap-y":[{"gap-y":p()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...D(),"normal"]}],"justify-self":[{"justify-self":["auto",...D()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...D(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...D(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...D(),"baseline"]}],"place-self":[{"place-self":["auto",...D()]}],p:[{p:p()}],px:[{px:p()}],py:[{py:p()}],ps:[{ps:p()}],pe:[{pe:p()}],pt:[{pt:p()}],pr:[{pr:p()}],pb:[{pb:p()}],pl:[{pl:p()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":p()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":p()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],w:[{w:[i,"screen",...V()]}],"min-w":[{"min-w":[i,"screen","none",...V()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[l]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",r,xe,me]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,g,Re]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Te,f]}],"font-family":[{font:[br,f,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,g,f]}],"line-clamp":[{"line-clamp":[_,"none",g,Re]}],leading:[{leading:[d,...p()]}],"list-image":[{"list-image":["none",g,f]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",g,f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:x()}],"text-color":[{text:x()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[_,"from-font","auto",g,me]}],"text-decoration-color":[{decoration:x()}],"underline-offset":[{"underline-offset":[_,"auto",g,f]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:p()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",g,f]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",g,f]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:n()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ce,g,f],radial:["",g,f],conic:[ce,g,f]},vr,hr]}],"bg-color":[{bg:x()}],"gradient-from-pos":[{from:j()}],"gradient-via-pos":[{via:j()}],"gradient-to-pos":[{to:j()}],"gradient-from":[{from:x()}],"gradient-via":[{via:x()}],"gradient-to":[{to:x()}],rounded:[{rounded:k()}],"rounded-s":[{"rounded-s":k()}],"rounded-e":[{"rounded-e":k()}],"rounded-t":[{"rounded-t":k()}],"rounded-r":[{"rounded-r":k()}],"rounded-b":[{"rounded-b":k()}],"rounded-l":[{"rounded-l":k()}],"rounded-ss":[{"rounded-ss":k()}],"rounded-se":[{"rounded-se":k()}],"rounded-ee":[{"rounded-ee":k()}],"rounded-es":[{"rounded-es":k()}],"rounded-tl":[{"rounded-tl":k()}],"rounded-tr":[{"rounded-tr":k()}],"rounded-br":[{"rounded-br":k()}],"rounded-bl":[{"rounded-bl":k()}],"border-w":[{border:E()}],"border-w-x":[{"border-x":E()}],"border-w-y":[{"border-y":E()}],"border-w-s":[{"border-s":E()}],"border-w-e":[{"border-e":E()}],"border-w-t":[{"border-t":E()}],"border-w-r":[{"border-r":E()}],"border-w-b":[{"border-b":E()}],"border-w-l":[{"border-l":E()}],"divide-x":[{"divide-x":E()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":E()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:x()}],"border-color-x":[{"border-x":x()}],"border-color-y":[{"border-y":x()}],"border-color-s":[{"border-s":x()}],"border-color-e":[{"border-e":x()}],"border-color-t":[{"border-t":x()}],"border-color-r":[{"border-r":x()}],"border-color-b":[{"border-b":x()}],"border-color-l":[{"border-l":x()}],"divide-color":[{divide:x()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_,g,f]}],"outline-w":[{outline:["",_,xe,me]}],"outline-color":[{outline:x()}],shadow:[{shadow:["","none",A,Ce,ke]}],"shadow-color":[{shadow:x()}],"inset-shadow":[{"inset-shadow":["none",O,Ce,ke]}],"inset-shadow-color":[{"inset-shadow":x()}],"ring-w":[{ring:E()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:x()}],"ring-offset-w":[{"ring-offset":[_,me]}],"ring-offset-color":[{"ring-offset":x()}],"inset-ring-w":[{"inset-ring":E()}],"inset-ring-color":[{"inset-ring":x()}],"text-shadow":[{"text-shadow":["none",F,Ce,ke]}],"text-shadow-color":[{"text-shadow":x()}],opacity:[{opacity:[_,g,f]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_]}],"mask-image-linear-from-pos":[{"mask-linear-from":T()}],"mask-image-linear-to-pos":[{"mask-linear-to":T()}],"mask-image-linear-from-color":[{"mask-linear-from":x()}],"mask-image-linear-to-color":[{"mask-linear-to":x()}],"mask-image-t-from-pos":[{"mask-t-from":T()}],"mask-image-t-to-pos":[{"mask-t-to":T()}],"mask-image-t-from-color":[{"mask-t-from":x()}],"mask-image-t-to-color":[{"mask-t-to":x()}],"mask-image-r-from-pos":[{"mask-r-from":T()}],"mask-image-r-to-pos":[{"mask-r-to":T()}],"mask-image-r-from-color":[{"mask-r-from":x()}],"mask-image-r-to-color":[{"mask-r-to":x()}],"mask-image-b-from-pos":[{"mask-b-from":T()}],"mask-image-b-to-pos":[{"mask-b-to":T()}],"mask-image-b-from-color":[{"mask-b-from":x()}],"mask-image-b-to-color":[{"mask-b-to":x()}],"mask-image-l-from-pos":[{"mask-l-from":T()}],"mask-image-l-to-pos":[{"mask-l-to":T()}],"mask-image-l-from-color":[{"mask-l-from":x()}],"mask-image-l-to-color":[{"mask-l-to":x()}],"mask-image-x-from-pos":[{"mask-x-from":T()}],"mask-image-x-to-pos":[{"mask-x-to":T()}],"mask-image-x-from-color":[{"mask-x-from":x()}],"mask-image-x-to-color":[{"mask-x-to":x()}],"mask-image-y-from-pos":[{"mask-y-from":T()}],"mask-image-y-to-pos":[{"mask-y-to":T()}],"mask-image-y-from-color":[{"mask-y-from":x()}],"mask-image-y-to-color":[{"mask-y-to":x()}],"mask-image-radial":[{"mask-radial":[g,f]}],"mask-image-radial-from-pos":[{"mask-radial-from":T()}],"mask-image-radial-to-pos":[{"mask-radial-to":T()}],"mask-image-radial-from-color":[{"mask-radial-from":x()}],"mask-image-radial-to-color":[{"mask-radial-to":x()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[_]}],"mask-image-conic-from-pos":[{"mask-conic-from":T()}],"mask-image-conic-to-pos":[{"mask-conic-to":T()}],"mask-image-conic-from-color":[{"mask-conic-from":x()}],"mask-image-conic-to-color":[{"mask-conic-to":x()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:n()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",g,f]}],filter:[{filter:["","none",g,f]}],blur:[{blur:$()}],brightness:[{brightness:[_,g,f]}],contrast:[{contrast:[_,g,f]}],"drop-shadow":[{"drop-shadow":["","none",B,Ce,ke]}],"drop-shadow-color":[{"drop-shadow":x()}],grayscale:[{grayscale:["",_,g,f]}],"hue-rotate":[{"hue-rotate":[_,g,f]}],invert:[{invert:["",_,g,f]}],saturate:[{saturate:[_,g,f]}],sepia:[{sepia:["",_,g,f]}],"backdrop-filter":[{"backdrop-filter":["","none",g,f]}],"backdrop-blur":[{"backdrop-blur":$()}],"backdrop-brightness":[{"backdrop-brightness":[_,g,f]}],"backdrop-contrast":[{"backdrop-contrast":[_,g,f]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_,g,f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_,g,f]}],"backdrop-invert":[{"backdrop-invert":["",_,g,f]}],"backdrop-opacity":[{"backdrop-opacity":[_,g,f]}],"backdrop-saturate":[{"backdrop-saturate":[_,g,f]}],"backdrop-sepia":[{"backdrop-sepia":["",_,g,f]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":p()}],"border-spacing-x":[{"border-spacing-x":p()}],"border-spacing-y":[{"border-spacing-y":p()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",g,f]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_,"initial",g,f]}],ease:[{ease:["linear","initial",K,g,f]}],delay:[{delay:[_,g,f]}],animate:[{animate:["none",H,g,f]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[W,g,f]}],"perspective-origin":[{"perspective-origin":q()}],rotate:[{rotate:ee()}],"rotate-x":[{"rotate-x":ee()}],"rotate-y":[{"rotate-y":ee()}],"rotate-z":[{"rotate-z":ee()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":["scale-3d"],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[g,f,"","none","gpu","cpu"]}],"transform-origin":[{origin:q()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:U()}],"translate-x":[{"translate-x":U()}],"translate-y":[{"translate-y":U()}],"translate-z":[{"translate-z":U()}],"translate-none":["translate-none"],accent:[{accent:x()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:x()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",g,f]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":p()}],"scroll-mx":[{"scroll-mx":p()}],"scroll-my":[{"scroll-my":p()}],"scroll-ms":[{"scroll-ms":p()}],"scroll-me":[{"scroll-me":p()}],"scroll-mt":[{"scroll-mt":p()}],"scroll-mr":[{"scroll-mr":p()}],"scroll-mb":[{"scroll-mb":p()}],"scroll-ml":[{"scroll-ml":p()}],"scroll-p":[{"scroll-p":p()}],"scroll-px":[{"scroll-px":p()}],"scroll-py":[{"scroll-py":p()}],"scroll-ps":[{"scroll-ps":p()}],"scroll-pe":[{"scroll-pe":p()}],"scroll-pt":[{"scroll-pt":p()}],"scroll-pr":[{"scroll-pr":p()}],"scroll-pb":[{"scroll-pb":p()}],"scroll-pl":[{"scroll-pl":p()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",g,f]}],fill:[{fill:["none",...x()]}],"stroke-w":[{stroke:[_,xe,me,Re]}],stroke:[{stroke:["none",...x()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function dt(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=dt(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function Cr(){for(var e,t,r=0,o="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=dt(e))&&(o&&(o+=" "),o+=t);return o}function Ee(...e){return kr(Cr(e))}var Ae,ut;function mt(){if(ut)return Ae;ut=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Ae=e,Ae}var ze,ft;function jr(){if(ft)return ze;ft=1;var e=typeof ve=="object"&&ve&&ve.Object===Object&&ve;return ze=e,ze}var _e,gt;function pt(){if(gt)return _e;gt=1;var e=jr(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return _e=r,_e}var Ie,ht;function Sr(){if(ht)return Ie;ht=1;var e=pt(),t=function(){return e.Date.now()};return Ie=t,Ie}var Ne,bt;function Tr(){if(bt)return Ne;bt=1;var e=/\s/;function t(r){for(var o=r.length;o--&&e.test(r.charAt(o)););return o}return Ne=t,Ne}var Le,xt;function Rr(){if(xt)return Le;xt=1;var e=Tr(),t=/^\s+/;function r(o){return o&&o.slice(0,e(o)+1).replace(t,"")}return Le=r,Le}var Oe,vt;function wt(){if(vt)return Oe;vt=1;var e=pt(),t=e.Symbol;return Oe=t,Oe}var Me,yt;function Er(){if(yt)return Me;yt=1;var e=wt(),t=Object.prototype,r=t.hasOwnProperty,o=t.toString,a=e?e.toStringTag:void 0;function d(l){var i=r.call(l,a),u=l[a];try{l[a]=void 0;var m=!0}catch{}var A=o.call(l);return m&&(i?l[a]=u:delete l[a]),A}return Me=d,Me}var Pe,kt;function Ar(){if(kt)return Pe;kt=1;var e=Object.prototype,t=e.toString;function r(o){return t.call(o)}return Pe=r,Pe}var Ue,Ct;function zr(){if(Ct)return Ue;Ct=1;var e=wt(),t=Er(),r=Ar(),o="[object Null]",a="[object Undefined]",d=e?e.toStringTag:void 0;function l(i){return i==null?i===void 0?a:o:d&&d in Object(i)?t(i):r(i)}return Ue=l,Ue}var Fe,jt;function _r(){if(jt)return Fe;jt=1;function e(t){return t!=null&&typeof t=="object"}return Fe=e,Fe}var De,St;function Ir(){if(St)return De;St=1;var e=zr(),t=_r(),r="[object Symbol]";function o(a){return typeof a=="symbol"||t(a)&&e(a)==r}return De=o,De}var Be,Tt;function Nr(){if(Tt)return Be;Tt=1;var e=Rr(),t=mt(),r=Ir(),o=NaN,a=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,l=/^0o[0-7]+$/i,i=parseInt;function u(m){if(typeof m=="number")return m;if(r(m))return o;if(t(m)){var A=typeof m.valueOf=="function"?m.valueOf():m;m=t(A)?A+"":A}if(typeof m!="string")return m===0?m:+m;m=e(m);var O=d.test(m);return O||l.test(m)?i(m.slice(2),O?2:8):a.test(m)?o:+m}return Be=u,Be}var Ge,Rt;function Lr(){if(Rt)return Ge;Rt=1;var e=mt(),t=Sr(),r=Nr(),o="Expected a function",a=Math.max,d=Math.min;function l(i,u,m){var A,O,F,B,R,W,M=0,K=!1,H=!1,C=!0;if(typeof i!="function")throw new TypeError(o);u=r(u)||0,e(m)&&(K=!!m.leading,H="maxWait"in m,F=H?a(r(m.maxWait)||0,u):F,C="trailing"in m?!!m.trailing:C);function I(w){var z=A,D=O;return A=O=void 0,M=w,B=i.apply(D,z),B}function q(w){return M=w,R=setTimeout(p,u),K?I(w):B}function J(w){var z=w-W,D=w-M,P=u-z;return H?d(P,F-D):P}function Q(w){var z=w-W,D=w-M;return W===void 0||z>=u||z<0||H&&D>=F}function p(){var w=t();if(Q(w))return c(w);R=setTimeout(p,J(w))}function c(w){return R=void 0,C&&A?I(w):(A=O=void 0,B)}function y(){R!==void 0&&clearTimeout(R),M=0,A=W=O=R=void 0}function S(){return R===void 0?B:c(t())}function v(){var w=t(),z=Q(w);if(A=arguments,O=this,W=w,z){if(R===void 0)return q(W);if(H)return clearTimeout(R),R=setTimeout(p,u),I(W)}return R===void 0&&(R=setTimeout(p,u)),B}return v.cancel=y,v.flush=S,v}return Ge=l,Ge}var Or=Lr();const Mr=At(Or),Et=b.forwardRef(({initialContent:e="",onChange:t,onSave:r,onExport:o,readOnly:a=!1,showButtons:d=!1,showSaveTitle:l=!1,showStatusBar:i=!1,height:u="500px",onImageUpload:m,imageUploadEndpoint:A,allowedImageTypes:O=["image/jpeg","image/png","image/gif","image/webp","image/svg+xml"],maxImageSize:F=5*1024*1024,onInit:B,debounceDelay:R=300,className:W="",placeholder:M="Start typing here...",autoFocus:K=!1},H)=>{const{editorState:C,editorRef:I,updateContent:q,updateTitle:J,executeCommand:Q,getValidationResult:p,exportToHTML:c,clearEditor:y,handlePaste:S,handleDrop:v,insertImage:w,uploadPendingImages:z}=Ot({initialContent:e,onImageUpload:m,imageUploadEndpoint:A,allowedImageTypes:O,maxImageSize:F}),D=b.useRef(null),P=b.useRef(!1),V=b.useRef(null),[x,Y]=b.useState(!1),[te,n]=b.useState(""),[j,k]=b.useState(!1),[E,Z]=b.useState(0),ae=b.useRef(null),T=b.useRef(t),$=b.useRef(C.content),ee=b.useRef(C.title);b.useEffect(()=>{T.current=t},[t]),b.useImperativeHandle(H,()=>({getContent:()=>C.content,getHTML:()=>c(),getTitle:()=>C.title,clear:y,focus:()=>{if(I.current){I.current.focus();const h=document.createRange();h.selectNodeContents(I.current),h.collapse(!1);const G=window.getSelection();G?.removeAllRanges(),G?.addRange(h)}},insertText:h=>{I.current&&(document.execCommand("insertText",!1,h),q(I.current.innerHTML))},insertHTML:h=>{I.current&&(document.execCommand("insertHTML",!1,h),q(I.current.innerHTML))},executeCommand:(h,G)=>{Q(h,G)}})),b.useEffect(()=>{B&&I.current&&!P.current&&(B(I.current),P.current=!0)},[B,I]),b.useEffect(()=>{K&&I.current&&!a&&setTimeout(()=>{if(I.current){I.current.focus();const h=document.createRange();h.selectNodeContents(I.current),h.collapse(!1);const G=window.getSelection();G?.removeAllRanges(),G?.addRange(h)}},100)},[K,a,I]),b.useEffect(()=>(V.current=Mr((h,G,ue)=>{T.current?.(h,G,ue)},R),()=>{V.current&&V.current.cancel()}),[R]),b.useEffect(()=>{if(!T.current||C.content===$.current&&C.title===ee.current)return;const h=(()=>{try{return c({includeStyles:!1,includeMeta:!1})}catch{return`<!DOCTYPE html><html><body>${C.content}</body></html>`}})();$.current=C.content,ee.current=C.title,R>0&&V.current?V.current(C.content,h,C.title):T.current(C.content,h,C.title)},[C.content,C.title,c,R]);const re=b.useCallback(async()=>{if(V.current&&V.current.flush?.(),C.pendingImages.length>0){k(!0);try{await z(),n("Images uploaded successfully!"),setTimeout(()=>n(""),3e3)}catch{n("Failed to upload images. Please try again."),Y(!0),setTimeout(()=>{Y(!1),n("")},5e3),k(!1);return}finally{k(!1)}}const h=p();if(!h.success){n(h.error||"Please fix validation errors before saving."),Y(!0),setTimeout(()=>{Y(!1),n("")},3e3);return}try{r?.(C.content,c()),n("Document saved successfully!"),Y(!0),setTimeout(()=>{Y(!1),n("")},2e3)}catch{n("Failed to save document."),Y(!0),setTimeout(()=>{Y(!1),n("")},3e3)}},[C,z,p,c,r]),se=b.useCallback(async()=>{if(V.current&&V.current.flush?.(),C.pendingImages.length>0){k(!0);try{await z()}catch(h){console.error("Failed to upload images:",h)}finally{k(!1)}}try{const h=c();o?.(h);const G=new Blob([h],{type:"text/html"}),ue=URL.createObjectURL(G),ne=document.createElement("a");ne.href=ue,ne.download=`${C.title.replace(/[^\w\s]/gi,"").replace(/\s+/g,"_")||"document"}.html`,document.body.appendChild(ne),ne.click(),document.body.removeChild(ne),URL.revokeObjectURL(ue),n("Document exported successfully!"),Y(!0),setTimeout(()=>{Y(!1),n("")},2e3)}catch{n("Failed to export document."),Y(!0),setTimeout(()=>{Y(!1),n("")},3e3)}},[C,z,c,o]),U=b.useCallback(h=>{q(h)},[q]),N=async h=>{if(!h.target.files||a)return;const G=Array.from(h.target.files);let ue=0;const ne=G.length;for(const Pr of G)try{await w(Pr),ue++,Z(Math.round(ue/ne*100))}catch(Ur){console.error("Failed to insert image:",Ur)}Z(0),h.target.value=""},de=b.useCallback(()=>{a||I.current&&I.current.focus()},[a,I]),oe=b.useCallback(h=>{(h.ctrlKey||h.metaKey)&&h.key==="s"&&(h.preventDefault(),re()),(h.ctrlKey||h.metaKey)&&h.key==="e"&&(h.preventDefault(),se()),(h.ctrlKey||h.metaKey)&&h.key==="k"&&h.shiftKey&&(h.preventDefault(),y())},[re,se,y]);return s.jsxs("div",{ref:ae,className:Ee("relative w-full bg-white border border-gray-300 rounded-lg overflow-hidden flex flex-col",a&&"pointer-events-none opacity-80",W),style:{height:u},children:[l&&s.jsxs("div",{className:"p-4 md:p-6 border-b bg-gradient-to-r from-gray-50 to-white",children:[s.jsx("input",{className:"w-full text-xl md:text-2xl font-bold bg-transparent outline-none placeholder:text-gray-400",value:C.title,onChange:h=>J(h.target.value),placeholder:"Document Title",readOnly:a,maxLength:100}),C.title.length>=90&&s.jsxs("div",{className:"text-xs text-gray-500 text-right mt-1",children:[C.title.length,"/100 characters"]})]}),s.jsx(Nt,{onCommand:Q,onSave:re,onExport:se,showButtons:d,onClear:y,hasUnsavedChanges:C.hasUnsavedChanges,onImageUpload:()=>D.current?.click(),pendingImagesCount:C.pendingImages.length}),s.jsx("input",{ref:D,type:"file",className:"hidden",accept:O.join(","),multiple:!0,onChange:N,disabled:a}),(x||j)&&s.jsx("div",{className:Ee("px-4 py-3 text-sm flex items-center gap-2 transition-all duration-300",j?"bg-blue-50 text-blue-700 border-b border-blue-100":te.includes("success")?"bg-green-50 text-green-700 border-b border-green-100":"bg-red-50 text-red-700 border-b border-red-100"),children:j?s.jsxs(s.Fragment,{children:[s.jsx(L.Loader2,{className:"h-4 w-4 animate-spin"}),s.jsxs("span",{children:["Uploading images... ",E>0&&`${E}%`]})]}):te.includes("success")?s.jsxs(s.Fragment,{children:[s.jsx(L.CheckCircle,{className:"h-4 w-4"}),s.jsx("span",{children:te})]}):s.jsxs(s.Fragment,{children:[s.jsx(L.AlertCircle,{className:"h-4 w-4"}),s.jsx("span",{children:te})]})}),s.jsx("div",{ref:I,className:Ee("flex-1 p-4 md:p-6 outline-none overflow-y-auto min-h-[200px] bg-white",a?"cursor-default select-text":"cursor-text",!C.content&&"relative"),contentEditable:!a,suppressContentEditableWarning:!0,onInput:h=>U(h.currentTarget.innerHTML),onPaste:S,onDrop:v,onDragOver:h=>h.preventDefault(),onClick:de,onKeyDown:oe,"data-placeholder":M,role:"textbox","aria-label":"Text editor","aria-multiline":"true",children:!C.content&&s.jsx("div",{className:"absolute top-6 left-6 text-gray-400 pointer-events-none select-none",children:M})}),C.pendingImages.length>0&&s.jsxs("div",{className:"px-4 py-3 text-sm text-blue-600 bg-blue-50 border-t border-blue-100 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(L.Upload,{size:16}),s.jsxs("span",{children:[C.pendingImages.length," image",C.pendingImages.length!==1?"s":""," pending upload"]})]}),s.jsx("button",{onClick:z,disabled:j,className:"text-sm px-3 py-1 bg-blue-100 hover:bg-blue-200 text-blue-700 rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:j?"Uploading...":"Upload Now"})]}),i&&s.jsx(Lt,{wordCount:C.wordCount,characterCount:C.characterCount,hasUnsavedChanges:C.hasUnsavedChanges,pendingImagesCount:C.pendingImages.length}),!a&&s.jsx("div",{className:"hidden md:block absolute bottom-2 right-2 text-xs text-gray-400 bg-white/80 px-2 py-1 rounded",children:"Ctrl+S to save • Ctrl+E to export"})]})});Et.displayName="TextEditor",le.TextEditor=Et,Object.defineProperty(le,Symbol.toStringTag,{value:"Module"})}));
61
+ </html>`,u},[Y]),v=x.useCallback(()=>{l({content:"",title:"Untitled Document",wordCount:0,characterCount:0,hasUnsavedChanges:!1,pendingImages:[]}),m.current.clear(),a.current&&(a.current.innerHTML="",O()),f.current=""},[O]),U=x.useCallback(d=>{a.current&&(a.current.innerHTML=d||"",R(d||""),f.current=d||"")},[R]);return{editorState:c,editorRef:a,updateContent:R,updateTitle:G,executeCommand:M,getValidationResult:Y,exportToHTML:q,clearEditor:v,setHTML:U,handlePaste:I,handleDrop:X,insertImage:H,uploadPendingImages:C}},Pt=(e,t)=>{const r=new Array(e.length+t.length);for(let o=0;o<e.length;o++)r[o]=e[o];for(let o=0;o<t.length;o++)r[e.length+o]=t[o];return r},Ut=(e,t)=>({classGroupId:e,validator:t}),Ke=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),ke="-",Xe=[],Ft="arbitrary..",Dt=e=>{const t=Gt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Bt(l);const a=l.split(ke),m=a[0]===""&&a.length>1?1:0;return qe(a,m,t)},getConflictingClassGroupIds:(l,a)=>{if(a){const m=o[l],f=r[l];return m?f?Pt(f,m):m:f||Xe}return r[l]||Xe}}},qe=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const i=e[t],c=r.nextPart.get(i);if(c){const f=qe(e,t+1,c);if(f)return f}const l=r.validators;if(l===null)return;const a=t===0?e.join(ke):e.slice(t).join(ke),m=l.length;for(let f=0;f<m;f++){const E=l[f];if(E.validator(a))return E.classGroupId}},Bt=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),o=t.slice(0,r);return o?Ft+o:void 0})(),Gt=e=>{const{theme:t,classGroups:r}=e;return Wt(r,t)},Wt=(e,t)=>{const r=Ke();for(const o in e){const i=e[o];Te(i,r,o,t)}return r},Te=(e,t,r,o)=>{const i=e.length;for(let c=0;c<i;c++){const l=e[c];Ht(l,t,r,o)}},Ht=(e,t,r,o)=>{if(typeof e=="string"){Vt(e,t,r);return}if(typeof e=="function"){Yt(e,t,r,o);return}Jt(e,t,r,o)},Vt=(e,t,r)=>{const o=e===""?t:Qe(t,e);o.classGroupId=r},Yt=(e,t,r,o)=>{if(Kt(e)){Te(e(o),t,r,o);return}t.validators===null&&(t.validators=[]),t.validators.push(Ut(r,e))},Jt=(e,t,r,o)=>{const i=Object.entries(e),c=i.length;for(let l=0;l<c;l++){const[a,m]=i[l];Te(m,Qe(t,a),r,o)}},Qe=(e,t)=>{let r=e;const o=t.split(ke),i=o.length;for(let c=0;c<i;c++){const l=o[c];let a=r.nextPart.get(l);a||(a=Ke(),r.nextPart.set(l,a)),r=a}return r},Kt=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Xt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),o=Object.create(null);const i=(c,l)=>{r[c]=l,t++,t>e&&(t=0,o=r,r=Object.create(null))};return{get(c){let l=r[c];if(l!==void 0)return l;if((l=o[c])!==void 0)return i(c,l),l},set(c,l){c in r?r[c]=l:i(c,l)}}},Se="!",Ze=":",qt=[],$e=(e,t,r,o,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:o,isExternal:i}),Qt=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=i=>{const c=[];let l=0,a=0,m=0,f;const E=i.length;for(let G=0;G<E;G++){const M=i[G];if(l===0&&a===0){if(M===Ze){c.push(i.slice(m,G)),m=G+1;continue}if(M==="/"){f=G;continue}}M==="["?l++:M==="]"?l--:M==="("?a++:M===")"&&a--}const O=c.length===0?i:i.slice(m);let F=O,D=!1;O.endsWith(Se)?(F=O.slice(0,-1),D=!0):O.startsWith(Se)&&(F=O.slice(1),D=!0);const R=f&&f>m?f-m:void 0;return $e(c,D,F,R)};if(t){const i=t+Ze,c=o;o=l=>l.startsWith(i)?c(l.slice(i.length)):$e(qt,!1,l,void 0,!0)}if(r){const i=o;o=c=>r({className:c,parseClassName:i})}return o},Zt=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,o)=>{t.set(r,1e6+o)}),r=>{const o=[];let i=[];for(let c=0;c<r.length;c++){const l=r[c],a=l[0]==="[",m=t.has(l);a||m?(i.length>0&&(i.sort(),o.push(...i),i=[]),o.push(l)):i.push(l)}return i.length>0&&(i.sort(),o.push(...i)),o}},$t=e=>({cache:Xt(e.cacheSize),parseClassName:Qt(e),sortModifiers:Zt(e),...Dt(e)}),er=/\s+/,tr=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:i,sortModifiers:c}=t,l=[],a=e.trim().split(er);let m="";for(let f=a.length-1;f>=0;f-=1){const E=a[f],{isExternal:O,modifiers:F,hasImportantModifier:D,baseClassName:R,maybePostfixModifierPosition:G}=r(E);if(O){m=E+(m.length>0?" "+m:m);continue}let M=!!G,J=o(M?R.substring(0,G):R);if(!J){if(!M){m=E+(m.length>0?" "+m:m);continue}if(J=o(R),!J){m=E+(m.length>0?" "+m:m);continue}M=!1}const H=F.length===0?"":F.length===1?F[0]:c(F).join(":"),C=D?H+Se:H,I=C+J;if(l.indexOf(I)>-1)continue;l.push(I);const X=i(J,M);for(let Y=0;Y<X.length;++Y){const q=X[Y];l.push(C+q)}m=E+(m.length>0?" "+m:m)}return m},rr=(...e)=>{let t=0,r,o,i="";for(;t<e.length;)(r=e[t++])&&(o=et(r))&&(i&&(i+=" "),i+=o);return i},et=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=et(e[o]))&&(r&&(r+=" "),r+=t);return r},or=(e,...t)=>{let r,o,i,c;const l=m=>{const f=t.reduce((E,O)=>O(E),e());return r=$t(f),o=r.cache.get,i=r.cache.set,c=a,a(m)},a=m=>{const f=o(m);if(f)return f;const E=tr(m,r);return i(m,E),E};return c=l,(...m)=>c(rr(...m))},nr=[],K=e=>{const t=r=>r[e]||nr;return t.isThemeGetter=!0,t},tt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,rt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ar=/^\d+\/\d+$/,ir=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,lr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ge=e=>ar.test(e),_=e=>!!e&&!Number.isNaN(Number(e)),de=e=>!!e&&Number.isInteger(Number(e)),Re=e=>e.endsWith("%")&&_(e.slice(0,-1)),se=e=>ir.test(e),ur=()=>!0,mr=e=>sr.test(e)&&!lr.test(e),ot=()=>!1,fr=e=>cr.test(e),gr=e=>dr.test(e),pr=e=>!h(e)&&!b(e),hr=e=>pe(e,lt,ot),h=e=>tt.test(e),me=e=>pe(e,ct,mr),Ee=e=>pe(e,yr,_),nt=e=>pe(e,it,ot),br=e=>pe(e,st,gr),Ce=e=>pe(e,dt,fr),b=e=>rt.test(e),ve=e=>he(e,ct),xr=e=>he(e,kr),at=e=>he(e,it),vr=e=>he(e,lt),wr=e=>he(e,st),je=e=>he(e,dt,!0),pe=(e,t,r)=>{const o=tt.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},he=(e,t,r=!1)=>{const o=rt.exec(e);return o?o[1]?t(o[1]):r:!1},it=e=>e==="position"||e==="percentage",st=e=>e==="image"||e==="url",lt=e=>e==="length"||e==="size"||e==="bg-size",ct=e=>e==="length",yr=e=>e==="number",kr=e=>e==="family-name",dt=e=>e==="shadow",Cr=or(()=>{const e=K("color"),t=K("font"),r=K("text"),o=K("font-weight"),i=K("tracking"),c=K("leading"),l=K("breakpoint"),a=K("container"),m=K("spacing"),f=K("radius"),E=K("shadow"),O=K("inset-shadow"),F=K("text-shadow"),D=K("drop-shadow"),R=K("blur"),G=K("perspective"),M=K("aspect"),J=K("ease"),H=K("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],X=()=>[...I(),b,h],Y=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto","contain","none"],v=()=>[b,h,m],U=()=>[ge,"full","auto",...v()],d=()=>[de,"none","subgrid",b,h],w=()=>["auto",{span:["full",de,b,h]},de,b,h],j=()=>[de,"auto",b,h],u=()=>["auto","min","max","fr",b,h],T=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...v()],W=()=>[ge,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...v()],p=()=>[e,b,h],Z=()=>[...I(),at,nt,{position:[b,h]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],n=()=>["auto","cover","contain",vr,hr,{size:[b,h]}],y=()=>[Re,ve,me],k=()=>["","none","full",f,b,h],S=()=>["",_,ve,me],ee=()=>["solid","dashed","dotted","double"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>[_,Re,at,nt],$=()=>["","none",R,b,h],te=()=>["none",_,b,h],oe=()=>["none",_,b,h],le=()=>[_,b,h],P=()=>[ge,"full",...v()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[se],breakpoint:[se],color:[ur],container:[se],"drop-shadow":[se],ease:["in","out","in-out"],font:[pr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[se],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[se],shadow:[se],spacing:["px",_],text:[se],"text-shadow":[se],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ge,h,b,M]}],container:["container"],columns:[{columns:[_,h,b,a]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:X()}],overflow:[{overflow:Y()}],"overflow-x":[{"overflow-x":Y()}],"overflow-y":[{"overflow-y":Y()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{start:U()}],end:[{end:U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[de,"auto",b,h]}],basis:[{basis:[ge,"full","auto",a,...v()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_,ge,"auto","initial","none",h]}],grow:[{grow:["",_,b,h]}],shrink:[{shrink:["",_,b,h]}],order:[{order:[de,"first","last","none",b,h]}],"grid-cols":[{"grid-cols":d()}],"col-start-end":[{col:w()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":d()}],"row-start-end":[{row:w()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":u()}],"auto-rows":[{"auto-rows":u()}],gap:[{gap:v()}],"gap-x":[{"gap-x":v()}],"gap-y":[{"gap-y":v()}],"justify-content":[{justify:[...T(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...T()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":T()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:v()}],px:[{px:v()}],py:[{py:v()}],ps:[{ps:v()}],pe:[{pe:v()}],pt:[{pt:v()}],pr:[{pr:v()}],pb:[{pb:v()}],pl:[{pl:v()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":v()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":v()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],w:[{w:[a,"screen",...W()]}],"min-w":[{"min-w":[a,"screen","none",...W()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[l]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",r,ve,me]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,b,Ee]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Re,h]}],"font-family":[{font:[xr,h,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,b,h]}],"line-clamp":[{"line-clamp":[_,"none",b,Ee]}],leading:[{leading:[c,...v()]}],"list-image":[{"list-image":["none",b,h]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",b,h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:p()}],"text-color":[{text:p()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:[_,"from-font","auto",b,me]}],"text-decoration-color":[{decoration:p()}],"underline-offset":[{"underline-offset":[_,"auto",b,h]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:v()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",b,h]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",b,h]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:n()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},de,b,h],radial:["",b,h],conic:[de,b,h]},wr,br]}],"bg-color":[{bg:p()}],"gradient-from-pos":[{from:y()}],"gradient-via-pos":[{via:y()}],"gradient-to-pos":[{to:y()}],"gradient-from":[{from:p()}],"gradient-via":[{via:p()}],"gradient-to":[{to:p()}],rounded:[{rounded:k()}],"rounded-s":[{"rounded-s":k()}],"rounded-e":[{"rounded-e":k()}],"rounded-t":[{"rounded-t":k()}],"rounded-r":[{"rounded-r":k()}],"rounded-b":[{"rounded-b":k()}],"rounded-l":[{"rounded-l":k()}],"rounded-ss":[{"rounded-ss":k()}],"rounded-se":[{"rounded-se":k()}],"rounded-ee":[{"rounded-ee":k()}],"rounded-es":[{"rounded-es":k()}],"rounded-tl":[{"rounded-tl":k()}],"rounded-tr":[{"rounded-tr":k()}],"rounded-br":[{"rounded-br":k()}],"rounded-bl":[{"rounded-bl":k()}],"border-w":[{border:S()}],"border-w-x":[{"border-x":S()}],"border-w-y":[{"border-y":S()}],"border-w-s":[{"border-s":S()}],"border-w-e":[{"border-e":S()}],"border-w-t":[{"border-t":S()}],"border-w-r":[{"border-r":S()}],"border-w-b":[{"border-b":S()}],"border-w-l":[{"border-l":S()}],"divide-x":[{"divide-x":S()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":S()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ee(),"hidden","none"]}],"divide-style":[{divide:[...ee(),"hidden","none"]}],"border-color":[{border:p()}],"border-color-x":[{"border-x":p()}],"border-color-y":[{"border-y":p()}],"border-color-s":[{"border-s":p()}],"border-color-e":[{"border-e":p()}],"border-color-t":[{"border-t":p()}],"border-color-r":[{"border-r":p()}],"border-color-b":[{"border-b":p()}],"border-color-l":[{"border-l":p()}],"divide-color":[{divide:p()}],"outline-style":[{outline:[...ee(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_,b,h]}],"outline-w":[{outline:["",_,ve,me]}],"outline-color":[{outline:p()}],shadow:[{shadow:["","none",E,je,Ce]}],"shadow-color":[{shadow:p()}],"inset-shadow":[{"inset-shadow":["none",O,je,Ce]}],"inset-shadow-color":[{"inset-shadow":p()}],"ring-w":[{ring:S()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:p()}],"ring-offset-w":[{"ring-offset":[_,me]}],"ring-offset-color":[{"ring-offset":p()}],"inset-ring-w":[{"inset-ring":S()}],"inset-ring-color":[{"inset-ring":p()}],"text-shadow":[{"text-shadow":["none",F,je,Ce]}],"text-shadow-color":[{"text-shadow":p()}],opacity:[{opacity:[_,b,h]}],"mix-blend":[{"mix-blend":[...re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":re()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_]}],"mask-image-linear-from-pos":[{"mask-linear-from":A()}],"mask-image-linear-to-pos":[{"mask-linear-to":A()}],"mask-image-linear-from-color":[{"mask-linear-from":p()}],"mask-image-linear-to-color":[{"mask-linear-to":p()}],"mask-image-t-from-pos":[{"mask-t-from":A()}],"mask-image-t-to-pos":[{"mask-t-to":A()}],"mask-image-t-from-color":[{"mask-t-from":p()}],"mask-image-t-to-color":[{"mask-t-to":p()}],"mask-image-r-from-pos":[{"mask-r-from":A()}],"mask-image-r-to-pos":[{"mask-r-to":A()}],"mask-image-r-from-color":[{"mask-r-from":p()}],"mask-image-r-to-color":[{"mask-r-to":p()}],"mask-image-b-from-pos":[{"mask-b-from":A()}],"mask-image-b-to-pos":[{"mask-b-to":A()}],"mask-image-b-from-color":[{"mask-b-from":p()}],"mask-image-b-to-color":[{"mask-b-to":p()}],"mask-image-l-from-pos":[{"mask-l-from":A()}],"mask-image-l-to-pos":[{"mask-l-to":A()}],"mask-image-l-from-color":[{"mask-l-from":p()}],"mask-image-l-to-color":[{"mask-l-to":p()}],"mask-image-x-from-pos":[{"mask-x-from":A()}],"mask-image-x-to-pos":[{"mask-x-to":A()}],"mask-image-x-from-color":[{"mask-x-from":p()}],"mask-image-x-to-color":[{"mask-x-to":p()}],"mask-image-y-from-pos":[{"mask-y-from":A()}],"mask-image-y-to-pos":[{"mask-y-to":A()}],"mask-image-y-from-color":[{"mask-y-from":p()}],"mask-image-y-to-color":[{"mask-y-to":p()}],"mask-image-radial":[{"mask-radial":[b,h]}],"mask-image-radial-from-pos":[{"mask-radial-from":A()}],"mask-image-radial-to-pos":[{"mask-radial-to":A()}],"mask-image-radial-from-color":[{"mask-radial-from":p()}],"mask-image-radial-to-color":[{"mask-radial-to":p()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[_]}],"mask-image-conic-from-pos":[{"mask-conic-from":A()}],"mask-image-conic-to-pos":[{"mask-conic-to":A()}],"mask-image-conic-from-color":[{"mask-conic-from":p()}],"mask-image-conic-to-color":[{"mask-conic-to":p()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:n()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",b,h]}],filter:[{filter:["","none",b,h]}],blur:[{blur:$()}],brightness:[{brightness:[_,b,h]}],contrast:[{contrast:[_,b,h]}],"drop-shadow":[{"drop-shadow":["","none",D,je,Ce]}],"drop-shadow-color":[{"drop-shadow":p()}],grayscale:[{grayscale:["",_,b,h]}],"hue-rotate":[{"hue-rotate":[_,b,h]}],invert:[{invert:["",_,b,h]}],saturate:[{saturate:[_,b,h]}],sepia:[{sepia:["",_,b,h]}],"backdrop-filter":[{"backdrop-filter":["","none",b,h]}],"backdrop-blur":[{"backdrop-blur":$()}],"backdrop-brightness":[{"backdrop-brightness":[_,b,h]}],"backdrop-contrast":[{"backdrop-contrast":[_,b,h]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_,b,h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_,b,h]}],"backdrop-invert":[{"backdrop-invert":["",_,b,h]}],"backdrop-opacity":[{"backdrop-opacity":[_,b,h]}],"backdrop-saturate":[{"backdrop-saturate":[_,b,h]}],"backdrop-sepia":[{"backdrop-sepia":["",_,b,h]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":v()}],"border-spacing-x":[{"border-spacing-x":v()}],"border-spacing-y":[{"border-spacing-y":v()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",b,h]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_,"initial",b,h]}],ease:[{ease:["linear","initial",J,b,h]}],delay:[{delay:[_,b,h]}],animate:[{animate:["none",H,b,h]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[G,b,h]}],"perspective-origin":[{"perspective-origin":X()}],rotate:[{rotate:te()}],"rotate-x":[{"rotate-x":te()}],"rotate-y":[{"rotate-y":te()}],"rotate-z":[{"rotate-z":te()}],scale:[{scale:oe()}],"scale-x":[{"scale-x":oe()}],"scale-y":[{"scale-y":oe()}],"scale-z":[{"scale-z":oe()}],"scale-3d":["scale-3d"],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[b,h,"","none","gpu","cpu"]}],"transform-origin":[{origin:X()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:P()}],"translate-x":[{"translate-x":P()}],"translate-y":[{"translate-y":P()}],"translate-z":[{"translate-z":P()}],"translate-none":["translate-none"],accent:[{accent:p()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:p()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",b,h]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":v()}],"scroll-mx":[{"scroll-mx":v()}],"scroll-my":[{"scroll-my":v()}],"scroll-ms":[{"scroll-ms":v()}],"scroll-me":[{"scroll-me":v()}],"scroll-mt":[{"scroll-mt":v()}],"scroll-mr":[{"scroll-mr":v()}],"scroll-mb":[{"scroll-mb":v()}],"scroll-ml":[{"scroll-ml":v()}],"scroll-p":[{"scroll-p":v()}],"scroll-px":[{"scroll-px":v()}],"scroll-py":[{"scroll-py":v()}],"scroll-ps":[{"scroll-ps":v()}],"scroll-pe":[{"scroll-pe":v()}],"scroll-pt":[{"scroll-pt":v()}],"scroll-pr":[{"scroll-pr":v()}],"scroll-pb":[{"scroll-pb":v()}],"scroll-pl":[{"scroll-pl":v()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",b,h]}],fill:[{fill:["none",...p()]}],"stroke-w":[{stroke:[_,ve,me,Ee]}],stroke:[{stroke:["none",...p()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ut(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=ut(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function jr(){for(var e,t,r=0,o="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=ut(e))&&(o&&(o+=" "),o+=t);return o}function ze(...e){return Cr(jr(e))}var Ae,mt;function ft(){if(mt)return Ae;mt=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Ae=e,Ae}var _e,gt;function Tr(){if(gt)return _e;gt=1;var e=typeof we=="object"&&we&&we.Object===Object&&we;return _e=e,_e}var Ie,pt;function ht(){if(pt)return Ie;pt=1;var e=Tr(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Ie=r,Ie}var Ne,bt;function Sr(){if(bt)return Ne;bt=1;var e=ht(),t=function(){return e.Date.now()};return Ne=t,Ne}var Le,xt;function Rr(){if(xt)return Le;xt=1;var e=/\s/;function t(r){for(var o=r.length;o--&&e.test(r.charAt(o)););return o}return Le=t,Le}var Oe,vt;function Er(){if(vt)return Oe;vt=1;var e=Rr(),t=/^\s+/;function r(o){return o&&o.slice(0,e(o)+1).replace(t,"")}return Oe=r,Oe}var Me,wt;function yt(){if(wt)return Me;wt=1;var e=ht(),t=e.Symbol;return Me=t,Me}var Pe,kt;function zr(){if(kt)return Pe;kt=1;var e=yt(),t=Object.prototype,r=t.hasOwnProperty,o=t.toString,i=e?e.toStringTag:void 0;function c(l){var a=r.call(l,i),m=l[i];try{l[i]=void 0;var f=!0}catch{}var E=o.call(l);return f&&(a?l[i]=m:delete l[i]),E}return Pe=c,Pe}var Ue,Ct;function Ar(){if(Ct)return Ue;Ct=1;var e=Object.prototype,t=e.toString;function r(o){return t.call(o)}return Ue=r,Ue}var Fe,jt;function _r(){if(jt)return Fe;jt=1;var e=yt(),t=zr(),r=Ar(),o="[object Null]",i="[object Undefined]",c=e?e.toStringTag:void 0;function l(a){return a==null?a===void 0?i:o:c&&c in Object(a)?t(a):r(a)}return Fe=l,Fe}var De,Tt;function Ir(){if(Tt)return De;Tt=1;function e(t){return t!=null&&typeof t=="object"}return De=e,De}var Be,St;function Nr(){if(St)return Be;St=1;var e=_r(),t=Ir(),r="[object Symbol]";function o(i){return typeof i=="symbol"||t(i)&&e(i)==r}return Be=o,Be}var Ge,Rt;function Lr(){if(Rt)return Ge;Rt=1;var e=Er(),t=ft(),r=Nr(),o=NaN,i=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^0o[0-7]+$/i,a=parseInt;function m(f){if(typeof f=="number")return f;if(r(f))return o;if(t(f)){var E=typeof f.valueOf=="function"?f.valueOf():f;f=t(E)?E+"":E}if(typeof f!="string")return f===0?f:+f;f=e(f);var O=c.test(f);return O||l.test(f)?a(f.slice(2),O?2:8):i.test(f)?o:+f}return Ge=m,Ge}var We,Et;function Or(){if(Et)return We;Et=1;var e=ft(),t=Sr(),r=Lr(),o="Expected a function",i=Math.max,c=Math.min;function l(a,m,f){var E,O,F,D,R,G,M=0,J=!1,H=!1,C=!0;if(typeof a!="function")throw new TypeError(o);m=r(m)||0,e(f)&&(J=!!f.leading,H="maxWait"in f,F=H?i(r(f.maxWait)||0,m):F,C="trailing"in f?!!f.trailing:C);function I(u){var T=E,z=O;return E=O=void 0,M=u,D=a.apply(z,T),D}function X(u){return M=u,R=setTimeout(v,m),J?I(u):D}function Y(u){var T=u-G,z=u-M,B=m-T;return H?c(B,F-z):B}function q(u){var T=u-G,z=u-M;return G===void 0||T>=m||T<0||H&&z>=F}function v(){var u=t();if(q(u))return U(u);R=setTimeout(v,Y(u))}function U(u){return R=void 0,C&&E?I(u):(E=O=void 0,D)}function d(){R!==void 0&&clearTimeout(R),M=0,E=G=O=R=void 0}function w(){return R===void 0?D:U(t())}function j(){var u=t(),T=q(u);if(E=arguments,O=this,G=u,T){if(R===void 0)return X(G);if(H)return clearTimeout(R),R=setTimeout(v,m),I(G)}return R===void 0&&(R=setTimeout(v,m)),D}return j.cancel=d,j.flush=w,j}return We=l,We}var Mr=Or();const Pr=At(Mr),zt=x.forwardRef(({initialContent:e="",onChange:t,onSave:r,onExport:o,readOnly:i=!1,showButtons:c=!1,showSaveTitle:l=!1,showStatusBar:a=!1,height:m="500px",onImageUpload:f,imageUploadEndpoint:E,allowedImageTypes:O=["image/jpeg","image/png","image/gif","image/webp","image/svg+xml"],maxImageSize:F=5*1024*1024,onInit:D,debounceDelay:R=300,className:G="",placeholder:M="Start typing here...",autoFocus:J=!1},H)=>{const{editorState:C,editorRef:I,updateContent:X,updateTitle:Y,executeCommand:q,getValidationResult:v,exportToHTML:U,clearEditor:d,setHTML:w,handlePaste:j,handleDrop:u,insertImage:T,uploadPendingImages:z}=Mt({initialContent:e,onImageUpload:f,imageUploadEndpoint:E,allowedImageTypes:O,maxImageSize:F}),B=x.useRef(null),W=x.useRef(!1),p=x.useRef(null),[Z,V]=x.useState(!1),[n,y]=x.useState(""),[k,S]=x.useState(!1),[ee,re]=x.useState(0),A=x.useRef(null),$=x.useRef(t),te=x.useRef(C.content),oe=x.useRef(C.title);x.useEffect(()=>{$.current=t},[t]),x.useImperativeHandle(H,()=>({getContent:()=>C.content,getHTML:()=>U(),getTitle:()=>C.title,clear:d,focus:()=>{if(I.current){I.current.focus();const g=document.createRange();g.selectNodeContents(I.current),g.collapse(!1);const Q=window.getSelection();Q?.removeAllRanges(),Q?.addRange(g)}},insertText:g=>{I.current&&(document.execCommand("insertText",!1,g),X(I.current.innerHTML))},insertHTML:g=>{I.current&&(document.execCommand("insertHTML",!1,g),X(I.current.innerHTML))},setHTML:g=>{w(g)},executeCommand:(g,Q)=>{q(g,Q)}})),x.useEffect(()=>{D&&I.current&&!W.current&&(D(I.current),W.current=!0)},[D,I]),x.useEffect(()=>{J&&I.current&&!i&&setTimeout(()=>{if(I.current){I.current.focus();const g=document.createRange();g.selectNodeContents(I.current),g.collapse(!1);const Q=window.getSelection();Q?.removeAllRanges(),Q?.addRange(g)}},100)},[J,i,I]),x.useEffect(()=>(p.current=Pr((g,Q,ae)=>{$.current?.(g,Q,ae)},R),()=>{p.current&&p.current.cancel()}),[R]),x.useEffect(()=>{if(!$.current||C.content===te.current&&C.title===oe.current)return;const g=(()=>{try{return U({includeStyles:!1,includeMeta:!1})}catch{return`<!DOCTYPE html><html><body>${C.content}</body></html>`}})();te.current=C.content,oe.current=C.title,R>0&&p.current?p.current(C.content,g,C.title):$.current(C.content,g,C.title)},[C.content,C.title,U,R]);const le=x.useCallback(async()=>{if(p.current&&p.current.flush?.(),C.pendingImages.length>0){S(!0);try{await z(),y("Images uploaded successfully!"),setTimeout(()=>y(""),3e3)}catch{y("Failed to upload images. Please try again."),V(!0),setTimeout(()=>{V(!1),y("")},5e3),S(!1);return}finally{S(!1)}}const g=v();if(!g.success){y(g.error||"Please fix validation errors before saving."),V(!0),setTimeout(()=>{V(!1),y("")},3e3);return}try{r?.(C.content,U()),y("Document saved successfully!"),V(!0),setTimeout(()=>{V(!1),y("")},2e3)}catch{y("Failed to save document."),V(!0),setTimeout(()=>{V(!1),y("")},3e3)}},[C,z,v,U,r]),P=x.useCallback(async()=>{if(p.current&&p.current.flush?.(),C.pendingImages.length>0){S(!0);try{await z()}catch(g){console.error("Failed to upload images:",g)}finally{S(!1)}}try{const g=U();o?.(g);const Q=new Blob([g],{type:"text/html"}),ae=URL.createObjectURL(Q),fe=document.createElement("a");fe.href=ae,fe.download=`${C.title.replace(/[^\w\s]/gi,"").replace(/\s+/g,"_")||"document"}.html`,document.body.appendChild(fe),fe.click(),document.body.removeChild(fe),URL.revokeObjectURL(ae),y("Document exported successfully!"),V(!0),setTimeout(()=>{V(!1),y("")},2e3)}catch{y("Failed to export document."),V(!0),setTimeout(()=>{V(!1),y("")},3e3)}},[C,z,U,o]),N=x.useCallback(g=>{X(g)},[X]),ue=async g=>{if(!g.target.files||i)return;const Q=Array.from(g.target.files);let ae=0;const fe=Q.length;for(const Ur of Q)try{await T(Ur),ae++,re(Math.round(ae/fe*100))}catch(Fr){console.error("Failed to insert image:",Fr)}re(0),g.target.value=""},ne=x.useCallback(()=>{i||I.current&&I.current.focus()},[i,I]),ie=x.useCallback(g=>{(g.ctrlKey||g.metaKey)&&g.key==="s"&&(g.preventDefault(),le()),(g.ctrlKey||g.metaKey)&&g.key==="e"&&(g.preventDefault(),P()),(g.ctrlKey||g.metaKey)&&g.key==="k"&&g.shiftKey&&(g.preventDefault(),d())},[le,P,d]);return s.jsxs("div",{ref:A,className:ze("relative w-full bg-white border border-gray-300 rounded-lg overflow-hidden flex flex-col",i&&"pointer-events-none opacity-80",G),style:{height:m},children:[l&&s.jsxs("div",{className:"p-4 md:p-6 border-b bg-gradient-to-r from-gray-50 to-white",children:[s.jsx("input",{className:"w-full text-xl md:text-2xl font-bold bg-transparent outline-none placeholder:text-gray-400",value:C.title,onChange:g=>Y(g.target.value),placeholder:"Document Title",readOnly:i,maxLength:100}),C.title.length>=90&&s.jsxs("div",{className:"text-xs text-gray-500 text-right mt-1",children:[C.title.length,"/100 characters"]})]}),s.jsx(Lt,{onCommand:q,onSave:le,onExport:P,showButtons:c,onClear:d,hasUnsavedChanges:C.hasUnsavedChanges,onImageUpload:()=>B.current?.click(),pendingImagesCount:C.pendingImages.length}),s.jsx("input",{ref:B,type:"file",className:"hidden",accept:O.join(","),multiple:!0,onChange:ue,disabled:i}),(Z||k)&&s.jsx("div",{className:ze("px-4 py-3 text-sm flex items-center gap-2 transition-all duration-300",k?"bg-blue-50 text-blue-700 border-b border-blue-100":n.includes("success")?"bg-green-50 text-green-700 border-b border-green-100":"bg-red-50 text-red-700 border-b border-red-100"),children:k?s.jsxs(s.Fragment,{children:[s.jsx(L.Loader2,{className:"h-4 w-4 animate-spin"}),s.jsxs("span",{children:["Uploading images... ",ee>0&&`${ee}%`]})]}):n.includes("success")?s.jsxs(s.Fragment,{children:[s.jsx(L.CheckCircle,{className:"h-4 w-4"}),s.jsx("span",{children:n})]}):s.jsxs(s.Fragment,{children:[s.jsx(L.AlertCircle,{className:"h-4 w-4"}),s.jsx("span",{children:n})]})}),s.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[!C.content&&s.jsx("div",{className:"absolute top-6 left-6 text-gray-400 pointer-events-none select-none z-0",children:M}),s.jsx("div",{ref:I,className:ze("flex-1 p-4 md:p-6 outline-none overflow-y-auto min-h-[200px] bg-transparent z-10",i?"cursor-default select-text":"cursor-text"),contentEditable:!i,suppressContentEditableWarning:!0,onInput:g=>N(g.currentTarget.innerHTML),onPaste:j,onDrop:u,onDragOver:g=>g.preventDefault(),onClick:ne,onKeyDown:ie,"data-placeholder":M,role:"textbox","aria-label":"Text editor","aria-multiline":"true"})]}),C.pendingImages.length>0&&s.jsxs("div",{className:"px-4 py-3 text-sm text-blue-600 bg-blue-50 border-t border-blue-100 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(L.Upload,{size:16}),s.jsxs("span",{children:[C.pendingImages.length," image",C.pendingImages.length!==1?"s":""," pending upload"]})]}),s.jsx("button",{onClick:z,disabled:k,className:"text-sm px-3 py-1 bg-blue-100 hover:bg-blue-200 text-blue-700 rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:k?"Uploading...":"Upload Now"})]}),a&&s.jsx(Ot,{wordCount:C.wordCount,characterCount:C.characterCount,hasUnsavedChanges:C.hasUnsavedChanges,pendingImagesCount:C.pendingImages.length}),!i&&s.jsx("div",{className:"hidden md:block absolute bottom-2 right-2 text-xs text-gray-400 bg-white/80 px-2 py-1 rounded",children:"Ctrl+S to save • Ctrl+E to export"})]})});zt.displayName="TextEditor",ce.TextEditor=zt,Object.defineProperty(ce,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abduljebar/text-editor",
3
- "version": "2.5.2",
3
+ "version": "2.6.2",
4
4
  "description": "A professional React text editor with export, save, and validation features",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",