diff --git a/dist/assets/index-b0e9e5d3.css b/dist/assets/index-7a174465.css similarity index 51% rename from dist/assets/index-b0e9e5d3.css rename to dist/assets/index-7a174465.css index 0268f72..2893fb2 100644 --- a/dist/assets/index-b0e9e5d3.css +++ b/dist/assets/index-7a174465.css @@ -1 +1 @@ -*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.left-1{left:.25rem}.right-0{right:0}.top-0{top:0}.top-1{top:.25rem}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.m-0{margin:0}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-10{margin-left:2.5rem;margin-right:2.5rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-0{margin-left:0}.ml-10{margin-left:2.5rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-5{margin-left:1.25rem}.mr-0{margin-right:0}.mr-2{margin-right:.5rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.contents{display:contents}.hidden{display:none}.h-24{height:6rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-auto{height:auto}.h-full{height:100%}.h-screen{height:100vh}.max-h-16{max-height:4rem}.min-h-\[50px\]{min-height:50px}.min-h-\[96px\]{min-height:96px}.min-h-screen{min-height:100vh}.w-14{width:3.5rem}.w-3{width:.75rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\[24px\]{width:24px}.w-\[260px\]{width:260px}.w-full{width:100%}.min-w-\[24px\]{min-width:24px}.max-w-3xl{max-width:48rem}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.flex-grow,.grow{flex-grow:1}.grow-0{flex-grow:0}.-translate-x-\[100\%\]{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap-reverse{flex-wrap:wrap-reverse}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.border{border-width:1px}.border-2{border-width:2px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-r-2{border-right-width:2px}.border-t-2{border-top-width:2px}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-gray-500{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity))}.border-green-800{--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity))}.border-white\/20{border-color:#fff3}.border-white\/50{border-color:#ffffff80}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-chat{--tw-bg-opacity: 1;background-color:rgb(69 76 90 / var(--tw-bg-opacity))}.bg-good{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity))}.bg-green-700{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity))}.bg-hover2{--tw-bg-opacity: 1;background-color:rgb(51 57 67 / var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(40 44 52 / var(--tw-bg-opacity))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}.bg-red-700{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity))}.bg-secondary{--tw-bg-opacity: 1;background-color:rgb(33 37 43 / var(--tw-bg-opacity))}.bg-warning{--tw-bg-opacity: 1;background-color:rgb(194 62 69 / var(--tw-bg-opacity))}.bg-yellow-600{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity))}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-20{padding-left:5rem;padding-right:5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-3{padding-bottom:.75rem}.pb-5{padding-bottom:1.25rem}.pl-20{padding-left:5rem}.pl-3{padding-left:.75rem}.pt-1{padding-top:.25rem}.pt-5{padding-top:1.25rem}.pt-\[3px\]{padding-top:3px}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[1rem\]{font-size:1rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-blue-200{--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-white\/80{color:#fffc}.text-white\/90{color:#ffffffe6}.underline{text-decoration-line:underline}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}*{font-family:Segoe UI,sans-serif}body{background-color:#21252b}.icon-white{filter:invert(75%)}.hover\:bg-blue-400:hover{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.hover\:bg-good2:hover{--tw-bg-opacity: 1;background-color:rgb(72 137 254 / var(--tw-bg-opacity))}.hover\:bg-gray-500:hover{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.hover\:bg-green-500:hover{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity))}.hover\:bg-hover:hover{--tw-bg-opacity: 1;background-color:rgb(43 48 56 / var(--tw-bg-opacity))}.hover\:bg-hover2:hover{--tw-bg-opacity: 1;background-color:rgb(51 57 67 / var(--tw-bg-opacity))}.hover\:bg-red-500:hover{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.hover\:bg-warning:hover{--tw-bg-opacity: 1;background-color:rgb(194 62 69 / var(--tw-bg-opacity))}.hover\:bg-warningHover:hover{--tw-bg-opacity: 1;background-color:rgb(229 104 101 / var(--tw-bg-opacity))}.hover\:text-blue-500:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.hover\:opacity-hover:hover{opacity:.2}.focus\:bg-white:focus{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:outline-primary:focus{outline-color:#282c34}@media (min-width: 768px){.md\:ml-\[260px\]{margin-left:260px}.md\:flex{display:flex}.md\:hidden{display:none}.md\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}}.playbutton.svelte-2tsp55,.downloadbutton.svelte-2tsp55{color:#add8e6}.playbutton.svelte-2tsp55:hover,.downloadbutton.svelte-2tsp55:hover{color:#add8e6;text-decoration:underline}.notice.svelte-2tsp55{font-size:.8em;color:#c4c457}.conversation.svelte-2c65x7 .edit.svelte-2c65x7,.conversation.svelte-2c65x7 .delete.svelte-2c65x7,.conversation.svelte-2c65x7:hover .tokens.svelte-2c65x7{display:none}.conversation.svelte-2c65x7:hover .edit.svelte-2c65x7,.conversation.svelte-2c65x7:hover .delete.svelte-2c65x7{display:flex}.edit-input.svelte-2c65x7.svelte-2c65x7{background-color:#333;color:#fff;width:auto;max-width:145px;padding:8px;border-radius:4px;border:1px solid #555}.title-container.svelte-2c65x7.svelte-2c65x7{overflow:hidden}.title-container.svelte-2c65x7.svelte-2c65x7:hover{z-index:20}.title-text.svelte-2c65x7.svelte-2c65x7{white-space:nowrap;overflow:hidden;text-overflow:clip;display:inline-block;max-width:100%;vertical-align:top}.convo-container.svelte-2c65x7.svelte-2c65x7:after{content:"";position:absolute;top:0;right:3px;bottom:0;width:3em;background:linear-gradient(to right,rgb(33,37,43,0),#21252b 80%,#21252b);z-index:10}.convo-container.svelte-2c65x7:after .title-container.svelte-2c65x7:hover{background:linear-gradient(to right,rgb(33,37,43,0),#333943 80%,#333943)}.fixed{background-color:#0006}.min-h-screen{min-height:calc(100vh - 4rem)}.bg-white{width:24rem}.border{padding:.5rem}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation-name:fadeIn;animation-duration:.2s;animation-fill-mode:forwards}input:checked~.dot{transform:translate(1.5rem);background-color:#8ee78e}pre.svelte-hssbda{background-color:#0d0d0d;border-radius:0 0 10px 10px;padding:20px;margin:0 20px;opacity:0;animation:svelte-hssbda-fade-in .5s ease-in-out forwards;margin-bottom:1rem;font-weight:700;overflow-wrap:break-word;white-space:pre-wrap}.copycode.svelte-hssbda{display:flex;justify-content:flex-end;background-color:#2f2f2f;margin:0 20px;border-radius:10px 10px 0 0;padding:.5rem 1rem}button.svelte-hssbda{font-size:small;display:block;transition:all .1s ease-in-out;color:#bbb}button.svelte-hssbda:hover{color:#fff}@keyframes svelte-hssbda-fade-in{0%{opacity:0}to{opacity:1}}@keyframes svelte-6aocss-fade-in{0%{opacity:0}to{opacity:1}}em.svelte-djznuz{font-weight:700}ol.svelte-1dicnom,ul.svelte-1dicnom{padding-left:1rem;padding-right:1rem}li.svelte-fm7yqp{padding-bottom:.5rem;padding-left:.5rem;list-style-type:decimal}li.svelte-fm7yqp::marker{color:#fff6}code.svelte-we39e{font-weight:700}p.svelte-jw73bw{padding-bottom:1rem}.height-manager{height:calc(var(--app-height) * 100)}@media (min-width: 1024px){.height-manager{height:100vh}}.tools{opacity:0;visibility:hidden;transition:opacity .1s,visibility .1s}.message:hover .tools{opacity:1;visibility:visible}.file-input{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1}.file-label{display:inline-flex;align-items:center;justify-content:center;gap:10px;color:#fff}.file-label:hover,.file-label:active{background-color:#696d85;cursor:pointer}.file-label{display:inline-flex;align-items:center;justify-content:center;gap:10px}.upload-icon{width:36px;height:auto}.fileCount{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border:2px solid white;border-radius:50%;background-color:transparent;color:#fff;font-size:16px}.pdf-icon{width:36px;height:auto}.copy-icon{filter:invert(60%)}.copy-icon:hover{filter:invert(100%)}.delete-icon{filter:grayscale(100%) invert(75%)}.delete-icon:hover{filter:none}.edit-icon{filter:grayscale(100%) invert(75%)}.edit-icon:hover{filter:grayscale(100%) invert(100%)}.inputbox-container{width:100%;justify-content:center;align-items:center;display:flex}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-button{background-color:#464d5c;height:0px}::-webkit-scrollbar-track-piece{background-color:#282c34}::-webkit-scrollbar-thumb{height:50px;background-color:#666;border-radius:12px}::-webkit-scrollbar-corner{background-color:#646464}::-webkit-resizer{background-color:#666}.message p{padding-bottom:.5rem} +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.left-1{left:.25rem}.right-0{right:0}.top-0{top:0}.top-1{top:.25rem}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.m-0{margin:0}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-10{margin-left:2.5rem;margin-right:2.5rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-0{margin-left:0}.ml-10{margin-left:2.5rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-5{margin-left:1.25rem}.mr-0{margin-right:0}.mr-2{margin-right:.5rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.contents{display:contents}.hidden{display:none}.h-24{height:6rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-auto{height:auto}.h-full{height:100%}.h-screen{height:100vh}.max-h-16{max-height:4rem}.min-h-\[50px\]{min-height:50px}.min-h-\[96px\]{min-height:96px}.min-h-screen{min-height:100vh}.w-14{width:3.5rem}.w-3{width:.75rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\[24px\]{width:24px}.w-\[260px\]{width:260px}.w-full{width:100%}.min-w-\[24px\]{min-width:24px}.max-w-3xl{max-width:48rem}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.flex-grow,.grow{flex-grow:1}.grow-0{flex-grow:0}.-translate-x-\[100\%\]{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap-reverse{flex-wrap:wrap-reverse}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.border{border-width:1px}.border-2{border-width:2px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-r-2{border-right-width:2px}.border-t-2{border-top-width:2px}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-gray-500{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity))}.border-green-800{--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity))}.border-white\/20{border-color:#fff3}.border-white\/50{border-color:#ffffff80}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-chat{--tw-bg-opacity: 1;background-color:rgb(69 76 90 / var(--tw-bg-opacity))}.bg-good{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity))}.bg-green-700{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity))}.bg-hover2{--tw-bg-opacity: 1;background-color:rgb(51 57 67 / var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(40 44 52 / var(--tw-bg-opacity))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}.bg-red-700{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity))}.bg-secondary{--tw-bg-opacity: 1;background-color:rgb(33 37 43 / var(--tw-bg-opacity))}.bg-warning{--tw-bg-opacity: 1;background-color:rgb(194 62 69 / var(--tw-bg-opacity))}.bg-yellow-600{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity))}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-3{padding-bottom:.75rem}.pb-5{padding-bottom:1.25rem}.pl-20{padding-left:5rem}.pl-3{padding-left:.75rem}.pr-5{padding-right:1.25rem}.pt-1{padding-top:.25rem}.pt-5{padding-top:1.25rem}.pt-\[3px\]{padding-top:3px}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[1rem\]{font-size:1rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-blue-200{--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-white\/80{color:#fffc}.text-white\/90{color:#ffffffe6}.underline{text-decoration-line:underline}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}*{font-family:Segoe UI,sans-serif}body{background-color:#21252b}.icon-white{filter:invert(75%)}.hover\:bg-blue-400:hover{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.hover\:bg-good2:hover{--tw-bg-opacity: 1;background-color:rgb(72 137 254 / var(--tw-bg-opacity))}.hover\:bg-gray-500:hover{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.hover\:bg-green-500:hover{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity))}.hover\:bg-hover:hover{--tw-bg-opacity: 1;background-color:rgb(43 48 56 / var(--tw-bg-opacity))}.hover\:bg-hover2:hover{--tw-bg-opacity: 1;background-color:rgb(51 57 67 / var(--tw-bg-opacity))}.hover\:bg-red-500:hover{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.hover\:bg-warning:hover{--tw-bg-opacity: 1;background-color:rgb(194 62 69 / var(--tw-bg-opacity))}.hover\:bg-warningHover:hover{--tw-bg-opacity: 1;background-color:rgb(229 104 101 / var(--tw-bg-opacity))}.hover\:text-blue-500:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.hover\:opacity-hover:hover{opacity:.2}.focus\:bg-white:focus{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:outline-primary:focus{outline-color:#282c34}@media (min-width: 768px){.md\:ml-\[260px\]{margin-left:260px}.md\:flex{display:flex}.md\:hidden{display:none}.md\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\:px-20{padding-left:5rem;padding-right:5rem}}.playbutton.svelte-2tsp55,.downloadbutton.svelte-2tsp55{color:#add8e6}.playbutton.svelte-2tsp55:hover,.downloadbutton.svelte-2tsp55:hover{color:#add8e6;text-decoration:underline}.notice.svelte-2tsp55{font-size:.8em;color:#c4c457}.conversation.svelte-2c65x7 .edit.svelte-2c65x7,.conversation.svelte-2c65x7 .delete.svelte-2c65x7,.conversation.svelte-2c65x7:hover .tokens.svelte-2c65x7{display:none}.conversation.svelte-2c65x7:hover .edit.svelte-2c65x7,.conversation.svelte-2c65x7:hover .delete.svelte-2c65x7{display:flex}.edit-input.svelte-2c65x7.svelte-2c65x7{background-color:#333;color:#fff;width:auto;max-width:145px;padding:8px;border-radius:4px;border:1px solid #555}.title-container.svelte-2c65x7.svelte-2c65x7{overflow:hidden}.title-container.svelte-2c65x7.svelte-2c65x7:hover{z-index:20}.title-text.svelte-2c65x7.svelte-2c65x7{white-space:nowrap;overflow:hidden;text-overflow:clip;display:inline-block;max-width:100%;vertical-align:top}.convo-container.svelte-2c65x7.svelte-2c65x7:after{content:"";position:absolute;top:0;right:3px;bottom:0;width:3em;background:linear-gradient(to right,rgb(33,37,43,0),#21252b 80%,#21252b);z-index:10}.convo-container.svelte-2c65x7:after .title-container.svelte-2c65x7:hover{background:linear-gradient(to right,rgb(33,37,43,0),#333943 80%,#333943)}.fixed{background-color:#0006}.min-h-screen{min-height:calc(100vh - 4rem)}.bg-white{width:24rem}.border{padding:.5rem}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation-name:fadeIn;animation-duration:.2s;animation-fill-mode:forwards}input:checked~.dot{transform:translate(1.5rem);background-color:#8ee78e}pre.svelte-hssbda{background-color:#0d0d0d;border-radius:0 0 10px 10px;padding:20px;margin:0 20px;opacity:0;animation:svelte-hssbda-fade-in .5s ease-in-out forwards;margin-bottom:1rem;font-weight:700;overflow-wrap:break-word;white-space:pre-wrap}.copycode.svelte-hssbda{display:flex;justify-content:flex-end;background-color:#2f2f2f;margin:0 20px;border-radius:10px 10px 0 0;padding:.5rem 1rem}button.svelte-hssbda{font-size:small;display:block;transition:all .1s ease-in-out;color:#bbb}button.svelte-hssbda:hover{color:#fff}@keyframes svelte-hssbda-fade-in{0%{opacity:0}to{opacity:1}}@keyframes svelte-6aocss-fade-in{0%{opacity:0}to{opacity:1}}em.svelte-djznuz{font-weight:700}ol.svelte-1dicnom,ul.svelte-1dicnom{padding-left:1rem;padding-right:1rem}li.svelte-fm7yqp{padding-bottom:.5rem;padding-left:.5rem;list-style-type:decimal}li.svelte-fm7yqp::marker{color:#fff6}code.svelte-we39e{font-weight:700}p.svelte-jw73bw{padding-bottom:1rem}.height-manager{height:calc(var(--app-height) * 100)}@media (min-width: 1024px){.height-manager{height:100vh}}.tools{opacity:0;visibility:hidden;transition:opacity .1s,visibility .1s}.message:hover .tools{opacity:1;visibility:visible}.file-input{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1}.file-label{display:inline-flex;align-items:center;justify-content:center;gap:10px;color:#fff}.file-label:hover,.file-label:active{background-color:#696d85;cursor:pointer}.file-label{display:inline-flex;align-items:center;justify-content:center;gap:10px}.upload-icon{width:36px;height:auto}.fileCount{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border:2px solid white;border-radius:50%;background-color:transparent;color:#fff;font-size:16px}.pdf-icon{width:36px;height:auto}.copy-icon{filter:invert(60%)}.copy-icon:hover{filter:invert(100%)}.delete-icon{filter:grayscale(100%) invert(75%)}.delete-icon:hover{filter:none}.edit-icon{filter:grayscale(100%) invert(75%)}.edit-icon:hover{filter:grayscale(100%) invert(100%)}.inputbox-container{width:100%;justify-content:center;align-items:center;display:flex}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-button{background-color:#464d5c;height:0px}::-webkit-scrollbar-track-piece{background-color:#282c34}::-webkit-scrollbar-thumb{height:50px;background-color:#666;border-radius:12px}::-webkit-scrollbar-corner{background-color:#646464}::-webkit-resizer{background-color:#666}.message p{padding-bottom:.5rem} diff --git a/dist/assets/index-4a068af4.js b/dist/assets/index-d470cf7b.js similarity index 92% rename from dist/assets/index-4a068af4.js rename to dist/assets/index-d470cf7b.js index 2b90da7..e49b480 100644 --- a/dist/assets/index-4a068af4.js +++ b/dist/assets/index-d470cf7b.js @@ -65,4 +65,4 @@ ${e} `}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return this.options.xhtml?"
":"
"}del(e){return`${e}`}link(e,t,r){if(e=Gs(this.options.sanitize,this.options.baseUrl,e),e===null)return r;let n='",n}image(e,t,r){if(e=Gs(this.options.sanitize,this.options.baseUrl,e),e===null)return r;let n=`${r}":">",n}text(e){return e}}class Ni{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,r){return""+r}image(e,t,r){return""+r}br(){return""}}class $r{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let r=e,n=0;if(this.seen.hasOwnProperty(r)){n=this.seen[e];do n++,r=e+"-"+n;while(this.seen.hasOwnProperty(r))}return t||(this.seen[e]=n,this.seen[r]=0),r}slug(e,t={}){const r=this.serialize(e);return this.getNextSafeSlug(r,t.dryrun)}}class it{constructor(e){this.options=e||Vt,this.options.renderer=this.options.renderer||new Tr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ni,this.slugger=new $r}static parse(e,t){return new it(t).parse(e)}static parseInline(e,t){return new it(t).parseInline(e)}parse(e,t=!0){let r="",n,i,l,a,o,c,u,f,d,h,_,m,w,v,E,P,O,F,C;const N=e.length;for(n=0;n0&&E.tokens[0].type==="paragraph"?(E.tokens[0].text=F+" "+E.tokens[0].text,E.tokens[0].tokens&&E.tokens[0].tokens.length>0&&E.tokens[0].tokens[0].type==="text"&&(E.tokens[0].tokens[0].text=F+" "+E.tokens[0].tokens[0].text)):E.tokens.unshift({type:"text",text:F}):v+=F),v+=this.parse(E.tokens,w),d+=this.renderer.listitem(v,O,P);r+=this.renderer.list(d,_,m);continue}case"html":{r+=this.renderer.html(h.text);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(d=h.tokens?this.parseInline(h.tokens):h.text;n+1"u"||s===null)throw new Error("marked(): input parameter is undefined or null");if(typeof s!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected");if(typeof e=="function"&&(t=e,e=null),e=nt({},q.defaults,e||{}),Li(e),t){const n=e.highlight;let i;try{i=lt.lex(s,e)}catch(o){return t(o)}const l=function(o){let c;if(!o)try{e.walkTokens&&q.walkTokens(i,e.walkTokens),c=it.parse(i,e)}catch(u){o=u}return e.highlight=n,o?t(o):t(null,c)};if(!n||n.length<3||(delete e.highlight,!i.length))return l();let a=0;q.walkTokens(i,function(o){o.type==="code"&&(a++,setTimeout(()=>{n(o.text,o.lang,function(c,u){if(c)return l(c);u!=null&&u!==o.text&&(o.text=u,o.escaped=!0),a--,a===0&&l()})},0))}),a===0&&l();return}function r(n){if(n.message+=` Please report this to https://github.com/markedjs/marked.`,e.silent)return"

An error occurred:

"+je(n.message+"",!0)+"
";throw n}try{const n=lt.lex(s,e);if(e.walkTokens){if(e.async)return Promise.all(q.walkTokens(n,e.walkTokens)).then(()=>it.parse(n,e)).catch(r);q.walkTokens(n,e.walkTokens)}return it.parse(n,e)}catch(n){r(n)}}q.options=q.setOptions=function(s){return nt(q.defaults,s),sc(q.defaults),q};q.getDefaults=Ui;q.defaults=Vt;q.use=function(...s){const e=q.defaults.extensions||{renderers:{},childTokens:{}};s.forEach(t=>{const r=nt({},t);if(r.async=q.defaults.async||r.async,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if(n.renderer){const i=e.renderers[n.name];i?e.renderers[n.name]=function(...l){let a=n.renderer.apply(this,l);return a===!1&&(a=i.apply(this,l)),a}:e.renderers[n.name]=n.renderer}if(n.tokenizer){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");e[n.level]?e[n.level].unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),r.extensions=e),t.renderer){const n=q.defaults.renderer||new Tr;for(const i in t.renderer){const l=n[i];n[i]=(...a)=>{let o=t.renderer[i].apply(n,a);return o===!1&&(o=l.apply(n,a)),o}}r.renderer=n}if(t.tokenizer){const n=q.defaults.tokenizer||new Pr;for(const i in t.tokenizer){const l=n[i];n[i]=(...a)=>{let o=t.tokenizer[i].apply(n,a);return o===!1&&(o=l.apply(n,a)),o}}r.tokenizer=n}if(t.walkTokens){const n=q.defaults.walkTokens;r.walkTokens=function(i){let l=[];return l.push(t.walkTokens.call(this,i)),n&&(l=l.concat(n.call(this,i))),l}}q.setOptions(r)})};q.walkTokens=function(s,e){let t=[];for(const r of s)switch(t=t.concat(e.call(q,r)),r.type){case"table":{for(const n of r.header)t=t.concat(q.walkTokens(n.tokens,e));for(const n of r.rows)for(const i of n)t=t.concat(q.walkTokens(i.tokens,e));break}case"list":{t=t.concat(q.walkTokens(r.items,e));break}default:q.defaults.extensions&&q.defaults.extensions.childTokens&&q.defaults.extensions.childTokens[r.type]?q.defaults.extensions.childTokens[r.type].forEach(function(n){t=t.concat(q.walkTokens(r[n],e))}):r.tokens&&(t=t.concat(q.walkTokens(r.tokens,e)))}return t};q.parseInline=function(s,e){if(typeof s>"u"||s===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof s!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected");e=nt({},q.defaults,e||{}),Li(e);try{const t=lt.lexInline(s,e);return e.walkTokens&&q.walkTokens(t,e.walkTokens),it.parseInline(t,e)}catch(t){if(t.message+=` -Please report this to https://github.com/markedjs/marked.`,e.silent)return"

An error occurred:

"+je(t.message+"",!0)+"
";throw t}};q.Parser=it;q.parser=it.parse;q.Renderer=Tr;q.TextRenderer=Ni;q.Lexer=lt;q.lexer=lt.lex;q.Tokenizer=Pr;q.Slugger=$r;q.parse=q;q.options;q.setOptions;q.use;q.walkTokens;q.parseInline;it.parse;lt.lex;const qi={};function vc(s){let e;return{c(){e=ae(s[1])},m(t,r){k(t,e,r)},p(t,r){r&2&&Pe(e,t[1])},i:U,o:U,d(t){t&&y(e)}}}function wc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h6"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function yc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h5"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function kc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h4"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Oc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h3"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Sc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h2"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Ac(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h1"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Ec(s){let e,t,r,n;const i=[Ac,Sc,Oc,kc,yc,wc,vc],l=[];function a(o,c){return o[0]===1?0:o[0]===2?1:o[0]===3?2:o[0]===4?3:o[0]===5?4:o[0]===6?5:6}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ge()},m(o,c){l[e].m(o,c),k(o,r,c),n=!0},p(o,[c]){let u=e;e=a(o),e===u?l[e].p(o,c):(ie(),A(l[u],1,1,()=>{l[u]=null}),le(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),S(t,1),t.m(r.parentNode,r))},i(o){n||(S(t),n=!0)},o(o){A(t),n=!1},d(o){l[e].d(o),o&&y(r)}}}function Pc(s,e,t){let r,{$$slots:n={},$$scope:i}=e,{depth:l}=e,{raw:a}=e,{text:o}=e;const{slug:c,getOptions:u}=ll(qi),f=u();return s.$$set=d=>{"depth"in d&&t(0,l=d.depth),"raw"in d&&t(1,a=d.raw),"text"in d&&t(3,o=d.text),"$$scope"in d&&t(4,i=d.$$scope)},s.$$.update=()=>{s.$$.dirty&8&&t(2,r=f.headerIds?f.headerPrefix+c(o):void 0)},[l,a,r,o,i,n]}class Tc extends ee{constructor(e){super(),X(this,e,Pc,Ec,Z,{depth:0,raw:1,text:3})}}function $c(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("p"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Cc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}let Rc=class extends ee{constructor(e){super(),X(this,e,Cc,$c,Z,{})}};function xc(s){let e;const t=s[3].default,r=de(t,s,s[2],null);return{c(){r&&r.c()},m(n,i){r&&r.m(n,i),e=!0},p(n,[i]){r&&r.p&&(!e||i&4)&&pe(r,t,n,n[2],e?he(t,n[2],i,null):me(n[2]),null)},i(n){e||(S(r,n),e=!0)},o(n){A(r,n),e=!1},d(n){r&&r.d(n)}}}function Ic(s,e,t){let{$$slots:r={},$$scope:n}=e,{text:i}=e,{raw:l}=e;return s.$$set=a=>{"text"in a&&t(0,i=a.text),"raw"in a&&t(1,l=a.raw),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class jc extends ee{constructor(e){super(),X(this,e,Ic,xc,Z,{text:0,raw:1})}}function Fc(s){let e,t;return{c(){e=b("img"),Ae(e.src,t=s[0])||p(e,"src",t),p(e,"title",s[1]),p(e,"alt",s[2])},m(r,n){k(r,e,n)},p(r,[n]){n&1&&!Ae(e.src,t=r[0])&&p(e,"src",t),n&2&&p(e,"title",r[1]),n&4&&p(e,"alt",r[2])},i:U,o:U,d(r){r&&y(e)}}}function Mc(s,e,t){let{href:r=""}=e,{title:n=void 0}=e,{text:i=""}=e;return s.$$set=l=>{"href"in l&&t(0,r=l.href),"title"in l&&t(1,n=l.title),"text"in l&&t(2,i=l.text)},[r,n,i]}class Uc extends ee{constructor(e){super(),X(this,e,Mc,Fc,Z,{href:0,title:1,text:2})}}function Bc(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("a"),n&&n.c(),p(e,"href",s[0]),p(e,"title",s[1])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&1)&&p(e,"href",i[0]),(!t||l&2)&&p(e,"title",i[1])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Vc(s,e,t){let{$$slots:r={},$$scope:n}=e,{href:i=""}=e,{title:l=void 0}=e;return s.$$set=a=>{"href"in a&&t(0,i=a.href),"title"in a&&t(1,l=a.title),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class Dc extends ee{constructor(e){super(),X(this,e,Vc,Bc,Z,{href:0,title:1})}}function Lc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("em"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Nc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}let qc=class extends ee{constructor(e){super(),X(this,e,Nc,Lc,Z,{})}};function zc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("del"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Hc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Jc extends ee{constructor(e){super(),X(this,e,Hc,zc,Z,{})}}function Gc(s){let e,t=s[0].replace(/`/g,"")+"",r;return{c(){e=b("code"),r=ae(t)},m(n,i){k(n,e,i),g(e,r)},p(n,[i]){i&1&&t!==(t=n[0].replace(/`/g,"")+"")&&Pe(r,t)},i:U,o:U,d(n){n&&y(e)}}}function Qc(s,e,t){let{raw:r}=e;return s.$$set=n=>{"raw"in n&&t(0,r=n.raw)},[r]}class Yc extends ee{constructor(e){super(),X(this,e,Qc,Gc,Z,{raw:0})}}function Wc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("strong"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Kc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Zc extends ee{constructor(e){super(),X(this,e,Kc,Wc,Z,{})}}function Xc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("table"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function eu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class tu extends ee{constructor(e){super(),X(this,e,eu,Xc,Z,{})}}function nu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("thead"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function ru(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class su extends ee{constructor(e){super(),X(this,e,ru,nu,Z,{})}}function iu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("tbody"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function lu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class ou extends ee{constructor(e){super(),X(this,e,lu,iu,Z,{})}}function au(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("tr"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function cu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class uu extends ee{constructor(e){super(),X(this,e,cu,au,Z,{})}}function fu(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("td"),n&&n.c(),p(e,"align",s[1])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&2)&&p(e,"align",i[1])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function du(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("th"),n&&n.c(),p(e,"align",s[1])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&2)&&p(e,"align",i[1])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function hu(s){let e,t,r,n;const i=[du,fu],l=[];function a(o,c){return o[0]?0:1}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ge()},m(o,c){l[e].m(o,c),k(o,r,c),n=!0},p(o,[c]){let u=e;e=a(o),e===u?l[e].p(o,c):(ie(),A(l[u],1,1,()=>{l[u]=null}),le(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),S(t,1),t.m(r.parentNode,r))},i(o){n||(S(t),n=!0)},o(o){A(t),n=!1},d(o){l[e].d(o),o&&y(r)}}}function pu(s,e,t){let{$$slots:r={},$$scope:n}=e,{header:i}=e,{align:l}=e;return s.$$set=a=>{"header"in a&&t(0,i=a.header),"align"in a&&t(1,l=a.align),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class mu extends ee{constructor(e){super(),X(this,e,pu,hu,Z,{header:0,align:1})}}function gu(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("ul"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function _u(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("ol"),n&&n.c(),p(e,"start",s[1])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&2)&&p(e,"start",i[1])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function bu(s){let e,t,r,n;const i=[_u,gu],l=[];function a(o,c){return o[0]?0:1}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ge()},m(o,c){l[e].m(o,c),k(o,r,c),n=!0},p(o,[c]){let u=e;e=a(o),e===u?l[e].p(o,c):(ie(),A(l[u],1,1,()=>{l[u]=null}),le(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),S(t,1),t.m(r.parentNode,r))},i(o){n||(S(t),n=!0)},o(o){A(t),n=!1},d(o){l[e].d(o),o&&y(r)}}}function vu(s,e,t){let{$$slots:r={},$$scope:n}=e,{ordered:i}=e,{start:l}=e;return s.$$set=a=>{"ordered"in a&&t(0,i=a.ordered),"start"in a&&t(1,l=a.start),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class wu extends ee{constructor(e){super(),X(this,e,vu,bu,Z,{ordered:0,start:1})}}function yu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("li"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function ku(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}let Ou=class extends ee{constructor(e){super(),X(this,e,ku,yu,Z,{})}};function Su(s){let e;return{c(){e=b("hr")},m(t,r){k(t,e,r)},p:U,i:U,o:U,d(t){t&&y(e)}}}class Au extends ee{constructor(e){super(),X(this,e,null,Su,Z,{})}}function Eu(s){let e,t;return{c(){e=new nl(!1),t=ge(),e.a=t},m(r,n){e.m(s[0],r,n),k(r,t,n)},p(r,[n]){n&1&&e.p(r[0])},i:U,o:U,d(r){r&&y(t),r&&e.d()}}}function Pu(s,e,t){let{text:r}=e;return s.$$set=n=>{"text"in n&&t(0,r=n.text)},[r]}let Tu=class extends ee{constructor(e){super(),X(this,e,Pu,Eu,Z,{text:0})}};function $u(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("blockquote"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Cu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Ru extends ee{constructor(e){super(),X(this,e,Cu,$u,Z,{})}}function xu(s){let e,t,r;return{c(){e=b("pre"),t=b("code"),r=ae(s[1]),p(e,"class",s[0])},m(n,i){k(n,e,i),g(e,t),g(t,r)},p(n,[i]){i&2&&Pe(r,n[1]),i&1&&p(e,"class",n[0])},i:U,o:U,d(n){n&&y(e)}}}function Iu(s,e,t){let{lang:r}=e,{text:n}=e;return s.$$set=i=>{"lang"in i&&t(0,r=i.lang),"text"in i&&t(1,n=i.text)},[r,n]}let ju=class extends ee{constructor(e){super(),X(this,e,Iu,xu,Z,{lang:0,text:1})}};function Fu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("br"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(i,l),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Mu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Uu extends ee{constructor(e){super(),X(this,e,Mu,Fu,Z,{})}}const Bu={heading:Tc,paragraph:Rc,text:jc,image:Uc,link:Dc,em:qc,strong:Zc,codespan:Yc,del:Jc,table:tu,tablehead:su,tablebody:ou,tablerow:uu,tablecell:mu,list:wu,orderedlistitem:null,unorderedlistitem:null,listitem:Ou,hr:Au,html:Tu,blockquote:Ru,code:ju,br:Uu},Vu={baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,xhtml:!1};function Du(s){let e,t;return e=new St({props:{tokens:s[0],renderers:s[1]}}),{c(){K(e.$$.fragment)},m(r,n){Y(e,r,n),t=!0},p(r,[n]){const i={};n&1&&(i.tokens=r[0]),n&2&&(i.renderers=r[1]),e.$set(i)},i(r){t||(S(e.$$.fragment,r),t=!0)},o(r){A(e.$$.fragment,r),t=!1},d(r){W(e,r)}}}function Lu(s,e,t){let r,n,i,l,{source:a=[]}=e,{renderers:o={}}=e,{options:c={}}=e,{isInline:u=!1}=e;const f=wn();let d,h,_;return il(qi,{slug:m=>n?n.slug(m):"",getOptions:()=>i}),vn(()=>{t(7,_=!0)}),s.$$set=m=>{"source"in m&&t(2,a=m.source),"renderers"in m&&t(3,o=m.renderers),"options"in m&&t(4,c=m.options),"isInline"in m&&t(5,u=m.isInline)},s.$$.update=()=>{s.$$.dirty&4&&t(8,r=Array.isArray(a)),s.$$.dirty&4&&(n=a?new $r:void 0),s.$$.dirty&16&&t(9,i={...Vu,...c}),s.$$.dirty&869&&(r?t(0,d=a):(t(6,h=new lt(i)),t(0,d=u?h.inlineTokens(a):h.lex(a)),f("parsed",{tokens:d}))),s.$$.dirty&8&&t(1,l={...Bu,...o}),s.$$.dirty&385&&_&&!r&&f("parsed",{tokens:d})},[d,l,a,o,c,u,h,_,r,i]}class zi extends ee{constructor(e){super(),X(this,e,Lu,Du,Z,{source:2,renderers:3,options:4,isInline:5})}}function Nu(s){let e,t,r,n,i,l,a,o,c;return{c(){e=b("div"),t=b("div"),r=b("button"),r.textContent="Copy code",n=$(),i=b("pre"),l=b("code"),a=ae(s[0]),p(r,"class","svelte-hssbda"),p(t,"class","copycode svelte-hssbda"),p(i,"class","svelte-hssbda"),rt(e,"position","relative")},m(u,f){k(u,e,f),g(e,t),g(t,r),g(e,n),g(e,i),g(i,l),g(l,a),o||(c=L(r,"click",s[1]),o=!0)},p(u,[f]){f&1&&Pe(a,u[0])},i:U,o:U,d(u){u&&y(e),o=!1,c()}}}function qu(s,e,t){let{text:r}=e;const n=async()=>{try{await navigator.clipboard.writeText(r)}catch(i){console.error("Error copying text: ",i)}};return s.$$set=i=>{"text"in i&&t(0,r=i.text)},[r,n]}class zu extends ee{constructor(e){super(),X(this,e,qu,Nu,Z,{text:0})}}function Hu(s){let e,t;return{c(){e=b("div"),t=ae(s[0]),rt(e,"position","relative")},m(r,n){k(r,e,n),g(e,t)},p(r,[n]){n&1&&Pe(t,r[0])},i:U,o:U,d(r){r&&y(e)}}}function Ju(s,e,t){let{text:r}=e;return s.$$set=n=>{"text"in n&&t(0,r=n.text)},[r]}class Gu extends ee{constructor(e){super(),X(this,e,Ju,Hu,Z,{text:0})}}function Qu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("em"),n&&n.c(),p(e,"class","svelte-djznuz")},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Yu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Hi extends ee{constructor(e){super(),X(this,e,Yu,Qu,Z,{})}}function Wu(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("ul"),n&&n.c(),p(e,"class","svelte-1dicnom")},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Ku(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("ol"),n&&n.c(),p(e,"start",s[1]),p(e,"class","svelte-1dicnom")},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&2)&&p(e,"start",i[1])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Zu(s){let e,t,r,n;const i=[Ku,Wu],l=[];function a(o,c){return o[0]?0:1}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ge()},m(o,c){l[e].m(o,c),k(o,r,c),n=!0},p(o,[c]){let u=e;e=a(o),e===u?l[e].p(o,c):(ie(),A(l[u],1,1,()=>{l[u]=null}),le(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),S(t,1),t.m(r.parentNode,r))},i(o){n||(S(t),n=!0)},o(o){A(t),n=!1},d(o){l[e].d(o),o&&y(r)}}}function Xu(s,e,t){let{$$slots:r={},$$scope:n}=e,{ordered:i}=e,{start:l}=e;return s.$$set=a=>{"ordered"in a&&t(0,i=a.ordered),"start"in a&&t(1,l=a.start),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class Ji extends ee{constructor(e){super(),X(this,e,Xu,Zu,Z,{ordered:0,start:1})}}function ef(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("li"),n&&n.c(),p(e,"class","svelte-fm7yqp")},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function tf(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Gi extends ee{constructor(e){super(),X(this,e,tf,ef,Z,{})}}function nf(s){let e,t=s[0].replace(/`/g,"")+"",r;return{c(){e=b("code"),r=ae(t),p(e,"class","svelte-we39e")},m(n,i){k(n,e,i),g(e,r)},p(n,[i]){i&1&&t!==(t=n[0].replace(/`/g,"")+"")&&Pe(r,t)},i:U,o:U,d(n){n&&y(e)}}}function rf(s,e,t){let{raw:r}=e;return s.$$set=n=>{"raw"in n&&t(0,r=n.raw)},[r]}class sf extends ee{constructor(e){super(),X(this,e,rf,nf,Z,{raw:0})}}function lf(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("p"),n&&n.c(),p(e,"class","svelte-jw73bw")},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function of(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Qi extends ee{constructor(e){super(),X(this,e,of,lf,Z,{})}}function af(s){let e;return{c(){e=ae(s[0])},m(t,r){k(t,e,r)},p(t,[r]){r&1&&Pe(e,t[0])},i:U,o:U,d(t){t&&y(e)}}}function cf(s,e,t){let{text:r}=e;return s.$$set=n=>{"text"in n&&t(0,r=n.text)},[r]}class Yi extends ee{constructor(e){super(),X(this,e,cf,af,Z,{text:0})}}const uf="/assets/delete-f3f148b5.svg",ff="/assets/CopyIcon-6270aedf.svg",Zs="/assets/UserIcon-57b535eb.svg",Xs="/assets/RobotIcon-76293781.svg",df="/assets/send-8e88dbd9.svg",hf="/assets/wait-8f30b8f8.svg",pf="/assets/upload-icon-8c25e619.svg",mf="/assets/pdf-icon-d4c18e5d.svg",gf="modulepreload",_f=function(s){return"/"+s},ei={},bf=function(e,t,r){if(!t||t.length===0)return e();const n=document.getElementsByTagName("link");return Promise.all(t.map(i=>{if(i=_f(i),i in ei)return;ei[i]=!0;const l=i.endsWith(".css"),a=l?'[rel="stylesheet"]':"";if(!!r)for(let u=n.length-1;u>=0;u--){const f=n[u];if(f.href===i&&(!l||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${a}`))return;const c=document.createElement("link");if(c.rel=l?"stylesheet":gf,l||(c.as="script",c.crossOrigin=""),c.href=i,document.head.appendChild(c),l)return new Promise((u,f)=>{c.addEventListener("load",u),c.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>e())};async function vf(){const s=await bf(()=>import("./pdf-ea9598b5.js"),[]);return s.GlobalWorkerOptions.workerSrc="/workers/pdf.worker.min.mjs",s}function wf(s){const t=/^D:(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/.exec(s);if(t){const r=parseInt(t[1],10),n=parseInt(t[2],10)-1,i=parseInt(t[3],10),l=parseInt(t[4],10),a=parseInt(t[5],10),o=parseInt(t[6],10);return new Date(r,n,i,l,a,o).toISOString().split("T")[0]}return"Unknown Date"}async function yf(s){try{const e=new FileReader,t=await vf();return new Promise((r,n)=>{e.onload=async i=>{const l=new Uint8Array(i.target.result),o=await t.getDocument({data:l}).promise,c=o.numPages;let u="";for(let E=1;E<=c;E++){const O=await(await o.getPage(E)).getTextContent();u+=O.items.map(F=>"str"in F?F.str:"").join(" ")}const f=u.split(/\s+/).length,h=(await o.getMetadata()).info,_=s.name,m=h.Title||"Untitled",w=h.Author||"Unknown Author",v=h.CreationDate?wf(h.CreationDate):"Unknown Date";r(`The user uploaded a PDF titled "${m}" with a file name of "${_}". It has ${c} pages and ${f} words. File metadata includes Author: "${w}" and creation date: ${v}. The extracted text is as follows: ${u}`)},e.onerror=n,e.readAsArrayBuffer(s)})}catch(e){return console.error("Error processing PDF:",e),Promise.reject("Failed to load the PDF file.")}}function ti(s,e,t){const r=s.slice();return r[53]=e[t],r[55]=t,r}function kf(s){let e;return{c(){e=ae("SmoothGPT")},m(t,r){k(t,e,r)},p:U,d(t){t&&y(e)}}}function Of(s){let e=(s[3][s[2]].title||"SmoothGPT")+"",t;return{c(){t=ae(e)},m(r,n){k(r,t,n)},p(r,n){n[0]&12&&e!==(e=(r[3][r[2]].title||"SmoothGPT")+"")&&Pe(t,e)},d(r){r&&y(t)}}}function ni(s){let e,t;return e=new Ca({}),e.$on("settings-changed",ra),{c(){K(e.$$.fragment)},m(r,n){Y(e,r,n),t=!0},p:U,i(r){t||(S(e.$$.fragment,r),t=!0)},o(r){A(e.$$.fragment,r),t=!1},d(r){W(e,r)}}}function ri(s){let e,t;return e=new Ia({}),{c(){K(e.$$.fragment)},m(r,n){Y(e,r,n),t=!0},i(r){t||(S(e.$$.fragment,r),t=!0)},o(r){A(e.$$.fragment,r),t=!1},d(r){W(e,r)}}}function Sf(s){let e;return{c(){e=b("div"),e.innerHTML="

No conversation selected. Start a new conversation.

",p(e,"class","flex justify-center items-center h-full")},m(t,r){k(t,e,r)},p:U,i:U,o:U,d(t){t&&y(e)}}}function Af(s){let e,t,r,n=s[3][s[2]].history,i=[];for(let a=0;aA(i[a],1,1,()=>{i[a]=null});return{c(){e=b("div"),t=b("div");for(let a=0;a{v[F]=null}),le(),u=v[c],u?u.p(P,O):(u=v[c]=w[c](P),u.c()),S(u,1),u.m(e,f))},i(P){d||(S(u),d=!0)},o(P){A(u),d=!1},d(P){P&&y(e),m.d(),v[c].d()}}}function Ef(s){let e;return{c(){e=ae("You")},m(t,r){k(t,e,r)},d(t){t&&y(e)}}}function Pf(s){let e;return{c(){e=ae("ChatGPT")},m(t,r){k(t,e,r)},d(t){t&&y(e)}}}function Tf(s){let e,t,r,n,i,l,a,o,c;const u=[If,xf,Rf,Cf],f=[];function d(m,w){return w[0]&12&&(t=null),w[0]&12&&(r=null),t==null&&(t=!!gr(m[53].content)),t?0:(r==null&&(r=!!ar(m[53])),r?1:m[53].role==="assistant"?2:3)}n=d(s,[-1,-1]),i=f[n]=u[n](s);let h=s[53].role==="assistant"&&ii(s),_=s[53].role==="user"&&oi(s);return{c(){e=b("div"),i.c(),l=$(),a=b("div"),h&&h.c(),o=$(),_&&_.c(),p(e,"class","message-display px-20 text-[1rem]"),p(a,"class","toolbelt flex space-x-2 pl-20 mb-2 tools")},m(m,w){k(m,e,w),f[n].m(e,null),k(m,l,w),k(m,a,w),h&&h.m(a,null),g(a,o),_&&_.m(a,null),c=!0},p(m,w){let v=n;n=d(m,w),n===v?f[n].p(m,w):(ie(),A(f[v],1,1,()=>{f[v]=null}),le(),i=f[n],i?i.p(m,w):(i=f[n]=u[n](m),i.c()),S(i,1),i.m(e,null)),m[53].role==="assistant"?h?h.p(m,w):(h=ii(m),h.c(),h.m(a,o)):h&&(h.d(1),h=null),m[53].role==="user"?_?_.p(m,w):(_=oi(m),_.c(),_.m(a,null)):_&&(_.d(1),_=null)},i(m){c||(S(i),c=!0)},o(m){A(i),c=!1},d(m){m&&y(e),f[n].d(),m&&y(l),m&&y(a),h&&h.d(),_&&_.d()}}}function $f(s){let e,t,r,n,i,l,a,o,c,u;function f(){return s[34](s[55])}return{c(){e=b("textarea"),t=$(),r=b("div"),n=b("button"),i=ae("Submit"),a=$(),o=b("button"),o.textContent="Cancel",p(e,"class","message-edit-textarea mt-2 bg-gray-700 p-3 mx-10 resize-none focus:outline-none rounded-lg"),rt(e,"height","96px"),rt(e,"overflow-y","auto"),p(n,"class",l="submit-edit rounded-lg p-2 mr-2 "+(s[18]?"bg-gray-500 cursor-not-allowed hover:bg-gray-500":"hover:bg-green-500 bg-green-700")),n.disabled=s[18],p(o,"class","cancel-edit bg-gray-700 hover:bg-gray-500 rounded-lg p-2 mr-2"),p(r,"class","flex place-content-center mt-4")},m(d,h){k(d,e,h),s[32](e),Xe(e,s[10]),k(d,t,h),k(d,r,h),g(r,n),g(n,i),g(r,a),g(r,o),c||(u=[L(e,"input",s[33]),L(e,"input",Wi),L(n,"click",f),L(o,"click",s[35])],c=!0)},p(d,h){s=d,h[0]&1024&&Xe(e,s[10]),h[0]&262144&&l!==(l="submit-edit rounded-lg p-2 mr-2 "+(s[18]?"bg-gray-500 cursor-not-allowed hover:bg-gray-500":"hover:bg-green-500 bg-green-700"))&&p(n,"class",l),h[0]&262144&&(n.disabled=s[18])},i:U,o:U,d(d){d&&y(e),s[32](null),d&&y(t),d&&y(r),c=!1,Ne(u)}}}function Cf(s){let e,t;return e=new zi({props:{renderers:{code:Gu,codespan:sf,em:Hi,list:Ji,listitem:Gi,paragraph:Qi,html:Yi},source:gn(s[53].content.toString())}}),{c(){K(e.$$.fragment)},m(r,n){Y(e,r,n),t=!0},p(r,n){const i={};n[0]&12&&(i.source=gn(r[53].content.toString())),e.$set(i)},i(r){t||(S(e.$$.fragment,r),t=!0)},o(r){A(e.$$.fragment,r),t=!1},d(r){W(e,r)}}}function Rf(s){let e,t;return e=new zi({props:{renderers:{code:zu,em:Hi,list:Ji,listitem:Gi,paragraph:Qi,html:Yi},source:gn(s[53].content.toString())}}),{c(){K(e.$$.fragment)},m(r,n){Y(e,r,n),t=!0},p(r,n){const i={};n[0]&12&&(i.source=gn(r[53].content.toString())),e.$set(i)},i(r){t||(S(e.$$.fragment,r),t=!0)},o(r){A(e.$$.fragment,r),t=!1},d(r){W(e,r)}}}function xf(s){let e,t,r;return t=new pa({props:{audioUrl:s[53].audioUrl}}),{c(){e=b("div"),K(t.$$.fragment),p(e,"class","pb-3")},m(n,i){k(n,e,i),Y(t,e,null),r=!0},p(n,i){const l={};i[0]&12&&(l.audioUrl=n[53].audioUrl),t.$set(l)},i(n){r||(S(t.$$.fragment,n),r=!0)},o(n){A(t.$$.fragment,n),r=!1},d(n){n&&y(e),W(t)}}}function If(s){let e,t,r,n;return{c(){e=b("img"),r=$(),n=b("div"),n.textContent="This image will be available for 60 minutes. Right click + save as!",Ae(e.src,t=s[53].content)||p(e,"src",t),p(e,"alt","Generated"),p(e,"class","max-w-full h-auto my-3"),p(n,"class","text-sm text-gray-500")},m(i,l){k(i,e,l),k(i,r,l),k(i,n,l)},p(i,l){l[0]&12&&!Ae(e.src,t=i[53].content)&&p(e,"src",t)},i:U,o:U,d(i){i&&y(e),i&&y(r),i&&y(n)}}}function ii(s){let e=!ar(s[53])&&!gr(s[53].content),t,r,n,i,l,a,o=e&&li(s);function c(){return s[37](s[55])}return{c(){o&&o.c(),t=$(),r=b("button"),n=b("img"),p(n,"class","delete-icon"),p(n,"alt","Delete"),Ae(n.src,i=uf)||p(n,"src",i),p(r,"class","deleteButton w-5")},m(u,f){o&&o.m(u,f),k(u,t,f),k(u,r,f),g(r,n),l||(a=L(r,"click",c),l=!0)},p(u,f){s=u,f[0]&12&&(e=!ar(s[53])&&!gr(s[53].content)),e?o?o.p(s,f):(o=li(s),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(u){o&&o.d(u),u&&y(t),u&&y(r),l=!1,a()}}}function li(s){let e,t,r,n,i;function l(){return s[36](s[53])}return{c(){e=b("button"),t=b("img"),p(t,"class","copy-icon"),p(t,"alt","Copy"),Ae(t.src,r=ff)||p(t,"src",r),p(e,"class","copyButton w-5")},m(a,o){k(a,e,o),g(e,t),n||(i=L(e,"click",l),n=!0)},p(a,o){s=a},d(a){a&&y(e),n=!1,i()}}}function oi(s){let e,t,r,n,i;function l(){return s[38](s[55])}return{c(){e=b("button"),t=b("img"),p(t,"class","edit-icon"),p(t,"alt","edit"),Ae(t.src,r=Mi)||p(t,"src",r),p(e,"class","editButton w-5")},m(a,o){k(a,e,o),g(e,t),n||(i=L(e,"click",l),n=!0)},p(a,o){s=a},d(a){a&&y(e),n=!1,i()}}}function ai(s){let e,t,r=s[53].role!=="system"&&si(s);return{c(){r&&r.c(),e=ge()},m(n,i){r&&r.m(n,i),k(n,e,i),t=!0},p(n,i){n[53].role!=="system"?r?(r.p(n,i),i[0]&12&&S(r,1)):(r=si(n),r.c(),S(r,1),r.m(e.parentNode,e)):r&&(ie(),A(r,1,1,()=>{r=null}),le())},i(n){t||(S(r),t=!0)},o(n){A(r),t=!1},d(n){r&&r.d(n),n&&y(e)}}}function jf(s){let e,t,r,n,i,l,a;function o(d,h){return d[12]===0?Uf:Mf}let c=o(s),u=c(s),f=s[12]>0&&ci(s);return{c(){e=b("input"),t=$(),r=b("label"),u.c(),n=$(),f&&f.c(),i=ge(),p(e,"type","file"),p(e,"id","pdfUpload"),p(e,"accept","application/pdf"),p(e,"class","file-input"),p(r,"for","pdfUpload"),p(r,"class","file-label bg-chat rounded py-2 px-4 mx-1 cursor-pointer hover:bg-hover2 transition-colors")},m(d,h){k(d,e,h),s[42](e),k(d,t,h),k(d,r,h),u.m(r,null),k(d,n,h),f&&f.m(d,h),k(d,i,h),l||(a=L(e,"change",s[41]),l=!0)},p(d,h){c===(c=o(d))&&u?u.p(d,h):(u.d(1),u=c(d),u&&(u.c(),u.m(r,null))),d[12]>0?f?f.p(d,h):(f=ci(d),f.c(),f.m(i.parentNode,i)):f&&(f.d(1),f=null)},d(d){d&&y(e),s[42](null),d&&y(t),d&&y(r),u.d(),d&&y(n),f&&f.d(d),d&&y(i),l=!1,a()}}}function Ff(s){let e,t,r,n,i,l,a;function o(d,h){return d[11]>0?Vf:Bf}let c=o(s),u=c(s),f=s[11]>0&&ui(s);return{c(){e=b("input"),t=$(),r=b("label"),u.c(),n=$(),f&&f.c(),i=ge(),p(e,"type","file"),p(e,"id","imageUpload"),e.multiple=!0,p(e,"accept","image/*"),p(e,"class","file-input"),p(r,"for","imageUpload"),p(r,"class","file-label bg-chat rounded py-2 px-4 mx-1 cursor-pointer hover:bg-hover2 transition-colors")},m(d,h){k(d,e,h),s[40](e),k(d,t,h),k(d,r,h),u.m(r,null),k(d,n,h),f&&f.m(d,h),k(d,i,h),l||(a=L(e,"change",ea),l=!0)},p(d,h){c===(c=o(d))&&u?u.p(d,h):(u.d(1),u=c(d),u&&(u.c(),u.m(r,null))),d[11]>0?f?f.p(d,h):(f=ui(d),f.c(),f.m(i.parentNode,i)):f&&(f.d(1),f=null)},d(d){d&&y(e),s[40](null),d&&y(t),d&&y(r),u.d(),d&&y(n),f&&f.d(d),d&&y(i),l=!1,a()}}}function Mf(s){let e,t;return{c(){e=b("span"),t=ae(s[12]),p(e,"class","fileCount")},m(r,n){k(r,e,n),g(e,t)},p(r,n){n[0]&4096&&Pe(t,r[12])},d(r){r&&y(e)}}}function Uf(s){let e,t;return{c(){e=b("img"),Ae(e.src,t=mf)||p(e,"src",t),p(e,"alt","PDF"),p(e,"class","pdf-icon icon-white")},m(r,n){k(r,e,n)},p:U,d(r){r&&y(e)}}}function ci(s){let e,t,r;return{c(){e=b("button"),e.textContent="X",p(e,"class","clear-btn px-4 rounded-lg bg-red-700 mx-2 hover:bg-red-500")},m(n,i){k(n,e,i),t||(r=L(e,"click",s[20]),t=!0)},p:U,d(n){n&&y(e),t=!1,r()}}}function Bf(s){let e,t;return{c(){e=b("img"),Ae(e.src,t=pf)||p(e,"src",t),p(e,"alt","Upload"),p(e,"class","upload-icon icon-white")},m(r,n){k(r,e,n)},p:U,d(r){r&&y(e)}}}function Vf(s){let e,t;return{c(){e=b("span"),t=ae(s[11]),p(e,"class","fileCount")},m(r,n){k(r,e,n),g(e,t)},p(r,n){n[0]&2048&&Pe(t,r[11])},d(r){r&&y(e)}}}function ui(s){let e,t,r;return{c(){e=b("button"),e.textContent="X",p(e,"class","clear-btn")},m(n,i){k(n,e,i),t||(r=L(e,"click",s[20]),t=!0)},p:U,d(n){n&&y(e),t=!1,r()}}}function Df(s){let e,t;return{c(){e=b("img"),p(e,"class","icon-white min-w-[24px] w-[24px]"),p(e,"alt","Send"),Ae(e.src,t=df)||p(e,"src",t)},m(r,n){k(r,e,n)},p:U,d(r){r&&y(e)}}}function Lf(s){let e,t;return{c(){e=b("img"),p(e,"class","icon-white min-w-[24px] w-[24px]"),p(e,"alt","Wait"),Ae(e.src,t=hf)||p(e,"src",t)},m(r,n){k(r,e,n)},p:U,d(r){r&&y(e)}}}function Nf(s){let e,t,r,n,i,l,a,o,c,u,f,d,h,_,m,w,v,E,P,O,F,C,N,ce,G,ne,oe,se,Oe,Te,ve,Ee,R;function D(x,ue){return x[3].length>0&&x[3][x[2]]?Of:kf}let z=D(s),B=z(s),J=s[15]&&ni(),H=s[16]&&ri();l=new Pa({}),l.$on("new-chat",s[30]);function Ce(x){s[31](x)}let Be={};s[8]!==void 0&&(Be.conversation_title=s[8]),c=new va({props:Be}),ut.push(()=>fl(c,"conversation_title",Ce)),c.$on("new-chat",Ri);const Ke=[Af,Sf],Ve=[];function M(x,ue){return x[3].length>0&&x[3][x[2]]?0:1}P=M(s),O=Ve[P]=Ke[P](s);function Se(x,ue){if(x[14])return Ff;if(x[13])return jf}let be=Se(s),Q=be&&be(s);function Qe(x,ue){return x[18]?Lf:Df}let De=Qe(s),Le=De(s);return{c(){e=b("title"),B.c(),t=$(),J&&J.c(),r=$(),H&&H.c(),n=$(),i=b("main"),K(l.$$.fragment),a=$(),o=b("div"),K(c.$$.fragment),f=$(),d=b("div"),h=b("div"),_=ae("Current Model: "),m=b("span"),w=ae(s[17]),v=$(),E=b("div"),O.c(),F=$(),C=b("div"),N=b("div"),Q&&Q.c(),ce=$(),G=b("textarea"),ne=$(),oe=b("button"),Le.c(),Oe=$(),Te=b("div"),Te.innerHTML='
Enjoying SmoothGPT? Contribute to hosting costs & check out my creative work: ko-fi.com/loreteller
',p(m,"class","font-normal"),p(h,"class","font-bold text-l"),p(d,"class","py-5 bg-primary px-5 flex flex-row justify-between flex-wrap-reverse"),p(E,"class","flex bg-primary overflow-y-auto overflow-x-hidden justify-center grow"),p(G,"class","w-full min-h-[96px] h-24 rounded-lg p-2 mx-1 mr-0 border-t-2 border-b-2 border-l-2 rounded-r-none bg-primary border-gray-500 resize-none focus:outline-none"),p(G,"placeholder","Type your message..."),rt(G,"height","96px"),rt(G,"overflow-y","auto"),rt(G,"overflow","visible",1),p(oe,"class","bg-chat rounded-lg py-2 px-4 mx-1 ml-0 border-t-2 border-b-2 border-r-2 border-gray-500 rounded-l-none cursor-pointer "),oe.disabled=se=!s[18]&&!s[4].trim().length,p(N,"class","inputbox flex flex-1 bg-primary mt-auto mx-auto max-w-3xl mb-3"),p(C,"class","inputbox-container w-full flex justify-center items-center bg-primary"),p(Te,"class","flex justify-center bg-primary px-4"),p(o,"class","h-screen flex justify-stretch flex-col md:ml-[260px] bg-secondary text-white/80 height-manager"),p(i,"class","bg-primary overflow-hidden")},m(x,ue){k(x,e,ue),B.m(e,null),k(x,t,ue),J&&J.m(x,ue),k(x,r,ue),H&&H.m(x,ue),k(x,n,ue),k(x,i,ue),Y(l,i,null),g(i,a),g(i,o),Y(c,o,null),g(o,f),g(o,d),g(d,h),g(h,_),g(h,m),g(m,w),g(o,v),g(o,E),Ve[P].m(E,null),s[39](E),g(o,F),g(o,C),g(C,N),Q&&Q.m(N,null),g(N,ce),g(N,G),s[43](G),Xe(G,s[4]),g(N,ne),g(N,oe),Le.m(oe,null),g(o,Oe),g(o,Te),ve=!0,Ee||(R=[L(G,"input",s[44]),L(G,"input",Wi),L(G,"keydown",s[45]),L(oe,"click",s[46])],Ee=!0)},p(x,ue){z===(z=D(x))&&B?B.p(x,ue):(B.d(1),B=z(x),B&&(B.c(),B.m(e,null))),x[15]?J?(J.p(x,ue),ue[0]&32768&&S(J,1)):(J=ni(),J.c(),S(J,1),J.m(r.parentNode,r)):J&&(ie(),A(J,1,1,()=>{J=null}),le()),x[16]?H?ue[0]&65536&&S(H,1):(H=ri(),H.c(),S(H,1),H.m(n.parentNode,n)):H&&(ie(),A(H,1,1,()=>{H=null}),le());const et={};!u&&ue[0]&256&&(u=!0,et.conversation_title=x[8],cl(()=>u=!1)),c.$set(et),(!ve||ue[0]&131072)&&Pe(w,x[17]);let Fe=P;P=M(x),P===Fe?Ve[P].p(x,ue):(ie(),A(Ve[Fe],1,1,()=>{Ve[Fe]=null}),le(),O=Ve[P],O?O.p(x,ue):(O=Ve[P]=Ke[P](x),O.c()),S(O,1),O.m(E,null)),be===(be=Se(x))&&Q?Q.p(x,ue):(Q&&Q.d(1),Q=be&&be(x),Q&&(Q.c(),Q.m(N,ce))),ue[0]&16&&Xe(G,x[4]),De===(De=Qe(x))&&Le?Le.p(x,ue):(Le.d(1),Le=De(x),Le&&(Le.c(),Le.m(oe,null))),(!ve||ue[0]&262160&&se!==(se=!x[18]&&!x[4].trim().length))&&(oe.disabled=se)},i(x){ve||(S(J),S(H),S(l.$$.fragment,x),S(c.$$.fragment,x),S(O),ve=!0)},o(x){A(J),A(H),A(l.$$.fragment,x),A(c.$$.fragment,x),A(O),ve=!1},d(x){x&&y(e),B.d(),x&&y(t),J&&J.d(x),x&&y(r),H&&H.d(x),x&&y(n),x&&y(i),W(l),W(c),Ve[P].d(),s[39](null),Q&&Q.d(),s[43](null),Le.d(),Ee=!1,Ne(R)}}}const qf=300;function Wi(s){s.target.style.height="inherit";const e=window.getComputedStyle(s.target),t=parseInt(e.getPropertyValue("border-top-width"),10)+s.target.scrollHeight+parseInt(e.getPropertyValue("border-bottom-width"),10);s.target.style.height=`${Math.min(t,qf)}px`}function gr(s){return!/\s/.test(s)&&s.includes("blob.core.windows.net")&&/rsct=image\/(jpeg|jpg|gif|png|bmp)/i.test(s)}function zf(s,e,t){let r,n,i,l,a,o,c,u,f,d,h,_;fe(s,xe,T=>t(2,i=T)),fe(s,re,T=>t(3,l=T)),fe(s,Ft,T=>t(26,a=T)),fe(s,wt,T=>t(27,o=T)),fe(s,_s,T=>t(28,c=T)),fe(s,or,T=>t(29,u=T)),fe(s,dn,T=>t(15,f=T)),fe(s,hn,T=>t(16,d=T)),fe(s,$e,T=>t(17,h=T)),fe(s,Ue,T=>t(18,_=T));let m,w,v="",E,P,O,F="",C,N="",ce=null,G="";async function ne(T){O=T.target.files[0],O&&(t(25,F=await yf(O)),console.log(F))}function oe(){Ft.set([]),O=null,t(25,F=""),t(1,w.value="",w)}let se=null;function Oe(){if(!C)return;const T={childList:!0,subtree:!0,characterData:!0};se=new MutationObserver((Ye,at)=>{Te()}),se.observe(C,T)}vn(async()=>{await ua(),Oe()}),sl(()=>{se&&(se.disconnect(),se=null),fa()});function Te(){C&&C.scrollHeight-C.scrollTop-150<=C.clientHeight&&t(7,C.scrollTop=C.scrollHeight,C)}function ve(){ws(v,i,F),t(4,v=""),oe(),t(5,E.style.height="96px",E)}function Ee(){C&&t(7,C.scrollTop=C.scrollHeight,C)}let R=0;rl(()=>{const T=l[i]?.history.length||0;T>R&&Ee(),R=T});let D=0,z=0;function B(T){t(9,ce=T),t(10,G=l[i].history[T].content)}function J(){t(9,ce=null),t(10,G=""),t(6,P.style.height="96px",P)}function H(T){const Ye=G,at=l[i].history.length-T;for(let Dt=0;DtRi();function Be(T){N=T,t(8,N),t(2,i),t(3,l)}function Ke(T){ut[T?"unshift":"push"](()=>{P=T,t(6,P)})}function Ve(){G=this.value,t(10,G)}const M=T=>H(T),Se=()=>J(),be=T=>Bo(T.content),Q=T=>vs(T),Qe=T=>B(T);function De(T){ut[T?"unshift":"push"](()=>{C=T,t(7,C)})}function Le(T){ut[T?"unshift":"push"](()=>{m=T,t(0,m),t(29,u)})}const x=T=>ne(T);function ue(T){ut[T?"unshift":"push"](()=>{w=T,t(1,w),t(28,c)})}function et(T){ut[T?"unshift":"push"](()=>{E=T,t(5,E)})}function Fe(){v=this.value,t(4,v)}const bt=T=>{const Ye=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);!_&&T.key==="Enter"&&!T.shiftKey&&!T.ctrlKey&&!T.metaKey&&!Ye?(T.preventDefault(),ve()):!_&&T.key},Wt=()=>{_?ta():ve()};return s.$$.update=()=>{if(s.$$.dirty[0]&536870913&&u&&m&&(t(0,m.value="",m),or.set(!1)),s.$$.dirty[0]&268435458&&c&&w&&(t(1,w.value="",w),_s.set(!1)),s.$$.dirty[0]&12){const T=i,Ye=l,at=l.length;T!==void 0&&Ye[T]&&t(8,N=Ye[T].title||"New Conversation"),(T==null||T<0||T>=at)&&(console.log("changing conversation from ID",i),xe.set(at>0?at-1:null),console.log("to ID",i))}s.$$.dirty[0]&134217728&&t(14,r=o.includes("Vision")),s.$$.dirty[0]&134217728&&t(13,n=o.includes("GPT")),s.$$.dirty[0]&12&&t(8,N=l[i]?l[i].title:"ChatGPT"),s.$$.dirty[0]&67108864&&t(11,D=a.length),s.$$.dirty[0]&33554432&&(F?t(12,z=1):t(12,z=0))},[m,w,i,l,v,E,P,C,N,ce,G,D,z,n,r,f,d,h,_,ne,oe,ve,B,J,H,F,a,o,c,u,Ce,Be,Ke,Ve,M,Se,be,Q,Qe,De,Le,x,ue,et,Fe,bt,Wt]}class Hf extends ee{constructor(e){super(),X(this,e,zf,Nf,Z,{},null,[-1,-1])}}const Jf="/assets/chat-431b71cc.svg";new Hf({target:document.getElementById("app")});window.addEventListener("load",()=>{const s=document.querySelector('link[rel="icon"]');s&&s.setAttribute("href",Jf)});export{bf as _}; +Please report this to https://github.com/markedjs/marked.`,e.silent)return"

An error occurred:

"+je(t.message+"",!0)+"
";throw t}};q.Parser=it;q.parser=it.parse;q.Renderer=Tr;q.TextRenderer=Ni;q.Lexer=lt;q.lexer=lt.lex;q.Tokenizer=Pr;q.Slugger=$r;q.parse=q;q.options;q.setOptions;q.use;q.walkTokens;q.parseInline;it.parse;lt.lex;const qi={};function vc(s){let e;return{c(){e=ae(s[1])},m(t,r){k(t,e,r)},p(t,r){r&2&&Pe(e,t[1])},i:U,o:U,d(t){t&&y(e)}}}function wc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h6"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function yc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h5"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function kc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h4"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Oc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h3"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Sc(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h2"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Ac(s){let e,t;const r=s[5].default,n=de(r,s,s[4],null);return{c(){e=b("h1"),n&&n.c(),p(e,"id",s[2])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&16)&&pe(n,r,i,i[4],t?he(r,i[4],l,null):me(i[4]),null),(!t||l&4)&&p(e,"id",i[2])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Ec(s){let e,t,r,n;const i=[Ac,Sc,Oc,kc,yc,wc,vc],l=[];function a(o,c){return o[0]===1?0:o[0]===2?1:o[0]===3?2:o[0]===4?3:o[0]===5?4:o[0]===6?5:6}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ge()},m(o,c){l[e].m(o,c),k(o,r,c),n=!0},p(o,[c]){let u=e;e=a(o),e===u?l[e].p(o,c):(ie(),A(l[u],1,1,()=>{l[u]=null}),le(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),S(t,1),t.m(r.parentNode,r))},i(o){n||(S(t),n=!0)},o(o){A(t),n=!1},d(o){l[e].d(o),o&&y(r)}}}function Pc(s,e,t){let r,{$$slots:n={},$$scope:i}=e,{depth:l}=e,{raw:a}=e,{text:o}=e;const{slug:c,getOptions:u}=ll(qi),f=u();return s.$$set=d=>{"depth"in d&&t(0,l=d.depth),"raw"in d&&t(1,a=d.raw),"text"in d&&t(3,o=d.text),"$$scope"in d&&t(4,i=d.$$scope)},s.$$.update=()=>{s.$$.dirty&8&&t(2,r=f.headerIds?f.headerPrefix+c(o):void 0)},[l,a,r,o,i,n]}class Tc extends ee{constructor(e){super(),X(this,e,Pc,Ec,Z,{depth:0,raw:1,text:3})}}function $c(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("p"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Cc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}let Rc=class extends ee{constructor(e){super(),X(this,e,Cc,$c,Z,{})}};function xc(s){let e;const t=s[3].default,r=de(t,s,s[2],null);return{c(){r&&r.c()},m(n,i){r&&r.m(n,i),e=!0},p(n,[i]){r&&r.p&&(!e||i&4)&&pe(r,t,n,n[2],e?he(t,n[2],i,null):me(n[2]),null)},i(n){e||(S(r,n),e=!0)},o(n){A(r,n),e=!1},d(n){r&&r.d(n)}}}function Ic(s,e,t){let{$$slots:r={},$$scope:n}=e,{text:i}=e,{raw:l}=e;return s.$$set=a=>{"text"in a&&t(0,i=a.text),"raw"in a&&t(1,l=a.raw),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class jc extends ee{constructor(e){super(),X(this,e,Ic,xc,Z,{text:0,raw:1})}}function Fc(s){let e,t;return{c(){e=b("img"),Ae(e.src,t=s[0])||p(e,"src",t),p(e,"title",s[1]),p(e,"alt",s[2])},m(r,n){k(r,e,n)},p(r,[n]){n&1&&!Ae(e.src,t=r[0])&&p(e,"src",t),n&2&&p(e,"title",r[1]),n&4&&p(e,"alt",r[2])},i:U,o:U,d(r){r&&y(e)}}}function Mc(s,e,t){let{href:r=""}=e,{title:n=void 0}=e,{text:i=""}=e;return s.$$set=l=>{"href"in l&&t(0,r=l.href),"title"in l&&t(1,n=l.title),"text"in l&&t(2,i=l.text)},[r,n,i]}class Uc extends ee{constructor(e){super(),X(this,e,Mc,Fc,Z,{href:0,title:1,text:2})}}function Bc(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("a"),n&&n.c(),p(e,"href",s[0]),p(e,"title",s[1])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&1)&&p(e,"href",i[0]),(!t||l&2)&&p(e,"title",i[1])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Vc(s,e,t){let{$$slots:r={},$$scope:n}=e,{href:i=""}=e,{title:l=void 0}=e;return s.$$set=a=>{"href"in a&&t(0,i=a.href),"title"in a&&t(1,l=a.title),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class Dc extends ee{constructor(e){super(),X(this,e,Vc,Bc,Z,{href:0,title:1})}}function Lc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("em"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Nc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}let qc=class extends ee{constructor(e){super(),X(this,e,Nc,Lc,Z,{})}};function zc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("del"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Hc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Jc extends ee{constructor(e){super(),X(this,e,Hc,zc,Z,{})}}function Gc(s){let e,t=s[0].replace(/`/g,"")+"",r;return{c(){e=b("code"),r=ae(t)},m(n,i){k(n,e,i),g(e,r)},p(n,[i]){i&1&&t!==(t=n[0].replace(/`/g,"")+"")&&Pe(r,t)},i:U,o:U,d(n){n&&y(e)}}}function Qc(s,e,t){let{raw:r}=e;return s.$$set=n=>{"raw"in n&&t(0,r=n.raw)},[r]}class Yc extends ee{constructor(e){super(),X(this,e,Qc,Gc,Z,{raw:0})}}function Wc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("strong"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Kc(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Zc extends ee{constructor(e){super(),X(this,e,Kc,Wc,Z,{})}}function Xc(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("table"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function eu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class tu extends ee{constructor(e){super(),X(this,e,eu,Xc,Z,{})}}function nu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("thead"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function ru(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class su extends ee{constructor(e){super(),X(this,e,ru,nu,Z,{})}}function iu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("tbody"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function lu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class ou extends ee{constructor(e){super(),X(this,e,lu,iu,Z,{})}}function au(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("tr"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function cu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class uu extends ee{constructor(e){super(),X(this,e,cu,au,Z,{})}}function fu(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("td"),n&&n.c(),p(e,"align",s[1])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&2)&&p(e,"align",i[1])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function du(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("th"),n&&n.c(),p(e,"align",s[1])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&2)&&p(e,"align",i[1])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function hu(s){let e,t,r,n;const i=[du,fu],l=[];function a(o,c){return o[0]?0:1}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ge()},m(o,c){l[e].m(o,c),k(o,r,c),n=!0},p(o,[c]){let u=e;e=a(o),e===u?l[e].p(o,c):(ie(),A(l[u],1,1,()=>{l[u]=null}),le(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),S(t,1),t.m(r.parentNode,r))},i(o){n||(S(t),n=!0)},o(o){A(t),n=!1},d(o){l[e].d(o),o&&y(r)}}}function pu(s,e,t){let{$$slots:r={},$$scope:n}=e,{header:i}=e,{align:l}=e;return s.$$set=a=>{"header"in a&&t(0,i=a.header),"align"in a&&t(1,l=a.align),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class mu extends ee{constructor(e){super(),X(this,e,pu,hu,Z,{header:0,align:1})}}function gu(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("ul"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function _u(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("ol"),n&&n.c(),p(e,"start",s[1])},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&2)&&p(e,"start",i[1])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function bu(s){let e,t,r,n;const i=[_u,gu],l=[];function a(o,c){return o[0]?0:1}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ge()},m(o,c){l[e].m(o,c),k(o,r,c),n=!0},p(o,[c]){let u=e;e=a(o),e===u?l[e].p(o,c):(ie(),A(l[u],1,1,()=>{l[u]=null}),le(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),S(t,1),t.m(r.parentNode,r))},i(o){n||(S(t),n=!0)},o(o){A(t),n=!1},d(o){l[e].d(o),o&&y(r)}}}function vu(s,e,t){let{$$slots:r={},$$scope:n}=e,{ordered:i}=e,{start:l}=e;return s.$$set=a=>{"ordered"in a&&t(0,i=a.ordered),"start"in a&&t(1,l=a.start),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class wu extends ee{constructor(e){super(),X(this,e,vu,bu,Z,{ordered:0,start:1})}}function yu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("li"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function ku(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}let Ou=class extends ee{constructor(e){super(),X(this,e,ku,yu,Z,{})}};function Su(s){let e;return{c(){e=b("hr")},m(t,r){k(t,e,r)},p:U,i:U,o:U,d(t){t&&y(e)}}}class Au extends ee{constructor(e){super(),X(this,e,null,Su,Z,{})}}function Eu(s){let e,t;return{c(){e=new nl(!1),t=ge(),e.a=t},m(r,n){e.m(s[0],r,n),k(r,t,n)},p(r,[n]){n&1&&e.p(r[0])},i:U,o:U,d(r){r&&y(t),r&&e.d()}}}function Pu(s,e,t){let{text:r}=e;return s.$$set=n=>{"text"in n&&t(0,r=n.text)},[r]}let Tu=class extends ee{constructor(e){super(),X(this,e,Pu,Eu,Z,{text:0})}};function $u(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("blockquote"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Cu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Ru extends ee{constructor(e){super(),X(this,e,Cu,$u,Z,{})}}function xu(s){let e,t,r;return{c(){e=b("pre"),t=b("code"),r=ae(s[1]),p(e,"class",s[0])},m(n,i){k(n,e,i),g(e,t),g(t,r)},p(n,[i]){i&2&&Pe(r,n[1]),i&1&&p(e,"class",n[0])},i:U,o:U,d(n){n&&y(e)}}}function Iu(s,e,t){let{lang:r}=e,{text:n}=e;return s.$$set=i=>{"lang"in i&&t(0,r=i.lang),"text"in i&&t(1,n=i.text)},[r,n]}let ju=class extends ee{constructor(e){super(),X(this,e,Iu,xu,Z,{lang:0,text:1})}};function Fu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("br"),n&&n.c()},m(i,l){k(i,e,l),n&&n.m(i,l),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Mu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Uu extends ee{constructor(e){super(),X(this,e,Mu,Fu,Z,{})}}const Bu={heading:Tc,paragraph:Rc,text:jc,image:Uc,link:Dc,em:qc,strong:Zc,codespan:Yc,del:Jc,table:tu,tablehead:su,tablebody:ou,tablerow:uu,tablecell:mu,list:wu,orderedlistitem:null,unorderedlistitem:null,listitem:Ou,hr:Au,html:Tu,blockquote:Ru,code:ju,br:Uu},Vu={baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,xhtml:!1};function Du(s){let e,t;return e=new St({props:{tokens:s[0],renderers:s[1]}}),{c(){K(e.$$.fragment)},m(r,n){Y(e,r,n),t=!0},p(r,[n]){const i={};n&1&&(i.tokens=r[0]),n&2&&(i.renderers=r[1]),e.$set(i)},i(r){t||(S(e.$$.fragment,r),t=!0)},o(r){A(e.$$.fragment,r),t=!1},d(r){W(e,r)}}}function Lu(s,e,t){let r,n,i,l,{source:a=[]}=e,{renderers:o={}}=e,{options:c={}}=e,{isInline:u=!1}=e;const f=wn();let d,h,_;return il(qi,{slug:m=>n?n.slug(m):"",getOptions:()=>i}),vn(()=>{t(7,_=!0)}),s.$$set=m=>{"source"in m&&t(2,a=m.source),"renderers"in m&&t(3,o=m.renderers),"options"in m&&t(4,c=m.options),"isInline"in m&&t(5,u=m.isInline)},s.$$.update=()=>{s.$$.dirty&4&&t(8,r=Array.isArray(a)),s.$$.dirty&4&&(n=a?new $r:void 0),s.$$.dirty&16&&t(9,i={...Vu,...c}),s.$$.dirty&869&&(r?t(0,d=a):(t(6,h=new lt(i)),t(0,d=u?h.inlineTokens(a):h.lex(a)),f("parsed",{tokens:d}))),s.$$.dirty&8&&t(1,l={...Bu,...o}),s.$$.dirty&385&&_&&!r&&f("parsed",{tokens:d})},[d,l,a,o,c,u,h,_,r,i]}class zi extends ee{constructor(e){super(),X(this,e,Lu,Du,Z,{source:2,renderers:3,options:4,isInline:5})}}function Nu(s){let e,t,r,n,i,l,a,o,c;return{c(){e=b("div"),t=b("div"),r=b("button"),r.textContent="Copy code",n=$(),i=b("pre"),l=b("code"),a=ae(s[0]),p(r,"class","svelte-hssbda"),p(t,"class","copycode svelte-hssbda"),p(i,"class","svelte-hssbda"),rt(e,"position","relative")},m(u,f){k(u,e,f),g(e,t),g(t,r),g(e,n),g(e,i),g(i,l),g(l,a),o||(c=L(r,"click",s[1]),o=!0)},p(u,[f]){f&1&&Pe(a,u[0])},i:U,o:U,d(u){u&&y(e),o=!1,c()}}}function qu(s,e,t){let{text:r}=e;const n=async()=>{try{await navigator.clipboard.writeText(r)}catch(i){console.error("Error copying text: ",i)}};return s.$$set=i=>{"text"in i&&t(0,r=i.text)},[r,n]}class zu extends ee{constructor(e){super(),X(this,e,qu,Nu,Z,{text:0})}}function Hu(s){let e,t;return{c(){e=b("div"),t=ae(s[0]),rt(e,"position","relative")},m(r,n){k(r,e,n),g(e,t)},p(r,[n]){n&1&&Pe(t,r[0])},i:U,o:U,d(r){r&&y(e)}}}function Ju(s,e,t){let{text:r}=e;return s.$$set=n=>{"text"in n&&t(0,r=n.text)},[r]}class Gu extends ee{constructor(e){super(),X(this,e,Ju,Hu,Z,{text:0})}}function Qu(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("em"),n&&n.c(),p(e,"class","svelte-djznuz")},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Yu(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Hi extends ee{constructor(e){super(),X(this,e,Yu,Qu,Z,{})}}function Wu(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("ul"),n&&n.c(),p(e,"class","svelte-1dicnom")},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Ku(s){let e,t;const r=s[3].default,n=de(r,s,s[2],null);return{c(){e=b("ol"),n&&n.c(),p(e,"start",s[1]),p(e,"class","svelte-1dicnom")},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,l){n&&n.p&&(!t||l&4)&&pe(n,r,i,i[2],t?he(r,i[2],l,null):me(i[2]),null),(!t||l&2)&&p(e,"start",i[1])},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function Zu(s){let e,t,r,n;const i=[Ku,Wu],l=[];function a(o,c){return o[0]?0:1}return e=a(s),t=l[e]=i[e](s),{c(){t.c(),r=ge()},m(o,c){l[e].m(o,c),k(o,r,c),n=!0},p(o,[c]){let u=e;e=a(o),e===u?l[e].p(o,c):(ie(),A(l[u],1,1,()=>{l[u]=null}),le(),t=l[e],t?t.p(o,c):(t=l[e]=i[e](o),t.c()),S(t,1),t.m(r.parentNode,r))},i(o){n||(S(t),n=!0)},o(o){A(t),n=!1},d(o){l[e].d(o),o&&y(r)}}}function Xu(s,e,t){let{$$slots:r={},$$scope:n}=e,{ordered:i}=e,{start:l}=e;return s.$$set=a=>{"ordered"in a&&t(0,i=a.ordered),"start"in a&&t(1,l=a.start),"$$scope"in a&&t(2,n=a.$$scope)},[i,l,n,r]}class Ji extends ee{constructor(e){super(),X(this,e,Xu,Zu,Z,{ordered:0,start:1})}}function ef(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("li"),n&&n.c(),p(e,"class","svelte-fm7yqp")},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function tf(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Gi extends ee{constructor(e){super(),X(this,e,tf,ef,Z,{})}}function nf(s){let e,t=s[0].replace(/`/g,"")+"",r;return{c(){e=b("code"),r=ae(t),p(e,"class","svelte-we39e")},m(n,i){k(n,e,i),g(e,r)},p(n,[i]){i&1&&t!==(t=n[0].replace(/`/g,"")+"")&&Pe(r,t)},i:U,o:U,d(n){n&&y(e)}}}function rf(s,e,t){let{raw:r}=e;return s.$$set=n=>{"raw"in n&&t(0,r=n.raw)},[r]}class sf extends ee{constructor(e){super(),X(this,e,rf,nf,Z,{raw:0})}}function lf(s){let e,t;const r=s[1].default,n=de(r,s,s[0],null);return{c(){e=b("p"),n&&n.c(),p(e,"class","svelte-jw73bw")},m(i,l){k(i,e,l),n&&n.m(e,null),t=!0},p(i,[l]){n&&n.p&&(!t||l&1)&&pe(n,r,i,i[0],t?he(r,i[0],l,null):me(i[0]),null)},i(i){t||(S(n,i),t=!0)},o(i){A(n,i),t=!1},d(i){i&&y(e),n&&n.d(i)}}}function of(s,e,t){let{$$slots:r={},$$scope:n}=e;return s.$$set=i=>{"$$scope"in i&&t(0,n=i.$$scope)},[n,r]}class Qi extends ee{constructor(e){super(),X(this,e,of,lf,Z,{})}}function af(s){let e;return{c(){e=ae(s[0])},m(t,r){k(t,e,r)},p(t,[r]){r&1&&Pe(e,t[0])},i:U,o:U,d(t){t&&y(e)}}}function cf(s,e,t){let{text:r}=e;return s.$$set=n=>{"text"in n&&t(0,r=n.text)},[r]}class Yi extends ee{constructor(e){super(),X(this,e,cf,af,Z,{text:0})}}const uf="/assets/delete-f3f148b5.svg",ff="/assets/CopyIcon-6270aedf.svg",Zs="/assets/UserIcon-57b535eb.svg",Xs="/assets/RobotIcon-76293781.svg",df="/assets/send-8e88dbd9.svg",hf="/assets/wait-8f30b8f8.svg",pf="/assets/upload-icon-8c25e619.svg",mf="/assets/pdf-icon-d4c18e5d.svg",gf="modulepreload",_f=function(s){return"/"+s},ei={},bf=function(e,t,r){if(!t||t.length===0)return e();const n=document.getElementsByTagName("link");return Promise.all(t.map(i=>{if(i=_f(i),i in ei)return;ei[i]=!0;const l=i.endsWith(".css"),a=l?'[rel="stylesheet"]':"";if(!!r)for(let u=n.length-1;u>=0;u--){const f=n[u];if(f.href===i&&(!l||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${a}`))return;const c=document.createElement("link");if(c.rel=l?"stylesheet":gf,l||(c.as="script",c.crossOrigin=""),c.href=i,document.head.appendChild(c),l)return new Promise((u,f)=>{c.addEventListener("load",u),c.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>e())};async function vf(){const s=await bf(()=>import("./pdf-36ee9169.js"),[]);return s.GlobalWorkerOptions.workerSrc="/workers/pdf.worker.min.mjs",s}function wf(s){const t=/^D:(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/.exec(s);if(t){const r=parseInt(t[1],10),n=parseInt(t[2],10)-1,i=parseInt(t[3],10),l=parseInt(t[4],10),a=parseInt(t[5],10),o=parseInt(t[6],10);return new Date(r,n,i,l,a,o).toISOString().split("T")[0]}return"Unknown Date"}async function yf(s){try{const e=new FileReader,t=await vf();return new Promise((r,n)=>{e.onload=async i=>{const l=new Uint8Array(i.target.result),o=await t.getDocument({data:l}).promise,c=o.numPages;let u="";for(let E=1;E<=c;E++){const O=await(await o.getPage(E)).getTextContent();u+=O.items.map(F=>"str"in F?F.str:"").join(" ")}const f=u.split(/\s+/).length,h=(await o.getMetadata()).info,_=s.name,m=h.Title||"Untitled",w=h.Author||"Unknown Author",v=h.CreationDate?wf(h.CreationDate):"Unknown Date";r(`The user uploaded a PDF titled "${m}" with a file name of "${_}". It has ${c} pages and ${f} words. File metadata includes Author: "${w}" and creation date: ${v}. The extracted text is as follows: ${u}`)},e.onerror=n,e.readAsArrayBuffer(s)})}catch(e){return console.error("Error processing PDF:",e),Promise.reject("Failed to load the PDF file.")}}function ti(s,e,t){const r=s.slice();return r[53]=e[t],r[55]=t,r}function kf(s){let e;return{c(){e=ae("SmoothGPT")},m(t,r){k(t,e,r)},p:U,d(t){t&&y(e)}}}function Of(s){let e=(s[3][s[2]].title||"SmoothGPT")+"",t;return{c(){t=ae(e)},m(r,n){k(r,t,n)},p(r,n){n[0]&12&&e!==(e=(r[3][r[2]].title||"SmoothGPT")+"")&&Pe(t,e)},d(r){r&&y(t)}}}function ni(s){let e,t;return e=new Ca({}),e.$on("settings-changed",ra),{c(){K(e.$$.fragment)},m(r,n){Y(e,r,n),t=!0},p:U,i(r){t||(S(e.$$.fragment,r),t=!0)},o(r){A(e.$$.fragment,r),t=!1},d(r){W(e,r)}}}function ri(s){let e,t;return e=new Ia({}),{c(){K(e.$$.fragment)},m(r,n){Y(e,r,n),t=!0},i(r){t||(S(e.$$.fragment,r),t=!0)},o(r){A(e.$$.fragment,r),t=!1},d(r){W(e,r)}}}function Sf(s){let e;return{c(){e=b("div"),e.innerHTML="

No conversation selected. Start a new conversation.

",p(e,"class","flex justify-center items-center h-full")},m(t,r){k(t,e,r)},p:U,i:U,o:U,d(t){t&&y(e)}}}function Af(s){let e,t,r,n=s[3][s[2]].history,i=[];for(let a=0;aA(i[a],1,1,()=>{i[a]=null});return{c(){e=b("div"),t=b("div");for(let a=0;a{v[F]=null}),le(),u=v[c],u?u.p(P,O):(u=v[c]=w[c](P),u.c()),S(u,1),u.m(e,f))},i(P){d||(S(u),d=!0)},o(P){A(u),d=!1},d(P){P&&y(e),m.d(),v[c].d()}}}function Ef(s){let e;return{c(){e=ae("You")},m(t,r){k(t,e,r)},d(t){t&&y(e)}}}function Pf(s){let e;return{c(){e=ae("ChatGPT")},m(t,r){k(t,e,r)},d(t){t&&y(e)}}}function Tf(s){let e,t,r,n,i,l,a,o,c;const u=[If,xf,Rf,Cf],f=[];function d(m,w){return w[0]&12&&(t=null),w[0]&12&&(r=null),t==null&&(t=!!gr(m[53].content)),t?0:(r==null&&(r=!!ar(m[53])),r?1:m[53].role==="assistant"?2:3)}n=d(s,[-1,-1]),i=f[n]=u[n](s);let h=s[53].role==="assistant"&&ii(s),_=s[53].role==="user"&&oi(s);return{c(){e=b("div"),i.c(),l=$(),a=b("div"),h&&h.c(),o=$(),_&&_.c(),p(e,"class","message-display pl-20 pr-5 md:px-20 text-[1rem]"),p(a,"class","toolbelt flex space-x-2 pl-20 mb-2 tools")},m(m,w){k(m,e,w),f[n].m(e,null),k(m,l,w),k(m,a,w),h&&h.m(a,null),g(a,o),_&&_.m(a,null),c=!0},p(m,w){let v=n;n=d(m,w),n===v?f[n].p(m,w):(ie(),A(f[v],1,1,()=>{f[v]=null}),le(),i=f[n],i?i.p(m,w):(i=f[n]=u[n](m),i.c()),S(i,1),i.m(e,null)),m[53].role==="assistant"?h?h.p(m,w):(h=ii(m),h.c(),h.m(a,o)):h&&(h.d(1),h=null),m[53].role==="user"?_?_.p(m,w):(_=oi(m),_.c(),_.m(a,null)):_&&(_.d(1),_=null)},i(m){c||(S(i),c=!0)},o(m){A(i),c=!1},d(m){m&&y(e),f[n].d(),m&&y(l),m&&y(a),h&&h.d(),_&&_.d()}}}function $f(s){let e,t,r,n,i,l,a,o,c,u;function f(){return s[34](s[55])}return{c(){e=b("textarea"),t=$(),r=b("div"),n=b("button"),i=ae("Submit"),a=$(),o=b("button"),o.textContent="Cancel",p(e,"class","message-edit-textarea mt-2 bg-gray-700 p-3 mx-10 resize-none focus:outline-none rounded-lg"),rt(e,"height","96px"),rt(e,"overflow-y","auto"),p(n,"class",l="submit-edit rounded-lg p-2 mr-2 "+(s[18]?"bg-gray-500 cursor-not-allowed hover:bg-gray-500":"hover:bg-green-500 bg-green-700")),n.disabled=s[18],p(o,"class","cancel-edit bg-gray-700 hover:bg-gray-500 rounded-lg p-2 mr-2"),p(r,"class","flex place-content-center mt-4")},m(d,h){k(d,e,h),s[32](e),Xe(e,s[10]),k(d,t,h),k(d,r,h),g(r,n),g(n,i),g(r,a),g(r,o),c||(u=[L(e,"input",s[33]),L(e,"input",Wi),L(n,"click",f),L(o,"click",s[35])],c=!0)},p(d,h){s=d,h[0]&1024&&Xe(e,s[10]),h[0]&262144&&l!==(l="submit-edit rounded-lg p-2 mr-2 "+(s[18]?"bg-gray-500 cursor-not-allowed hover:bg-gray-500":"hover:bg-green-500 bg-green-700"))&&p(n,"class",l),h[0]&262144&&(n.disabled=s[18])},i:U,o:U,d(d){d&&y(e),s[32](null),d&&y(t),d&&y(r),c=!1,Ne(u)}}}function Cf(s){let e,t;return e=new zi({props:{renderers:{code:Gu,codespan:sf,em:Hi,list:Ji,listitem:Gi,paragraph:Qi,html:Yi},source:gn(s[53].content.toString())}}),{c(){K(e.$$.fragment)},m(r,n){Y(e,r,n),t=!0},p(r,n){const i={};n[0]&12&&(i.source=gn(r[53].content.toString())),e.$set(i)},i(r){t||(S(e.$$.fragment,r),t=!0)},o(r){A(e.$$.fragment,r),t=!1},d(r){W(e,r)}}}function Rf(s){let e,t;return e=new zi({props:{renderers:{code:zu,em:Hi,list:Ji,listitem:Gi,paragraph:Qi,html:Yi},source:gn(s[53].content.toString())}}),{c(){K(e.$$.fragment)},m(r,n){Y(e,r,n),t=!0},p(r,n){const i={};n[0]&12&&(i.source=gn(r[53].content.toString())),e.$set(i)},i(r){t||(S(e.$$.fragment,r),t=!0)},o(r){A(e.$$.fragment,r),t=!1},d(r){W(e,r)}}}function xf(s){let e,t,r;return t=new pa({props:{audioUrl:s[53].audioUrl}}),{c(){e=b("div"),K(t.$$.fragment),p(e,"class","pb-3")},m(n,i){k(n,e,i),Y(t,e,null),r=!0},p(n,i){const l={};i[0]&12&&(l.audioUrl=n[53].audioUrl),t.$set(l)},i(n){r||(S(t.$$.fragment,n),r=!0)},o(n){A(t.$$.fragment,n),r=!1},d(n){n&&y(e),W(t)}}}function If(s){let e,t,r,n;return{c(){e=b("img"),r=$(),n=b("div"),n.textContent="This image will be available for 60 minutes. Right click + save as!",Ae(e.src,t=s[53].content)||p(e,"src",t),p(e,"alt","Generated"),p(e,"class","max-w-full h-auto my-3"),p(n,"class","text-sm text-gray-500")},m(i,l){k(i,e,l),k(i,r,l),k(i,n,l)},p(i,l){l[0]&12&&!Ae(e.src,t=i[53].content)&&p(e,"src",t)},i:U,o:U,d(i){i&&y(e),i&&y(r),i&&y(n)}}}function ii(s){let e=!ar(s[53])&&!gr(s[53].content),t,r,n,i,l,a,o=e&&li(s);function c(){return s[37](s[55])}return{c(){o&&o.c(),t=$(),r=b("button"),n=b("img"),p(n,"class","delete-icon"),p(n,"alt","Delete"),Ae(n.src,i=uf)||p(n,"src",i),p(r,"class","deleteButton w-5")},m(u,f){o&&o.m(u,f),k(u,t,f),k(u,r,f),g(r,n),l||(a=L(r,"click",c),l=!0)},p(u,f){s=u,f[0]&12&&(e=!ar(s[53])&&!gr(s[53].content)),e?o?o.p(s,f):(o=li(s),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(u){o&&o.d(u),u&&y(t),u&&y(r),l=!1,a()}}}function li(s){let e,t,r,n,i;function l(){return s[36](s[53])}return{c(){e=b("button"),t=b("img"),p(t,"class","copy-icon"),p(t,"alt","Copy"),Ae(t.src,r=ff)||p(t,"src",r),p(e,"class","copyButton w-5")},m(a,o){k(a,e,o),g(e,t),n||(i=L(e,"click",l),n=!0)},p(a,o){s=a},d(a){a&&y(e),n=!1,i()}}}function oi(s){let e,t,r,n,i;function l(){return s[38](s[55])}return{c(){e=b("button"),t=b("img"),p(t,"class","edit-icon"),p(t,"alt","edit"),Ae(t.src,r=Mi)||p(t,"src",r),p(e,"class","editButton w-5")},m(a,o){k(a,e,o),g(e,t),n||(i=L(e,"click",l),n=!0)},p(a,o){s=a},d(a){a&&y(e),n=!1,i()}}}function ai(s){let e,t,r=s[53].role!=="system"&&si(s);return{c(){r&&r.c(),e=ge()},m(n,i){r&&r.m(n,i),k(n,e,i),t=!0},p(n,i){n[53].role!=="system"?r?(r.p(n,i),i[0]&12&&S(r,1)):(r=si(n),r.c(),S(r,1),r.m(e.parentNode,e)):r&&(ie(),A(r,1,1,()=>{r=null}),le())},i(n){t||(S(r),t=!0)},o(n){A(r),t=!1},d(n){r&&r.d(n),n&&y(e)}}}function jf(s){let e,t,r,n,i,l,a;function o(d,h){return d[12]===0?Uf:Mf}let c=o(s),u=c(s),f=s[12]>0&&ci(s);return{c(){e=b("input"),t=$(),r=b("label"),u.c(),n=$(),f&&f.c(),i=ge(),p(e,"type","file"),p(e,"id","pdfUpload"),p(e,"accept","application/pdf"),p(e,"class","file-input"),p(r,"for","pdfUpload"),p(r,"class","file-label bg-chat rounded py-2 px-4 mx-1 cursor-pointer hover:bg-hover2 transition-colors")},m(d,h){k(d,e,h),s[42](e),k(d,t,h),k(d,r,h),u.m(r,null),k(d,n,h),f&&f.m(d,h),k(d,i,h),l||(a=L(e,"change",s[41]),l=!0)},p(d,h){c===(c=o(d))&&u?u.p(d,h):(u.d(1),u=c(d),u&&(u.c(),u.m(r,null))),d[12]>0?f?f.p(d,h):(f=ci(d),f.c(),f.m(i.parentNode,i)):f&&(f.d(1),f=null)},d(d){d&&y(e),s[42](null),d&&y(t),d&&y(r),u.d(),d&&y(n),f&&f.d(d),d&&y(i),l=!1,a()}}}function Ff(s){let e,t,r,n,i,l,a;function o(d,h){return d[11]>0?Vf:Bf}let c=o(s),u=c(s),f=s[11]>0&&ui(s);return{c(){e=b("input"),t=$(),r=b("label"),u.c(),n=$(),f&&f.c(),i=ge(),p(e,"type","file"),p(e,"id","imageUpload"),e.multiple=!0,p(e,"accept","image/*"),p(e,"class","file-input"),p(r,"for","imageUpload"),p(r,"class","file-label bg-chat rounded py-2 px-4 mx-1 cursor-pointer hover:bg-hover2 transition-colors")},m(d,h){k(d,e,h),s[40](e),k(d,t,h),k(d,r,h),u.m(r,null),k(d,n,h),f&&f.m(d,h),k(d,i,h),l||(a=L(e,"change",ea),l=!0)},p(d,h){c===(c=o(d))&&u?u.p(d,h):(u.d(1),u=c(d),u&&(u.c(),u.m(r,null))),d[11]>0?f?f.p(d,h):(f=ui(d),f.c(),f.m(i.parentNode,i)):f&&(f.d(1),f=null)},d(d){d&&y(e),s[40](null),d&&y(t),d&&y(r),u.d(),d&&y(n),f&&f.d(d),d&&y(i),l=!1,a()}}}function Mf(s){let e,t;return{c(){e=b("span"),t=ae(s[12]),p(e,"class","fileCount")},m(r,n){k(r,e,n),g(e,t)},p(r,n){n[0]&4096&&Pe(t,r[12])},d(r){r&&y(e)}}}function Uf(s){let e,t;return{c(){e=b("img"),Ae(e.src,t=mf)||p(e,"src",t),p(e,"alt","PDF"),p(e,"class","pdf-icon icon-white")},m(r,n){k(r,e,n)},p:U,d(r){r&&y(e)}}}function ci(s){let e,t,r;return{c(){e=b("button"),e.textContent="X",p(e,"class","clear-btn px-4 rounded-lg bg-red-700 mx-2 hover:bg-red-500")},m(n,i){k(n,e,i),t||(r=L(e,"click",s[20]),t=!0)},p:U,d(n){n&&y(e),t=!1,r()}}}function Bf(s){let e,t;return{c(){e=b("img"),Ae(e.src,t=pf)||p(e,"src",t),p(e,"alt","Upload"),p(e,"class","upload-icon icon-white")},m(r,n){k(r,e,n)},p:U,d(r){r&&y(e)}}}function Vf(s){let e,t;return{c(){e=b("span"),t=ae(s[11]),p(e,"class","fileCount")},m(r,n){k(r,e,n),g(e,t)},p(r,n){n[0]&2048&&Pe(t,r[11])},d(r){r&&y(e)}}}function ui(s){let e,t,r;return{c(){e=b("button"),e.textContent="X",p(e,"class","clear-btn")},m(n,i){k(n,e,i),t||(r=L(e,"click",s[20]),t=!0)},p:U,d(n){n&&y(e),t=!1,r()}}}function Df(s){let e,t;return{c(){e=b("img"),p(e,"class","icon-white min-w-[24px] w-[24px]"),p(e,"alt","Send"),Ae(e.src,t=df)||p(e,"src",t)},m(r,n){k(r,e,n)},p:U,d(r){r&&y(e)}}}function Lf(s){let e,t;return{c(){e=b("img"),p(e,"class","icon-white min-w-[24px] w-[24px]"),p(e,"alt","Wait"),Ae(e.src,t=hf)||p(e,"src",t)},m(r,n){k(r,e,n)},p:U,d(r){r&&y(e)}}}function Nf(s){let e,t,r,n,i,l,a,o,c,u,f,d,h,_,m,w,v,E,P,O,F,C,N,ce,G,ne,oe,se,Oe,Te,ve,Ee,R;function D(x,ue){return x[3].length>0&&x[3][x[2]]?Of:kf}let z=D(s),B=z(s),J=s[15]&&ni(),H=s[16]&&ri();l=new Pa({}),l.$on("new-chat",s[30]);function Ce(x){s[31](x)}let Be={};s[8]!==void 0&&(Be.conversation_title=s[8]),c=new va({props:Be}),ut.push(()=>fl(c,"conversation_title",Ce)),c.$on("new-chat",Ri);const Ke=[Af,Sf],Ve=[];function M(x,ue){return x[3].length>0&&x[3][x[2]]?0:1}P=M(s),O=Ve[P]=Ke[P](s);function Se(x,ue){if(x[14])return Ff;if(x[13])return jf}let be=Se(s),Q=be&&be(s);function Qe(x,ue){return x[18]?Lf:Df}let De=Qe(s),Le=De(s);return{c(){e=b("title"),B.c(),t=$(),J&&J.c(),r=$(),H&&H.c(),n=$(),i=b("main"),K(l.$$.fragment),a=$(),o=b("div"),K(c.$$.fragment),f=$(),d=b("div"),h=b("div"),_=ae("Current Model: "),m=b("span"),w=ae(s[17]),v=$(),E=b("div"),O.c(),F=$(),C=b("div"),N=b("div"),Q&&Q.c(),ce=$(),G=b("textarea"),ne=$(),oe=b("button"),Le.c(),Oe=$(),Te=b("div"),Te.innerHTML='',p(m,"class","font-normal"),p(h,"class","font-bold text-l"),p(d,"class","py-5 bg-primary px-5 flex flex-row justify-between flex-wrap-reverse"),p(E,"class","flex bg-primary overflow-y-auto overflow-x-hidden justify-center grow"),p(G,"class","w-full min-h-[96px] h-24 rounded-lg p-2 mx-1 mr-0 border-t-2 border-b-2 border-l-2 rounded-r-none bg-primary border-gray-500 resize-none focus:outline-none"),p(G,"placeholder","Type your message..."),rt(G,"height","96px"),rt(G,"overflow-y","auto"),rt(G,"overflow","visible",1),p(oe,"class","bg-chat rounded-lg py-2 px-4 mx-1 ml-0 border-t-2 border-b-2 border-r-2 border-gray-500 rounded-l-none cursor-pointer "),oe.disabled=se=!s[18]&&!s[4].trim().length,p(N,"class","inputbox flex flex-1 bg-primary mt-auto mx-auto max-w-3xl mb-3"),p(C,"class","inputbox-container w-full flex justify-center items-center bg-primary"),p(Te,"class","flex justify-center bg-primary px-4"),p(o,"class","h-screen flex justify-stretch flex-col md:ml-[260px] bg-secondary text-white/80 height-manager"),p(i,"class","bg-primary overflow-hidden")},m(x,ue){k(x,e,ue),B.m(e,null),k(x,t,ue),J&&J.m(x,ue),k(x,r,ue),H&&H.m(x,ue),k(x,n,ue),k(x,i,ue),Y(l,i,null),g(i,a),g(i,o),Y(c,o,null),g(o,f),g(o,d),g(d,h),g(h,_),g(h,m),g(m,w),g(o,v),g(o,E),Ve[P].m(E,null),s[39](E),g(o,F),g(o,C),g(C,N),Q&&Q.m(N,null),g(N,ce),g(N,G),s[43](G),Xe(G,s[4]),g(N,ne),g(N,oe),Le.m(oe,null),g(o,Oe),g(o,Te),ve=!0,Ee||(R=[L(G,"input",s[44]),L(G,"input",Wi),L(G,"keydown",s[45]),L(oe,"click",s[46])],Ee=!0)},p(x,ue){z===(z=D(x))&&B?B.p(x,ue):(B.d(1),B=z(x),B&&(B.c(),B.m(e,null))),x[15]?J?(J.p(x,ue),ue[0]&32768&&S(J,1)):(J=ni(),J.c(),S(J,1),J.m(r.parentNode,r)):J&&(ie(),A(J,1,1,()=>{J=null}),le()),x[16]?H?ue[0]&65536&&S(H,1):(H=ri(),H.c(),S(H,1),H.m(n.parentNode,n)):H&&(ie(),A(H,1,1,()=>{H=null}),le());const et={};!u&&ue[0]&256&&(u=!0,et.conversation_title=x[8],cl(()=>u=!1)),c.$set(et),(!ve||ue[0]&131072)&&Pe(w,x[17]);let Fe=P;P=M(x),P===Fe?Ve[P].p(x,ue):(ie(),A(Ve[Fe],1,1,()=>{Ve[Fe]=null}),le(),O=Ve[P],O?O.p(x,ue):(O=Ve[P]=Ke[P](x),O.c()),S(O,1),O.m(E,null)),be===(be=Se(x))&&Q?Q.p(x,ue):(Q&&Q.d(1),Q=be&&be(x),Q&&(Q.c(),Q.m(N,ce))),ue[0]&16&&Xe(G,x[4]),De===(De=Qe(x))&&Le?Le.p(x,ue):(Le.d(1),Le=De(x),Le&&(Le.c(),Le.m(oe,null))),(!ve||ue[0]&262160&&se!==(se=!x[18]&&!x[4].trim().length))&&(oe.disabled=se)},i(x){ve||(S(J),S(H),S(l.$$.fragment,x),S(c.$$.fragment,x),S(O),ve=!0)},o(x){A(J),A(H),A(l.$$.fragment,x),A(c.$$.fragment,x),A(O),ve=!1},d(x){x&&y(e),B.d(),x&&y(t),J&&J.d(x),x&&y(r),H&&H.d(x),x&&y(n),x&&y(i),W(l),W(c),Ve[P].d(),s[39](null),Q&&Q.d(),s[43](null),Le.d(),Ee=!1,Ne(R)}}}const qf=300;function Wi(s){s.target.style.height="inherit";const e=window.getComputedStyle(s.target),t=parseInt(e.getPropertyValue("border-top-width"),10)+s.target.scrollHeight+parseInt(e.getPropertyValue("border-bottom-width"),10);s.target.style.height=`${Math.min(t,qf)}px`}function gr(s){return!/\s/.test(s)&&s.includes("blob.core.windows.net")&&/rsct=image\/(jpeg|jpg|gif|png|bmp)/i.test(s)}function zf(s,e,t){let r,n,i,l,a,o,c,u,f,d,h,_;fe(s,xe,T=>t(2,i=T)),fe(s,re,T=>t(3,l=T)),fe(s,Ft,T=>t(26,a=T)),fe(s,wt,T=>t(27,o=T)),fe(s,_s,T=>t(28,c=T)),fe(s,or,T=>t(29,u=T)),fe(s,dn,T=>t(15,f=T)),fe(s,hn,T=>t(16,d=T)),fe(s,$e,T=>t(17,h=T)),fe(s,Ue,T=>t(18,_=T));let m,w,v="",E,P,O,F="",C,N="",ce=null,G="";async function ne(T){O=T.target.files[0],O&&(t(25,F=await yf(O)),console.log(F))}function oe(){Ft.set([]),O=null,t(25,F=""),t(1,w.value="",w)}let se=null;function Oe(){if(!C)return;const T={childList:!0,subtree:!0,characterData:!0};se=new MutationObserver((Ye,at)=>{Te()}),se.observe(C,T)}vn(async()=>{await ua(),Oe()}),sl(()=>{se&&(se.disconnect(),se=null),fa()});function Te(){C&&C.scrollHeight-C.scrollTop-150<=C.clientHeight&&t(7,C.scrollTop=C.scrollHeight,C)}function ve(){ws(v,i,F),t(4,v=""),oe(),t(5,E.style.height="96px",E)}function Ee(){C&&t(7,C.scrollTop=C.scrollHeight,C)}let R=0;rl(()=>{const T=l[i]?.history.length||0;T>R&&Ee(),R=T});let D=0,z=0;function B(T){t(9,ce=T),t(10,G=l[i].history[T].content)}function J(){t(9,ce=null),t(10,G=""),t(6,P.style.height="96px",P)}function H(T){const Ye=G,at=l[i].history.length-T;for(let Dt=0;DtRi();function Be(T){N=T,t(8,N),t(2,i),t(3,l)}function Ke(T){ut[T?"unshift":"push"](()=>{P=T,t(6,P)})}function Ve(){G=this.value,t(10,G)}const M=T=>H(T),Se=()=>J(),be=T=>Bo(T.content),Q=T=>vs(T),Qe=T=>B(T);function De(T){ut[T?"unshift":"push"](()=>{C=T,t(7,C)})}function Le(T){ut[T?"unshift":"push"](()=>{m=T,t(0,m),t(29,u)})}const x=T=>ne(T);function ue(T){ut[T?"unshift":"push"](()=>{w=T,t(1,w),t(28,c)})}function et(T){ut[T?"unshift":"push"](()=>{E=T,t(5,E)})}function Fe(){v=this.value,t(4,v)}const bt=T=>{const Ye=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);!_&&T.key==="Enter"&&!T.shiftKey&&!T.ctrlKey&&!T.metaKey&&!Ye?(T.preventDefault(),ve()):!_&&T.key},Wt=()=>{_?ta():ve()};return s.$$.update=()=>{if(s.$$.dirty[0]&536870913&&u&&m&&(t(0,m.value="",m),or.set(!1)),s.$$.dirty[0]&268435458&&c&&w&&(t(1,w.value="",w),_s.set(!1)),s.$$.dirty[0]&12){const T=i,Ye=l,at=l.length;T!==void 0&&Ye[T]&&t(8,N=Ye[T].title||"New Conversation"),(T==null||T<0||T>=at)&&(console.log("changing conversation from ID",i),xe.set(at>0?at-1:null),console.log("to ID",i))}s.$$.dirty[0]&134217728&&t(14,r=o.includes("Vision")),s.$$.dirty[0]&134217728&&t(13,n=o.includes("GPT")),s.$$.dirty[0]&12&&t(8,N=l[i]?l[i].title:"ChatGPT"),s.$$.dirty[0]&67108864&&t(11,D=a.length),s.$$.dirty[0]&33554432&&(F?t(12,z=1):t(12,z=0))},[m,w,i,l,v,E,P,C,N,ce,G,D,z,n,r,f,d,h,_,ne,oe,ve,B,J,H,F,a,o,c,u,Ce,Be,Ke,Ve,M,Se,be,Q,Qe,De,Le,x,ue,et,Fe,bt,Wt]}class Hf extends ee{constructor(e){super(),X(this,e,zf,Nf,Z,{},null,[-1,-1])}}const Jf="/assets/chat-431b71cc.svg";new Hf({target:document.getElementById("app")});window.addEventListener("load",()=>{const s=document.querySelector('link[rel="icon"]');s&&s.setAttribute("href",Jf)});export{bf as _}; diff --git a/dist/assets/pdf-ea9598b5.js b/dist/assets/pdf-36ee9169.js similarity index 99% rename from dist/assets/pdf-ea9598b5.js rename to dist/assets/pdf-36ee9169.js index 08af6e7..b40b177 100644 --- a/dist/assets/pdf-ea9598b5.js +++ b/dist/assets/pdf-36ee9169.js @@ -1,4 +1,4 @@ -import{_ as Rt}from"./index-4a068af4.js";var Vt={976:(dt,et,V)=>{V.d(et,{AnnotationLayer:()=>ct,FreeTextAnnotationElement:()=>B,InkAnnotationElement:()=>Q,StampAnnotationElement:()=>ht});var y=V(292),z=V(419),_=V(792);function U(Z){return Math.floor(Math.max(0,Math.min(1,Z))*255).toString(16).padStart(2,"0")}function F(Z){return Math.max(0,Math.min(255,255*Z))}class C{static CMYK_G([m,l,e,n]){return["G",1-Math.min(1,.3*m+.59*e+.11*l+n)]}static G_CMYK([m]){return["CMYK",0,0,0,1-m]}static G_RGB([m]){return["RGB",m,m,m]}static G_rgb([m]){return m=F(m),[m,m,m]}static G_HTML([m]){const l=U(m);return`#${l}${l}${l}`}static RGB_G([m,l,e]){return["G",.3*m+.59*l+.11*e]}static RGB_rgb(m){return m.map(F)}static RGB_HTML(m){return`#${m.map(U).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([m,l,e,n]){return["RGB",1-Math.min(1,m+n),1-Math.min(1,e+n),1-Math.min(1,l+n)]}static CMYK_rgb([m,l,e,n]){return[F(1-Math.min(1,m+n)),F(1-Math.min(1,e+n)),F(1-Math.min(1,l+n))]}static CMYK_HTML(m){const l=this.CMYK_RGB(m).slice(1);return this.RGB_HTML(l)}static RGB_CMYK([m,l,e]){const n=1-m,a=1-l,i=1-e,h=Math.min(n,a,i);return["CMYK",n,a,i,h]}}var T=V(284);const A=1e3,o=9,d=new WeakSet;function u(Z){return{width:Z[2]-Z[0],height:Z[3]-Z[1]}}class b{static create(m){switch(m.data.annotationType){case y.AnnotationType.LINK:return new g(m);case y.AnnotationType.TEXT:return new t(m);case y.AnnotationType.WIDGET:switch(m.data.fieldType){case"Tx":return new c(m);case"Btn":return m.data.radioButton?new S(m):m.data.checkBox?new v(m):new M(m);case"Ch":return new I(m);case"Sig":return new f(m)}return new r(m);case y.AnnotationType.POPUP:return new O(m);case y.AnnotationType.FREETEXT:return new B(m);case y.AnnotationType.LINE:return new q(m);case y.AnnotationType.SQUARE:return new st(m);case y.AnnotationType.CIRCLE:return new X(m);case y.AnnotationType.POLYLINE:return new H(m);case y.AnnotationType.CARET:return new Y(m);case y.AnnotationType.INK:return new Q(m);case y.AnnotationType.POLYGON:return new G(m);case y.AnnotationType.HIGHLIGHT:return new K(m);case y.AnnotationType.UNDERLINE:return new at(m);case y.AnnotationType.SQUIGGLY:return new ot(m);case y.AnnotationType.STRIKEOUT:return new lt(m);case y.AnnotationType.STAMP:return new ht(m);case y.AnnotationType.FILEATTACHMENT:return new ft(m);default:return new s(m)}}}class s{#t=!1;constructor(m,{isRenderable:l=!1,ignoreBorder:e=!1,createQuadrilaterals:n=!1}={}){this.isRenderable=l,this.data=m.data,this.layer=m.layer,this.linkService=m.linkService,this.downloadManager=m.downloadManager,this.imageResourcesPath=m.imageResourcesPath,this.renderForms=m.renderForms,this.svgFactory=m.svgFactory,this.annotationStorage=m.annotationStorage,this.enableScripting=m.enableScripting,this.hasJSActions=m.hasJSActions,this._fieldObjects=m.fieldObjects,this.parent=m.parent,l&&(this.container=this._createContainer(e)),n&&this._createQuadrilaterals()}static _hasPopupData({titleObj:m,contentsObj:l,richText:e}){return!!(m?.str||l?.str||e?.str)}get hasPopupData(){return s._hasPopupData(this.data)}_createContainer(m){const{data:l,parent:{page:e,viewport:n}}=this,a=document.createElement("section");a.setAttribute("data-annotation-id",l.id),this instanceof r||(a.tabIndex=A),a.style.zIndex=this.parent.zIndex++,l.popupRef&&a.setAttribute("aria-haspopup","dialog"),l.alternativeText&&(a.title=l.alternativeText),l.noRotate&&a.classList.add("norotate");const{pageWidth:i,pageHeight:h,pageX:p,pageY:w}=n.rawDims;if(!l.rect||this instanceof O){const{rotation:x}=l;return!l.hasOwnCanvas&&x!==0&&this.setRotation(x,a),a}const{width:E,height:R}=u(l.rect),P=y.Util.normalizeRect([l.rect[0],e.view[3]-l.rect[1]+e.view[1],l.rect[2],e.view[3]-l.rect[3]+e.view[1]]);if(!m&&l.borderStyle.width>0){a.style.borderWidth=`${l.borderStyle.width}px`;const x=l.borderStyle.horizontalCornerRadius,k=l.borderStyle.verticalCornerRadius;if(x>0||k>0){const j=`calc(${x}px * var(--scale-factor)) / calc(${k}px * var(--scale-factor))`;a.style.borderRadius=j}else if(this instanceof S){const j=`calc(${E}px * var(--scale-factor)) / calc(${R}px * var(--scale-factor))`;a.style.borderRadius=j}switch(l.borderStyle.style){case y.AnnotationBorderStyleType.SOLID:a.style.borderStyle="solid";break;case y.AnnotationBorderStyleType.DASHED:a.style.borderStyle="dashed";break;case y.AnnotationBorderStyleType.BEVELED:(0,y.warn)("Unimplemented border style: beveled");break;case y.AnnotationBorderStyleType.INSET:(0,y.warn)("Unimplemented border style: inset");break;case y.AnnotationBorderStyleType.UNDERLINE:a.style.borderBottomStyle="solid";break}const D=l.borderColor||null;D?(this.#t=!0,a.style.borderColor=y.Util.makeHexColor(D[0]|0,D[1]|0,D[2]|0)):a.style.borderWidth=0}a.style.left=`${100*(P[0]-p)/i}%`,a.style.top=`${100*(P[1]-w)/h}%`;const{rotation:L}=l;return l.hasOwnCanvas||L===0?(a.style.width=`${100*E/i}%`,a.style.height=`${100*R/h}%`):this.setRotation(L,a),a}setRotation(m,l=this.container){if(!this.data.rect)return;const{pageWidth:e,pageHeight:n}=this.parent.viewport.rawDims,{width:a,height:i}=u(this.data.rect);let h,p;m%180===0?(h=100*a/e,p=100*i/n):(h=100*i/e,p=100*a/n),l.style.width=`${h}%`,l.style.height=`${p}%`,l.setAttribute("data-main-rotation",(360-m)%360)}get _commonActions(){const m=(l,e,n)=>{const a=n.detail[l],i=a[0],h=a.slice(1);n.target.style[e]=C[`${i}_HTML`](h),this.annotationStorage.setValue(this.data.id,{[e]:C[`${i}_rgb`](h)})};return(0,y.shadow)(this,"_commonActions",{display:l=>{const{display:e}=l.detail,n=e%2===1;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:e===1||e===2})},print:l=>{this.annotationStorage.setValue(this.data.id,{noPrint:!l.detail.print})},hidden:l=>{const{hidden:e}=l.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:l=>{setTimeout(()=>l.target.focus({preventScroll:!1}),0)},userName:l=>{l.target.title=l.detail.userName},readonly:l=>{l.target.disabled=l.detail.readonly},required:l=>{this._setRequired(l.target,l.detail.required)},bgColor:l=>{m("bgColor","backgroundColor",l)},fillColor:l=>{m("fillColor","backgroundColor",l)},fgColor:l=>{m("fgColor","color",l)},textColor:l=>{m("textColor","color",l)},borderColor:l=>{m("borderColor","borderColor",l)},strokeColor:l=>{m("strokeColor","borderColor",l)},rotation:l=>{const e=l.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(m,l){const e=this._commonActions;for(const n of Object.keys(l.detail))(m[n]||e[n])?.(l)}_setDefaultPropertiesFromJS(m){if(!this.enableScripting)return;const l=this.annotationStorage.getRawValue(this.data.id);if(!l)return;const e=this._commonActions;for(const[n,a]of Object.entries(l)){const i=e[n];if(i){const h={detail:{[n]:a},target:m};i(h),delete l[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:m}=this.data;if(!m)return;const[l,e,n,a]=this.data.rect;if(m.length===1){const[,{x:k,y:D},{x:j,y:J}]=m[0];if(n===k&&a===D&&l===j&&e===J)return}const{style:i}=this.container;let h;if(this.#t){const{borderColor:k,borderWidth:D}=i;i.borderWidth=0,h=["url('data:image/svg+xml;utf8,",'',``],this.container.classList.add("hasBorder")}const p=n-l,w=a-e,{svgFactory:E}=this,R=E.createElement("svg");R.classList.add("quadrilateralsContainer"),R.setAttribute("width",0),R.setAttribute("height",0);const P=E.createElement("defs");R.append(P);const L=E.createElement("clipPath"),x=`clippath_${this.data.id}`;L.setAttribute("id",x),L.setAttribute("clipPathUnits","objectBoundingBox"),P.append(L);for(const[,{x:k,y:D},{x:j,y:J}]of m){const $=E.createElement("rect"),tt=(j-l)/p,it=(a-D)/w,W=(k-j)/p,rt=(D-J)/w;$.setAttribute("x",tt),$.setAttribute("y",it),$.setAttribute("width",W),$.setAttribute("height",rt),L.append($),h?.push(``)}this.#t&&(h.push("')"),i.backgroundImage=h.join("")),this.container.append(R),this.container.style.clipPath=`url(#${x})`}_createPopup(){const{container:m,data:l}=this;m.setAttribute("aria-haspopup","dialog");const e=new O({data:{color:l.color,titleObj:l.titleObj,modificationDate:l.modificationDate,contentsObj:l.contentsObj,richText:l.richText,parentRect:l.rect,borderStyle:0,id:`popup_${l.id}`,rotation:l.rotation},parent:this.parent,elements:[this]});this.parent.div.append(e.render())}render(){(0,y.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(m,l=null){const e=[];if(this._fieldObjects){const n=this._fieldObjects[m];if(n)for(const{page:a,id:i,exportValues:h}of n){if(a===-1||i===l)continue;const p=typeof h=="string"?h:null,w=document.querySelector(`[data-element-id="${i}"]`);if(w&&!d.has(w)){(0,y.warn)(`_getElementsByName - element not allowed: ${i}`);continue}e.push({id:i,exportValue:p,domElement:w})}return e}for(const n of document.getElementsByName(m)){const{exportValue:a}=n,i=n.getAttribute("data-element-id");i!==l&&d.has(n)&&e.push({id:i,exportValue:a,domElement:n})}return e}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const m=this.getElementsToTriggerPopup();if(Array.isArray(m))for(const l of m)l.classList.add("highlightArea");else m.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:m,data:{id:l}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:m,editId:l})})}}class g extends s{constructor(m,l=null){super(m,{isRenderable:!0,ignoreBorder:!!l?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=m.data.isTooltipOnly}render(){const{data:m,linkService:l}=this,e=document.createElement("a");e.setAttribute("data-element-id",m.id);let n=!1;return m.url?(l.addLinkAttributes(e,m.url,m.newWindow),n=!0):m.action?(this._bindNamedAction(e,m.action),n=!0):m.attachment?(this.#e(e,m.attachment,m.attachmentDest),n=!0):m.setOCGState?(this.#s(e,m.setOCGState),n=!0):m.dest?(this._bindLink(e,m.dest),n=!0):(m.actions&&(m.actions.Action||m.actions["Mouse Up"]||m.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(e,m),n=!0),m.resetForm?(this._bindResetFormAction(e,m.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(e,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(e),this.container}#t(){this.container.setAttribute("data-internal-link","")}_bindLink(m,l){m.href=this.linkService.getDestinationHash(l),m.onclick=()=>(l&&this.linkService.goToDestination(l),!1),(l||l==="")&&this.#t()}_bindNamedAction(m,l){m.href=this.linkService.getAnchorUrl(""),m.onclick=()=>(this.linkService.executeNamedAction(l),!1),this.#t()}#e(m,l,e=null){m.href=this.linkService.getAnchorUrl(""),m.onclick=()=>(this.downloadManager?.openOrDownloadData(l.content,l.filename,e),!1),this.#t()}#s(m,l){m.href=this.linkService.getAnchorUrl(""),m.onclick=()=>(this.linkService.executeSetOCGState(l),!1),this.#t()}_bindJSAction(m,l){m.href=this.linkService.getAnchorUrl("");const e=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(l.actions)){const a=e.get(n);a&&(m[a]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l.id,name:n}}),!1))}m.onclick||(m.onclick=()=>!1),this.#t()}_bindResetFormAction(m,l){const e=m.onclick;if(e||(m.href=this.linkService.getAnchorUrl("")),this.#t(),!this._fieldObjects){(0,y.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),e||(m.onclick=()=>!1);return}m.onclick=()=>{e?.();const{fields:n,refs:a,include:i}=l,h=[];if(n.length!==0||a.length!==0){const E=new Set(a);for(const R of n){const P=this._fieldObjects[R]||[];for(const{id:L}of P)E.add(L)}for(const R of Object.values(this._fieldObjects))for(const P of R)E.has(P.id)===i&&h.push(P)}else for(const E of Object.values(this._fieldObjects))h.push(...E);const p=this.annotationStorage,w=[];for(const E of h){const{id:R}=E;switch(w.push(R),E.type){case"text":{const L=E.defaultValue||"";p.setValue(R,{value:L});break}case"checkbox":case"radiobutton":{const L=E.defaultValue===E.exportValues;p.setValue(R,{value:L});break}case"combobox":case"listbox":{const L=E.defaultValue||"";p.setValue(R,{value:L});break}default:continue}const P=document.querySelector(`[data-element-id="${R}"]`);if(P){if(!d.has(P)){(0,y.warn)(`_bindResetFormAction - element not allowed: ${R}`);continue}}else continue;P.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:w,name:"ResetForm"}}),!1}}}class t extends s{constructor(m){super(m,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const m=document.createElement("img");return m.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",m.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),m.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(m),this.container}}class r extends s{render(){return this.container}showElementAndHideCanvas(m){this.data.hasOwnCanvas&&(m.previousSibling?.nodeName==="CANVAS"&&(m.previousSibling.hidden=!0),m.hidden=!1)}_getKeyModifier(m){return y.FeatureTest.platform.isMac?m.metaKey:m.ctrlKey}_setEventListener(m,l,e,n,a){e.includes("mouse")?m.addEventListener(e,i=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:a(i),shift:i.shiftKey,modifier:this._getKeyModifier(i)}})}):m.addEventListener(e,i=>{if(e==="blur"){if(!l.focused||!i.relatedTarget)return;l.focused=!1}else if(e==="focus"){if(l.focused)return;l.focused=!0}a&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:a(i)}})})}_setEventListeners(m,l,e,n){for(const[a,i]of e)(i==="Action"||this.data.actions?.[i])&&((i==="Focus"||i==="Blur")&&(l||={focused:!1}),this._setEventListener(m,l,a,i,n),i==="Focus"&&!this.data.actions?.Blur?this._setEventListener(m,l,"blur","Blur",null):i==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(m,l,"focus","Focus",null))}_setBackgroundColor(m){const l=this.data.backgroundColor||null;m.style.backgroundColor=l===null?"transparent":y.Util.makeHexColor(l[0],l[1],l[2])}_setTextStyle(m){const l=["left","center","right"],{fontColor:e}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||o,a=m.style;let i;const h=2,p=w=>Math.round(10*w)/10;if(this.data.multiLine){const w=Math.abs(this.data.rect[3]-this.data.rect[1]-h),E=Math.round(w/(y.LINE_FACTOR*n))||1,R=w/E;i=Math.min(n,p(R/y.LINE_FACTOR))}else{const w=Math.abs(this.data.rect[3]-this.data.rect[1]-h);i=Math.min(n,p(w/y.LINE_FACTOR))}a.fontSize=`calc(${i}px * var(--scale-factor))`,a.color=y.Util.makeHexColor(e[0],e[1],e[2]),this.data.textAlignment!==null&&(a.textAlign=l[this.data.textAlignment])}_setRequired(m,l){l?m.setAttribute("required",!0):m.removeAttribute("required"),m.setAttribute("aria-required",l)}}class c extends r{constructor(m){const l=m.renderForms||m.data.hasOwnCanvas||!m.data.hasAppearance&&!!m.data.fieldValue;super(m,{isRenderable:l})}setPropertyOnSiblings(m,l,e,n){const a=this.annotationStorage;for(const i of this._getElementsByName(m.name,m.id))i.domElement&&(i.domElement[l]=e),a.setValue(i.id,{[n]:e})}render(){const m=this.annotationStorage,l=this.data.id;this.container.classList.add("textWidgetAnnotation");let e=null;if(this.renderForms){const n=m.getValue(l,{value:this.data.fieldValue});let a=n.value||"";const i=m.getValue(l,{charLimit:this.data.maxLen}).charLimit;i&&a.length>i&&(a=a.slice(0,i));let h=n.formattedValue||this.data.textContent?.join(` +import{_ as Rt}from"./index-d470cf7b.js";var Vt={976:(dt,et,V)=>{V.d(et,{AnnotationLayer:()=>ct,FreeTextAnnotationElement:()=>B,InkAnnotationElement:()=>Q,StampAnnotationElement:()=>ht});var y=V(292),z=V(419),_=V(792);function U(Z){return Math.floor(Math.max(0,Math.min(1,Z))*255).toString(16).padStart(2,"0")}function F(Z){return Math.max(0,Math.min(255,255*Z))}class C{static CMYK_G([m,l,e,n]){return["G",1-Math.min(1,.3*m+.59*e+.11*l+n)]}static G_CMYK([m]){return["CMYK",0,0,0,1-m]}static G_RGB([m]){return["RGB",m,m,m]}static G_rgb([m]){return m=F(m),[m,m,m]}static G_HTML([m]){const l=U(m);return`#${l}${l}${l}`}static RGB_G([m,l,e]){return["G",.3*m+.59*l+.11*e]}static RGB_rgb(m){return m.map(F)}static RGB_HTML(m){return`#${m.map(U).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([m,l,e,n]){return["RGB",1-Math.min(1,m+n),1-Math.min(1,e+n),1-Math.min(1,l+n)]}static CMYK_rgb([m,l,e,n]){return[F(1-Math.min(1,m+n)),F(1-Math.min(1,e+n)),F(1-Math.min(1,l+n))]}static CMYK_HTML(m){const l=this.CMYK_RGB(m).slice(1);return this.RGB_HTML(l)}static RGB_CMYK([m,l,e]){const n=1-m,a=1-l,i=1-e,h=Math.min(n,a,i);return["CMYK",n,a,i,h]}}var T=V(284);const A=1e3,o=9,d=new WeakSet;function u(Z){return{width:Z[2]-Z[0],height:Z[3]-Z[1]}}class b{static create(m){switch(m.data.annotationType){case y.AnnotationType.LINK:return new g(m);case y.AnnotationType.TEXT:return new t(m);case y.AnnotationType.WIDGET:switch(m.data.fieldType){case"Tx":return new c(m);case"Btn":return m.data.radioButton?new S(m):m.data.checkBox?new v(m):new M(m);case"Ch":return new I(m);case"Sig":return new f(m)}return new r(m);case y.AnnotationType.POPUP:return new O(m);case y.AnnotationType.FREETEXT:return new B(m);case y.AnnotationType.LINE:return new q(m);case y.AnnotationType.SQUARE:return new st(m);case y.AnnotationType.CIRCLE:return new X(m);case y.AnnotationType.POLYLINE:return new H(m);case y.AnnotationType.CARET:return new Y(m);case y.AnnotationType.INK:return new Q(m);case y.AnnotationType.POLYGON:return new G(m);case y.AnnotationType.HIGHLIGHT:return new K(m);case y.AnnotationType.UNDERLINE:return new at(m);case y.AnnotationType.SQUIGGLY:return new ot(m);case y.AnnotationType.STRIKEOUT:return new lt(m);case y.AnnotationType.STAMP:return new ht(m);case y.AnnotationType.FILEATTACHMENT:return new ft(m);default:return new s(m)}}}class s{#t=!1;constructor(m,{isRenderable:l=!1,ignoreBorder:e=!1,createQuadrilaterals:n=!1}={}){this.isRenderable=l,this.data=m.data,this.layer=m.layer,this.linkService=m.linkService,this.downloadManager=m.downloadManager,this.imageResourcesPath=m.imageResourcesPath,this.renderForms=m.renderForms,this.svgFactory=m.svgFactory,this.annotationStorage=m.annotationStorage,this.enableScripting=m.enableScripting,this.hasJSActions=m.hasJSActions,this._fieldObjects=m.fieldObjects,this.parent=m.parent,l&&(this.container=this._createContainer(e)),n&&this._createQuadrilaterals()}static _hasPopupData({titleObj:m,contentsObj:l,richText:e}){return!!(m?.str||l?.str||e?.str)}get hasPopupData(){return s._hasPopupData(this.data)}_createContainer(m){const{data:l,parent:{page:e,viewport:n}}=this,a=document.createElement("section");a.setAttribute("data-annotation-id",l.id),this instanceof r||(a.tabIndex=A),a.style.zIndex=this.parent.zIndex++,l.popupRef&&a.setAttribute("aria-haspopup","dialog"),l.alternativeText&&(a.title=l.alternativeText),l.noRotate&&a.classList.add("norotate");const{pageWidth:i,pageHeight:h,pageX:p,pageY:w}=n.rawDims;if(!l.rect||this instanceof O){const{rotation:x}=l;return!l.hasOwnCanvas&&x!==0&&this.setRotation(x,a),a}const{width:E,height:R}=u(l.rect),P=y.Util.normalizeRect([l.rect[0],e.view[3]-l.rect[1]+e.view[1],l.rect[2],e.view[3]-l.rect[3]+e.view[1]]);if(!m&&l.borderStyle.width>0){a.style.borderWidth=`${l.borderStyle.width}px`;const x=l.borderStyle.horizontalCornerRadius,k=l.borderStyle.verticalCornerRadius;if(x>0||k>0){const j=`calc(${x}px * var(--scale-factor)) / calc(${k}px * var(--scale-factor))`;a.style.borderRadius=j}else if(this instanceof S){const j=`calc(${E}px * var(--scale-factor)) / calc(${R}px * var(--scale-factor))`;a.style.borderRadius=j}switch(l.borderStyle.style){case y.AnnotationBorderStyleType.SOLID:a.style.borderStyle="solid";break;case y.AnnotationBorderStyleType.DASHED:a.style.borderStyle="dashed";break;case y.AnnotationBorderStyleType.BEVELED:(0,y.warn)("Unimplemented border style: beveled");break;case y.AnnotationBorderStyleType.INSET:(0,y.warn)("Unimplemented border style: inset");break;case y.AnnotationBorderStyleType.UNDERLINE:a.style.borderBottomStyle="solid";break}const D=l.borderColor||null;D?(this.#t=!0,a.style.borderColor=y.Util.makeHexColor(D[0]|0,D[1]|0,D[2]|0)):a.style.borderWidth=0}a.style.left=`${100*(P[0]-p)/i}%`,a.style.top=`${100*(P[1]-w)/h}%`;const{rotation:L}=l;return l.hasOwnCanvas||L===0?(a.style.width=`${100*E/i}%`,a.style.height=`${100*R/h}%`):this.setRotation(L,a),a}setRotation(m,l=this.container){if(!this.data.rect)return;const{pageWidth:e,pageHeight:n}=this.parent.viewport.rawDims,{width:a,height:i}=u(this.data.rect);let h,p;m%180===0?(h=100*a/e,p=100*i/n):(h=100*i/e,p=100*a/n),l.style.width=`${h}%`,l.style.height=`${p}%`,l.setAttribute("data-main-rotation",(360-m)%360)}get _commonActions(){const m=(l,e,n)=>{const a=n.detail[l],i=a[0],h=a.slice(1);n.target.style[e]=C[`${i}_HTML`](h),this.annotationStorage.setValue(this.data.id,{[e]:C[`${i}_rgb`](h)})};return(0,y.shadow)(this,"_commonActions",{display:l=>{const{display:e}=l.detail,n=e%2===1;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:e===1||e===2})},print:l=>{this.annotationStorage.setValue(this.data.id,{noPrint:!l.detail.print})},hidden:l=>{const{hidden:e}=l.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:l=>{setTimeout(()=>l.target.focus({preventScroll:!1}),0)},userName:l=>{l.target.title=l.detail.userName},readonly:l=>{l.target.disabled=l.detail.readonly},required:l=>{this._setRequired(l.target,l.detail.required)},bgColor:l=>{m("bgColor","backgroundColor",l)},fillColor:l=>{m("fillColor","backgroundColor",l)},fgColor:l=>{m("fgColor","color",l)},textColor:l=>{m("textColor","color",l)},borderColor:l=>{m("borderColor","borderColor",l)},strokeColor:l=>{m("strokeColor","borderColor",l)},rotation:l=>{const e=l.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(m,l){const e=this._commonActions;for(const n of Object.keys(l.detail))(m[n]||e[n])?.(l)}_setDefaultPropertiesFromJS(m){if(!this.enableScripting)return;const l=this.annotationStorage.getRawValue(this.data.id);if(!l)return;const e=this._commonActions;for(const[n,a]of Object.entries(l)){const i=e[n];if(i){const h={detail:{[n]:a},target:m};i(h),delete l[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:m}=this.data;if(!m)return;const[l,e,n,a]=this.data.rect;if(m.length===1){const[,{x:k,y:D},{x:j,y:J}]=m[0];if(n===k&&a===D&&l===j&&e===J)return}const{style:i}=this.container;let h;if(this.#t){const{borderColor:k,borderWidth:D}=i;i.borderWidth=0,h=["url('data:image/svg+xml;utf8,",'',``],this.container.classList.add("hasBorder")}const p=n-l,w=a-e,{svgFactory:E}=this,R=E.createElement("svg");R.classList.add("quadrilateralsContainer"),R.setAttribute("width",0),R.setAttribute("height",0);const P=E.createElement("defs");R.append(P);const L=E.createElement("clipPath"),x=`clippath_${this.data.id}`;L.setAttribute("id",x),L.setAttribute("clipPathUnits","objectBoundingBox"),P.append(L);for(const[,{x:k,y:D},{x:j,y:J}]of m){const $=E.createElement("rect"),tt=(j-l)/p,it=(a-D)/w,W=(k-j)/p,rt=(D-J)/w;$.setAttribute("x",tt),$.setAttribute("y",it),$.setAttribute("width",W),$.setAttribute("height",rt),L.append($),h?.push(``)}this.#t&&(h.push("')"),i.backgroundImage=h.join("")),this.container.append(R),this.container.style.clipPath=`url(#${x})`}_createPopup(){const{container:m,data:l}=this;m.setAttribute("aria-haspopup","dialog");const e=new O({data:{color:l.color,titleObj:l.titleObj,modificationDate:l.modificationDate,contentsObj:l.contentsObj,richText:l.richText,parentRect:l.rect,borderStyle:0,id:`popup_${l.id}`,rotation:l.rotation},parent:this.parent,elements:[this]});this.parent.div.append(e.render())}render(){(0,y.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(m,l=null){const e=[];if(this._fieldObjects){const n=this._fieldObjects[m];if(n)for(const{page:a,id:i,exportValues:h}of n){if(a===-1||i===l)continue;const p=typeof h=="string"?h:null,w=document.querySelector(`[data-element-id="${i}"]`);if(w&&!d.has(w)){(0,y.warn)(`_getElementsByName - element not allowed: ${i}`);continue}e.push({id:i,exportValue:p,domElement:w})}return e}for(const n of document.getElementsByName(m)){const{exportValue:a}=n,i=n.getAttribute("data-element-id");i!==l&&d.has(n)&&e.push({id:i,exportValue:a,domElement:n})}return e}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const m=this.getElementsToTriggerPopup();if(Array.isArray(m))for(const l of m)l.classList.add("highlightArea");else m.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:m,data:{id:l}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:m,editId:l})})}}class g extends s{constructor(m,l=null){super(m,{isRenderable:!0,ignoreBorder:!!l?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=m.data.isTooltipOnly}render(){const{data:m,linkService:l}=this,e=document.createElement("a");e.setAttribute("data-element-id",m.id);let n=!1;return m.url?(l.addLinkAttributes(e,m.url,m.newWindow),n=!0):m.action?(this._bindNamedAction(e,m.action),n=!0):m.attachment?(this.#e(e,m.attachment,m.attachmentDest),n=!0):m.setOCGState?(this.#s(e,m.setOCGState),n=!0):m.dest?(this._bindLink(e,m.dest),n=!0):(m.actions&&(m.actions.Action||m.actions["Mouse Up"]||m.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(e,m),n=!0),m.resetForm?(this._bindResetFormAction(e,m.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(e,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(e),this.container}#t(){this.container.setAttribute("data-internal-link","")}_bindLink(m,l){m.href=this.linkService.getDestinationHash(l),m.onclick=()=>(l&&this.linkService.goToDestination(l),!1),(l||l==="")&&this.#t()}_bindNamedAction(m,l){m.href=this.linkService.getAnchorUrl(""),m.onclick=()=>(this.linkService.executeNamedAction(l),!1),this.#t()}#e(m,l,e=null){m.href=this.linkService.getAnchorUrl(""),m.onclick=()=>(this.downloadManager?.openOrDownloadData(l.content,l.filename,e),!1),this.#t()}#s(m,l){m.href=this.linkService.getAnchorUrl(""),m.onclick=()=>(this.linkService.executeSetOCGState(l),!1),this.#t()}_bindJSAction(m,l){m.href=this.linkService.getAnchorUrl("");const e=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(l.actions)){const a=e.get(n);a&&(m[a]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l.id,name:n}}),!1))}m.onclick||(m.onclick=()=>!1),this.#t()}_bindResetFormAction(m,l){const e=m.onclick;if(e||(m.href=this.linkService.getAnchorUrl("")),this.#t(),!this._fieldObjects){(0,y.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),e||(m.onclick=()=>!1);return}m.onclick=()=>{e?.();const{fields:n,refs:a,include:i}=l,h=[];if(n.length!==0||a.length!==0){const E=new Set(a);for(const R of n){const P=this._fieldObjects[R]||[];for(const{id:L}of P)E.add(L)}for(const R of Object.values(this._fieldObjects))for(const P of R)E.has(P.id)===i&&h.push(P)}else for(const E of Object.values(this._fieldObjects))h.push(...E);const p=this.annotationStorage,w=[];for(const E of h){const{id:R}=E;switch(w.push(R),E.type){case"text":{const L=E.defaultValue||"";p.setValue(R,{value:L});break}case"checkbox":case"radiobutton":{const L=E.defaultValue===E.exportValues;p.setValue(R,{value:L});break}case"combobox":case"listbox":{const L=E.defaultValue||"";p.setValue(R,{value:L});break}default:continue}const P=document.querySelector(`[data-element-id="${R}"]`);if(P){if(!d.has(P)){(0,y.warn)(`_bindResetFormAction - element not allowed: ${R}`);continue}}else continue;P.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:w,name:"ResetForm"}}),!1}}}class t extends s{constructor(m){super(m,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const m=document.createElement("img");return m.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",m.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),m.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(m),this.container}}class r extends s{render(){return this.container}showElementAndHideCanvas(m){this.data.hasOwnCanvas&&(m.previousSibling?.nodeName==="CANVAS"&&(m.previousSibling.hidden=!0),m.hidden=!1)}_getKeyModifier(m){return y.FeatureTest.platform.isMac?m.metaKey:m.ctrlKey}_setEventListener(m,l,e,n,a){e.includes("mouse")?m.addEventListener(e,i=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:a(i),shift:i.shiftKey,modifier:this._getKeyModifier(i)}})}):m.addEventListener(e,i=>{if(e==="blur"){if(!l.focused||!i.relatedTarget)return;l.focused=!1}else if(e==="focus"){if(l.focused)return;l.focused=!0}a&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:a(i)}})})}_setEventListeners(m,l,e,n){for(const[a,i]of e)(i==="Action"||this.data.actions?.[i])&&((i==="Focus"||i==="Blur")&&(l||={focused:!1}),this._setEventListener(m,l,a,i,n),i==="Focus"&&!this.data.actions?.Blur?this._setEventListener(m,l,"blur","Blur",null):i==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(m,l,"focus","Focus",null))}_setBackgroundColor(m){const l=this.data.backgroundColor||null;m.style.backgroundColor=l===null?"transparent":y.Util.makeHexColor(l[0],l[1],l[2])}_setTextStyle(m){const l=["left","center","right"],{fontColor:e}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||o,a=m.style;let i;const h=2,p=w=>Math.round(10*w)/10;if(this.data.multiLine){const w=Math.abs(this.data.rect[3]-this.data.rect[1]-h),E=Math.round(w/(y.LINE_FACTOR*n))||1,R=w/E;i=Math.min(n,p(R/y.LINE_FACTOR))}else{const w=Math.abs(this.data.rect[3]-this.data.rect[1]-h);i=Math.min(n,p(w/y.LINE_FACTOR))}a.fontSize=`calc(${i}px * var(--scale-factor))`,a.color=y.Util.makeHexColor(e[0],e[1],e[2]),this.data.textAlignment!==null&&(a.textAlign=l[this.data.textAlignment])}_setRequired(m,l){l?m.setAttribute("required",!0):m.removeAttribute("required"),m.setAttribute("aria-required",l)}}class c extends r{constructor(m){const l=m.renderForms||m.data.hasOwnCanvas||!m.data.hasAppearance&&!!m.data.fieldValue;super(m,{isRenderable:l})}setPropertyOnSiblings(m,l,e,n){const a=this.annotationStorage;for(const i of this._getElementsByName(m.name,m.id))i.domElement&&(i.domElement[l]=e),a.setValue(i.id,{[n]:e})}render(){const m=this.annotationStorage,l=this.data.id;this.container.classList.add("textWidgetAnnotation");let e=null;if(this.renderForms){const n=m.getValue(l,{value:this.data.fieldValue});let a=n.value||"";const i=m.getValue(l,{charLimit:this.data.maxLen}).charLimit;i&&a.length>i&&(a=a.slice(0,i));let h=n.formattedValue||this.data.textContent?.join(` `)||null;h&&this.data.comb&&(h=h.replaceAll(/\s+/g,""));const p={userValue:a,formattedValue:h,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(e=document.createElement("textarea"),e.textContent=h??a,this.data.doNotScroll&&(e.style.overflowY="hidden")):(e=document.createElement("input"),e.type="text",e.setAttribute("value",h??a),this.data.doNotScroll&&(e.style.overflowX="hidden")),this.data.hasOwnCanvas&&(e.hidden=!0),d.add(e),e.setAttribute("data-element-id",l),e.disabled=this.data.readOnly,e.name=this.data.fieldName,e.tabIndex=A,this._setRequired(e,this.data.required),i&&(e.maxLength=i),e.addEventListener("input",E=>{m.setValue(l,{value:E.target.value}),this.setPropertyOnSiblings(e,"value",E.target.value,"value"),p.formattedValue=null}),e.addEventListener("resetform",E=>{const R=this.data.defaultFieldValue??"";e.value=p.userValue=R,p.formattedValue=null});let w=E=>{const{formattedValue:R}=p;R!=null&&(E.target.value=R),E.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){e.addEventListener("focus",R=>{if(p.focused)return;const{target:P}=R;p.userValue&&(P.value=p.userValue),p.lastCommittedValue=P.value,p.commitKey=1,this.data.actions?.Focus||(p.focused=!0)}),e.addEventListener("updatefromsandbox",R=>{this.showElementAndHideCanvas(R.target);const P={value(L){p.userValue=L.detail.value??"",m.setValue(l,{value:p.userValue.toString()}),L.target.value=p.userValue},formattedValue(L){const{formattedValue:x}=L.detail;p.formattedValue=x,x!=null&&L.target!==document.activeElement&&(L.target.value=x),m.setValue(l,{formattedValue:x})},selRange(L){L.target.setSelectionRange(...L.detail.selRange)},charLimit:L=>{const{charLimit:x}=L.detail,{target:k}=L;if(x===0){k.removeAttribute("maxLength");return}k.setAttribute("maxLength",x);let D=p.userValue;!D||D.length<=x||(D=D.slice(0,x),k.value=p.userValue=D,m.setValue(l,{value:D}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:D,willCommit:!0,commitKey:1,selStart:k.selectionStart,selEnd:k.selectionEnd}}))}};this._dispatchEventFromSandbox(P,R)}),e.addEventListener("keydown",R=>{p.commitKey=1;let P=-1;if(R.key==="Escape"?P=0:R.key==="Enter"&&!this.data.multiLine?P=2:R.key==="Tab"&&(p.commitKey=3),P===-1)return;const{value:L}=R.target;p.lastCommittedValue!==L&&(p.lastCommittedValue=L,p.userValue=L,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:L,willCommit:!0,commitKey:P,selStart:R.target.selectionStart,selEnd:R.target.selectionEnd}}))});const E=w;w=null,e.addEventListener("blur",R=>{if(!p.focused||!R.relatedTarget)return;this.data.actions?.Blur||(p.focused=!1);const{value:P}=R.target;p.userValue=P,p.lastCommittedValue!==P&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:P,willCommit:!0,commitKey:p.commitKey,selStart:R.target.selectionStart,selEnd:R.target.selectionEnd}}),E(R)}),this.data.actions?.Keystroke&&e.addEventListener("beforeinput",R=>{p.lastCommittedValue=null;const{data:P,target:L}=R,{value:x,selectionStart:k,selectionEnd:D}=L;let j=k,J=D;switch(R.inputType){case"deleteWordBackward":{const $=x.substring(0,k).match(/\w*[^\w]*$/);$&&(j-=$[0].length);break}case"deleteWordForward":{const $=x.substring(k).match(/^[^\w]*\w*/);$&&(J+=$[0].length);break}case"deleteContentBackward":k===D&&(j-=1);break;case"deleteContentForward":k===D&&(J+=1);break}R.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:x,change:P||"",willCommit:!1,selStart:j,selEnd:J}})}),this._setEventListeners(e,p,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],R=>R.target.value)}if(w&&e.addEventListener("blur",w),this.data.comb){const R=(this.data.rect[2]-this.data.rect[0])/i;e.classList.add("comb"),e.style.letterSpacing=`calc(${R}px * var(--scale-factor) - 1ch)`}}else e=document.createElement("div"),e.textContent=this.data.fieldValue,e.style.verticalAlign="middle",e.style.display="table-cell",this.data.hasOwnCanvas&&(e.hidden=!0);return this._setTextStyle(e),this._setBackgroundColor(e),this._setDefaultPropertiesFromJS(e),this.container.append(e),this.container}}class f extends r{constructor(m){super(m,{isRenderable:!!m.data.hasOwnCanvas})}}class v extends r{constructor(m){super(m,{isRenderable:m.renderForms})}render(){const m=this.annotationStorage,l=this.data,e=l.id;let n=m.getValue(e,{value:l.exportValue===l.fieldValue}).value;typeof n=="string"&&(n=n!=="Off",m.setValue(e,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const a=document.createElement("input");return d.add(a),a.setAttribute("data-element-id",e),a.disabled=l.readOnly,this._setRequired(a,this.data.required),a.type="checkbox",a.name=l.fieldName,n&&a.setAttribute("checked",!0),a.setAttribute("exportValue",l.exportValue),a.tabIndex=A,a.addEventListener("change",i=>{const{name:h,checked:p}=i.target;for(const w of this._getElementsByName(h,e)){const E=p&&w.exportValue===l.exportValue;w.domElement&&(w.domElement.checked=E),m.setValue(w.id,{value:E})}m.setValue(e,{value:p})}),a.addEventListener("resetform",i=>{const h=l.defaultFieldValue||"Off";i.target.checked=h===l.exportValue}),this.enableScripting&&this.hasJSActions&&(a.addEventListener("updatefromsandbox",i=>{const h={value(p){p.target.checked=p.detail.value!=="Off",m.setValue(e,{value:p.target.checked})}};this._dispatchEventFromSandbox(h,i)}),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],i=>i.target.checked)),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class S extends r{constructor(m){super(m,{isRenderable:m.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const m=this.annotationStorage,l=this.data,e=l.id;let n=m.getValue(e,{value:l.fieldValue===l.buttonValue}).value;if(typeof n=="string"&&(n=n!==l.buttonValue,m.setValue(e,{value:n})),n)for(const i of this._getElementsByName(l.fieldName,e))m.setValue(i.id,{value:!1});const a=document.createElement("input");if(d.add(a),a.setAttribute("data-element-id",e),a.disabled=l.readOnly,this._setRequired(a,this.data.required),a.type="radio",a.name=l.fieldName,n&&a.setAttribute("checked",!0),a.tabIndex=A,a.addEventListener("change",i=>{const{name:h,checked:p}=i.target;for(const w of this._getElementsByName(h,e))m.setValue(w.id,{value:!1});m.setValue(e,{value:p})}),a.addEventListener("resetform",i=>{const h=l.defaultFieldValue;i.target.checked=h!=null&&h===l.buttonValue}),this.enableScripting&&this.hasJSActions){const i=l.buttonValue;a.addEventListener("updatefromsandbox",h=>{const p={value:w=>{const E=i===w.detail.value;for(const R of this._getElementsByName(w.target.name)){const P=E&&R.id===e;R.domElement&&(R.domElement.checked=P),m.setValue(R.id,{value:P})}}};this._dispatchEventFromSandbox(p,h)}),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],h=>h.target.checked)}return this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class M extends g{constructor(m){super(m,{ignoreBorder:m.data.hasAppearance})}render(){const m=super.render();m.classList.add("buttonWidgetAnnotation","pushButton");const l=m.lastChild;return this.enableScripting&&this.hasJSActions&&l&&(this._setDefaultPropertiesFromJS(l),l.addEventListener("updatefromsandbox",e=>{this._dispatchEventFromSandbox({},e)})),m}}class I extends r{constructor(m){super(m,{isRenderable:m.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const m=this.annotationStorage,l=this.data.id,e=m.getValue(l,{value:this.data.fieldValue}),n=document.createElement("select");d.add(n),n.setAttribute("data-element-id",l),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=A;let a=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",E=>{const R=this.data.defaultFieldValue;for(const P of n.options)P.selected=P.value===R});for(const E of this.data.options){const R=document.createElement("option");R.textContent=E.displayValue,R.value=E.exportValue,e.value.includes(E.exportValue)&&(R.setAttribute("selected",!0),a=!1),n.append(R)}let i=null;if(a){const E=document.createElement("option");E.value=" ",E.setAttribute("hidden",!0),E.setAttribute("selected",!0),n.prepend(E),i=()=>{E.remove(),n.removeEventListener("input",i),i=null},n.addEventListener("input",i)}const h=E=>{const R=E?"value":"textContent",{options:P,multiple:L}=n;return L?Array.prototype.filter.call(P,x=>x.selected).map(x=>x[R]):P.selectedIndex===-1?null:P[P.selectedIndex][R]};let p=h(!1);const w=E=>{const R=E.target.options;return Array.prototype.map.call(R,P=>({displayValue:P.textContent,exportValue:P.value}))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",E=>{const R={value(P){i?.();const L=P.detail.value,x=new Set(Array.isArray(L)?L:[L]);for(const k of n.options)k.selected=x.has(k.value);m.setValue(l,{value:h(!0)}),p=h(!1)},multipleSelection(P){n.multiple=!0},remove(P){const L=n.options,x=P.detail.remove;L[x].selected=!1,n.remove(x),L.length>0&&Array.prototype.findIndex.call(L,D=>D.selected)===-1&&(L[0].selected=!0),m.setValue(l,{value:h(!0),items:w(P)}),p=h(!1)},clear(P){for(;n.length!==0;)n.remove(0);m.setValue(l,{value:null,items:[]}),p=h(!1)},insert(P){const{index:L,displayValue:x,exportValue:k}=P.detail.insert,D=n.children[L],j=document.createElement("option");j.textContent=x,j.value=k,D?D.before(j):n.append(j),m.setValue(l,{value:h(!0),items:w(P)}),p=h(!1)},items(P){const{items:L}=P.detail;for(;n.length!==0;)n.remove(0);for(const x of L){const{displayValue:k,exportValue:D}=x,j=document.createElement("option");j.textContent=k,j.value=D,n.append(j)}n.options.length>0&&(n.options[0].selected=!0),m.setValue(l,{value:h(!0),items:w(P)}),p=h(!1)},indices(P){const L=new Set(P.detail.indices);for(const x of P.target.options)x.selected=L.has(x.index);m.setValue(l,{value:h(!0)}),p=h(!1)},editable(P){P.target.disabled=!P.detail.editable}};this._dispatchEventFromSandbox(R,E)}),n.addEventListener("input",E=>{const R=h(!0);m.setValue(l,{value:R}),E.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:p,changeEx:R,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],E=>E.target.value)):n.addEventListener("input",function(E){m.setValue(l,{value:h(!0)})}),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class O extends s{constructor(m){const{data:l,elements:e}=m;super(m,{isRenderable:s._hasPopupData(l)}),this.elements=e}render(){this.container.classList.add("popupAnnotation");const m=new N({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),l=[];for(const e of this.elements)e.popup=m,l.push(e.data.id),e.addHighlightArea();return this.container.setAttribute("aria-controls",l.map(e=>`${y.AnnotationPrefix}${e}`).join(",")),this.container}}class N{#t=this.#b.bind(this);#e=this.#E.bind(this);#s=this.#w.bind(this);#n=this.#A.bind(this);#r=null;#i=null;#a=null;#l=null;#h=null;#d=null;#u=null;#c=!1;#o=null;#p=null;#g=null;#f=null;#m=!1;constructor({container:m,color:l,elements:e,titleObj:n,modificationDate:a,contentsObj:i,richText:h,parent:p,rect:w,parentRect:E,open:R}){this.#i=m,this.#f=n,this.#a=i,this.#g=h,this.#d=p,this.#r=l,this.#p=w,this.#u=E,this.#h=e,this.#l=z.PDFDateString.toDateObject(a),this.trigger=e.flatMap(P=>P.getElementsToTriggerPopup());for(const P of this.trigger)P.addEventListener("click",this.#n),P.addEventListener("mouseenter",this.#s),P.addEventListener("mouseleave",this.#e),P.classList.add("popupTriggerArea");for(const P of e)P.container?.addEventListener("keydown",this.#t);this.#i.hidden=!0,R&&this.#A()}render(){if(this.#o)return;const{page:{view:m},viewport:{rawDims:{pageWidth:l,pageHeight:e,pageX:n,pageY:a}}}=this.#d,i=this.#o=document.createElement("div");if(i.className="popup",this.#r){const $=i.style.outlineColor=y.Util.makeHexColor(...this.#r);CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?i.style.backgroundColor=`color-mix(in srgb, ${$} 30%, white)`:i.style.backgroundColor=y.Util.makeHexColor(...this.#r.map(it=>Math.floor(.7*(255-it)+it)))}const h=document.createElement("span");h.className="header";const p=document.createElement("h1");if(h.append(p),{dir:p.dir,str:p.textContent}=this.#f,i.append(h),this.#l){const $=document.createElement("span");$.classList.add("popupDate"),$.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),$.setAttribute("data-l10n-args",JSON.stringify({date:this.#l.toLocaleDateString(),time:this.#l.toLocaleTimeString()})),h.append($)}const w=this.#a,E=this.#g;if(E?.str&&(!w?.str||w.str===E.str))T.XfaLayer.render({xfaHtml:E.html,intent:"richText",div:i}),i.lastChild.classList.add("richText","popupContent");else{const $=this._formatContents(w);i.append($)}let R=!!this.#u,P=R?this.#u:this.#p;for(const $ of this.#h)if(!P||y.Util.intersect($.data.rect,P)!==null){P=$.data.rect,R=!0;break}const L=y.Util.normalizeRect([P[0],m[3]-P[1]+m[1],P[2],m[3]-P[3]+m[1]]),x=5,k=R?P[2]-P[0]+x:0,D=L[0]+k,j=L[1],{style:J}=this.#i;J.left=`${100*(D-n)/l}%`,J.top=`${100*(j-a)/e}%`,this.#i.append(i)}_formatContents({str:m,dir:l}){const e=document.createElement("p");e.classList.add("popupContent"),e.dir=l;const n=m.split(/(?:\r\n?|\n)/);for(let a=0,i=n.length;a{a.key==="Enter"&&(n?a.metaKey:a.ctrlKey)&&this.#e()}),!l.popupRef&&this.hasPopupData?this._createPopup():e.classList.add("popupTriggerArea"),m.append(e),m}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}#e(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class ct{#t=null;#e=null;#s=new Map;constructor({div:m,accessibilityManager:l,annotationCanvasMap:e,page:n,viewport:a}){this.div=m,this.#t=l,this.#e=e,this.page=n,this.viewport=a,this.zIndex=0}#n(m,l){const e=m.firstChild||m;e.id=`${y.AnnotationPrefix}${l}`,this.div.append(m),this.#t?.moveElementInDOM(this.div,m,e,!1)}async render(m){const{annotations:l}=m,e=this.div;(0,z.setLayerDimensions)(e,this.viewport);const n=new Map,a={data:null,layer:e,linkService:m.linkService,downloadManager:m.downloadManager,imageResourcesPath:m.imageResourcesPath||"",renderForms:m.renderForms!==!1,svgFactory:new z.DOMSVGFactory,annotationStorage:m.annotationStorage||new _.AnnotationStorage,enableScripting:m.enableScripting===!0,hasJSActions:m.hasJSActions,fieldObjects:m.fieldObjects,parent:this,elements:null};for(const i of l){if(i.noHTML)continue;const h=i.annotationType===y.AnnotationType.POPUP;if(h){const E=n.get(i.id);if(!E)continue;a.elements=E}else{const{width:E,height:R}=u(i.rect);if(E<=0||R<=0)continue}a.data=i;const p=b.create(a);if(!p.isRenderable)continue;if(!h&&i.popupRef){const E=n.get(i.popupRef);E?E.push(p):n.set(i.popupRef,[p])}p.annotationEditorType>0&&this.#s.set(p.data.id,p);const w=p.render();i.hidden&&(w.style.visibility="hidden"),this.#n(w,i.id)}this.#r()}update({viewport:m}){const l=this.div;this.viewport=m,(0,z.setLayerDimensions)(l,{rotation:m.rotation}),this.#r(),l.hidden=!1}#r(){if(!this.#e)return;const m=this.div;for(const[l,e]of this.#e){const n=m.querySelector(`[data-annotation-id="${l}"]`);if(!n)continue;const{firstChild:a}=n;a?a.nodeName==="CANVAS"?a.replaceWith(e):a.before(e):n.append(e)}this.#e.clear()}getEditableAnnotations(){return Array.from(this.#s.values())}getEditableAnnotation(m){return this.#s.get(m)}}},792:(dt,et,V)=>{V.d(et,{AnnotationStorage:()=>F,PrintAnnotationStorage:()=>C,SerializableEmpty:()=>U});var y=V(292),z=V(310),_=V(651);const U=Object.freeze({map:null,hash:"",transfer:void 0});class F{#t=!1;#e=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(A,o){const d=this.#e.get(A);return d===void 0?o:Object.assign(o,d)}getRawValue(A){return this.#e.get(A)}remove(A){if(this.#e.delete(A),this.#e.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const o of this.#e.values())if(o instanceof z.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(A,o){const d=this.#e.get(A);let u=!1;if(d!==void 0)for(const[b,s]of Object.entries(o))d[b]!==s&&(u=!0,d[b]=s);else u=!0,this.#e.set(A,o);u&&this.#s(),o instanceof z.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(o.constructor._type)}has(A){return this.#e.has(A)}getAll(){return this.#e.size>0?(0,y.objectFromMap)(this.#e):null}setAll(A){for(const[o,d]of Object.entries(A))this.setValue(o,d)}get size(){return this.#e.size}#s(){this.#t||(this.#t=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#t&&(this.#t=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new C(this)}get serializable(){if(this.#e.size===0)return U;const A=new Map,o=new _.MurmurHash3_64,d=[],u=Object.create(null);let b=!1;for(const[s,g]of this.#e){const t=g instanceof z.AnnotationEditor?g.serialize(!1,u):g;t&&(A.set(s,t),o.update(`${s}:${JSON.stringify(t)}`),b||=!!t.bitmap)}if(b)for(const s of A.values())s.bitmap&&d.push(s.bitmap);return A.size>0?{map:A,hash:o.hexdigest(),transfer:d}:U}get editorStats(){let A=null;const o=new Map;for(const d of this.#e.values()){if(!(d instanceof z.AnnotationEditor))continue;const u=d.telemetryFinalData;if(!u)continue;const{type:b}=u;o.has(b)||o.set(b,Object.getPrototypeOf(d).constructor),A||=Object.create(null);const s=A[b]||=new Map;for(const[g,t]of Object.entries(u)){if(g==="type")continue;let r=s.get(g);r||(r=new Map,s.set(g,r));const c=r.get(t)??0;r.set(t,c+1)}}for(const[d,u]of o)A[d]=u.computeTelemetryFinalData(A[d]);return A}}class C extends F{#t;constructor(A){super();const{map:o,hash:d,transfer:u}=A.serializable,b=structuredClone(o,u?{transfer:u}:null);this.#t={map:b,hash:d,transfer:u}}get print(){(0,y.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#t}}},831:(dt,et,V)=>{V.a(dt,async(y,z)=>{try{let st=function(a){if(typeof a=="string"||a instanceof URL?a={url:a}:(a instanceof ArrayBuffer||ArrayBuffer.isView(a))&&(a={data:a}),typeof a!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!a.url&&!a.data&&!a.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const i=new Y,{docId:h}=i,p=a.url?H(a.url):null,w=a.data?G(a.data):null,E=a.httpHeaders||null,R=a.withCredentials===!0,P=a.password??null,L=a.range instanceof Q?a.range:null,x=Number.isInteger(a.rangeChunkSize)&&a.rangeChunkSize>0?a.rangeChunkSize:S;let k=a.worker instanceof ht?a.worker:null;const D=a.verbosity,j=typeof a.docBaseUrl=="string"&&!(0,F.isDataScheme)(a.docBaseUrl)?a.docBaseUrl:null,J=typeof a.cMapUrl=="string"?a.cMapUrl:null,$=a.cMapPacked!==!1,tt=a.CMapReaderFactory||N,it=typeof a.standardFontDataUrl=="string"?a.standardFontDataUrl:null,W=a.StandardFontDataFactory||q,rt=a.stopAtErrors!==!0,nt=Number.isInteger(a.maxImageSize)&&a.maxImageSize>-1?a.maxImageSize:-1,ut=a.isEvalSupported!==!1,gt=typeof a.isOffscreenCanvasSupported=="boolean"?a.isOffscreenCanvasSupported:!_.isNodeJS,mt=Number.isInteger(a.canvasMaxAreaInBytes)?a.canvasMaxAreaInBytes:-1,At=typeof a.disableFontFace=="boolean"?a.disableFontFace:_.isNodeJS,bt=a.fontExtraProperties===!0,Ct=a.enableXfa===!0,St=a.ownerDocument||globalThis.document,Tt=a.disableRange===!0,yt=a.disableStream===!0,xt=a.disableAutoFetch===!0,kt=a.pdfBug===!0,Pt=L?L.length:a.length??NaN,Nt=typeof a.useSystemFonts=="boolean"?a.useSystemFonts:!_.isNodeJS&&!At,Mt=typeof a.useWorkerFetch=="boolean"?a.useWorkerFetch:tt===F.DOMCMapReaderFactory&&W===F.DOMStandardFontDataFactory&&J&&it&&(0,F.isValidFetchUrl)(J,document.baseURI)&&(0,F.isValidFetchUrl)(it,document.baseURI),Ot=a.canvasFactory||new O({ownerDocument:St}),Et=a.filterFactory||new B({docId:h,ownerDocument:St}),wt=null;(0,_.setVerbosityLevel)(D);const It={canvasFactory:Ot,filterFactory:Et};if(Mt||(It.cMapReaderFactory=new tt({baseUrl:J,isCompressed:$}),It.standardFontDataFactory=new W({baseUrl:it})),!k){const vt={verbosity:D,port:d.GlobalWorkerOptions.workerPort};k=vt.port?ht.fromPort(vt):new ht(vt),i._worker=k}const Ht={docId:h,apiVersion:"4.1.392",data:w,password:P,disableAutoFetch:xt,rangeChunkSize:x,length:Pt,docBaseUrl:j,enableXfa:Ct,evaluatorOptions:{maxImageSize:nt,disableFontFace:At,ignoreErrors:rt,isEvalSupported:ut,isOffscreenCanvasSupported:gt,canvasMaxAreaInBytes:mt,fontExtraProperties:bt,useSystemFonts:Nt,cMapUrl:Mt?J:null,standardFontDataUrl:Mt?it:null}},_t={ignoreErrors:rt,isEvalSupported:ut,disableFontFace:At,fontExtraProperties:bt,enableXfa:Ct,ownerDocument:St,disableAutoFetch:xt,pdfBug:kt,styleElement:wt};return k.promise.then(function(){if(i.destroyed)throw new Error("Loading aborted");const vt=X(k,Ht),Ut=new Promise(function(Bt){let Dt;L?Dt=new g.PDFDataTransportStream(L,{disableRange:Tt,disableStream:yt}):w||(Dt=(Ft=>_.isNodeJS?function(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype}()&&(0,F.isValidFetchUrl)(Ft.url)?new t.PDFFetchStream(Ft):new c.PDFNodeStream(Ft):(0,F.isValidFetchUrl)(Ft.url)?new t.PDFFetchStream(Ft):new r.PDFNetworkStream(Ft))({url:p,length:Pt,httpHeaders:E,withCredentials:R,rangeChunkSize:x,disableRange:Tt,disableStream:yt})),Bt(Dt)});return Promise.all([vt,Ut]).then(function([Bt,Dt]){if(i.destroyed)throw new Error("Loading aborted");const zt=new u.MessageHandler(h,Bt,k.port),Ft=new ft(zt,i,Dt,_t,It);i._transport=Ft,zt.send("Ready",null)})}).catch(i._capability.reject),i},H=function(a){if(a instanceof URL)return a.href;try{return new URL(a,window.location).href}catch{if(_.isNodeJS&&typeof a=="string")return a}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")},G=function(a){if(_.isNodeJS&&typeof Buffer<"u"&&a instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength)return a;if(typeof a=="string")return(0,_.stringToBytes)(a);if(a instanceof ArrayBuffer||ArrayBuffer.isView(a)||typeof a=="object"&&!isNaN(a?.length))return new Uint8Array(a);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")};V.d(et,{PDFDataRangeTransport:()=>Q,PDFWorker:()=>ht,build:()=>n,getDocument:()=>st,version:()=>e});var _=V(292),U=V(792),F=V(419),C=V(10),T=V(573),A=V(923),o=V(814),d=V(164),u=V(178),b=V(62),s=V(626),g=V(585),t=V(94),r=V(457),c=V(786),f=V(50),v=y([T,c]);[T,c]=v.then?(await v)():v;const S=65536,M=100,I=5e3,O=_.isNodeJS?T.NodeCanvasFactory:F.DOMCanvasFactory,N=_.isNodeJS?T.NodeCMapReaderFactory:F.DOMCMapReaderFactory,B=_.isNodeJS?T.NodeFilterFactory:F.DOMFilterFactory,q=_.isNodeJS?T.NodeStandardFontDataFactory:F.DOMStandardFontDataFactory;async function X(a,i){if(a.destroyed)throw new Error("Worker was destroyed");const h=await a.messageHandler.sendWithPromise("GetDocRequest",i,i.data?[i.data.buffer]:null);if(a.destroyed)throw new Error("Worker was destroyed");return h}class Y{static#t=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${Y.#t++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(i){throw this._worker?.port&&delete this._worker._pendingDestroy,i}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}class Q{constructor(i,h,p=!1,w=null){this.length=i,this.initialData=h,this.progressiveDone=p,this.contentDispositionFilename=w,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(i){this._rangeListeners.push(i)}addProgressListener(i){this._progressListeners.push(i)}addProgressiveReadListener(i){this._progressiveReadListeners.push(i)}addProgressiveDoneListener(i){this._progressiveDoneListeners.push(i)}onDataRange(i,h){for(const p of this._rangeListeners)p(i,h)}onDataProgress(i,h){this._readyCapability.promise.then(()=>{for(const p of this._progressListeners)p(i,h)})}onDataProgressiveRead(i){this._readyCapability.promise.then(()=>{for(const h of this._progressiveReadListeners)h(i)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const i of this._progressiveDoneListeners)i()})}transportReady(){this._readyCapability.resolve()}requestDataRange(i,h){(0,_.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class K{constructor(i,h){this._pdfInfo=i,this._transport=h}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(i){return this._transport.getPage(i)}getPageIndex(i){return this._transport.getPageIndex(i)}getDestinations(){return this._transport.getDestinations()}getDestination(i){return this._transport.getDestination(i)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:i="display"}={}){const{renderingIntent:h}=this._transport.getRenderingIntent(i);return this._transport.getOptionalContentConfig(h)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(i=!1){return this._transport.startCleanup(i||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class at{#t=null;#e=!1;constructor(i,h,p,w=!1){this._pageIndex=i,this._pageInfo=h,this._transport=p,this._stats=w?new F.StatTimer:null,this._pdfBug=w,this.commonObjs=p.commonObjs,this.objs=new Z,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:i,rotation:h=this.rotate,offsetX:p=0,offsetY:w=0,dontFlip:E=!1}={}){return new F.PageViewport({viewBox:this.view,scale:i,rotation:h,offsetX:p,offsetY:w,dontFlip:E})}getAnnotations({intent:i="display"}={}){const{renderingIntent:h}=this._transport.getRenderingIntent(i);return this._transport.getAnnotations(this._pageIndex,h)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:i,viewport:h,intent:p="display",annotationMode:w=_.AnnotationMode.ENABLE,transform:E=null,background:R=null,optionalContentConfigPromise:P=null,annotationCanvasMap:L=null,pageColors:x=null,printAnnotationStorage:k=null}){this._stats?.time("Overall");const D=this._transport.getRenderingIntent(p,w,k),{renderingIntent:j,cacheKey:J}=D;this.#e=!1,this.#n(),P||=this._transport.getOptionalContentConfig(j);let $=this._intentStates.get(J);$||($=Object.create(null),this._intentStates.set(J,$)),$.streamReaderCancelTimeout&&(clearTimeout($.streamReaderCancelTimeout),$.streamReaderCancelTimeout=null);const tt=!!(j&_.RenderingIntentFlag.PRINT);$.displayReadyCapability||($.displayReadyCapability=Promise.withResolvers(),$.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(D));const it=nt=>{$.renderTasks.delete(W),(this._maybeCleanupAfterRender||tt)&&(this.#e=!0),this.#s(!tt),nt?(W.capability.reject(nt),this._abortOperatorList({intentState:$,reason:nt instanceof Error?nt:new Error(nt)})):W.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")},W=new l({callback:it,params:{canvasContext:i,viewport:h,transform:E,background:R},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:L,operatorList:$.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!tt,pdfBug:this._pdfBug,pageColors:x});($.renderTasks||=new Set).add(W);const rt=W.task;return Promise.all([$.displayReadyCapability.promise,P]).then(([nt,ut])=>{if(this.destroyed){it();return}if(this._stats?.time("Rendering"),!(ut.renderingIntent&j))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");W.initializeGraphics({transparency:nt,optionalContentConfig:ut}),W.operatorListChanged()}).catch(it),rt}getOperatorList({intent:i="display",annotationMode:h=_.AnnotationMode.ENABLE,printAnnotationStorage:p=null}={}){function w(){R.operatorList.lastChunk&&(R.opListReadCapability.resolve(R.operatorList),R.renderTasks.delete(P))}const E=this._transport.getRenderingIntent(i,h,p,!0);let R=this._intentStates.get(E.cacheKey);R||(R=Object.create(null),this._intentStates.set(E.cacheKey,R));let P;return R.opListReadCapability||(P=Object.create(null),P.operatorListChanged=w,R.opListReadCapability=Promise.withResolvers(),(R.renderTasks||=new Set).add(P),R.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(E)),R.opListReadCapability.promise}streamTextContent({includeMarkedContent:i=!1,disableNormalization:h=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:i===!0,disableNormalization:h===!0},{highWaterMark:100,size(w){return w.items.length}})}getTextContent(i={}){if(this._transport._htmlForXfa)return this.getXfa().then(p=>f.XfaText.textContent(p));const h=this.streamTextContent(i);return new Promise(function(p,w){function E(){R.read().then(function({value:L,done:x}){if(x){p(P);return}Object.assign(P.styles,L.styles),P.items.push(...L.items),E()},w)}const R=h.getReader(),P={items:[],styles:Object.create(null)};E()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const i=[];for(const h of this._intentStates.values())if(this._abortOperatorList({intentState:h,reason:new Error("Page was destroyed."),force:!0}),!h.opListReadCapability)for(const p of h.renderTasks)i.push(p.completed),p.cancel();return this.objs.clear(),this.#e=!1,this.#n(),Promise.all(i)}cleanup(i=!1){this.#e=!0;const h=this.#s(!1);return i&&h&&(this._stats&&=new F.StatTimer),h}#s(i=!1){if(this.#n(),!this.#e||this.destroyed)return!1;if(i)return this.#t=setTimeout(()=>{this.#t=null,this.#s(!1)},I),!1;for(const{renderTasks:h,operatorList:p}of this._intentStates.values())if(h.size>0||!p.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#e=!1,!0}#n(){this.#t&&(clearTimeout(this.#t),this.#t=null)}_startRenderPage(i,h){const p=this._intentStates.get(h);p&&(this._stats?.timeEnd("Page Request"),p.displayReadyCapability?.resolve(i))}_renderPageChunk(i,h){for(let p=0,w=i.length;p{P.read().then(({value:k,done:D})=>{if(D){L.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(k,L),x())},k=>{if(L.streamReader=null,!this._transport.destroyed){if(L.operatorList){L.operatorList.lastChunk=!0;for(const D of L.renderTasks)D.operatorListChanged();this.#s(!0)}if(L.displayReadyCapability)L.displayReadyCapability.reject(k);else if(L.opListReadCapability)L.opListReadCapability.reject(k);else throw k}})};x()}_abortOperatorList({intentState:i,reason:h,force:p=!1}){if(i.streamReader){if(i.streamReaderCancelTimeout&&(clearTimeout(i.streamReaderCancelTimeout),i.streamReaderCancelTimeout=null),!p){if(i.renderTasks.size>0)return;if(h instanceof F.RenderingCancelledException){let w=M;h.extraDelay>0&&h.extraDelay<1e3&&(w+=h.extraDelay),i.streamReaderCancelTimeout=setTimeout(()=>{i.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:i,reason:h,force:!0})},w);return}}if(i.streamReader.cancel(new _.AbortException(h.message)).catch(()=>{}),i.streamReader=null,!this._transport.destroyed){for(const[w,E]of this._intentStates)if(E===i){this._intentStates.delete(w);break}this.cleanup()}}}get stats(){return this._stats}}class ot{#t=new Set;#e=Promise.resolve();postMessage(i,h){const p={data:structuredClone(i,h?{transfer:h}:null)};this.#e.then(()=>{for(const w of this.#t)w.call(this,p)})}addEventListener(i,h){this.#t.add(h)}removeEventListener(i,h){this.#t.delete(h)}terminate(){this.#t.clear()}}const lt={isWorkerDisabled:!1,fakeWorkerId:0};_.isNodeJS&&(lt.isWorkerDisabled=!0,d.GlobalWorkerOptions.workerSrc||="./pdf.worker.mjs"),lt.isSameOrigin=function(a,i){let h;try{if(h=new URL(a),!h.origin||h.origin==="null")return!1}catch{return!1}const p=new URL(i,h);return h.origin===p.origin},lt.createCDNWrapper=function(a){const i=`await import("${a}");`;return URL.createObjectURL(new Blob([i],{type:"text/javascript"}))};class ht{static#t;constructor({name:i=null,port:h=null,verbosity:p=(0,_.getVerbosityLevel)()}={}){if(this.name=i,this.destroyed=!1,this.verbosity=p,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,h){if(ht.#t?.has(h))throw new Error("Cannot use more than one PDFWorker per port.");(ht.#t||=new WeakMap).set(h,this),this._initializeFromPort(h);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(i){this._port=i,this._messageHandler=new u.MessageHandler("main","worker",i),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!lt.isWorkerDisabled&&!ht.#e){let{workerSrc:i}=ht;try{lt.isSameOrigin(window.location.href,i)||(i=lt.createCDNWrapper(new URL(i,window.location).href));const h=new Worker(i,{type:"module"}),p=new u.MessageHandler("main","worker",h),w=()=>{h.removeEventListener("error",E),p.destroy(),h.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},E=()=>{this._webWorker||w()};h.addEventListener("error",E),p.on("test",P=>{if(h.removeEventListener("error",E),this.destroyed){w();return}P?(this._messageHandler=p,this._port=h,this._webWorker=h,this._readyCapability.resolve(),p.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),p.destroy(),h.terminate())}),p.on("ready",P=>{if(h.removeEventListener("error",E),this.destroyed){w();return}try{R()}catch{this._setupFakeWorker()}});const R=()=>{const P=new Uint8Array;p.send("test",P,[P.buffer])};R();return}catch{(0,_.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){lt.isWorkerDisabled||((0,_.warn)("Setting up fake worker."),lt.isWorkerDisabled=!0),ht._setupFakeWorkerGlobal.then(i=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const h=new ot;this._port=h;const p=`fake${lt.fakeWorkerId++}`,w=new u.MessageHandler(p+"_worker",p,h);i.setup(w,h);const E=new u.MessageHandler(p,p+"_worker",h);this._messageHandler=E,this._readyCapability.resolve(),E.send("configure",{verbosity:this.verbosity})}).catch(i=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${i.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),ht.#t?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(i){if(!i?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const h=this.#t?.get(i.port);if(h){if(h._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return h}return new ht(i)}static get workerSrc(){if(d.GlobalWorkerOptions.workerSrc)return d.GlobalWorkerOptions.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#e(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){const i=async()=>this.#e?this.#e:(await Rt(()=>import(this.workerSrc),[])).WorkerMessageHandler;return(0,_.shadow)(this,"_setupFakeWorkerGlobal",i())}}class ft{#t=new Map;#e=new Map;#s=new Map;#n=null;constructor(i,h,p,w,E){this.messageHandler=i,this.loadingTask=h,this.commonObjs=new Z,this.fontLoader=new C.FontLoader({ownerDocument:w.ownerDocument,styleElement:w.styleElement}),this._params=w,this.canvasFactory=E.canvasFactory,this.filterFactory=E.filterFactory,this.cMapReaderFactory=E.cMapReaderFactory,this.standardFontDataFactory=E.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=p,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#r(i,h=null){const p=this.#t.get(i);if(p)return p;const w=this.messageHandler.sendWithPromise(i,h);return this.#t.set(i,w),w}get annotationStorage(){return(0,_.shadow)(this,"annotationStorage",new U.AnnotationStorage)}getRenderingIntent(i,h=_.AnnotationMode.ENABLE,p=null,w=!1){let E=_.RenderingIntentFlag.DISPLAY,R=U.SerializableEmpty;switch(i){case"any":E=_.RenderingIntentFlag.ANY;break;case"display":break;case"print":E=_.RenderingIntentFlag.PRINT;break;default:(0,_.warn)(`getRenderingIntent - invalid intent: ${i}`)}switch(h){case _.AnnotationMode.DISABLE:E+=_.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _.AnnotationMode.ENABLE:break;case _.AnnotationMode.ENABLE_FORMS:E+=_.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _.AnnotationMode.ENABLE_STORAGE:E+=_.RenderingIntentFlag.ANNOTATIONS_STORAGE,R=(E&_.RenderingIntentFlag.PRINT&&p instanceof U.PrintAnnotationStorage?p:this.annotationStorage).serializable;break;default:(0,_.warn)(`getRenderingIntent - invalid annotationMode: ${h}`)}return w&&(E+=_.RenderingIntentFlag.OPLIST),{renderingIntent:E,cacheKey:`${E}_${R.hash}`,annotationStorageSerializable:R}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#n?.reject(new Error("Worker was destroyed during onPassword callback"));const i=[];for(const p of this.#e.values())i.push(p._destroy());this.#e.clear(),this.#s.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const h=this.messageHandler.sendWithPromise("Terminate",null);return i.push(h),Promise.all(i).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(),(0,o.cleanupTextLayer)(),this._networkStream?.cancelAllRequests(new _.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:i,loadingTask:h}=this;i.on("GetReader",(p,w)=>{(0,_.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=E=>{this._lastProgress={loaded:E.loaded,total:E.total}},w.onPull=()=>{this._fullReader.read().then(function({value:E,done:R}){if(R){w.close();return}(0,_.assert)(E instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),w.enqueue(new Uint8Array(E),1,[E])}).catch(E=>{w.error(E)})},w.onCancel=E=>{this._fullReader.cancel(E),w.ready.catch(R=>{if(!this.destroyed)throw R})}}),i.on("ReaderHeadersReady",p=>{const w=Promise.withResolvers(),E=this._fullReader;return E.headersReady.then(()=>{(!E.isStreamingSupported||!E.isRangeSupported)&&(this._lastProgress&&h.onProgress?.(this._lastProgress),E.onProgress=R=>{h.onProgress?.({loaded:R.loaded,total:R.total})}),w.resolve({isStreamingSupported:E.isStreamingSupported,isRangeSupported:E.isRangeSupported,contentLength:E.contentLength})},w.reject),w.promise}),i.on("GetRangeReader",(p,w)=>{(0,_.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const E=this._networkStream.getRangeReader(p.begin,p.end);if(!E){w.close();return}w.onPull=()=>{E.read().then(function({value:R,done:P}){if(P){w.close();return}(0,_.assert)(R instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),w.enqueue(new Uint8Array(R),1,[R])}).catch(R=>{w.error(R)})},w.onCancel=R=>{E.cancel(R),w.ready.catch(P=>{if(!this.destroyed)throw P})}}),i.on("GetDoc",({pdfInfo:p})=>{this._numPages=p.numPages,this._htmlForXfa=p.htmlForXfa,delete p.htmlForXfa,h._capability.resolve(new K(p,this))}),i.on("DocException",function(p){let w;switch(p.name){case"PasswordException":w=new _.PasswordException(p.message,p.code);break;case"InvalidPDFException":w=new _.InvalidPDFException(p.message);break;case"MissingPDFException":w=new _.MissingPDFException(p.message);break;case"UnexpectedResponseException":w=new _.UnexpectedResponseException(p.message,p.status);break;case"UnknownErrorException":w=new _.UnknownErrorException(p.message,p.details);break;default:(0,_.unreachable)("DocException - expected a valid Error.")}h._capability.reject(w)}),i.on("PasswordRequest",p=>{if(this.#n=Promise.withResolvers(),h.onPassword){const w=E=>{E instanceof Error?this.#n.reject(E):this.#n.resolve({password:E})};try{h.onPassword(w,p.code)}catch(E){this.#n.reject(E)}}else this.#n.reject(new _.PasswordException(p.message,p.code));return this.#n.promise}),i.on("DataLoaded",p=>{h.onProgress?.({loaded:p.length,total:p.length}),this.downloadInfoCapability.resolve(p)}),i.on("StartRenderPage",p=>{if(this.destroyed)return;this.#e.get(p.pageIndex)._startRenderPage(p.transparency,p.cacheKey)}),i.on("commonobj",([p,w,E])=>{if(this.destroyed||this.commonObjs.has(p))return null;switch(w){case"Font":const R=this._params;if("error"in E){const k=E.error;(0,_.warn)(`Error during font loading: ${k}`),this.commonObjs.resolve(p,k);break}const P=R.pdfBug&&globalThis.FontInspector?.enabled?(k,D)=>globalThis.FontInspector.fontAdded(k,D):null,L=new C.FontFaceObject(E,{isEvalSupported:R.isEvalSupported,disableFontFace:R.disableFontFace,ignoreErrors:R.ignoreErrors,inspectFont:P});this.fontLoader.bind(L).catch(()=>i.sendWithPromise("FontFallback",{id:p})).finally(()=>{!R.fontExtraProperties&&L.data&&(L.data=null),this.commonObjs.resolve(p,L)});break;case"CopyLocalImage":const{imageRef:x}=E;(0,_.assert)(x,"The imageRef must be defined.");for(const k of this.#e.values())for(const[,D]of k.objs)if(D.ref===x)return D.dataLen?(this.commonObjs.resolve(p,structuredClone(D)),D.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(p,E);break;default:throw new Error(`Got unknown common object type ${w}`)}return null}),i.on("obj",([p,w,E,R])=>{if(this.destroyed)return;const P=this.#e.get(w);if(!P.objs.has(p)){if(P._intentStates.size===0){R?.bitmap?.close();return}switch(E){case"Image":P.objs.resolve(p,R),R?.dataLen>_.MAX_IMAGE_SIZE_TO_CACHE&&(P._maybeCleanupAfterRender=!0);break;case"Pattern":P.objs.resolve(p,R);break;default:throw new Error(`Got unknown object type ${E}`)}}}),i.on("DocProgress",p=>{this.destroyed||h.onProgress?.({loaded:p.loaded,total:p.total})}),i.on("FetchBuiltInCMap",p=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(p):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),i.on("FetchStandardFontData",p=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(p):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&(0,_.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:i,transfer:h}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:i,filename:this._fullReader?.filename??null},h).finally(()=>{this.annotationStorage.resetModified()})}getPage(i){if(!Number.isInteger(i)||i<=0||i>this._numPages)return Promise.reject(new Error("Invalid page request."));const h=i-1,p=this.#s.get(h);if(p)return p;const w=this.messageHandler.sendWithPromise("GetPage",{pageIndex:h}).then(E=>{if(this.destroyed)throw new Error("Transport destroyed");const R=new at(h,E,this,this._params.pdfBug);return this.#e.set(h,R),R});return this.#s.set(h,w),w}getPageIndex(i){return typeof i!="object"||i===null||!Number.isInteger(i.num)||i.num<0||!Number.isInteger(i.gen)||i.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:i.num,gen:i.gen})}getAnnotations(i,h){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:i,intent:h})}getFieldObjects(){return this.#r("GetFieldObjects")}hasJSActions(){return this.#r("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(i){return typeof i!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:i})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#r("GetDocJSActions")}getPageJSActions(i){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:i})}getStructTree(i){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:i})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(i){return this.#r("GetOptionalContentConfig").then(h=>new s.OptionalContentConfig(h,i))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const i="GetMetadata",h=this.#t.get(i);if(h)return h;const p=this.messageHandler.sendWithPromise(i,null).then(w=>({info:w[0],metadata:w[1]?new b.Metadata(w[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#t.set(i,p),p}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(i=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const h of this.#e.values())if(!h.cleanup())throw new Error(`startCleanup: Page ${h.pageNumber} is currently rendering.`);this.commonObjs.clear(),i||this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(!0),(0,o.cleanupTextLayer)()}}get loadingParams(){const{disableAutoFetch:i,enableXfa:h}=this._params;return(0,_.shadow)(this,"loadingParams",{disableAutoFetch:i,enableXfa:h})}}const ct=Symbol("INITIAL_DATA");class Z{#t=Object.create(null);#e(i){return this.#t[i]||={...Promise.withResolvers(),data:ct}}get(i,h=null){if(h){const w=this.#e(i);return w.promise.then(()=>h(w.data)),null}const p=this.#t[i];if(!p||p.data===ct)throw new Error(`Requesting object that isn't resolved yet ${i}.`);return p.data}has(i){const h=this.#t[i];return!!h&&h.data!==ct}resolve(i,h=null){const p=this.#e(i);p.data=h,p.resolve()}clear(){for(const i in this.#t){const{data:h}=this.#t[i];h?.bitmap?.close()}this.#t=Object.create(null)}*[Symbol.iterator](){for(const i in this.#t){const{data:h}=this.#t[i];h!==ct&&(yield[i,h])}}}class m{#t=null;constructor(i){this.#t=i,this.onContinue=null}get promise(){return this.#t.capability.promise}cancel(i=0){this.#t.cancel(null,i)}get separateAnnots(){const{separateAnnots:i}=this.#t.operatorList;if(!i)return!1;const{annotationCanvasMap:h}=this.#t;return i.form||i.canvas&&h?.size>0}}class l{static#t=new WeakSet;constructor({callback:i,params:h,objs:p,commonObjs:w,annotationCanvasMap:E,operatorList:R,pageIndex:P,canvasFactory:L,filterFactory:x,useRequestAnimationFrame:k=!1,pdfBug:D=!1,pageColors:j=null}){this.callback=i,this.params=h,this.objs=p,this.commonObjs=w,this.annotationCanvasMap=E,this.operatorListIdx=null,this.operatorList=R,this._pageIndex=P,this.canvasFactory=L,this.filterFactory=x,this._pdfBug=D,this.pageColors=j,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=k===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new m(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=h.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:i=!1,optionalContentConfig:h}){if(this.cancelled)return;if(this._canvas){if(l.#t.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");l.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:p,viewport:w,transform:E,background:R}=this.params;this.gfx=new A.CanvasGraphics(p,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:h},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:E,viewport:w,transparency:i,background:R}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(i=null,h=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),l.#t.delete(this._canvas),this.callback(i||new F.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,h))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),l.#t.delete(this._canvas),this.callback())))}}const e="4.1.392",n="fcb76a78d";z()}catch(S){z(S)}})},583:(dt,et,V)=>{V.d(et,{BaseCMapReaderFactory:()=>U,BaseCanvasFactory:()=>_,BaseFilterFactory:()=>z,BaseSVGFactory:()=>C,BaseStandardFontDataFactory:()=>F});var y=V(292);class z{constructor(){this.constructor===z&&(0,y.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(A){return"none"}addHCMFilter(A,o){return"none"}addHighlightHCMFilter(A,o,d,u,b){return"none"}destroy(A=!1){}}class _{constructor(){this.constructor===_&&(0,y.unreachable)("Cannot initialize BaseCanvasFactory.")}create(A,o){if(A<=0||o<=0)throw new Error("Invalid canvas size");const d=this._createCanvas(A,o);return{canvas:d,context:d.getContext("2d")}}reset(A,o,d){if(!A.canvas)throw new Error("Canvas is not specified");if(o<=0||d<=0)throw new Error("Invalid canvas size");A.canvas.width=o,A.canvas.height=d}destroy(A){if(!A.canvas)throw new Error("Canvas is not specified");A.canvas.width=0,A.canvas.height=0,A.canvas=null,A.context=null}_createCanvas(A,o){(0,y.unreachable)("Abstract method `_createCanvas` called.")}}class U{constructor({baseUrl:A=null,isCompressed:o=!0}){this.constructor===U&&(0,y.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=A,this.isCompressed=o}async fetch({name:A}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!A)throw new Error("CMap name must be specified.");const o=this.baseUrl+A+(this.isCompressed?".bcmap":""),d=this.isCompressed?y.CMapCompressionType.BINARY:y.CMapCompressionType.NONE;return this._fetchData(o,d).catch(u=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${o}`)})}_fetchData(A,o){(0,y.unreachable)("Abstract method `_fetchData` called.")}}class F{constructor({baseUrl:A=null}){this.constructor===F&&(0,y.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=A}async fetch({filename:A}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!A)throw new Error("Font filename must be specified.");const o=`${this.baseUrl}${A}`;return this._fetchData(o).catch(d=>{throw new Error(`Unable to load font data at: ${o}`)})}_fetchData(A){(0,y.unreachable)("Abstract method `_fetchData` called.")}}class C{constructor(){this.constructor===C&&(0,y.unreachable)("Cannot initialize BaseSVGFactory.")}create(A,o,d=!1){if(A<=0||o<=0)throw new Error("Invalid SVG dimensions");const u=this._createSVG("svg:svg");return u.setAttribute("version","1.1"),d||(u.setAttribute("width",`${A}px`),u.setAttribute("height",`${o}px`)),u.setAttribute("preserveAspectRatio","none"),u.setAttribute("viewBox",`0 0 ${A} ${o}`),u}createElement(A){if(typeof A!="string")throw new Error("Invalid SVG element type");return this._createSVG(A)}_createSVG(A){(0,y.unreachable)("Abstract method `_createSVG` called.")}}},923:(dt,et,V)=>{V.d(et,{CanvasGraphics:()=>m});var y=V(292),z=V(419);const _={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function U(l,e){if(!e)return;const n=e[2]-e[0],a=e[3]-e[1],i=new Path2D;i.rect(e[0],e[1],n,a),l.clip(i)}class F{constructor(){this.constructor===F&&(0,y.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,y.unreachable)("Abstract method `getPattern` called.")}}class C extends F{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let n;this._type==="axial"?n=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(n=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const a of this._colorStops)n.addColorStop(a[0],a[1]);return n}getPattern(e,n,a,i){let h;if(i===_.STROKE||i===_.FILL){const p=n.current.getClippedPathBoundingBox(i,(0,z.getCurrentTransform)(e))||[0,0,0,0],w=Math.ceil(p[2]-p[0])||1,E=Math.ceil(p[3]-p[1])||1,R=n.cachedCanvases.getCanvas("pattern",w,E,!0),P=R.context;P.clearRect(0,0,P.canvas.width,P.canvas.height),P.beginPath(),P.rect(0,0,P.canvas.width,P.canvas.height),P.translate(-p[0],-p[1]),a=y.Util.transform(a,[1,0,0,1,p[0],p[1]]),P.transform(...n.baseTransform),this.matrix&&P.transform(...this.matrix),U(P,this._bbox),P.fillStyle=this._createGradient(P),P.fill(),h=e.createPattern(R.canvas,"no-repeat");const L=new DOMMatrix(a);h.setTransform(L)}else U(e,this._bbox),h=this._createGradient(e);return h}}function T(l,e,n,a,i,h,p,w){const E=e.coords,R=e.colors,P=l.data,L=l.width*4;let x;E[n+1]>E[a+1]&&(x=n,n=a,a=x,x=h,h=p,p=x),E[a+1]>E[i+1]&&(x=a,a=i,i=x,x=p,p=w,w=x),E[n+1]>E[a+1]&&(x=n,n=a,a=x,x=h,h=p,p=x);const k=(E[n]+e.offsetX)*e.scaleX,D=(E[n+1]+e.offsetY)*e.scaleY,j=(E[a]+e.offsetX)*e.scaleX,J=(E[a+1]+e.offsetY)*e.scaleY,$=(E[i]+e.offsetX)*e.scaleX,tt=(E[i+1]+e.offsetY)*e.scaleY;if(D>=tt)return;const it=R[h],W=R[h+1],rt=R[h+2],nt=R[p],ut=R[p+1],gt=R[p+2],mt=R[w],At=R[w+1],bt=R[w+2],Ct=Math.round(D),St=Math.round(tt);let Tt,yt,xt,kt,Pt,Nt,Mt,Ot;for(let Et=Ct;Et<=St;Et++){if(Ettt?vt=1:J===tt?vt=0:vt=(J-Et)/(J-tt),Tt=j-(j-$)*vt,yt=nt-(nt-mt)*vt,xt=ut-(ut-At)*vt,kt=gt-(gt-bt)*vt}let wt;Ettt?wt=1:wt=(D-Et)/(D-tt),Pt=k-(k-$)*wt,Nt=it-(it-mt)*wt,Mt=W-(W-At)*wt,Ot=rt-(rt-bt)*wt;const It=Math.round(Math.min(Tt,Pt)),Ht=Math.round(Math.max(Tt,Pt));let _t=L*Et+It*4;for(let vt=It;vt<=Ht;vt++)wt=(Tt-vt)/(Tt-Pt),wt<0?wt=0:wt>1&&(wt=1),P[_t++]=yt-(yt-Nt)*wt|0,P[_t++]=xt-(xt-Mt)*wt|0,P[_t++]=kt-(kt-Ot)*wt|0,P[_t++]=255}}function A(l,e,n){const a=e.coords,i=e.colors;let h,p;switch(e.type){case"lattice":const w=e.verticesPerRow,E=Math.floor(a.length/w)-1,R=w-1;for(h=0;h=i?h=i:a=h/e,{scale:a,size:h}}clipBbox(e,n,a,i,h){const p=i-n,w=h-a;e.ctx.rect(n,a,p,w),e.current.updateRectMinMax((0,z.getCurrentTransform)(e.ctx),[n,a,i,h]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,n,a){const i=e.ctx,h=e.current;switch(n){case b.COLORED:const p=this.ctx;i.fillStyle=p.fillStyle,i.strokeStyle=p.strokeStyle,h.fillColor=p.fillStyle,h.strokeColor=p.strokeStyle;break;case b.UNCOLORED:const w=y.Util.makeHexColor(a[0],a[1],a[2]);i.fillStyle=w,i.strokeStyle=w,h.fillColor=w,h.strokeColor=w;break;default:throw new y.FormatError(`Unsupported paint type: ${n}`)}}getPattern(e,n,a,i){let h=a;i!==_.SHADING&&(h=y.Util.transform(h,n.baseTransform),this.matrix&&(h=y.Util.transform(h,this.matrix)));const p=this.createPatternCanvas(n);let w=new DOMMatrix(h);w=w.translate(p.offsetX,p.offsetY),w=w.scale(1/p.scaleX,1/p.scaleY);const E=e.createPattern(p.canvas,"repeat");return E.setTransform(w),E}}function g({src:l,srcPos:e=0,dest:n,width:a,height:i,nonBlackColor:h=4294967295,inverseDecode:p=!1}){const w=y.FeatureTest.isLittleEndian?4278190080:255,[E,R]=p?[h,w]:[w,h],P=a>>3,L=a&7,x=l.length;n=new Uint32Array(n.buffer);let k=0;for(let D=0;D{l.save=l.__originalSave,l.restore=l.__originalRestore,l.rotate=l.__originalRotate,l.scale=l.__originalScale,l.translate=l.__originalTranslate,l.transform=l.__originalTransform,l.setTransform=l.__originalSetTransform,l.resetTransform=l.__originalResetTransform,l.clip=l.__originalClip,l.moveTo=l.__originalMoveTo,l.lineTo=l.__originalLineTo,l.bezierCurveTo=l.__originalBezierCurveTo,l.rect=l.__originalRect,l.closePath=l.__originalClosePath,l.beginPath=l.__originalBeginPath,delete l._removeMirroring},l.save=function(){e.save(),this.__originalSave()},l.restore=function(){e.restore(),this.__originalRestore()},l.translate=function(a,i){e.translate(a,i),this.__originalTranslate(a,i)},l.scale=function(a,i){e.scale(a,i),this.__originalScale(a,i)},l.transform=function(a,i,h,p,w,E){e.transform(a,i,h,p,w,E),this.__originalTransform(a,i,h,p,w,E)},l.setTransform=function(a,i,h,p,w,E){e.setTransform(a,i,h,p,w,E),this.__originalSetTransform(a,i,h,p,w,E)},l.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},l.rotate=function(a){e.rotate(a),this.__originalRotate(a)},l.clip=function(a){e.clip(a),this.__originalClip(a)},l.moveTo=function(n,a){e.moveTo(n,a),this.__originalMoveTo(n,a)},l.lineTo=function(n,a){e.lineTo(n,a),this.__originalLineTo(n,a)},l.bezierCurveTo=function(n,a,i,h,p,w){e.bezierCurveTo(n,a,i,h,p,w),this.__originalBezierCurveTo(n,a,i,h,p,w)},l.rect=function(n,a,i,h){e.rect(n,a,i,h),this.__originalRect(n,a,i,h)},l.closePath=function(){e.closePath(),this.__originalClosePath()},l.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class O{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,n,a){let i;return this.cache[e]!==void 0?(i=this.cache[e],this.canvasFactory.reset(i,n,a)):(i=this.canvasFactory.create(n,a),this.cache[e]=i),i}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const n=this.cache[e];this.canvasFactory.destroy(n),delete this.cache[e]}}}function N(l,e,n,a,i,h,p,w,E,R){const[P,L,x,k,D,j]=(0,z.getCurrentTransform)(l);if(L===0&&x===0){const tt=p*P+D,it=Math.round(tt),W=w*k+j,rt=Math.round(W),nt=(p+E)*P+D,ut=Math.abs(Math.round(nt)-it)||1,gt=(w+R)*k+j,mt=Math.abs(Math.round(gt)-rt)||1;return l.setTransform(Math.sign(P),0,0,Math.sign(k),it,rt),l.drawImage(e,n,a,i,h,0,0,ut,mt),l.setTransform(P,L,x,k,D,j),[ut,mt]}if(P===0&&k===0){const tt=w*x+D,it=Math.round(tt),W=p*L+j,rt=Math.round(W),nt=(w+R)*x+D,ut=Math.abs(Math.round(nt)-it)||1,gt=(p+E)*L+j,mt=Math.abs(Math.round(gt)-rt)||1;return l.setTransform(0,Math.sign(L),Math.sign(x),0,it,rt),l.drawImage(e,n,a,i,h,0,0,mt,ut),l.setTransform(P,L,x,k,D,j),[mt,ut]}l.drawImage(e,n,a,i,h,p,w,E,R);const J=Math.hypot(P,L),$=Math.hypot(x,k);return[J*E,$*R]}function B(l){const{width:e,height:n}=l;if(e>S||n>S)return null;const a=1e3,i=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),h=e+1;let p=new Uint8Array(h*(n+1)),w,E,R;const P=e+7&-8;let L=new Uint8Array(P*n),x=0;for(const $ of l.data){let tt=128;for(;tt>0;)L[x++]=$&tt?0:255,tt>>=1}let k=0;for(x=0,L[x]!==0&&(p[0]=1,++k),E=1;E>2)+(L[x+1]?4:0)+(L[x-P+1]?8:0),i[$]&&(p[R+E]=i[$],++k),x++;if(L[x-P]!==L[x]&&(p[R+E]=L[x]?2:4,++k),k>a)return null}for(x=P*(n-1),R=w*h,L[x]!==0&&(p[R]=8,++k),E=1;Ea)return null;const D=new Int32Array([0,h,-1,0,-h,0,0,0,1]),j=new Path2D;for(w=0;k&&w<=n;w++){let $=w*h;const tt=$+e;for(;$>4,p[$]&=W>>2|W<<2),j.lineTo($%h,$/h|0),p[$]||--k}while(it!==$);--w}return L=null,p=null,function($){$.save(),$.scale(1/e,-1/n),$.translate(0,-n),$.fill(j),$.beginPath(),$.restore()}}class q{constructor(e,n){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=y.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=y.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=y.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,e,n])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,n){this.x=e,this.y=n}updatePathMinMax(e,n,a){[n,a]=y.Util.applyTransform([n,a],e),this.minX=Math.min(this.minX,n),this.minY=Math.min(this.minY,a),this.maxX=Math.max(this.maxX,n),this.maxY=Math.max(this.maxY,a)}updateRectMinMax(e,n){const a=y.Util.applyTransform(n,e),i=y.Util.applyTransform(n.slice(2),e),h=y.Util.applyTransform([n[0],n[3]],e),p=y.Util.applyTransform([n[2],n[1]],e);this.minX=Math.min(this.minX,a[0],i[0],h[0],p[0]),this.minY=Math.min(this.minY,a[1],i[1],h[1],p[1]),this.maxX=Math.max(this.maxX,a[0],i[0],h[0],p[0]),this.maxY=Math.max(this.maxY,a[1],i[1],h[1],p[1])}updateScalingPathMinMax(e,n){y.Util.scaleMinMax(e,n),this.minX=Math.min(this.minX,n[0]),this.minY=Math.min(this.minY,n[1]),this.maxX=Math.max(this.maxX,n[2]),this.maxY=Math.max(this.maxY,n[3])}updateCurvePathMinMax(e,n,a,i,h,p,w,E,R,P){const L=y.Util.bezierBoundingBox(n,a,i,h,p,w,E,R,P);P||this.updateRectMinMax(e,L)}getPathBoundingBox(e=_.FILL,n=null){const a=[this.minX,this.minY,this.maxX,this.maxY];if(e===_.STROKE){n||(0,y.unreachable)("Stroke bounding box must include transform.");const i=y.Util.singularValueDecompose2dScale(n),h=i[0]*this.lineWidth/2,p=i[1]*this.lineWidth/2;a[0]-=h,a[1]-=p,a[2]+=h,a[3]+=p}return a}updateClipFromPath(){const e=y.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=_.FILL,n=null){return y.Util.intersect(this.clipBox,this.getPathBoundingBox(e,n))}}function st(l,e){if(typeof ImageData<"u"&&e instanceof ImageData){l.putImageData(e,0,0);return}const n=e.height,a=e.width,i=n%M,h=(n-i)/M,p=i===0?h:h+1,w=l.createImageData(a,M);let E=0,R;const P=e.data,L=w.data;let x,k,D,j;if(e.kind===y.ImageKind.GRAYSCALE_1BPP){const J=P.byteLength,$=new Uint32Array(L.buffer,0,L.byteLength>>2),tt=$.length,it=a+7>>3,W=4294967295,rt=y.FeatureTest.isLittleEndian?4278190080:255;for(x=0;xit?a:nt*8-7,mt=gt&-8;let At=0,bt=0;for(;ut>=1}for(;R=h&&(D=i,j=a*D),R=0,k=j;k--;)L[R++]=P[E++],L[R++]=P[E++],L[R++]=P[E++],L[R++]=255;l.putImageData(w,0,x*M)}else throw new Error(`bad image kind: ${e.kind}`)}function X(l,e){if(e.bitmap){l.drawImage(e.bitmap,0,0);return}const n=e.height,a=e.width,i=n%M,h=(n-i)/M,p=i===0?h:h+1,w=l.createImageData(a,M);let E=0;const R=e.data,P=w.data;for(let L=0;L>8,l[h-2]=l[h-2]*p+n*w>>8,l[h-1]=l[h-1]*p+a*w>>8}}}function Q(l,e,n){const a=l.length,i=1/255;for(let h=3;h>8]>>8:e[i]*h>>16}}function at(l,e,n,a,i,h,p,w,E,R,P){const L=!!h,x=L?h[0]:0,k=L?h[1]:0,D=L?h[2]:0,j=i==="Luminosity"?K:Q,$=Math.min(a,Math.ceil(1048576/n));for(let tt=0;ttv&&typeof a=="function",P=R?Date.now()+f:0;let L=0;const x=this.commonObjs,k=this.objs;let D;for(;;){if(i!==void 0&&w===i.nextBreakPoint)return i.breakIt(w,a),w;if(D=p[w],D!==y.OPS.dependency)this[D].apply(this,h[w]);else for(const j of h[w]){const J=j.startsWith("g_")?x:k;if(!J.has(j))return J.get(j,a),w}if(w++,w===E)return w;if(R&&++L>v){if(Date.now()>P)return a(),w;L=0}}}#t(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#t(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const n of e.values())typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&(n.width=n.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#e()}#e(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){const n=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=n}}}_scaleImage(e,n){const a=e.width,i=e.height;let h=Math.max(Math.hypot(n[0],n[1]),1),p=Math.max(Math.hypot(n[2],n[3]),1),w=a,E=i,R="prescale1",P,L;for(;h>2&&w>1||p>2&&E>1;){let x=w,k=E;h>2&&w>1&&(x=w>=16384?Math.floor(w/2)-1||1:Math.ceil(w/2),h/=w/x),p>2&&E>1&&(k=E>=16384?Math.floor(E/2)-1||1:Math.ceil(E)/2,p/=E/k),P=this.cachedCanvases.getCanvas(R,x,k),L=P.context,L.clearRect(0,0,x,k),L.drawImage(e,0,0,w,E,0,0,x,k),e=P.canvas,w=x,E=k,R=R==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:w,paintHeight:E}}_createMaskCanvas(e){const n=this.ctx,{width:a,height:i}=e,h=this.current.fillColor,p=this.current.patternFill,w=(0,z.getCurrentTransform)(n);let E,R,P,L;if((e.bitmap||e.data)&&e.count>1){const gt=e.bitmap||e.data.buffer;R=JSON.stringify(p?w:[w.slice(0,4),h]),E=this._cachedBitmapsMap.get(gt),E||(E=new Map,this._cachedBitmapsMap.set(gt,E));const mt=E.get(R);if(mt&&!p){const At=Math.round(Math.min(w[0],w[2])+w[4]),bt=Math.round(Math.min(w[1],w[3])+w[5]);return{canvas:mt,offsetX:At,offsetY:bt}}P=mt}P||(L=this.cachedCanvases.getCanvas("maskCanvas",a,i),X(L.context,e));let x=y.Util.transform(w,[1/a,0,0,-1/i,0,0]);x=y.Util.transform(x,[1,0,0,1,0,-i]);const[k,D,j,J]=y.Util.getAxialAlignedBoundingBox([0,0,a,i],x),$=Math.round(j-k)||1,tt=Math.round(J-D)||1,it=this.cachedCanvases.getCanvas("fillCanvas",$,tt),W=it.context,rt=k,nt=D;W.translate(-rt,-nt),W.transform(...x),P||(P=this._scaleImage(L.canvas,(0,z.getCurrentTransformInverse)(W)),P=P.img,E&&p&&E.set(R,P)),W.imageSmoothingEnabled=lt((0,z.getCurrentTransform)(W),e.interpolate),N(W,P,0,0,P.width,P.height,0,0,a,i),W.globalCompositeOperation="source-in";const ut=y.Util.transform((0,z.getCurrentTransformInverse)(W),[1,0,0,1,-rt,-nt]);return W.fillStyle=p?h.getPattern(n,this,ut,_.FILL):h,W.fillRect(0,0,a,i),E&&!p&&(this.cachedCanvases.delete("fillCanvas"),E.set(R,it.canvas)),{canvas:it.canvas,offsetX:Math.round(rt),offsetY:Math.round(nt)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=ht[e]}setLineJoin(e){this.ctx.lineJoin=ft[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,n){const a=this.ctx;a.setLineDash!==void 0&&(a.setLineDash(e),a.lineDashOffset=n)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[n,a]of e)switch(n){case"LW":this.setLineWidth(a);break;case"LC":this.setLineCap(a);break;case"LJ":this.setLineJoin(a);break;case"ML":this.setMiterLimit(a);break;case"D":this.setDash(a[0],a[1]);break;case"RI":this.setRenderingIntent(a);break;case"FL":this.setFlatness(a);break;case"Font":this.setFont(a[0],a[1]);break;case"CA":this.current.strokeAlpha=a;break;case"ca":this.current.fillAlpha=a,this.ctx.globalAlpha=a;break;case"BM":this.ctx.globalCompositeOperation=a;break;case"SMask":this.current.activeSMask=a?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(a);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,n=this.ctx.canvas.height,a="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(a,e,n);this.suspendedCtx=this.ctx,this.ctx=i.context;const h=this.ctx;h.setTransform(...(0,z.getCurrentTransform)(this.suspendedCtx)),H(this.suspendedCtx,h),I(h,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),H(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const n=this.current.activeSMask,a=this.suspendedCtx;ot(a,n,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(H(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),H(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,n,a,i,h,p){this.ctx.transform(e,n,a,i,h,p),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,n,a){const i=this.ctx,h=this.current;let p=h.x,w=h.y,E,R;const P=(0,z.getCurrentTransform)(i),L=P[0]===0&&P[3]===0||P[1]===0&&P[2]===0,x=L?a.slice(0):null;for(let k=0,D=0,j=e.length;kr&&(R=r),this.current.fontSizeScale=n/R,this.ctx.font=`${E} ${w} ${R}px ${p}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,n){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=n}setLeadingMoveText(e,n){this.setLeading(-n),this.moveText(e,n)}setTextMatrix(e,n,a,i,h,p){this.current.textMatrix=[e,n,a,i,h,p],this.current.textMatrixScale=Math.hypot(e,n),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,n,a,i){const h=this.ctx,p=this.current,w=p.font,E=p.textRenderingMode,R=p.fontSize/p.fontSizeScale,P=E&y.TextRenderingMode.FILL_STROKE_MASK,L=!!(E&y.TextRenderingMode.ADD_TO_PATH_FLAG),x=p.patternFill&&!w.missingFile;let k;(w.disableFontFace||L||x)&&(k=w.getPathGenerator(this.commonObjs,e)),w.disableFontFace||x?(h.save(),h.translate(n,a),h.beginPath(),k(h,R),i&&h.setTransform(...i),(P===y.TextRenderingMode.FILL||P===y.TextRenderingMode.FILL_STROKE)&&h.fill(),(P===y.TextRenderingMode.STROKE||P===y.TextRenderingMode.FILL_STROKE)&&h.stroke(),h.restore()):((P===y.TextRenderingMode.FILL||P===y.TextRenderingMode.FILL_STROKE)&&h.fillText(e,n,a),(P===y.TextRenderingMode.STROKE||P===y.TextRenderingMode.FILL_STROKE)&&h.strokeText(e,n,a)),L&&(this.pendingTextPaths||=[]).push({transform:(0,z.getCurrentTransform)(h),x:n,y:a,fontSize:R,addToPath:k})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const n=e.getImageData(0,0,10,10).data;let a=!1;for(let i=3;i0&&n[i]<255){a=!0;break}return(0,y.shadow)(this,"isFontSubpixelAAEnabled",a)}showText(e){const n=this.current,a=n.font;if(a.isType3Font)return this.showType3Text(e);const i=n.fontSize;if(i===0)return;const h=this.ctx,p=n.fontSizeScale,w=n.charSpacing,E=n.wordSpacing,R=n.fontDirection,P=n.textHScale*R,L=e.length,x=a.vertical,k=x?1:-1,D=a.defaultVMetrics,j=i*n.fontMatrix[0],J=n.textRenderingMode===y.TextRenderingMode.FILL&&!a.disableFontFace&&!n.patternFill;h.save(),h.transform(...n.textMatrix),h.translate(n.x,n.y+n.textRise),R>0?h.scale(P,-1):h.scale(P,1);let $;if(n.patternFill){h.save();const nt=n.fillColor.getPattern(h,this,(0,z.getCurrentTransformInverse)(h),_.FILL);$=(0,z.getCurrentTransform)(h),h.restore(),h.fillStyle=nt}let tt=n.lineWidth;const it=n.textMatrixScale;if(it===0||tt===0){const nt=n.textRenderingMode&y.TextRenderingMode.FILL_STROKE_MASK;(nt===y.TextRenderingMode.STROKE||nt===y.TextRenderingMode.FILL_STROKE)&&(tt=this.getSinglePixelWidth())}else tt/=it;if(p!==1&&(h.scale(p,p),tt/=p),h.lineWidth=tt,a.isInvalidPDFjsFont){const nt=[];let ut=0;for(const gt of e)nt.push(gt.unicode),ut+=gt.width;h.fillText(nt.join(""),0,0),n.x+=ut*j*P,h.restore(),this.compose();return}let W=0,rt;for(rt=0;rt0){const yt=h.measureText(mt).width*1e3/i*p;if(Stnew m(p,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};n=new s(e,a,this.ctx,h,i)}else n=this._getPattern(e[1],e[2]);return n}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,n,a){const i=y.Util.makeHexColor(e,n,a);this.ctx.strokeStyle=i,this.current.strokeColor=i}setFillRGBColor(e,n,a){const i=y.Util.makeHexColor(e,n,a);this.ctx.fillStyle=i,this.current.fillColor=i,this.current.patternFill=!1}_getPattern(e,n=null){let a;return this.cachedPatterns.has(e)?a=this.cachedPatterns.get(e):(a=u(this.getObject(e)),this.cachedPatterns.set(e,a)),n&&(a.matrix=n),a}shadingFill(e){if(!this.contentVisible)return;const n=this.ctx;this.save();const a=this._getPattern(e);n.fillStyle=a.getPattern(n,this,(0,z.getCurrentTransformInverse)(n),_.SHADING);const i=(0,z.getCurrentTransformInverse)(n);if(i){const{width:h,height:p}=n.canvas,[w,E,R,P]=y.Util.getAxialAlignedBoundingBox([0,0,h,p],i);this.ctx.fillRect(w,E,R-w,P-E)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,y.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,y.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(e,n){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(e)&&e.length===6&&this.transform(...e),this.baseTransform=(0,z.getCurrentTransform)(this.ctx),n)){const a=n[2]-n[0],i=n[3]-n[1];this.ctx.rect(n[0],n[1],a,i),this.current.updateRectMinMax((0,z.getCurrentTransform)(this.ctx),n),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const n=this.ctx;e.isolated||(0,y.info)("TODO: Support non-isolated groups."),e.knockout&&(0,y.warn)("Knockout groups not supported.");const a=(0,z.getCurrentTransform)(n);if(e.matrix&&n.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let i=y.Util.getAxialAlignedBoundingBox(e.bbox,(0,z.getCurrentTransform)(n));const h=[0,0,n.canvas.width,n.canvas.height];i=y.Util.intersect(i,h)||[0,0,0,0];const p=Math.floor(i[0]),w=Math.floor(i[1]);let E=Math.max(Math.ceil(i[2])-p,1),R=Math.max(Math.ceil(i[3])-w,1),P=1,L=1;E>c&&(P=E/c,E=c),R>c&&(L=R/c,R=c),this.current.startNewPathAndClipBox([0,0,E,R]);let x="groupAt"+this.groupLevel;e.smask&&(x+="_smask_"+this.smaskCounter++%2);const k=this.cachedCanvases.getCanvas(x,E,R),D=k.context;D.scale(1/P,1/L),D.translate(-p,-w),D.transform(...a),e.smask?this.smaskStack.push({canvas:k.canvas,context:D,offsetX:p,offsetY:w,scaleX:P,scaleY:L,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(n.setTransform(1,0,0,1,0,0),n.translate(p,w),n.scale(P,L),n.save()),H(n,D),this.ctx=D,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const n=this.ctx,a=this.groupStack.pop();if(this.ctx=a,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const i=(0,z.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...i);const h=y.Util.getAxialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],i);this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.compose(h)}}beginAnnotation(e,n,a,i,h){if(this.#t(),G(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(n)&&n.length===4){const p=n[2]-n[0],w=n[3]-n[1];if(h&&this.annotationCanvasMap){a=a.slice(),a[4]-=n[0],a[5]-=n[1],n=n.slice(),n[0]=n[1]=0,n[2]=p,n[3]=w;const[E,R]=y.Util.singularValueDecompose2dScale((0,z.getCurrentTransform)(this.ctx)),{viewportScale:P}=this,L=Math.ceil(p*this.outputScaleX*P),x=Math.ceil(w*this.outputScaleY*P);this.annotationCanvas=this.canvasFactory.create(L,x);const{canvas:k,context:D}=this.annotationCanvas;this.annotationCanvasMap.set(e,k),this.annotationCanvas.savedCtx=this.ctx,this.ctx=D,this.ctx.save(),this.ctx.setTransform(E,0,0,-R,0,w*R),G(this.ctx)}else G(this.ctx),this.ctx.rect(n[0],n[1],p,w),this.ctx.clip(),this.endPath()}this.current=new q(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...a),this.transform(...i)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#e(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const n=e.count;e=this.getObject(e.data,e),e.count=n;const a=this.ctx,i=this.processingType3;if(i&&(i.compiled===void 0&&(i.compiled=B(e)),i.compiled)){i.compiled(a);return}const h=this._createMaskCanvas(e),p=h.canvas;a.save(),a.setTransform(1,0,0,1,0,0),a.drawImage(p,h.offsetX,h.offsetY),a.restore(),this.compose()}paintImageMaskXObjectRepeat(e,n,a=0,i=0,h,p){if(!this.contentVisible)return;e=this.getObject(e.data,e);const w=this.ctx;w.save();const E=(0,z.getCurrentTransform)(w);w.transform(n,a,i,h,0,0);const R=this._createMaskCanvas(e);w.setTransform(1,0,0,1,R.offsetX-E[4],R.offsetY-E[5]);for(let P=0,L=p.length;PL?P/L:1,w=R>L?R/L:1}}this._cachedScaleForStroking[0]=p,this._cachedScaleForStroking[1]=w}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:n}=this,{lineWidth:a}=this.current,[i,h]=this.getScaleForStroking();if(n.lineWidth=a||1,i===1&&h===1){n.stroke();return}const p=n.getLineDash();if(e&&n.save(),n.scale(i,h),p.length>0){const w=Math.max(i,h);n.setLineDash(p.map(E=>E/w)),n.lineDashOffset/=w}n.stroke(),e&&n.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}for(const l in y.OPS)m.prototype[l]!==void 0&&(m.prototype[y.OPS[l]]=m.prototype[l])},419:(dt,et,V)=>{V.d(et,{DOMCMapReaderFactory:()=>A,DOMCanvasFactory:()=>C,DOMFilterFactory:()=>F,DOMSVGFactory:()=>d,DOMStandardFontDataFactory:()=>o,PDFDateString:()=>M,PageViewport:()=>u,PixelsPerInch:()=>U,RenderingCancelledException:()=>b,StatTimer:()=>c,fetchData:()=>T,getColorValues:()=>N,getCurrentTransform:()=>B,getCurrentTransformInverse:()=>q,getFilenameFromUrl:()=>t,getPdfFilenameFromUrl:()=>r,getRGB:()=>O,getXfaPageViewport:()=>I,isDataScheme:()=>s,isPdfFile:()=>g,isValidFetchUrl:()=>f,noContextMenu:()=>v,setLayerDimensions:()=>st});var y=V(583),z=V(292);const _="http://www.w3.org/2000/svg";class U{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}class F extends y.BaseFilterFactory{#t;#e;#s;#n;#r;#i=0;constructor({docId:H,ownerDocument:G=globalThis.document}={}){super(),this.#s=H,this.#n=G}get#a(){return this.#t||=new Map}get#l(){return this.#r||=new Map}get#h(){if(!this.#e){const H=this.#n.createElement("div"),{style:G}=H;G.visibility="hidden",G.contain="strict",G.width=G.height=0,G.position="absolute",G.top=G.left=0,G.zIndex=-1;const Y=this.#n.createElementNS(_,"svg");Y.setAttribute("width",0),Y.setAttribute("height",0),this.#e=this.#n.createElementNS(_,"defs"),H.append(Y),Y.append(this.#e),this.#n.body.append(H)}return this.#e}addFilter(H){if(!H)return"none";let G=this.#a.get(H);if(G)return G;let Y,Q,K,at;if(H.length===1){const ft=H[0],ct=new Array(256);for(let Z=0;Z<256;Z++)ct[Z]=ft[Z]/255;at=Y=Q=K=ct.join(",")}else{const[ft,ct,Z]=H,m=new Array(256),l=new Array(256),e=new Array(256);for(let n=0;n<256;n++)m[n]=ft[n]/255,l[n]=ct[n]/255,e[n]=Z[n]/255;Y=m.join(","),Q=l.join(","),K=e.join(","),at=`${Y}${Q}${K}`}if(G=this.#a.get(at),G)return this.#a.set(H,G),G;const ot=`g_${this.#s}_transfer_map_${this.#i++}`,lt=`url(#${ot})`;this.#a.set(H,lt),this.#a.set(at,lt);const ht=this.#u(ot);return this.#o(Y,Q,K,ht),lt}addHCMFilter(H,G){const Y=`${H}-${G}`,Q="base";let K=this.#l.get(Q);if(K?.key===Y||(K?(K.filter?.remove(),K.key=Y,K.url="none",K.filter=null):(K={key:Y,url:"none",filter:null},this.#l.set(Q,K)),!H||!G))return K.url;const at=this.#p(H);H=z.Util.makeHexColor(...at);const ot=this.#p(G);if(G=z.Util.makeHexColor(...ot),this.#h.style.color="",H==="#000000"&&G==="#ffffff"||H===G)return K.url;const lt=new Array(256);for(let m=0;m<=255;m++){const l=m/255;lt[m]=l<=.03928?l/12.92:((l+.055)/1.055)**2.4}const ht=lt.join(","),ft=`g_${this.#s}_hcm_filter`,ct=K.filter=this.#u(ft);this.#o(ht,ht,ht,ct),this.#d(ct);const Z=(m,l)=>{const e=at[m]/255,n=ot[m]/255,a=new Array(l+1);for(let i=0;i<=l;i++)a[i]=e+i/l*(n-e);return a.join(",")};return this.#o(Z(0,5),Z(1,5),Z(2,5),ct),K.url=`url(#${ft})`,K.url}addHighlightHCMFilter(H,G,Y,Q,K){const at=`${G}-${Y}-${Q}-${K}`;let ot=this.#l.get(H);if(ot?.key===at||(ot?(ot.filter?.remove(),ot.key=at,ot.url="none",ot.filter=null):(ot={key:at,url:"none",filter:null},this.#l.set(H,ot)),!G||!Y))return ot.url;const[lt,ht]=[G,Y].map(this.#p.bind(this));let ft=Math.round(.2126*lt[0]+.7152*lt[1]+.0722*lt[2]),ct=Math.round(.2126*ht[0]+.7152*ht[1]+.0722*ht[2]),[Z,m]=[Q,K].map(this.#p.bind(this));ct{const p=new Array(256),w=(ct-ft)/h,E=a/255,R=(i-a)/(255*h);let P=0;for(let L=0;L<=h;L++){const x=Math.round(ft+L*w),k=E+L*R;for(let D=P;D<=x;D++)p[D]=k;P=x+1}for(let L=P;L<256;L++)p[L]=p[P-1];return p.join(",")},e=`g_${this.#s}_hcm_${H}_filter`,n=ot.filter=this.#u(e);return this.#d(n),this.#o(l(Z[0],m[0],5),l(Z[1],m[1],5),l(Z[2],m[2],5),n),ot.url=`url(#${e})`,ot.url}destroy(H=!1){H&&this.#l.size!==0||(this.#e&&(this.#e.parentNode.parentNode.remove(),this.#e=null),this.#t&&(this.#t.clear(),this.#t=null),this.#i=0)}#d(H){const G=this.#n.createElementNS(_,"feColorMatrix");G.setAttribute("type","matrix"),G.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),H.append(G)}#u(H){const G=this.#n.createElementNS(_,"filter");return G.setAttribute("color-interpolation-filters","sRGB"),G.setAttribute("id",H),this.#h.append(G),G}#c(H,G,Y){const Q=this.#n.createElementNS(_,G);Q.setAttribute("type","discrete"),Q.setAttribute("tableValues",Y),H.append(Q)}#o(H,G,Y,Q){const K=this.#n.createElementNS(_,"feComponentTransfer");Q.append(K),this.#c(K,"feFuncR",H),this.#c(K,"feFuncG",G),this.#c(K,"feFuncB",Y)}#p(H){return this.#h.style.color=H,O(getComputedStyle(this.#h).getPropertyValue("color"))}}class C extends y.BaseCanvasFactory{constructor({ownerDocument:H=globalThis.document}={}){super(),this._document=H}_createCanvas(H,G){const Y=this._document.createElement("canvas");return Y.width=H,Y.height=G,Y}}async function T(X,H="text"){if(f(X,document.baseURI)){const G=await fetch(X);if(!G.ok)throw new Error(G.statusText);switch(H){case"arraybuffer":return G.arrayBuffer();case"blob":return G.blob();case"json":return G.json()}return G.text()}return new Promise((G,Y)=>{const Q=new XMLHttpRequest;Q.open("GET",X,!0),Q.responseType=H,Q.onreadystatechange=()=>{if(Q.readyState===XMLHttpRequest.DONE){if(Q.status===200||Q.status===0){switch(H){case"arraybuffer":case"blob":case"json":G(Q.response);return}G(Q.responseText);return}Y(new Error(Q.statusText))}},Q.send(null)})}class A extends y.BaseCMapReaderFactory{_fetchData(H,G){return T(H,this.isCompressed?"arraybuffer":"text").then(Y=>({cMapData:Y instanceof ArrayBuffer?new Uint8Array(Y):(0,z.stringToBytes)(Y),compressionType:G}))}}class o extends y.BaseStandardFontDataFactory{_fetchData(H){return T(H,"arraybuffer").then(G=>new Uint8Array(G))}}class d extends y.BaseSVGFactory{_createSVG(H){return document.createElementNS(_,H)}}class u{constructor({viewBox:H,scale:G,rotation:Y,offsetX:Q=0,offsetY:K=0,dontFlip:at=!1}){this.viewBox=H,this.scale=G,this.rotation=Y,this.offsetX=Q,this.offsetY=K;const ot=(H[2]+H[0])/2,lt=(H[3]+H[1])/2;let ht,ft,ct,Z;switch(Y%=360,Y<0&&(Y+=360),Y){case 180:ht=-1,ft=0,ct=0,Z=1;break;case 90:ht=0,ft=1,ct=1,Z=0;break;case 270:ht=0,ft=-1,ct=-1,Z=0;break;case 0:ht=1,ft=0,ct=0,Z=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}at&&(ct=-ct,Z=-Z);let m,l,e,n;ht===0?(m=Math.abs(lt-H[1])*G+Q,l=Math.abs(ot-H[0])*G+K,e=(H[3]-H[1])*G,n=(H[2]-H[0])*G):(m=Math.abs(ot-H[0])*G+Q,l=Math.abs(lt-H[1])*G+K,e=(H[2]-H[0])*G,n=(H[3]-H[1])*G),this.transform=[ht*G,ft*G,ct*G,Z*G,m-ht*G*ot-ct*G*lt,l-ft*G*ot-Z*G*lt],this.width=e,this.height=n}get rawDims(){const{viewBox:H}=this;return(0,z.shadow)(this,"rawDims",{pageWidth:H[2]-H[0],pageHeight:H[3]-H[1],pageX:H[0],pageY:H[1]})}clone({scale:H=this.scale,rotation:G=this.rotation,offsetX:Y=this.offsetX,offsetY:Q=this.offsetY,dontFlip:K=!1}={}){return new u({viewBox:this.viewBox.slice(),scale:H,rotation:G,offsetX:Y,offsetY:Q,dontFlip:K})}convertToViewportPoint(H,G){return z.Util.applyTransform([H,G],this.transform)}convertToViewportRectangle(H){const G=z.Util.applyTransform([H[0],H[1]],this.transform),Y=z.Util.applyTransform([H[2],H[3]],this.transform);return[G[0],G[1],Y[0],Y[1]]}convertToPdfPoint(H,G){return z.Util.applyInverseTransform([H,G],this.transform)}}class b extends z.BaseException{constructor(H,G=0){super(H,"RenderingCancelledException"),this.extraDelay=G}}function s(X){const H=X.length;let G=0;for(;G=1&&Q<=12?Q-1:0;let K=parseInt(G[3],10);K=K>=1&&K<=31?K:1;let at=parseInt(G[4],10);at=at>=0&&at<=23?at:0;let ot=parseInt(G[5],10);ot=ot>=0&&ot<=59?ot:0;let lt=parseInt(G[6],10);lt=lt>=0&<<=59?lt:0;const ht=G[7]||"Z";let ft=parseInt(G[8],10);ft=ft>=0&&ft<=23?ft:0;let ct=parseInt(G[9],10)||0;return ct=ct>=0&&ct<=59?ct:0,ht==="-"?(at+=ft,ot+=ct):ht==="+"&&(at-=ft,ot-=ct),new Date(Date.UTC(Y,Q,K,at,ot,lt))}}function I(X,{scale:H=1,rotation:G=0}){const{width:Y,height:Q}=X.attributes.style,K=[0,0,parseInt(Y),parseInt(Q)];return new u({viewBox:K,scale:H,rotation:G})}function O(X){if(X.startsWith("#")){const H=parseInt(X.slice(1),16);return[(H&16711680)>>16,(H&65280)>>8,H&255]}return X.startsWith("rgb(")?X.slice(4,-1).split(",").map(H=>parseInt(H)):X.startsWith("rgba(")?X.slice(5,-1).split(",").map(H=>parseInt(H)).slice(0,3):((0,z.warn)(`Not a valid color format: "${X}"`),[0,0,0])}function N(X){const H=document.createElement("span");H.style.visibility="hidden",document.body.append(H);for(const G of X.keys()){H.style.color=G;const Y=window.getComputedStyle(H).color;X.set(G,O(Y))}H.remove()}function B(X){const{a:H,b:G,c:Y,d:Q,e:K,f:at}=X.getTransform();return[H,G,Y,Q,K,at]}function q(X){const{a:H,b:G,c:Y,d:Q,e:K,f:at}=X.getTransform().invertSelf();return[H,G,Y,Q,K,at]}function st(X,H,G=!1,Y=!0){if(H instanceof u){const{pageWidth:Q,pageHeight:K}=H.rawDims,{style:at}=X,ot=z.FeatureTest.isCSSRoundSupported,lt=`var(--scale-factor) * ${Q}px`,ht=`var(--scale-factor) * ${K}px`,ft=ot?`round(${lt}, 1px)`:`calc(${lt})`,ct=ot?`round(${ht}, 1px)`:`calc(${ht})`;!G||H.rotation%180===0?(at.width=ft,at.height=ct):(at.width=ct,at.height=ft)}Y&&X.setAttribute("data-main-rotation",H.rotation)}},47:(dt,et,V)=>{V.d(et,{DrawLayer:()=>_});var y=V(419),z=V(292);class _{#t=null;#e=0;#s=new Map;#n=new Map;constructor({pageIndex:F}){this.pageIndex=F}setParent(F){if(!this.#t){this.#t=F;return}if(this.#t!==F){if(this.#s.size>0)for(const C of this.#s.values())C.remove(),F.append(C);this.#t=F}}static get _svgFactory(){return(0,z.shadow)(this,"_svgFactory",new y.DOMSVGFactory)}static#r(F,{x:C=0,y:T=0,width:A=1,height:o=1}={}){const{style:d}=F;d.top=`${100*T}%`,d.left=`${100*C}%`,d.width=`${100*A}%`,d.height=`${100*o}%`}#i(F){const C=_._svgFactory.create(1,1,!0);return this.#t.append(C),C.setAttribute("aria-hidden",!0),_.#r(C,F),C}#a(F,C){const T=_._svgFactory.createElement("clipPath");F.append(T);const A=`clip_${C}`;T.setAttribute("id",A),T.setAttribute("clipPathUnits","objectBoundingBox");const o=_._svgFactory.createElement("use");return T.append(o),o.setAttribute("href",`#${C}`),o.classList.add("clip"),A}highlight(F,C,T,A=!1){const o=this.#e++,d=this.#i(F.box);d.classList.add("highlight"),F.free&&d.classList.add("free");const u=_._svgFactory.createElement("defs");d.append(u);const b=_._svgFactory.createElement("path");u.append(b);const s=`path_p${this.pageIndex}_${o}`;b.setAttribute("id",s),b.setAttribute("d",F.toSVGPath()),A&&this.#n.set(o,b);const g=this.#a(u,s),t=_._svgFactory.createElement("use");return d.append(t),d.setAttribute("fill",C),d.setAttribute("fill-opacity",T),t.setAttribute("href",`#${s}`),this.#s.set(o,d),{id:o,clipPathId:`url(#${g})`}}highlightOutline(F){const C=this.#e++,T=this.#i(F.box);T.classList.add("highlightOutline");const A=_._svgFactory.createElement("defs");T.append(A);const o=_._svgFactory.createElement("path");A.append(o);const d=`path_p${this.pageIndex}_${C}`;o.setAttribute("id",d),o.setAttribute("d",F.toSVGPath()),o.setAttribute("vector-effect","non-scaling-stroke");let u;if(F.free){T.classList.add("free");const g=_._svgFactory.createElement("mask");A.append(g),u=`mask_p${this.pageIndex}_${C}`,g.setAttribute("id",u),g.setAttribute("maskUnits","objectBoundingBox");const t=_._svgFactory.createElement("rect");g.append(t),t.setAttribute("width","1"),t.setAttribute("height","1"),t.setAttribute("fill","white");const r=_._svgFactory.createElement("use");g.append(r),r.setAttribute("href",`#${d}`),r.setAttribute("stroke","none"),r.setAttribute("fill","black"),r.setAttribute("fill-rule","nonzero"),r.classList.add("mask")}const b=_._svgFactory.createElement("use");T.append(b),b.setAttribute("href",`#${d}`),u&&b.setAttribute("mask",`url(#${u})`);const s=b.cloneNode();return T.append(s),b.classList.add("mainOutline"),s.classList.add("secondaryOutline"),this.#s.set(C,T),C}finalizeLine(F,C){const T=this.#n.get(F);this.#n.delete(F),this.updateBox(F,C.box),T.setAttribute("d",C.toSVGPath())}updateLine(F,C){this.#s.get(F).firstChild.firstChild.setAttribute("d",C.toSVGPath())}removeFreeHighlight(F){this.remove(F),this.#n.delete(F)}updatePath(F,C){this.#n.get(F).setAttribute("d",C.toSVGPath())}updateBox(F,C){_.#r(this.#s.get(F),C)}show(F,C){this.#s.get(F).classList.toggle("hidden",!C)}rotate(F,C){this.#s.get(F).setAttribute("data-main-rotation",C)}changeColor(F,C){this.#s.get(F).setAttribute("fill",C)}changeOpacity(F,C){this.#s.get(F).setAttribute("fill-opacity",C)}addClass(F,C){this.#s.get(F).classList.add(C)}removeClass(F,C){this.#s.get(F).classList.remove(C)}remove(F){this.#t!==null&&(this.#s.get(F).remove(),this.#s.delete(F))}destroy(){this.#t=null;for(const F of this.#s.values())F.remove();this.#s.clear()}}},731:(dt,et,V)=>{V.d(et,{AnnotationEditorLayer:()=>s});var y=V(292),z=V(310),_=V(830),U=V(976);const F=/\r\n?|\n/g;class C extends z.AnnotationEditor{#t=this.editorDivBlur.bind(this);#e=this.editorDivFocus.bind(this);#s=this.editorDivInput.bind(this);#n=this.editorDivKeydown.bind(this);#r=this.editorDivPaste.bind(this);#i;#a="";#l=`${this.id}-editor`;#h;#d=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=C.prototype,r=v=>v.isEmpty(),c=_.AnnotationEditorUIManager.TRANSLATE_SMALL,f=_.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,y.shadow)(this,"_keyboardManager",new _.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-c,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-f,0],checker:r}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[c,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[f,0],checker:r}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-c],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-f],checker:r}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,c],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,f],checker:r}]]))}static _type="freetext";static _editorType=y.AnnotationEditorType.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"}),this.#i=t.color||C._defaultColor||z.AnnotationEditor._defaultLineColor,this.#h=t.fontSize||C._defaultFontSize}static initialize(t,r){z.AnnotationEditor.initialize(t,r,{strings:["pdfjs-free-text-default-content"]});const c=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(c.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,r){switch(t){case y.AnnotationEditorParamsType.FREETEXT_SIZE:C._defaultFontSize=r;break;case y.AnnotationEditorParamsType.FREETEXT_COLOR:C._defaultColor=r;break}}updateParams(t,r){switch(t){case y.AnnotationEditorParamsType.FREETEXT_SIZE:this.#u(r);break;case y.AnnotationEditorParamsType.FREETEXT_COLOR:this.#c(r);break}}static get defaultPropertiesToUpdate(){return[[y.AnnotationEditorParamsType.FREETEXT_SIZE,C._defaultFontSize],[y.AnnotationEditorParamsType.FREETEXT_COLOR,C._defaultColor||z.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[y.AnnotationEditorParamsType.FREETEXT_SIZE,this.#h],[y.AnnotationEditorParamsType.FREETEXT_COLOR,this.#i]]}#u(t){const r=f=>{this.editorDiv.style.fontSize=`calc(${f}px * var(--scale-factor))`,this.translate(0,-(f-this.#h)*this.parentScale),this.#h=f,this.#p()},c=this.#h;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,c),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:y.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#c(t){const r=f=>{this.#i=this.editorDiv.style.color=f},c=this.#i;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,c),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:y.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,r){this._uiManager.translateSelectedEditors(t,r,!0)}getInitialTranslation(){const t=this.parentScale;return[-C._internalPadding*t,-(C._internalPadding+this.#h)*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(y.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#n),this.editorDiv.addEventListener("focus",this.#e),this.editorDiv.addEventListener("blur",this.#t),this.editorDiv.addEventListener("input",this.#s),this.editorDiv.addEventListener("paste",this.#r))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#l),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#n),this.editorDiv.removeEventListener("focus",this.#e),this.editorDiv.removeEventListener("blur",this.#t),this.editorDiv.removeEventListener("input",this.#s),this.editorDiv.removeEventListener("paste",this.#r),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#o(){const t=[];this.editorDiv.normalize();for(const r of this.editorDiv.childNodes)t.push(C.#g(r));return t.join(` `)}#p(){const[t,r]=this.parentDimensions;let c;if(this.isAttachedToDOM)c=this.div.getBoundingClientRect();else{const{currentLayer:f,div:v}=this,S=v.style.display;v.style.display="hidden",f.div.append(this.div),c=v.getBoundingClientRect(),v.remove(),v.style.display=S}this.rotation%180===this.parentRotation%180?(this.width=c.width/t,this.height=c.height/r):(this.width=c.height/t,this.height=c.width/r),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#a,r=this.#a=this.#o().trimEnd();if(t===r)return;const c=f=>{if(this.#a=f,!f){this.remove();return}this.#f(),this._uiManager.rebuild(this),this.#p()};this.addCommands({cmd:()=>{c(r)},undo:()=>{c(t)},mustExec:!1}),this.#p()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&t.key==="Enter"&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){C._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,r;this.width&&(t=this.x,r=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#l),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),z.AnnotationEditor._l10nPromise.get("pdfjs-free-text-default-content").then(f=>this.editorDiv?.setAttribute("default-content",f)),this.editorDiv.contentEditable=!0;const{style:c}=this.editorDiv;if(c.fontSize=`calc(${this.#h}px * var(--scale-factor))`,c.color=this.#i,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,_.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[f,v]=this.parentDimensions;if(this.annotationElementId){const{position:S}=this.#d;let[M,I]=this.getInitialTranslation();[M,I]=this.pageTranslationToScreen(M,I);const[O,N]=this.pageDimensions,[B,q]=this.pageTranslation;let st,X;switch(this.rotation){case 0:st=t+(S[0]-B)/O,X=r+this.height-(S[1]-q)/N;break;case 90:st=t+(S[0]-B)/O,X=r-(S[1]-q)/N,[M,I]=[I,-M];break;case 180:st=t-this.width+(S[0]-B)/O,X=r-(S[1]-q)/N,[M,I]=[-M,-I];break;case 270:st=t+(S[0]-B-this.height*N)/O,X=r+(S[1]-q-this.width*O)/N,[M,I]=[-I,M];break}this.setAt(st*f,X*v,M,I)}else this.setAt(t*f,r*v,this.width*f,this.height*v);this.#f(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#g(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(F,"")}editorDivPaste(t){const r=t.clipboardData||window.clipboardData,{types:c}=r;if(c.length===1&&c[0]==="text/plain")return;t.preventDefault();const f=C.#b(r.getData("text")||"").replaceAll(F,` diff --git a/dist/index.html b/dist/index.html index 3bfa50b..02b0007 100644 --- a/dist/index.html +++ b/dist/index.html @@ -4,8 +4,8 @@ - - + +
diff --git a/src/App.svelte b/src/App.svelte index 5934735..734f091 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -289,7 +289,7 @@ SmoothGPT {:else} -
+
{#if isImageUrl(message.content)} Generated