@abduljebar/text-editor 1.2.0 → 1.2.1
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.
- package/dist/components/TextEditor.d.ts.map +1 -1
- package/dist/components/Toolbar.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +94 -77
- package/dist/index.umd.cjs +29 -12
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../src/components/TextEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAIhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA+
|
|
1
|
+
{"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../src/components/TextEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAIhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA+JhD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../src/components/Toolbar.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAoBnD,UAAU,YAAY;IACpB,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../src/components/Toolbar.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAoBnD,UAAU,YAAY;IACpB,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAwP1C,CAAC"}
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */@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-leading:initial;--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-space-y-reverse:0}}}@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-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-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--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-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--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-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;--container-6xl:72rem;--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);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-bold:700;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--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{.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-2{margin-inline:calc(var(--spacing)*2)}.mx-auto{margin-inline:auto}.mt-2{margin-top:calc(var(--spacing)*2)}.block{display:block}.flex{display:flex}.inline{display:inline}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.min-h-\[500px\]{min-height:500px}.w-9{width:calc(var(--spacing)*9)}.w-full{width:100%}.w-px{width:1px}.max-w-6xl{max-width:var(--container-6xl)}.max-w-none{max-width:none}.resize-none{resize:none}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.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-6{gap:calc(var(--spacing)*6)}.overflow-hidden{overflow:hidden}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-none{--tw-border-style:none;border-style:none}.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)}.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-600{background-color:var(--color-green-600)}.bg-red-600{background-color:var(--color-red-600)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing)*3)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.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-blue-600{color:var(--color-blue-600)}.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-orange-600{color:var(--color-orange-600)}.text-red-600{color:var(--color-red-600)}.text-white{color:var(--color-white)}.italic{font-style:italic}.underline{text-decoration-line:underline}.placeholder-gray-400::-moz-placeholder{color:var(--color-gray-400)}.placeholder-gray-400::placeholder{color:var(--color-gray-400)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px 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-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-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.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)}}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-blue-300:disabled{background-color:var(--color-blue-300)}@media (min-width:40rem){.sm\:mt-0{margin-top:calc(var(--spacing)*0)}}.animate-fadeIn{animation:.3s ease-in-out fadeIn}}.editor-content h1{margin-top:calc(var(--spacing)*4);margin-bottom:calc(var(--spacing)*2);font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-gray-800)}.editor-content p{margin-bottom:calc(var(--spacing)*4)}.editor-content a{color:var(--color-blue-600);text-decoration-line:underline}@keyframes fadeIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.editor-content{min-height:500px;padding:calc(var(--spacing)*8)}.editor-content h1{margin-top:calc(var(--spacing)*6);margin-bottom:calc(var(--spacing)*4);border-bottom-style:var(--tw-border-style);padding-bottom:calc(var(--spacing)*2);font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-gray-800);border-bottom-width:1px}.editor-content h2{margin-top:calc(var(--spacing)*5);margin-bottom:calc(var(--spacing)*3);font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-gray-800)}.editor-content h3{margin-top:calc(var(--spacing)*4);margin-bottom:calc(var(--spacing)*2);font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-gray-800)}.editor-content p{margin-bottom:calc(var(--spacing)*4);--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);color:var(--color-gray-700)}.editor-content ul{margin-bottom:calc(var(--spacing)*4);margin-left:calc(var(--spacing)*4);list-style-type:disc;list-style-position:inside}:where(.editor-content ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}.editor-content ol{margin-bottom:calc(var(--spacing)*4);margin-left:calc(var(--spacing)*4);list-style-type:decimal;list-style-position:inside}:where(.editor-content ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}.editor-content li{margin-bottom:calc(var(--spacing)*1)}.editor-content a{color:var(--color-blue-600);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));text-decoration-line:underline}@media (hover:hover){.editor-content a:hover{color:var(--color-blue-800)}}.editor-content blockquote{margin-block:calc(var(--spacing)*4);border-left-style:var(--tw-border-style);border-left-width:4px;border-color:var(--color-blue-500);padding-left:calc(var(--spacing)*4);color:var(--color-gray-600);font-style:italic}.editor-content code{background-color:var(--color-gray-100);padding-inline:calc(var(--spacing)*2);padding-block:calc(var(--spacing)*1);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:.25rem}.editor-content pre{margin-block:calc(var(--spacing)*4);border-radius:var(--radius-lg);background-color:var(--color-gray-800);padding:calc(var(--spacing)*4);color:var(--color-gray-100);overflow-x:auto}.editor-content pre code{padding:calc(var(--spacing)*0);color:inherit;background-color:#0000}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@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-space-y-reverse{syntax:"*";inherits:false;initial-value:0}
|
|
1
|
+
/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */@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-leading:initial;--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-space-y-reverse:0}}}@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-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-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--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-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--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-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;--container-6xl:72rem;--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);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-bold:700;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--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{.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-2{margin-inline:calc(var(--spacing)*2)}.mx-auto{margin-inline:auto}.mt-2{margin-top:calc(var(--spacing)*2)}.block{display:block}.flex{display:flex}.inline{display:inline}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.min-h-\[500px\]{min-height:500px}.w-9{width:calc(var(--spacing)*9)}.w-full{width:100%}.w-px{width:1px}.max-w-6xl{max-width:var(--container-6xl)}.max-w-none{max-width:none}.resize-none{resize:none}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.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-6{gap:calc(var(--spacing)*6)}.overflow-hidden{overflow:hidden}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-none{--tw-border-style:none;border-style:none}.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)}.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-600{background-color:var(--color-green-600)}.bg-red-600{background-color:var(--color-red-600)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing)*3)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.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-blue-600{color:var(--color-blue-600)}.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-orange-600{color:var(--color-orange-600)}.text-red-600{color:var(--color-red-600)}.text-white{color:var(--color-white)}.italic{font-style:italic}.underline{text-decoration-line:underline}.placeholder-gray-400::-moz-placeholder{color:var(--color-gray-400)}.placeholder-gray-400::placeholder{color:var(--color-gray-400)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px 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-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-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.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)}}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-blue-300:disabled{background-color:var(--color-blue-300)}@media (min-width:40rem){.sm\:mt-0{margin-top:calc(var(--spacing)*0)}}.\[\&_a\]\:text-blue-600 a{color:var(--color-blue-600)}.\[\&_a\]\:underline a{text-decoration-line:underline}.\[\&_a\]\:transition-colors a{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))}@media (hover:hover){.\[\&_a\]\:hover\:text-blue-800 a:hover{color:var(--color-blue-800)}}.\[\&_blockquote\]\:my-4 blockquote{margin-block:calc(var(--spacing)*4)}.\[\&_blockquote\]\:border-l-4 blockquote{border-left-style:var(--tw-border-style);border-left-width:4px}.\[\&_blockquote\]\:border-blue-500 blockquote{border-color:var(--color-blue-500)}.\[\&_blockquote\]\:pl-4 blockquote{padding-left:calc(var(--spacing)*4)}.\[\&_blockquote\]\:text-gray-600 blockquote{color:var(--color-gray-600)}.\[\&_blockquote\]\:italic blockquote{font-style:italic}.\[\&_code\]\:rounded code{border-radius:.25rem}.\[\&_code\]\:bg-gray-100 code{background-color:var(--color-gray-100)}.\[\&_code\]\:px-2 code{padding-inline:calc(var(--spacing)*2)}.\[\&_code\]\:py-1 code{padding-block:calc(var(--spacing)*1)}.\[\&_code\]\:font-mono code{font-family:var(--font-mono)}.\[\&_code\]\:text-sm code{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\[\&_h1\]\:mt-6 h1{margin-top:calc(var(--spacing)*6)}.\[\&_h1\]\:mb-4 h1{margin-bottom:calc(var(--spacing)*4)}.\[\&_h1\]\:border-b h1{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_h1\]\:pb-2 h1{padding-bottom:calc(var(--spacing)*2)}.\[\&_h1\]\:text-3xl h1{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.\[\&_h1\]\:font-bold h1{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.\[\&_h1\]\:text-gray-800 h1{color:var(--color-gray-800)}.\[\&_h2\]\:mt-5 h2{margin-top:calc(var(--spacing)*5)}.\[\&_h2\]\:mb-3 h2{margin-bottom:calc(var(--spacing)*3)}.\[\&_h2\]\:text-2xl h2{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.\[\&_h2\]\:font-bold h2{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.\[\&_h2\]\:text-gray-800 h2{color:var(--color-gray-800)}.\[\&_h3\]\:mt-4 h3{margin-top:calc(var(--spacing)*4)}.\[\&_h3\]\:mb-2 h3{margin-bottom:calc(var(--spacing)*2)}.\[\&_h3\]\:text-xl h3{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\[\&_h3\]\:font-bold h3{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.\[\&_h3\]\:text-gray-800 h3{color:var(--color-gray-800)}.\[\&_li\]\:mb-1 li{margin-bottom:calc(var(--spacing)*1)}.\[\&_ol\]\:mb-4 ol{margin-bottom:calc(var(--spacing)*4)}.\[\&_ol\]\:ml-4 ol{margin-left:calc(var(--spacing)*4)}.\[\&_ol\]\:list-inside ol{list-style-position:inside}.\[\&_ol\]\:list-decimal ol{list-style-type:decimal}:where(.\[\&_ol\]\:space-y-1 ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}.\[\&_p\]\:mb-4 p{margin-bottom:calc(var(--spacing)*4)}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_p\]\:text-gray-700 p{color:var(--color-gray-700)}.\[\&_pre\]\:my-4 pre{margin-block:calc(var(--spacing)*4)}.\[\&_pre\]\:overflow-x-auto pre{overflow-x:auto}.\[\&_pre\]\:rounded-lg pre{border-radius:var(--radius-lg)}.\[\&_pre\]\:bg-gray-800 pre{background-color:var(--color-gray-800)}.\[\&_pre\]\:p-4 pre{padding:calc(var(--spacing)*4)}.\[\&_pre\]\:text-gray-100 pre{color:var(--color-gray-100)}.\[\&_pre_code\]\:bg-transparent pre code{background-color:#0000}.\[\&_pre_code\]\:p-0 pre code{padding:calc(var(--spacing)*0)}.\[\&_pre_code\]\:text-inherit pre code{color:inherit}.\[\&_ul\]\:mb-4 ul{margin-bottom:calc(var(--spacing)*4)}.\[\&_ul\]\:ml-4 ul{margin-left:calc(var(--spacing)*4)}.\[\&_ul\]\:list-inside ul{list-style-position:inside}.\[\&_ul\]\:list-disc ul{list-style-type:disc}:where(.\[\&_ul\]\:space-y-1 ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@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-space-y-reverse{syntax:"*";inherits:false;initial-value:0}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Ft, { useState as ae, useEffect as Ee, useRef as Mt, useCallback as P } from "react";
|
|
2
|
-
import { Save as Vt, FileDown as Wt, Trash2 as Bt, Bold as
|
|
2
|
+
import { Save as Vt, FileDown as Wt, Trash2 as Bt, Bold as qt, Italic as Yt, Underline as Jt, Strikethrough as Gt, List as Ht, ListOrdered as Xt, Heading1 as Kt, Heading2 as Qt, Type as en, AlignLeft as tn, AlignCenter as nn, AlignRight as rn, Link as on } from "lucide-react";
|
|
3
3
|
var ne = { exports: {} }, G = {};
|
|
4
4
|
/**
|
|
5
5
|
* @license React
|
|
@@ -53,7 +53,7 @@ function sn() {
|
|
|
53
53
|
switch (u) {
|
|
54
54
|
case j:
|
|
55
55
|
return "Fragment";
|
|
56
|
-
case
|
|
56
|
+
case C:
|
|
57
57
|
return "Profiler";
|
|
58
58
|
case U:
|
|
59
59
|
return "StrictMode";
|
|
@@ -72,7 +72,7 @@ function sn() {
|
|
|
72
72
|
return "Portal";
|
|
73
73
|
case A:
|
|
74
74
|
return u.displayName || "Context";
|
|
75
|
-
case
|
|
75
|
+
case S:
|
|
76
76
|
return (u._context.displayName || "Context") + ".Consumer";
|
|
77
77
|
case N:
|
|
78
78
|
var g = u.render;
|
|
@@ -199,10 +199,10 @@ function sn() {
|
|
|
199
199
|
else v(T);
|
|
200
200
|
if (Re.call(g, "key")) {
|
|
201
201
|
T = e(u);
|
|
202
|
-
var
|
|
202
|
+
var q = Object.keys(g).filter(function(Lt) {
|
|
203
203
|
return Lt !== "key";
|
|
204
204
|
});
|
|
205
|
-
x = 0 <
|
|
205
|
+
x = 0 < q.length ? "{key: someKey, " + q.join(": ..., ") + ": ...}" : "{key: someKey}", Le[T + x] || (q = 0 < q.length ? "{" + q.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
206
206
|
`A props object containing a "key" prop is being spread into JSX:
|
|
207
207
|
let props = %s;
|
|
208
208
|
<%s {...props} />
|
|
@@ -211,7 +211,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
211
211
|
<%s key={someKey} {...props} />`,
|
|
212
212
|
x,
|
|
213
213
|
T,
|
|
214
|
-
|
|
214
|
+
q,
|
|
215
215
|
T
|
|
216
216
|
), Le[T + x] = !0);
|
|
217
217
|
}
|
|
@@ -238,7 +238,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
238
238
|
function _(u) {
|
|
239
239
|
return typeof u == "object" && u !== null && u.$$typeof === b;
|
|
240
240
|
}
|
|
241
|
-
var l = Ft, b = Symbol.for("react.transitional.element"), R = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"),
|
|
241
|
+
var l = Ft, b = Symbol.for("react.transitional.element"), R = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), S = Symbol.for("react.consumer"), A = Symbol.for("react.context"), N = Symbol.for("react.forward_ref"), $ = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), ee = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), Nt = Symbol.for("react.activity"), Dt = Symbol.for("react.client.reference"), _e = l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Re = Object.prototype.hasOwnProperty, Ut = Array.isArray, ge = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
244
|
l = {
|
|
@@ -294,9 +294,9 @@ const un = ({
|
|
|
294
294
|
if (R && R.rangeCount > 0) {
|
|
295
295
|
let j = R.getRangeAt(0).commonAncestorContainer;
|
|
296
296
|
for (; j && j.nodeType === Node.ELEMENT_NODE; ) {
|
|
297
|
-
const U = j,
|
|
298
|
-
if (["h1", "h2", "p", "div"].includes(
|
|
299
|
-
|
|
297
|
+
const U = j, C = U.tagName.toLowerCase();
|
|
298
|
+
if (["h1", "h2", "p", "div"].includes(C)) {
|
|
299
|
+
C === "h1" || C === "h2" ? (b = C, l.push(`formatBlock:${C}`)) : (C === "p" || C === "div" && !b) && (b = "p");
|
|
300
300
|
break;
|
|
301
301
|
}
|
|
302
302
|
j = U.parentNode;
|
|
@@ -321,13 +321,13 @@ const un = ({
|
|
|
321
321
|
{
|
|
322
322
|
id: "bold",
|
|
323
323
|
command: "bold",
|
|
324
|
-
icon: /* @__PURE__ */ p.jsx(
|
|
324
|
+
icon: /* @__PURE__ */ p.jsx(qt, { size: 18 }),
|
|
325
325
|
title: "Bold"
|
|
326
326
|
},
|
|
327
327
|
{
|
|
328
328
|
id: "italic",
|
|
329
329
|
command: "italic",
|
|
330
|
-
icon: /* @__PURE__ */ p.jsx(
|
|
330
|
+
icon: /* @__PURE__ */ p.jsx(Yt, { size: 18 }),
|
|
331
331
|
title: "Italic"
|
|
332
332
|
},
|
|
333
333
|
{
|
|
@@ -419,8 +419,7 @@ const un = ({
|
|
|
419
419
|
onClick: () => l.onClick ? l.onClick() : e(l.command, l.value),
|
|
420
420
|
title: l.title,
|
|
421
421
|
type: "button",
|
|
422
|
-
className: `w-9 h-9 flex items-center justify-center rounded-md border transition-colors duration-200
|
|
423
|
-
${b ? "bg-blue-100 text-blue-600 border-blue-300 hover:bg-blue-200" : "bg-white border-gray-300 text-gray-700 hover:bg-gray-100"}`,
|
|
422
|
+
className: `w-9 h-9 flex items-center justify-center rounded-md border transition-colors duration-200 ${b ? "bg-blue-100 text-blue-600 border-blue-300 hover:bg-blue-200" : "bg-white border-gray-300 text-gray-700 hover:bg-gray-100"}`,
|
|
424
423
|
children: l.icon
|
|
425
424
|
},
|
|
426
425
|
l.id
|
|
@@ -775,7 +774,7 @@ function yn(e, t, n) {
|
|
|
775
774
|
});
|
|
776
775
|
return L(t, r);
|
|
777
776
|
}
|
|
778
|
-
function
|
|
777
|
+
function Y(e, t = 0) {
|
|
779
778
|
if (e.aborted === !0)
|
|
780
779
|
return !0;
|
|
781
780
|
for (let n = t; n < e.issues.length; n++)
|
|
@@ -862,7 +861,7 @@ const Ie = (e) => (t, n, r, o) => {
|
|
|
862
861
|
throw pt(s, o?.callee), s;
|
|
863
862
|
}
|
|
864
863
|
return c.value;
|
|
865
|
-
},
|
|
864
|
+
}, Ce = (e) => async (t, n, r, o) => {
|
|
866
865
|
const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
867
866
|
let c = t._zod.run({ value: n, issues: [] }, i);
|
|
868
867
|
if (c instanceof Promise && (c = await c), c.issues.length) {
|
|
@@ -890,18 +889,18 @@ const Ie = (e) => (t, n, r, o) => {
|
|
|
890
889
|
return Ie(e)(t, n, o);
|
|
891
890
|
}, An = (e) => (t, n, r) => Ie(e)(t, n, r), jn = (e) => async (t, n, r) => {
|
|
892
891
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
893
|
-
return
|
|
894
|
-
}, In = (e) => async (t, n, r) =>
|
|
892
|
+
return Ce(e)(t, n, o);
|
|
893
|
+
}, In = (e) => async (t, n, r) => Ce(e)(t, n, r), Cn = (e) => (t, n, r) => {
|
|
895
894
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
896
895
|
return he(e)(t, n, o);
|
|
897
|
-
},
|
|
896
|
+
}, Sn = (e) => (t, n, r) => he(e)(t, n, r), On = (e) => async (t, n, r) => {
|
|
898
897
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
899
898
|
return me(e)(t, n, o);
|
|
900
|
-
}, Rn = (e) => async (t, n, r) => me(e)(t, n, r), Pn = /^[cC][^\s-]{8,}$/, Nn = /^[0-9a-z]+$/, Dn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Un = /^[0-9a-vA-V]{20}$/, Ln = /^[A-Za-z0-9]{27}$/, Fn = /^[a-zA-Z0-9_-]{21}$/, Mn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Vn = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,
|
|
901
|
-
function
|
|
899
|
+
}, Rn = (e) => async (t, n, r) => me(e)(t, n, r), Pn = /^[cC][^\s-]{8,}$/, Nn = /^[0-9a-z]+$/, Dn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Un = /^[0-9a-vA-V]{20}$/, Ln = /^[A-Za-z0-9]{27}$/, Fn = /^[a-zA-Z0-9_-]{21}$/, Mn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Vn = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, qe = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Wn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Bn = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
900
|
+
function qn() {
|
|
902
901
|
return new RegExp(Bn, "u");
|
|
903
902
|
}
|
|
904
|
-
const
|
|
903
|
+
const Yn = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Jn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, Gn = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, Hn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Xn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, kt = /^[A-Za-z0-9_-]*$/, Kn = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, Qn = /^\+(?:[0-9]){6,14}[0-9]$/, zt = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", er = /* @__PURE__ */ new RegExp(`^${zt}$`);
|
|
905
904
|
function yt(e) {
|
|
906
905
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
907
906
|
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
@@ -1231,7 +1230,7 @@ const zr = {
|
|
|
1231
1230
|
});
|
|
1232
1231
|
else {
|
|
1233
1232
|
const o = (c, s, f) => {
|
|
1234
|
-
let d =
|
|
1233
|
+
let d = Y(c), h;
|
|
1235
1234
|
for (const v of s) {
|
|
1236
1235
|
if (v._zod.def.when) {
|
|
1237
1236
|
if (!v._zod.def.when(c))
|
|
@@ -1243,17 +1242,17 @@ const zr = {
|
|
|
1243
1242
|
throw new J();
|
|
1244
1243
|
if (h || l instanceof Promise)
|
|
1245
1244
|
h = (h ?? Promise.resolve()).then(async () => {
|
|
1246
|
-
await l, c.issues.length !== _ && (d || (d =
|
|
1245
|
+
await l, c.issues.length !== _ && (d || (d = Y(c, _)));
|
|
1247
1246
|
});
|
|
1248
1247
|
else {
|
|
1249
1248
|
if (c.issues.length === _)
|
|
1250
1249
|
continue;
|
|
1251
|
-
d || (d =
|
|
1250
|
+
d || (d = Y(c, _));
|
|
1252
1251
|
}
|
|
1253
1252
|
}
|
|
1254
1253
|
return h ? h.then(() => c) : c;
|
|
1255
1254
|
}, i = (c, s, f) => {
|
|
1256
|
-
if (
|
|
1255
|
+
if (Y(c))
|
|
1257
1256
|
return c.aborted = !0, c;
|
|
1258
1257
|
const d = o(s, r, f);
|
|
1259
1258
|
if (d instanceof Promise) {
|
|
@@ -1291,7 +1290,7 @@ const zr = {
|
|
|
1291
1290
|
vendor: "zod",
|
|
1292
1291
|
version: 1
|
|
1293
1292
|
};
|
|
1294
|
-
}),
|
|
1293
|
+
}), Se = /* @__PURE__ */ a("$ZodString", (e, t) => {
|
|
1295
1294
|
Z.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? rr(e._zod.bag), e._zod.parse = (n, r) => {
|
|
1296
1295
|
if (t.coerce)
|
|
1297
1296
|
try {
|
|
@@ -1306,7 +1305,7 @@ const zr = {
|
|
|
1306
1305
|
}), n;
|
|
1307
1306
|
};
|
|
1308
1307
|
}), k = /* @__PURE__ */ a("$ZodStringFormat", (e, t) => {
|
|
1309
|
-
pe.init(e, t),
|
|
1308
|
+
pe.init(e, t), Se.init(e, t);
|
|
1310
1309
|
}), yr = /* @__PURE__ */ a("$ZodGUID", (e, t) => {
|
|
1311
1310
|
t.pattern ?? (t.pattern = Vn), k.init(e, t);
|
|
1312
1311
|
}), $r = /* @__PURE__ */ a("$ZodUUID", (e, t) => {
|
|
@@ -1323,9 +1322,9 @@ const zr = {
|
|
|
1323
1322
|
}[t.version];
|
|
1324
1323
|
if (r === void 0)
|
|
1325
1324
|
throw new Error(`Invalid UUID version: "${t.version}"`);
|
|
1326
|
-
t.pattern ?? (t.pattern =
|
|
1325
|
+
t.pattern ?? (t.pattern = qe(r));
|
|
1327
1326
|
} else
|
|
1328
|
-
t.pattern ?? (t.pattern =
|
|
1327
|
+
t.pattern ?? (t.pattern = qe());
|
|
1329
1328
|
k.init(e, t);
|
|
1330
1329
|
}), Zr = /* @__PURE__ */ a("$ZodEmail", (e, t) => {
|
|
1331
1330
|
t.pattern ?? (t.pattern = Wn), k.init(e, t);
|
|
@@ -1362,7 +1361,7 @@ const zr = {
|
|
|
1362
1361
|
}
|
|
1363
1362
|
};
|
|
1364
1363
|
}), xr = /* @__PURE__ */ a("$ZodEmoji", (e, t) => {
|
|
1365
|
-
t.pattern ?? (t.pattern =
|
|
1364
|
+
t.pattern ?? (t.pattern = qn()), k.init(e, t);
|
|
1366
1365
|
}), Tr = /* @__PURE__ */ a("$ZodNanoID", (e, t) => {
|
|
1367
1366
|
t.pattern ?? (t.pattern = Fn), k.init(e, t);
|
|
1368
1367
|
}), Ar = /* @__PURE__ */ a("$ZodCUID", (e, t) => {
|
|
@@ -1371,9 +1370,9 @@ const zr = {
|
|
|
1371
1370
|
t.pattern ?? (t.pattern = Nn), k.init(e, t);
|
|
1372
1371
|
}), Ir = /* @__PURE__ */ a("$ZodULID", (e, t) => {
|
|
1373
1372
|
t.pattern ?? (t.pattern = Dn), k.init(e, t);
|
|
1374
|
-
}),
|
|
1373
|
+
}), Cr = /* @__PURE__ */ a("$ZodXID", (e, t) => {
|
|
1375
1374
|
t.pattern ?? (t.pattern = Un), k.init(e, t);
|
|
1376
|
-
}),
|
|
1375
|
+
}), Sr = /* @__PURE__ */ a("$ZodKSUID", (e, t) => {
|
|
1377
1376
|
t.pattern ?? (t.pattern = Ln), k.init(e, t);
|
|
1378
1377
|
}), Or = /* @__PURE__ */ a("$ZodISODateTime", (e, t) => {
|
|
1379
1378
|
t.pattern ?? (t.pattern = nr(t)), k.init(e, t);
|
|
@@ -1384,7 +1383,7 @@ const zr = {
|
|
|
1384
1383
|
}), Nr = /* @__PURE__ */ a("$ZodISODuration", (e, t) => {
|
|
1385
1384
|
t.pattern ?? (t.pattern = Mn), k.init(e, t);
|
|
1386
1385
|
}), Dr = /* @__PURE__ */ a("$ZodIPv4", (e, t) => {
|
|
1387
|
-
t.pattern ?? (t.pattern =
|
|
1386
|
+
t.pattern ?? (t.pattern = Yn), k.init(e, t), e._zod.onattach.push((n) => {
|
|
1388
1387
|
const r = n._zod.bag;
|
|
1389
1388
|
r.format = "ipv4";
|
|
1390
1389
|
});
|
|
@@ -1478,7 +1477,7 @@ const Wr = /* @__PURE__ */ a("$ZodBase64URL", (e, t) => {
|
|
|
1478
1477
|
}), Br = /* @__PURE__ */ a("$ZodE164", (e, t) => {
|
|
1479
1478
|
t.pattern ?? (t.pattern = Qn), k.init(e, t);
|
|
1480
1479
|
});
|
|
1481
|
-
function
|
|
1480
|
+
function qr(e, t = null) {
|
|
1482
1481
|
try {
|
|
1483
1482
|
const n = e.split(".");
|
|
1484
1483
|
if (n.length !== 3)
|
|
@@ -1492,9 +1491,9 @@ function Yr(e, t = null) {
|
|
|
1492
1491
|
return !1;
|
|
1493
1492
|
}
|
|
1494
1493
|
}
|
|
1495
|
-
const
|
|
1494
|
+
const Yr = /* @__PURE__ */ a("$ZodJWT", (e, t) => {
|
|
1496
1495
|
k.init(e, t), e._zod.check = (n) => {
|
|
1497
|
-
|
|
1496
|
+
qr(n.value, t.alg) || n.issues.push({
|
|
1498
1497
|
code: "invalid_format",
|
|
1499
1498
|
format: "jwt",
|
|
1500
1499
|
input: n.value,
|
|
@@ -1548,7 +1547,7 @@ const qr = /* @__PURE__ */ a("$ZodJWT", (e, t) => {
|
|
|
1548
1547
|
inst: e
|
|
1549
1548
|
}), n);
|
|
1550
1549
|
});
|
|
1551
|
-
function
|
|
1550
|
+
function Ye(e, t, n) {
|
|
1552
1551
|
e.issues.length && t.issues.push(...gt(n, e.issues)), t.value[n] = e.value;
|
|
1553
1552
|
}
|
|
1554
1553
|
const Kr = /* @__PURE__ */ a("$ZodArray", (e, t) => {
|
|
@@ -1568,7 +1567,7 @@ const Kr = /* @__PURE__ */ a("$ZodArray", (e, t) => {
|
|
|
1568
1567
|
value: s,
|
|
1569
1568
|
issues: []
|
|
1570
1569
|
}, r);
|
|
1571
|
-
f instanceof Promise ? i.push(f.then((d) =>
|
|
1570
|
+
f instanceof Promise ? i.push(f.then((d) => Ye(d, n, c))) : Ye(f, n, c);
|
|
1572
1571
|
}
|
|
1573
1572
|
return i.length ? Promise.all(i).then(() => n) : n;
|
|
1574
1573
|
};
|
|
@@ -1657,19 +1656,19 @@ const Qr = /* @__PURE__ */ a("$ZodObject", (e, t) => {
|
|
|
1657
1656
|
}), eo = /* @__PURE__ */ a("$ZodObjectJIT", (e, t) => {
|
|
1658
1657
|
Qr.init(e, t);
|
|
1659
1658
|
const n = e._zod.parse, r = xe(() => At(t)), o = (_) => {
|
|
1660
|
-
const l = new kr(["shape", "payload", "ctx"]), b = r.value, R = (
|
|
1661
|
-
const A = Be(
|
|
1659
|
+
const l = new kr(["shape", "payload", "ctx"]), b = r.value, R = (S) => {
|
|
1660
|
+
const A = Be(S);
|
|
1662
1661
|
return `shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`;
|
|
1663
1662
|
};
|
|
1664
1663
|
l.write("const input = payload.value;");
|
|
1665
1664
|
const j = /* @__PURE__ */ Object.create(null);
|
|
1666
1665
|
let U = 0;
|
|
1667
|
-
for (const
|
|
1668
|
-
j[
|
|
1666
|
+
for (const S of b.keys)
|
|
1667
|
+
j[S] = `key_${U++}`;
|
|
1669
1668
|
l.write("const newResult = {};");
|
|
1670
|
-
for (const
|
|
1671
|
-
const A = j[
|
|
1672
|
-
l.write(`const ${A} = ${R(
|
|
1669
|
+
for (const S of b.keys) {
|
|
1670
|
+
const A = j[S], N = Be(S);
|
|
1671
|
+
l.write(`const ${A} = ${R(S)};`), l.write(`
|
|
1673
1672
|
if (${A}.issues.length) {
|
|
1674
1673
|
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
|
1675
1674
|
...iss,
|
|
@@ -1689,8 +1688,8 @@ const Qr = /* @__PURE__ */ a("$ZodObject", (e, t) => {
|
|
|
1689
1688
|
`);
|
|
1690
1689
|
}
|
|
1691
1690
|
l.write("payload.value = newResult;"), l.write("return payload;");
|
|
1692
|
-
const
|
|
1693
|
-
return (
|
|
1691
|
+
const C = l.compile();
|
|
1692
|
+
return (S, A) => C(_, S, A);
|
|
1694
1693
|
};
|
|
1695
1694
|
let i;
|
|
1696
1695
|
const c = ue, s = !mt.jitless, d = s && hn.value, h = t.catchall;
|
|
@@ -1710,7 +1709,7 @@ function Je(e, t, n, r) {
|
|
|
1710
1709
|
for (const i of e)
|
|
1711
1710
|
if (i.issues.length === 0)
|
|
1712
1711
|
return t.value = i.value, t;
|
|
1713
|
-
const o = e.filter((i) => !
|
|
1712
|
+
const o = e.filter((i) => !Y(i));
|
|
1714
1713
|
return o.length === 1 ? (t.value = o[0].value, o[0]) : (t.issues.push({
|
|
1715
1714
|
code: "invalid_union",
|
|
1716
1715
|
input: t.value,
|
|
@@ -1791,7 +1790,7 @@ function ye(e, t) {
|
|
|
1791
1790
|
return { valid: !1, mergeErrorPath: [] };
|
|
1792
1791
|
}
|
|
1793
1792
|
function Ge(e, t, n) {
|
|
1794
|
-
if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues),
|
|
1793
|
+
if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues), Y(e))
|
|
1795
1794
|
return e;
|
|
1796
1795
|
const r = ye(t.value, n.value);
|
|
1797
1796
|
if (!r.valid)
|
|
@@ -2121,7 +2120,7 @@ function Io(e, t) {
|
|
|
2121
2120
|
...m(t)
|
|
2122
2121
|
});
|
|
2123
2122
|
}
|
|
2124
|
-
function
|
|
2123
|
+
function Co(e, t) {
|
|
2125
2124
|
return new e({
|
|
2126
2125
|
type: "string",
|
|
2127
2126
|
format: "ipv6",
|
|
@@ -2130,7 +2129,7 @@ function So(e, t) {
|
|
|
2130
2129
|
...m(t)
|
|
2131
2130
|
});
|
|
2132
2131
|
}
|
|
2133
|
-
function
|
|
2132
|
+
function So(e, t) {
|
|
2134
2133
|
return new e({
|
|
2135
2134
|
type: "string",
|
|
2136
2135
|
format: "cidrv4",
|
|
@@ -2242,12 +2241,12 @@ function Bo(e, t) {
|
|
|
2242
2241
|
...m(t)
|
|
2243
2242
|
});
|
|
2244
2243
|
}
|
|
2245
|
-
function
|
|
2244
|
+
function qo(e) {
|
|
2246
2245
|
return new e({
|
|
2247
2246
|
type: "unknown"
|
|
2248
2247
|
});
|
|
2249
2248
|
}
|
|
2250
|
-
function
|
|
2249
|
+
function Yo(e, t) {
|
|
2251
2250
|
return new e({
|
|
2252
2251
|
type: "never",
|
|
2253
2252
|
...m(t)
|
|
@@ -2306,7 +2305,7 @@ function de(e, t) {
|
|
|
2306
2305
|
minimum: e
|
|
2307
2306
|
});
|
|
2308
2307
|
}
|
|
2309
|
-
function
|
|
2308
|
+
function Ct(e, t) {
|
|
2310
2309
|
return new hr({
|
|
2311
2310
|
check: "length_equals",
|
|
2312
2311
|
...m(t),
|
|
@@ -2468,7 +2467,7 @@ const _i = (e, t) => {
|
|
|
2468
2467
|
});
|
|
2469
2468
|
}, O = a("ZodError", _i, {
|
|
2470
2469
|
Parent: Error
|
|
2471
|
-
}), gi = /* @__PURE__ */ Ie(O), vi = /* @__PURE__ */
|
|
2470
|
+
}), gi = /* @__PURE__ */ Ie(O), vi = /* @__PURE__ */ Ce(O), bi = /* @__PURE__ */ he(O), wi = /* @__PURE__ */ me(O), ki = /* @__PURE__ */ Tn(O), zi = /* @__PURE__ */ An(O), yi = /* @__PURE__ */ jn(O), $i = /* @__PURE__ */ In(O), Zi = /* @__PURE__ */ Cn(O), Ei = /* @__PURE__ */ Sn(O), xi = /* @__PURE__ */ On(O), Ti = /* @__PURE__ */ Rn(O), E = /* @__PURE__ */ a("ZodType", (e, t) => (Z.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(B(t, {
|
|
2472
2471
|
checks: [
|
|
2473
2472
|
...t.checks ?? [],
|
|
2474
2473
|
...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
@@ -2486,18 +2485,18 @@ const _i = (e, t) => {
|
|
|
2486
2485
|
return ie.get(e);
|
|
2487
2486
|
const r = e.clone();
|
|
2488
2487
|
return ie.add(r, n[0]), r;
|
|
2489
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)),
|
|
2490
|
-
|
|
2488
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), St = /* @__PURE__ */ a("_ZodString", (e, t) => {
|
|
2489
|
+
Se.init(e, t), E.init(e, t);
|
|
2491
2490
|
const n = e._zod.bag;
|
|
2492
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(Jo(...r)), e.includes = (...r) => e.check(Xo(...r)), e.startsWith = (...r) => e.check(Ko(...r)), e.endsWith = (...r) => e.check(Qo(...r)), e.min = (...r) => e.check(de(...r)), e.max = (...r) => e.check(It(...r)), e.length = (...r) => e.check(
|
|
2491
|
+
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(Jo(...r)), e.includes = (...r) => e.check(Xo(...r)), e.startsWith = (...r) => e.check(Ko(...r)), e.endsWith = (...r) => e.check(Qo(...r)), e.min = (...r) => e.check(de(...r)), e.max = (...r) => e.check(It(...r)), e.length = (...r) => e.check(Ct(...r)), e.nonempty = (...r) => e.check(de(1, ...r)), e.lowercase = (r) => e.check(Go(r)), e.uppercase = (r) => e.check(Ho(r)), e.trim = () => e.check(ti()), e.normalize = (...r) => e.check(ei(...r)), e.toLowerCase = () => e.check(ni()), e.toUpperCase = () => e.check(ri());
|
|
2493
2492
|
}), Ai = /* @__PURE__ */ a("ZodString", (e, t) => {
|
|
2494
|
-
|
|
2493
|
+
Se.init(e, t), St.init(e, t), e.email = (n) => e.check(vo(ji, n)), e.url = (n) => e.check(yo(Ii, n)), e.jwt = (n) => e.check(Do(qi, n)), e.emoji = (n) => e.check($o(Ci, n)), e.guid = (n) => e.check(tt(it, n)), e.uuid = (n) => e.check(bo(se, n)), e.uuidv4 = (n) => e.check(wo(se, n)), e.uuidv6 = (n) => e.check(ko(se, n)), e.uuidv7 = (n) => e.check(zo(se, n)), e.nanoid = (n) => e.check(Zo(Si, n)), e.guid = (n) => e.check(tt(it, n)), e.cuid = (n) => e.check(Eo(Oi, n)), e.cuid2 = (n) => e.check(xo(Ri, n)), e.ulid = (n) => e.check(To(Pi, n)), e.base64 = (n) => e.check(Ro(Vi, n)), e.base64url = (n) => e.check(Po(Wi, n)), e.xid = (n) => e.check(Ao(Ni, n)), e.ksuid = (n) => e.check(jo(Di, n)), e.ipv4 = (n) => e.check(Io(Ui, n)), e.ipv6 = (n) => e.check(Co(Li, n)), e.cidrv4 = (n) => e.check(So(Fi, n)), e.cidrv6 = (n) => e.check(Oo(Mi, n)), e.e164 = (n) => e.check(No(Bi, n)), e.datetime = (n) => e.check(ui(n)), e.date = (n) => e.check(di(n)), e.time = (n) => e.check(hi(n)), e.duration = (n) => e.check(pi(n));
|
|
2495
2494
|
});
|
|
2496
2495
|
function ce(e) {
|
|
2497
2496
|
return go(Ai, e);
|
|
2498
2497
|
}
|
|
2499
2498
|
const z = /* @__PURE__ */ a("ZodStringFormat", (e, t) => {
|
|
2500
|
-
k.init(e, t),
|
|
2499
|
+
k.init(e, t), St.init(e, t);
|
|
2501
2500
|
}), ji = /* @__PURE__ */ a("ZodEmail", (e, t) => {
|
|
2502
2501
|
Zr.init(e, t), z.init(e, t);
|
|
2503
2502
|
}), it = /* @__PURE__ */ a("ZodGUID", (e, t) => {
|
|
@@ -2506,9 +2505,9 @@ const z = /* @__PURE__ */ a("ZodStringFormat", (e, t) => {
|
|
|
2506
2505
|
$r.init(e, t), z.init(e, t);
|
|
2507
2506
|
}), Ii = /* @__PURE__ */ a("ZodURL", (e, t) => {
|
|
2508
2507
|
Er.init(e, t), z.init(e, t);
|
|
2509
|
-
}),
|
|
2508
|
+
}), Ci = /* @__PURE__ */ a("ZodEmoji", (e, t) => {
|
|
2510
2509
|
xr.init(e, t), z.init(e, t);
|
|
2511
|
-
}),
|
|
2510
|
+
}), Si = /* @__PURE__ */ a("ZodNanoID", (e, t) => {
|
|
2512
2511
|
Tr.init(e, t), z.init(e, t);
|
|
2513
2512
|
}), Oi = /* @__PURE__ */ a("ZodCUID", (e, t) => {
|
|
2514
2513
|
Ar.init(e, t), z.init(e, t);
|
|
@@ -2517,9 +2516,9 @@ const z = /* @__PURE__ */ a("ZodStringFormat", (e, t) => {
|
|
|
2517
2516
|
}), Pi = /* @__PURE__ */ a("ZodULID", (e, t) => {
|
|
2518
2517
|
Ir.init(e, t), z.init(e, t);
|
|
2519
2518
|
}), Ni = /* @__PURE__ */ a("ZodXID", (e, t) => {
|
|
2520
|
-
Sr.init(e, t), z.init(e, t);
|
|
2521
|
-
}), Di = /* @__PURE__ */ a("ZodKSUID", (e, t) => {
|
|
2522
2519
|
Cr.init(e, t), z.init(e, t);
|
|
2520
|
+
}), Di = /* @__PURE__ */ a("ZodKSUID", (e, t) => {
|
|
2521
|
+
Sr.init(e, t), z.init(e, t);
|
|
2523
2522
|
}), Ui = /* @__PURE__ */ a("ZodIPv4", (e, t) => {
|
|
2524
2523
|
Dr.init(e, t), z.init(e, t);
|
|
2525
2524
|
}), Li = /* @__PURE__ */ a("ZodIPv6", (e, t) => {
|
|
@@ -2534,8 +2533,8 @@ const z = /* @__PURE__ */ a("ZodStringFormat", (e, t) => {
|
|
|
2534
2533
|
Wr.init(e, t), z.init(e, t);
|
|
2535
2534
|
}), Bi = /* @__PURE__ */ a("ZodE164", (e, t) => {
|
|
2536
2535
|
Br.init(e, t), z.init(e, t);
|
|
2537
|
-
}),
|
|
2538
|
-
|
|
2536
|
+
}), qi = /* @__PURE__ */ a("ZodJWT", (e, t) => {
|
|
2537
|
+
Yr.init(e, t), z.init(e, t);
|
|
2539
2538
|
}), Ot = /* @__PURE__ */ a("ZodNumber", (e, t) => {
|
|
2540
2539
|
Tt.init(e, t), E.init(e, t), e.gt = (r, o) => e.check(rt(r, o)), e.gte = (r, o) => e.check(ke(r, o)), e.min = (r, o) => e.check(ke(r, o)), e.lt = (r, o) => e.check(nt(r, o)), e.lte = (r, o) => e.check(we(r, o)), e.max = (r, o) => e.check(we(r, o)), e.int = (r) => e.check(st(r)), e.safe = (r) => e.check(st(r)), e.positive = (r) => e.check(rt(0, r)), e.nonnegative = (r) => e.check(ke(0, r)), e.negative = (r) => e.check(nt(0, r)), e.nonpositive = (r) => e.check(we(0, r)), e.multipleOf = (r, o) => e.check(ot(r, o)), e.step = (r, o) => e.check(ot(r, o)), e.finite = () => e;
|
|
2541
2540
|
const n = e._zod.bag;
|
|
@@ -2544,11 +2543,11 @@ const z = /* @__PURE__ */ a("ZodStringFormat", (e, t) => {
|
|
|
2544
2543
|
function ct(e) {
|
|
2545
2544
|
return Vo(Ot, e);
|
|
2546
2545
|
}
|
|
2547
|
-
const
|
|
2546
|
+
const Yi = /* @__PURE__ */ a("ZodNumberFormat", (e, t) => {
|
|
2548
2547
|
Jr.init(e, t), Ot.init(e, t);
|
|
2549
2548
|
});
|
|
2550
2549
|
function st(e) {
|
|
2551
|
-
return Wo(
|
|
2550
|
+
return Wo(Yi, e);
|
|
2552
2551
|
}
|
|
2553
2552
|
const Ji = /* @__PURE__ */ a("ZodBoolean", (e, t) => {
|
|
2554
2553
|
Gr.init(e, t), E.init(e, t);
|
|
@@ -2560,16 +2559,16 @@ const Gi = /* @__PURE__ */ a("ZodUnknown", (e, t) => {
|
|
|
2560
2559
|
Hr.init(e, t), E.init(e, t);
|
|
2561
2560
|
});
|
|
2562
2561
|
function ut() {
|
|
2563
|
-
return
|
|
2562
|
+
return qo(Gi);
|
|
2564
2563
|
}
|
|
2565
2564
|
const Hi = /* @__PURE__ */ a("ZodNever", (e, t) => {
|
|
2566
2565
|
Xr.init(e, t), E.init(e, t);
|
|
2567
2566
|
});
|
|
2568
2567
|
function Xi(e) {
|
|
2569
|
-
return
|
|
2568
|
+
return Yo(Hi, e);
|
|
2570
2569
|
}
|
|
2571
2570
|
const Ki = /* @__PURE__ */ a("ZodArray", (e, t) => {
|
|
2572
|
-
Kr.init(e, t), E.init(e, t), e.element = t.element, e.min = (n, r) => e.check(de(n, r)), e.nonempty = (n) => e.check(de(1, n)), e.max = (n, r) => e.check(It(n, r)), e.length = (n, r) => e.check(
|
|
2571
|
+
Kr.init(e, t), E.init(e, t), e.element = t.element, e.min = (n, r) => e.check(de(n, r)), e.nonempty = (n) => e.check(de(1, n)), e.max = (n, r) => e.check(It(n, r)), e.length = (n, r) => e.check(Ct(n, r)), e.unwrap = () => e.element;
|
|
2573
2572
|
});
|
|
2574
2573
|
function Qi(e, t) {
|
|
2575
2574
|
return oi(Ki, e, t);
|
|
@@ -2918,7 +2917,7 @@ const zc = (e = "") => {
|
|
|
2918
2917
|
t?.(s.content, F);
|
|
2919
2918
|
} else
|
|
2920
2919
|
j(!0), setTimeout(() => j(!1), 3e3);
|
|
2921
|
-
}, [s.content, _, l, t]),
|
|
2920
|
+
}, [s.content, _, l, t]), C = P(() => {
|
|
2922
2921
|
try {
|
|
2923
2922
|
const $ = l();
|
|
2924
2923
|
n?.($);
|
|
@@ -2929,7 +2928,7 @@ const zc = (e = "") => {
|
|
|
2929
2928
|
"Export failed: " + ($ instanceof Error ? $.message : "Unknown error")
|
|
2930
2929
|
);
|
|
2931
2930
|
}
|
|
2932
|
-
}, [l, s.title, n]),
|
|
2931
|
+
}, [l, s.title, n]), S = P(() => {
|
|
2933
2932
|
confirm(
|
|
2934
2933
|
"Are you sure you want to clear the editor? All unsaved changes will be lost."
|
|
2935
2934
|
) && b();
|
|
@@ -2963,9 +2962,9 @@ const zc = (e = "") => {
|
|
|
2963
2962
|
{
|
|
2964
2963
|
onCommand: v,
|
|
2965
2964
|
onSave: U,
|
|
2966
|
-
onExport:
|
|
2965
|
+
onExport: C,
|
|
2967
2966
|
showButtons: o,
|
|
2968
|
-
onClear:
|
|
2967
|
+
onClear: S,
|
|
2969
2968
|
hasUnsavedChanges: s.hasUnsavedChanges
|
|
2970
2969
|
}
|
|
2971
2970
|
),
|
|
@@ -2973,7 +2972,25 @@ const zc = (e = "") => {
|
|
|
2973
2972
|
"div",
|
|
2974
2973
|
{
|
|
2975
2974
|
ref: f,
|
|
2976
|
-
className:
|
|
2975
|
+
className: `min-h-[500px] p-8 border-none outline-none resize-none text-gray-700 leading-relaxed prose max-w-none\r
|
|
2976
|
+
/* Heading styles */\r
|
|
2977
|
+
[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:mt-6 [&_h1]:mb-4 [&_h1]:text-gray-800 [&_h1]:border-b [&_h1]:pb-2\r
|
|
2978
|
+
[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:mt-5 [&_h2]:mb-3 [&_h2]:text-gray-800\r
|
|
2979
|
+
[&_h3]:text-xl [&_h3]:font-bold [&_h3]:mt-4 [&_h3]:mb-2 [&_h3]:text-gray-800\r
|
|
2980
|
+
/* Paragraph styles */\r
|
|
2981
|
+
[&_p]:mb-4 [&_p]:text-gray-700 [&_p]:leading-relaxed\r
|
|
2982
|
+
/* List styles */\r
|
|
2983
|
+
[&_ul]:list-disc [&_ul]:list-inside [&_ul]:mb-4 [&_ul]:ml-4 [&_ul]:space-y-1\r
|
|
2984
|
+
[&_ol]:list-decimal [&_ol]:list-inside [&_ol]:mb-4 [&_ol]:ml-4 [&_ol]:space-y-1\r
|
|
2985
|
+
[&_li]:mb-1\r
|
|
2986
|
+
/* Link styles */\r
|
|
2987
|
+
[&_a]:text-blue-600 [&_a]:hover:text-blue-800 [&_a]:underline [&_a]:transition-colors\r
|
|
2988
|
+
/* Blockquote styles */\r
|
|
2989
|
+
[&_blockquote]:border-l-4 [&_blockquote]:border-blue-500 [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:text-gray-600 [&_blockquote]:my-4\r
|
|
2990
|
+
/* Code styles */\r
|
|
2991
|
+
[&_code]:bg-gray-100 [&_code]:px-2 [&_code]:py-1 [&_code]:rounded [&_code]:text-sm [&_code]:font-mono\r
|
|
2992
|
+
[&_pre]:bg-gray-800 [&_pre]:text-gray-100 [&_pre]:p-4 [&_pre]:rounded-lg [&_pre]:overflow-x-auto [&_pre]:my-4\r
|
|
2993
|
+
[&_pre_code]:bg-transparent [&_pre_code]:text-inherit [&_pre_code]:p-0`,
|
|
2977
2994
|
contentEditable: !0,
|
|
2978
2995
|
onInput: ($) => A($.currentTarget.innerHTML),
|
|
2979
2996
|
onBlur: ($) => A($.currentTarget.innerHTML),
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(D,k){typeof exports=="object"&&typeof module<"u"?k(exports,require("react"),require("lucide-react")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react"],k):(D=typeof globalThis<"u"?globalThis:D||self,k(D.TextEditor={},D.React,D.LucideReact))})(this,(function(D,k,C){"use strict";var Ne=document.createElement("style");Ne.textContent=`/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */@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-leading:initial;--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-space-y-reverse:0}}}@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-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-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--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-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--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-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;--container-6xl:72rem;--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);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-bold:700;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--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{.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-2{margin-inline:calc(var(--spacing)*2)}.mx-auto{margin-inline:auto}.mt-2{margin-top:calc(var(--spacing)*2)}.block{display:block}.flex{display:flex}.inline{display:inline}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.min-h-\\[500px\\]{min-height:500px}.w-9{width:calc(var(--spacing)*9)}.w-full{width:100%}.w-px{width:1px}.max-w-6xl{max-width:var(--container-6xl)}.max-w-none{max-width:none}.resize-none{resize:none}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.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-6{gap:calc(var(--spacing)*6)}.overflow-hidden{overflow:hidden}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-none{--tw-border-style:none;border-style:none}.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)}.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-600{background-color:var(--color-green-600)}.bg-red-600{background-color:var(--color-red-600)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing)*3)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.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-blue-600{color:var(--color-blue-600)}.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-orange-600{color:var(--color-orange-600)}.text-red-600{color:var(--color-red-600)}.text-white{color:var(--color-white)}.italic{font-style:italic}.underline{text-decoration-line:underline}.placeholder-gray-400::-moz-placeholder{color:var(--color-gray-400)}.placeholder-gray-400::placeholder{color:var(--color-gray-400)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px 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-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-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.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)}}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-blue-300:disabled{background-color:var(--color-blue-300)}@media (min-width:40rem){.sm\\:mt-0{margin-top:calc(var(--spacing)*0)}}.animate-fadeIn{animation:.3s ease-in-out fadeIn}}.editor-content h1{margin-top:calc(var(--spacing)*4);margin-bottom:calc(var(--spacing)*2);font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-gray-800)}.editor-content p{margin-bottom:calc(var(--spacing)*4)}.editor-content a{color:var(--color-blue-600);text-decoration-line:underline}@keyframes fadeIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.editor-content{min-height:500px;padding:calc(var(--spacing)*8)}.editor-content h1{margin-top:calc(var(--spacing)*6);margin-bottom:calc(var(--spacing)*4);border-bottom-style:var(--tw-border-style);padding-bottom:calc(var(--spacing)*2);font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-gray-800);border-bottom-width:1px}.editor-content h2{margin-top:calc(var(--spacing)*5);margin-bottom:calc(var(--spacing)*3);font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-gray-800)}.editor-content h3{margin-top:calc(var(--spacing)*4);margin-bottom:calc(var(--spacing)*2);font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-gray-800)}.editor-content p{margin-bottom:calc(var(--spacing)*4);--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);color:var(--color-gray-700)}.editor-content ul{margin-bottom:calc(var(--spacing)*4);margin-left:calc(var(--spacing)*4);list-style-type:disc;list-style-position:inside}:where(.editor-content ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}.editor-content ol{margin-bottom:calc(var(--spacing)*4);margin-left:calc(var(--spacing)*4);list-style-type:decimal;list-style-position:inside}:where(.editor-content ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}.editor-content li{margin-bottom:calc(var(--spacing)*1)}.editor-content a{color:var(--color-blue-600);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));text-decoration-line:underline}@media (hover:hover){.editor-content a:hover{color:var(--color-blue-800)}}.editor-content blockquote{margin-block:calc(var(--spacing)*4);border-left-style:var(--tw-border-style);border-left-width:4px;border-color:var(--color-blue-500);padding-left:calc(var(--spacing)*4);color:var(--color-gray-600);font-style:italic}.editor-content code{background-color:var(--color-gray-100);padding-inline:calc(var(--spacing)*2);padding-block:calc(var(--spacing)*1);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:.25rem}.editor-content pre{margin-block:calc(var(--spacing)*4);border-radius:var(--radius-lg);background-color:var(--color-gray-800);padding:calc(var(--spacing)*4);color:var(--color-gray-100);overflow-x:auto}.editor-content pre code{padding:calc(var(--spacing)*0);color:inherit;background-color:#0000}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@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-space-y-reverse{syntax:"*";inherits:false;initial-value:0}
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(
|
|
1
|
+
(function(D,k){typeof exports=="object"&&typeof module<"u"?k(exports,require("react"),require("lucide-react")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react"],k):(D=typeof globalThis<"u"?globalThis:D||self,k(D.TextEditor={},D.React,D.LucideReact))})(this,(function(D,k,C){"use strict";var Pe=document.createElement("style");Pe.textContent=`/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */@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-leading:initial;--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-space-y-reverse:0}}}@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-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-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--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-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--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-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;--container-6xl:72rem;--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);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-bold:700;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--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{.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-2{margin-inline:calc(var(--spacing)*2)}.mx-auto{margin-inline:auto}.mt-2{margin-top:calc(var(--spacing)*2)}.block{display:block}.flex{display:flex}.inline{display:inline}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.min-h-\\[500px\\]{min-height:500px}.w-9{width:calc(var(--spacing)*9)}.w-full{width:100%}.w-px{width:1px}.max-w-6xl{max-width:var(--container-6xl)}.max-w-none{max-width:none}.resize-none{resize:none}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.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-6{gap:calc(var(--spacing)*6)}.overflow-hidden{overflow:hidden}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-none{--tw-border-style:none;border-style:none}.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)}.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-600{background-color:var(--color-green-600)}.bg-red-600{background-color:var(--color-red-600)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing)*3)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.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-blue-600{color:var(--color-blue-600)}.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-orange-600{color:var(--color-orange-600)}.text-red-600{color:var(--color-red-600)}.text-white{color:var(--color-white)}.italic{font-style:italic}.underline{text-decoration-line:underline}.placeholder-gray-400::-moz-placeholder{color:var(--color-gray-400)}.placeholder-gray-400::placeholder{color:var(--color-gray-400)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px 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-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-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.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)}}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-blue-300:disabled{background-color:var(--color-blue-300)}@media (min-width:40rem){.sm\\:mt-0{margin-top:calc(var(--spacing)*0)}}.\\[\\&_a\\]\\:text-blue-600 a{color:var(--color-blue-600)}.\\[\\&_a\\]\\:underline a{text-decoration-line:underline}.\\[\\&_a\\]\\:transition-colors a{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))}@media (hover:hover){.\\[\\&_a\\]\\:hover\\:text-blue-800 a:hover{color:var(--color-blue-800)}}.\\[\\&_blockquote\\]\\:my-4 blockquote{margin-block:calc(var(--spacing)*4)}.\\[\\&_blockquote\\]\\:border-l-4 blockquote{border-left-style:var(--tw-border-style);border-left-width:4px}.\\[\\&_blockquote\\]\\:border-blue-500 blockquote{border-color:var(--color-blue-500)}.\\[\\&_blockquote\\]\\:pl-4 blockquote{padding-left:calc(var(--spacing)*4)}.\\[\\&_blockquote\\]\\:text-gray-600 blockquote{color:var(--color-gray-600)}.\\[\\&_blockquote\\]\\:italic blockquote{font-style:italic}.\\[\\&_code\\]\\:rounded code{border-radius:.25rem}.\\[\\&_code\\]\\:bg-gray-100 code{background-color:var(--color-gray-100)}.\\[\\&_code\\]\\:px-2 code{padding-inline:calc(var(--spacing)*2)}.\\[\\&_code\\]\\:py-1 code{padding-block:calc(var(--spacing)*1)}.\\[\\&_code\\]\\:font-mono code{font-family:var(--font-mono)}.\\[\\&_code\\]\\:text-sm code{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\\[\\&_h1\\]\\:mt-6 h1{margin-top:calc(var(--spacing)*6)}.\\[\\&_h1\\]\\:mb-4 h1{margin-bottom:calc(var(--spacing)*4)}.\\[\\&_h1\\]\\:border-b h1{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\\[\\&_h1\\]\\:pb-2 h1{padding-bottom:calc(var(--spacing)*2)}.\\[\\&_h1\\]\\:text-3xl h1{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.\\[\\&_h1\\]\\:font-bold h1{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.\\[\\&_h1\\]\\:text-gray-800 h1{color:var(--color-gray-800)}.\\[\\&_h2\\]\\:mt-5 h2{margin-top:calc(var(--spacing)*5)}.\\[\\&_h2\\]\\:mb-3 h2{margin-bottom:calc(var(--spacing)*3)}.\\[\\&_h2\\]\\:text-2xl h2{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.\\[\\&_h2\\]\\:font-bold h2{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.\\[\\&_h2\\]\\:text-gray-800 h2{color:var(--color-gray-800)}.\\[\\&_h3\\]\\:mt-4 h3{margin-top:calc(var(--spacing)*4)}.\\[\\&_h3\\]\\:mb-2 h3{margin-bottom:calc(var(--spacing)*2)}.\\[\\&_h3\\]\\:text-xl h3{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.\\[\\&_h3\\]\\:font-bold h3{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.\\[\\&_h3\\]\\:text-gray-800 h3{color:var(--color-gray-800)}.\\[\\&_li\\]\\:mb-1 li{margin-bottom:calc(var(--spacing)*1)}.\\[\\&_ol\\]\\:mb-4 ol{margin-bottom:calc(var(--spacing)*4)}.\\[\\&_ol\\]\\:ml-4 ol{margin-left:calc(var(--spacing)*4)}.\\[\\&_ol\\]\\:list-inside ol{list-style-position:inside}.\\[\\&_ol\\]\\:list-decimal ol{list-style-type:decimal}:where(.\\[\\&_ol\\]\\:space-y-1 ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}.\\[\\&_p\\]\\:mb-4 p{margin-bottom:calc(var(--spacing)*4)}.\\[\\&_p\\]\\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\\[\\&_p\\]\\:text-gray-700 p{color:var(--color-gray-700)}.\\[\\&_pre\\]\\:my-4 pre{margin-block:calc(var(--spacing)*4)}.\\[\\&_pre\\]\\:overflow-x-auto pre{overflow-x:auto}.\\[\\&_pre\\]\\:rounded-lg pre{border-radius:var(--radius-lg)}.\\[\\&_pre\\]\\:bg-gray-800 pre{background-color:var(--color-gray-800)}.\\[\\&_pre\\]\\:p-4 pre{padding:calc(var(--spacing)*4)}.\\[\\&_pre\\]\\:text-gray-100 pre{color:var(--color-gray-100)}.\\[\\&_pre_code\\]\\:bg-transparent pre code{background-color:#0000}.\\[\\&_pre_code\\]\\:p-0 pre code{padding:calc(var(--spacing)*0)}.\\[\\&_pre_code\\]\\:text-inherit pre code{color:inherit}.\\[\\&_ul\\]\\:mb-4 ul{margin-bottom:calc(var(--spacing)*4)}.\\[\\&_ul\\]\\:ml-4 ul{margin-left:calc(var(--spacing)*4)}.\\[\\&_ul\\]\\:list-inside ul{list-style-position:inside}.\\[\\&_ul\\]\\:list-disc ul{list-style-type:disc}:where(.\\[\\&_ul\\]\\:space-y-1 ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@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-space-y-reverse{syntax:"*";inherits:false;initial-value:0}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(Pe);var re={exports:{}},X={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var
|
|
10
|
+
*/var Ne;function Ut(){if(Ne)return X;Ne=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,o,i){var a=null;if(i!==void 0&&(a=""+i),o.key!==void 0&&(a=""+o.key),"key"in o){i={};for(var c in o)c!=="key"&&(i[c]=o[c])}else i=o;return o=i.ref,{$$typeof:e,type:n,key:a,ref:o!==void 0?o:null,props:i}}return X.Fragment=t,X.jsx=r,X.jsxs=r,X}var K={};/**
|
|
11
11
|
* @license React
|
|
12
12
|
* react-jsx-runtime.development.js
|
|
13
13
|
*
|
|
@@ -15,15 +15,14 @@
|
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var Re;function Lt(){return Re||(Re=1,process.env.NODE_ENV!=="production"&&(function(){function e(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===
|
|
18
|
+
*/var Re;function Lt(){return Re||(Re=1,process.env.NODE_ENV!=="production"&&(function(){function e(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===na?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case I:return"Fragment";case O:return"Profiler";case M:return"StrictMode";case Z:return"Suspense";case q:return"SuspenseList";case ra:return"Activity"}if(typeof u=="object")switch(typeof u.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),u.$$typeof){case R:return"Portal";case A:return u.displayName||"Context";case P:return(u._context.displayName||"Context")+".Consumer";case U:var v=u.render;return u=u.displayName,u||(u=v.displayName||v.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case me:return v=u.displayName||null,v!==null?v:e(u.type)||"Memo";case L:v=u._payload,u=u._init;try{return e(u(v))}catch{}}return null}function t(u){return""+u}function r(u){try{t(u);var v=!1}catch{v=!0}if(v){v=console;var z=v.error,T=typeof Symbol=="function"&&Symbol.toStringTag&&u[Symbol.toStringTag]||u.constructor.name||"Object";return z.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",T),t(u)}}function n(u){if(u===I)return"<>";if(typeof u=="object"&&u!==null&&u.$$typeof===L)return"<...>";try{var v=e(u);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function o(){var u=Ae.A;return u===null?null:u.getOwner()}function i(){return Error("react-stack-top-frame")}function a(u){if(It.call(u,"key")){var v=Object.getOwnPropertyDescriptor(u,"key").get;if(v&&v.isReactWarning)return!1}return u.key!==void 0}function c(u,v){function z(){Ot||(Ot=!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)",v))}z.isReactWarning=!0,Object.defineProperty(u,"key",{get:z,configurable:!0})}function h(){var u=e(this.type);return Pt[u]||(Pt[u]=!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.")),u=this.props.ref,u!==void 0?u:null}function d(u,v,z,T,ge,Ie){var j=z.ref;return u={$$typeof:_,type:u,key:v,props:z,_owner:T},(j!==void 0?j:null)!==null?Object.defineProperty(u,"ref",{enumerable:!1,get:h}):Object.defineProperty(u,"ref",{enumerable:!1,value:null}),u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(u,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(u,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ge}),Object.defineProperty(u,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ie}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u}function p(u,v,z,T,ge,Ie){var j=v.children;if(j!==void 0)if(T)if(oa(j)){for(T=0;T<j.length;T++)b(j[T]);Object.freeze&&Object.freeze(j)}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 b(j);if(It.call(v,"key")){j=e(u);var H=Object.keys(v).filter(function(ia){return ia!=="key"});T=0<H.length?"{key: someKey, "+H.join(": ..., ")+": ...}":"{key: someKey}",Dt[j+T]||(H=0<H.length?"{"+H.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
19
19
|
let props = %s;
|
|
20
20
|
<%s {...props} />
|
|
21
21
|
React keys must be passed directly to JSX without using spread:
|
|
22
22
|
let props = %s;
|
|
23
|
-
<%s key={someKey} {...props} />`,T,j,X,j),Dt[j+T]=!0)}if(j=null,z!==void 0&&(n(z),j=""+z),a(v)&&(n(v.key),j=""+v.key),"key"in v){z={};for(var Oe in v)Oe!=="key"&&(z[Oe]=v[Oe])}else z=v;return j&&c(z,typeof u=="function"?u.displayName||u.name||"Unknown":u),d(u,j,z,o(),ge,Ie)}function b(u){g(u)?u._store&&(u._store.validated=1):typeof u=="object"&&u!==null&&u.$$typeof===L&&(u._payload.status==="fulfilled"?g(u._payload.value)&&u._payload.value._store&&(u._payload.value._store.validated=1):u._store&&(u._store.validated=1))}function g(u){return typeof u=="object"&&u!==null&&u.$$typeof===w}var l=k,w=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),A=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),me=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),na=Symbol.for("react.activity"),ra=Symbol.for("react.client.reference"),Ae=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,It=Object.prototype.hasOwnProperty,oa=Array.isArray,Se=console.createTask?console.createTask:function(){return null};l={react_stack_bottom_frame:function(u){return u()}};var Ot,Nt={},Pt=l.react_stack_bottom_frame.bind(l,i)(),Rt=Se(r(i)),Dt={};q.Fragment=I,q.jsx=function(u,v,z){var T=1e4>Ae.recentlyCreatedOwnerStacks++;return f(u,v,z,!1,T?Error("react-stack-top-frame"):Pt,T?Se(r(u)):Rt)},q.jsxs=function(u,v,z){var T=1e4>Ae.recentlyCreatedOwnerStacks++;return f(u,v,z,!0,T?Error("react-stack-top-frame"):Pt,T?Se(r(u)):Rt)}})()),q}var De;function Ft(){return De||(De=1,process.env.NODE_ENV==="production"?ne.exports=Ut():ne.exports=Lt()),ne.exports}var m=Ft();const Mt=({onCommand:e,onSave:t,onExport:n,onClear:r,showButtons:o=!1,hasUnsavedChanges:i})=>{const[a,c]=k.useState([]),[h,d]=k.useState("p"),f=()=>{const l=[];let w="p";document.queryCommandState("bold")&&l.push("bold"),document.queryCommandState("italic")&&l.push("italic"),document.queryCommandState("underline")&&l.push("underline"),document.queryCommandState("strikeThrough")&&l.push("strikeThrough"),document.queryCommandState("insertUnorderedList")&&l.push("insertUnorderedList"),document.queryCommandState("insertOrderedList")&&l.push("insertOrderedList"),document.queryCommandState("justifyLeft")&&l.push("justifyLeft"),document.queryCommandState("justifyCenter")&&l.push("justifyCenter"),document.queryCommandState("justifyRight")&&l.push("justifyRight");const R=window.getSelection();if(R&&R.rangeCount>0){let I=R.getRangeAt(0).commonAncestorContainer;for(;I&&I.nodeType===Node.ELEMENT_NODE;){const M=I,O=M.tagName.toLowerCase();if(["h1","h2","p","div"].includes(O)){O==="h1"||O==="h2"?(w=O,l.push(`formatBlock:${O}`)):(O==="p"||O==="div"&&!w)&&(w="p");break}I=M.parentNode}}d(w),c(l)};k.useEffect(()=>{const l=()=>{f()},w=()=>{setTimeout(f,10)};return document.addEventListener("selectionchange",l),document.addEventListener("click",w),document.addEventListener("keyup",w),()=>{document.removeEventListener("selectionchange",l),document.removeEventListener("click",w),document.removeEventListener("keyup",w)}},[]);const b=()=>{const l=prompt("Enter URL:");l&&e("createLink",l)},g=[{id:"bold",command:"bold",icon:m.jsx(C.Bold,{size:18}),title:"Bold"},{id:"italic",command:"italic",icon:m.jsx(C.Italic,{size:18}),title:"Italic"},{id:"underline",command:"underline",icon:m.jsx(C.Underline,{size:18}),title:"Underline"},{id:"strikeThrough",command:"strikeThrough",icon:m.jsx(C.Strikethrough,{size:18}),title:"Strikethrough"},{id:"separator-1",separator:!0},{id:"unordered-list",command:"insertUnorderedList",icon:m.jsx(C.List,{size:18}),title:"Bullet List"},{id:"ordered-list",command:"insertOrderedList",icon:m.jsx(C.ListOrdered,{size:18}),title:"Numbered List"},{id:"separator-2",separator:!0},{id:"heading-1",command:"formatBlock",value:"h1",icon:m.jsx(C.Heading1,{size:18}),title:"Heading 1",isActive:h==="h1"},{id:"heading-2",command:"formatBlock",value:"h2",icon:m.jsx(C.Heading2,{size:18}),title:"Heading 2",isActive:h==="h2"},{id:"paragraph",command:"formatBlock",value:"p",icon:m.jsx(C.Type,{size:18}),title:"Paragraph",isActive:h==="p"},{id:"separator-3",separator:!0},{id:"align-left",command:"justifyLeft",icon:m.jsx(C.AlignLeft,{size:18}),title:"Align Left"},{id:"align-center",command:"justifyCenter",icon:m.jsx(C.AlignCenter,{size:18}),title:"Center"},{id:"align-right",command:"justifyRight",icon:m.jsx(C.AlignRight,{size:18}),title:"Align Right"},{id:"separator-4",separator:!0},{id:"link",command:"createLink",icon:m.jsx(C.Link,{size:18}),title:"Insert Link",onClick:b}];return m.jsxs("div",{className:"flex flex-wrap justify-between items-center p-3 bg-gray-50 border-b border-gray-200",children:[m.jsx("div",{className:"flex flex-wrap items-center gap-1",children:g.map(l=>{if("separator"in l)return m.jsx("div",{className:"w-px h-6 bg-gray-300 mx-2"},l.id);const w=l.isActive!==void 0?l.isActive:a.includes(l.command);return m.jsx("button",{onClick:()=>l.onClick?l.onClick():e(l.command,l.value),title:l.title,type:"button",className:`w-9 h-9 flex items-center justify-center rounded-md border transition-colors duration-200
|
|
24
|
-
${w?"bg-blue-100 text-blue-600 border-blue-300 hover:bg-blue-200":"bg-white border-gray-300 text-gray-700 hover:bg-gray-100"}`,children:l.icon},l.id)})}),o&&m.jsxs("div",{className:"flex items-center gap-2 mt-2 sm:mt-0",children:[m.jsxs("button",{onClick:t,disabled:!i,title:"Save Document",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",children:[m.jsx(C.Save,{size:16}),m.jsx("span",{children:"Save"})]}),m.jsxs("button",{onClick:n,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",children:[m.jsx(C.FileDown,{size:16}),m.jsx("span",{children:"Export"})]}),m.jsxs("button",{onClick:r,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",children:[m.jsx(C.Trash2,{size:16}),m.jsx("span",{children:"Clear"})]})]})]})},Vt=({wordCount:e,characterCount:t,hasUnsavedChanges:n})=>m.jsx("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:m.jsxs("div",{className:"flex items-center gap-6",children:[m.jsxs("div",{children:["Words: ",m.jsx("strong",{className:"text-gray-800",children:e})]}),m.jsxs("div",{children:["Characters: ",m.jsx("strong",{className:"text-gray-800",children:t})]}),m.jsxs("div",{children:["Status: ",m.jsx("strong",{className:n?"text-orange-600":"text-green-600",children:n?"Unsaved Changes":"Saved"})]})]})});function s(e,t,n){function r(c,h){var d;Object.defineProperty(c,"_zod",{value:c._zod??{},enumerable:!1}),(d=c._zod).traits??(d.traits=new Set),c._zod.traits.add(e),t(c,h);for(const f in a.prototype)f in c||Object.defineProperty(c,f,{value:a.prototype[f].bind(c)});c._zod.constr=a,c._zod.def=h}const o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function a(c){var h;const d=n?.Parent?new i:this;r(d,c),(h=d._zod).deferred??(h.deferred=[]);for(const f of d._zod.deferred)f();return d}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class G extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ue extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Le={};function V(e){return Le}function Wt(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ve(e,t){return typeof t=="bigint"?t.toString():t}function be(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function we(e){return e==null}function _e(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Bt(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const h=r.match(/\d?e-(\d?)/);h?.[1]&&(o=Number.parseInt(h[1]))}const i=n>o?n:o,a=Number.parseInt(e.toFixed(i).replace(".","")),c=Number.parseInt(t.toFixed(i).replace(".",""));return a%c/10**i}const Fe=Symbol("evaluating");function _(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Fe)return r===void 0&&(r=Fe,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function W(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function B(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Me(e){return JSON.stringify(e)}const Ve="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function re(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Yt=be(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Q(e){if(re(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(re(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function We(e){return Q(e)?{...e}:Array.isArray(e)?[...e]:e}const Jt=new Set(["string","number","symbol"]);function oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function p(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Gt(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Ht={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Xt(e,t){const n=e._zod.def,r=B(e._zod.def,{get shape(){const o={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(o[i]=n.shape[i])}return W(this,"shape",o),o},checks:[]});return F(e,r)}function Kt(e,t){const n=e._zod.def,r=B(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete o[i]}return W(this,"shape",o),o},checks:[]});return F(e,r)}function qt(e,t){if(!Q(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const o=B(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return W(this,"shape",i),i},checks:[]});return F(e,o)}function Qt(e,t){if(!Q(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return W(this,"shape",r),r},checks:e._zod.def.checks};return F(e,n)}function en(e,t){const n=B(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return W(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return F(e,n)}function tn(e,t,n){const r=B(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(n)for(const a in n){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=e?new e({type:"optional",innerType:o[a]}):o[a])}else for(const a in o)i[a]=e?new e({type:"optional",innerType:o[a]}):o[a];return W(this,"shape",i),i},checks:[]});return F(t,r)}function nn(e,t,n){const r=B(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(n)for(const a in n){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(const a in o)i[a]=new e({type:"nonoptional",innerType:o[a]});return W(this,"shape",i),i},checks:[]});return F(t,r)}function H(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Be(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function ie(e){return typeof e=="string"?e:e?.message}function Y(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=ie(e.inst?._zod.def?.error?.(e))??ie(t?.error?.(e))??ie(n.customError?.(e))??ie(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ke(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ee(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Ye=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ve,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Je=s("$ZodError",Ye),Ge=s("$ZodError",Ye,{Parent:Error});function rn(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function on(e,t){const n=t||function(i){return i.message},r={_errors:[]},o=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>o({issues:c}));else if(a.code==="invalid_key")o({issues:a.issues});else if(a.code==="invalid_element")o({issues:a.issues});else if(a.path.length===0)r._errors.push(n(a));else{let c=r,h=0;for(;h<a.path.length;){const d=a.path[h];h===a.path.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(n(a))):c[d]=c[d]||{_errors:[]},c=c[d],h++}}};return o(e),r}const ye=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new G;if(a.issues.length){const c=new(o?.Err??e)(a.issues.map(h=>Y(h,i,V())));throw Ve(c,o?.callee),c}return a.value},xe=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const c=new(o?.Err??e)(a.issues.map(h=>Y(h,i,V())));throw Ve(c,o?.callee),c}return a.value},ae=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new G;return i.issues.length?{success:!1,error:new(e??Je)(i.issues.map(a=>Y(a,o,V())))}:{success:!0,data:i.value}},an=ae(Ge),ce=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>Y(a,o,V())))}:{success:!0,data:i.value}},cn=ce(Ge),sn=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ye(e)(t,n,o)},un=e=>(t,n,r)=>ye(e)(t,n,r),ln=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return xe(e)(t,n,o)},dn=e=>async(t,n,r)=>xe(e)(t,n,r),hn=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ae(e)(t,n,o)},fn=e=>(t,n,r)=>ae(e)(t,n,r),pn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ce(e)(t,n,o)},mn=e=>async(t,n,r)=>ce(e)(t,n,r),gn=/^[cC][^\s-]{8,}$/,vn=/^[0-9a-z]+$/,bn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wn=/^[0-9a-vA-V]{20}$/,_n=/^[A-Za-z0-9]{27}$/,kn=/^[a-zA-Z0-9_-]{21}$/,yn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,xn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,He=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,zn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,En="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Zn(){return new RegExp(En,"u")}const $n=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Tn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,jn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Cn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,An=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xe=/^[A-Za-z0-9_-]*$/,Sn=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,In=/^\+(?:[0-9]){6,14}[0-9]$/,Ke="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",On=new RegExp(`^${Ke}$`);function qe(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Nn(e){return new RegExp(`^${qe(e)}$`)}function Pn(e){const t=qe({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Ke}T(?:${r})$`)}const Rn=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Dn=/^-?\d+$/,Un=/^-?\d+(?:\.\d+)?/,Ln=/^(?:true|false)$/i,Fn=/^[^A-Z]*$/,Mn=/^[^a-z]*$/,S=s("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Qe={number:"number",bigint:"bigint",object:"date"},et=s("$ZodCheckLessThan",(e,t)=>{S.init(e,t);const n=Qe[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tt=s("$ZodCheckGreaterThan",(e,t)=>{S.init(e,t);const n=Qe[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Vn=s("$ZodCheckMultipleOf",(e,t)=>{S.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Bt(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Wn=s("$ZodCheckNumberFormat",(e,t)=>{S.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=Ht[t.format];e._zod.onattach.push(a=>{const c=a._zod.bag;c.format=t.format,c.minimum=o,c.maximum=i,n&&(c.pattern=Dn)}),e._zod.check=a=>{const c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}c<o&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>i&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inst:e})}}),Bn=s("$ZodCheckMaxLength",(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!we(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const a=ke(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Yn=s("$ZodCheckMinLength",(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!we(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const a=ke(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Jn=s("$ZodCheckLengthEquals",(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!we(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===t.length)return;const a=ke(o),c=i>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),se=s("$ZodCheckStringFormat",(e,t)=>{var n,r;S.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Gn=s("$ZodCheckRegex",(e,t)=>{se.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Hn=s("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Fn),se.init(e,t)}),Xn=s("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Mn),se.init(e,t)}),Kn=s("$ZodCheckIncludes",(e,t)=>{S.init(e,t);const n=oe(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),qn=s("$ZodCheckStartsWith",(e,t)=>{S.init(e,t);const n=new RegExp(`^${oe(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Qn=s("$ZodCheckEndsWith",(e,t)=>{S.init(e,t);const n=new RegExp(`.*${oe(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),er=s("$ZodCheckOverwrite",(e,t)=>{S.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class tr{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
25
|
-
`)
|
|
26
|
-
`))}}const nr={major:4,minor:1,patch:11},E=s("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=nr;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const i of o._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(a,c,h)=>{let d=H(a),f;for(const b of c){if(b._zod.def.when){if(!b._zod.def.when(a))continue}else if(d)continue;const g=a.issues.length,l=b._zod.check(a);if(l instanceof Promise&&h?.async===!1)throw new G;if(f||l instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await l,a.issues.length!==g&&(d||(d=H(a,g)))});else{if(a.issues.length===g)continue;d||(d=H(a,g))}}return f?f.then(()=>a):a},i=(a,c,h)=>{if(H(a))return a.aborted=!0,a;const d=o(c,r,h);if(d instanceof Promise){if(h.async===!1)throw new G;return d.then(f=>e._zod.parse(f,h))}return e._zod.parse(d,h)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){const d=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return d instanceof Promise?d.then(f=>i(f,a,c)):i(d,a,c)}const h=e._zod.parse(a,c);if(h instanceof Promise){if(c.async===!1)throw new G;return h.then(d=>o(d,r,c))}return o(h,r,c)}}e["~standard"]={validate:o=>{try{const i=an(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return cn(e,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),ze=s("$ZodString",(e,t)=>{E.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Rn(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),y=s("$ZodStringFormat",(e,t)=>{se.init(e,t),ze.init(e,t)}),rr=s("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=xn),y.init(e,t)}),or=s("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=He(r))}else t.pattern??(t.pattern=He());y.init(e,t)}),ir=s("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=zn),y.init(e,t)}),ar=s("$ZodURL",(e,t)=>{y.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Sn.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),cr=s("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Zn()),y.init(e,t)}),sr=s("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=kn),y.init(e,t)}),ur=s("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=gn),y.init(e,t)}),lr=s("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=vn),y.init(e,t)}),dr=s("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bn),y.init(e,t)}),hr=s("$ZodXID",(e,t)=>{t.pattern??(t.pattern=wn),y.init(e,t)}),fr=s("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=_n),y.init(e,t)}),pr=s("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Pn(t)),y.init(e,t)}),mr=s("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=On),y.init(e,t)}),gr=s("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Nn(t)),y.init(e,t)}),vr=s("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=yn),y.init(e,t)}),br=s("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=$n),y.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),wr=s("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Tn),y.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),_r=s("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=jn),y.init(e,t)}),kr=s("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Cn),y.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,i]=r;if(!i)throw new Error;const a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function nt(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const yr=s("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=An),y.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{nt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function xr(e){if(!Xe.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return nt(n)}const zr=s("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Xe),y.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{xr(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Er=s("$ZodE164",(e,t)=>{t.pattern??(t.pattern=In),y.init(e,t)});function Zr(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const $r=s("$ZodJWT",(e,t)=>{y.init(e,t),e._zod.check=n=>{Zr(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),rt=s("$ZodNumber",(e,t)=>{E.init(e,t),e._zod.pattern=e._zod.bag.pattern??Un,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),Tr=s("$ZodNumber",(e,t)=>{Wn.init(e,t),rt.init(e,t)}),jr=s("$ZodBoolean",(e,t)=>{E.init(e,t),e._zod.pattern=Ln,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Cr=s("$ZodUnknown",(e,t)=>{E.init(e,t),e._zod.parse=n=>n}),Ar=s("$ZodNever",(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function ot(e,t,n){e.issues.length&&t.issues.push(...Be(n,e.issues)),t.value[n]=e.value}const Sr=s("$ZodArray",(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let a=0;a<o.length;a++){const c=o[a],h=t.element._zod.run({value:c,issues:[]},r);h instanceof Promise?i.push(h.then(d=>ot(d,n,a))):ot(h,n,a)}return i.length?Promise.all(i).then(()=>n):n}});function ue(e,t,n,r){e.issues.length&&t.issues.push(...Be(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function it(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=Gt(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function at(e,t,n,r,o,i){const a=[],c=o.keySet,h=o.catchall._zod,d=h.def.type;for(const f of Object.keys(t)){if(c.has(f))continue;if(d==="never"){a.push(f);continue}const b=h.run({value:t[f],issues:[]},r);b instanceof Promise?e.push(b.then(g=>ue(g,n,f,t))):ue(b,n,f,t)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const Ir=s("$ZodObject",(e,t)=>{if(E.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...c};return Object.defineProperty(t,"shape",{value:h}),h}})}const r=be(()=>it(t));_(e._zod,"propValues",()=>{const c=t.shape,h={};for(const d in c){const f=c[d]._zod;if(f.values){h[d]??(h[d]=new Set);for(const b of f.values)h[d].add(b)}}return h});const o=re,i=t.catchall;let a;e._zod.parse=(c,h)=>{a??(a=r.value);const d=c.value;if(!o(d))return c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c;c.value={};const f=[],b=a.shape;for(const g of a.keys){const w=b[g]._zod.run({value:d[g],issues:[]},h);w instanceof Promise?f.push(w.then(R=>ue(R,c,g,d))):ue(w,c,g,d)}return i?at(f,d,c,h,r.value,e):f.length?Promise.all(f).then(()=>c):c}}),Or=s("$ZodObjectJIT",(e,t)=>{Ir.init(e,t);const n=e._zod.parse,r=be(()=>it(t)),o=g=>{const l=new tr(["shape","payload","ctx"]),w=r.value,R=N=>{const A=Me(N);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};l.write("const input = payload.value;");const I=Object.create(null);let M=0;for(const N of w.keys)I[N]=`key_${M++}`;l.write("const newResult = {};");for(const N of w.keys){const A=I[N],U=Me(N);l.write(`const ${A} = ${R(N)};`),l.write(`
|
|
23
|
+
<%s key={someKey} {...props} />`,T,j,H,j),Dt[j+T]=!0)}if(j=null,z!==void 0&&(r(z),j=""+z),a(v)&&(r(v.key),j=""+v.key),"key"in v){z={};for(var Oe in v)Oe!=="key"&&(z[Oe]=v[Oe])}else z=v;return j&&c(z,typeof u=="function"?u.displayName||u.name||"Unknown":u),d(u,j,z,o(),ge,Ie)}function b(u){g(u)?u._store&&(u._store.validated=1):typeof u=="object"&&u!==null&&u.$$typeof===L&&(u._payload.status==="fulfilled"?g(u._payload.value)&&u._payload.value._store&&(u._payload.value._store.validated=1):u._store&&(u._store.validated=1))}function g(u){return typeof u=="object"&&u!==null&&u.$$typeof===_}var l=k,_=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),A=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),me=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),ra=Symbol.for("react.activity"),na=Symbol.for("react.client.reference"),Ae=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,It=Object.prototype.hasOwnProperty,oa=Array.isArray,Se=console.createTask?console.createTask:function(){return null};l={react_stack_bottom_frame:function(u){return u()}};var Ot,Pt={},Nt=l.react_stack_bottom_frame.bind(l,i)(),Rt=Se(n(i)),Dt={};K.Fragment=I,K.jsx=function(u,v,z){var T=1e4>Ae.recentlyCreatedOwnerStacks++;return p(u,v,z,!1,T?Error("react-stack-top-frame"):Nt,T?Se(n(u)):Rt)},K.jsxs=function(u,v,z){var T=1e4>Ae.recentlyCreatedOwnerStacks++;return p(u,v,z,!0,T?Error("react-stack-top-frame"):Nt,T?Se(n(u)):Rt)}})()),K}var De;function Ft(){return De||(De=1,process.env.NODE_ENV==="production"?re.exports=Ut():re.exports=Lt()),re.exports}var m=Ft();const Mt=({onCommand:e,onSave:t,onExport:r,onClear:n,showButtons:o=!1,hasUnsavedChanges:i})=>{const[a,c]=k.useState([]),[h,d]=k.useState("p"),p=()=>{const l=[];let _="p";document.queryCommandState("bold")&&l.push("bold"),document.queryCommandState("italic")&&l.push("italic"),document.queryCommandState("underline")&&l.push("underline"),document.queryCommandState("strikeThrough")&&l.push("strikeThrough"),document.queryCommandState("insertUnorderedList")&&l.push("insertUnorderedList"),document.queryCommandState("insertOrderedList")&&l.push("insertOrderedList"),document.queryCommandState("justifyLeft")&&l.push("justifyLeft"),document.queryCommandState("justifyCenter")&&l.push("justifyCenter"),document.queryCommandState("justifyRight")&&l.push("justifyRight");const R=window.getSelection();if(R&&R.rangeCount>0){let I=R.getRangeAt(0).commonAncestorContainer;for(;I&&I.nodeType===Node.ELEMENT_NODE;){const M=I,O=M.tagName.toLowerCase();if(["h1","h2","p","div"].includes(O)){O==="h1"||O==="h2"?(_=O,l.push(`formatBlock:${O}`)):(O==="p"||O==="div"&&!_)&&(_="p");break}I=M.parentNode}}d(_),c(l)};k.useEffect(()=>{const l=()=>{p()},_=()=>{setTimeout(p,10)};return document.addEventListener("selectionchange",l),document.addEventListener("click",_),document.addEventListener("keyup",_),()=>{document.removeEventListener("selectionchange",l),document.removeEventListener("click",_),document.removeEventListener("keyup",_)}},[]);const b=()=>{const l=prompt("Enter URL:");l&&e("createLink",l)},g=[{id:"bold",command:"bold",icon:m.jsx(C.Bold,{size:18}),title:"Bold"},{id:"italic",command:"italic",icon:m.jsx(C.Italic,{size:18}),title:"Italic"},{id:"underline",command:"underline",icon:m.jsx(C.Underline,{size:18}),title:"Underline"},{id:"strikeThrough",command:"strikeThrough",icon:m.jsx(C.Strikethrough,{size:18}),title:"Strikethrough"},{id:"separator-1",separator:!0},{id:"unordered-list",command:"insertUnorderedList",icon:m.jsx(C.List,{size:18}),title:"Bullet List"},{id:"ordered-list",command:"insertOrderedList",icon:m.jsx(C.ListOrdered,{size:18}),title:"Numbered List"},{id:"separator-2",separator:!0},{id:"heading-1",command:"formatBlock",value:"h1",icon:m.jsx(C.Heading1,{size:18}),title:"Heading 1",isActive:h==="h1"},{id:"heading-2",command:"formatBlock",value:"h2",icon:m.jsx(C.Heading2,{size:18}),title:"Heading 2",isActive:h==="h2"},{id:"paragraph",command:"formatBlock",value:"p",icon:m.jsx(C.Type,{size:18}),title:"Paragraph",isActive:h==="p"},{id:"separator-3",separator:!0},{id:"align-left",command:"justifyLeft",icon:m.jsx(C.AlignLeft,{size:18}),title:"Align Left"},{id:"align-center",command:"justifyCenter",icon:m.jsx(C.AlignCenter,{size:18}),title:"Center"},{id:"align-right",command:"justifyRight",icon:m.jsx(C.AlignRight,{size:18}),title:"Align Right"},{id:"separator-4",separator:!0},{id:"link",command:"createLink",icon:m.jsx(C.Link,{size:18}),title:"Insert Link",onClick:b}];return m.jsxs("div",{className:"flex flex-wrap justify-between items-center p-3 bg-gray-50 border-b border-gray-200",children:[m.jsx("div",{className:"flex flex-wrap items-center gap-1",children:g.map(l=>{if("separator"in l)return m.jsx("div",{className:"w-px h-6 bg-gray-300 mx-2"},l.id);const _=l.isActive!==void 0?l.isActive:a.includes(l.command);return m.jsx("button",{onClick:()=>l.onClick?l.onClick():e(l.command,l.value),title:l.title,type:"button",className:`w-9 h-9 flex items-center justify-center rounded-md border transition-colors duration-200 ${_?"bg-blue-100 text-blue-600 border-blue-300 hover:bg-blue-200":"bg-white border-gray-300 text-gray-700 hover:bg-gray-100"}`,children:l.icon},l.id)})}),o&&m.jsxs("div",{className:"flex items-center gap-2 mt-2 sm:mt-0",children:[m.jsxs("button",{onClick:t,disabled:!i,title:"Save Document",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",children:[m.jsx(C.Save,{size:16}),m.jsx("span",{children:"Save"})]}),m.jsxs("button",{onClick:r,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",children:[m.jsx(C.FileDown,{size:16}),m.jsx("span",{children:"Export"})]}),m.jsxs("button",{onClick:n,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",children:[m.jsx(C.Trash2,{size:16}),m.jsx("span",{children:"Clear"})]})]})]})},Vt=({wordCount:e,characterCount:t,hasUnsavedChanges:r})=>m.jsx("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:m.jsxs("div",{className:"flex items-center gap-6",children:[m.jsxs("div",{children:["Words: ",m.jsx("strong",{className:"text-gray-800",children:e})]}),m.jsxs("div",{children:["Characters: ",m.jsx("strong",{className:"text-gray-800",children:t})]}),m.jsxs("div",{children:["Status: ",m.jsx("strong",{className:r?"text-orange-600":"text-green-600",children:r?"Unsaved Changes":"Saved"})]})]})});function s(e,t,r){function n(c,h){var d;Object.defineProperty(c,"_zod",{value:c._zod??{},enumerable:!1}),(d=c._zod).traits??(d.traits=new Set),c._zod.traits.add(e),t(c,h);for(const p in a.prototype)p in c||Object.defineProperty(c,p,{value:a.prototype[p].bind(c)});c._zod.constr=a,c._zod.def=h}const o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function a(c){var h;const d=r?.Parent?new i:this;n(d,c),(h=d._zod).deferred??(h.deferred=[]);for(const p of d._zod.deferred)p();return d}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>r?.Parent&&c instanceof r.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class J extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ue extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Le={};function V(e){return Le}function Wt(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function ve(e,t){return typeof t=="bigint"?t.toString():t}function be(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function _e(e){return e==null}function we(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Bt(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let o=(n.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(n)){const h=n.match(/\d?e-(\d?)/);h?.[1]&&(o=Number.parseInt(h[1]))}const i=r>o?r:o,a=Number.parseInt(e.toFixed(i).replace(".","")),c=Number.parseInt(t.toFixed(i).replace(".",""));return a%c/10**i}const Fe=Symbol("evaluating");function w(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Fe)return n===void 0&&(n=Fe,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function W(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function B(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Me(e){return JSON.stringify(e)}const Ve="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ne(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Yt=be(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Q(e){if(ne(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(ne(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function We(e){return Q(e)?{...e}:Array.isArray(e)?[...e]:e}const qt=new Set(["string","number","symbol"]);function oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function f(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Jt(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Gt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ht(e,t){const r=e._zod.def,n=B(e._zod.def,{get shape(){const o={};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(o[i]=r.shape[i])}return W(this,"shape",o),o},checks:[]});return F(e,n)}function Xt(e,t){const r=e._zod.def,n=B(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete o[i]}return W(this,"shape",o),o},checks:[]});return F(e,n)}function Kt(e,t){if(!Q(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const o=B(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return W(this,"shape",i),i},checks:[]});return F(e,o)}function Qt(e,t){if(!Q(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return W(this,"shape",n),n},checks:e._zod.def.checks};return F(e,r)}function er(e,t){const r=B(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return W(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return F(e,r)}function tr(e,t,r){const n=B(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(r)for(const a in r){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=e?new e({type:"optional",innerType:o[a]}):o[a])}else for(const a in o)i[a]=e?new e({type:"optional",innerType:o[a]}):o[a];return W(this,"shape",i),i},checks:[]});return F(t,n)}function rr(e,t,r){const n=B(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(r)for(const a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(const a in o)i[a]=new e({type:"nonoptional",innerType:o[a]});return W(this,"shape",i),i},checks:[]});return F(t,n)}function G(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Be(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ie(e){return typeof e=="string"?e:e?.message}function Y(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const o=ie(e.inst?._zod.def?.error?.(e))??ie(t?.error?.(e))??ie(r.customError?.(e))??ie(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function ke(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ee(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const Ye=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ve,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},qe=s("$ZodError",Ye),Je=s("$ZodError",Ye,{Parent:Error});function nr(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function or(e,t){const r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>o({issues:c}));else if(a.code==="invalid_key")o({issues:a.issues});else if(a.code==="invalid_element")o({issues:a.issues});else if(a.path.length===0)n._errors.push(r(a));else{let c=n,h=0;for(;h<a.path.length;){const d=a.path[h];h===a.path.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(r(a))):c[d]=c[d]||{_errors:[]},c=c[d],h++}}};return o(e),n}const ye=e=>(t,r,n,o)=>{const i=n?Object.assign(n,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new J;if(a.issues.length){const c=new(o?.Err??e)(a.issues.map(h=>Y(h,i,V())));throw Ve(c,o?.callee),c}return a.value},xe=e=>async(t,r,n,o)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const c=new(o?.Err??e)(a.issues.map(h=>Y(h,i,V())));throw Ve(c,o?.callee),c}return a.value},ae=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new J;return i.issues.length?{success:!1,error:new(e??qe)(i.issues.map(a=>Y(a,o,V())))}:{success:!0,data:i.value}},ir=ae(Je),ce=e=>async(t,r,n)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>Y(a,o,V())))}:{success:!0,data:i.value}},ar=ce(Je),cr=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ye(e)(t,r,o)},sr=e=>(t,r,n)=>ye(e)(t,r,n),ur=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return xe(e)(t,r,o)},lr=e=>async(t,r,n)=>xe(e)(t,r,n),dr=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ae(e)(t,r,o)},hr=e=>(t,r,n)=>ae(e)(t,r,n),pr=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ce(e)(t,r,o)},fr=e=>async(t,r,n)=>ce(e)(t,r,n),mr=/^[cC][^\s-]{8,}$/,gr=/^[0-9a-z]+$/,vr=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,br=/^[0-9a-vA-V]{20}$/,_r=/^[A-Za-z0-9]{27}$/,wr=/^[a-zA-Z0-9_-]{21}$/,kr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yr=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ge=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,xr=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,zr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Er(){return new RegExp(zr,"u")}const Zr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,$r=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Tr=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,jr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Cr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,He=/^[A-Za-z0-9_-]*$/,Ar=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Sr=/^\+(?:[0-9]){6,14}[0-9]$/,Xe="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Ir=new RegExp(`^${Xe}$`);function Ke(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Or(e){return new RegExp(`^${Ke(e)}$`)}function Pr(e){const t=Ke({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Xe}T(?:${n})$`)}const Nr=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Rr=/^-?\d+$/,Dr=/^-?\d+(?:\.\d+)?/,Ur=/^(?:true|false)$/i,Lr=/^[^A-Z]*$/,Fr=/^[^a-z]*$/,S=s("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Qe={number:"number",bigint:"bigint",object:"date"},et=s("$ZodCheckLessThan",(e,t)=>{S.init(e,t);const r=Qe[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tt=s("$ZodCheckGreaterThan",(e,t)=>{S.init(e,t);const r=Qe[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Mr=s("$ZodCheckMultipleOf",(e,t)=>{S.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Bt(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Vr=s("$ZodCheckNumberFormat",(e,t)=>{S.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Gt[t.format];e._zod.onattach.push(a=>{const c=a._zod.bag;c.format=t.format,c.minimum=o,c.maximum=i,r&&(c.pattern=Rr)}),e._zod.check=a=>{const c=a.value;if(r){if(!Number.isInteger(c)){a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}c<o&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>i&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inst:e})}}),Wr=s("$ZodCheckMaxLength",(e,t)=>{var r;S.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!_e(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const o=n.value;if(o.length<=t.maximum)return;const a=ke(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Br=s("$ZodCheckMinLength",(e,t)=>{var r;S.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!_e(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const a=ke(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Yr=s("$ZodCheckLengthEquals",(e,t)=>{var r;S.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!_e(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{const o=n.value,i=o.length;if(i===t.length)return;const a=ke(o),c=i>t.length;n.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),se=s("$ZodCheckStringFormat",(e,t)=>{var r,n;S.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),qr=s("$ZodCheckRegex",(e,t)=>{se.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Jr=s("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Lr),se.init(e,t)}),Gr=s("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Fr),se.init(e,t)}),Hr=s("$ZodCheckIncludes",(e,t)=>{S.init(e,t);const r=oe(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Xr=s("$ZodCheckStartsWith",(e,t)=>{S.init(e,t);const r=new RegExp(`^${oe(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Kr=s("$ZodCheckEndsWith",(e,t)=>{S.init(e,t);const r=new RegExp(`.*${oe(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Qr=s("$ZodCheckOverwrite",(e,t)=>{S.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class en{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
|
|
24
|
+
`).filter(a=>a),o=Math.min(...n.map(a=>a.length-a.trimStart().length)),i=n.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(const a of i)this.content.push(a)}compile(){const t=Function,r=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,o.join(`
|
|
25
|
+
`))}}const tn={major:4,minor:1,patch:11},E=s("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tn;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const o of n)for(const i of o._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(a,c,h)=>{let d=G(a),p;for(const b of c){if(b._zod.def.when){if(!b._zod.def.when(a))continue}else if(d)continue;const g=a.issues.length,l=b._zod.check(a);if(l instanceof Promise&&h?.async===!1)throw new J;if(p||l instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await l,a.issues.length!==g&&(d||(d=G(a,g)))});else{if(a.issues.length===g)continue;d||(d=G(a,g))}}return p?p.then(()=>a):a},i=(a,c,h)=>{if(G(a))return a.aborted=!0,a;const d=o(c,n,h);if(d instanceof Promise){if(h.async===!1)throw new J;return d.then(p=>e._zod.parse(p,h))}return e._zod.parse(d,h)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){const d=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return d instanceof Promise?d.then(p=>i(p,a,c)):i(d,a,c)}const h=e._zod.parse(a,c);if(h instanceof Promise){if(c.async===!1)throw new J;return h.then(d=>o(d,n,c))}return o(h,n,c)}}e["~standard"]={validate:o=>{try{const i=ir(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return ar(e,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),ze=s("$ZodString",(e,t)=>{E.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Nr(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),y=s("$ZodStringFormat",(e,t)=>{se.init(e,t),ze.init(e,t)}),rn=s("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=yr),y.init(e,t)}),nn=s("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ge(n))}else t.pattern??(t.pattern=Ge());y.init(e,t)}),on=s("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=xr),y.init(e,t)}),an=s("$ZodURL",(e,t)=>{y.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Ar.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),cn=s("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Er()),y.init(e,t)}),sn=s("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=wr),y.init(e,t)}),un=s("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=mr),y.init(e,t)}),ln=s("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=gr),y.init(e,t)}),dn=s("$ZodULID",(e,t)=>{t.pattern??(t.pattern=vr),y.init(e,t)}),hn=s("$ZodXID",(e,t)=>{t.pattern??(t.pattern=br),y.init(e,t)}),pn=s("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=_r),y.init(e,t)}),fn=s("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Pr(t)),y.init(e,t)}),mn=s("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ir),y.init(e,t)}),gn=s("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Or(t)),y.init(e,t)}),vn=s("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=kr),y.init(e,t)}),bn=s("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Zr),y.init(e,t),e._zod.onattach.push(r=>{const n=r._zod.bag;n.format="ipv4"})}),_n=s("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=$r),y.init(e,t),e._zod.onattach.push(r=>{const n=r._zod.bag;n.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),wn=s("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Tr),y.init(e,t)}),kn=s("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=jr),y.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[o,i]=n;if(!i)throw new Error;const a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function rt(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const yn=s("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Cr),y.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{rt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function xn(e){if(!He.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return rt(r)}const zn=s("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=He),y.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{xn(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),En=s("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Sr),y.init(e,t)});function Zn(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const $n=s("$ZodJWT",(e,t)=>{y.init(e,t),e._zod.check=r=>{Zn(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),nt=s("$ZodNumber",(e,t)=>{E.init(e,t),e._zod.pattern=e._zod.bag.pattern??Dr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),Tn=s("$ZodNumber",(e,t)=>{Vr.init(e,t),nt.init(e,t)}),jn=s("$ZodBoolean",(e,t)=>{E.init(e,t),e._zod.pattern=Ur,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}const o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Cn=s("$ZodUnknown",(e,t)=>{E.init(e,t),e._zod.parse=r=>r}),An=s("$ZodNever",(e,t)=>{E.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function ot(e,t,r){e.issues.length&&t.issues.push(...Be(r,e.issues)),t.value[r]=e.value}const Sn=s("$ZodArray",(e,t)=>{E.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const i=[];for(let a=0;a<o.length;a++){const c=o[a],h=t.element._zod.run({value:c,issues:[]},n);h instanceof Promise?i.push(h.then(d=>ot(d,r,a))):ot(h,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function ue(e,t,r,n){e.issues.length&&t.issues.push(...Be(r,e.issues)),e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function it(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const r=Jt(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function at(e,t,r,n,o,i){const a=[],c=o.keySet,h=o.catchall._zod,d=h.def.type;for(const p of Object.keys(t)){if(c.has(p))continue;if(d==="never"){a.push(p);continue}const b=h.run({value:t[p],issues:[]},n);b instanceof Promise?e.push(b.then(g=>ue(g,r,p,t))):ue(b,r,p,t)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}const In=s("$ZodObject",(e,t)=>{if(E.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...c};return Object.defineProperty(t,"shape",{value:h}),h}})}const n=be(()=>it(t));w(e._zod,"propValues",()=>{const c=t.shape,h={};for(const d in c){const p=c[d]._zod;if(p.values){h[d]??(h[d]=new Set);for(const b of p.values)h[d].add(b)}}return h});const o=ne,i=t.catchall;let a;e._zod.parse=(c,h)=>{a??(a=n.value);const d=c.value;if(!o(d))return c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c;c.value={};const p=[],b=a.shape;for(const g of a.keys){const _=b[g]._zod.run({value:d[g],issues:[]},h);_ instanceof Promise?p.push(_.then(R=>ue(R,c,g,d))):ue(_,c,g,d)}return i?at(p,d,c,h,n.value,e):p.length?Promise.all(p).then(()=>c):c}}),On=s("$ZodObjectJIT",(e,t)=>{In.init(e,t);const r=e._zod.parse,n=be(()=>it(t)),o=g=>{const l=new en(["shape","payload","ctx"]),_=n.value,R=P=>{const A=Me(P);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};l.write("const input = payload.value;");const I=Object.create(null);let M=0;for(const P of _.keys)I[P]=`key_${M++}`;l.write("const newResult = {};");for(const P of _.keys){const A=I[P],U=Me(P);l.write(`const ${A} = ${R(P)};`),l.write(`
|
|
27
26
|
if (${A}.issues.length) {
|
|
28
27
|
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
|
29
28
|
...iss,
|
|
@@ -40,12 +39,12 @@ React keys must be passed directly to JSX without using spread:
|
|
|
40
39
|
newResult[${U}] = ${A}.value;
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
`)}l.write("payload.value = newResult;"),l.write("return payload;");const O=l.compile();return(N,A)=>O(g,N,A)};let i;const a=re,c=!Le.jitless,d=c&&Yt.value,f=t.catchall;let b;e._zod.parse=(g,l)=>{b??(b=r.value);const w=g.value;return a(w)?c&&d&&l?.async===!1&&l.jitless!==!0?(i||(i=o(t.shape)),g=i(g,l),f?at([],w,g,l,b,e):g):n(g,l):(g.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),g)}});function ct(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!H(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(a=>Y(a,r,V())))}),t)}const Nr=s("$ZodUnion",(e,t)=>{E.init(e,t),_(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),_(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),_(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),_(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>_e(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let a=!1;const c=[];for(const h of t.options){const d=h._zod.run({value:o.value,issues:[]},i);if(d instanceof Promise)c.push(d),a=!0;else{if(d.issues.length===0)return d;c.push(d)}}return a?Promise.all(c).then(h=>ct(h,o,e,i)):ct(c,o,e,i)}}),Pr=s("$ZodIntersection",(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),a=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([h,d])=>st(n,h,d)):st(n,i,a)}});function Ee(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Q(e)&&Q(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};for(const i of r){const a=Ee(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};o[i]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=t[r],a=Ee(o,i);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function st(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),H(e))return e;const r=Ee(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const Rr=s("$ZodEnum",(e,t)=>{E.init(e,t);const n=Wt(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>Jt.has(typeof o)).map(o=>typeof o=="string"?oe(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const a=o.value;return r.has(a)||o.issues.push({code:"invalid_value",values:n,input:a,inst:e}),o}}),Dr=s("$ZodTransform",(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Ue(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(n.value=a,n));if(o instanceof Promise)throw new G;return n.value=o,n}});function ut(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Ur=s("$ZodOptional",(e,t)=>{E.init(e,t),e._zod.optin="optional",e._zod.optout="optional",_(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),_(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${_e(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>ut(i,n.value)):ut(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Lr=s("$ZodNullable",(e,t)=>{E.init(e,t),_(e._zod,"optin",()=>t.innerType._zod.optin),_(e._zod,"optout",()=>t.innerType._zod.optout),_(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${_e(n.source)}|null)$`):void 0}),_(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Fr=s("$ZodDefault",(e,t)=>{E.init(e,t),e._zod.optin="optional",_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>lt(i,t)):lt(o,t)}});function lt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Mr=s("$ZodPrefault",(e,t)=>{E.init(e,t),e._zod.optin="optional",_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Vr=s("$ZodNonOptional",(e,t)=>{E.init(e,t),_(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>dt(i,e)):dt(o,e)}});function dt(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Wr=s("$ZodCatch",(e,t)=>{E.init(e,t),_(e._zod,"optin",()=>t.innerType._zod.optin),_(e._zod,"optout",()=>t.innerType._zod.optout),_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>Y(a,r,V()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>Y(i,r,V()))},input:n.value}),n.issues=[]),n)}}),Br=s("$ZodPipe",(e,t)=>{E.init(e,t),_(e._zod,"values",()=>t.in._zod.values),_(e._zod,"optin",()=>t.in._zod.optin),_(e._zod,"optout",()=>t.out._zod.optout),_(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(a=>le(a,t.in,r)):le(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>le(i,t.out,r)):le(o,t.out,r)}});function le(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Yr=s("$ZodReadonly",(e,t)=>{E.init(e,t),_(e._zod,"propValues",()=>t.innerType._zod.propValues),_(e._zod,"values",()=>t.innerType._zod.values),_(e._zod,"optin",()=>t.innerType._zod.optin),_(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(ht):ht(o)}});function ht(e){return e.value=Object.freeze(e.value),e}const Jr=s("$ZodCustom",(e,t)=>{S.init(e,t),E.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>ft(i,n,r,e));ft(o,n,r,e)}});function ft(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(ee(o))}}class Gr{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Hr(){return new Gr}const de=Hr();function Xr(e,t){return new e({type:"string",...p(t)})}function Kr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...p(t)})}function pt(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...p(t)})}function qr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...p(t)})}function Qr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...p(t)})}function eo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...p(t)})}function to(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...p(t)})}function no(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...p(t)})}function ro(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...p(t)})}function oo(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...p(t)})}function io(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...p(t)})}function ao(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...p(t)})}function co(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...p(t)})}function so(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...p(t)})}function uo(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...p(t)})}function lo(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...p(t)})}function ho(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...p(t)})}function fo(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...p(t)})}function po(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...p(t)})}function mo(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...p(t)})}function go(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...p(t)})}function vo(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...p(t)})}function bo(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...p(t)})}function wo(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...p(t)})}function _o(e,t){return new e({type:"string",format:"date",check:"string_format",...p(t)})}function ko(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...p(t)})}function yo(e,t){return new e({type:"string",format:"duration",check:"string_format",...p(t)})}function xo(e,t){return new e({type:"number",checks:[],...p(t)})}function zo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...p(t)})}function Eo(e,t){return new e({type:"boolean",...p(t)})}function Zo(e){return new e({type:"unknown"})}function $o(e,t){return new e({type:"never",...p(t)})}function mt(e,t){return new et({check:"less_than",...p(t),value:e,inclusive:!1})}function Ze(e,t){return new et({check:"less_than",...p(t),value:e,inclusive:!0})}function gt(e,t){return new tt({check:"greater_than",...p(t),value:e,inclusive:!1})}function $e(e,t){return new tt({check:"greater_than",...p(t),value:e,inclusive:!0})}function vt(e,t){return new Vn({check:"multiple_of",...p(t),value:e})}function bt(e,t){return new Bn({check:"max_length",...p(t),maximum:e})}function he(e,t){return new Yn({check:"min_length",...p(t),minimum:e})}function wt(e,t){return new Jn({check:"length_equals",...p(t),length:e})}function To(e,t){return new Gn({check:"string_format",format:"regex",...p(t),pattern:e})}function jo(e){return new Hn({check:"string_format",format:"lowercase",...p(e)})}function Co(e){return new Xn({check:"string_format",format:"uppercase",...p(e)})}function Ao(e,t){return new Kn({check:"string_format",format:"includes",...p(t),includes:e})}function So(e,t){return new qn({check:"string_format",format:"starts_with",...p(t),prefix:e})}function Io(e,t){return new Qn({check:"string_format",format:"ends_with",...p(t),suffix:e})}function te(e){return new er({check:"overwrite",tx:e})}function Oo(e){return te(t=>t.normalize(e))}function No(){return te(e=>e.trim())}function Po(){return te(e=>e.toLowerCase())}function Ro(){return te(e=>e.toUpperCase())}function Do(e,t,n){return new e({type:"array",element:t,...p(n)})}function Uo(e,t,n){return new e({type:"custom",check:"custom",fn:t,...p(n)})}function Lo(e){const t=Fo(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(ee(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(ee(o))}},e(n.value,n)));return t}function Fo(e,t){const n=new S({check:"custom",...p(t)});return n._zod.check=e,n}const Mo=s("ZodISODateTime",(e,t)=>{pr.init(e,t),x.init(e,t)});function Vo(e){return wo(Mo,e)}const Wo=s("ZodISODate",(e,t)=>{mr.init(e,t),x.init(e,t)});function Bo(e){return _o(Wo,e)}const Yo=s("ZodISOTime",(e,t)=>{gr.init(e,t),x.init(e,t)});function Jo(e){return ko(Yo,e)}const Go=s("ZodISODuration",(e,t)=>{vr.init(e,t),x.init(e,t)});function Ho(e){return yo(Go,e)}const P=s("ZodError",(e,t)=>{Je.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>on(e,n)},flatten:{value:n=>rn(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,ve,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,ve,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Xo=ye(P),Ko=xe(P),qo=ae(P),Qo=ce(P),ei=sn(P),ti=un(P),ni=ln(P),ri=dn(P),oi=hn(P),ii=fn(P),ai=pn(P),ci=mn(P),$=s("ZodType",(e,t)=>(E.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(B(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]})),e.clone=(n,r)=>F(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>Xo(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>qo(e,n,r),e.parseAsync=async(n,r)=>Ko(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Qo(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>ei(e,n,r),e.decode=(n,r)=>ti(e,n,r),e.encodeAsync=async(n,r)=>ni(e,n,r),e.decodeAsync=async(n,r)=>ri(e,n,r),e.safeEncode=(n,r)=>oi(e,n,r),e.safeDecode=(n,r)=>ii(e,n,r),e.safeEncodeAsync=async(n,r)=>ai(e,n,r),e.safeDecodeAsync=async(n,r)=>ci(e,n,r),e.refine=(n,r)=>e.check(qi(n,r)),e.superRefine=n=>e.check(Qi(n)),e.overwrite=n=>e.check(te(n)),e.optional=()=>Tt(e),e.nullable=()=>jt(e),e.nullish=()=>Tt(jt(e)),e.nonoptional=n=>Bi(e,n),e.array=()=>Si(e),e.or=n=>Ni([e,n]),e.and=n=>Ri(e,n),e.transform=n=>At(e,Ui(n)),e.default=n=>Mi(e,n),e.prefault=n=>Wi(e,n),e.catch=n=>Ji(e,n),e.pipe=n=>At(e,n),e.readonly=()=>Xi(e),e.describe=n=>{const r=e.clone();return de.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return de.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return de.get(e);const r=e.clone();return de.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),_t=s("_ZodString",(e,t)=>{ze.init(e,t),$.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(To(...r)),e.includes=(...r)=>e.check(Ao(...r)),e.startsWith=(...r)=>e.check(So(...r)),e.endsWith=(...r)=>e.check(Io(...r)),e.min=(...r)=>e.check(he(...r)),e.max=(...r)=>e.check(bt(...r)),e.length=(...r)=>e.check(wt(...r)),e.nonempty=(...r)=>e.check(he(1,...r)),e.lowercase=r=>e.check(jo(r)),e.uppercase=r=>e.check(Co(r)),e.trim=()=>e.check(No()),e.normalize=(...r)=>e.check(Oo(...r)),e.toLowerCase=()=>e.check(Po()),e.toUpperCase=()=>e.check(Ro())}),si=s("ZodString",(e,t)=>{ze.init(e,t),_t.init(e,t),e.email=n=>e.check(Kr(ui,n)),e.url=n=>e.check(no(li,n)),e.jwt=n=>e.check(bo(Ei,n)),e.emoji=n=>e.check(ro(di,n)),e.guid=n=>e.check(pt(kt,n)),e.uuid=n=>e.check(qr(pe,n)),e.uuidv4=n=>e.check(Qr(pe,n)),e.uuidv6=n=>e.check(eo(pe,n)),e.uuidv7=n=>e.check(to(pe,n)),e.nanoid=n=>e.check(oo(hi,n)),e.guid=n=>e.check(pt(kt,n)),e.cuid=n=>e.check(io(fi,n)),e.cuid2=n=>e.check(ao(pi,n)),e.ulid=n=>e.check(co(mi,n)),e.base64=n=>e.check(mo(yi,n)),e.base64url=n=>e.check(go(xi,n)),e.xid=n=>e.check(so(gi,n)),e.ksuid=n=>e.check(uo(vi,n)),e.ipv4=n=>e.check(lo(bi,n)),e.ipv6=n=>e.check(ho(wi,n)),e.cidrv4=n=>e.check(fo(_i,n)),e.cidrv6=n=>e.check(po(ki,n)),e.e164=n=>e.check(vo(zi,n)),e.datetime=n=>e.check(Vo(n)),e.date=n=>e.check(Bo(n)),e.time=n=>e.check(Jo(n)),e.duration=n=>e.check(Ho(n))});function fe(e){return Xr(si,e)}const x=s("ZodStringFormat",(e,t)=>{y.init(e,t),_t.init(e,t)}),ui=s("ZodEmail",(e,t)=>{ir.init(e,t),x.init(e,t)}),kt=s("ZodGUID",(e,t)=>{rr.init(e,t),x.init(e,t)}),pe=s("ZodUUID",(e,t)=>{or.init(e,t),x.init(e,t)}),li=s("ZodURL",(e,t)=>{ar.init(e,t),x.init(e,t)}),di=s("ZodEmoji",(e,t)=>{cr.init(e,t),x.init(e,t)}),hi=s("ZodNanoID",(e,t)=>{sr.init(e,t),x.init(e,t)}),fi=s("ZodCUID",(e,t)=>{ur.init(e,t),x.init(e,t)}),pi=s("ZodCUID2",(e,t)=>{lr.init(e,t),x.init(e,t)}),mi=s("ZodULID",(e,t)=>{dr.init(e,t),x.init(e,t)}),gi=s("ZodXID",(e,t)=>{hr.init(e,t),x.init(e,t)}),vi=s("ZodKSUID",(e,t)=>{fr.init(e,t),x.init(e,t)}),bi=s("ZodIPv4",(e,t)=>{br.init(e,t),x.init(e,t)}),wi=s("ZodIPv6",(e,t)=>{wr.init(e,t),x.init(e,t)}),_i=s("ZodCIDRv4",(e,t)=>{_r.init(e,t),x.init(e,t)}),ki=s("ZodCIDRv6",(e,t)=>{kr.init(e,t),x.init(e,t)}),yi=s("ZodBase64",(e,t)=>{yr.init(e,t),x.init(e,t)}),xi=s("ZodBase64URL",(e,t)=>{zr.init(e,t),x.init(e,t)}),zi=s("ZodE164",(e,t)=>{Er.init(e,t),x.init(e,t)}),Ei=s("ZodJWT",(e,t)=>{$r.init(e,t),x.init(e,t)}),yt=s("ZodNumber",(e,t)=>{rt.init(e,t),$.init(e,t),e.gt=(r,o)=>e.check(gt(r,o)),e.gte=(r,o)=>e.check($e(r,o)),e.min=(r,o)=>e.check($e(r,o)),e.lt=(r,o)=>e.check(mt(r,o)),e.lte=(r,o)=>e.check(Ze(r,o)),e.max=(r,o)=>e.check(Ze(r,o)),e.int=r=>e.check(zt(r)),e.safe=r=>e.check(zt(r)),e.positive=r=>e.check(gt(0,r)),e.nonnegative=r=>e.check($e(0,r)),e.negative=r=>e.check(mt(0,r)),e.nonpositive=r=>e.check(Ze(0,r)),e.multipleOf=(r,o)=>e.check(vt(r,o)),e.step=(r,o)=>e.check(vt(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function xt(e){return xo(yt,e)}const Zi=s("ZodNumberFormat",(e,t)=>{Tr.init(e,t),yt.init(e,t)});function zt(e){return zo(Zi,e)}const $i=s("ZodBoolean",(e,t)=>{jr.init(e,t),$.init(e,t)});function Et(e){return Eo($i,e)}const Ti=s("ZodUnknown",(e,t)=>{Cr.init(e,t),$.init(e,t)});function Zt(){return Zo(Ti)}const ji=s("ZodNever",(e,t)=>{Ar.init(e,t),$.init(e,t)});function Ci(e){return $o(ji,e)}const Ai=s("ZodArray",(e,t)=>{Sr.init(e,t),$.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(he(n,r)),e.nonempty=n=>e.check(he(1,n)),e.max=(n,r)=>e.check(bt(n,r)),e.length=(n,r)=>e.check(wt(n,r)),e.unwrap=()=>e.element});function Si(e,t){return Do(Ai,e,t)}const Ii=s("ZodObject",(e,t)=>{Or.init(e,t),$.init(e,t),_(e,"shape",()=>t.shape),e.keyof=()=>Ce(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Zt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Zt()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ci()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>qt(e,n),e.safeExtend=n=>Qt(e,n),e.merge=n=>en(e,n),e.pick=n=>Xt(e,n),e.omit=n=>Kt(e,n),e.partial=(...n)=>tn($t,e,n[0]),e.required=(...n)=>nn(Ct,e,n[0])});function Te(e,t){const n={type:"object",shape:e??{},...p(t)};return new Ii(n)}const Oi=s("ZodUnion",(e,t)=>{Nr.init(e,t),$.init(e,t),e.options=t.options});function Ni(e,t){return new Oi({type:"union",options:e,...p(t)})}const Pi=s("ZodIntersection",(e,t)=>{Pr.init(e,t),$.init(e,t)});function Ri(e,t){return new Pi({type:"intersection",left:e,right:t})}const je=s("ZodEnum",(e,t)=>{Rr.init(e,t),$.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const a of r)if(n.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new je({...t,checks:[],...p(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const a of r)if(n.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new je({...t,checks:[],...p(o),entries:i})}});function Ce(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new je({type:"enum",entries:n,...p(t)})}const Di=s("ZodTransform",(e,t)=>{Dr.init(e,t),$.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Ue(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(ee(i,n.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(ee(a))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function Ui(e){return new Di({type:"transform",transform:e})}const $t=s("ZodOptional",(e,t)=>{Ur.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Tt(e){return new $t({type:"optional",innerType:e})}const Li=s("ZodNullable",(e,t)=>{Lr.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType});function jt(e){return new Li({type:"nullable",innerType:e})}const Fi=s("ZodDefault",(e,t)=>{Fr.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Mi(e,t){return new Fi({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():We(t)}})}const Vi=s("ZodPrefault",(e,t)=>{Mr.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Wi(e,t){return new Vi({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():We(t)}})}const Ct=s("ZodNonOptional",(e,t)=>{Vr.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Bi(e,t){return new Ct({type:"nonoptional",innerType:e,...p(t)})}const Yi=s("ZodCatch",(e,t)=>{Wr.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ji(e,t){return new Yi({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Gi=s("ZodPipe",(e,t)=>{Br.init(e,t),$.init(e,t),e.in=t.in,e.out=t.out});function At(e,t){return new Gi({type:"pipe",in:e,out:t})}const Hi=s("ZodReadonly",(e,t)=>{Yr.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Xi(e){return new Hi({type:"readonly",innerType:e})}const Ki=s("ZodCustom",(e,t)=>{Jr.init(e,t),$.init(e,t)});function qi(e,t={}){return Uo(Ki,e,t)}function Qi(e){return Lo(e)}const ea=Te({title:fe().min(1,"Title is required").max(200,"Title too long"),content:fe().min(1,"Content is required"),format:Ce(["html","markdown"]).default("html"),metadata:Te({createdAt:fe().datetime(),updatedAt:fe().datetime(),wordCount:xt().min(0),characterCount:xt().min(0)}).optional()});Te({includeStyles:Et().default(!0),includeMeta:Et().default(!0),format:Ce(["html","txt"]).default("html")});const St=(e="")=>{const[t,n]=k.useState({content:e,title:"Untitled Document",wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length,hasUnsavedChanges:!1}),r=k.useRef(null);k.useEffect(()=>{r.current&&e!==t.content&&(r.current.innerHTML=e,n(f=>({...f,content:e,wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length})))},[e]);const o=k.useCallback(f=>{const b=f.trim()?f.trim().split(/\s+/).length:0,g=f.length;n(l=>({...l,content:f,wordCount:b,characterCount:g,hasUnsavedChanges:!0}))},[]),i=k.useCallback(f=>{n(b=>({...b,title:f,hasUnsavedChanges:!0}))},[]),a=k.useCallback((f,b)=>{document.execCommand(f,!1,b),r.current?.focus()},[]),c=k.useCallback(()=>{try{return{success:!0,data:ea.parse({title:t.title,content:t.content,metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),wordCount:t.wordCount,characterCount:t.characterCount}})}}catch(f){return{success:!1,error:f instanceof Error?f.message:"Validation failed"}}},[t]),h=k.useCallback((f={includeStyles:!0,includeMeta:!0})=>{const b=c();if(!b.success)throw new Error(b.error);const{data:g}=b;let l=`<!DOCTYPE html>
|
|
42
|
+
`)}l.write("payload.value = newResult;"),l.write("return payload;");const O=l.compile();return(P,A)=>O(g,P,A)};let i;const a=ne,c=!Le.jitless,d=c&&Yt.value,p=t.catchall;let b;e._zod.parse=(g,l)=>{b??(b=n.value);const _=g.value;return a(_)?c&&d&&l?.async===!1&&l.jitless!==!0?(i||(i=o(t.shape)),g=i(g,l),p?at([],_,g,l,b,e):g):r(g,l):(g.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),g)}});function ct(e,t,r,n){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!G(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>Y(a,n,V())))}),t)}const Pn=s("$ZodUnion",(e,t)=>{E.init(e,t),w(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),w(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),w(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),w(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>we(i.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(r)return n(o,i);let a=!1;const c=[];for(const h of t.options){const d=h._zod.run({value:o.value,issues:[]},i);if(d instanceof Promise)c.push(d),a=!0;else{if(d.issues.length===0)return d;c.push(d)}}return a?Promise.all(c).then(h=>ct(h,o,e,i)):ct(c,o,e,i)}}),Nn=s("$ZodIntersection",(e,t)=>{E.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,i=t.left._zod.run({value:o,issues:[]},n),a=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([h,d])=>st(r,h,d)):st(r,i,a)}});function Ee(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Q(e)&&Q(t)){const r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};for(const i of n){const a=Ee(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};o[i]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],i=t[n],a=Ee(o,i);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function st(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),G(e))return e;const n=Ee(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const Rn=s("$ZodEnum",(e,t)=>{E.init(e,t);const r=Wt(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>qt.has(typeof o)).map(o=>typeof o=="string"?oe(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const a=o.value;return n.has(a)||o.issues.push({code:"invalid_value",values:r,input:a,inst:e}),o}}),Dn=s("$ZodTransform",(e,t)=>{E.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ue(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(r.value=a,r));if(o instanceof Promise)throw new J;return r.value=o,r}});function ut(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Un=s("$ZodOptional",(e,t)=>{E.init(e,t),e._zod.optin="optional",e._zod.optout="optional",w(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),w(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${we(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>ut(i,r.value)):ut(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),Ln=s("$ZodNullable",(e,t)=>{E.init(e,t),w(e._zod,"optin",()=>t.innerType._zod.optin),w(e._zod,"optout",()=>t.innerType._zod.optout),w(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${we(r.source)}|null)$`):void 0}),w(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),Fn=s("$ZodDefault",(e,t)=>{E.init(e,t),e._zod.optin="optional",w(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>lt(i,t)):lt(o,t)}});function lt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Mn=s("$ZodPrefault",(e,t)=>{E.init(e,t),e._zod.optin="optional",w(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Vn=s("$ZodNonOptional",(e,t)=>{E.init(e,t),w(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>dt(i,e)):dt(o,e)}});function dt(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Wn=s("$ZodCatch",(e,t)=>{E.init(e,t),w(e._zod,"optin",()=>t.innerType._zod.optin),w(e._zod,"optout",()=>t.innerType._zod.optout),w(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>Y(a,n,V()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>Y(i,n,V()))},input:r.value}),r.issues=[]),r)}}),Bn=s("$ZodPipe",(e,t)=>{E.init(e,t),w(e._zod,"values",()=>t.in._zod.values),w(e._zod,"optin",()=>t.in._zod.optin),w(e._zod,"optout",()=>t.out._zod.optout),w(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const i=t.out._zod.run(r,n);return i instanceof Promise?i.then(a=>le(a,t.in,n)):le(i,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>le(i,t.out,n)):le(o,t.out,n)}});function le(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const Yn=s("$ZodReadonly",(e,t)=>{E.init(e,t),w(e._zod,"propValues",()=>t.innerType._zod.propValues),w(e._zod,"values",()=>t.innerType._zod.values),w(e._zod,"optin",()=>t.innerType._zod.optin),w(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(ht):ht(o)}});function ht(e){return e.value=Object.freeze(e.value),e}const qn=s("$ZodCustom",(e,t)=>{S.init(e,t),E.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>pt(i,r,n,e));pt(o,r,n,e)}});function pt(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(ee(o))}}class Jn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Gn(){return new Jn}const de=Gn();function Hn(e,t){return new e({type:"string",...f(t)})}function Xn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...f(t)})}function ft(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...f(t)})}function Kn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...f(t)})}function Qn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...f(t)})}function eo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...f(t)})}function to(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...f(t)})}function ro(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...f(t)})}function no(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...f(t)})}function oo(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...f(t)})}function io(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...f(t)})}function ao(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...f(t)})}function co(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...f(t)})}function so(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...f(t)})}function uo(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...f(t)})}function lo(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...f(t)})}function ho(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...f(t)})}function po(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...f(t)})}function fo(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...f(t)})}function mo(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...f(t)})}function go(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...f(t)})}function vo(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...f(t)})}function bo(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...f(t)})}function _o(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...f(t)})}function wo(e,t){return new e({type:"string",format:"date",check:"string_format",...f(t)})}function ko(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...f(t)})}function yo(e,t){return new e({type:"string",format:"duration",check:"string_format",...f(t)})}function xo(e,t){return new e({type:"number",checks:[],...f(t)})}function zo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...f(t)})}function Eo(e,t){return new e({type:"boolean",...f(t)})}function Zo(e){return new e({type:"unknown"})}function $o(e,t){return new e({type:"never",...f(t)})}function mt(e,t){return new et({check:"less_than",...f(t),value:e,inclusive:!1})}function Ze(e,t){return new et({check:"less_than",...f(t),value:e,inclusive:!0})}function gt(e,t){return new tt({check:"greater_than",...f(t),value:e,inclusive:!1})}function $e(e,t){return new tt({check:"greater_than",...f(t),value:e,inclusive:!0})}function vt(e,t){return new Mr({check:"multiple_of",...f(t),value:e})}function bt(e,t){return new Wr({check:"max_length",...f(t),maximum:e})}function he(e,t){return new Br({check:"min_length",...f(t),minimum:e})}function _t(e,t){return new Yr({check:"length_equals",...f(t),length:e})}function To(e,t){return new qr({check:"string_format",format:"regex",...f(t),pattern:e})}function jo(e){return new Jr({check:"string_format",format:"lowercase",...f(e)})}function Co(e){return new Gr({check:"string_format",format:"uppercase",...f(e)})}function Ao(e,t){return new Hr({check:"string_format",format:"includes",...f(t),includes:e})}function So(e,t){return new Xr({check:"string_format",format:"starts_with",...f(t),prefix:e})}function Io(e,t){return new Kr({check:"string_format",format:"ends_with",...f(t),suffix:e})}function te(e){return new Qr({check:"overwrite",tx:e})}function Oo(e){return te(t=>t.normalize(e))}function Po(){return te(e=>e.trim())}function No(){return te(e=>e.toLowerCase())}function Ro(){return te(e=>e.toUpperCase())}function Do(e,t,r){return new e({type:"array",element:t,...f(r)})}function Uo(e,t,r){return new e({type:"custom",check:"custom",fn:t,...f(r)})}function Lo(e){const t=Fo(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(ee(n,r.value,t._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(ee(o))}},e(r.value,r)));return t}function Fo(e,t){const r=new S({check:"custom",...f(t)});return r._zod.check=e,r}const Mo=s("ZodISODateTime",(e,t)=>{fn.init(e,t),x.init(e,t)});function Vo(e){return _o(Mo,e)}const Wo=s("ZodISODate",(e,t)=>{mn.init(e,t),x.init(e,t)});function Bo(e){return wo(Wo,e)}const Yo=s("ZodISOTime",(e,t)=>{gn.init(e,t),x.init(e,t)});function qo(e){return ko(Yo,e)}const Jo=s("ZodISODuration",(e,t)=>{vn.init(e,t),x.init(e,t)});function Go(e){return yo(Jo,e)}const N=s("ZodError",(e,t)=>{qe.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>or(e,r)},flatten:{value:r=>nr(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,ve,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,ve,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ho=ye(N),Xo=xe(N),Ko=ae(N),Qo=ce(N),ei=cr(N),ti=sr(N),ri=ur(N),ni=lr(N),oi=dr(N),ii=hr(N),ai=pr(N),ci=fr(N),$=s("ZodType",(e,t)=>(E.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(B(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(r,n)=>F(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>Ho(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Ko(e,r,n),e.parseAsync=async(r,n)=>Xo(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Qo(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>ei(e,r,n),e.decode=(r,n)=>ti(e,r,n),e.encodeAsync=async(r,n)=>ri(e,r,n),e.decodeAsync=async(r,n)=>ni(e,r,n),e.safeEncode=(r,n)=>oi(e,r,n),e.safeDecode=(r,n)=>ii(e,r,n),e.safeEncodeAsync=async(r,n)=>ai(e,r,n),e.safeDecodeAsync=async(r,n)=>ci(e,r,n),e.refine=(r,n)=>e.check(Ki(r,n)),e.superRefine=r=>e.check(Qi(r)),e.overwrite=r=>e.check(te(r)),e.optional=()=>Tt(e),e.nullable=()=>jt(e),e.nullish=()=>Tt(jt(e)),e.nonoptional=r=>Bi(e,r),e.array=()=>Si(e),e.or=r=>Pi([e,r]),e.and=r=>Ri(e,r),e.transform=r=>At(e,Ui(r)),e.default=r=>Mi(e,r),e.prefault=r=>Wi(e,r),e.catch=r=>qi(e,r),e.pipe=r=>At(e,r),e.readonly=()=>Hi(e),e.describe=r=>{const n=e.clone();return de.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return de.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return de.get(e);const n=e.clone();return de.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),wt=s("_ZodString",(e,t)=>{ze.init(e,t),$.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(To(...n)),e.includes=(...n)=>e.check(Ao(...n)),e.startsWith=(...n)=>e.check(So(...n)),e.endsWith=(...n)=>e.check(Io(...n)),e.min=(...n)=>e.check(he(...n)),e.max=(...n)=>e.check(bt(...n)),e.length=(...n)=>e.check(_t(...n)),e.nonempty=(...n)=>e.check(he(1,...n)),e.lowercase=n=>e.check(jo(n)),e.uppercase=n=>e.check(Co(n)),e.trim=()=>e.check(Po()),e.normalize=(...n)=>e.check(Oo(...n)),e.toLowerCase=()=>e.check(No()),e.toUpperCase=()=>e.check(Ro())}),si=s("ZodString",(e,t)=>{ze.init(e,t),wt.init(e,t),e.email=r=>e.check(Xn(ui,r)),e.url=r=>e.check(ro(li,r)),e.jwt=r=>e.check(bo(Ei,r)),e.emoji=r=>e.check(no(di,r)),e.guid=r=>e.check(ft(kt,r)),e.uuid=r=>e.check(Kn(fe,r)),e.uuidv4=r=>e.check(Qn(fe,r)),e.uuidv6=r=>e.check(eo(fe,r)),e.uuidv7=r=>e.check(to(fe,r)),e.nanoid=r=>e.check(oo(hi,r)),e.guid=r=>e.check(ft(kt,r)),e.cuid=r=>e.check(io(pi,r)),e.cuid2=r=>e.check(ao(fi,r)),e.ulid=r=>e.check(co(mi,r)),e.base64=r=>e.check(mo(yi,r)),e.base64url=r=>e.check(go(xi,r)),e.xid=r=>e.check(so(gi,r)),e.ksuid=r=>e.check(uo(vi,r)),e.ipv4=r=>e.check(lo(bi,r)),e.ipv6=r=>e.check(ho(_i,r)),e.cidrv4=r=>e.check(po(wi,r)),e.cidrv6=r=>e.check(fo(ki,r)),e.e164=r=>e.check(vo(zi,r)),e.datetime=r=>e.check(Vo(r)),e.date=r=>e.check(Bo(r)),e.time=r=>e.check(qo(r)),e.duration=r=>e.check(Go(r))});function pe(e){return Hn(si,e)}const x=s("ZodStringFormat",(e,t)=>{y.init(e,t),wt.init(e,t)}),ui=s("ZodEmail",(e,t)=>{on.init(e,t),x.init(e,t)}),kt=s("ZodGUID",(e,t)=>{rn.init(e,t),x.init(e,t)}),fe=s("ZodUUID",(e,t)=>{nn.init(e,t),x.init(e,t)}),li=s("ZodURL",(e,t)=>{an.init(e,t),x.init(e,t)}),di=s("ZodEmoji",(e,t)=>{cn.init(e,t),x.init(e,t)}),hi=s("ZodNanoID",(e,t)=>{sn.init(e,t),x.init(e,t)}),pi=s("ZodCUID",(e,t)=>{un.init(e,t),x.init(e,t)}),fi=s("ZodCUID2",(e,t)=>{ln.init(e,t),x.init(e,t)}),mi=s("ZodULID",(e,t)=>{dn.init(e,t),x.init(e,t)}),gi=s("ZodXID",(e,t)=>{hn.init(e,t),x.init(e,t)}),vi=s("ZodKSUID",(e,t)=>{pn.init(e,t),x.init(e,t)}),bi=s("ZodIPv4",(e,t)=>{bn.init(e,t),x.init(e,t)}),_i=s("ZodIPv6",(e,t)=>{_n.init(e,t),x.init(e,t)}),wi=s("ZodCIDRv4",(e,t)=>{wn.init(e,t),x.init(e,t)}),ki=s("ZodCIDRv6",(e,t)=>{kn.init(e,t),x.init(e,t)}),yi=s("ZodBase64",(e,t)=>{yn.init(e,t),x.init(e,t)}),xi=s("ZodBase64URL",(e,t)=>{zn.init(e,t),x.init(e,t)}),zi=s("ZodE164",(e,t)=>{En.init(e,t),x.init(e,t)}),Ei=s("ZodJWT",(e,t)=>{$n.init(e,t),x.init(e,t)}),yt=s("ZodNumber",(e,t)=>{nt.init(e,t),$.init(e,t),e.gt=(n,o)=>e.check(gt(n,o)),e.gte=(n,o)=>e.check($e(n,o)),e.min=(n,o)=>e.check($e(n,o)),e.lt=(n,o)=>e.check(mt(n,o)),e.lte=(n,o)=>e.check(Ze(n,o)),e.max=(n,o)=>e.check(Ze(n,o)),e.int=n=>e.check(zt(n)),e.safe=n=>e.check(zt(n)),e.positive=n=>e.check(gt(0,n)),e.nonnegative=n=>e.check($e(0,n)),e.negative=n=>e.check(mt(0,n)),e.nonpositive=n=>e.check(Ze(0,n)),e.multipleOf=(n,o)=>e.check(vt(n,o)),e.step=(n,o)=>e.check(vt(n,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function xt(e){return xo(yt,e)}const Zi=s("ZodNumberFormat",(e,t)=>{Tn.init(e,t),yt.init(e,t)});function zt(e){return zo(Zi,e)}const $i=s("ZodBoolean",(e,t)=>{jn.init(e,t),$.init(e,t)});function Et(e){return Eo($i,e)}const Ti=s("ZodUnknown",(e,t)=>{Cn.init(e,t),$.init(e,t)});function Zt(){return Zo(Ti)}const ji=s("ZodNever",(e,t)=>{An.init(e,t),$.init(e,t)});function Ci(e){return $o(ji,e)}const Ai=s("ZodArray",(e,t)=>{Sn.init(e,t),$.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(he(r,n)),e.nonempty=r=>e.check(he(1,r)),e.max=(r,n)=>e.check(bt(r,n)),e.length=(r,n)=>e.check(_t(r,n)),e.unwrap=()=>e.element});function Si(e,t){return Do(Ai,e,t)}const Ii=s("ZodObject",(e,t)=>{On.init(e,t),$.init(e,t),w(e,"shape",()=>t.shape),e.keyof=()=>Ce(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Zt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Zt()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ci()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Kt(e,r),e.safeExtend=r=>Qt(e,r),e.merge=r=>er(e,r),e.pick=r=>Ht(e,r),e.omit=r=>Xt(e,r),e.partial=(...r)=>tr($t,e,r[0]),e.required=(...r)=>rr(Ct,e,r[0])});function Te(e,t){const r={type:"object",shape:e??{},...f(t)};return new Ii(r)}const Oi=s("ZodUnion",(e,t)=>{Pn.init(e,t),$.init(e,t),e.options=t.options});function Pi(e,t){return new Oi({type:"union",options:e,...f(t)})}const Ni=s("ZodIntersection",(e,t)=>{Nn.init(e,t),$.init(e,t)});function Ri(e,t){return new Ni({type:"intersection",left:e,right:t})}const je=s("ZodEnum",(e,t)=>{Rn.init(e,t),$.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const i={};for(const a of n)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new je({...t,checks:[],...f(o),entries:i})},e.exclude=(n,o)=>{const i={...t.entries};for(const a of n)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new je({...t,checks:[],...f(o),entries:i})}});function Ce(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new je({type:"enum",entries:r,...f(t)})}const Di=s("ZodTransform",(e,t)=>{Dn.init(e,t),$.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ue(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(ee(i,r.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(ee(a))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function Ui(e){return new Di({type:"transform",transform:e})}const $t=s("ZodOptional",(e,t)=>{Un.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Tt(e){return new $t({type:"optional",innerType:e})}const Li=s("ZodNullable",(e,t)=>{Ln.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType});function jt(e){return new Li({type:"nullable",innerType:e})}const Fi=s("ZodDefault",(e,t)=>{Fn.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Mi(e,t){return new Fi({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():We(t)}})}const Vi=s("ZodPrefault",(e,t)=>{Mn.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Wi(e,t){return new Vi({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():We(t)}})}const Ct=s("ZodNonOptional",(e,t)=>{Vn.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Bi(e,t){return new Ct({type:"nonoptional",innerType:e,...f(t)})}const Yi=s("ZodCatch",(e,t)=>{Wn.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function qi(e,t){return new Yi({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ji=s("ZodPipe",(e,t)=>{Bn.init(e,t),$.init(e,t),e.in=t.in,e.out=t.out});function At(e,t){return new Ji({type:"pipe",in:e,out:t})}const Gi=s("ZodReadonly",(e,t)=>{Yn.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Hi(e){return new Gi({type:"readonly",innerType:e})}const Xi=s("ZodCustom",(e,t)=>{qn.init(e,t),$.init(e,t)});function Ki(e,t={}){return Uo(Xi,e,t)}function Qi(e){return Lo(e)}const ea=Te({title:pe().min(1,"Title is required").max(200,"Title too long"),content:pe().min(1,"Content is required"),format:Ce(["html","markdown"]).default("html"),metadata:Te({createdAt:pe().datetime(),updatedAt:pe().datetime(),wordCount:xt().min(0),characterCount:xt().min(0)}).optional()});Te({includeStyles:Et().default(!0),includeMeta:Et().default(!0),format:Ce(["html","txt"]).default("html")});const St=(e="")=>{const[t,r]=k.useState({content:e,title:"Untitled Document",wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length,hasUnsavedChanges:!1}),n=k.useRef(null);k.useEffect(()=>{n.current&&e!==t.content&&(n.current.innerHTML=e,r(p=>({...p,content:e,wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length})))},[e]);const o=k.useCallback(p=>{const b=p.trim()?p.trim().split(/\s+/).length:0,g=p.length;r(l=>({...l,content:p,wordCount:b,characterCount:g,hasUnsavedChanges:!0}))},[]),i=k.useCallback(p=>{r(b=>({...b,title:p,hasUnsavedChanges:!0}))},[]),a=k.useCallback((p,b)=>{document.execCommand(p,!1,b),n.current?.focus()},[]),c=k.useCallback(()=>{try{return{success:!0,data:ea.parse({title:t.title,content:t.content,metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),wordCount:t.wordCount,characterCount:t.characterCount}})}}catch(p){return{success:!1,error:p instanceof Error?p.message:"Validation failed"}}},[t]),h=k.useCallback((p={includeStyles:!0,includeMeta:!0})=>{const b=c();if(!b.success)throw new Error(b.error);const{data:g}=b;let l=`<!DOCTYPE html>
|
|
44
43
|
<html>
|
|
45
44
|
<head>
|
|
46
45
|
<meta charset="UTF-8">
|
|
47
46
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
48
|
-
<title>${g?.title}</title>`;return
|
|
47
|
+
<title>${g?.title}</title>`;return p.includeStyles&&(l+=`
|
|
49
48
|
<style>
|
|
50
49
|
body {
|
|
51
50
|
font-family: Arial, sans-serif;
|
|
@@ -61,7 +60,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
61
60
|
}
|
|
62
61
|
</style>`),l+=`
|
|
63
62
|
</head>
|
|
64
|
-
<body>`,
|
|
63
|
+
<body>`,p.includeMeta&&(l+=`
|
|
65
64
|
<div class="document-meta">
|
|
66
65
|
<h1>${g?.title}</h1>
|
|
67
66
|
<p><small>Created: ${new Date(g?.metadata.createdAt??"").toLocaleString()} |
|
|
@@ -73,4 +72,22 @@ React keys must be passed directly to JSX without using spread:
|
|
|
73
72
|
${g?.content}
|
|
74
73
|
</div>
|
|
75
74
|
</body>
|
|
76
|
-
</html>`,l},[c]),d=k.useCallback(()=>{
|
|
75
|
+
</html>`,l},[c]),d=k.useCallback(()=>{r({content:"",title:"Untitled Document",wordCount:0,characterCount:0,hasUnsavedChanges:!1}),n.current&&(n.current.innerHTML="")},[]);return{editorState:t,editorRef:n,updateContent:o,updateTitle:i,executeCommand:a,getValidationResult:c,exportToHTML:h,clearEditor:d}},ta=({initialContent:e="",onSave:t,onExport:r,onChange:n,showButtons:o=!1,showSaveTitle:i=!1,showStatusBar:a=!1})=>{const{editorState:c,editorRef:h,updateContent:d,updateTitle:p,executeCommand:b,getValidationResult:g,exportToHTML:l,clearEditor:_}=St(e),[R,I]=k.useState(!1);k.useEffect(()=>{if(n)try{const Z=l({includeStyles:!1,includeMeta:!1});n(c.content,Z,c.title)}catch{const q=`<!DOCTYPE html><html><body>${c.content}</body></html>`;n(c.content,q,c.title)}},[c.content,c.title,n,l]);const M=k.useCallback(()=>{if(g().success){const q=l();t?.(c.content,q)}else I(!0),setTimeout(()=>I(!1),3e3)},[c.content,g,l,t]),O=k.useCallback(()=>{try{const Z=l();r?.(Z);const q=new Blob([Z],{type:"text/html"}),me=URL.createObjectURL(q),L=document.createElement("a");L.href=me,L.download=`${c.title.replace(/\s+/g,"_")||"document"}.html`,document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(me)}catch(Z){alert("Export failed: "+(Z instanceof Error?Z.message:"Unknown error"))}},[l,c.title,r]),P=k.useCallback(()=>{confirm("Are you sure you want to clear the editor? All unsaved changes will be lost.")&&_()},[_]),A=k.useCallback(Z=>{d(Z)},[d]),U=k.useCallback(Z=>{p(Z)},[p]);return m.jsxs("div",{className:"w-full max-w-6xl mx-auto bg-white rounded-xl shadow-lg overflow-hidden",children:[i&&m.jsxs("div",{className:"p-6 border-b border-gray-200 bg-gray-50",children:[m.jsx("input",{type:"text",className:"w-full bg-transparent text-2xl font-bold text-gray-800 outline-none placeholder-gray-400",value:c.title,onChange:Z=>U(Z.target.value),placeholder:"Document Title"}),R&&m.jsx("div",{className:"text-red-600 text-sm mt-2 animate-fadeIn",children:"Please add content before saving"})]}),m.jsx(Mt,{onCommand:b,onSave:M,onExport:O,showButtons:o,onClear:P,hasUnsavedChanges:c.hasUnsavedChanges}),m.jsx("div",{ref:h,className:`min-h-[500px] p-8 border-none outline-none resize-none text-gray-700 leading-relaxed prose max-w-none\r
|
|
76
|
+
/* Heading styles */\r
|
|
77
|
+
[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:mt-6 [&_h1]:mb-4 [&_h1]:text-gray-800 [&_h1]:border-b [&_h1]:pb-2\r
|
|
78
|
+
[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:mt-5 [&_h2]:mb-3 [&_h2]:text-gray-800\r
|
|
79
|
+
[&_h3]:text-xl [&_h3]:font-bold [&_h3]:mt-4 [&_h3]:mb-2 [&_h3]:text-gray-800\r
|
|
80
|
+
/* Paragraph styles */\r
|
|
81
|
+
[&_p]:mb-4 [&_p]:text-gray-700 [&_p]:leading-relaxed\r
|
|
82
|
+
/* List styles */\r
|
|
83
|
+
[&_ul]:list-disc [&_ul]:list-inside [&_ul]:mb-4 [&_ul]:ml-4 [&_ul]:space-y-1\r
|
|
84
|
+
[&_ol]:list-decimal [&_ol]:list-inside [&_ol]:mb-4 [&_ol]:ml-4 [&_ol]:space-y-1\r
|
|
85
|
+
[&_li]:mb-1\r
|
|
86
|
+
/* Link styles */\r
|
|
87
|
+
[&_a]:text-blue-600 [&_a]:hover:text-blue-800 [&_a]:underline [&_a]:transition-colors\r
|
|
88
|
+
/* Blockquote styles */\r
|
|
89
|
+
[&_blockquote]:border-l-4 [&_blockquote]:border-blue-500 [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:text-gray-600 [&_blockquote]:my-4\r
|
|
90
|
+
/* Code styles */\r
|
|
91
|
+
[&_code]:bg-gray-100 [&_code]:px-2 [&_code]:py-1 [&_code]:rounded [&_code]:text-sm [&_code]:font-mono\r
|
|
92
|
+
[&_pre]:bg-gray-800 [&_pre]:text-gray-100 [&_pre]:p-4 [&_pre]:rounded-lg [&_pre]:overflow-x-auto [&_pre]:my-4\r
|
|
93
|
+
[&_pre_code]:bg-transparent [&_pre_code]:text-inherit [&_pre_code]:p-0`,contentEditable:!0,onInput:Z=>A(Z.currentTarget.innerHTML),onBlur:Z=>A(Z.currentTarget.innerHTML),suppressContentEditableWarning:!0}),a&&m.jsx(Vt,{wordCount:c.wordCount,characterCount:c.characterCount,hasUnsavedChanges:c.hasUnsavedChanges})]})};D.TextEditor=ta,D.useTextEditor=St,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})}));
|