@ddict/popup 1.6.3 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/popup.css +1 -1
- package/dist/popup.es.js +466 -450
- package/dist/popup.umd.js +8 -8
- package/package.json +1 -1
package/dist/popup.umd.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
(function(Y,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(Y=typeof globalThis<"u"?globalThis:Y||self,t(Y.Popup={},Y.Vue))})(this,function(Y,t){"use strict";var Ie=typeof document<"u"?document.currentScript:null;const Me=navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i),Ce={isRTL:nn,setLocalStorage:on,getLocalStorage:ln};function nn(e){return["ar","fa","iw","yi","ur","pa"].indexOf(e)>-1}function on(e,o){localStorage.setItem(e,JSON.stringify(o))}function ln(e){return JSON.parse(localStorage.getItem(e))}const rn={class:"dropdown dropdown-end z-50"},an=t.createElementVNode("div",{tabindex:"0",role:"button",class:"btn btn-ghost btn-circle btn-sm"},[t.createElementVNode("svg",{class:"w-5 h-5 text-primary",fill:"currentColor",viewBox:"0 0 20 20"},[t.createElementVNode("path",{d:"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"})])],-1),sn={tabindex:"0",class:"dropdown-content menu p-2 shadow bg-base-100 rounded-box w-52 max-h-96 overflow-y-auto z-50"},cn=["id","value","checked","onChange"],dn=["for"],un={class:"flex items-center gap-2"},fn={__name:"ThemeSelector",props:{currentTheme:{type:String,default:"lofi"}},emits:["themeChange"],setup(e,{emit:o}){const n=o,l=[{value:"lofi",name:"Lo-Fi",color:"#0f0f23"},{value:"pastel",name:"Pastel",color:"#d1c1d7"},{value:"fantasy",name:"Fantasy",color:"#6e0b75"},{value:"autumn",name:"Autumn",color:"#8c0327"},{value:"retro",name:"Retro",color:"#ef9995"},{value:"synthwave",name:"Synthwave",color:"#e779c1"},{value:"halloween",name:"Halloween",color:"#f28c18"},{value:"dracula",name:"Dracula",color:"#ff79c6"},{value:"coffee",name:"Coffee",color:"#db924b"},{value:"dim",name:"Dim",color:"#9fe88d"},{value:"sunset",name:"Sunset",color:"#ff865b"},{value:"cyberpunk",name:"Cyberpunk",color:"#ff7598"}],r=a=>{n("themeChange",a)};return(a,i)=>(t.openBlock(),t.createElementBlock("div",rn,[an,t.createElementVNode("ul",sn,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(l,s=>t.createElementVNode("li",{key:s.value},[t.createElementVNode("input",{type:"radio",id:`theme-${s.value}`,value:s.value,checked:e.currentTheme===s.value,onChange:c=>r(s.value),class:"theme-controller sr-only"},null,40,cn),t.createElementVNode("label",{for:`theme-${s.value}`,class:t.normalizeClass(["cursor-pointer rounded-lg px-2 py-1 hover:bg-base-200",{"bg-primary text-primary-content":e.currentTheme===s.value}])},[t.createElementVNode("span",un,[t.createElementVNode("span",{class:"w-3 h-3 rounded-full",style:t.normalizeStyle({backgroundColor:s.color})},null,4),t.createTextVNode(" "+t.toDisplayString(s.name),1)])],10,dn)])),64))])]))}},pn={class:"flex justify-between"},mn=t.createStaticVNode('<div class="flex flex-row"><svg class="w-24 text-primary" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M40.151 8.94498H35.7256V23.055H40.151C44.7473 23.055 47.826 20.0825 47.826 15.9795C47.8267 11.8093 44.7678 8.94498 40.151 8.94498ZM40.1312 21.025H37.993V10.9974H40.1312C43.4217 10.9974 45.4972 12.9846 45.4972 15.9795C45.4965 18.9296 43.4012 21.025 40.1312 21.025Z" fill="currentColor"></path><path d="M54.5158 8.94498H50.0903V23.055H54.5158C59.1121 23.055 62.1908 20.0825 62.1908 15.9795C62.1914 11.8093 59.1351 8.94498 54.5158 8.94498ZM54.496 21.025H52.3578V10.9974H54.496C57.789 10.9974 59.8619 12.9846 59.8619 15.9795C59.8613 18.9296 57.766 21.025 54.496 21.025Z" fill="currentColor"></path><path d="M66.7237 8.94498H64.4575V23.055H66.7237V8.94498Z" fill="currentColor"></path><path d="M76.4301 10.7837C78.29 10.7837 79.7436 11.6603 80.7487 13.2207L82.4589 11.9591C81.2401 9.97057 78.9957 8.70953 76.409 8.70953C72.3898 8.64555 68.9048 11.9591 68.9906 16C68.9048 20.0403 72.3898 23.3544 76.409 23.2905C79.0385 23.2905 81.2618 22.0294 82.4589 20.0409L80.7487 18.7793C79.7436 20.3397 78.29 21.2163 76.4301 21.2163C73.544 21.2163 71.3418 18.993 71.3418 16C71.3418 13.007 73.5433 10.7837 76.4301 10.7837Z" fill="currentColor"></path><path d="M83.3135 8.94498V10.9757H88.0595V23.055H90.3256V10.9757H95.0934V8.94498H83.3135Z" fill="currentColor"></path><path d="M8.66351 4.7121H4.604V15.4427L6.87208 13.3839V6.79143H8.64559C11.4639 6.79143 13.2835 8.47857 13.2835 11.0877C13.2835 13.6916 11.421 15.4427 8.64559 15.4427H4.604V17.5016H8.66351C12.7531 17.5016 15.6098 14.8644 15.6098 11.0877C15.6104 7.27575 12.8196 4.7121 8.66351 4.7121Z" fill="currentColor"></path><path d="M26.2425 9.25528H21.5502L20.7537 14.293L21.4523 14.3308L21.4069 14.7294C21.3916 14.8656 21.3289 15.0448 21.112 15.1734C21.1017 15.9399 21.0845 17.0493 20.9706 18.1766H26.5937V19.8586H21.4677C22.4133 22.9424 24.1254 24.9648 26.5611 25.8669L27.1536 26.0864L26.6795 26.5048C26.4875 26.6737 26.2182 27.0141 26.0896 27.2489L25.9258 27.5438L25.6155 27.4152C23.167 26.4095 21.4223 24.4926 20.2905 21.563C19.3602 24.3365 17.5797 26.2553 14.8592 27.428L14.5438 27.5617L14.3775 27.2642C14.2764 27.08 14.0294 26.7876 13.8151 26.5989L13.3564 26.1951L13.9239 25.9655C16.4555 24.9392 18.064 23.1414 18.8228 20.4837C19.6647 19.8381 20.2099 18.8221 20.2169 17.6801V4.53231C20.2169 2.58349 18.6334 1 16.6846 1H3.53487C1.58349 1 0 2.58349 0 4.53231V17.6795C0 19.6283 1.58349 21.2143 3.53487 21.2143H8.25528V27.2431C8.25528 29.3135 9.93986 31 12.0096 31H26.2431C28.3161 31 29.9974 29.3129 29.9974 27.2431V13.0096C29.9974 10.9392 28.3154 9.25528 26.2425 9.25528ZM3.53487 19.4517C2.55662 19.4517 1.762 18.6603 1.762 17.6788V4.53231C1.762 3.55662 2.55598 2.762 3.53487 2.762H16.6839C17.6571 2.762 18.4517 3.55598 18.4517 4.53231V17.6795C18.4517 17.778 18.444 17.8733 18.4267 17.9667C18.3941 18.1811 18.3231 18.38 18.215 18.5592C17.9149 19.0934 17.3372 19.4517 16.6846 19.4517H3.53487Z" fill="currentColor"></path></svg></div>',1),hn={class:"flex"},gn=[t.createElementVNode("svg",{class:"w-6 h-6 text-primary",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.5 3.25C5.25736 3.25 4.25 4.25736 4.25 5.5H3.5H2.75C2.75 3.42893 4.42893 1.75 6.5 1.75H17.5C17.9142 1.75 18.25 2.08579 18.25 2.5V15.5C18.25 15.9142 17.9142 16.25 17.5 16.25H6.5C5.26293 16.25 4.25 17.2576 4.25 18.5C4.25 18.9142 3.91421 19.25 3.5 19.25C3.08579 19.25 2.75 18.9142 2.75 18.5V5.5C2.75 5.49993 2.75 5.5 3.5 5.5C4.25 5.5 4.25 5.49993 4.25 5.5V15.5017C4.87779 15.0296 5.65755 14.75 6.5 14.75H16.75V3.25H6.5Z",fill:"currentColor"}),t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20.5 2.75C20.9142 2.75 21.25 3.08579 21.25 3.5V21.5C21.25 21.9142 20.9142 22.25 20.5 22.25H6.5C4.42893 22.25 2.75 20.5711 2.75 18.5C2.75 16.4289 4.42893 14.75 6.5 14.75H17.4995C17.4996 14.75 17.5 14.75 17.5 15.5C17.5 16.25 17.5001 16.25 17.5 16.25H6.5C5.25736 16.25 4.25 17.2574 4.25 18.5C4.25 19.7426 5.25736 20.75 6.5 20.75H19.75V3.5C19.75 3.08579 20.0858 2.75 20.5 2.75ZM18.25 15.5C18.25 15.9142 17.9142 16.25 17.5 16.25V15.5L17.4995 14.75C17.9137 14.75 18.25 15.0858 18.25 15.5Z",fill:"currentColor"}),t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.25 18.5C6.25 18.0858 6.58579 17.75 7 17.75H17C17.4142 17.75 17.75 18.0858 17.75 18.5C17.75 18.9142 17.4142 19.25 17 19.25H7C6.58579 19.25 6.25 18.9142 6.25 18.5Z",fill:"currentColor"})],-1)],bn=t.createElementVNode("svg",{class:"w-6 h-6 text-primary",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M12 3L1 9L12 15L23 9L12 3Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M5 13L12 17L19 13",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M5 17L12 21L19 17",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),Cn={key:0,class:"absolute -top-0.5 -right-0.5 bg-red-500 text-white text-xs rounded-full h-4 min-w-[16px] flex items-center justify-center px-1 text-[8px]"},xn=[t.createElementVNode("svg",{class:"w-6 h-6 text-primary",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M5.3163 19.4384C5.92462 18.0052 7.34492 17 9 17H15C16.6551 17 18.0754 18.0052 18.6837 19.4384M16 9.5C16 11.7091 14.2091 13.5 12 13.5C9.79086 13.5 8 11.7091 8 9.5C8 7.29086 9.79086 5.5 12 5.5C14.2091 5.5 16 7.29086 16 9.5ZM22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)],vn=[t.createElementVNode("svg",{class:"w-6 h-6 text-primary",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M9.12596 1.63869C9.46935 1.54364 9.83221 1.70329 9.99413 2.02068C10.3672 2.75191 11.1261 3.25 12 3.25C12.8739 3.25 13.6328 2.75191 14.0059 2.02068C14.1678 1.70329 14.5307 1.54364 14.874 1.63869C16.5585 2.10497 18.0759 2.9704 19.3184 4.12574C19.5611 4.35137 19.6269 4.70948 19.4804 5.00666C19.3331 5.30535 19.25 5.6419 19.25 6C19.25 7.24263 20.2574 8.25 21.5 8.25L21.5314 8.24977C21.8629 8.24504 22.1583 8.45859 22.2576 8.77495C22.5777 9.79397 22.75 10.8776 22.75 12C22.75 12.7408 22.6749 13.4649 22.5318 14.1648C22.4548 14.5411 22.1059 14.7985 21.7237 14.7609C21.6504 14.7537 21.5758 14.75 21.5 14.75C20.2574 14.75 19.25 15.7574 19.25 17C19.25 17.5531 19.4486 18.0579 19.7793 18.4498C20.027 18.7434 20.0128 19.1767 19.7465 19.4535C18.4777 20.7719 16.8745 21.7678 15.0721 22.3044C14.6807 22.4209 14.2681 22.2029 14.1437 21.814C13.8535 20.906 13.0024 20.25 12 20.25C10.9976 20.25 10.1465 20.906 9.85629 21.814C9.73195 22.2029 9.31927 22.4209 8.92789 22.3044C7.12545 21.7678 5.52229 20.7719 4.25353 19.4535C3.98716 19.1767 3.97299 18.7434 4.22072 18.4498C4.55139 18.0579 4.75 17.5531 4.75 17C4.75 15.7574 3.74264 14.75 2.5 14.75C2.42423 14.75 2.34963 14.7537 2.27634 14.7609C1.89406 14.7985 1.54519 14.5411 1.46821 14.1648C1.32505 13.4649 1.25 12.7408 1.25 12C1.25 10.8776 1.42227 9.79398 1.74236 8.77494C1.84173 8.45859 2.13705 8.24504 2.4686 8.24977L2.5 8.25C3.74264 8.25 4.75 7.24263 4.75 6C4.75 5.6419 4.66689 5.30535 4.51962 5.00666C4.3731 4.70948 4.43894 4.35137 4.68159 4.12574C5.92411 2.9704 7.44153 2.10497 9.12596 1.63869ZM6.08277 4.88991C6.19152 5.24123 6.25 5.61424 6.25 6C6.25 7.88945 4.85261 9.45253 3.03493 9.71213C2.84898 10.4432 2.75 11.2096 2.75 12C2.75 12.4294 2.77921 12.8516 2.83567 13.2648C4.74948 13.4346 6.25 15.0421 6.25 17C6.25 17.6669 6.0754 18.2941 5.76971 18.8372C6.62645 19.6184 7.63002 20.2404 8.73362 20.657C9.37706 19.5189 10.598 18.75 12 18.75C13.402 18.75 14.6229 19.5189 15.2664 20.657C16.37 20.2404 17.3735 19.6184 18.2303 18.8372C17.9246 18.2941 17.75 17.6669 17.75 17C17.75 15.0421 19.2505 13.4346 21.1643 13.2648C21.2208 12.8516 21.25 12.4294 21.25 12C21.25 11.2096 21.151 10.4432 20.9651 9.71213C19.1474 9.45252 17.75 7.88945 17.75 6C17.75 5.61424 17.8085 5.24123 17.9172 4.88991C17.0618 4.1771 16.0762 3.61614 15.0018 3.24775C14.3184 4.15897 13.2287 4.75 12 4.75C10.7713 4.75 9.68158 4.15897 8.99819 3.24775C7.92382 3.61614 6.93823 4.1771 6.08277 4.88991Z",fill:"currentColor"}),t.createElementVNode("path",{d:"M7.75 12C7.75 9.65278 9.65279 7.75 12 7.75C14.3472 7.75 16.25 9.65278 16.25 12C16.25 14.3472 14.3472 16.25 12 16.25C9.65279 16.25 7.75 14.3472 7.75 12ZM12 9.25C10.4812 9.25 9.25 10.4812 9.25 12C9.25 13.5188 10.4812 14.75 12 14.75C13.5188 14.75 14.75 13.5188 14.75 12C14.75 10.4812 13.5188 9.25 12 9.25Z",fill:"currentColor"})],-1)],yn=[t.createStaticVNode('<svg class="w-6 h-6 text-primary" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.467 2.47236C2.75841 2.17799 3.23328 2.17559 3.52764 2.467L8.52765 7.41675C8.82201 7.70816 8.82441 8.18303 8.533 8.4774C8.24159 8.77176 7.76672 8.77416 7.47235 8.48275L2.47236 3.533C2.17799 3.24159 2.17559 2.76672 2.467 2.47236Z" fill="currentColor"></path><path d="M8.533 15.4724C8.82441 15.7667 8.82201 16.2416 8.52765 16.533L3.52765 21.4828C3.23328 21.7742 2.75841 21.7718 2.467 21.4774C2.17559 21.183 2.17799 20.7082 2.47236 20.4167L7.47235 15.467C7.76672 15.1756 8.24159 15.178 8.533 15.4724Z" fill="currentColor"></path><path d="M15.52 15.4697C15.8129 15.1768 16.2877 15.1768 16.5806 15.4697L21.5304 20.4194C21.8233 20.7123 21.8233 21.1872 21.5304 21.4801C21.2375 21.773 20.7626 21.773 20.4697 21.4801L15.52 16.5303C15.2271 16.2374 15.2271 15.7626 15.52 15.4697Z" fill="currentColor"></path><path d="M21.4801 2.46967C21.773 2.76256 21.773 3.23744 21.4801 3.53033L16.5303 8.48008C16.2374 8.77297 15.7626 8.77297 15.4697 8.48008C15.1768 8.18719 15.1768 7.71231 15.4697 7.41942L20.4194 2.46967C20.7123 2.17678 21.1872 2.17678 21.4801 2.46967Z" fill="currentColor"></path><path d="M15.75 3C15.75 2.58579 16.0858 2.25 16.5 2.25H21C21.4142 2.25 21.75 2.58579 21.75 3V7.5C21.75 7.91421 21.4142 8.25 21 8.25C20.5858 8.25 20.25 7.91421 20.25 7.5V3.75H16.5C16.0858 3.75 15.75 3.41421 15.75 3Z" fill="currentColor"></path><path d="M21 15.75C21.4142 15.75 21.75 16.0858 21.75 16.5V21C21.75 21.4142 21.4142 21.75 21 21.75H16.5C16.0858 21.75 15.75 21.4142 15.75 21C15.75 20.5858 16.0858 20.25 16.5 20.25H20.25V16.5C20.25 16.0858 20.5858 15.75 21 15.75Z" fill="currentColor"></path><path d="M3 15.75C3.41421 15.75 3.75 16.0858 3.75 16.5V20.25H7.5C7.91421 20.25 8.25 20.5858 8.25 21C8.25 21.4142 7.91421 21.75 7.5 21.75H3C2.58579 21.75 2.25 21.4142 2.25 21V16.5C2.25 16.0858 2.58579 15.75 3 15.75Z" fill="currentColor"></path><path d="M2.25 3C2.25 2.58579 2.58579 2.25 3 2.25H7.5C7.91421 2.25 8.25 2.58579 8.25 3C8.25 3.41421 7.91421 3.75 7.5 3.75H3.75V7.5C3.75 7.91421 3.41421 8.25 3 8.25C2.58579 8.25 2.25 7.91421 2.25 7.5V3Z" fill="currentColor"></path></svg>',1)],wn={__name:"Header",props:{headerSettings:{type:Object,required:!0,default:()=>({showAccount:!0,showReader:!0,showLearn:0,showFullscreen:!0,showSettings:!0,showThemeSelector:!0})},currentTheme:{type:String,default:"lofi"}},emits:["settings","fullScreen","reader","learn","account","themeChange"],setup(e,{emit:o}){const n=o,l=r=>{n("themeChange",r)};return(r,a)=>(t.openBlock(),t.createElementBlock("div",pn,[mn,t.createElementVNode("div",hn,[e.headerSettings.showThemeSelector?(t.openBlock(),t.createBlock(fn,{key:0,"current-theme":e.currentTheme,onThemeChange:l},null,8,["current-theme"])):t.createCommentVNode("",!0),e.headerSettings.showReader?(t.openBlock(),t.createElementBlock("button",{key:1,class:"btn btn-ghost btn-circle btn-sm",onClick:a[0]||(a[0]=i=>n("reader"))},gn)):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"btn btn-ghost btn-circle btn-sm relative",onClick:a[1]||(a[1]=i=>n("learn"))},[bn,e.headerSettings.showLearn>0?(t.openBlock(),t.createElementBlock("span",Cn,t.toDisplayString(e.headerSettings.showLearn>999?"999+":e.headerSettings.showLearn),1)):t.createCommentVNode("",!0)]),e.headerSettings.showAccount?(t.openBlock(),t.createElementBlock("button",{key:2,class:"btn btn-ghost btn-circle btn-sm",onClick:a[2]||(a[2]=i=>n("account"))},xn)):t.createCommentVNode("",!0),e.headerSettings.showSettings?(t.openBlock(),t.createElementBlock("button",{key:3,class:"btn btn-ghost btn-circle btn-sm",onClick:a[3]||(a[3]=i=>n("settings"))},vn)):t.createCommentVNode("",!0),e.headerSettings.showFullscreen?(t.openBlock(),t.createElementBlock("button",{key:4,class:"btn btn-ghost btn-circle btn-sm",onClick:a[4]||(a[4]=i=>n("fullScreen"))},yn)):t.createCommentVNode("",!0)])]))}};function ie(e,o,n){let l=n.initialDeps??[],r;return()=>{var a,i,s,c;let d;n.key&&((a=n.debug)!=null&&a.call(n))&&(d=Date.now());const u=e();if(!(u.length!==l.length||u.some((h,b)=>l[b]!==h)))return r;l=u;let C;if(n.key&&((i=n.debug)!=null&&i.call(n))&&(C=Date.now()),r=o(...u),n.key&&((s=n.debug)!=null&&s.call(n))){const h=Math.round((Date.now()-d)*100)/100,b=Math.round((Date.now()-C)*100)/100,g=b/16,S=(k,v)=>{for(k=String(k);k.length<v;)k=" "+k;return k};console.info(`%c⏱ ${S(b,5)} /${S(h,5)} ms`,`
|
|
1
|
+
(function(Y,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(Y=typeof globalThis<"u"?globalThis:Y||self,t(Y.Popup={},Y.Vue))})(this,function(Y,t){"use strict";var Ie=typeof document<"u"?document.currentScript:null;const Me=navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i),Ce={isRTL:nn,setLocalStorage:on,getLocalStorage:ln};function nn(e){return["ar","fa","iw","yi","ur","pa"].indexOf(e)>-1}function on(e,o){localStorage.setItem(e,JSON.stringify(o))}function ln(e){return JSON.parse(localStorage.getItem(e))}const rn={class:"dropdown dropdown-end z-50"},an=t.createElementVNode("div",{tabindex:"0",role:"button",class:"btn btn-ghost btn-circle btn-sm"},[t.createElementVNode("svg",{class:"w-5 h-5 text-primary",fill:"currentColor",viewBox:"0 0 20 20"},[t.createElementVNode("path",{d:"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"})])],-1),sn={tabindex:"0",class:"dropdown-content menu p-2 shadow bg-base-100 rounded-box w-52 max-h-96 overflow-y-auto z-50"},cn=["id","value","checked","onChange"],dn=["for"],un={class:"flex items-center gap-2"},fn={__name:"ThemeSelector",props:{currentTheme:{type:String,default:"lofi"}},emits:["themeChange"],setup(e,{emit:o}){const n=o,l=[{value:"lofi",name:"Lo-Fi",color:"#0f0f23"},{value:"pastel",name:"Pastel",color:"#d1c1d7"},{value:"fantasy",name:"Fantasy",color:"#6e0b75"},{value:"autumn",name:"Autumn",color:"#8c0327"},{value:"retro",name:"Retro",color:"#ef9995"},{value:"synthwave",name:"Synthwave",color:"#e779c1"},{value:"halloween",name:"Halloween",color:"#f28c18"},{value:"dracula",name:"Dracula",color:"#ff79c6"},{value:"coffee",name:"Coffee",color:"#db924b"},{value:"dim",name:"Dim",color:"#9fe88d"},{value:"sunset",name:"Sunset",color:"#ff865b"},{value:"cyberpunk",name:"Cyberpunk",color:"#ff7598"}],r=a=>{n("themeChange",a)};return(a,i)=>(t.openBlock(),t.createElementBlock("div",rn,[an,t.createElementVNode("ul",sn,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(l,s=>t.createElementVNode("li",{key:s.value},[t.createElementVNode("input",{type:"radio",id:`theme-${s.value}`,value:s.value,checked:e.currentTheme===s.value,onChange:c=>r(s.value),class:"theme-controller sr-only"},null,40,cn),t.createElementVNode("label",{for:`theme-${s.value}`,class:t.normalizeClass(["cursor-pointer rounded-lg px-2 py-1 hover:bg-base-200",{"bg-primary text-primary-content":e.currentTheme===s.value}])},[t.createElementVNode("span",un,[t.createElementVNode("span",{class:"w-3 h-3 rounded-full",style:t.normalizeStyle({backgroundColor:s.color})},null,4),t.createTextVNode(" "+t.toDisplayString(s.name),1)])],10,dn)])),64))])]))}},pn={class:"flex justify-between"},mn={class:"flex flex-row items-center"},hn=t.createStaticVNode('<svg class="w-24 text-primary" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M40.151 8.94498H35.7256V23.055H40.151C44.7473 23.055 47.826 20.0825 47.826 15.9795C47.8267 11.8093 44.7678 8.94498 40.151 8.94498ZM40.1312 21.025H37.993V10.9974H40.1312C43.4217 10.9974 45.4972 12.9846 45.4972 15.9795C45.4965 18.9296 43.4012 21.025 40.1312 21.025Z" fill="currentColor"></path><path d="M54.5158 8.94498H50.0903V23.055H54.5158C59.1121 23.055 62.1908 20.0825 62.1908 15.9795C62.1914 11.8093 59.1351 8.94498 54.5158 8.94498ZM54.496 21.025H52.3578V10.9974H54.496C57.789 10.9974 59.8619 12.9846 59.8619 15.9795C59.8613 18.9296 57.766 21.025 54.496 21.025Z" fill="currentColor"></path><path d="M66.7237 8.94498H64.4575V23.055H66.7237V8.94498Z" fill="currentColor"></path><path d="M76.4301 10.7837C78.29 10.7837 79.7436 11.6603 80.7487 13.2207L82.4589 11.9591C81.2401 9.97057 78.9957 8.70953 76.409 8.70953C72.3898 8.64555 68.9048 11.9591 68.9906 16C68.9048 20.0403 72.3898 23.3544 76.409 23.2905C79.0385 23.2905 81.2618 22.0294 82.4589 20.0409L80.7487 18.7793C79.7436 20.3397 78.29 21.2163 76.4301 21.2163C73.544 21.2163 71.3418 18.993 71.3418 16C71.3418 13.007 73.5433 10.7837 76.4301 10.7837Z" fill="currentColor"></path><path d="M83.3135 8.94498V10.9757H88.0595V23.055H90.3256V10.9757H95.0934V8.94498H83.3135Z" fill="currentColor"></path><path d="M8.66351 4.7121H4.604V15.4427L6.87208 13.3839V6.79143H8.64559C11.4639 6.79143 13.2835 8.47857 13.2835 11.0877C13.2835 13.6916 11.421 15.4427 8.64559 15.4427H4.604V17.5016H8.66351C12.7531 17.5016 15.6098 14.8644 15.6098 11.0877C15.6104 7.27575 12.8196 4.7121 8.66351 4.7121Z" fill="currentColor"></path><path d="M26.2425 9.25528H21.5502L20.7537 14.293L21.4523 14.3308L21.4069 14.7294C21.3916 14.8656 21.3289 15.0448 21.112 15.1734C21.1017 15.9399 21.0845 17.0493 20.9706 18.1766H26.5937V19.8586H21.4677C22.4133 22.9424 24.1254 24.9648 26.5611 25.8669L27.1536 26.0864L26.6795 26.5048C26.4875 26.6737 26.2182 27.0141 26.0896 27.2489L25.9258 27.5438L25.6155 27.4152C23.167 26.4095 21.4223 24.4926 20.2905 21.563C19.3602 24.3365 17.5797 26.2553 14.8592 27.428L14.5438 27.5617L14.3775 27.2642C14.2764 27.08 14.0294 26.7876 13.8151 26.5989L13.3564 26.1951L13.9239 25.9655C16.4555 24.9392 18.064 23.1414 18.8228 20.4837C19.6647 19.8381 20.2099 18.8221 20.2169 17.6801V4.53231C20.2169 2.58349 18.6334 1 16.6846 1H3.53487C1.58349 1 0 2.58349 0 4.53231V17.6795C0 19.6283 1.58349 21.2143 3.53487 21.2143H8.25528V27.2431C8.25528 29.3135 9.93986 31 12.0096 31H26.2431C28.3161 31 29.9974 29.3129 29.9974 27.2431V13.0096C29.9974 10.9392 28.3154 9.25528 26.2425 9.25528ZM3.53487 19.4517C2.55662 19.4517 1.762 18.6603 1.762 17.6788V4.53231C1.762 3.55662 2.55598 2.762 3.53487 2.762H16.6839C17.6571 2.762 18.4517 3.55598 18.4517 4.53231V17.6795C18.4517 17.778 18.444 17.8733 18.4267 17.9667C18.3941 18.1811 18.3231 18.38 18.215 18.5592C17.9149 19.0934 17.3372 19.4517 16.6846 19.4517H3.53487Z" fill="currentColor"></path></svg>',1),gn={key:0,class:"ml-2 px-1.5 py-0.5 text-[10px] font-medium bg-primary/10 text-primary border border-primary/20 rounded-full"},bn={class:"flex"},Cn=[t.createElementVNode("svg",{class:"w-6 h-6 text-primary",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.5 3.25C5.25736 3.25 4.25 4.25736 4.25 5.5H3.5H2.75C2.75 3.42893 4.42893 1.75 6.5 1.75H17.5C17.9142 1.75 18.25 2.08579 18.25 2.5V15.5C18.25 15.9142 17.9142 16.25 17.5 16.25H6.5C5.26293 16.25 4.25 17.2576 4.25 18.5C4.25 18.9142 3.91421 19.25 3.5 19.25C3.08579 19.25 2.75 18.9142 2.75 18.5V5.5C2.75 5.49993 2.75 5.5 3.5 5.5C4.25 5.5 4.25 5.49993 4.25 5.5V15.5017C4.87779 15.0296 5.65755 14.75 6.5 14.75H16.75V3.25H6.5Z",fill:"currentColor"}),t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20.5 2.75C20.9142 2.75 21.25 3.08579 21.25 3.5V21.5C21.25 21.9142 20.9142 22.25 20.5 22.25H6.5C4.42893 22.25 2.75 20.5711 2.75 18.5C2.75 16.4289 4.42893 14.75 6.5 14.75H17.4995C17.4996 14.75 17.5 14.75 17.5 15.5C17.5 16.25 17.5001 16.25 17.5 16.25H6.5C5.25736 16.25 4.25 17.2574 4.25 18.5C4.25 19.7426 5.25736 20.75 6.5 20.75H19.75V3.5C19.75 3.08579 20.0858 2.75 20.5 2.75ZM18.25 15.5C18.25 15.9142 17.9142 16.25 17.5 16.25V15.5L17.4995 14.75C17.9137 14.75 18.25 15.0858 18.25 15.5Z",fill:"currentColor"}),t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.25 18.5C6.25 18.0858 6.58579 17.75 7 17.75H17C17.4142 17.75 17.75 18.0858 17.75 18.5C17.75 18.9142 17.4142 19.25 17 19.25H7C6.58579 19.25 6.25 18.9142 6.25 18.5Z",fill:"currentColor"})],-1)],xn=t.createElementVNode("svg",{class:"w-6 h-6 text-primary",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M12 3L1 9L12 15L23 9L12 3Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M5 13L12 17L19 13",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M5 17L12 21L19 17",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),vn={key:0,class:"absolute -top-0.5 -right-0.5 bg-red-500 text-white text-xs rounded-full h-4 min-w-[16px] flex items-center justify-center px-1 text-[8px]"},yn=[t.createElementVNode("svg",{class:"w-6 h-6 text-primary",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M5.3163 19.4384C5.92462 18.0052 7.34492 17 9 17H15C16.6551 17 18.0754 18.0052 18.6837 19.4384M16 9.5C16 11.7091 14.2091 13.5 12 13.5C9.79086 13.5 8 11.7091 8 9.5C8 7.29086 9.79086 5.5 12 5.5C14.2091 5.5 16 7.29086 16 9.5ZM22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)],wn=[t.createElementVNode("svg",{class:"w-6 h-6 text-primary",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M9.12596 1.63869C9.46935 1.54364 9.83221 1.70329 9.99413 2.02068C10.3672 2.75191 11.1261 3.25 12 3.25C12.8739 3.25 13.6328 2.75191 14.0059 2.02068C14.1678 1.70329 14.5307 1.54364 14.874 1.63869C16.5585 2.10497 18.0759 2.9704 19.3184 4.12574C19.5611 4.35137 19.6269 4.70948 19.4804 5.00666C19.3331 5.30535 19.25 5.6419 19.25 6C19.25 7.24263 20.2574 8.25 21.5 8.25L21.5314 8.24977C21.8629 8.24504 22.1583 8.45859 22.2576 8.77495C22.5777 9.79397 22.75 10.8776 22.75 12C22.75 12.7408 22.6749 13.4649 22.5318 14.1648C22.4548 14.5411 22.1059 14.7985 21.7237 14.7609C21.6504 14.7537 21.5758 14.75 21.5 14.75C20.2574 14.75 19.25 15.7574 19.25 17C19.25 17.5531 19.4486 18.0579 19.7793 18.4498C20.027 18.7434 20.0128 19.1767 19.7465 19.4535C18.4777 20.7719 16.8745 21.7678 15.0721 22.3044C14.6807 22.4209 14.2681 22.2029 14.1437 21.814C13.8535 20.906 13.0024 20.25 12 20.25C10.9976 20.25 10.1465 20.906 9.85629 21.814C9.73195 22.2029 9.31927 22.4209 8.92789 22.3044C7.12545 21.7678 5.52229 20.7719 4.25353 19.4535C3.98716 19.1767 3.97299 18.7434 4.22072 18.4498C4.55139 18.0579 4.75 17.5531 4.75 17C4.75 15.7574 3.74264 14.75 2.5 14.75C2.42423 14.75 2.34963 14.7537 2.27634 14.7609C1.89406 14.7985 1.54519 14.5411 1.46821 14.1648C1.32505 13.4649 1.25 12.7408 1.25 12C1.25 10.8776 1.42227 9.79398 1.74236 8.77494C1.84173 8.45859 2.13705 8.24504 2.4686 8.24977L2.5 8.25C3.74264 8.25 4.75 7.24263 4.75 6C4.75 5.6419 4.66689 5.30535 4.51962 5.00666C4.3731 4.70948 4.43894 4.35137 4.68159 4.12574C5.92411 2.9704 7.44153 2.10497 9.12596 1.63869ZM6.08277 4.88991C6.19152 5.24123 6.25 5.61424 6.25 6C6.25 7.88945 4.85261 9.45253 3.03493 9.71213C2.84898 10.4432 2.75 11.2096 2.75 12C2.75 12.4294 2.77921 12.8516 2.83567 13.2648C4.74948 13.4346 6.25 15.0421 6.25 17C6.25 17.6669 6.0754 18.2941 5.76971 18.8372C6.62645 19.6184 7.63002 20.2404 8.73362 20.657C9.37706 19.5189 10.598 18.75 12 18.75C13.402 18.75 14.6229 19.5189 15.2664 20.657C16.37 20.2404 17.3735 19.6184 18.2303 18.8372C17.9246 18.2941 17.75 17.6669 17.75 17C17.75 15.0421 19.2505 13.4346 21.1643 13.2648C21.2208 12.8516 21.25 12.4294 21.25 12C21.25 11.2096 21.151 10.4432 20.9651 9.71213C19.1474 9.45252 17.75 7.88945 17.75 6C17.75 5.61424 17.8085 5.24123 17.9172 4.88991C17.0618 4.1771 16.0762 3.61614 15.0018 3.24775C14.3184 4.15897 13.2287 4.75 12 4.75C10.7713 4.75 9.68158 4.15897 8.99819 3.24775C7.92382 3.61614 6.93823 4.1771 6.08277 4.88991Z",fill:"currentColor"}),t.createElementVNode("path",{d:"M7.75 12C7.75 9.65278 9.65279 7.75 12 7.75C14.3472 7.75 16.25 9.65278 16.25 12C16.25 14.3472 14.3472 16.25 12 16.25C9.65279 16.25 7.75 14.3472 7.75 12ZM12 9.25C10.4812 9.25 9.25 10.4812 9.25 12C9.25 13.5188 10.4812 14.75 12 14.75C13.5188 14.75 14.75 13.5188 14.75 12C14.75 10.4812 13.5188 9.25 12 9.25Z",fill:"currentColor"})],-1)],En=[t.createStaticVNode('<svg class="w-6 h-6 text-primary" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.467 2.47236C2.75841 2.17799 3.23328 2.17559 3.52764 2.467L8.52765 7.41675C8.82201 7.70816 8.82441 8.18303 8.533 8.4774C8.24159 8.77176 7.76672 8.77416 7.47235 8.48275L2.47236 3.533C2.17799 3.24159 2.17559 2.76672 2.467 2.47236Z" fill="currentColor"></path><path d="M8.533 15.4724C8.82441 15.7667 8.82201 16.2416 8.52765 16.533L3.52765 21.4828C3.23328 21.7742 2.75841 21.7718 2.467 21.4774C2.17559 21.183 2.17799 20.7082 2.47236 20.4167L7.47235 15.467C7.76672 15.1756 8.24159 15.178 8.533 15.4724Z" fill="currentColor"></path><path d="M15.52 15.4697C15.8129 15.1768 16.2877 15.1768 16.5806 15.4697L21.5304 20.4194C21.8233 20.7123 21.8233 21.1872 21.5304 21.4801C21.2375 21.773 20.7626 21.773 20.4697 21.4801L15.52 16.5303C15.2271 16.2374 15.2271 15.7626 15.52 15.4697Z" fill="currentColor"></path><path d="M21.4801 2.46967C21.773 2.76256 21.773 3.23744 21.4801 3.53033L16.5303 8.48008C16.2374 8.77297 15.7626 8.77297 15.4697 8.48008C15.1768 8.18719 15.1768 7.71231 15.4697 7.41942L20.4194 2.46967C20.7123 2.17678 21.1872 2.17678 21.4801 2.46967Z" fill="currentColor"></path><path d="M15.75 3C15.75 2.58579 16.0858 2.25 16.5 2.25H21C21.4142 2.25 21.75 2.58579 21.75 3V7.5C21.75 7.91421 21.4142 8.25 21 8.25C20.5858 8.25 20.25 7.91421 20.25 7.5V3.75H16.5C16.0858 3.75 15.75 3.41421 15.75 3Z" fill="currentColor"></path><path d="M21 15.75C21.4142 15.75 21.75 16.0858 21.75 16.5V21C21.75 21.4142 21.4142 21.75 21 21.75H16.5C16.0858 21.75 15.75 21.4142 15.75 21C15.75 20.5858 16.0858 20.25 16.5 20.25H20.25V16.5C20.25 16.0858 20.5858 15.75 21 15.75Z" fill="currentColor"></path><path d="M3 15.75C3.41421 15.75 3.75 16.0858 3.75 16.5V20.25H7.5C7.91421 20.25 8.25 20.5858 8.25 21C8.25 21.4142 7.91421 21.75 7.5 21.75H3C2.58579 21.75 2.25 21.4142 2.25 21V16.5C2.25 16.0858 2.58579 15.75 3 15.75Z" fill="currentColor"></path><path d="M2.25 3C2.25 2.58579 2.58579 2.25 3 2.25H7.5C7.91421 2.25 8.25 2.58579 8.25 3C8.25 3.41421 7.91421 3.75 7.5 3.75H3.75V7.5C3.75 7.91421 3.41421 8.25 3 8.25C2.58579 8.25 2.25 7.91421 2.25 7.5V3Z" fill="currentColor"></path></svg>',1)],_n={__name:"Header",props:{headerSettings:{type:Object,required:!0,default:()=>({showAccount:!0,showReader:!0,showLearn:0,showFullscreen:!0,showSettings:!0,showThemeSelector:!0})},currentTheme:{type:String,default:"lofi"},isPremium:{type:Boolean,default:!1}},emits:["settings","fullScreen","reader","learn","account","themeChange"],setup(e,{emit:o}){const n=o,l=r=>{n("themeChange",r)};return(r,a)=>(t.openBlock(),t.createElementBlock("div",pn,[t.createElementVNode("div",mn,[hn,e.isPremium?(t.openBlock(),t.createElementBlock("span",gn,"Premium")):t.createCommentVNode("",!0)]),t.createElementVNode("div",bn,[e.headerSettings.showThemeSelector?(t.openBlock(),t.createBlock(fn,{key:0,"current-theme":e.currentTheme,onThemeChange:l},null,8,["current-theme"])):t.createCommentVNode("",!0),e.headerSettings.showReader?(t.openBlock(),t.createElementBlock("button",{key:1,class:"btn btn-ghost btn-circle btn-sm",onClick:a[0]||(a[0]=i=>n("reader"))},Cn)):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"btn btn-ghost btn-circle btn-sm relative",onClick:a[1]||(a[1]=i=>n("learn"))},[xn,e.headerSettings.showLearn>0?(t.openBlock(),t.createElementBlock("span",vn,t.toDisplayString(e.headerSettings.showLearn>999?"999+":e.headerSettings.showLearn),1)):t.createCommentVNode("",!0)]),e.headerSettings.showAccount?(t.openBlock(),t.createElementBlock("button",{key:2,class:"btn btn-ghost btn-circle btn-sm",onClick:a[2]||(a[2]=i=>n("account"))},yn)):t.createCommentVNode("",!0),e.headerSettings.showSettings?(t.openBlock(),t.createElementBlock("button",{key:3,class:"btn btn-ghost btn-circle btn-sm",onClick:a[3]||(a[3]=i=>n("settings"))},wn)):t.createCommentVNode("",!0),e.headerSettings.showFullscreen?(t.openBlock(),t.createElementBlock("button",{key:4,class:"btn btn-ghost btn-circle btn-sm",onClick:a[4]||(a[4]=i=>n("fullScreen"))},En)):t.createCommentVNode("",!0)])]))}};function ie(e,o,n){let l=n.initialDeps??[],r;return()=>{var a,i,s,c;let d;n.key&&((a=n.debug)!=null&&a.call(n))&&(d=Date.now());const u=e();if(!(u.length!==l.length||u.some((h,b)=>l[b]!==h)))return r;l=u;let C;if(n.key&&((i=n.debug)!=null&&i.call(n))&&(C=Date.now()),r=o(...u),n.key&&((s=n.debug)!=null&&s.call(n))){const h=Math.round((Date.now()-d)*100)/100,b=Math.round((Date.now()-C)*100)/100,g=b/16,S=(k,v)=>{for(k=String(k);k.length<v;)k=" "+k;return k};console.info(`%c⏱ ${S(b,5)} /${S(h,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
|
-
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(c=n==null?void 0:n.onChange)==null||c.call(n,r),r}}function Ae(e,o){if(e===void 0)throw new Error("Unexpected undefined");return e}const En=(e,o)=>Math.abs(e-o)<1,_n=(e,o,n)=>{let l;return function(...r){e.clearTimeout(l),l=e.setTimeout(()=>o.apply(this,r),n)}},kn=e=>e,Sn=e=>{const o=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),l=[];for(let r=o;r<=n;r++)l.push(r);return l},Tn=(e,o)=>{const n=e.scrollElement;if(!n)return;const l=e.targetWindow;if(!l)return;const r=i=>{const{width:s,height:c}=i;o({width:Math.round(s),height:Math.round(c)})};if(r(n.getBoundingClientRect()),!l.ResizeObserver)return()=>{};const a=new l.ResizeObserver(i=>{const s=i[0];if(s!=null&&s.borderBoxSize){const c=s.borderBoxSize[0];if(c){r({width:c.inlineSize,height:c.blockSize});return}}r(n.getBoundingClientRect())});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},nt={passive:!0},$n=typeof window>"u"?!0:"onscrollend"in window,Vn=(e,o)=>{const n=e.scrollElement;if(!n)return;const l=e.targetWindow;if(!l)return;let r=0;const a=$n?()=>{}:_n(l,()=>{o(r,!1)},e.options.isScrollingResetDelay),i=d=>()=>{r=n[e.options.horizontal?"scrollLeft":"scrollTop"],a(),o(r,d)},s=i(!0),c=i(!1);return c(),n.addEventListener("scroll",s,nt),n.addEventListener("scrollend",c,nt),()=>{n.removeEventListener("scroll",s),n.removeEventListener("scrollend",c)}},Bn=(e,o,n)=>{if(o!=null&&o.borderBoxSize){const l=o.borderBoxSize[0];if(l)return Math.round(l[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},Nn=(e,{adjustments:o=0,behavior:n},l)=>{var r,a;const i=e+o;(a=(r=l.scrollElement)==null?void 0:r.scrollTo)==null||a.call(r,{[l.options.horizontal?"left":"top"]:i,behavior:n})};class Ln{constructor(o){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const l=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(a=>{this._measureElement(a.target,a)})}));return{disconnect:()=>{var r;return(r=l())==null?void 0:r.disconnect()},observe:r=>{var a;return(a=l())==null?void 0:a.observe(r,{box:"border-box"})},unobserve:r=>{var a;return(a=l())==null?void 0:a.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([l,r])=>{typeof r>"u"&&delete n[l]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:kn,rangeExtractor:Sn,onChange:()=>{},measureElement:Bn,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,...n}},this.notify=(n,l)=>{var r,a;const{startIndex:i,endIndex:s}=this.range??{startIndex:void 0,endIndex:void 0},c=this.calculateRange();(n||i!==(c==null?void 0:c.startIndex)||s!==(c==null?void 0:c.endIndex))&&((a=(r=this.options).onChange)==null||a.call(r,this,l))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.observer.disconnect(),this.elementsCache.clear()},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const l=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==l){if(this.cleanup(),!l){this.notify(!1,!1);return}this.scrollElement=l,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(r,a)=>{this.scrollAdjustments=0,this.scrollDirection=a?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r;const i=this.isScrolling;this.isScrolling=a,this.notify(i!==a,a)}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,l)=>{const r=new Map,a=new Map;for(let i=l-1;i>=0;i--){const s=n[i];if(r.has(s.lane))continue;const c=a.get(s.lane);if(c==null||s.end>c.end?a.set(s.lane,s):s.end<c.end&&r.set(s.lane,!0),r.size===this.options.lanes)break}return a.size===this.options.lanes?Array.from(a.values()).sort((i,s)=>i.end===s.end?i.index-s.index:i.end-s.end)[0]:void 0},this.getMeasurementOptions=ie(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,l,r,a,i)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:l,scrollMargin:r,getItemKey:a,enabled:i}),{key:!1}),this.getMeasurements=ie(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:l,scrollMargin:r,getItemKey:a,enabled:i},s)=>{var c;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const d=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,d);for(let f=d;f<n;f++){let C=(c=this.measurementsCache[f])==null?void 0:c.measureElement;C||(C=y=>{const w=a(f),V=this.elementsCache.get(w);if(!y){V&&(this.observer.unobserve(V),this.elementsCache.delete(w));return}V!==y&&(V&&this.observer.unobserve(V),this.observer.observe(y),this.elementsCache.set(w,y)),y.isConnected&&this.resizeItem(f,this.options.measureElement(y,void 0,this))});const h=a(f),b=this.options.lanes===1?u[f-1]:this.getFurthestMeasurement(u,f),g=b?b.end+this.options.gap:l+r,S=s.get(h),k=typeof S=="number"?S:this.options.estimateSize(f),v=g+k,x=b?b.lane:f%this.options.lanes;u[f]={index:f,start:g,size:k,end:v,key:h,lane:x,measureElement:C}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=ie(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,l,r)=>this.range=n.length>0&&l>0?On({measurements:n,outerSize:l,scrollOffset:r}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=ie(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,l,r,a)=>l===null?[]:n({startIndex:l.startIndex,endIndex:l.endIndex,overscan:r,count:a}),{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const l=this.options.indexAttribute,r=n.getAttribute(l);return r?parseInt(r,10):(console.warn(`Missing attribute name '${l}={index}' on measured element.`),-1)},this._measureElement=(n,l)=>{const r=this.indexFromElement(n),a=this.getMeasurements()[r];if(!a||!n.isConnected){this.elementsCache.forEach((s,c)=>{s===n&&(this.observer.unobserve(n),this.elementsCache.delete(c))});return}const i=this.elementsCache.get(a.key);i!==n&&(i&&this.observer.unobserve(i),this.observer.observe(n),this.elementsCache.set(a.key,n)),this.resizeItem(r,this.options.measureElement(n,l,this))},this.resizeItem=(n,l)=>{const r=this.getMeasurements()[n];if(!r)return;const a=this.itemSizeCache.get(r.key)??r.size,i=l-a;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,i,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,l)),this.notify(!0,!1))},this.measureElement=n=>{n&&this._measureElement(n,void 0)},this.getVirtualItems=ie(()=>[this.getIndexes(),this.getMeasurements()],(n,l)=>{const r=[];for(let a=0,i=n.length;a<i;a++){const s=n[a],c=l[s];r.push(c)}return r},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const l=this.getMeasurements();if(l.length!==0)return Ae(l[ot(0,l.length-1,r=>Ae(l[r]).start,n)])},this.getOffsetForAlignment=(n,l)=>{const r=this.getSize(),a=this.getScrollOffset();l==="auto"&&(n<=a?l="start":n>=a+r?l="end":l="start"),l==="start"?n=n:l==="end"?n=n-r:l==="center"&&(n=n-r/2);const i=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[i]:this.scrollElement[i]:0)-r;return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,l="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.getMeasurements()[n];if(!r)return;const a=this.getSize(),i=this.getScrollOffset();if(l==="auto")if(r.end>=i+a-this.options.scrollPaddingEnd)l="end";else if(r.start<=i+this.options.scrollPaddingStart)l="start";else return[i,l];const s=l==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,l),l]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:l="start",behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,l),{adjustments:void 0,behavior:r})},this.scrollToIndex=(n,{align:l="auto",behavior:r}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const a=this.getOffsetForIndex(n,l);if(!a)return;const[i,s]=a;this._scrollToOffset(i,{adjustments:void 0,behavior:r}),r!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[d]=Ae(this.getOffsetForIndex(n,s));En(d,this.getScrollOffset())||this.scrollToIndex(n,{align:s,behavior:r})}else this.scrollToIndex(n,{align:s,behavior:r})}))},this.scrollBy=(n,{behavior:l}={})=>{this.cancelScrollToIndex(),l==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:l})},this.getTotalSize=()=>{var n;const l=this.getMeasurements();let r;return l.length===0?r=this.options.paddingStart:r=this.options.lanes===1?((n=l[l.length-1])==null?void 0:n.end)??0:Math.max(...l.slice(-this.options.lanes).map(a=>a.end)),r-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(n,{adjustments:l,behavior:r})=>{this.options.scrollToFn(n,{behavior:r,adjustments:l},this)},this.measure=()=>{var n,l;this.itemSizeCache=new Map,(l=(n=this.options).onChange)==null||l.call(n,this,!1)},this.setOptions(o)}}const ot=(e,o,n,l)=>{for(;e<=o;){const r=(e+o)/2|0,a=n(r);if(a<l)e=r+1;else if(a>l)o=r-1;else return r}return e>0?e-1:0};function On({measurements:e,outerSize:o,scrollOffset:n}){const l=e.length-1,a=ot(0,l,s=>e[s].start,n);let i=a;for(;i<l&&e[i].end<n+o;)i++;return{startIndex:a,endIndex:i}}function In(e){const o=new Ln(t.unref(e)),n=t.shallowRef(o),l=o._didMount();return t.watch(()=>t.unref(e).getScrollElement(),r=>{r&&o._willUpdate()},{immediate:!0}),t.watch(()=>t.unref(e),r=>{o.setOptions({...r,onChange:(a,i)=>{var s;t.triggerRef(n),(s=r.onChange)==null||s.call(r,a,i)}}),o._willUpdate(),t.triggerRef(n)},{immediate:!0}),t.onScopeDispose(l),n}function Mn(e){return In(t.computed(()=>({observeElementRect:Tn,observeElementOffset:Vn,scrollToFn:Nn,...t.unref(e)})))}function An(e,o,n){let l=t.ref(n==null?void 0:n.value),r=t.computed(()=>e.value!==void 0);return[t.computed(()=>r.value?e.value:l.value),function(a){return r.value||(l.value=a),o==null?void 0:o(a)}]}function Rn(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(o=>setTimeout(()=>{throw o}))}function xe(){let e=[],o={addEventListener(n,l,r,a){return n.addEventListener(l,r,a),o.add(()=>n.removeEventListener(l,r,a))},requestAnimationFrame(...n){let l=requestAnimationFrame(...n);o.add(()=>cancelAnimationFrame(l))},nextFrame(...n){o.requestAnimationFrame(()=>{o.requestAnimationFrame(...n)})},setTimeout(...n){let l=setTimeout(...n);o.add(()=>clearTimeout(l))},microTask(...n){let l={current:!0};return Rn(()=>{l.current&&n[0]()}),o.add(()=>{l.current=!1})},style(n,l,r){let a=n.style.getPropertyValue(l);return Object.assign(n.style,{[l]:r}),this.add(()=>{Object.assign(n.style,{[l]:a})})},group(n){let l=xe();return n(l),this.add(()=>l.dispose())},add(n){return e.push(n),()=>{let l=e.indexOf(n);if(l>=0)for(let r of e.splice(l,1))r()}},dispose(){for(let n of e.splice(0))n()}};return o}function Dn(){let e=xe();return t.onUnmounted(()=>e.dispose()),e}function Pn(){let e=Dn();return o=>{e.dispose(),e.nextFrame(o)}}let Fn=Symbol("headlessui.useid"),jn=0;function ce(){return t.inject(Fn,()=>`${++jn}`)()}function N(e){var o;if(e==null||e.value==null)return null;let n=(o=e.value.$el)!=null?o:e.value;return n instanceof Node?n:null}function U(e,o,...n){if(e in o){let r=o[e];return typeof r=="function"?r(...n):r}let l=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(o).map(r=>`"${r}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,U),l}var zn=Object.defineProperty,Hn=(e,o,n)=>o in e?zn(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,lt=(e,o,n)=>(Hn(e,typeof o!="symbol"?o+"":o,n),n);let Zn=class{constructor(){lt(this,"current",this.detect()),lt(this,"currentId",0)}set(o){this.current!==o&&(this.currentId=0,this.current=o)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}},Re=new Zn;function De(e){if(Re.isServer)return null;if(e instanceof Node)return e.ownerDocument;if(e!=null&&e.hasOwnProperty("value")){let o=N(e);if(o)return o.ownerDocument}return document}let rt=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Un=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(Un||{}),Wn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Wn||{}),qn=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(qn||{}),at=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(at||{});function Gn(e,o=0){var n;return e===((n=De(e))==null?void 0:n.body)?!1:U(o,{0(){return e.matches(rt)},1(){let l=e;for(;l!==null;){if(l.matches(rt))return!0;l=l.parentElement}return!1}})}var Jn=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Jn||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Yn(e,o=n=>n){return e.slice().sort((n,l)=>{let r=o(n),a=o(l);if(r===null||a===null)return 0;let i=r.compareDocumentPosition(a);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Qn(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Xn(){return/Android/gi.test(window.navigator.userAgent)}function st(){return Qn()||Xn()}function ve(e,o,n){Re.isServer||t.watchEffect(l=>{document.addEventListener(e,o,n),l(()=>document.removeEventListener(e,o,n))})}function Kn(e,o,n){Re.isServer||t.watchEffect(l=>{window.addEventListener(e,o,n),l(()=>window.removeEventListener(e,o,n))})}function eo(e,o,n=t.computed(()=>!0)){function l(a,i){if(!n.value||a.defaultPrevented)return;let s=i(a);if(s===null||!s.getRootNode().contains(s))return;let c=function d(u){return typeof u=="function"?d(u()):Array.isArray(u)||u instanceof Set?u:[u]}(e);for(let d of c){if(d===null)continue;let u=d instanceof HTMLElement?d:N(d);if(u!=null&&u.contains(s)||a.composed&&a.composedPath().includes(u))return}return!Gn(s,at.Loose)&&s.tabIndex!==-1&&a.preventDefault(),o(a,s)}let r=t.ref(null);ve("pointerdown",a=>{var i,s;n.value&&(r.value=((s=(i=a.composedPath)==null?void 0:i.call(a))==null?void 0:s[0])||a.target)},!0),ve("mousedown",a=>{var i,s;n.value&&(r.value=((s=(i=a.composedPath)==null?void 0:i.call(a))==null?void 0:s[0])||a.target)},!0),ve("click",a=>{st()||r.value&&(l(a,()=>r.value),r.value=null)},!0),ve("touchend",a=>l(a,()=>a.target instanceof HTMLElement?a.target:null),!0),Kn("blur",a=>l(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function it(e,o){if(e)return e;let n=o??"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function to(e,o){let n=t.ref(it(e.value.type,e.value.as));return t.onMounted(()=>{n.value=it(e.value.type,e.value.as)}),t.watchEffect(()=>{var l;n.value||N(o)&&N(o)instanceof HTMLButtonElement&&!((l=N(o))!=null&&l.hasAttribute("type"))&&(n.value="button")}),n}function ct(e){return[e.screenX,e.screenY]}function no(){let e=t.ref([-1,-1]);return{wasMoved(o){let n=ct(o);return e.value[0]===n[0]&&e.value[1]===n[1]?!1:(e.value=n,!0)},update(o){e.value=ct(o)}}}function oo({container:e,accept:o,walk:n,enabled:l}){t.watchEffect(()=>{let r=e.value;if(!r||l!==void 0&&!l.value)return;let a=De(e);if(!a)return;let i=Object.assign(c=>o(c),{acceptNode:o}),s=a.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,i,!1);for(;s.nextNode();)n(s.currentNode)})}var de=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(de||{}),lo=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(lo||{});function Q({visible:e=!0,features:o=0,ourProps:n,theirProps:l,...r}){var a;let i=ut(l,n),s=Object.assign(r,{props:i});if(e||o&2&&i.static)return Pe(s);if(o&1){let c=(a=i.unmount)==null||a?0:1;return U(c,{0(){return null},1(){return Pe({...r,props:{...i,hidden:!0,style:{display:"none"}}})}})}return Pe(s)}function Pe({props:e,attrs:o,slots:n,slot:l,name:r}){var a,i;let{as:s,...c}=ye(e,["unmount","static"]),d=(a=n.default)==null?void 0:a.call(n,l),u={};if(l){let f=!1,C=[];for(let[h,b]of Object.entries(l))typeof b=="boolean"&&(f=!0),b===!0&&C.push(h);f&&(u["data-headlessui-state"]=C.join(" "))}if(s==="template"){if(d=dt(d??[]),Object.keys(c).length>0||Object.keys(o).length>0){let[f,...C]=d??[];if(!ao(f)||C.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${r} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(c).concat(Object.keys(o)).map(g=>g.trim()).filter((g,S,k)=>k.indexOf(g)===S).sort((g,S)=>g.localeCompare(S)).map(g=>` - ${g}`).join(`
|
|
4
|
+
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(c=n==null?void 0:n.onChange)==null||c.call(n,r),r}}function Ae(e,o){if(e===void 0)throw new Error("Unexpected undefined");return e}const kn=(e,o)=>Math.abs(e-o)<1,Sn=(e,o,n)=>{let l;return function(...r){e.clearTimeout(l),l=e.setTimeout(()=>o.apply(this,r),n)}},Tn=e=>e,$n=e=>{const o=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),l=[];for(let r=o;r<=n;r++)l.push(r);return l},Vn=(e,o)=>{const n=e.scrollElement;if(!n)return;const l=e.targetWindow;if(!l)return;const r=i=>{const{width:s,height:c}=i;o({width:Math.round(s),height:Math.round(c)})};if(r(n.getBoundingClientRect()),!l.ResizeObserver)return()=>{};const a=new l.ResizeObserver(i=>{const s=i[0];if(s!=null&&s.borderBoxSize){const c=s.borderBoxSize[0];if(c){r({width:c.inlineSize,height:c.blockSize});return}}r(n.getBoundingClientRect())});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},nt={passive:!0},Bn=typeof window>"u"?!0:"onscrollend"in window,Nn=(e,o)=>{const n=e.scrollElement;if(!n)return;const l=e.targetWindow;if(!l)return;let r=0;const a=Bn?()=>{}:Sn(l,()=>{o(r,!1)},e.options.isScrollingResetDelay),i=d=>()=>{r=n[e.options.horizontal?"scrollLeft":"scrollTop"],a(),o(r,d)},s=i(!0),c=i(!1);return c(),n.addEventListener("scroll",s,nt),n.addEventListener("scrollend",c,nt),()=>{n.removeEventListener("scroll",s),n.removeEventListener("scrollend",c)}},Ln=(e,o,n)=>{if(o!=null&&o.borderBoxSize){const l=o.borderBoxSize[0];if(l)return Math.round(l[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},On=(e,{adjustments:o=0,behavior:n},l)=>{var r,a;const i=e+o;(a=(r=l.scrollElement)==null?void 0:r.scrollTo)==null||a.call(r,{[l.options.horizontal?"left":"top"]:i,behavior:n})};class In{constructor(o){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const l=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(a=>{this._measureElement(a.target,a)})}));return{disconnect:()=>{var r;return(r=l())==null?void 0:r.disconnect()},observe:r=>{var a;return(a=l())==null?void 0:a.observe(r,{box:"border-box"})},unobserve:r=>{var a;return(a=l())==null?void 0:a.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([l,r])=>{typeof r>"u"&&delete n[l]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Tn,rangeExtractor:$n,onChange:()=>{},measureElement:Ln,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,...n}},this.notify=(n,l)=>{var r,a;const{startIndex:i,endIndex:s}=this.range??{startIndex:void 0,endIndex:void 0},c=this.calculateRange();(n||i!==(c==null?void 0:c.startIndex)||s!==(c==null?void 0:c.endIndex))&&((a=(r=this.options).onChange)==null||a.call(r,this,l))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.observer.disconnect(),this.elementsCache.clear()},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const l=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==l){if(this.cleanup(),!l){this.notify(!1,!1);return}this.scrollElement=l,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(r,a)=>{this.scrollAdjustments=0,this.scrollDirection=a?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r;const i=this.isScrolling;this.isScrolling=a,this.notify(i!==a,a)}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,l)=>{const r=new Map,a=new Map;for(let i=l-1;i>=0;i--){const s=n[i];if(r.has(s.lane))continue;const c=a.get(s.lane);if(c==null||s.end>c.end?a.set(s.lane,s):s.end<c.end&&r.set(s.lane,!0),r.size===this.options.lanes)break}return a.size===this.options.lanes?Array.from(a.values()).sort((i,s)=>i.end===s.end?i.index-s.index:i.end-s.end)[0]:void 0},this.getMeasurementOptions=ie(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,l,r,a,i)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:l,scrollMargin:r,getItemKey:a,enabled:i}),{key:!1}),this.getMeasurements=ie(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:l,scrollMargin:r,getItemKey:a,enabled:i},s)=>{var c;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const d=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,d);for(let f=d;f<n;f++){let C=(c=this.measurementsCache[f])==null?void 0:c.measureElement;C||(C=y=>{const w=a(f),V=this.elementsCache.get(w);if(!y){V&&(this.observer.unobserve(V),this.elementsCache.delete(w));return}V!==y&&(V&&this.observer.unobserve(V),this.observer.observe(y),this.elementsCache.set(w,y)),y.isConnected&&this.resizeItem(f,this.options.measureElement(y,void 0,this))});const h=a(f),b=this.options.lanes===1?u[f-1]:this.getFurthestMeasurement(u,f),g=b?b.end+this.options.gap:l+r,S=s.get(h),k=typeof S=="number"?S:this.options.estimateSize(f),v=g+k,x=b?b.lane:f%this.options.lanes;u[f]={index:f,start:g,size:k,end:v,key:h,lane:x,measureElement:C}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=ie(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,l,r)=>this.range=n.length>0&&l>0?Mn({measurements:n,outerSize:l,scrollOffset:r}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=ie(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,l,r,a)=>l===null?[]:n({startIndex:l.startIndex,endIndex:l.endIndex,overscan:r,count:a}),{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const l=this.options.indexAttribute,r=n.getAttribute(l);return r?parseInt(r,10):(console.warn(`Missing attribute name '${l}={index}' on measured element.`),-1)},this._measureElement=(n,l)=>{const r=this.indexFromElement(n),a=this.getMeasurements()[r];if(!a||!n.isConnected){this.elementsCache.forEach((s,c)=>{s===n&&(this.observer.unobserve(n),this.elementsCache.delete(c))});return}const i=this.elementsCache.get(a.key);i!==n&&(i&&this.observer.unobserve(i),this.observer.observe(n),this.elementsCache.set(a.key,n)),this.resizeItem(r,this.options.measureElement(n,l,this))},this.resizeItem=(n,l)=>{const r=this.getMeasurements()[n];if(!r)return;const a=this.itemSizeCache.get(r.key)??r.size,i=l-a;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,i,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,l)),this.notify(!0,!1))},this.measureElement=n=>{n&&this._measureElement(n,void 0)},this.getVirtualItems=ie(()=>[this.getIndexes(),this.getMeasurements()],(n,l)=>{const r=[];for(let a=0,i=n.length;a<i;a++){const s=n[a],c=l[s];r.push(c)}return r},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const l=this.getMeasurements();if(l.length!==0)return Ae(l[ot(0,l.length-1,r=>Ae(l[r]).start,n)])},this.getOffsetForAlignment=(n,l)=>{const r=this.getSize(),a=this.getScrollOffset();l==="auto"&&(n<=a?l="start":n>=a+r?l="end":l="start"),l==="start"?n=n:l==="end"?n=n-r:l==="center"&&(n=n-r/2);const i=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[i]:this.scrollElement[i]:0)-r;return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,l="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.getMeasurements()[n];if(!r)return;const a=this.getSize(),i=this.getScrollOffset();if(l==="auto")if(r.end>=i+a-this.options.scrollPaddingEnd)l="end";else if(r.start<=i+this.options.scrollPaddingStart)l="start";else return[i,l];const s=l==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,l),l]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:l="start",behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,l),{adjustments:void 0,behavior:r})},this.scrollToIndex=(n,{align:l="auto",behavior:r}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const a=this.getOffsetForIndex(n,l);if(!a)return;const[i,s]=a;this._scrollToOffset(i,{adjustments:void 0,behavior:r}),r!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[d]=Ae(this.getOffsetForIndex(n,s));kn(d,this.getScrollOffset())||this.scrollToIndex(n,{align:s,behavior:r})}else this.scrollToIndex(n,{align:s,behavior:r})}))},this.scrollBy=(n,{behavior:l}={})=>{this.cancelScrollToIndex(),l==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:l})},this.getTotalSize=()=>{var n;const l=this.getMeasurements();let r;return l.length===0?r=this.options.paddingStart:r=this.options.lanes===1?((n=l[l.length-1])==null?void 0:n.end)??0:Math.max(...l.slice(-this.options.lanes).map(a=>a.end)),r-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(n,{adjustments:l,behavior:r})=>{this.options.scrollToFn(n,{behavior:r,adjustments:l},this)},this.measure=()=>{var n,l;this.itemSizeCache=new Map,(l=(n=this.options).onChange)==null||l.call(n,this,!1)},this.setOptions(o)}}const ot=(e,o,n,l)=>{for(;e<=o;){const r=(e+o)/2|0,a=n(r);if(a<l)e=r+1;else if(a>l)o=r-1;else return r}return e>0?e-1:0};function Mn({measurements:e,outerSize:o,scrollOffset:n}){const l=e.length-1,a=ot(0,l,s=>e[s].start,n);let i=a;for(;i<l&&e[i].end<n+o;)i++;return{startIndex:a,endIndex:i}}function An(e){const o=new In(t.unref(e)),n=t.shallowRef(o),l=o._didMount();return t.watch(()=>t.unref(e).getScrollElement(),r=>{r&&o._willUpdate()},{immediate:!0}),t.watch(()=>t.unref(e),r=>{o.setOptions({...r,onChange:(a,i)=>{var s;t.triggerRef(n),(s=r.onChange)==null||s.call(r,a,i)}}),o._willUpdate(),t.triggerRef(n)},{immediate:!0}),t.onScopeDispose(l),n}function Rn(e){return An(t.computed(()=>({observeElementRect:Vn,observeElementOffset:Nn,scrollToFn:On,...t.unref(e)})))}function Dn(e,o,n){let l=t.ref(n==null?void 0:n.value),r=t.computed(()=>e.value!==void 0);return[t.computed(()=>r.value?e.value:l.value),function(a){return r.value||(l.value=a),o==null?void 0:o(a)}]}function Pn(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(o=>setTimeout(()=>{throw o}))}function xe(){let e=[],o={addEventListener(n,l,r,a){return n.addEventListener(l,r,a),o.add(()=>n.removeEventListener(l,r,a))},requestAnimationFrame(...n){let l=requestAnimationFrame(...n);o.add(()=>cancelAnimationFrame(l))},nextFrame(...n){o.requestAnimationFrame(()=>{o.requestAnimationFrame(...n)})},setTimeout(...n){let l=setTimeout(...n);o.add(()=>clearTimeout(l))},microTask(...n){let l={current:!0};return Pn(()=>{l.current&&n[0]()}),o.add(()=>{l.current=!1})},style(n,l,r){let a=n.style.getPropertyValue(l);return Object.assign(n.style,{[l]:r}),this.add(()=>{Object.assign(n.style,{[l]:a})})},group(n){let l=xe();return n(l),this.add(()=>l.dispose())},add(n){return e.push(n),()=>{let l=e.indexOf(n);if(l>=0)for(let r of e.splice(l,1))r()}},dispose(){for(let n of e.splice(0))n()}};return o}function Fn(){let e=xe();return t.onUnmounted(()=>e.dispose()),e}function jn(){let e=Fn();return o=>{e.dispose(),e.nextFrame(o)}}let zn=Symbol("headlessui.useid"),Hn=0;function ce(){return t.inject(zn,()=>`${++Hn}`)()}function N(e){var o;if(e==null||e.value==null)return null;let n=(o=e.value.$el)!=null?o:e.value;return n instanceof Node?n:null}function U(e,o,...n){if(e in o){let r=o[e];return typeof r=="function"?r(...n):r}let l=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(o).map(r=>`"${r}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,U),l}var Zn=Object.defineProperty,Un=(e,o,n)=>o in e?Zn(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,lt=(e,o,n)=>(Un(e,typeof o!="symbol"?o+"":o,n),n);let Wn=class{constructor(){lt(this,"current",this.detect()),lt(this,"currentId",0)}set(o){this.current!==o&&(this.currentId=0,this.current=o)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}},Re=new Wn;function De(e){if(Re.isServer)return null;if(e instanceof Node)return e.ownerDocument;if(e!=null&&e.hasOwnProperty("value")){let o=N(e);if(o)return o.ownerDocument}return document}let rt=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var qn=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(qn||{}),Gn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Gn||{}),Jn=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Jn||{}),at=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(at||{});function Yn(e,o=0){var n;return e===((n=De(e))==null?void 0:n.body)?!1:U(o,{0(){return e.matches(rt)},1(){let l=e;for(;l!==null;){if(l.matches(rt))return!0;l=l.parentElement}return!1}})}var Qn=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Qn||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Xn(e,o=n=>n){return e.slice().sort((n,l)=>{let r=o(n),a=o(l);if(r===null||a===null)return 0;let i=r.compareDocumentPosition(a);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Kn(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function eo(){return/Android/gi.test(window.navigator.userAgent)}function st(){return Kn()||eo()}function ve(e,o,n){Re.isServer||t.watchEffect(l=>{document.addEventListener(e,o,n),l(()=>document.removeEventListener(e,o,n))})}function to(e,o,n){Re.isServer||t.watchEffect(l=>{window.addEventListener(e,o,n),l(()=>window.removeEventListener(e,o,n))})}function no(e,o,n=t.computed(()=>!0)){function l(a,i){if(!n.value||a.defaultPrevented)return;let s=i(a);if(s===null||!s.getRootNode().contains(s))return;let c=function d(u){return typeof u=="function"?d(u()):Array.isArray(u)||u instanceof Set?u:[u]}(e);for(let d of c){if(d===null)continue;let u=d instanceof HTMLElement?d:N(d);if(u!=null&&u.contains(s)||a.composed&&a.composedPath().includes(u))return}return!Yn(s,at.Loose)&&s.tabIndex!==-1&&a.preventDefault(),o(a,s)}let r=t.ref(null);ve("pointerdown",a=>{var i,s;n.value&&(r.value=((s=(i=a.composedPath)==null?void 0:i.call(a))==null?void 0:s[0])||a.target)},!0),ve("mousedown",a=>{var i,s;n.value&&(r.value=((s=(i=a.composedPath)==null?void 0:i.call(a))==null?void 0:s[0])||a.target)},!0),ve("click",a=>{st()||r.value&&(l(a,()=>r.value),r.value=null)},!0),ve("touchend",a=>l(a,()=>a.target instanceof HTMLElement?a.target:null),!0),to("blur",a=>l(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function it(e,o){if(e)return e;let n=o??"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function oo(e,o){let n=t.ref(it(e.value.type,e.value.as));return t.onMounted(()=>{n.value=it(e.value.type,e.value.as)}),t.watchEffect(()=>{var l;n.value||N(o)&&N(o)instanceof HTMLButtonElement&&!((l=N(o))!=null&&l.hasAttribute("type"))&&(n.value="button")}),n}function ct(e){return[e.screenX,e.screenY]}function lo(){let e=t.ref([-1,-1]);return{wasMoved(o){let n=ct(o);return e.value[0]===n[0]&&e.value[1]===n[1]?!1:(e.value=n,!0)},update(o){e.value=ct(o)}}}function ro({container:e,accept:o,walk:n,enabled:l}){t.watchEffect(()=>{let r=e.value;if(!r||l!==void 0&&!l.value)return;let a=De(e);if(!a)return;let i=Object.assign(c=>o(c),{acceptNode:o}),s=a.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,i,!1);for(;s.nextNode();)n(s.currentNode)})}var de=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(de||{}),ao=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ao||{});function Q({visible:e=!0,features:o=0,ourProps:n,theirProps:l,...r}){var a;let i=ut(l,n),s=Object.assign(r,{props:i});if(e||o&2&&i.static)return Pe(s);if(o&1){let c=(a=i.unmount)==null||a?0:1;return U(c,{0(){return null},1(){return Pe({...r,props:{...i,hidden:!0,style:{display:"none"}}})}})}return Pe(s)}function Pe({props:e,attrs:o,slots:n,slot:l,name:r}){var a,i;let{as:s,...c}=ye(e,["unmount","static"]),d=(a=n.default)==null?void 0:a.call(n,l),u={};if(l){let f=!1,C=[];for(let[h,b]of Object.entries(l))typeof b=="boolean"&&(f=!0),b===!0&&C.push(h);f&&(u["data-headlessui-state"]=C.join(" "))}if(s==="template"){if(d=dt(d??[]),Object.keys(c).length>0||Object.keys(o).length>0){let[f,...C]=d??[];if(!io(f)||C.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${r} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(c).concat(Object.keys(o)).map(g=>g.trim()).filter((g,S,k)=>k.indexOf(g)===S).sort((g,S)=>g.localeCompare(S)).map(g=>` - ${g}`).join(`
|
|
5
5
|
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map(g=>` - ${g}`).join(`
|
|
6
6
|
`)].join(`
|
|
7
|
-
`));let h=ut((i=f.props)!=null?i:{},c,u),b=t.cloneVNode(f,h,!0);for(let g in h)g.startsWith("on")&&(b.props||(b.props={}),b.props[g]=h[g]);return b}return Array.isArray(d)&&d.length===1?d[0]:d}return t.h(s,Object.assign({},c,u),{default:()=>d})}function dt(e){return e.flatMap(o=>o.type===t.Fragment?dt(o.children):[o])}function ut(...e){if(e.length===0)return{};if(e.length===1)return e[0];let o={},n={};for(let l of e)for(let r in l)r.startsWith("on")&&typeof l[r]=="function"?(n[r]!=null||(n[r]=[]),n[r].push(l[r])):o[r]=l[r];if(o.disabled||o["aria-disabled"])return Object.assign(o,Object.fromEntries(Object.keys(n).map(l=>[l,void 0])));for(let l in n)Object.assign(o,{[l](r,...a){let i=n[l];for(let s of i){if(r instanceof Event&&r.defaultPrevented)return;s(r,...a)}}});return o}function ro(e){let o=Object.assign({},e);for(let n in o)o[n]===void 0&&delete o[n];return o}function ye(e,o=[]){let n=Object.assign({},e);for(let l of o)l in n&&delete n[l];return n}function ao(e){return e==null?!1:typeof e.type=="string"||typeof e.type=="object"||typeof e.type=="function"}var ft=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(ft||{});let so=t.defineComponent({name:"Hidden",props:{as:{type:[Object,String],default:"div"},features:{type:Number,default:1}},setup(e,{slots:o,attrs:n}){return()=>{var l;let{features:r,...a}=e,i={"aria-hidden":(r&2)===2?!0:(l=a["aria-hidden"])!=null?l:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Q({ourProps:i,theirProps:a,slot:{},attrs:n,slots:o,name:"Hidden"})}}}),pt=Symbol("Context");var ue=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ue||{});function io(){return t.inject(pt,null)}function co(e){t.provide(pt,e)}var D=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(D||{}),mt=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(mt||{});function uo(e){function o(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",o))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",o),o())}let X=[];uo(()=>{function e(o){o.target instanceof HTMLElement&&o.target!==document.body&&X[0]!==o.target&&(X.unshift(o.target),X=X.filter(n=>n!=null&&n.isConnected),X.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function fo(e){throw new Error("Unexpected object: "+e)}var A=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(A||{});function ht(e,o){let n=o.resolveItems();if(n.length<=0)return null;let l=o.resolveActiveIndex(),r=l??-1;switch(e.focus){case 0:{for(let a=0;a<n.length;++a)if(!o.resolveDisabled(n[a],a,n))return a;return l}case 1:{r===-1&&(r=n.length);for(let a=r-1;a>=0;--a)if(!o.resolveDisabled(n[a],a,n))return a;return l}case 2:{for(let a=r+1;a<n.length;++a)if(!o.resolveDisabled(n[a],a,n))return a;return l}case 3:{for(let a=n.length-1;a>=0;--a)if(!o.resolveDisabled(n[a],a,n))return a;return l}case 4:{for(let a=0;a<n.length;++a)if(o.resolveId(n[a],a,n)===e.id)return a;return l}case 5:return null;default:fo(e)}}function gt(e={},o=null,n=[]){for(let[l,r]of Object.entries(e))Ct(n,bt(o,l),r);return n}function bt(e,o){return e?e+"["+o+"]":o}function Ct(e,o,n){if(Array.isArray(n))for(let[l,r]of n.entries())Ct(e,bt(o,l.toString()),r);else n instanceof Date?e.push([o,n.toISOString()]):typeof n=="boolean"?e.push([o,n?"1":"0"]):typeof n=="string"?e.push([o,n]):typeof n=="number"?e.push([o,`${n}`]):n==null?e.push([o,""]):gt(n,o,e)}function po(e,o){return e===o}var mo=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(mo||{}),ho=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(ho||{}),go=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(go||{});let xt=Symbol("ComboboxContext");function K(e){let o=t.inject(xt,null);if(o===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,K),n}return o}let vt=Symbol("VirtualContext"),bo=t.defineComponent({name:"VirtualProvider",setup(e,{slots:o}){let n=K("VirtualProvider"),l=t.computed(()=>{let s=N(n.optionsRef);if(!s)return{start:0,end:0};let c=window.getComputedStyle(s);return{start:parseFloat(c.paddingBlockStart||c.paddingTop),end:parseFloat(c.paddingBlockEnd||c.paddingBottom)}}),r=Mn(t.computed(()=>({scrollPaddingStart:l.value.start,scrollPaddingEnd:l.value.end,count:n.virtual.value.options.length,estimateSize(){return 40},getScrollElement(){return N(n.optionsRef)},overscan:12}))),a=t.computed(()=>{var s;return(s=n.virtual.value)==null?void 0:s.options}),i=t.ref(0);return t.watch([a],()=>{i.value+=1}),t.provide(vt,n.virtual.value?r:null),()=>[t.h("div",{style:{position:"relative",width:"100%",height:`${r.value.getTotalSize()}px`},ref:s=>{if(s){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||n.activationTrigger.value===0)return;n.activeOptionIndex.value!==null&&n.virtual.value.options.length>n.activeOptionIndex.value&&r.value.scrollToIndex(n.activeOptionIndex.value)}}},r.value.getVirtualItems().map(s=>t.cloneVNode(o.default({option:n.virtual.value.options[s.index],open:n.comboboxState.value===0})[0],{key:`${i.value}-${s.index}`,"data-index":s.index,"aria-setsize":n.virtual.value.options.length,"aria-posinset":s.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${s.start}px)`,overflowAnchor:"none"}})))]}}),Co=t.defineComponent({name:"Combobox",emits:{"update:modelValue":e=>!0},props:{as:{type:[Object,String],default:"template"},disabled:{type:[Boolean],default:!1},by:{type:[String,Function],nullable:!0,default:null},modelValue:{type:[Object,String,Number,Boolean],default:void 0},defaultValue:{type:[Object,String,Number,Boolean],default:void 0},form:{type:String,optional:!0},name:{type:String,optional:!0},nullable:{type:Boolean,default:!1},multiple:{type:[Boolean],default:!1},immediate:{type:[Boolean],default:!1},virtual:{type:Object,default:null}},inheritAttrs:!1,setup(e,{slots:o,attrs:n,emit:l}){let r=t.ref(1),a=t.ref(null),i=t.ref(null),s=t.ref(null),c=t.ref(null),d=t.ref({static:!1,hold:!1}),u=t.ref([]),f=t.ref(null),C=t.ref(2),h=t.ref(!1);function b(p=m=>m){let m=f.value!==null?u.value[f.value]:null,T=p(u.value.slice()),$=T.length>0&&T[0].dataRef.order.value!==null?T.sort((O,F)=>O.dataRef.order.value-F.dataRef.order.value):Yn(T,O=>N(O.dataRef.domRef)),L=m?$.indexOf(m):null;return L===-1&&(L=null),{options:$,activeOptionIndex:L}}let g=t.computed(()=>e.multiple?1:0),S=t.computed(()=>e.nullable),[k,v]=An(t.computed(()=>e.modelValue),p=>l("update:modelValue",p),t.computed(()=>e.defaultValue)),x=t.computed(()=>k.value===void 0?U(g.value,{1:[],0:void 0}):k.value),y=null,w=null;function V(p){return U(g.value,{0(){return v==null?void 0:v(p)},1:()=>{let m=t.toRaw(_.value.value).slice(),T=t.toRaw(p),$=m.findIndex(L=>_.compare(T,t.toRaw(L)));return $===-1?m.push(T):m.splice($,1),v==null?void 0:v(m)}})}let E=t.computed(()=>{});t.watch([E],([p],[m])=>{if(_.virtual.value&&p&&m&&f.value!==null){let T=p.indexOf(m[f.value]);T!==-1?f.value=T:f.value=null}});let _={comboboxState:r,value:x,mode:g,compare(p,m){if(typeof e.by=="string"){let T=e.by;return(p==null?void 0:p[T])===(m==null?void 0:m[T])}return e.by===null?po(p,m):e.by(p,m)},calculateIndex(p){return _.virtual.value?e.by===null?_.virtual.value.options.indexOf(p):_.virtual.value.options.findIndex(m=>_.compare(m,p)):u.value.findIndex(m=>_.compare(m.dataRef.value,p))},defaultValue:t.computed(()=>e.defaultValue),nullable:S,immediate:t.computed(()=>!1),virtual:t.computed(()=>null),inputRef:i,labelRef:a,buttonRef:s,optionsRef:c,disabled:t.computed(()=>e.disabled),options:u,change(p){v(p)},activeOptionIndex:t.computed(()=>{if(h.value&&f.value===null&&(_.virtual.value?_.virtual.value.options.length>0:u.value.length>0)){if(_.virtual.value){let m=_.virtual.value.options.findIndex(T=>{var $;return!(($=_.virtual.value)!=null&&$.disabled(T))});if(m!==-1)return m}let p=u.value.findIndex(m=>!m.dataRef.disabled);if(p!==-1)return p}return f.value}),activationTrigger:C,optionsPropsRef:d,closeCombobox(){h.value=!1,!e.disabled&&r.value!==1&&(r.value=1,f.value=null)},openCombobox(){if(h.value=!0,!e.disabled&&r.value!==0){if(_.value.value){let p=_.calculateIndex(_.value.value);p!==-1&&(f.value=p)}r.value=0}},setActivationTrigger(p){C.value=p},goToOption(p,m,T){h.value=!1,y!==null&&cancelAnimationFrame(y),y=requestAnimationFrame(()=>{if(e.disabled||c.value&&!d.value.static&&r.value===1)return;if(_.virtual.value){f.value=p===A.Specific?m:ht({focus:p},{resolveItems:()=>_.virtual.value.options,resolveActiveIndex:()=>{var O,F;return(F=(O=_.activeOptionIndex.value)!=null?O:_.virtual.value.options.findIndex(j=>{var M;return!((M=_.virtual.value)!=null&&M.disabled(j))}))!=null?F:null},resolveDisabled:O=>_.virtual.value.disabled(O),resolveId(){throw new Error("Function not implemented.")}}),C.value=T??2;return}let $=b();if($.activeOptionIndex===null){let O=$.options.findIndex(F=>!F.dataRef.disabled);O!==-1&&($.activeOptionIndex=O)}let L=p===A.Specific?m:ht({focus:p},{resolveItems:()=>$.options,resolveActiveIndex:()=>$.activeOptionIndex,resolveId:O=>O.id,resolveDisabled:O=>O.dataRef.disabled});f.value=L,C.value=T??2,u.value=$.options})},selectOption(p){let m=u.value.find($=>$.id===p);if(!m)return;let{dataRef:T}=m;V(T.value)},selectActiveOption(){if(_.activeOptionIndex.value!==null){if(_.virtual.value)V(_.virtual.value.options[_.activeOptionIndex.value]);else{let{dataRef:p}=u.value[_.activeOptionIndex.value];V(p.value)}_.goToOption(A.Specific,_.activeOptionIndex.value)}},registerOption(p,m){let T=t.reactive({id:p,dataRef:m});if(_.virtual.value){u.value.push(T);return}w&&cancelAnimationFrame(w);let $=b(L=>(L.push(T),L));f.value===null&&_.isSelected(m.value.value)&&($.activeOptionIndex=$.options.indexOf(T)),u.value=$.options,f.value=$.activeOptionIndex,C.value=2,$.options.some(L=>!N(L.dataRef.domRef))&&(w=requestAnimationFrame(()=>{let L=b();u.value=L.options,f.value=L.activeOptionIndex}))},unregisterOption(p,m){if(y!==null&&cancelAnimationFrame(y),m&&(h.value=!0),_.virtual.value){u.value=u.value.filter($=>$.id!==p);return}let T=b($=>{let L=$.findIndex(O=>O.id===p);return L!==-1&&$.splice(L,1),$});u.value=T.options,f.value=T.activeOptionIndex,C.value=2},isSelected(p){return U(g.value,{0:()=>_.compare(t.toRaw(_.value.value),t.toRaw(p)),1:()=>t.toRaw(_.value.value).some(m=>_.compare(t.toRaw(m),t.toRaw(p)))})},isActive(p){return f.value===_.calculateIndex(p)}};eo([i,s,c],()=>_.closeCombobox(),t.computed(()=>r.value===0)),t.provide(xt,_),co(t.computed(()=>U(r.value,{0:ue.Open,1:ue.Closed})));let B=t.computed(()=>{var p;return(p=N(i))==null?void 0:p.closest("form")});return t.onMounted(()=>{t.watch([B],()=>{if(!B.value||e.defaultValue===void 0)return;function p(){_.change(e.defaultValue)}return B.value.addEventListener("reset",p),()=>{var m;(m=B.value)==null||m.removeEventListener("reset",p)}},{immediate:!0})}),()=>{var p,m,T;let{name:$,disabled:L,form:O,...F}=e,j={open:r.value===0,disabled:L,activeIndex:_.activeOptionIndex.value,activeOption:_.activeOptionIndex.value===null?null:_.virtual.value?_.virtual.value.options[(p=_.activeOptionIndex.value)!=null?p:0]:(T=(m=_.options.value[_.activeOptionIndex.value])==null?void 0:m.dataRef.value)!=null?T:null,value:x.value};return t.h(t.Fragment,[...$!=null&&x.value!=null?gt({[$]:x.value}).map(([M,us])=>t.h(so,ro({features:ft.Hidden,key:M,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:O,disabled:L,name:M,value:us}))):[],Q({theirProps:{...n,...ye(F,["by","defaultValue","immediate","modelValue","multiple","nullable","onUpdate:modelValue","virtual"])},ourProps:{},slot:j,slots:o,attrs:n,name:"Combobox"})])}}});t.defineComponent({name:"ComboboxLabel",props:{as:{type:[Object,String],default:"label"},id:{type:String,default:null}},setup(e,{attrs:o,slots:n}){var l;let r=(l=e.id)!=null?l:`headlessui-combobox-label-${ce()}`,a=K("ComboboxLabel");function i(){var s;(s=N(a.inputRef))==null||s.focus({preventScroll:!0})}return()=>{let s={open:a.comboboxState.value===0,disabled:a.disabled.value},{...c}=e,d={id:r,ref:a.labelRef,onClick:i};return Q({ourProps:d,theirProps:c,slot:s,attrs:o,slots:n,name:"ComboboxLabel"})}}});let xo=t.defineComponent({name:"ComboboxButton",props:{as:{type:[Object,String],default:"button"},id:{type:String,default:null}},setup(e,{attrs:o,slots:n,expose:l}){var r;let a=(r=e.id)!=null?r:`headlessui-combobox-button-${ce()}`,i=K("ComboboxButton");l({el:i.buttonRef,$el:i.buttonRef});function s(u){i.disabled.value||(i.comboboxState.value===0?i.closeCombobox():(u.preventDefault(),i.openCombobox()),t.nextTick(()=>{var f;return(f=N(i.inputRef))==null?void 0:f.focus({preventScroll:!0})}))}function c(u){switch(u.key){case D.ArrowDown:u.preventDefault(),u.stopPropagation(),i.comboboxState.value===1&&i.openCombobox(),t.nextTick(()=>{var f;return(f=i.inputRef.value)==null?void 0:f.focus({preventScroll:!0})});return;case D.ArrowUp:u.preventDefault(),u.stopPropagation(),i.comboboxState.value===1&&(i.openCombobox(),t.nextTick(()=>{i.value.value||i.goToOption(A.Last)})),t.nextTick(()=>{var f;return(f=i.inputRef.value)==null?void 0:f.focus({preventScroll:!0})});return;case D.Escape:if(i.comboboxState.value!==0)return;u.preventDefault(),i.optionsRef.value&&!i.optionsPropsRef.value.static&&u.stopPropagation(),i.closeCombobox(),t.nextTick(()=>{var f;return(f=i.inputRef.value)==null?void 0:f.focus({preventScroll:!0})});return}}let d=to(t.computed(()=>({as:e.as,type:o.type})),i.buttonRef);return()=>{var u,f;let C={open:i.comboboxState.value===0,disabled:i.disabled.value,value:i.value.value},{...h}=e,b={ref:i.buttonRef,id:a,type:d.value,tabindex:"-1","aria-haspopup":"listbox","aria-controls":(u=N(i.optionsRef))==null?void 0:u.id,"aria-expanded":i.comboboxState.value===0,"aria-labelledby":i.labelRef.value?[(f=N(i.labelRef))==null?void 0:f.id,a].join(" "):void 0,disabled:i.disabled.value===!0?!0:void 0,onKeydown:c,onClick:s};return Q({ourProps:b,theirProps:h,slot:C,attrs:o,slots:n,name:"ComboboxButton"})}}}),vo=t.defineComponent({name:"ComboboxInput",props:{as:{type:[Object,String],default:"input"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},displayValue:{type:Function},defaultValue:{type:String,default:void 0},id:{type:String,default:null}},emits:{change:e=>!0},setup(e,{emit:o,attrs:n,slots:l,expose:r}){var a;let i=(a=e.id)!=null?a:`headlessui-combobox-input-${ce()}`,s=K("ComboboxInput"),c=t.computed(()=>De(N(s.inputRef))),d={value:!1};r({el:s.inputRef,$el:s.inputRef});function u(){s.change(null);let w=N(s.optionsRef);w&&(w.scrollTop=0),s.goToOption(A.Nothing)}let f=t.computed(()=>{var w;let V=s.value.value;return N(s.inputRef)?typeof e.displayValue<"u"&&V!==void 0?(w=e.displayValue(V))!=null?w:"":typeof V=="string"?V:"":""});t.onMounted(()=>{t.watch([f,s.comboboxState,c],([w,V],[E,_])=>{if(d.value)return;let B=N(s.inputRef);B&&((_===0&&V===1||w!==E)&&(B.value=w),requestAnimationFrame(()=>{var p;if(d.value||!B||((p=c.value)==null?void 0:p.activeElement)!==B)return;let{selectionStart:m,selectionEnd:T}=B;Math.abs((T??0)-(m??0))===0&&m===0&&B.setSelectionRange(B.value.length,B.value.length)}))},{immediate:!0}),t.watch([s.comboboxState],([w],[V])=>{if(w===0&&V===1){if(d.value)return;let E=N(s.inputRef);if(!E)return;let _=E.value,{selectionStart:B,selectionEnd:p,selectionDirection:m}=E;E.value="",E.value=_,m!==null?E.setSelectionRange(B,p,m):E.setSelectionRange(B,p)}})});let C=t.ref(!1);function h(){C.value=!0}function b(){xe().nextFrame(()=>{C.value=!1})}let g=Pn();function S(w){switch(d.value=!0,g(()=>{d.value=!1}),w.key){case D.Enter:if(d.value=!1,s.comboboxState.value!==0||C.value)return;if(w.preventDefault(),w.stopPropagation(),s.activeOptionIndex.value===null){s.closeCombobox();return}s.selectActiveOption(),s.mode.value===0&&s.closeCombobox();break;case D.ArrowDown:return d.value=!1,w.preventDefault(),w.stopPropagation(),U(s.comboboxState.value,{0:()=>s.goToOption(A.Next),1:()=>s.openCombobox()});case D.ArrowUp:return d.value=!1,w.preventDefault(),w.stopPropagation(),U(s.comboboxState.value,{0:()=>s.goToOption(A.Previous),1:()=>{s.openCombobox(),t.nextTick(()=>{s.value.value||s.goToOption(A.Last)})}});case D.Home:if(w.shiftKey)break;return d.value=!1,w.preventDefault(),w.stopPropagation(),s.goToOption(A.First);case D.PageUp:return d.value=!1,w.preventDefault(),w.stopPropagation(),s.goToOption(A.First);case D.End:if(w.shiftKey)break;return d.value=!1,w.preventDefault(),w.stopPropagation(),s.goToOption(A.Last);case D.PageDown:return d.value=!1,w.preventDefault(),w.stopPropagation(),s.goToOption(A.Last);case D.Escape:if(d.value=!1,s.comboboxState.value!==0)return;w.preventDefault(),s.optionsRef.value&&!s.optionsPropsRef.value.static&&w.stopPropagation(),s.nullable.value&&s.mode.value===0&&s.value.value===null&&u(),s.closeCombobox();break;case D.Tab:if(d.value=!1,s.comboboxState.value!==0)return;s.mode.value===0&&s.activationTrigger.value!==1&&s.selectActiveOption(),s.closeCombobox();break}}function k(w){o("change",w),s.nullable.value&&s.mode.value===0&&w.target.value===""&&u(),s.openCombobox()}function v(w){var V,E,_;let B=(V=w.relatedTarget)!=null?V:X.find(p=>p!==w.currentTarget);if(d.value=!1,!((E=N(s.optionsRef))!=null&&E.contains(B))&&!((_=N(s.buttonRef))!=null&&_.contains(B))&&s.comboboxState.value===0)return w.preventDefault(),s.mode.value===0&&(s.nullable.value&&s.value.value===null?u():s.activationTrigger.value!==1&&s.selectActiveOption()),s.closeCombobox()}function x(w){var V,E,_;let B=(V=w.relatedTarget)!=null?V:X.find(p=>p!==w.currentTarget);(E=N(s.buttonRef))!=null&&E.contains(B)||(_=N(s.optionsRef))!=null&&_.contains(B)||s.disabled.value||s.immediate.value&&s.comboboxState.value!==0&&(s.openCombobox(),xe().nextFrame(()=>{s.setActivationTrigger(1)}))}let y=t.computed(()=>{var w,V,E,_;return(_=(E=(V=e.defaultValue)!=null?V:s.defaultValue.value!==void 0?(w=e.displayValue)==null?void 0:w.call(e,s.defaultValue.value):null)!=null?E:s.defaultValue.value)!=null?_:""});return()=>{var w,V,E,_,B,p,m;let T={open:s.comboboxState.value===0},{displayValue:$,onChange:L,...O}=e,F={"aria-controls":(w=s.optionsRef.value)==null?void 0:w.id,"aria-expanded":s.comboboxState.value===0,"aria-activedescendant":s.activeOptionIndex.value===null?void 0:s.virtual.value?(V=s.options.value.find(j=>!s.virtual.value.disabled(j.dataRef.value)&&s.compare(j.dataRef.value,s.virtual.value.options[s.activeOptionIndex.value])))==null?void 0:V.id:(E=s.options.value[s.activeOptionIndex.value])==null?void 0:E.id,"aria-labelledby":(p=(_=N(s.labelRef))==null?void 0:_.id)!=null?p:(B=N(s.buttonRef))==null?void 0:B.id,"aria-autocomplete":"list",id:i,onCompositionstart:h,onCompositionend:b,onKeydown:S,onInput:k,onFocus:x,onBlur:v,role:"combobox",type:(m=n.type)!=null?m:"text",tabIndex:0,ref:s.inputRef,defaultValue:y.value,disabled:s.disabled.value===!0?!0:void 0};return Q({ourProps:F,theirProps:O,slot:T,attrs:n,slots:l,features:de.RenderStrategy|de.Static,name:"ComboboxInput"})}}}),yo=t.defineComponent({name:"ComboboxOptions",props:{as:{type:[Object,String],default:"ul"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},hold:{type:[Boolean],default:!1}},setup(e,{attrs:o,slots:n,expose:l}){let r=K("ComboboxOptions"),a=`headlessui-combobox-options-${ce()}`;l({el:r.optionsRef,$el:r.optionsRef}),t.watchEffect(()=>{r.optionsPropsRef.value.static=e.static}),t.watchEffect(()=>{r.optionsPropsRef.value.hold=e.hold});let i=io(),s=t.computed(()=>i!==null?(i.value&ue.Open)===ue.Open:r.comboboxState.value===0);oo({container:t.computed(()=>N(r.optionsRef)),enabled:t.computed(()=>r.comboboxState.value===0),accept(d){return d.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:d.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(d){d.setAttribute("role","none")}});function c(d){d.preventDefault()}return()=>{var d,u,f;let C={open:r.comboboxState.value===0},h={"aria-labelledby":(f=(d=N(r.labelRef))==null?void 0:d.id)!=null?f:(u=N(r.buttonRef))==null?void 0:u.id,id:a,ref:r.optionsRef,role:"listbox","aria-multiselectable":r.mode.value===1?!0:void 0,onMousedown:c},b=ye(e,["hold"]);return Q({ourProps:h,theirProps:b,slot:C,attrs:o,slots:r.virtual.value&&r.comboboxState.value===0?{...n,default:()=>[t.h(bo,{},n.default)]}:n,features:de.RenderStrategy|de.Static,visible:s.value,name:"ComboboxOptions"})}}}),wo=t.defineComponent({name:"ComboboxOption",props:{as:{type:[Object,String],default:"li"},value:{type:[Object,String,Number,Boolean]},disabled:{type:Boolean,default:!1},order:{type:[Number],default:null}},setup(e,{slots:o,attrs:n,expose:l}){let r=K("ComboboxOption"),a=`headlessui-combobox-option-${ce()}`,i=t.ref(null),s=t.computed(()=>e.disabled);l({el:i,$el:i});let c=t.computed(()=>{var v;return r.virtual.value?r.activeOptionIndex.value===r.calculateIndex(e.value):r.activeOptionIndex.value===null?!1:((v=r.options.value[r.activeOptionIndex.value])==null?void 0:v.id)===a}),d=t.computed(()=>r.isSelected(e.value)),u=t.inject(vt,null),f=t.computed(()=>({disabled:e.disabled,value:e.value,domRef:i,order:t.computed(()=>e.order)}));t.onMounted(()=>r.registerOption(a,f)),t.onUnmounted(()=>r.unregisterOption(a,c.value)),t.watchEffect(()=>{let v=N(i);v&&(u==null||u.value.measureElement(v))}),t.watchEffect(()=>{r.comboboxState.value===0&&c.value&&(r.virtual.value||r.activationTrigger.value!==0&&t.nextTick(()=>{var v,x;return(x=(v=N(i))==null?void 0:v.scrollIntoView)==null?void 0:x.call(v,{block:"nearest"})}))});function C(v){v.preventDefault(),v.button===mt.Left&&(s.value||(r.selectOption(a),st()||requestAnimationFrame(()=>{var x;return(x=N(r.inputRef))==null?void 0:x.focus({preventScroll:!0})}),r.mode.value===0&&r.closeCombobox()))}function h(){var v;if(e.disabled||(v=r.virtual.value)!=null&&v.disabled(e.value))return r.goToOption(A.Nothing);let x=r.calculateIndex(e.value);r.goToOption(A.Specific,x)}let b=no();function g(v){b.update(v)}function S(v){var x;if(!b.wasMoved(v)||e.disabled||(x=r.virtual.value)!=null&&x.disabled(e.value)||c.value)return;let y=r.calculateIndex(e.value);r.goToOption(A.Specific,y,0)}function k(v){var x;b.wasMoved(v)&&(e.disabled||(x=r.virtual.value)!=null&&x.disabled(e.value)||c.value&&(r.optionsPropsRef.value.hold||r.goToOption(A.Nothing)))}return()=>{let{disabled:v}=e,x={active:c.value,selected:d.value,disabled:v},y={id:a,ref:i,role:"option",tabIndex:v===!0?void 0:-1,"aria-disabled":v===!0?!0:void 0,"aria-selected":d.value,disabled:void 0,onMousedown:C,onFocus:h,onPointerenter:g,onMouseenter:g,onPointermove:S,onMousemove:S,onPointerleave:k,onMouseleave:k},w=ye(e,["order","value"]);return Q({ourProps:y,theirProps:w,slot:x,attrs:n,slots:o,name:"ComboboxOption"})}}});function Eo(e,o){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"})])}function _o(e,o){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z","clip-rule":"evenodd"})])}function ko(e,o){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.47 6.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 1 1-1.06 1.06L10 8.06l-3.72 3.72a.75.75 0 0 1-1.06-1.06l4.25-4.25Z","clip-rule":"evenodd"})])}function we(e,o,n){return Array.isArray(e)?(e.length=Math.max(e.length,o),e.splice(o,1,n),n):(e[o]=n,n)}function Fe(e,o){if(Array.isArray(e)){e.splice(o,1);return}delete e[o]}function So(){return yt().__VUE_DEVTOOLS_GLOBAL_HOOK__}function yt(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const To=typeof Proxy=="function",$o="devtools-plugin:setup",Vo="plugin:settings:set";let oe,je;function Bo(){var e;return oe!==void 0||(typeof window<"u"&&window.performance?(oe=!0,je=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(oe=!0,je=globalThis.perf_hooks.performance):oe=!1),oe}function No(){return Bo()?je.now():Date.now()}class Lo{constructor(o,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=o,this.hook=n;const l={};if(o.settings)for(const i in o.settings){const s=o.settings[i];l[i]=s.defaultValue}const r=`__vue-devtools-plugin-settings__${o.id}`;let a=Object.assign({},l);try{const i=localStorage.getItem(r),s=JSON.parse(i);Object.assign(a,s)}catch{}this.fallbacks={getSettings(){return a},setSettings(i){try{localStorage.setItem(r,JSON.stringify(i))}catch{}a=i},now(){return No()}},n&&n.on(Vo,(i,s)=>{i===this.plugin.id&&this.fallbacks.setSettings(s)}),this.proxiedOn=new Proxy({},{get:(i,s)=>this.target?this.target.on[s]:(...c)=>{this.onQueue.push({method:s,args:c})}}),this.proxiedTarget=new Proxy({},{get:(i,s)=>this.target?this.target[s]:s==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(s)?(...c)=>(this.targetQueue.push({method:s,args:c,resolve:()=>{}}),this.fallbacks[s](...c)):(...c)=>new Promise(d=>{this.targetQueue.push({method:s,args:c,resolve:d})})})}async setRealTarget(o){this.target=o;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function wt(e,o){const n=e,l=yt(),r=So(),a=To&&n.enableEarlyProxy;if(r&&(l.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!a))r.emit($o,e,o);else{const i=a?new Lo(n,r):null;(l.__VUE_DEVTOOLS_PLUGINS__=l.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:o,proxy:i}),i&&o(i.proxiedTarget)}}/*!
|
|
7
|
+
`));let h=ut((i=f.props)!=null?i:{},c,u),b=t.cloneVNode(f,h,!0);for(let g in h)g.startsWith("on")&&(b.props||(b.props={}),b.props[g]=h[g]);return b}return Array.isArray(d)&&d.length===1?d[0]:d}return t.h(s,Object.assign({},c,u),{default:()=>d})}function dt(e){return e.flatMap(o=>o.type===t.Fragment?dt(o.children):[o])}function ut(...e){if(e.length===0)return{};if(e.length===1)return e[0];let o={},n={};for(let l of e)for(let r in l)r.startsWith("on")&&typeof l[r]=="function"?(n[r]!=null||(n[r]=[]),n[r].push(l[r])):o[r]=l[r];if(o.disabled||o["aria-disabled"])return Object.assign(o,Object.fromEntries(Object.keys(n).map(l=>[l,void 0])));for(let l in n)Object.assign(o,{[l](r,...a){let i=n[l];for(let s of i){if(r instanceof Event&&r.defaultPrevented)return;s(r,...a)}}});return o}function so(e){let o=Object.assign({},e);for(let n in o)o[n]===void 0&&delete o[n];return o}function ye(e,o=[]){let n=Object.assign({},e);for(let l of o)l in n&&delete n[l];return n}function io(e){return e==null?!1:typeof e.type=="string"||typeof e.type=="object"||typeof e.type=="function"}var ft=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(ft||{});let co=t.defineComponent({name:"Hidden",props:{as:{type:[Object,String],default:"div"},features:{type:Number,default:1}},setup(e,{slots:o,attrs:n}){return()=>{var l;let{features:r,...a}=e,i={"aria-hidden":(r&2)===2?!0:(l=a["aria-hidden"])!=null?l:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Q({ourProps:i,theirProps:a,slot:{},attrs:n,slots:o,name:"Hidden"})}}}),pt=Symbol("Context");var ue=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ue||{});function uo(){return t.inject(pt,null)}function fo(e){t.provide(pt,e)}var D=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(D||{}),mt=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(mt||{});function po(e){function o(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",o))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",o),o())}let X=[];po(()=>{function e(o){o.target instanceof HTMLElement&&o.target!==document.body&&X[0]!==o.target&&(X.unshift(o.target),X=X.filter(n=>n!=null&&n.isConnected),X.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function mo(e){throw new Error("Unexpected object: "+e)}var A=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(A||{});function ht(e,o){let n=o.resolveItems();if(n.length<=0)return null;let l=o.resolveActiveIndex(),r=l??-1;switch(e.focus){case 0:{for(let a=0;a<n.length;++a)if(!o.resolveDisabled(n[a],a,n))return a;return l}case 1:{r===-1&&(r=n.length);for(let a=r-1;a>=0;--a)if(!o.resolveDisabled(n[a],a,n))return a;return l}case 2:{for(let a=r+1;a<n.length;++a)if(!o.resolveDisabled(n[a],a,n))return a;return l}case 3:{for(let a=n.length-1;a>=0;--a)if(!o.resolveDisabled(n[a],a,n))return a;return l}case 4:{for(let a=0;a<n.length;++a)if(o.resolveId(n[a],a,n)===e.id)return a;return l}case 5:return null;default:mo(e)}}function gt(e={},o=null,n=[]){for(let[l,r]of Object.entries(e))Ct(n,bt(o,l),r);return n}function bt(e,o){return e?e+"["+o+"]":o}function Ct(e,o,n){if(Array.isArray(n))for(let[l,r]of n.entries())Ct(e,bt(o,l.toString()),r);else n instanceof Date?e.push([o,n.toISOString()]):typeof n=="boolean"?e.push([o,n?"1":"0"]):typeof n=="string"?e.push([o,n]):typeof n=="number"?e.push([o,`${n}`]):n==null?e.push([o,""]):gt(n,o,e)}function ho(e,o){return e===o}var go=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(go||{}),bo=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(bo||{}),Co=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(Co||{});let xt=Symbol("ComboboxContext");function K(e){let o=t.inject(xt,null);if(o===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,K),n}return o}let vt=Symbol("VirtualContext"),xo=t.defineComponent({name:"VirtualProvider",setup(e,{slots:o}){let n=K("VirtualProvider"),l=t.computed(()=>{let s=N(n.optionsRef);if(!s)return{start:0,end:0};let c=window.getComputedStyle(s);return{start:parseFloat(c.paddingBlockStart||c.paddingTop),end:parseFloat(c.paddingBlockEnd||c.paddingBottom)}}),r=Rn(t.computed(()=>({scrollPaddingStart:l.value.start,scrollPaddingEnd:l.value.end,count:n.virtual.value.options.length,estimateSize(){return 40},getScrollElement(){return N(n.optionsRef)},overscan:12}))),a=t.computed(()=>{var s;return(s=n.virtual.value)==null?void 0:s.options}),i=t.ref(0);return t.watch([a],()=>{i.value+=1}),t.provide(vt,n.virtual.value?r:null),()=>[t.h("div",{style:{position:"relative",width:"100%",height:`${r.value.getTotalSize()}px`},ref:s=>{if(s){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||n.activationTrigger.value===0)return;n.activeOptionIndex.value!==null&&n.virtual.value.options.length>n.activeOptionIndex.value&&r.value.scrollToIndex(n.activeOptionIndex.value)}}},r.value.getVirtualItems().map(s=>t.cloneVNode(o.default({option:n.virtual.value.options[s.index],open:n.comboboxState.value===0})[0],{key:`${i.value}-${s.index}`,"data-index":s.index,"aria-setsize":n.virtual.value.options.length,"aria-posinset":s.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${s.start}px)`,overflowAnchor:"none"}})))]}}),vo=t.defineComponent({name:"Combobox",emits:{"update:modelValue":e=>!0},props:{as:{type:[Object,String],default:"template"},disabled:{type:[Boolean],default:!1},by:{type:[String,Function],nullable:!0,default:null},modelValue:{type:[Object,String,Number,Boolean],default:void 0},defaultValue:{type:[Object,String,Number,Boolean],default:void 0},form:{type:String,optional:!0},name:{type:String,optional:!0},nullable:{type:Boolean,default:!1},multiple:{type:[Boolean],default:!1},immediate:{type:[Boolean],default:!1},virtual:{type:Object,default:null}},inheritAttrs:!1,setup(e,{slots:o,attrs:n,emit:l}){let r=t.ref(1),a=t.ref(null),i=t.ref(null),s=t.ref(null),c=t.ref(null),d=t.ref({static:!1,hold:!1}),u=t.ref([]),f=t.ref(null),C=t.ref(2),h=t.ref(!1);function b(p=m=>m){let m=f.value!==null?u.value[f.value]:null,T=p(u.value.slice()),$=T.length>0&&T[0].dataRef.order.value!==null?T.sort((O,F)=>O.dataRef.order.value-F.dataRef.order.value):Xn(T,O=>N(O.dataRef.domRef)),L=m?$.indexOf(m):null;return L===-1&&(L=null),{options:$,activeOptionIndex:L}}let g=t.computed(()=>e.multiple?1:0),S=t.computed(()=>e.nullable),[k,v]=Dn(t.computed(()=>e.modelValue),p=>l("update:modelValue",p),t.computed(()=>e.defaultValue)),x=t.computed(()=>k.value===void 0?U(g.value,{1:[],0:void 0}):k.value),y=null,w=null;function V(p){return U(g.value,{0(){return v==null?void 0:v(p)},1:()=>{let m=t.toRaw(_.value.value).slice(),T=t.toRaw(p),$=m.findIndex(L=>_.compare(T,t.toRaw(L)));return $===-1?m.push(T):m.splice($,1),v==null?void 0:v(m)}})}let E=t.computed(()=>{});t.watch([E],([p],[m])=>{if(_.virtual.value&&p&&m&&f.value!==null){let T=p.indexOf(m[f.value]);T!==-1?f.value=T:f.value=null}});let _={comboboxState:r,value:x,mode:g,compare(p,m){if(typeof e.by=="string"){let T=e.by;return(p==null?void 0:p[T])===(m==null?void 0:m[T])}return e.by===null?ho(p,m):e.by(p,m)},calculateIndex(p){return _.virtual.value?e.by===null?_.virtual.value.options.indexOf(p):_.virtual.value.options.findIndex(m=>_.compare(m,p)):u.value.findIndex(m=>_.compare(m.dataRef.value,p))},defaultValue:t.computed(()=>e.defaultValue),nullable:S,immediate:t.computed(()=>!1),virtual:t.computed(()=>null),inputRef:i,labelRef:a,buttonRef:s,optionsRef:c,disabled:t.computed(()=>e.disabled),options:u,change(p){v(p)},activeOptionIndex:t.computed(()=>{if(h.value&&f.value===null&&(_.virtual.value?_.virtual.value.options.length>0:u.value.length>0)){if(_.virtual.value){let m=_.virtual.value.options.findIndex(T=>{var $;return!(($=_.virtual.value)!=null&&$.disabled(T))});if(m!==-1)return m}let p=u.value.findIndex(m=>!m.dataRef.disabled);if(p!==-1)return p}return f.value}),activationTrigger:C,optionsPropsRef:d,closeCombobox(){h.value=!1,!e.disabled&&r.value!==1&&(r.value=1,f.value=null)},openCombobox(){if(h.value=!0,!e.disabled&&r.value!==0){if(_.value.value){let p=_.calculateIndex(_.value.value);p!==-1&&(f.value=p)}r.value=0}},setActivationTrigger(p){C.value=p},goToOption(p,m,T){h.value=!1,y!==null&&cancelAnimationFrame(y),y=requestAnimationFrame(()=>{if(e.disabled||c.value&&!d.value.static&&r.value===1)return;if(_.virtual.value){f.value=p===A.Specific?m:ht({focus:p},{resolveItems:()=>_.virtual.value.options,resolveActiveIndex:()=>{var O,F;return(F=(O=_.activeOptionIndex.value)!=null?O:_.virtual.value.options.findIndex(j=>{var M;return!((M=_.virtual.value)!=null&&M.disabled(j))}))!=null?F:null},resolveDisabled:O=>_.virtual.value.disabled(O),resolveId(){throw new Error("Function not implemented.")}}),C.value=T??2;return}let $=b();if($.activeOptionIndex===null){let O=$.options.findIndex(F=>!F.dataRef.disabled);O!==-1&&($.activeOptionIndex=O)}let L=p===A.Specific?m:ht({focus:p},{resolveItems:()=>$.options,resolveActiveIndex:()=>$.activeOptionIndex,resolveId:O=>O.id,resolveDisabled:O=>O.dataRef.disabled});f.value=L,C.value=T??2,u.value=$.options})},selectOption(p){let m=u.value.find($=>$.id===p);if(!m)return;let{dataRef:T}=m;V(T.value)},selectActiveOption(){if(_.activeOptionIndex.value!==null){if(_.virtual.value)V(_.virtual.value.options[_.activeOptionIndex.value]);else{let{dataRef:p}=u.value[_.activeOptionIndex.value];V(p.value)}_.goToOption(A.Specific,_.activeOptionIndex.value)}},registerOption(p,m){let T=t.reactive({id:p,dataRef:m});if(_.virtual.value){u.value.push(T);return}w&&cancelAnimationFrame(w);let $=b(L=>(L.push(T),L));f.value===null&&_.isSelected(m.value.value)&&($.activeOptionIndex=$.options.indexOf(T)),u.value=$.options,f.value=$.activeOptionIndex,C.value=2,$.options.some(L=>!N(L.dataRef.domRef))&&(w=requestAnimationFrame(()=>{let L=b();u.value=L.options,f.value=L.activeOptionIndex}))},unregisterOption(p,m){if(y!==null&&cancelAnimationFrame(y),m&&(h.value=!0),_.virtual.value){u.value=u.value.filter($=>$.id!==p);return}let T=b($=>{let L=$.findIndex(O=>O.id===p);return L!==-1&&$.splice(L,1),$});u.value=T.options,f.value=T.activeOptionIndex,C.value=2},isSelected(p){return U(g.value,{0:()=>_.compare(t.toRaw(_.value.value),t.toRaw(p)),1:()=>t.toRaw(_.value.value).some(m=>_.compare(t.toRaw(m),t.toRaw(p)))})},isActive(p){return f.value===_.calculateIndex(p)}};no([i,s,c],()=>_.closeCombobox(),t.computed(()=>r.value===0)),t.provide(xt,_),fo(t.computed(()=>U(r.value,{0:ue.Open,1:ue.Closed})));let B=t.computed(()=>{var p;return(p=N(i))==null?void 0:p.closest("form")});return t.onMounted(()=>{t.watch([B],()=>{if(!B.value||e.defaultValue===void 0)return;function p(){_.change(e.defaultValue)}return B.value.addEventListener("reset",p),()=>{var m;(m=B.value)==null||m.removeEventListener("reset",p)}},{immediate:!0})}),()=>{var p,m,T;let{name:$,disabled:L,form:O,...F}=e,j={open:r.value===0,disabled:L,activeIndex:_.activeOptionIndex.value,activeOption:_.activeOptionIndex.value===null?null:_.virtual.value?_.virtual.value.options[(p=_.activeOptionIndex.value)!=null?p:0]:(T=(m=_.options.value[_.activeOptionIndex.value])==null?void 0:m.dataRef.value)!=null?T:null,value:x.value};return t.h(t.Fragment,[...$!=null&&x.value!=null?gt({[$]:x.value}).map(([M,ps])=>t.h(co,so({features:ft.Hidden,key:M,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:O,disabled:L,name:M,value:ps}))):[],Q({theirProps:{...n,...ye(F,["by","defaultValue","immediate","modelValue","multiple","nullable","onUpdate:modelValue","virtual"])},ourProps:{},slot:j,slots:o,attrs:n,name:"Combobox"})])}}});t.defineComponent({name:"ComboboxLabel",props:{as:{type:[Object,String],default:"label"},id:{type:String,default:null}},setup(e,{attrs:o,slots:n}){var l;let r=(l=e.id)!=null?l:`headlessui-combobox-label-${ce()}`,a=K("ComboboxLabel");function i(){var s;(s=N(a.inputRef))==null||s.focus({preventScroll:!0})}return()=>{let s={open:a.comboboxState.value===0,disabled:a.disabled.value},{...c}=e,d={id:r,ref:a.labelRef,onClick:i};return Q({ourProps:d,theirProps:c,slot:s,attrs:o,slots:n,name:"ComboboxLabel"})}}});let yo=t.defineComponent({name:"ComboboxButton",props:{as:{type:[Object,String],default:"button"},id:{type:String,default:null}},setup(e,{attrs:o,slots:n,expose:l}){var r;let a=(r=e.id)!=null?r:`headlessui-combobox-button-${ce()}`,i=K("ComboboxButton");l({el:i.buttonRef,$el:i.buttonRef});function s(u){i.disabled.value||(i.comboboxState.value===0?i.closeCombobox():(u.preventDefault(),i.openCombobox()),t.nextTick(()=>{var f;return(f=N(i.inputRef))==null?void 0:f.focus({preventScroll:!0})}))}function c(u){switch(u.key){case D.ArrowDown:u.preventDefault(),u.stopPropagation(),i.comboboxState.value===1&&i.openCombobox(),t.nextTick(()=>{var f;return(f=i.inputRef.value)==null?void 0:f.focus({preventScroll:!0})});return;case D.ArrowUp:u.preventDefault(),u.stopPropagation(),i.comboboxState.value===1&&(i.openCombobox(),t.nextTick(()=>{i.value.value||i.goToOption(A.Last)})),t.nextTick(()=>{var f;return(f=i.inputRef.value)==null?void 0:f.focus({preventScroll:!0})});return;case D.Escape:if(i.comboboxState.value!==0)return;u.preventDefault(),i.optionsRef.value&&!i.optionsPropsRef.value.static&&u.stopPropagation(),i.closeCombobox(),t.nextTick(()=>{var f;return(f=i.inputRef.value)==null?void 0:f.focus({preventScroll:!0})});return}}let d=oo(t.computed(()=>({as:e.as,type:o.type})),i.buttonRef);return()=>{var u,f;let C={open:i.comboboxState.value===0,disabled:i.disabled.value,value:i.value.value},{...h}=e,b={ref:i.buttonRef,id:a,type:d.value,tabindex:"-1","aria-haspopup":"listbox","aria-controls":(u=N(i.optionsRef))==null?void 0:u.id,"aria-expanded":i.comboboxState.value===0,"aria-labelledby":i.labelRef.value?[(f=N(i.labelRef))==null?void 0:f.id,a].join(" "):void 0,disabled:i.disabled.value===!0?!0:void 0,onKeydown:c,onClick:s};return Q({ourProps:b,theirProps:h,slot:C,attrs:o,slots:n,name:"ComboboxButton"})}}}),wo=t.defineComponent({name:"ComboboxInput",props:{as:{type:[Object,String],default:"input"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},displayValue:{type:Function},defaultValue:{type:String,default:void 0},id:{type:String,default:null}},emits:{change:e=>!0},setup(e,{emit:o,attrs:n,slots:l,expose:r}){var a;let i=(a=e.id)!=null?a:`headlessui-combobox-input-${ce()}`,s=K("ComboboxInput"),c=t.computed(()=>De(N(s.inputRef))),d={value:!1};r({el:s.inputRef,$el:s.inputRef});function u(){s.change(null);let w=N(s.optionsRef);w&&(w.scrollTop=0),s.goToOption(A.Nothing)}let f=t.computed(()=>{var w;let V=s.value.value;return N(s.inputRef)?typeof e.displayValue<"u"&&V!==void 0?(w=e.displayValue(V))!=null?w:"":typeof V=="string"?V:"":""});t.onMounted(()=>{t.watch([f,s.comboboxState,c],([w,V],[E,_])=>{if(d.value)return;let B=N(s.inputRef);B&&((_===0&&V===1||w!==E)&&(B.value=w),requestAnimationFrame(()=>{var p;if(d.value||!B||((p=c.value)==null?void 0:p.activeElement)!==B)return;let{selectionStart:m,selectionEnd:T}=B;Math.abs((T??0)-(m??0))===0&&m===0&&B.setSelectionRange(B.value.length,B.value.length)}))},{immediate:!0}),t.watch([s.comboboxState],([w],[V])=>{if(w===0&&V===1){if(d.value)return;let E=N(s.inputRef);if(!E)return;let _=E.value,{selectionStart:B,selectionEnd:p,selectionDirection:m}=E;E.value="",E.value=_,m!==null?E.setSelectionRange(B,p,m):E.setSelectionRange(B,p)}})});let C=t.ref(!1);function h(){C.value=!0}function b(){xe().nextFrame(()=>{C.value=!1})}let g=jn();function S(w){switch(d.value=!0,g(()=>{d.value=!1}),w.key){case D.Enter:if(d.value=!1,s.comboboxState.value!==0||C.value)return;if(w.preventDefault(),w.stopPropagation(),s.activeOptionIndex.value===null){s.closeCombobox();return}s.selectActiveOption(),s.mode.value===0&&s.closeCombobox();break;case D.ArrowDown:return d.value=!1,w.preventDefault(),w.stopPropagation(),U(s.comboboxState.value,{0:()=>s.goToOption(A.Next),1:()=>s.openCombobox()});case D.ArrowUp:return d.value=!1,w.preventDefault(),w.stopPropagation(),U(s.comboboxState.value,{0:()=>s.goToOption(A.Previous),1:()=>{s.openCombobox(),t.nextTick(()=>{s.value.value||s.goToOption(A.Last)})}});case D.Home:if(w.shiftKey)break;return d.value=!1,w.preventDefault(),w.stopPropagation(),s.goToOption(A.First);case D.PageUp:return d.value=!1,w.preventDefault(),w.stopPropagation(),s.goToOption(A.First);case D.End:if(w.shiftKey)break;return d.value=!1,w.preventDefault(),w.stopPropagation(),s.goToOption(A.Last);case D.PageDown:return d.value=!1,w.preventDefault(),w.stopPropagation(),s.goToOption(A.Last);case D.Escape:if(d.value=!1,s.comboboxState.value!==0)return;w.preventDefault(),s.optionsRef.value&&!s.optionsPropsRef.value.static&&w.stopPropagation(),s.nullable.value&&s.mode.value===0&&s.value.value===null&&u(),s.closeCombobox();break;case D.Tab:if(d.value=!1,s.comboboxState.value!==0)return;s.mode.value===0&&s.activationTrigger.value!==1&&s.selectActiveOption(),s.closeCombobox();break}}function k(w){o("change",w),s.nullable.value&&s.mode.value===0&&w.target.value===""&&u(),s.openCombobox()}function v(w){var V,E,_;let B=(V=w.relatedTarget)!=null?V:X.find(p=>p!==w.currentTarget);if(d.value=!1,!((E=N(s.optionsRef))!=null&&E.contains(B))&&!((_=N(s.buttonRef))!=null&&_.contains(B))&&s.comboboxState.value===0)return w.preventDefault(),s.mode.value===0&&(s.nullable.value&&s.value.value===null?u():s.activationTrigger.value!==1&&s.selectActiveOption()),s.closeCombobox()}function x(w){var V,E,_;let B=(V=w.relatedTarget)!=null?V:X.find(p=>p!==w.currentTarget);(E=N(s.buttonRef))!=null&&E.contains(B)||(_=N(s.optionsRef))!=null&&_.contains(B)||s.disabled.value||s.immediate.value&&s.comboboxState.value!==0&&(s.openCombobox(),xe().nextFrame(()=>{s.setActivationTrigger(1)}))}let y=t.computed(()=>{var w,V,E,_;return(_=(E=(V=e.defaultValue)!=null?V:s.defaultValue.value!==void 0?(w=e.displayValue)==null?void 0:w.call(e,s.defaultValue.value):null)!=null?E:s.defaultValue.value)!=null?_:""});return()=>{var w,V,E,_,B,p,m;let T={open:s.comboboxState.value===0},{displayValue:$,onChange:L,...O}=e,F={"aria-controls":(w=s.optionsRef.value)==null?void 0:w.id,"aria-expanded":s.comboboxState.value===0,"aria-activedescendant":s.activeOptionIndex.value===null?void 0:s.virtual.value?(V=s.options.value.find(j=>!s.virtual.value.disabled(j.dataRef.value)&&s.compare(j.dataRef.value,s.virtual.value.options[s.activeOptionIndex.value])))==null?void 0:V.id:(E=s.options.value[s.activeOptionIndex.value])==null?void 0:E.id,"aria-labelledby":(p=(_=N(s.labelRef))==null?void 0:_.id)!=null?p:(B=N(s.buttonRef))==null?void 0:B.id,"aria-autocomplete":"list",id:i,onCompositionstart:h,onCompositionend:b,onKeydown:S,onInput:k,onFocus:x,onBlur:v,role:"combobox",type:(m=n.type)!=null?m:"text",tabIndex:0,ref:s.inputRef,defaultValue:y.value,disabled:s.disabled.value===!0?!0:void 0};return Q({ourProps:F,theirProps:O,slot:T,attrs:n,slots:l,features:de.RenderStrategy|de.Static,name:"ComboboxInput"})}}}),Eo=t.defineComponent({name:"ComboboxOptions",props:{as:{type:[Object,String],default:"ul"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},hold:{type:[Boolean],default:!1}},setup(e,{attrs:o,slots:n,expose:l}){let r=K("ComboboxOptions"),a=`headlessui-combobox-options-${ce()}`;l({el:r.optionsRef,$el:r.optionsRef}),t.watchEffect(()=>{r.optionsPropsRef.value.static=e.static}),t.watchEffect(()=>{r.optionsPropsRef.value.hold=e.hold});let i=uo(),s=t.computed(()=>i!==null?(i.value&ue.Open)===ue.Open:r.comboboxState.value===0);ro({container:t.computed(()=>N(r.optionsRef)),enabled:t.computed(()=>r.comboboxState.value===0),accept(d){return d.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:d.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(d){d.setAttribute("role","none")}});function c(d){d.preventDefault()}return()=>{var d,u,f;let C={open:r.comboboxState.value===0},h={"aria-labelledby":(f=(d=N(r.labelRef))==null?void 0:d.id)!=null?f:(u=N(r.buttonRef))==null?void 0:u.id,id:a,ref:r.optionsRef,role:"listbox","aria-multiselectable":r.mode.value===1?!0:void 0,onMousedown:c},b=ye(e,["hold"]);return Q({ourProps:h,theirProps:b,slot:C,attrs:o,slots:r.virtual.value&&r.comboboxState.value===0?{...n,default:()=>[t.h(xo,{},n.default)]}:n,features:de.RenderStrategy|de.Static,visible:s.value,name:"ComboboxOptions"})}}}),_o=t.defineComponent({name:"ComboboxOption",props:{as:{type:[Object,String],default:"li"},value:{type:[Object,String,Number,Boolean]},disabled:{type:Boolean,default:!1},order:{type:[Number],default:null}},setup(e,{slots:o,attrs:n,expose:l}){let r=K("ComboboxOption"),a=`headlessui-combobox-option-${ce()}`,i=t.ref(null),s=t.computed(()=>e.disabled);l({el:i,$el:i});let c=t.computed(()=>{var v;return r.virtual.value?r.activeOptionIndex.value===r.calculateIndex(e.value):r.activeOptionIndex.value===null?!1:((v=r.options.value[r.activeOptionIndex.value])==null?void 0:v.id)===a}),d=t.computed(()=>r.isSelected(e.value)),u=t.inject(vt,null),f=t.computed(()=>({disabled:e.disabled,value:e.value,domRef:i,order:t.computed(()=>e.order)}));t.onMounted(()=>r.registerOption(a,f)),t.onUnmounted(()=>r.unregisterOption(a,c.value)),t.watchEffect(()=>{let v=N(i);v&&(u==null||u.value.measureElement(v))}),t.watchEffect(()=>{r.comboboxState.value===0&&c.value&&(r.virtual.value||r.activationTrigger.value!==0&&t.nextTick(()=>{var v,x;return(x=(v=N(i))==null?void 0:v.scrollIntoView)==null?void 0:x.call(v,{block:"nearest"})}))});function C(v){v.preventDefault(),v.button===mt.Left&&(s.value||(r.selectOption(a),st()||requestAnimationFrame(()=>{var x;return(x=N(r.inputRef))==null?void 0:x.focus({preventScroll:!0})}),r.mode.value===0&&r.closeCombobox()))}function h(){var v;if(e.disabled||(v=r.virtual.value)!=null&&v.disabled(e.value))return r.goToOption(A.Nothing);let x=r.calculateIndex(e.value);r.goToOption(A.Specific,x)}let b=lo();function g(v){b.update(v)}function S(v){var x;if(!b.wasMoved(v)||e.disabled||(x=r.virtual.value)!=null&&x.disabled(e.value)||c.value)return;let y=r.calculateIndex(e.value);r.goToOption(A.Specific,y,0)}function k(v){var x;b.wasMoved(v)&&(e.disabled||(x=r.virtual.value)!=null&&x.disabled(e.value)||c.value&&(r.optionsPropsRef.value.hold||r.goToOption(A.Nothing)))}return()=>{let{disabled:v}=e,x={active:c.value,selected:d.value,disabled:v},y={id:a,ref:i,role:"option",tabIndex:v===!0?void 0:-1,"aria-disabled":v===!0?!0:void 0,"aria-selected":d.value,disabled:void 0,onMousedown:C,onFocus:h,onPointerenter:g,onMouseenter:g,onPointermove:S,onMousemove:S,onPointerleave:k,onMouseleave:k},w=ye(e,["order","value"]);return Q({ourProps:y,theirProps:w,slot:x,attrs:n,slots:o,name:"ComboboxOption"})}}});function ko(e,o){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"})])}function So(e,o){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z","clip-rule":"evenodd"})])}function To(e,o){return t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.47 6.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 1 1-1.06 1.06L10 8.06l-3.72 3.72a.75.75 0 0 1-1.06-1.06l4.25-4.25Z","clip-rule":"evenodd"})])}function we(e,o,n){return Array.isArray(e)?(e.length=Math.max(e.length,o),e.splice(o,1,n),n):(e[o]=n,n)}function Fe(e,o){if(Array.isArray(e)){e.splice(o,1);return}delete e[o]}function $o(){return yt().__VUE_DEVTOOLS_GLOBAL_HOOK__}function yt(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Vo=typeof Proxy=="function",Bo="devtools-plugin:setup",No="plugin:settings:set";let oe,je;function Lo(){var e;return oe!==void 0||(typeof window<"u"&&window.performance?(oe=!0,je=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(oe=!0,je=globalThis.perf_hooks.performance):oe=!1),oe}function Oo(){return Lo()?je.now():Date.now()}class Io{constructor(o,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=o,this.hook=n;const l={};if(o.settings)for(const i in o.settings){const s=o.settings[i];l[i]=s.defaultValue}const r=`__vue-devtools-plugin-settings__${o.id}`;let a=Object.assign({},l);try{const i=localStorage.getItem(r),s=JSON.parse(i);Object.assign(a,s)}catch{}this.fallbacks={getSettings(){return a},setSettings(i){try{localStorage.setItem(r,JSON.stringify(i))}catch{}a=i},now(){return Oo()}},n&&n.on(No,(i,s)=>{i===this.plugin.id&&this.fallbacks.setSettings(s)}),this.proxiedOn=new Proxy({},{get:(i,s)=>this.target?this.target.on[s]:(...c)=>{this.onQueue.push({method:s,args:c})}}),this.proxiedTarget=new Proxy({},{get:(i,s)=>this.target?this.target[s]:s==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(s)?(...c)=>(this.targetQueue.push({method:s,args:c,resolve:()=>{}}),this.fallbacks[s](...c)):(...c)=>new Promise(d=>{this.targetQueue.push({method:s,args:c,resolve:d})})})}async setRealTarget(o){this.target=o;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function wt(e,o){const n=e,l=yt(),r=$o(),a=Vo&&n.enableEarlyProxy;if(r&&(l.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!a))r.emit(Bo,e,o);else{const i=a?new Io(n,r):null;(l.__VUE_DEVTOOLS_PLUGINS__=l.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:o,proxy:i}),i&&o(i.proxiedTarget)}}/*!
|
|
8
8
|
* pinia v2.1.7
|
|
9
9
|
* (c) 2023 Eduardo San Martin Morote
|
|
10
10
|
* @license MIT
|
|
11
|
-
*/let fe;const pe=e=>fe=e,Et=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function ee(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var H;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(H||(H={}));const Ee=typeof window<"u",me=(process.env.NODE_ENV!=="production"||!1)&&process.env.NODE_ENV!=="test"&&Ee,_t=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:typeof globalThis=="object"?globalThis:{HTMLElement:null};function
|
|
11
|
+
*/let fe;const pe=e=>fe=e,Et=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function ee(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var H;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(H||(H={}));const Ee=typeof window<"u",me=(process.env.NODE_ENV!=="production"||!1)&&process.env.NODE_ENV!=="test"&&Ee,_t=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:typeof globalThis=="object"?globalThis:{HTMLElement:null};function Mo(e,{autoBom:o=!1}={}){return o&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function ze(e,o,n){const l=new XMLHttpRequest;l.open("GET",e),l.responseType="blob",l.onload=function(){Tt(l.response,o,n)},l.onerror=function(){console.error("could not download file")},l.send()}function kt(e){const o=new XMLHttpRequest;o.open("HEAD",e,!1);try{o.send()}catch{}return o.status>=200&&o.status<=299}function _e(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{const n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(n)}}const ke=typeof navigator=="object"?navigator:{userAgent:""},St=/Macintosh/.test(ke.userAgent)&&/AppleWebKit/.test(ke.userAgent)&&!/Safari/.test(ke.userAgent),Tt=Ee?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!St?Ao:"msSaveOrOpenBlob"in ke?Ro:Do:()=>{};function Ao(e,o="download",n){const l=document.createElement("a");l.download=o,l.rel="noopener",typeof e=="string"?(l.href=e,l.origin!==location.origin?kt(l.href)?ze(e,o,n):(l.target="_blank",_e(l)):_e(l)):(l.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(l.href)},4e4),setTimeout(function(){_e(l)},0))}function Ro(e,o="download",n){if(typeof e=="string")if(kt(e))ze(e,o,n);else{const l=document.createElement("a");l.href=e,l.target="_blank",setTimeout(function(){_e(l)})}else navigator.msSaveOrOpenBlob(Mo(e,n),o)}function Do(e,o,n,l){if(l=l||open("","_blank"),l&&(l.document.title=l.document.body.innerText="downloading..."),typeof e=="string")return ze(e,o,n);const r=e.type==="application/octet-stream",a=/constructor/i.test(String(_t.HTMLElement))||"safari"in _t,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||r&&a||St)&&typeof FileReader<"u"){const s=new FileReader;s.onloadend=function(){let c=s.result;if(typeof c!="string")throw l=null,new Error("Wrong reader.result type");c=i?c:c.replace(/^data:[^;]*;/,"data:attachment/file;"),l?l.location.href=c:location.assign(c),l=null},s.readAsDataURL(e)}else{const s=URL.createObjectURL(e);l?l.location.assign(s):location.href=s,l=null,setTimeout(function(){URL.revokeObjectURL(s)},4e4)}}function I(e,o){const n="🍍 "+e;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(n,o):o==="error"?console.error(n):o==="warn"?console.warn(n):console.log(n)}function He(e){return"_a"in e&&"install"in e}function $t(){if(!("clipboard"in navigator))return I("Your browser doesn't support the Clipboard API","error"),!0}function Vt(e){return e instanceof Error&&e.message.toLowerCase().includes("document is not focused")?(I('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function Po(e){if(!$t())try{await navigator.clipboard.writeText(JSON.stringify(e.state.value)),I("Global state copied to clipboard.")}catch(o){if(Vt(o))return;I("Failed to serialize the state. Check the console for more details.","error"),console.error(o)}}async function Fo(e){if(!$t())try{Bt(e,JSON.parse(await navigator.clipboard.readText())),I("Global state pasted from clipboard.")}catch(o){if(Vt(o))return;I("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(o)}}async function jo(e){try{Tt(new Blob([JSON.stringify(e.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(o){I("Failed to export the state as JSON. Check the console for more details.","error"),console.error(o)}}let W;function zo(){W||(W=document.createElement("input"),W.type="file",W.accept=".json");function e(){return new Promise((o,n)=>{W.onchange=async()=>{const l=W.files;if(!l)return o(null);const r=l.item(0);return o(r?{text:await r.text(),file:r}:null)},W.oncancel=()=>o(null),W.onerror=n,W.click()})}return e}async function Ho(e){try{const n=await zo()();if(!n)return;const{text:l,file:r}=n;Bt(e,JSON.parse(l)),I(`Global state imported from "${r.name}".`)}catch(o){I("Failed to import the state from JSON. Check the console for more details.","error"),console.error(o)}}function Bt(e,o){for(const n in o){const l=e.state.value[n];l?Object.assign(l,o[n]):e.state.value[n]=o[n]}}function z(e){return{_custom:{display:e}}}const Nt="🍍 Pinia (root)",Ze="_root";function Zo(e){return He(e)?{id:Ze,label:Nt}:{id:e.$id,label:e.$id}}function Uo(e){if(He(e)){const n=Array.from(e._s.keys()),l=e._s;return{state:n.map(a=>({editable:!0,key:a,value:e.state.value[a]})),getters:n.filter(a=>l.get(a)._getters).map(a=>{const i=l.get(a);return{editable:!1,key:a,value:i._getters.reduce((s,c)=>(s[c]=i[c],s),{})}})}}const o={state:Object.keys(e.$state).map(n=>({editable:!0,key:n,value:e.$state[n]}))};return e._getters&&e._getters.length&&(o.getters=e._getters.map(n=>({editable:!1,key:n,value:e[n]}))),e._customProperties.size&&(o.customProperties=Array.from(e._customProperties).map(n=>({editable:!0,key:n,value:e[n]}))),o}function Wo(e){return e?Array.isArray(e)?e.reduce((o,n)=>(o.keys.push(n.key),o.operations.push(n.type),o.oldValue[n.key]=n.oldValue,o.newValue[n.key]=n.newValue,o),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:z(e.type),key:z(e.key),oldValue:e.oldValue,newValue:e.newValue}:{}}function qo(e){switch(e){case H.direct:return"mutation";case H.patchFunction:return"$patch";case H.patchObject:return"$patch";default:return"unknown"}}let le=!0;const Se=[],te="pinia:mutations",R="pinia",{assign:Go}=Object,Te=e=>"🍍 "+e;function Jo(e,o){wt({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:Se,app:e},n=>{typeof n.now!="function"&&I("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),n.addTimelineLayer({id:te,label:"Pinia 🍍",color:15064968}),n.addInspector({id:R,label:"Pinia 🍍",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{Po(o)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await Fo(o),n.sendInspectorTree(R),n.sendInspectorState(R)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{jo(o)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await Ho(o),n.sendInspectorTree(R),n.sendInspectorState(R)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:l=>{const r=o._s.get(l);r?typeof r.$reset!="function"?I(`Cannot reset "${l}" store because it doesn't have a "$reset" method implemented.`,"warn"):(r.$reset(),I(`Store "${l}" reset.`)):I(`Cannot reset "${l}" store because it wasn't found.`,"warn")}}]}),n.on.inspectComponent((l,r)=>{const a=l.componentInstance&&l.componentInstance.proxy;if(a&&a._pStores){const i=l.componentInstance.proxy._pStores;Object.values(i).forEach(s=>{l.instanceData.state.push({type:Te(s.$id),key:"state",editable:!0,value:s._isOptionsAPI?{_custom:{value:t.toRaw(s.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>s.$reset()}]}}:Object.keys(s.$state).reduce((c,d)=>(c[d]=s.$state[d],c),{})}),s._getters&&s._getters.length&&l.instanceData.state.push({type:Te(s.$id),key:"getters",editable:!1,value:s._getters.reduce((c,d)=>{try{c[d]=s[d]}catch(u){c[d]=u}return c},{})})})}}),n.on.getInspectorTree(l=>{if(l.app===e&&l.inspectorId===R){let r=[o];r=r.concat(Array.from(o._s.values())),l.rootNodes=(l.filter?r.filter(a=>"$id"in a?a.$id.toLowerCase().includes(l.filter.toLowerCase()):Nt.toLowerCase().includes(l.filter.toLowerCase())):r).map(Zo)}}),n.on.getInspectorState(l=>{if(l.app===e&&l.inspectorId===R){const r=l.nodeId===Ze?o:o._s.get(l.nodeId);if(!r)return;r&&(l.state=Uo(r))}}),n.on.editInspectorState((l,r)=>{if(l.app===e&&l.inspectorId===R){const a=l.nodeId===Ze?o:o._s.get(l.nodeId);if(!a)return I(`store "${l.nodeId}" not found`,"error");const{path:i}=l;He(a)?i.unshift("state"):(i.length!==1||!a._customProperties.has(i[0])||i[0]in a.$state)&&i.unshift("$state"),le=!1,l.set(a,i,l.state.value),le=!0}}),n.on.editComponentState(l=>{if(l.type.startsWith("🍍")){const r=l.type.replace(/^🍍\s*/,""),a=o._s.get(r);if(!a)return I(`store "${r}" not found`,"error");const{path:i}=l;if(i[0]!=="state")return I(`Invalid path for store "${r}":
|
|
12
12
|
${i}
|
|
13
|
-
Only state can be modified.`);i[0]="$state",le=!1,l.set(a,i,l.state.value),le=!0}})})}function
|
|
13
|
+
Only state can be modified.`);i[0]="$state",le=!1,l.set(a,i,l.state.value),le=!0}})})}function Yo(e,o){Se.includes(Te(o.$id))||Se.push(Te(o.$id)),wt({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:Se,app:e,settings:{logStoreChanges:{label:"Notify about new/deleted stores",type:"boolean",defaultValue:!0}}},n=>{const l=typeof n.now=="function"?n.now.bind(n):Date.now;o.$onAction(({after:i,onError:s,name:c,args:d})=>{const u=Lt++;n.addTimelineEvent({layerId:te,event:{time:l(),title:"🛫 "+c,subtitle:"start",data:{store:z(o.$id),action:z(c),args:d},groupId:u}}),i(f=>{q=void 0,n.addTimelineEvent({layerId:te,event:{time:l(),title:"🛬 "+c,subtitle:"end",data:{store:z(o.$id),action:z(c),args:d,result:f},groupId:u}})}),s(f=>{q=void 0,n.addTimelineEvent({layerId:te,event:{time:l(),logType:"error",title:"💥 "+c,subtitle:"end",data:{store:z(o.$id),action:z(c),args:d,error:f},groupId:u}})})},!0),o._customProperties.forEach(i=>{t.watch(()=>t.unref(o[i]),(s,c)=>{n.notifyComponentUpdate(),n.sendInspectorState(R),le&&n.addTimelineEvent({layerId:te,event:{time:l(),title:"Change",subtitle:i,data:{newValue:s,oldValue:c},groupId:q}})},{deep:!0})}),o.$subscribe(({events:i,type:s},c)=>{if(n.notifyComponentUpdate(),n.sendInspectorState(R),!le)return;const d={time:l(),title:qo(s),data:Go({store:z(o.$id)},Wo(i)),groupId:q};s===H.patchFunction?d.subtitle="⤵️":s===H.patchObject?d.subtitle="🧩":i&&!Array.isArray(i)&&(d.subtitle=i.type),i&&(d.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:i}}),n.addTimelineEvent({layerId:te,event:d})},{detached:!0,flush:"sync"});const r=o._hotUpdate;o._hotUpdate=t.markRaw(i=>{r(i),n.addTimelineEvent({layerId:te,event:{time:l(),title:"🔥 "+o.$id,subtitle:"HMR update",data:{store:z(o.$id),info:z("HMR update")}}}),n.notifyComponentUpdate(),n.sendInspectorTree(R),n.sendInspectorState(R)});const{$dispose:a}=o;o.$dispose=()=>{a(),n.notifyComponentUpdate(),n.sendInspectorTree(R),n.sendInspectorState(R),n.getSettings().logStoreChanges&&I(`Disposed "${o.$id}" store 🗑`)},n.notifyComponentUpdate(),n.sendInspectorTree(R),n.sendInspectorState(R),n.getSettings().logStoreChanges&&I(`"${o.$id}" store installed 🆕`)})}let Lt=0,q;function Ot(e,o,n){const l=o.reduce((r,a)=>(r[a]=t.toRaw(e)[a],r),{});for(const r in l)e[r]=function(){const a=Lt,i=n?new Proxy(e,{get(...c){return q=a,Reflect.get(...c)},set(...c){return q=a,Reflect.set(...c)}}):e;q=a;const s=l[r].apply(i,arguments);return q=void 0,s}}function Qo({app:e,store:o,options:n}){if(o.$id.startsWith("__hot:"))return;o._isOptionsAPI=!!n.state,Ot(o,Object.keys(n.actions),o._isOptionsAPI);const l=o._hotUpdate;t.toRaw(o)._hotUpdate=function(r){l.apply(this,arguments),Ot(o,Object.keys(r._hmrPayload.actions),!!o._isOptionsAPI)},Yo(e,o)}function Xo(){const e=t.effectScope(!0),o=e.run(()=>t.ref({}));let n=[],l=[];const r=t.markRaw({install(a){pe(r),r._a=a,a.provide(Et,r),a.config.globalProperties.$pinia=r,me&&Jo(a,r),l.forEach(i=>n.push(i)),l=[]},use(a){return this._a?n.push(a):l.push(a),this},_p:n,_a:null,_e:e,_s:new Map,state:o});return me&&typeof Proxy<"u"&&r.use(Qo),r}function It(e,o){for(const n in o){const l=o[n];if(!(n in e))continue;const r=e[n];ee(r)&&ee(l)&&!t.isRef(l)&&!t.isReactive(l)?e[n]=It(r,l):e[n]=l}return e}const Mt=()=>{};function At(e,o,n,l=Mt){e.push(o);const r=()=>{const a=e.indexOf(o);a>-1&&(e.splice(a,1),l())};return!n&&t.getCurrentScope()&&t.onScopeDispose(r),r}function re(e,...o){e.slice().forEach(n=>{n(...o)})}const Ko=e=>e();function Ue(e,o){e instanceof Map&&o instanceof Map&&o.forEach((n,l)=>e.set(l,n)),e instanceof Set&&o instanceof Set&&o.forEach(e.add,e);for(const n in o){if(!o.hasOwnProperty(n))continue;const l=o[n],r=e[n];ee(r)&&ee(l)&&e.hasOwnProperty(n)&&!t.isRef(l)&&!t.isReactive(l)?e[n]=Ue(r,l):e[n]=l}return e}const el=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function tl(e){return!ee(e)||!e.hasOwnProperty(el)}const{assign:P}=Object;function Rt(e){return!!(t.isRef(e)&&e.effect)}function Dt(e,o,n,l){const{state:r,actions:a,getters:i}=o,s=n.state.value[e];let c;function d(){!s&&(process.env.NODE_ENV==="production"||!l)&&(n.state.value[e]=r?r():{});const u=process.env.NODE_ENV!=="production"&&l?t.toRefs(t.ref(r?r():{}).value):t.toRefs(n.state.value[e]);return P(u,a,Object.keys(i||{}).reduce((f,C)=>(process.env.NODE_ENV!=="production"&&C in u&&console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${C}" in store "${e}".`),f[C]=t.markRaw(t.computed(()=>{pe(n);const h=n._s.get(e);return i[C].call(h,h)})),f),{}))}return c=We(e,d,o,n,l,!0),c}function We(e,o,n={},l,r,a){let i;const s=P({actions:{}},n);if(process.env.NODE_ENV!=="production"&&!l._e.active)throw new Error("Pinia destroyed");const c={deep:!0};process.env.NODE_ENV!=="production"&&(c.onTrigger=p=>{d?h=p:d==!1&&!E._hotUpdating&&(Array.isArray(h)?h.push(p):console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let d,u,f=[],C=[],h;const b=l.state.value[e];!a&&!b&&(process.env.NODE_ENV==="production"||!r)&&(l.state.value[e]={});const g=t.ref({});let S;function k(p){let m;d=u=!1,process.env.NODE_ENV!=="production"&&(h=[]),typeof p=="function"?(p(l.state.value[e]),m={type:H.patchFunction,storeId:e,events:h}):(Ue(l.state.value[e],p),m={type:H.patchObject,payload:p,storeId:e,events:h});const T=S=Symbol();t.nextTick().then(()=>{S===T&&(d=!0)}),u=!0,re(f,m,l.state.value[e])}const v=a?function(){const{state:m}=n,T=m?m():{};this.$patch($=>{P($,T)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`)}:Mt;function x(){i.stop(),f=[],C=[],l._s.delete(e)}function y(p,m){return function(){pe(l);const T=Array.from(arguments),$=[],L=[];function O(M){$.push(M)}function F(M){L.push(M)}re(C,{args:T,name:p,store:E,after:O,onError:F});let j;try{j=m.apply(this&&this.$id===e?this:E,T)}catch(M){throw re(L,M),M}return j instanceof Promise?j.then(M=>(re($,M),M)).catch(M=>(re(L,M),Promise.reject(M))):(re($,j),j)}}const w=t.markRaw({actions:{},getters:{},state:[],hotState:g}),V={_p:l,$id:e,$onAction:At.bind(null,C),$patch:k,$reset:v,$subscribe(p,m={}){const T=At(f,p,m.detached,()=>$()),$=i.run(()=>t.watch(()=>l.state.value[e],L=>{(m.flush==="sync"?u:d)&&p({storeId:e,type:H.direct,events:h},L)},P({},c,m)));return T},$dispose:x},E=t.reactive(process.env.NODE_ENV!=="production"||me?P({_hmrPayload:w,_customProperties:t.markRaw(new Set)},V):V);l._s.set(e,E);const B=(l._a&&l._a.runWithContext||Ko)(()=>l._e.run(()=>(i=t.effectScope()).run(o)));for(const p in B){const m=B[p];if(t.isRef(m)&&!Rt(m)||t.isReactive(m))process.env.NODE_ENV!=="production"&&r?we(g.value,p,t.toRef(B,p)):a||(b&&tl(m)&&(t.isRef(m)?m.value=b[p]:Ue(m,b[p])),l.state.value[e][p]=m),process.env.NODE_ENV!=="production"&&w.state.push(p);else if(typeof m=="function"){const T=process.env.NODE_ENV!=="production"&&r?m:y(p,m);B[p]=T,process.env.NODE_ENV!=="production"&&(w.actions[p]=m),s.actions[p]=m}else process.env.NODE_ENV!=="production"&&Rt(m)&&(w.getters[p]=a?n.getters[p]:m,Ee&&(B._getters||(B._getters=t.markRaw([]))).push(p))}if(P(E,B),P(t.toRaw(E),B),Object.defineProperty(E,"$state",{get:()=>process.env.NODE_ENV!=="production"&&r?g.value:l.state.value[e],set:p=>{if(process.env.NODE_ENV!=="production"&&r)throw new Error("cannot set hotState");k(m=>{P(m,p)})}}),process.env.NODE_ENV!=="production"&&(E._hotUpdate=t.markRaw(p=>{E._hotUpdating=!0,p._hmrPayload.state.forEach(m=>{if(m in E.$state){const T=p.$state[m],$=E.$state[m];typeof T=="object"&&ee(T)&&ee($)?It(T,$):p.$state[m]=$}we(E,m,t.toRef(p.$state,m))}),Object.keys(E.$state).forEach(m=>{m in p.$state||Fe(E,m)}),d=!1,u=!1,l.state.value[e]=t.toRef(p._hmrPayload,"hotState"),u=!0,t.nextTick().then(()=>{d=!0});for(const m in p._hmrPayload.actions){const T=p[m];we(E,m,y(m,T))}for(const m in p._hmrPayload.getters){const T=p._hmrPayload.getters[m],$=a?t.computed(()=>(pe(l),T.call(E,E))):T;we(E,m,$)}Object.keys(E._hmrPayload.getters).forEach(m=>{m in p._hmrPayload.getters||Fe(E,m)}),Object.keys(E._hmrPayload.actions).forEach(m=>{m in p._hmrPayload.actions||Fe(E,m)}),E._hmrPayload=p._hmrPayload,E._getters=p._getters,E._hotUpdating=!1})),me){const p={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(m=>{Object.defineProperty(E,m,P({value:E[m]},p))})}return l._p.forEach(p=>{if(me){const m=i.run(()=>p({store:E,app:l._a,pinia:l,options:s}));Object.keys(m||{}).forEach(T=>E._customProperties.add(T)),P(E,m)}else P(E,i.run(()=>p({store:E,app:l._a,pinia:l,options:s})))}),process.env.NODE_ENV!=="production"&&E.$state&&typeof E.$state=="object"&&typeof E.$state.constructor=="function"&&!E.$state.constructor.toString().includes("[native code]")&&console.warn(`[🍍]: The "state" must be a plain object. It cannot be
|
|
14
14
|
state: () => new MyClass()
|
|
15
15
|
Found in store "${E.$id}".`),b&&a&&n.hydrate&&n.hydrate(E.$state,b),d=!0,u=!0,E}function he(e,o,n){let l,r;const a=typeof o=="function";if(typeof e=="string")l=e,r=a?n:o;else if(r=e,l=e.id,process.env.NODE_ENV!=="production"&&typeof l!="string")throw new Error('[🍍]: "defineStore()" must be passed a store id as its first argument.');function i(s,c){const d=t.hasInjectionContext();if(s=(process.env.NODE_ENV==="test"&&fe&&fe._testing?null:s)||(d?t.inject(Et,null):null),s&&pe(s),process.env.NODE_ENV!=="production"&&!fe)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
16
16
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
17
|
-
This will fail in production.`);s=fe,s._s.has(l)||(a?We(l,o,r,s):Dt(l,r,s),process.env.NODE_ENV!=="production"&&(i._pinia=s));const u=s._s.get(l);if(process.env.NODE_ENV!=="production"&&c){const f="__hot:"+l,C=a?We(f,o,r,s,!0):Dt(f,P({},r),s,!0);c._hotUpdate(C),delete s.state.value[f],s._s.delete(f)}if(process.env.NODE_ENV!=="production"&&Ee){const f=t.getCurrentInstance();if(f&&f.proxy&&!c){const C=f.proxy,h="_pStores"in C?C._pStores:C._pStores={};h[l]=u}}return u}return i.$id=l,i}const ne=he("loader",()=>{const e=t.ref({translation:!1,aiExplanation:!1,writing:!1});return{loadingStates:e,setLoading:(l,r)=>{e.value[l]=r},isLoading:l=>e.value[l]}}),Pt={__name:"Select",props:t.mergeModels({languages:{type:Object,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const o=ne(),n=e,l=t.useModel(e,"modelValue"),r=t.ref(""),a=t.ref(null),i=t.computed(()=>Object.entries(n.languages).filter(([,c])=>c.toLowerCase().includes(r.value.toLowerCase()))),s=c=>{c.target.value="",r.value="",a.value&&a.value.$el.click()};return(c,d)=>(t.openBlock(),t.createBlock(t.unref(Co),{modelValue:l.value,"onUpdate:modelValue":d[3]||(d[3]=u=>l.value=u),disabled:t.unref(o).loading,as:"div",class:"relative mt-1"},{default:t.withCtx(()=>[t.createVNode(t.unref(vo),{class:"w-full bg-base-100 border border-base-300 rounded py-2.5 pl-3 pr-10 text-sm text-base-content font-medium focus:outline-none focus:ring-0.5 focus:ring-primary focus:border-primary",onChange:d[0]||(d[0]=u=>r.value=u.target.value),displayValue:u=>e.languages[u],onFocus:d[1]||(d[1]=u=>s(u))},null,8,["displayValue"]),t.createVNode(t.unref(xo),{ref_key:"btnSelect",ref:a,class:"absolute inset-y-0 right-0 flex items-center pr-2"},{default:t.withCtx(()=>[t.createVNode(t.unref(_o),{class:"h-5 w-5 text-base-content/50","aria-hidden":"true",onClick:d[2]||(d[2]=u=>s(u))})]),_:1},512),t.createVNode(t.unref(yo),{class:"absolute mt-1 max-h-60 w-full overflow-auto rounded-md bg-base-100 py-1 text-base shadow-lg ring-1 ring-base-300 focus:outline-none sm:text-sm z-50"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.value,([u,f])=>(t.openBlock(),t.createBlock(t.unref(wo),{key:u,value:u},{default:t.withCtx(({active:C,selected:h})=>[t.createElementVNode("li",{class:t.normalizeClass(["relative cursor-default select-none py-2 pl-3 pr-9",C?"bg-primary text-primary-content":"text-base-content"])},[t.createElementVNode("span",{class:t.normalizeClass(["block truncate",h&&"font-semibold"])},t.toDisplayString(f),3)],2)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue","disabled"]))}},el=["disabled"],tl=[t.createStaticVNode('<svg class="w-4 h-4 text-primary" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.68688 2.3131C3.88214 2.50837 3.88214 2.82495 3.68688 3.02021L2.04043 4.66666L3.68688 6.3131C3.88214 6.50837 3.88214 6.82495 3.68688 7.02021C3.49162 7.21547 3.17504 7.21547 2.97977 7.02021L0.979775 5.02021C0.784513 4.82495 0.784513 4.50837 0.979775 4.3131L2.97977 2.3131C3.17504 2.11784 3.49162 2.11784 3.68688 2.3131Z" fill="currentColor"></path><path d="M12.3131 8.97977C12.5084 8.78451 12.825 8.78451 13.0202 8.97977L15.0202 10.9798C15.2155 11.175 15.2155 11.4916 15.0202 11.6869L13.0202 13.6869C12.825 13.8821 12.5084 13.8821 12.3131 13.6869C12.1178 13.4916 12.1178 13.175 12.3131 12.9798L13.9596 11.3333L12.3131 9.68688C12.1178 9.49161 12.1178 9.17503 12.3131 8.97977Z" fill="currentColor"></path><path d="M0.833328 4.66666C0.833328 4.39051 1.05719 4.16666 1.33333 4.16666H14.6667C14.9428 4.16666 15.1667 4.39051 15.1667 4.66666C15.1667 4.9428 14.9428 5.16666 14.6667 5.16666H1.33333C1.05719 5.16666 0.833328 4.9428 0.833328 4.66666Z" fill="currentColor"></path><path d="M0.833328 11.3333C0.833328 11.0572 1.05719 10.8333 1.33333 10.8333H14.6667C14.9428 10.8333 15.1667 11.0572 15.1667 11.3333C15.1667 11.6095 14.9428 11.8333 14.6667 11.8333H1.33333C1.05719 11.8333 0.833328 11.6095 0.833328 11.3333Z" fill="currentColor"></path></svg>',1)],nl=["disabled"],ol=[t.createStaticVNode('<svg class="w-4 h-4 text-primary" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.68688 2.3131C3.88214 2.50837 3.88214 2.82495 3.68688 3.02021L2.04043 4.66666L3.68688 6.3131C3.88214 6.50837 3.88214 6.82495 3.68688 7.02021C3.49162 7.21547 3.17504 7.21547 2.97977 7.02021L0.979775 5.02021C0.784513 4.82495 0.784513 4.50837 0.979775 4.3131L2.97977 2.3131C3.17504 2.11784 3.49162 2.11784 3.68688 2.3131Z" fill="currentColor"></path><path d="M12.3131 8.97977C12.5084 8.78451 12.825 8.78451 13.0202 8.97977L15.0202 10.9798C15.2155 11.175 15.2155 11.4916 15.0202 11.6869L13.0202 13.6869C12.825 13.8821 12.5084 13.8821 12.3131 13.6869C12.1178 13.4916 12.1178 13.175 12.3131 12.9798L13.9596 11.3333L12.3131 9.68688C12.1178 9.49161 12.1178 9.17503 12.3131 8.97977Z" fill="currentColor"></path><path d="M0.833328 4.66666C0.833328 4.39051 1.05719 4.16666 1.33333 4.16666H14.6667C14.9428 4.16666 15.1667 4.39051 15.1667 4.66666C15.1667 4.9428 14.9428 5.16666 14.6667 5.16666H1.33333C1.05719 5.16666 0.833328 4.9428 0.833328 4.66666Z" fill="currentColor"></path><path d="M0.833328 11.3333C0.833328 11.0572 1.05719 10.8333 1.33333 10.8333H14.6667C14.9428 10.8333 15.1667 11.0572 15.1667 11.3333C15.1667 11.6095 14.9428 11.8333 14.6667 11.8333H1.33333C1.05719 11.8333 0.833328 11.6095 0.833328 11.3333Z" fill="currentColor"></path></svg>',1)],ll={__name:"SwapBtn",props:{isBidirect:{type:Boolean,default:!1}},emits:["swap"],setup(e,{emit:o}){const n=ne(),l=t.computed(()=>n.isLoading("translation")),r=o;return(a,i)=>e.isBidirect?(t.openBlock(),t.createElementBlock("button",{key:1,onClick:i[0]||(i[0]=s=>r("swap")),disabled:l.value},ol,8,nl)):(t.openBlock(),t.createElementBlock("button",{key:0,disabled:l.value},tl,8,el))}},ae=he("language",()=>{const e=t.ref("auto"),o=t.ref("vi"),n=t.ref({src:[],target:[]}),l=t.computed(()=>n.value.src[e.value]),r=t.computed(()=>n.value.target[o.value]);function a(c,d){e.value=c==null?void 0:c.src,o.value=c==null?void 0:c.target,n.value=d}function i(){if(!n.value.src[o.value]||!n.value.target[e.value])return;const c=e.value;e.value=o.value,o.value=c}function s(c){return n.value.src[c]||n.value.target[c]}return{languages:n,src:e,target:o,srcLabel:l,targetLabel:r,init:a,swap:i,getLabel:s}}),rl={key:0,class:"flex flex-col"},al={class:"flex"},sl={class:"grow flex flex-col"},il={key:0,class:"flex mt-1 space-x-1"},cl=["onClick"],dl={class:"grow flex flex-col"},ul={key:0,class:"flex mt-1 space-x-1 justify-end"},fl=["onClick"],pl={class:"flex"},ml={class:"grow flex flex-col"},hl={class:"grow flex flex-col"},Ft=3,gl={__name:"Selects",setup(e){const o=ae(),n=t.ref([]),l=t.ref([]);function r(){o.swap()}return t.onMounted(()=>{var a,i;n.value=((a=Ce.getLocalStorage("recentSrc"))==null?void 0:a.filter(s=>!!s))||[],l.value=((i=Ce.getLocalStorage("recentTarget"))==null?void 0:i.filter(s=>!!s))||[]}),t.watch(()=>o.src,a=>{a&&(n.value.includes(a)||(n.value.unshift(a),n.value=n.value.slice(0,Ft),Ce.setLocalStorage("recentSrc",n.value)))}),t.watch(()=>o.target,a=>{a&&(l.value.includes(a)||(l.value.unshift(a),l.value=l.value.slice(0,Ft),Ce.setLocalStorage("recentTarget",l.value)))}),(a,i)=>t.unref(o).languages?(t.openBlock(),t.createElementBlock("div",rl,[t.createElementVNode("div",al,[t.createElementVNode("div",sl,[n.value.length>0?(t.openBlock(),t.createElementBlock("div",il,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,s=>(t.openBlock(),t.createElementBlock("button",{key:s,class:"px-1 bg-base-100 border border-primary text-primary text-xs rounded hover:bg-primary hover:text-primary-content",onClick:c=>t.unref(o).src=s},t.toDisplayString(t.unref(o).languages.src[s]),9,cl))),128))])):t.createCommentVNode("",!0)]),t.createElementVNode("div",dl,[l.value.length>0?(t.openBlock(),t.createElementBlock("div",ul,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,s=>(t.openBlock(),t.createElementBlock("button",{key:s,class:"px-1 bg-base-100 border border-primary text-primary text-xs rounded hover:bg-primary hover:text-primary-content",onClick:c=>t.unref(o).target=s},t.toDisplayString(t.unref(o).languages.target[s]),9,fl))),128))])):t.createCommentVNode("",!0)])]),t.createElementVNode("div",pl,[t.createElementVNode("div",ml,[t.createVNode(Pt,{modelValue:t.unref(o).src,"onUpdate:modelValue":i[0]||(i[0]=s=>t.unref(o).src=s),languages:t.unref(o).languages.src,class:"grow"},null,8,["modelValue","languages"])]),t.createVNode(ll,{isBidirect:t.unref(o).src!=="auto",class:"grow-0 mx-3 mt-4 self-start",onSwap:r},null,8,["isBidirect"]),t.createElementVNode("div",hl,[t.createVNode(Pt,{modelValue:t.unref(o).target,"onUpdate:modelValue":i[1]||(i[1]=s=>t.unref(o).target=s),languages:t.unref(o).languages.target,class:"grow"},null,8,["modelValue","languages"])])])])):t.createCommentVNode("",!0)}},se={INPUT_MAX_LENGTH:5e3,INPUT_DEBOUNCE:1e3,IMPROVE_INPUT_MIN_LENGTH:4,DEFAULT_DIFF_MODE:!0},G=(e,o)=>{const n=e.__vccOpts||e;for(const[l,r]of o)n[l]=r;return n},bl={},Cl={class:"mr-2 loading loading-dots loading-xs"};function xl(e,o){return t.openBlock(),t.createElementBlock("span",Cl)}const qe=G(bl,[["render",xl]]),Ge=he("tts",()=>{const e=t.ref({src:null,target:null});function o(r){r.src&&(e.value.src=r.src),r.target&&(e.value.target=r.target)}function n(r){if(r==="src")return e.value.src;if(r==="target")return e.value.target}function l(){e.value={src:null,target:null}}return{tts:e,set:o,get:n,reset:l}}),vl=["disabled"],yl=[t.createElementVNode("path",{d:"M2.33325 4.66667H3.51125C3.82693 4.6667 4.13239 4.55473 4.37325 4.35067L6.83392 2.26667C6.99592 2.12953 7.19374 2.04156 7.40407 2.01312C7.61441 1.98468 7.82849 2.01696 8.02109 2.10615C8.21369 2.19534 8.37678 2.33772 8.49114 2.51652C8.60551 2.69532 8.66638 2.90309 8.66659 3.11534V12.8847C8.66649 13.097 8.60565 13.305 8.49125 13.4839C8.37685 13.6628 8.21367 13.8053 8.02094 13.8945C7.82822 13.9837 7.614 14.0159 7.40356 13.9874C7.19312 13.9588 6.99523 13.8707 6.83325 13.7333L4.37325 11.6487C4.13229 11.4449 3.82685 11.3331 3.51125 11.3333H2.33325C2.06804 11.3333 1.81368 11.228 1.62615 11.0404C1.43861 10.8529 1.33325 10.5986 1.33325 10.3333V5.66667C1.33325 5.40145 1.43861 5.1471 1.62615 4.95956C1.81368 4.77203 2.06804 4.66667 2.33325 4.66667ZM11.1779 11.18C11.5969 10.763 11.9294 10.2674 12.1562 9.72156C12.3831 9.17572 12.4999 8.59044 12.4999 7.99934C12.4999 7.40823 12.3831 6.82295 12.1562 6.27711C11.9294 5.73127 11.5969 5.23564 11.1779 4.81867C11.1317 4.77098 11.0765 4.73297 11.0155 4.70686C10.9544 4.68075 10.8888 4.66705 10.8224 4.66657C10.756 4.66609 10.6902 4.67883 10.6288 4.70406C10.5674 4.72929 10.5116 4.76649 10.4647 4.8135C10.4179 4.86051 10.3808 4.91639 10.3558 4.97787C10.3307 5.03935 10.3181 5.10521 10.3188 5.17159C10.3195 5.23798 10.3334 5.30357 10.3597 5.36453C10.3859 5.42549 10.4241 5.48061 10.4719 5.52667C10.7977 5.85079 11.0562 6.23609 11.2326 6.66043C11.409 7.08477 11.4998 7.53979 11.4998 7.99934C11.4998 8.45888 11.409 8.9139 11.2326 9.33824C11.0562 9.76258 10.7977 10.1479 10.4719 10.472C10.4241 10.5181 10.3859 10.5732 10.3597 10.6341C10.3334 10.6951 10.3195 10.7607 10.3188 10.8271C10.3181 10.8935 10.3307 10.9593 10.3558 11.0208C10.3808 11.0823 10.4179 11.1382 10.4647 11.1852C10.5116 11.2322 10.5674 11.2694 10.6288 11.2946C10.6902 11.3198 10.756 11.3326 10.8224 11.3321C10.8888 11.3316 10.9544 11.3179 11.0155 11.2918C11.0765 11.2657 11.1317 11.2277 11.1779 11.18ZM12.7113 13.2127C12.6123 13.2126 12.5157 13.1832 12.4335 13.1281C12.3513 13.0731 12.2873 12.9949 12.2495 12.9035C12.2118 12.8121 12.202 12.7115 12.2214 12.6146C12.2408 12.5176 12.2886 12.4285 12.3586 12.3587C12.9317 11.7866 13.3865 11.1071 13.6967 10.359C14.0069 9.61101 14.1666 8.80915 14.1666 7.99934C14.1666 7.18952 14.0069 6.38766 13.6967 5.63963C13.3865 4.8916 12.9317 4.2121 12.3586 3.64C12.3122 3.59351 12.2754 3.53834 12.2503 3.47764C12.2252 3.41693 12.2124 3.35188 12.2124 3.2862C12.2125 3.22052 12.2255 3.15549 12.2507 3.09483C12.2759 3.03417 12.3128 2.97907 12.3593 2.93267C12.4057 2.88627 12.4609 2.84948 12.5216 2.8244C12.5823 2.79932 12.6474 2.78645 12.7131 2.78651C12.7787 2.78657 12.8438 2.79957 12.9044 2.82476C12.9651 2.84995 13.0202 2.88685 13.0666 2.93334C13.7327 3.59825 14.2612 4.38801 14.6218 5.25741C14.9824 6.12681 15.168 7.05879 15.168 8C15.168 8.94122 14.9824 9.87319 14.6218 10.7426C14.2612 11.612 13.7327 12.4018 13.0666 13.0667C13.02 13.1134 12.9646 13.1504 12.9036 13.1756C12.8426 13.2007 12.7772 13.2129 12.7113 13.2127Z",fill:"currentColor"},null,-1)],wl=[t.createElementVNode("svg",{class:"w-4 h-4 text-primary",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.5 7.5a3 3 0 0 1 3-3h9a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3h-9a3 3 0 0 1-3-3v-9Z","clip-rule":"evenodd",fill:"currentColor"})],-1)],El={__name:"SpeakBtn",props:{type:{type:String,default:""},disabled:Boolean},emits:["loadTTS"],setup(e,{emit:o}){const n=Ge(),l=e,r=o,a=t.computed(()=>n.tts[l.type]),i=t.ref(!1),s=new Audio,c=t.ref(!1);t.watch(a,()=>{if(!a.value){i.value=!1;return}c.value&&(c.value=!1,u())},{immediate:!0}),t.onUnmounted(()=>{f(),s.src=""});function d(){if(a.value){u();return}c.value=!0,i.value=!0,r("loadTTS")}function u(){a.value&&(s.src=a.value,s.playbackRate=.7,i.value=!0,s.play().catch(()=>{i.value=!1}))}function f(){s.pause(),s.currentTime=0,i.value=!1}return s.onended=()=>{i.value=!1},(C,h)=>i.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"btn btn-xs btn-circle",onClick:t.withModifiers(f,["prevent"])},wl)):(t.openBlock(),t.createElementBlock("button",{key:0,class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled,onClick:t.withModifiers(d,["prevent"])},[(t.openBlock(),t.createElementBlock("svg",{class:t.normalizeClass(["w-4 h-4 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},yl,2))],10,vl))}},_l={class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":"Clear"},kl=["disabled"],Sl=[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.19102 3.19102C3.44571 2.93633 3.85864 2.93633 4.11333 3.19102L12.809 11.8867C13.0637 12.1414 13.0637 12.5543 12.809 12.809C12.5543 13.0637 12.1414 13.0637 11.8867 12.809L3.19102 4.11333C2.93633 3.85864 2.93633 3.44571 3.19102 3.19102Z",fill:"currentColor"},null,-1),t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.809 3.19102C13.0637 3.44571 13.0637 3.85864 12.809 4.11333L4.11333 12.809C3.85864 13.0637 3.44571 13.0637 3.19102 12.809C2.93633 12.5543 2.93633 12.1414 3.19102 11.8867L11.8867 3.19102C12.1414 2.93633 12.5543 2.93633 12.809 3.19102Z",fill:"currentColor"},null,-1)],jt={__name:"ClearBtn",props:{disabled:Boolean},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",_l,[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled},[(t.openBlock(),t.createElementBlock("svg",{class:t.normalizeClass(["w-4 h-4 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Sl,2))],10,kl)]))}},Tl={class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":"Favorite"},$l=["disabled"],Vl=[t.createElementVNode("path",{d:"M14.9491 5.89315C14.8278 5.53128 14.5111 5.27252 14.1226 5.21783L10.5264 4.7114L8.91813 1.55315C8.74435 1.21195 8.39257 1 7.99998 1C7.60739 1 7.25557 1.21195 7.08183 1.55315L5.47358 4.7114L1.8774 5.21783C1.48888 5.27252 1.17219 5.53128 1.05086 5.89315C0.929554 6.25501 1.02881 6.64477 1.30993 6.91038L3.91217 9.36871L3.29786 12.8399C3.2315 13.215 3.38755 13.5868 3.7052 13.8105C3.88128 13.9344 4.08938 14 4.30704 14C4.47232 14 4.63705 13.9606 4.78341 13.886L7.99995 12.2471L11.2165 13.886C11.3628 13.9606 11.5276 14 11.6929 14C11.9106 14 12.1187 13.9345 12.2948 13.8105C12.6124 13.5868 12.7685 13.215 12.7021 12.84L12.0878 9.36871L14.6901 6.91035C14.9712 6.64477 15.0704 6.25498 14.9491 5.89315ZM14.0266 6.25082L11.2455 8.87813C11.1335 8.98392 11.0824 9.13637 11.1089 9.28575L11.7654 12.9956C11.7701 13.0226 11.759 13.0493 11.7362 13.0653C11.7202 13.0766 11.7038 13.079 11.6929 13.079C11.6809 13.079 11.6694 13.0762 11.6587 13.0708L8.22108 11.3192C8.15189 11.284 8.07593 11.2663 7.99998 11.2663C7.92402 11.2663 7.84807 11.284 7.77882 11.3193L4.34118 13.0708C4.33052 13.0763 4.31904 13.079 4.30701 13.079C4.29611 13.079 4.27969 13.0767 4.26373 13.0654C4.24092 13.0494 4.22975 13.0226 4.2345 12.9957L4.89104 9.28584C4.91747 9.13646 4.86637 8.98401 4.75439 8.87822L1.97327 6.25091C1.95308 6.23184 1.94595 6.20383 1.95466 6.17786C1.9634 6.15185 1.98612 6.13326 2.01405 6.12933L5.85743 5.58807C6.0122 5.56626 6.14599 5.47208 6.21521 5.33616L7.93404 1.9608C7.94653 1.9363 7.97178 1.92107 7.99998 1.92107C8.02818 1.92107 8.05343 1.9363 8.06591 1.9608L9.78468 5.33607C9.85391 5.47199 9.9877 5.5662 10.1425 5.58799L13.9859 6.12924C14.0138 6.1332 14.0365 6.15176 14.0452 6.17777C14.0539 6.20374 14.0468 6.23175 14.0266 6.25082Z",fill:"currentColor"},null,-1)],Bl=[t.createElementVNode("path",{d:"M7.47207 1.31905C7.57125 1.12371 7.77589 1 8.00001 1C8.22413 1 8.42877 1.12367 8.52795 1.31905L10.3721 4.95175L14.4959 5.53427C14.7177 5.5656 14.9019 5.7166 14.9712 5.9238C15.0404 6.13101 14.9827 6.35843 14.8222 6.51049L11.8382 9.33816L12.5427 13.3309C12.5806 13.5456 12.4897 13.7626 12.3084 13.8906C12.1272 14.0187 11.8868 14.0356 11.6884 13.9342L8.00004 12.0491L4.31158 13.9343C4.11323 14.0356 3.87286 14.0187 3.69157 13.8907C3.51028 13.7627 3.4195 13.5457 3.45736 13.3309L4.1618 9.33819L1.17781 6.51052C1.01735 6.35846 0.959571 6.13101 1.02884 5.92383C1.09807 5.71663 1.28232 5.56563 1.50409 5.53431L5.62787 4.95178L7.47207 1.31905Z",fill:"currentColor"},null,-1)],Nl={__name:"FavoriteBtn",props:{disabled:Boolean,isFilled:Boolean},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",Tl,[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled},[e.isFilled?(t.openBlock(),t.createElementBlock("svg",{key:1,class:t.normalizeClass(["w-4 h-4 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Bl,2)):(t.openBlock(),t.createElementBlock("svg",{key:0,class:t.normalizeClass(["w-4 h-4 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Vl,2))],10,$l)]))}},Ll={class:"tooltip tooltip-top tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!text-xs before:!py-1 before:!px-2","data-tip":"AI Translate"},Ol=["disabled"],Il=[t.createElementVNode("path",{d:"M6.8544 3.20309C5.39975 2.89815 4.26277 1.76117 3.95787 0.30649C3.92042 0.12792 3.76292 0 3.58041 0C3.3979 0 3.2404 0.12792 3.20297 0.30652C2.89805 1.76117 1.76107 2.89812 0.306418 3.20302C0.127818 3.24045 -0.00012207 3.39798 -0.00012207 3.58046C-0.00012207 3.76295 0.127798 3.92047 0.306418 3.9579C1.76105 4.26285 2.89798 5.3998 3.2029 6.85448C3.24033 7.03307 3.39783 7.16102 3.58034 7.16102C3.76282 7.16102 3.92035 7.0331 3.95778 6.85448C4.26272 5.39983 5.39973 4.26287 6.85438 3.95799C7.03297 3.92056 7.16092 3.76306 7.16092 3.58056C7.1609 3.39805 7.03297 3.24052 6.8544 3.20309ZM3.58036 5.60938C3.14292 4.73132 2.42956 4.01792 1.55151 3.58049C2.42958 3.14305 3.14297 2.42968 3.58041 1.55161C4.01785 2.4297 4.73122 3.14307 5.60926 3.58053C4.73119 4.01797 4.0178 4.73132 3.58036 5.60938Z",fill:"currentColor"},null,-1),t.createElementVNode("path",{d:"M6.21683 9.574C5.53147 9.4303 4.99578 8.8947 4.85209 8.2093C4.81466 8.0307 4.65716 7.90271 4.47465 7.90271C4.29217 7.90271 4.13464 8.0306 4.09721 8.2092C3.95352 8.8946 3.4178 9.4303 2.73244 9.574C2.55385 9.6114 2.4259 9.7689 2.4259 9.9514C2.4259 10.1339 2.55383 10.2914 2.73244 10.3288C3.41778 10.4725 3.95349 11.0082 4.09716 11.6936C4.13459 11.8722 4.2921 12.0002 4.4746 12.0002C4.65709 12.0002 4.81461 11.8723 4.85204 11.6936C4.99574 11.0082 5.53145 10.4725 6.21683 10.3289C6.39543 10.2914 6.52337 10.1339 6.52337 9.9514C6.52337 9.7689 6.39545 9.6114 6.21683 9.574ZM4.47463 10.6408C4.29163 10.3688 4.05725 10.1345 3.78526 9.9515C4.0573 9.7684 4.29163 9.5341 4.47463 9.2621C4.65765 9.5341 4.892 9.7685 5.164 9.9515C4.892 10.1345 4.65763 10.3688 4.47463 10.6408Z",fill:"currentColor"},null,-1),t.createElementVNode("path",{d:"M11.4271 6.00324C10.5007 5.80904 9.7766 5.08496 9.5825 4.15859C9.545 3.98 9.3875 3.85205 9.205 3.85205C9.0225 3.85205 8.865 3.97995 8.8276 4.15857C8.6334 5.08496 7.90932 5.80902 6.98293 6.0032C6.80434 6.04063 6.67639 6.19815 6.67639 6.38064C6.67639 6.56312 6.80431 6.72062 6.98293 6.75807C7.9093 6.95228 8.6334 7.67633 8.8275 8.6027C8.865 8.7813 9.0225 8.9093 9.205 8.9093C9.3875 8.9093 9.545 8.7814 9.5824 8.6027C9.7766 7.67633 10.5007 6.95228 11.4271 6.75812C11.6057 6.72067 11.7336 6.56317 11.7336 6.38068C11.7336 6.1982 11.6057 6.04067 11.4271 6.00324ZM9.205 7.47681C8.9365 7.02634 8.5593 6.64914 8.1089 6.38066C8.5593 6.11218 8.9365 5.73502 9.205 5.28453C9.4735 5.73502 9.8507 6.11221 10.3012 6.38068C9.8507 6.64916 9.4735 7.02636 9.205 7.47681Z",fill:"currentColor"},null,-1)],Ml=[t.createStaticVNode('<path d="M6.8544 3.20309C5.39975 2.89815 4.26277 1.76117 3.95787 0.30649C3.92042 0.12792 3.76292 0 3.58041 0C3.3979 0 3.2404 0.12792 3.20297 0.30652C2.89805 1.76117 1.76107 2.89812 0.306418 3.20302C0.127818 3.24045 -0.00012207 3.39798 -0.00012207 3.58046C-0.00012207 3.76295 0.127798 3.92047 0.306418 3.9579C1.76105 4.26285 2.89798 5.3998 3.2029 6.85448C3.24033 7.03307 3.39783 7.16102 3.58034 7.16102C3.76282 7.16102 3.92035 7.0331 3.95778 6.85448C4.26272 5.39983 5.39973 4.26287 6.85438 3.95799C7.03297 3.92056 7.16092 3.76306 7.16092 3.58056C7.1609 3.39805 7.03297 3.24052 6.8544 3.20309ZM3.58036 5.60938C3.14292 4.73132 2.42956 4.01792 1.55151 3.58049C2.42958 3.14305 3.14297 2.42968 3.58041 1.55161C4.01785 2.4297 4.73122 3.14307 5.60926 3.58053C4.73119 4.01797 4.0178 4.73132 3.58036 5.60938Z" fill="currentColor"></path><path d="M6.21683 9.574C5.53147 9.4303 4.99578 8.8947 4.85209 8.2093C4.81466 8.0307 4.65716 7.90271 4.47465 7.90271C4.29217 7.90271 4.13464 8.0306 4.09721 8.2092C3.95352 8.8946 3.4178 9.4303 2.73244 9.574C2.55385 9.6114 2.4259 9.7689 2.4259 9.9514C2.4259 10.1339 2.55383 10.2914 2.73244 10.3288C3.41778 10.4725 3.95349 11.0082 4.09716 11.6936C4.13459 11.8722 4.2921 12.0002 4.4746 12.0002C4.65709 12.0002 4.81461 11.8723 4.85204 11.6936C4.99574 11.0082 5.53145 10.4725 6.21683 10.3289C6.39543 10.2914 6.52337 10.1339 6.52337 9.9514C6.52337 9.7689 6.39545 9.6114 6.21683 9.574ZM4.47463 10.6408C4.29163 10.3688 4.05725 10.1345 3.78526 9.9515C4.0573 9.7684 4.29163 9.5341 4.47463 9.2621C4.65765 9.5341 4.892 9.7685 5.164 9.9515C4.892 10.1345 4.65763 10.3688 4.47463 10.6408Z" fill="currentColor"></path><path d="M11.4271 6.00324C10.5007 5.80904 9.7766 5.08496 9.5825 4.15859C9.545 3.98 9.3875 3.85205 9.205 3.85205C9.0225 3.85205 8.865 3.97995 8.8276 4.15857C8.6334 5.08496 7.90932 5.80902 6.98293 6.0032C6.80434 6.04063 6.67639 6.19815 6.67639 6.38064C6.67639 6.56312 6.80431 6.72062 6.98293 6.75807C7.9093 6.95228 8.6334 7.67633 8.8275 8.6027C8.865 8.7813 9.0225 8.9093 9.205 8.9093C9.3875 8.9093 9.545 8.7814 9.5824 8.6027C9.7766 7.67633 10.5007 6.95228 11.4271 6.75812C11.6057 6.72067 11.7336 6.56317 11.7336 6.38068C11.7336 6.1982 11.6057 6.04067 11.4271 6.00324ZM9.205 7.47681C8.9365 7.02634 8.5593 6.64914 8.1089 6.38066C8.5593 6.11218 8.9365 5.73502 9.205 5.28453C9.4735 5.73502 9.8507 6.11221 10.3012 6.38068C9.8507 6.64916 9.4735 7.02636 9.205 7.47681Z" fill="currentColor"></path><circle cx="3.5" cy="3.5" r="1.5" fill="currentColor"></circle><ellipse cx="4.5" cy="10" rx="0.5" ry="1" fill="currentColor"></ellipse><path d="M3.5 1L4.79904 2.5H2.20096L3.5 1Z" fill="currentColor"></path><path d="M6 3.5L4.5 4.79904L4.5 2.20096L6 3.5Z" fill="currentColor"></path><path d="M10.3697 6.67832L8.22108 7.01422L9.5776 4.65296L10.3697 6.67832Z" fill="currentColor"></path><path d="M8.27756 5.34149L10.768 6.00067L9.11199 7.77878L8.27756 5.34149Z" fill="currentColor"></path><path d="M1 3.5L2.5 2.20096L2.5 4.79904L1 3.5Z" fill="currentColor"></path><path d="M3.5 6L2.20096 4.5L4.79904 4.5L3.5 6Z" fill="currentColor"></path><circle cx="9" cy="6" r="1" fill="currentColor"></circle><path d="M5.49718 9.92495L4.03391 10.4693L3.96891 9.60573L5.49718 9.92495Z" fill="currentColor"></path><path d="M3.54089 9.71696L5.10212 9.72621L4.857 10.5568L3.54089 9.71696Z" fill="currentColor"></path><path d="M3.50071 9.96247L5.0159 9.58606L4.9834 10.4515L3.50071 9.96247Z" fill="currentColor"></path>',15)],Al={__name:"AIBtn",props:{disabled:Boolean,isFilled:Boolean},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",Ll,[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled},[e.isFilled?(t.openBlock(),t.createElementBlock("svg",{key:1,class:t.normalizeClass(["w-4 h-4 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ml,2)):(t.openBlock(),t.createElementBlock("svg",{key:0,class:t.normalizeClass(["w-4 h-4 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Il,2))],10,Ol)]))}},Rl=["data-tip"],Dl=["disabled"],Pl=[t.createElementVNode("path",{d:"M13.9023 3.26667L10.8093 0.1C10.7767 0.0666667 10.7116 0 10.5814 0H3.74419C3.12558 0 2.60465 0.533333 2.60465 1.16667V2.66667H1.13953C0.52093 2.66667 0 3.2 0 3.83333V14.8667C0 15.4667 0.52093 16 1.13953 16H10.2558C10.8744 16 11.3953 15.4667 11.3953 14.8333V13.3333H12.8605C13.4791 13.3333 14 12.8 14 12.1667V3.5C14 3.4 13.9674 3.3 13.9023 3.26667ZM12.893 3.16667H11.3954C11.1349 3.16667 10.907 2.93333 10.907 2.66667V1.13333L12.893 3.16667ZM10.2558 15.3333H1.13953C0.87907 15.3333 0.651163 15.1 0.651163 14.8333V3.83333C0.651163 3.53333 0.87907 3.33333 1.13953 3.33333H7.68372V5.33333C7.68372 5.96667 8.20465 6.5 8.82326 6.5H10.7767V14.8667C10.7442 15.1 10.5488 15.3333 10.2558 15.3333ZM9.31163 4.8L10.2884 5.8H8.7907C8.53023 5.8 8.30233 5.56667 8.30233 5.3V3.76667L9.31163 4.8ZM12.8605 12.6667H11.3953V6.13333C11.3953 6.06667 11.3628 5.96667 11.2977 5.9L8.20465 2.73333C8.17209 2.7 8.07442 2.66667 8.0093 2.66667H3.25581V1.16667C3.25581 0.9 3.45116 0.666666 3.74419 0.666666H10.2558V2.66667C10.2558 3.3 10.7767 3.83333 11.3954 3.83333H13.3488V12.2C13.3488 12.4667 13.1209 12.6667 12.8605 12.6667Z",fill:"currentColor"},null,-1)],zt={__name:"CopyBtn",props:{disabled:Boolean},setup(e){const o=t.ref("Copy"),n=()=>{o.value="Copied",setTimeout(()=>{o.value="Copy"},1e3)};return(l,r)=>(t.openBlock(),t.createElementBlock("div",{class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":o.value},[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled,onClick:n},[(t.openBlock(),t.createElementBlock("svg",{class:t.normalizeClass(["w-3 h-3 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Pl,2))],10,Dl)],8,Rl))}},Fl={class:"flex flex-row px-1 pr-10 pt-1 items-center bg-transparent relative"},jl={class:"ml-1 text-sm text-base-content/70"},zl={key:0,class:"italic"},Hl={class:"absolute right-1 top-1 flex flex-col items-center gap-0"},Ht=G({__name:"InputBtnGroup",props:{loading:{type:Boolean,default:!1},isTTS:{type:Boolean,default:!0},src:{type:String,default:""},srcLabel:{type:String,default:""},type:{type:String,default:""},phonetic:{type:String,default:""},hasClearBtn:{type:Boolean,default:!1},hasFavoriteBtn:{type:Boolean,default:!1},hasAIBtn:{type:Boolean,default:!1},hasCopyBtn:{type:Boolean,default:!1},isFavorite:{type:Boolean,default:!1},isAITranslate:{type:Boolean,default:!1},onFavorite:{type:Function,default:()=>{}}},emits:["clear","favorite","loadTTS","aiTranslate","copy"],setup(e,{emit:o}){const n=o;return(l,r)=>(t.openBlock(),t.createElementBlock("div",Fl,[e.src&&e.isTTS?(t.openBlock(),t.createBlock(El,{key:0,type:e.type,onLoadTTS:r[0]||(r[0]=a=>n("loadTTS"))},null,8,["type"])):t.createCommentVNode("",!0),t.createElementVNode("div",jl,[t.createTextVNode(t.toDisplayString(e.srcLabel)+" ",1),e.phonetic?(t.openBlock(),t.createElementBlock("span",zl,"- "+t.toDisplayString(e.phonetic),1)):t.createCommentVNode("",!0)]),e.loading?(t.openBlock(),t.createBlock(qe,{key:1,class:"absolute right-6 top-2"})):t.createCommentVNode("",!0),t.createElementVNode("div",Hl,[e.hasClearBtn?(t.openBlock(),t.createBlock(jt,{key:0,onClick:r[1]||(r[1]=a=>n("clear")),disabled:e.loading},null,8,["disabled"])):t.createCommentVNode("",!0),e.src&&e.hasAIBtn?(t.openBlock(),t.createBlock(Al,{key:1,isFilled:e.isAITranslate,onClick:r[2]||(r[2]=a=>n("aiTranslate")),disabled:e.loading},null,8,["isFilled","disabled"])):t.createCommentVNode("",!0),e.src&&e.hasFavoriteBtn?(t.openBlock(),t.createBlock(Nl,{key:2,isFilled:e.isFavorite,onClick:r[3]||(r[3]=a=>n("favorite")),disabled:e.loading},null,8,["isFilled","disabled"])):t.createCommentVNode("",!0),e.src&&e.hasCopyBtn?(t.openBlock(),t.createBlock(zt,{key:3,onClick:r[4]||(r[4]=a=>n("copy")),disabled:e.loading},null,8,["disabled"])):t.createCommentVNode("",!0)])]))}},[["__scopeId","data-v-faca0157"]]),J=he("translation",()=>{const e=t.ref(null),o=t.ref(null),n=t.ref(null),l=t.ref({src:null,target:null}),r=t.ref(null),a=t.ref([]),i=t.ref([]),s=t.ref([]),c=t.ref([]),d=t.ref({src:null,target:null}),u=ae(),f=t.computed(()=>u.getLabel(e.value)),C=t.computed(()=>u.getLabel(o.value));function h(g){e.value=g.src,o.value=g.target,n.value=g.text,l.value=g.phonetic,r.value=g.result,a.value=g.dictionary,i.value=g.definitions,s.value=g.synonyms,c.value=g.examples,d.value=g.tts}function b(){e.value=null,o.value=null,n.value=null,l.value={src:null,target:null},r.value=null,a.value=[],i.value=[],s.value=[],c.value=[],d.value={src:null,target:null}}return{src:e,srcLabel:f,target:o,targetLabel:C,phonetic:l,text:n,result:r,dictionary:a,definitions:i,synonyms:s,examples:c,tts:d,init:h,reset:b}});function Zl(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}function $e(e){return typeof e=="function"?e():t.unref(e)}const Ul=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Zt=()=>{};function Wl(e,o){function n(...l){return new Promise((r,a)=>{Promise.resolve(e(()=>o.apply(this,l),{fn:o,thisArg:this,args:l})).then(r).catch(a)})}return n}function ql(e,o={}){let n,l,r=Zt;const a=s=>{clearTimeout(s),r(),r=Zt};return s=>{const c=$e(e),d=$e(o.maxWait);return n&&a(n),c<=0||d!==void 0&&d<=0?(l&&(a(l),l=null),Promise.resolve(s())):new Promise((u,f)=>{r=o.rejectOnCancel?f:u,d&&!l&&(l=setTimeout(()=>{n&&a(n),l=null,u(s())},d)),n=setTimeout(()=>{l&&a(l),l=null,u(s())},c)})}}function Gl(e,o=200,n={}){return Wl(ql(o,n),e)}function Ut(e){var o;const n=$e(e);return(o=n==null?void 0:n.$el)!=null?o:n}const Jl=Ul?window:void 0;function Yl(){const e=t.ref(!1),o=t.getCurrentInstance();return o&&t.onMounted(()=>{e.value=!0},o),e}function Ql(e){const o=Yl();return t.computed(()=>(o.value,!!e()))}function Xl(e,o,n={}){const{window:l=Jl,...r}=n;let a;const i=Ql(()=>l&&"ResizeObserver"in l),s=()=>{a&&(a.disconnect(),a=void 0)},c=t.computed(()=>Array.isArray(e)?e.map(f=>Ut(f)):[Ut(e)]),d=t.watch(c,f=>{if(s(),i.value&&l){a=new ResizeObserver(o);for(const C of f)C&&a.observe(C,r)}},{immediate:!0,flush:"post"}),u=()=>{s(),d()};return Zl(u),{isSupported:i,stop:u}}function Ve(e){var o;const n=t.ref(e==null?void 0:e.element),l=t.ref(e==null?void 0:e.input),r=(o=e==null?void 0:e.styleProp)!=null?o:"height",a=t.ref(1);function i(){var s;if(!n.value)return;let c="";n.value.style[r]="1px",a.value=(s=n.value)==null?void 0:s.scrollHeight,e!=null&&e.styleTarget?$e(e.styleTarget).style[r]=`${a.value}px`:c=`${a.value}px`,n.value.style[r]=c}return t.watch([l,n],()=>t.nextTick(i),{immediate:!0}),t.watch(a,()=>{var s;return(s=e==null?void 0:e.onResize)==null?void 0:s.call(e)}),Xl(n,()=>i()),e!=null&&e.watch&&t.watch(e.watch,i,{immediate:!0,deep:!0}),{textarea:n,input:l,triggerResize:i}}const Kl={class:"bg-base-100 relative z-10 border border-base-300 rounded"},er=G({__name:"Input",props:{text:{type:String,default:""},isTTS:{type:Boolean,default:!0}},emits:["change","clear","loadTTS"],setup(e,{emit:o}){const n=J(),l=e,r=t.ref(l.text),a=t.computed(()=>n.src),i=t.computed(()=>n.srcLabel),s=t.computed(()=>{var b;return(b=n.phonetic)==null?void 0:b.src}),{textarea:c}=Ve({input:r,styleProp:"minHeight"}),d=o,u=Gl(()=>{d("change",r.value)},se.INPUT_DEBOUNCE);t.onMounted(()=>{h()});function f(){if(!r.value){C();return}u()}function C(){d("clear"),r.value="",c.value.focus()}async function h(){await t.nextTick(),c.value.select()}return t.watch(()=>l.text,b=>{r.value!==b&&h(),r.value=b}),(b,g)=>(t.openBlock(),t.createElementBlock("div",Kl,[t.createVNode(Ht,{src:a.value,srcLabel:i.value,isTTS:e.isTTS,type:"src",phonetic:s.value,hasClearBtn:r.value.length>0,onClear:C,onLoadTTS:g[0]||(g[0]=S=>d("loadTTS"))},null,8,["src","srcLabel","isTTS","phonetic","hasClearBtn"]),t.withDirectives(t.createElementVNode("textarea",{ref_key:"textarea",ref:c,"onUpdate:modelValue":g[1]||(g[1]=S=>r.value=S),class:"w-full outline-none px-2 pr-8 bg-transparent text-base-content resize-none pb-3 overflow-x-hidden overflow-y-hidden",autofocus:"",rows:"2",onInput:f,onFocus:h},null,544),[[t.vModelText,r.value,void 0,{trim:!0}]])]))}},[["__scopeId","data-v-66ae5655"]]),tr={class:"bg-base-100 relative z-10 rounded-md h-full"},nr={class:"bg-transparent"},or=G({__name:"Result",props:{isFavoriteFeatureEnabled:Boolean,isAITranslateFeatureEnabled:Boolean,isAITranslate:Boolean,isFavorite:Boolean,isTTS:{type:Boolean,default:!0}},emits:["loadTTS","favorite","aiTranslate","copy"],setup(e,{emit:o}){const n=J(),l=t.computed(()=>n.result),r=t.computed(()=>n.target),a=t.computed(()=>n.targetLabel),i=t.computed(()=>{var C;return(C=n.phonetic)==null?void 0:C.target}),s=ne(),c=t.computed(()=>s.isLoading("translation")),{textarea:d,input:u}=Ve({input:l,styleProp:"minHeight"}),f=o;return(C,h)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["relative p-0.5 bg-[length:300%_300%] bg-[position:0%_50%] border border-base-300 rounded",{"bg-gradient-to-br from-[#8556f0] via-[#d6b379] via-[#6bedd1] to-[#439beb] animate-moveGradient border border-base-100":e.isAITranslate&&!c.value}])},[t.createElementVNode("div",tr,[t.createVNode(Ht,{loading:c.value,src:r.value,srcLabel:a.value,isTTS:e.isTTS,type:"target",hasFavoriteBtn:e.isFavoriteFeatureEnabled,hasAIBtn:e.isAITranslateFeatureEnabled,hasCopyBtn:!0,isFavorite:e.isFavorite,isAITranslate:e.isAITranslate,phonetic:i.value,onFavorite:h[0]||(h[0]=b=>f("favorite")),onLoadTTS:h[1]||(h[1]=b=>f("loadTTS")),onAiTranslate:h[2]||(h[2]=b=>f("aiTranslate")),onCopy:h[3]||(h[3]=b=>f("copy"))},null,8,["loading","src","srcLabel","isTTS","hasFavoriteBtn","hasAIBtn","isFavorite","isAITranslate","phonetic"]),t.createElementVNode("div",nr,[t.withDirectives(t.createElementVNode("textarea",{ref_key:"textarea",ref:d,"onUpdate:modelValue":h[4]||(h[4]=b=>t.isRef(u)?u.value=b:null),class:"w-full outline-none px-2 pr-8 bg-transparent text-base-content resize-none pb-3 overflow-x-hidden overflow-y-hidden",readonly:"",rows:"2",spellcheck:"false"},null,512),[[t.vModelText,t.unref(u)]])])])],2))}},[["__scopeId","data-v-88599360"]]),lr={class:"btn btn-xs btn-circle btn-ghost"},Be={__name:"ToggleBtn",props:{isExpanded:Boolean},setup(e){const o=e;return(n,l)=>(t.openBlock(),t.createElementBlock("button",lr,[o.isExpanded?(t.openBlock(),t.createBlock(t.unref(ko),{key:0,class:"w-7 text-base-content/50"})):(t.openBlock(),t.createBlock(t.unref(Eo),{key:1,class:"w-7 text-base-content/50"}))]))}},rr=t.createElementVNode("h2",{class:"card-title text-base font-bold text-base-content"},"Dictionary",-1),ar={class:"capitalize text-xs font-normal text-base-content/70 mb-1"},sr={class:"list-none list-inside"},ir=["onClick"],cr={class:"text-sm font-normal text-base-content/80 leading-4"},dr={__name:"Dictionary",emits:["translate"],setup(e,{emit:o}){const n=t.ref(!0),l=J(),r=ae(),a=t.computed(()=>l.dictionary),i=o,s=()=>{n.value=!n.value},c=d=>{i("translate",d,l.target,l.src),r.src=l.target,r.target=l.src,window.scrollTo(0,0)};return(d,u)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"flex justify-between items-center",onClick:s},[rr,t.createVNode(Be,{isExpanded:n.value},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",n.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value,(f,C)=>(t.openBlock(),t.createElementBlock("li",{key:`${f.pos}-${C}`,class:"mb-2"},[t.createElementVNode("h5",ar,t.toDisplayString(f.pos),1),t.createElementVNode("ul",sr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f.items,(h,b)=>(t.openBlock(),t.createElementBlock("li",{key:`${h.word}-${b}`},[t.createElementVNode("span",{class:"m-0.5 font-normal badge badge-ghost bg-primary text-primary-content cursor-pointer border-0 rounded",onClick:g=>c(h.word)},t.toDisplayString(h.word),9,ir),t.createElementVNode("small",cr," - "+t.toDisplayString(h.reverse_translation.join(", ")),1)]))),128))])]))),128))])],2)],64))}},ur=t.createElementVNode("h2",{class:"card-title text-base font-bold text-base-content"},"Definitions",-1),fr={class:"capitalize text-xs font-normal text-base-content/70 mb-1"},pr={class:"text-sm text-base-content list-disc list-outside ml-5"},mr=t.createElementVNode("br",null,null,-1),hr={key:0,class:"italic text-base-content/70"},gr={__name:"Definition",setup(e){const o=t.ref(!0),n=J(),l=t.computed(()=>n.definitions),r=()=>{o.value=!o.value};return(a,i)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"flex justify-between items-center",onClick:r},[ur,t.createVNode(Be,{isExpanded:o.value},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",o.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(s,c)=>(t.openBlock(),t.createElementBlock("li",{key:`${s.pos}-${c}`,class:"mb-2"},[t.createElementVNode("h5",fr,t.toDisplayString(s.pos),1),t.createElementVNode("ul",pr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.items,(d,u)=>(t.openBlock(),t.createElementBlock("li",{key:`${d.gloss}-${u}`,class:"mb-1"},[t.createElementVNode("span",null,t.toDisplayString(d.gloss),1),mr,d.example?(t.openBlock(),t.createElementBlock("small",hr,'"'+t.toDisplayString(d.example)+'"',1)):t.createCommentVNode("",!0)]))),128))])]))),128))])],2)],64))}},br=t.createElementVNode("h2",{class:"card-title text-base font-bold text-base-content"},"Examples",-1),Cr={class:"text-base-content text-sm list-disc list-outside ml-5 my-2"},xr=["innerHTML"],vr={__name:"Example",setup(e){const o=t.ref(!0),n=J(),l=t.computed(()=>n.examples),r=()=>{o.value=!o.value};return(a,i)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"flex justify-between items-center",onClick:r},[br,t.createVNode(Be,{isExpanded:o.value},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",o.value?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",Cr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(s,c)=>(t.openBlock(),t.createElementBlock("li",{key:`${s.definition_id}-${c}`,innerHTML:s},null,8,xr))),128))])],2)],64))}},yr=t.createElementVNode("h2",{class:"card-title text-base font-bold text-base-content"},"Synonyms",-1),wr={class:"capitalize text-xs font-normal text-base-content/70 mb-1"},Er={class:"list-none list-inside"},_r={class:"flex flex-wrap"},kr=["onClick"],Sr={__name:"Synonyms",emits:["translate"],setup(e,{emit:o}){const n=t.ref(!0),l=J(),r=t.computed(()=>l.synonyms),a=o,i=()=>{n.value=!n.value},s=c=>{a("translate",c),window.scrollTo(0,0)};return(c,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"flex justify-between items-center",onClick:i},[yr,t.createVNode(Be,{isExpanded:n.value},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",n.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,(u,f)=>(t.openBlock(),t.createElementBlock("li",{key:`${u.pos}-${f}`,class:"mb-2"},[t.createElementVNode("h5",wr,t.toDisplayString(u.pos),1),t.createElementVNode("ul",Er,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.items,(C,h)=>(t.openBlock(),t.createElementBlock("li",{key:`${C.word}-${h}`,class:"mb-2"},[t.createElementVNode("div",_r,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(C.synonym,(b,g)=>(t.openBlock(),t.createElementBlock("span",{key:`${b}-${g}`,class:"m-0.5 ml-0 font-normal badge badge-ghost bg-primary text-primary-content cursor-pointer border-0 rounded",onClick:S=>s(b)},t.toDisplayString(b),9,kr))),128))])]))),128))])]))),128))])],2)],64))}},Tr=["disabled"],$r=[t.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12h1m-3.5-6.5 1-1M12 3V2M5.5 5.5l-1-1M3 12H2m8 10h4m3-10a5 5 0 1 0-7 4.584V19h4v-2.416A5.001 5.001 0 0 0 17 12z"},null,-1)],Vr=[t.createElementVNode("path",{fill:"currentColor",d:"M12 7a5 5 0 0 0-2 9.584V19h4v-2.416A5.001 5.001 0 0 0 12 7z"},null,-1),t.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12h1m-3.5-6.5 1-1M12 3V2M5.5 5.5l-1-1M3 12H2m8 10h4m3-10a5 5 0 1 0-7 4.584V19h4v-2.416A5.001 5.001 0 0 0 17 12z"},null,-1)],Br={__name:"ChevronAIBtn",props:{disabled:Boolean,isExpanded:Boolean},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled},[e.isExpanded?(t.openBlock(),t.createElementBlock("svg",{key:1,class:t.normalizeClass(["w-6 h-6 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none"},Vr,2)):(t.openBlock(),t.createElementBlock("svg",{key:0,class:t.normalizeClass(["w-6 h-6 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none"},$r,2))],10,Tr))}},Nr={class:"p-2 gap-0 relative z-10"},Lr={class:"flex justify-between items-center"},Or=t.createElementVNode("h2",{class:"card-title text-base font-bold text-base-content"},"AI Summary",-1),Ir={class:"flex items-center"},Mr={class:"tooltip tooltip-bottom tooltip-small before:!bg-base-100 before:!border before:!border-solid before:!border-base-300 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded before:!text-base-content/70 before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":"AI Summarize"},Ar={key:0,class:"text-base-content list-none list-outside"},Rr=["innerHTML"],Dr={__name:"AIExplanation",props:{isAIExplain:{type:Boolean,default:!1,required:!0},explanation:{type:Object,required:!0}},emits:["aiExplain"],setup(e,{emit:o}){const n=ne(),l=t.computed(()=>n.isLoading("aiExplanation")),r=o;function a(){r("aiExplain")}return(i,s)=>{var c,d;return t.openBlock(),t.createElementBlock("div",Nr,[t.createElementVNode("div",Lr,[Or,t.createElementVNode("div",Ir,[l.value?(t.openBlock(),t.createBlock(qe,{key:0})):t.createCommentVNode("",!0),t.createElementVNode("div",Mr,[t.createVNode(Br,{isExpanded:e.isAIExplain,disabled:l.value,onClick:a},null,8,["isExpanded","disabled"])])])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",e.isAIExplain?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"])},[(c=e.explanation)!=null&&c.result?(t.openBlock(),t.createElementBlock("ul",Ar,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(((d=e.explanation)==null?void 0:d.result.split(`
|
|
18
|
-
`))||[],(u,f)=>(t.openBlock(),t.createElementBlock("li",{key:`${u}-${f}`,innerHTML:u},null,8,Rr))),128))])):t.createCommentVNode("",!0)],2)])}}};function Pr(){document.documentElement.setAttribute("dir","rtl")}function Fr(){document.documentElement.removeAttribute("dir")}const Wt={supportRTL:Pr,removeRTL:Fr},jr=["ar","fa","iw","yi","ur","pa"],zr=e=>(t.pushScopeId("data-v-08f9cb53"),e=e(),t.popScopeId(),e),Hr={class:"pb-6"},Zr={class:"flex flex-col lg:flex-row lg:gap-2"},Ur={id:"input",class:"w-full lg:w-[calc(50%-1rem)] flex mt-1"},Wr=zr(()=>t.createElementVNode("div",{class:"w-6 h-4 mx-auto hidden lg:block"},null,-1)),qr={class:"w-full lg:w-[calc(50%-1rem)] flex mt-1"},Gr={key:0,class:"masonry-container mt-1"},Jr={key:0,class:"masonry-item border border-base-300 bg-base-100"},Yr={key:1,class:"masonry-item border border-base-300 bg-base-100"},Qr={class:"p-2"},Xr={key:2,class:"masonry-item border border-base-300 bg-base-100"},Kr={class:"p-2"},ea={key:3,class:"masonry-item border border-base-300 bg-base-100"},ta={class:"p-2"},na={key:4,class:"masonry-item border border-base-300 bg-base-100"},oa={class:"p-2"},la={key:1,class:"text-base-content italic font-medium"},ra=G({__name:"TranslateTab",props:{opt:Object,languages:Object,translation:Object,explanation:Object,tts:Object,isTTS:Boolean,isFavoriteFeatureEnabled:Boolean,isAITranslateFeatureEnabled:Boolean,isFavorite:Boolean,isAITranslate:Boolean,isAIExplain:Boolean,aiExplainMinLength:Number},emits:["opt","translate","loadTTS","favorite","aiTranslate","aiExplain","copy"],setup(e,{emit:o}){const n=t.ref(""),l=e,r=t.inject("translationStore"),a=t.inject("ttsStore"),i=t.inject("languageStore"),s=t.inject("loaderStore"),c=o,d=()=>{const k=l.opt.target;jr.includes(k)?Wt.supportRTL():Wt.removeRTL()};t.watch(()=>l.translation,k=>{s.setLoading("translation",!1),k&&(n.value=k.text,r.init(k),a.reset())},{immediate:!0}),t.watch([()=>l.explanation,()=>l.isAIExplain],([k])=>{k!=null&&k.result&&s.setLoading("aiExplanation",!1)},{immediate:!0,deep:!0}),t.watch(()=>l.tts,k=>{if(!k){a.reset();return}a.set(k)},{immediate:!0}),t.watch([()=>l.opt,()=>l.languages],([k,v])=>{i.init(k,v),d()}),t.watch([()=>i.src,()=>i.target],([k,v])=>{c("opt",{src:k,target:v}),h(n.value)}),t.onMounted(()=>{i.init(l.opt,l.languages),d()});function u(){n.value="",l.isAITranslate&&b(),r.reset()}function f(k){n.value=k,h(k)}function C(k){const v=k==="src"?r.text:r.result;c("loadTTS",{type:k,data:v})}function h(k,v=i.src,x=i.target){k&&(S(),n.value=k,s.setLoading("translation",!0),c("translate",{src:v,target:x,text:k}))}function b(){l.isAITranslate||s.setLoading("translation",!0),c("aiTranslate",{src:i.src,target:i.target,text:n.value})}function g(){l.isAIExplain||s.setLoading("aiExplanation",!0),c("aiExplain",{src:i.src,target:i.target,text:n.value})}function S(){const k=document.getElementById("input");k&&k.getBoundingClientRect().top<0&&k.scrollIntoView({behavior:"smooth"})}return(k,v)=>{var x,y,w,V,E;return t.openBlock(),t.createElementBlock("div",Hr,[t.createVNode(gl),t.createElementVNode("div",Zr,[t.createElementVNode("div",Ur,[t.createVNode(er,{text:n.value,isTTS:e.isTTS,onChange:f,onClear:u,onLoadTTS:v[0]||(v[0]=_=>C("src")),class:"flex-grow flex flex-col"},null,8,["text","isTTS"])]),Wr,t.createElementVNode("div",qr,[t.createVNode(or,{isFavoriteFeatureEnabled:e.isFavoriteFeatureEnabled,isAITranslateFeatureEnabled:e.isAITranslateFeatureEnabled,isAITranslate:e.isAITranslate,isFavorite:e.isFavorite,isTTS:e.isTTS,onCopy:v[1]||(v[1]=_=>{var B;return k.$emit("copy",(B=t.unref(r))==null?void 0:B.result)}),onAiTranslate:b,onFavorite:v[2]||(v[2]=_=>k.$emit("favorite")),onLoadTTS:v[3]||(v[3]=_=>C("target")),class:"flex-grow flex flex-col"},null,8,["isFavoriteFeatureEnabled","isAITranslateFeatureEnabled","isAITranslate","isFavorite","isTTS"])])]),e.translation?(t.openBlock(),t.createElementBlock("div",Gr,[((x=t.unref(r).result)==null?void 0:x.length)>e.aiExplainMinLength?(t.openBlock(),t.createElementBlock("div",Jr,[t.createVNode(Dr,{isAIExplain:e.isAIExplain,explanation:e.explanation,onAiExplain:g},null,8,["isAIExplain","explanation"])])):t.createCommentVNode("",!0),(y=t.unref(r).dictionary)!=null&&y.length?(t.openBlock(),t.createElementBlock("div",Yr,[t.createElementVNode("div",Qr,[t.createVNode(dr,{onTranslate:h})])])):t.createCommentVNode("",!0),(w=t.unref(r).definitions)!=null&&w.length?(t.openBlock(),t.createElementBlock("div",Xr,[t.createElementVNode("div",Kr,[t.createVNode(gr)])])):t.createCommentVNode("",!0),(V=t.unref(r).synonyms)!=null&&V.length?(t.openBlock(),t.createElementBlock("div",ea,[t.createElementVNode("div",ta,[t.createVNode(Sr,{onTranslate:h})])])):t.createCommentVNode("",!0),(E=t.unref(r).examples)!=null&&E.length?(t.openBlock(),t.createElementBlock("div",na,[t.createElementVNode("div",oa,[t.createVNode(vr)])])):t.createCommentVNode("",!0)])):(t.openBlock(),t.createElementBlock("span",la,"Service unavailable"))])}}},[["__scopeId","data-v-08f9cb53"]]),aa=["disabled"],sa=[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)],ia={__name:"RetryBtn",props:{disabled:Boolean},emits:["click"],setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("button",{class:"bg-base-100 rounded-full hover:bg-base-200 focus:outline-none active:scale-95",onClick:n[0]||(n[0]=l=>o.$emit("click")),disabled:e.disabled,"aria-label":"Retry"},[(t.openBlock(),t.createElementBlock("svg",{class:t.normalizeClass(["h-5 w-5 text-primary",{"opacity-50":e.disabled}]),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},sa,2))],8,aa))}},ca=["data-tip"],da=["disabled"],ua=[t.createElementVNode("path",{d:"M2.293,21.707a1,1,0,0,0,1.414,0l3.2-3.2A9.581,9.581,0,0,0,12,20c4.325,0,8.227-3,9.938-7.654a.993.993,0,0,0,0-.692A12.6,12.6,0,0,0,18.7,6.719l3.012-3.012a1,1,0,1,0-1.414-1.414l-3.2,3.2A9.581,9.581,0,0,0,12,4C7.675,4,3.773,7,2.062,11.654a.993.993,0,0,0,0,.692,12.6,12.6,0,0,0,3.243,4.935L2.293,20.293A1,1,0,0,0,2.293,21.707ZM17.266,8.148A10.454,10.454,0,0,1,19.929,12c-1.478,3.657-4.556,6-7.929,6a7.52,7.52,0,0,1-3.632-.954l1.613-1.613A3.947,3.947,0,0,0,12,16a4,4,0,0,0,4-4,3.947,3.947,0,0,0-.567-2.019Zm-7.191,4.363A1.96,1.96,0,0,1,10,12a2,2,0,0,1,2-2,1.96,1.96,0,0,1,.511.075Zm3.85-1.022A1.96,1.96,0,0,1,14,12a2,2,0,0,1-2,2,1.96,1.96,0,0,1-.511-.075ZM4.071,12C5.549,8.343,8.627,6,12,6a7.52,7.52,0,0,1,3.632.954L14.019,8.567A3.947,3.947,0,0,0,12,8a4,4,0,0,0-4,4,3.947,3.947,0,0,0,.567,2.019L6.734,15.852A10.454,10.454,0,0,1,4.071,12Z"},null,-1)],fa=[t.createElementVNode("path",{d:"M12,7a4,4,0,1,0,4,4A4,4,0,0,0,12,7Zm0,6a2,2,0,1,1,2-2A2,2,0,0,1,12,13Zm6.5,2v1.5H20a1,1,0,0,1,0,2H18.5V20a1,1,0,0,1-2,0V18.5H15a1,1,0,0,1,0-2h1.5V15a1,1,0,0,1,2,0Zm3.438-4.345a.987.987,0,0,1,0,.69,13.339,13.339,0,0,1-1.08,2.264,1,1,0,1,1-1.715-1.028A11.3,11.3,0,0,0,19.928,11C18.451,7.343,15.373,5,12,5S5.549,7.343,4.072,11a9.315,9.315,0,0,0,6.167,5.787,1,1,0,1,1-.478,1.942,11.393,11.393,0,0,1-7.7-7.383.99.99,0,0,1,0-.691C3.773,6,7.674,3,12,3S20.227,6,21.938,10.655Z"},null,-1)],pa={__name:"ToggleDiffBtn",props:{disabled:Boolean,isDiffMode:Boolean},emits:["toggle"],setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",{class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":e.isDiffMode?"Hide Differences":"Show Differences"},[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled,onClick:n[0]||(n[0]=l=>o.$emit("toggle"))},[e.isDiffMode?(t.openBlock(),t.createElementBlock("svg",{key:1,class:t.normalizeClass(["w-4 h-4 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},fa,2)):(t.openBlock(),t.createElementBlock("svg",{key:0,class:t.normalizeClass(["w-4 h-4 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},ua,2))],10,da)],8,ca))}},ma={class:"flex flex-row px-2 pr-10 items-center bg-transparent relative"},ha={class:"absolute right-1 top-1 flex flex-col items-center gap-0"},qt={__name:"InputBtnGroup",props:{loading:{type:Boolean,default:!1},src:{type:String,default:""},hasCopyBtn:{type:Boolean,default:!1},hasClearBtn:{type:Boolean,default:!1},showDiffToggle:{type:Boolean,default:!1},isDiffMode:{type:Boolean,default:!1},hasInfoBtn:{type:Boolean,default:!1}},emits:["copy","clear","toggleDiff","info"],setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",ma,[e.loading?(t.openBlock(),t.createBlock(qe,{key:0,class:"absolute right-6 top-2"})):t.createCommentVNode("",!0),t.createElementVNode("div",ha,[e.showDiffToggle?(t.openBlock(),t.createBlock(pa,{key:0,disabled:e.loading,isDiffMode:e.isDiffMode,onToggle:n[0]||(n[0]=l=>o.$emit("toggleDiff"))},null,8,["disabled","isDiffMode"])):t.createCommentVNode("",!0),e.hasClearBtn&&e.src?(t.openBlock(),t.createBlock(jt,{key:1,onClick:n[1]||(n[1]=l=>o.$emit("clear")),disabled:e.loading},null,8,["disabled"])):t.createCommentVNode("",!0),e.hasCopyBtn&&e.src?(t.openBlock(),t.createBlock(zt,{key:2,onClick:n[2]||(n[2]=l=>o.$emit("copy"))})):t.createCommentVNode("",!0)])]))}},ga={class:"bg-base-100 relative z-10 border border-base-300 rounded"},ba=["onKeydown","placeholder"],Ca=G({__name:"Input",props:{text:{type:String,default:""}},emits:["change","clear","improve"],setup(e,{emit:o}){const n=e,l=t.ref(n.text),{textarea:r}=Ve({input:l,styleProp:"minHeight"}),a=o;function i(){if(!l.value){s();return}a("change",l.value)}function s(){a("clear"),l.value="",r.value.focus()}function c(){r.value&&r.value.select()}function d(){l.value&&a("improve",l.value)}return t.watch(()=>n.text,u=>{l.value!==u&&(l.value=u,t.nextTick(c))}),t.onMounted(()=>{l.value=n.text,t.nextTick(()=>{r.value.focus(),c()})}),(u,f)=>(t.openBlock(),t.createElementBlock("div",ga,[t.createVNode(qt,{src:e.text,hasClearBtn:!0,hasInfoBtn:!0,onClear:s,class:"mb-1"},null,8,["src"]),t.withDirectives(t.createElementVNode("textarea",{ref_key:"textarea",ref:r,"onUpdate:modelValue":f[0]||(f[0]=C=>l.value=C),class:"w-full outline-none px-2 pr-8 bg-transparent text-base-content resize-none pb-3 overflow-x-hidden overflow-y-hidden h-full",autofocus:"",rows:"2",onInput:i,onFocus:c,onKeydown:t.withKeys(t.withModifiers(d,["ctrl","prevent"]),["enter"]),placeholder:`Min ${t.unref(se).IMPROVE_INPUT_MIN_LENGTH} characters. ${t.unref(Me)?"":"Ctrl+Enter to improve"}`},null,40,ba),[[t.vModelText,l.value,void 0,{trim:!0}]])]))}},[["__scopeId","data-v-66614870"]]);function Z(){}Z.prototype={diff:function(o,n){var l,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=r.callback;typeof r=="function"&&(a=r,r={});var i=this;function s(y){return y=i.postProcess(y,r),a?(setTimeout(function(){a(y)},0),!0):y}o=this.castInput(o,r),n=this.castInput(n,r),o=this.removeEmpty(this.tokenize(o,r)),n=this.removeEmpty(this.tokenize(n,r));var c=n.length,d=o.length,u=1,f=c+d;r.maxEditLength!=null&&(f=Math.min(f,r.maxEditLength));var C=(l=r.timeout)!==null&&l!==void 0?l:1/0,h=Date.now()+C,b=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(b[0],n,o,0,r);if(b[0].oldPos+1>=d&&g+1>=c)return s(Gt(i,b[0].lastComponent,n,o,i.useLongestToken));var S=-1/0,k=1/0;function v(){for(var y=Math.max(S,-u);y<=Math.min(k,u);y+=2){var w=void 0,V=b[y-1],E=b[y+1];V&&(b[y-1]=void 0);var _=!1;if(E){var B=E.oldPos-y;_=E&&0<=B&&B<c}var p=V&&V.oldPos+1<d;if(!_&&!p){b[y]=void 0;continue}if(!p||_&&V.oldPos<E.oldPos?w=i.addToPath(E,!0,!1,0,r):w=i.addToPath(V,!1,!0,1,r),g=i.extractCommon(w,n,o,y,r),w.oldPos+1>=d&&g+1>=c)return s(Gt(i,w.lastComponent,n,o,i.useLongestToken));b[y]=w,w.oldPos+1>=d&&(k=Math.min(k,y-1)),g+1>=c&&(S=Math.max(S,y+1))}u++}if(a)(function y(){setTimeout(function(){if(u>f||Date.now()>h)return a();v()||y()},0)})();else for(;u<=f&&Date.now()<=h;){var x=v();if(x)return x}},addToPath:function(o,n,l,r,a){var i=o.lastComponent;return i&&!a.oneChangePerToken&&i.added===n&&i.removed===l?{oldPos:o.oldPos+r,lastComponent:{count:i.count+1,added:n,removed:l,previousComponent:i.previousComponent}}:{oldPos:o.oldPos+r,lastComponent:{count:1,added:n,removed:l,previousComponent:i}}},extractCommon:function(o,n,l,r,a){for(var i=n.length,s=l.length,c=o.oldPos,d=c-r,u=0;d+1<i&&c+1<s&&this.equals(l[c+1],n[d+1],a);)d++,c++,u++,a.oneChangePerToken&&(o.lastComponent={count:1,previousComponent:o.lastComponent,added:!1,removed:!1});return u&&!a.oneChangePerToken&&(o.lastComponent={count:u,previousComponent:o.lastComponent,added:!1,removed:!1}),o.oldPos=c,d},equals:function(o,n,l){return l.comparator?l.comparator(o,n):o===n||l.ignoreCase&&o.toLowerCase()===n.toLowerCase()},removeEmpty:function(o){for(var n=[],l=0;l<o.length;l++)o[l]&&n.push(o[l]);return n},castInput:function(o){return o},tokenize:function(o){return Array.from(o)},join:function(o){return o.join("")},postProcess:function(o){return o}};function Gt(e,o,n,l,r){for(var a=[],i;o;)a.push(o),i=o.previousComponent,delete o.previousComponent,o=i;a.reverse();for(var s=0,c=a.length,d=0,u=0;s<c;s++){var f=a[s];if(f.removed)f.value=e.join(l.slice(u,u+f.count)),u+=f.count;else{if(!f.added&&r){var C=n.slice(d,d+f.count);C=C.map(function(h,b){var g=l[u+b];return g.length>h.length?g:h}),f.value=e.join(C)}else f.value=e.join(n.slice(d,d+f.count));d+=f.count,f.added||(u+=f.count)}}return a}function Jt(e,o){var n;for(n=0;n<e.length&&n<o.length;n++)if(e[n]!=o[n])return e.slice(0,n);return e.slice(0,n)}function Yt(e,o){var n;if(!e||!o||e[e.length-1]!=o[o.length-1])return"";for(n=0;n<e.length&&n<o.length;n++)if(e[e.length-(n+1)]!=o[o.length-(n+1)])return e.slice(-n);return e.slice(-n)}function Je(e,o,n){if(e.slice(0,o.length)!=o)throw Error("string ".concat(JSON.stringify(e)," doesn't start with prefix ").concat(JSON.stringify(o),"; this is a bug"));return n+e.slice(o.length)}function Ye(e,o,n){if(!o)return e+n;if(e.slice(-o.length)!=o)throw Error("string ".concat(JSON.stringify(e)," doesn't end with suffix ").concat(JSON.stringify(o),"; this is a bug"));return e.slice(0,-o.length)+n}function ge(e,o){return Je(e,o,"")}function Ne(e,o){return Ye(e,o,"")}function Qt(e,o){return o.slice(0,xa(e,o))}function xa(e,o){var n=0;e.length>o.length&&(n=e.length-o.length);var l=o.length;e.length<o.length&&(l=e.length);var r=Array(l),a=0;r[0]=0;for(var i=1;i<l;i++){for(o[i]==o[a]?r[i]=r[a]:r[i]=a;a>0&&o[i]!=o[a];)a=r[a];o[i]==o[a]&&a++}a=0;for(var s=n;s<e.length;s++){for(;a>0&&e[s]!=o[a];)a=r[a];e[s]==o[a]&&a++}return a}var Le="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",va=new RegExp("[".concat(Le,"]+|\\s+|[^").concat(Le,"]"),"ug"),Oe=new Z;Oe.equals=function(e,o,n){return n.ignoreCase&&(e=e.toLowerCase(),o=o.toLowerCase()),e.trim()===o.trim()},Oe.tokenize=function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n;if(o.intlSegmenter){if(o.intlSegmenter.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');n=Array.from(o.intlSegmenter.segment(e),function(a){return a.segment})}else n=e.match(va)||[];var l=[],r=null;return n.forEach(function(a){/\s/.test(a)?r==null?l.push(a):l.push(l.pop()+a):/\s/.test(r)?l[l.length-1]==r?l.push(l.pop()+a):l.push(r+a):l.push(a),r=a}),l},Oe.join=function(e){return e.map(function(o,n){return n==0?o:o.replace(/^\s+/,"")}).join("")},Oe.postProcess=function(e,o){if(!e||o.oneChangePerToken)return e;var n=null,l=null,r=null;return e.forEach(function(a){a.added?l=a:a.removed?r=a:((l||r)&&Xt(n,r,l,a),n=a,l=null,r=null)}),(l||r)&&Xt(n,r,l,null),e};function Xt(e,o,n,l){if(o&&n){var r=o.value.match(/^\s*/)[0],a=o.value.match(/\s*$/)[0],i=n.value.match(/^\s*/)[0],s=n.value.match(/\s*$/)[0];if(e){var c=Jt(r,i);e.value=Ye(e.value,i,c),o.value=ge(o.value,c),n.value=ge(n.value,c)}if(l){var d=Yt(a,s);l.value=Je(l.value,s,d),o.value=Ne(o.value,d),n.value=Ne(n.value,d)}}else if(n)e&&(n.value=n.value.replace(/^\s*/,"")),l&&(l.value=l.value.replace(/^\s*/,""));else if(e&&l){var u=l.value.match(/^\s*/)[0],f=o.value.match(/^\s*/)[0],C=o.value.match(/\s*$/)[0],h=Jt(u,f);o.value=ge(o.value,h);var b=Yt(ge(u,h),C);o.value=Ne(o.value,b),l.value=Je(l.value,u,b),e.value=Ye(e.value,u,u.slice(0,u.length-b.length))}else if(l){var g=l.value.match(/^\s*/)[0],S=o.value.match(/\s*$/)[0],k=Qt(S,g);o.value=Ne(o.value,k)}else if(e){var v=e.value.match(/\s*$/)[0],x=o.value.match(/^\s*/)[0],y=Qt(v,x);o.value=ge(o.value,y)}}var Kt=new Z;Kt.tokenize=function(e){var o=new RegExp("(\\r?\\n)|[".concat(Le,"]+|[^\\S\\n\\r]+|[^").concat(Le,"]"),"ug");return e.match(o)||[]};function ya(e,o,n){return Kt.diff(e,o,n)}var Qe=new Z;Qe.tokenize=function(e,o){o.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
17
|
+
This will fail in production.`);s=fe,s._s.has(l)||(a?We(l,o,r,s):Dt(l,r,s),process.env.NODE_ENV!=="production"&&(i._pinia=s));const u=s._s.get(l);if(process.env.NODE_ENV!=="production"&&c){const f="__hot:"+l,C=a?We(f,o,r,s,!0):Dt(f,P({},r),s,!0);c._hotUpdate(C),delete s.state.value[f],s._s.delete(f)}if(process.env.NODE_ENV!=="production"&&Ee){const f=t.getCurrentInstance();if(f&&f.proxy&&!c){const C=f.proxy,h="_pStores"in C?C._pStores:C._pStores={};h[l]=u}}return u}return i.$id=l,i}const ne=he("loader",()=>{const e=t.ref({translation:!1,aiExplanation:!1,writing:!1});return{loadingStates:e,setLoading:(l,r)=>{e.value[l]=r},isLoading:l=>e.value[l]}}),Pt={__name:"Select",props:t.mergeModels({languages:{type:Object,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const o=ne(),n=e,l=t.useModel(e,"modelValue"),r=t.ref(""),a=t.ref(null),i=t.computed(()=>Object.entries(n.languages).filter(([,c])=>c.toLowerCase().includes(r.value.toLowerCase()))),s=c=>{c.target.value="",r.value="",a.value&&a.value.$el.click()};return(c,d)=>(t.openBlock(),t.createBlock(t.unref(vo),{modelValue:l.value,"onUpdate:modelValue":d[3]||(d[3]=u=>l.value=u),disabled:t.unref(o).loading,as:"div",class:"relative mt-1"},{default:t.withCtx(()=>[t.createVNode(t.unref(wo),{class:"w-full bg-base-100 border border-base-300 rounded py-2.5 pl-3 pr-10 text-sm text-base-content font-medium focus:outline-none focus:ring-0.5 focus:ring-primary focus:border-primary",onChange:d[0]||(d[0]=u=>r.value=u.target.value),displayValue:u=>e.languages[u],onFocus:d[1]||(d[1]=u=>s(u))},null,8,["displayValue"]),t.createVNode(t.unref(yo),{ref_key:"btnSelect",ref:a,class:"absolute inset-y-0 right-0 flex items-center pr-2"},{default:t.withCtx(()=>[t.createVNode(t.unref(So),{class:"h-5 w-5 text-base-content/50","aria-hidden":"true",onClick:d[2]||(d[2]=u=>s(u))})]),_:1},512),t.createVNode(t.unref(Eo),{class:"absolute mt-1 max-h-60 w-full overflow-auto rounded-md bg-base-100 py-1 text-base shadow-lg ring-1 ring-base-300 focus:outline-none sm:text-sm z-50"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.value,([u,f])=>(t.openBlock(),t.createBlock(t.unref(_o),{key:u,value:u},{default:t.withCtx(({active:C,selected:h})=>[t.createElementVNode("li",{class:t.normalizeClass(["relative cursor-default select-none py-2 pl-3 pr-9",C?"bg-primary text-primary-content":"text-base-content"])},[t.createElementVNode("span",{class:t.normalizeClass(["block truncate",h&&"font-semibold"])},t.toDisplayString(f),3)],2)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue","disabled"]))}},nl=["disabled"],ol=[t.createStaticVNode('<svg class="w-4 h-4 text-primary" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.68688 2.3131C3.88214 2.50837 3.88214 2.82495 3.68688 3.02021L2.04043 4.66666L3.68688 6.3131C3.88214 6.50837 3.88214 6.82495 3.68688 7.02021C3.49162 7.21547 3.17504 7.21547 2.97977 7.02021L0.979775 5.02021C0.784513 4.82495 0.784513 4.50837 0.979775 4.3131L2.97977 2.3131C3.17504 2.11784 3.49162 2.11784 3.68688 2.3131Z" fill="currentColor"></path><path d="M12.3131 8.97977C12.5084 8.78451 12.825 8.78451 13.0202 8.97977L15.0202 10.9798C15.2155 11.175 15.2155 11.4916 15.0202 11.6869L13.0202 13.6869C12.825 13.8821 12.5084 13.8821 12.3131 13.6869C12.1178 13.4916 12.1178 13.175 12.3131 12.9798L13.9596 11.3333L12.3131 9.68688C12.1178 9.49161 12.1178 9.17503 12.3131 8.97977Z" fill="currentColor"></path><path d="M0.833328 4.66666C0.833328 4.39051 1.05719 4.16666 1.33333 4.16666H14.6667C14.9428 4.16666 15.1667 4.39051 15.1667 4.66666C15.1667 4.9428 14.9428 5.16666 14.6667 5.16666H1.33333C1.05719 5.16666 0.833328 4.9428 0.833328 4.66666Z" fill="currentColor"></path><path d="M0.833328 11.3333C0.833328 11.0572 1.05719 10.8333 1.33333 10.8333H14.6667C14.9428 10.8333 15.1667 11.0572 15.1667 11.3333C15.1667 11.6095 14.9428 11.8333 14.6667 11.8333H1.33333C1.05719 11.8333 0.833328 11.6095 0.833328 11.3333Z" fill="currentColor"></path></svg>',1)],ll=["disabled"],rl=[t.createStaticVNode('<svg class="w-4 h-4 text-primary" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.68688 2.3131C3.88214 2.50837 3.88214 2.82495 3.68688 3.02021L2.04043 4.66666L3.68688 6.3131C3.88214 6.50837 3.88214 6.82495 3.68688 7.02021C3.49162 7.21547 3.17504 7.21547 2.97977 7.02021L0.979775 5.02021C0.784513 4.82495 0.784513 4.50837 0.979775 4.3131L2.97977 2.3131C3.17504 2.11784 3.49162 2.11784 3.68688 2.3131Z" fill="currentColor"></path><path d="M12.3131 8.97977C12.5084 8.78451 12.825 8.78451 13.0202 8.97977L15.0202 10.9798C15.2155 11.175 15.2155 11.4916 15.0202 11.6869L13.0202 13.6869C12.825 13.8821 12.5084 13.8821 12.3131 13.6869C12.1178 13.4916 12.1178 13.175 12.3131 12.9798L13.9596 11.3333L12.3131 9.68688C12.1178 9.49161 12.1178 9.17503 12.3131 8.97977Z" fill="currentColor"></path><path d="M0.833328 4.66666C0.833328 4.39051 1.05719 4.16666 1.33333 4.16666H14.6667C14.9428 4.16666 15.1667 4.39051 15.1667 4.66666C15.1667 4.9428 14.9428 5.16666 14.6667 5.16666H1.33333C1.05719 5.16666 0.833328 4.9428 0.833328 4.66666Z" fill="currentColor"></path><path d="M0.833328 11.3333C0.833328 11.0572 1.05719 10.8333 1.33333 10.8333H14.6667C14.9428 10.8333 15.1667 11.0572 15.1667 11.3333C15.1667 11.6095 14.9428 11.8333 14.6667 11.8333H1.33333C1.05719 11.8333 0.833328 11.6095 0.833328 11.3333Z" fill="currentColor"></path></svg>',1)],al={__name:"SwapBtn",props:{isBidirect:{type:Boolean,default:!1}},emits:["swap"],setup(e,{emit:o}){const n=ne(),l=t.computed(()=>n.isLoading("translation")),r=o;return(a,i)=>e.isBidirect?(t.openBlock(),t.createElementBlock("button",{key:1,onClick:i[0]||(i[0]=s=>r("swap")),disabled:l.value},rl,8,ll)):(t.openBlock(),t.createElementBlock("button",{key:0,disabled:l.value},ol,8,nl))}},ae=he("language",()=>{const e=t.ref("auto"),o=t.ref("vi"),n=t.ref({src:[],target:[]}),l=t.computed(()=>n.value.src[e.value]),r=t.computed(()=>n.value.target[o.value]);function a(c,d){e.value=c==null?void 0:c.src,o.value=c==null?void 0:c.target,n.value=d}function i(){if(!n.value.src[o.value]||!n.value.target[e.value])return;const c=e.value;e.value=o.value,o.value=c}function s(c){return n.value.src[c]||n.value.target[c]}return{languages:n,src:e,target:o,srcLabel:l,targetLabel:r,init:a,swap:i,getLabel:s}}),sl={key:0,class:"flex flex-col"},il={class:"flex"},cl={class:"grow flex flex-col"},dl={key:0,class:"flex mt-1 space-x-1"},ul=["onClick"],fl={class:"grow flex flex-col"},pl={key:0,class:"flex mt-1 space-x-1 justify-end"},ml=["onClick"],hl={class:"flex"},gl={class:"grow flex flex-col"},bl={class:"grow flex flex-col"},Ft=3,Cl={__name:"Selects",setup(e){const o=ae(),n=t.ref([]),l=t.ref([]);function r(){o.swap()}return t.onMounted(()=>{var a,i;n.value=((a=Ce.getLocalStorage("recentSrc"))==null?void 0:a.filter(s=>!!s))||[],l.value=((i=Ce.getLocalStorage("recentTarget"))==null?void 0:i.filter(s=>!!s))||[]}),t.watch(()=>o.src,a=>{a&&(n.value.includes(a)||(n.value.unshift(a),n.value=n.value.slice(0,Ft),Ce.setLocalStorage("recentSrc",n.value)))}),t.watch(()=>o.target,a=>{a&&(l.value.includes(a)||(l.value.unshift(a),l.value=l.value.slice(0,Ft),Ce.setLocalStorage("recentTarget",l.value)))}),(a,i)=>t.unref(o).languages?(t.openBlock(),t.createElementBlock("div",sl,[t.createElementVNode("div",il,[t.createElementVNode("div",cl,[n.value.length>0?(t.openBlock(),t.createElementBlock("div",dl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,s=>(t.openBlock(),t.createElementBlock("button",{key:s,class:"px-1 bg-base-100 border border-primary text-primary text-xs rounded hover:bg-primary hover:text-primary-content",onClick:c=>t.unref(o).src=s},t.toDisplayString(t.unref(o).languages.src[s]),9,ul))),128))])):t.createCommentVNode("",!0)]),t.createElementVNode("div",fl,[l.value.length>0?(t.openBlock(),t.createElementBlock("div",pl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,s=>(t.openBlock(),t.createElementBlock("button",{key:s,class:"px-1 bg-base-100 border border-primary text-primary text-xs rounded hover:bg-primary hover:text-primary-content",onClick:c=>t.unref(o).target=s},t.toDisplayString(t.unref(o).languages.target[s]),9,ml))),128))])):t.createCommentVNode("",!0)])]),t.createElementVNode("div",hl,[t.createElementVNode("div",gl,[t.createVNode(Pt,{modelValue:t.unref(o).src,"onUpdate:modelValue":i[0]||(i[0]=s=>t.unref(o).src=s),languages:t.unref(o).languages.src,class:"grow"},null,8,["modelValue","languages"])]),t.createVNode(al,{isBidirect:t.unref(o).src!=="auto",class:"grow-0 mx-3 mt-4 self-start",onSwap:r},null,8,["isBidirect"]),t.createElementVNode("div",bl,[t.createVNode(Pt,{modelValue:t.unref(o).target,"onUpdate:modelValue":i[1]||(i[1]=s=>t.unref(o).target=s),languages:t.unref(o).languages.target,class:"grow"},null,8,["modelValue","languages"])])])])):t.createCommentVNode("",!0)}},se={INPUT_MAX_LENGTH:5e3,INPUT_DEBOUNCE:1e3,IMPROVE_INPUT_MIN_LENGTH:4,DEFAULT_DIFF_MODE:!0},G=(e,o)=>{const n=e.__vccOpts||e;for(const[l,r]of o)n[l]=r;return n},xl={},vl={class:"mr-2 loading loading-dots loading-xs"};function yl(e,o){return t.openBlock(),t.createElementBlock("span",vl)}const qe=G(xl,[["render",yl]]),Ge=he("tts",()=>{const e=t.ref({src:null,target:null});function o(r){r.src&&(e.value.src=r.src),r.target&&(e.value.target=r.target)}function n(r){if(r==="src")return e.value.src;if(r==="target")return e.value.target}function l(){e.value={src:null,target:null}}return{tts:e,set:o,get:n,reset:l}}),wl=["disabled"],El=[t.createElementVNode("path",{d:"M2.33325 4.66667H3.51125C3.82693 4.6667 4.13239 4.55473 4.37325 4.35067L6.83392 2.26667C6.99592 2.12953 7.19374 2.04156 7.40407 2.01312C7.61441 1.98468 7.82849 2.01696 8.02109 2.10615C8.21369 2.19534 8.37678 2.33772 8.49114 2.51652C8.60551 2.69532 8.66638 2.90309 8.66659 3.11534V12.8847C8.66649 13.097 8.60565 13.305 8.49125 13.4839C8.37685 13.6628 8.21367 13.8053 8.02094 13.8945C7.82822 13.9837 7.614 14.0159 7.40356 13.9874C7.19312 13.9588 6.99523 13.8707 6.83325 13.7333L4.37325 11.6487C4.13229 11.4449 3.82685 11.3331 3.51125 11.3333H2.33325C2.06804 11.3333 1.81368 11.228 1.62615 11.0404C1.43861 10.8529 1.33325 10.5986 1.33325 10.3333V5.66667C1.33325 5.40145 1.43861 5.1471 1.62615 4.95956C1.81368 4.77203 2.06804 4.66667 2.33325 4.66667ZM11.1779 11.18C11.5969 10.763 11.9294 10.2674 12.1562 9.72156C12.3831 9.17572 12.4999 8.59044 12.4999 7.99934C12.4999 7.40823 12.3831 6.82295 12.1562 6.27711C11.9294 5.73127 11.5969 5.23564 11.1779 4.81867C11.1317 4.77098 11.0765 4.73297 11.0155 4.70686C10.9544 4.68075 10.8888 4.66705 10.8224 4.66657C10.756 4.66609 10.6902 4.67883 10.6288 4.70406C10.5674 4.72929 10.5116 4.76649 10.4647 4.8135C10.4179 4.86051 10.3808 4.91639 10.3558 4.97787C10.3307 5.03935 10.3181 5.10521 10.3188 5.17159C10.3195 5.23798 10.3334 5.30357 10.3597 5.36453C10.3859 5.42549 10.4241 5.48061 10.4719 5.52667C10.7977 5.85079 11.0562 6.23609 11.2326 6.66043C11.409 7.08477 11.4998 7.53979 11.4998 7.99934C11.4998 8.45888 11.409 8.9139 11.2326 9.33824C11.0562 9.76258 10.7977 10.1479 10.4719 10.472C10.4241 10.5181 10.3859 10.5732 10.3597 10.6341C10.3334 10.6951 10.3195 10.7607 10.3188 10.8271C10.3181 10.8935 10.3307 10.9593 10.3558 11.0208C10.3808 11.0823 10.4179 11.1382 10.4647 11.1852C10.5116 11.2322 10.5674 11.2694 10.6288 11.2946C10.6902 11.3198 10.756 11.3326 10.8224 11.3321C10.8888 11.3316 10.9544 11.3179 11.0155 11.2918C11.0765 11.2657 11.1317 11.2277 11.1779 11.18ZM12.7113 13.2127C12.6123 13.2126 12.5157 13.1832 12.4335 13.1281C12.3513 13.0731 12.2873 12.9949 12.2495 12.9035C12.2118 12.8121 12.202 12.7115 12.2214 12.6146C12.2408 12.5176 12.2886 12.4285 12.3586 12.3587C12.9317 11.7866 13.3865 11.1071 13.6967 10.359C14.0069 9.61101 14.1666 8.80915 14.1666 7.99934C14.1666 7.18952 14.0069 6.38766 13.6967 5.63963C13.3865 4.8916 12.9317 4.2121 12.3586 3.64C12.3122 3.59351 12.2754 3.53834 12.2503 3.47764C12.2252 3.41693 12.2124 3.35188 12.2124 3.2862C12.2125 3.22052 12.2255 3.15549 12.2507 3.09483C12.2759 3.03417 12.3128 2.97907 12.3593 2.93267C12.4057 2.88627 12.4609 2.84948 12.5216 2.8244C12.5823 2.79932 12.6474 2.78645 12.7131 2.78651C12.7787 2.78657 12.8438 2.79957 12.9044 2.82476C12.9651 2.84995 13.0202 2.88685 13.0666 2.93334C13.7327 3.59825 14.2612 4.38801 14.6218 5.25741C14.9824 6.12681 15.168 7.05879 15.168 8C15.168 8.94122 14.9824 9.87319 14.6218 10.7426C14.2612 11.612 13.7327 12.4018 13.0666 13.0667C13.02 13.1134 12.9646 13.1504 12.9036 13.1756C12.8426 13.2007 12.7772 13.2129 12.7113 13.2127Z",fill:"currentColor"},null,-1)],_l=[t.createElementVNode("svg",{class:"w-4 h-4 text-primary",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.5 7.5a3 3 0 0 1 3-3h9a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3h-9a3 3 0 0 1-3-3v-9Z","clip-rule":"evenodd",fill:"currentColor"})],-1)],kl={__name:"SpeakBtn",props:{type:{type:String,default:""},disabled:Boolean},emits:["loadTTS"],setup(e,{emit:o}){const n=Ge(),l=e,r=o,a=t.computed(()=>n.tts[l.type]),i=t.ref(!1),s=new Audio,c=t.ref(!1);t.watch(a,()=>{if(!a.value){i.value=!1;return}c.value&&(c.value=!1,u())},{immediate:!0}),t.onUnmounted(()=>{f(),s.src=""});function d(){if(a.value){u();return}c.value=!0,i.value=!0,r("loadTTS")}function u(){a.value&&(s.src=a.value,s.playbackRate=.7,i.value=!0,s.play().catch(()=>{i.value=!1}))}function f(){s.pause(),s.currentTime=0,i.value=!1}return s.onended=()=>{i.value=!1},(C,h)=>i.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"btn btn-xs btn-circle",onClick:t.withModifiers(f,["prevent"])},_l)):(t.openBlock(),t.createElementBlock("button",{key:0,class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled,onClick:t.withModifiers(d,["prevent"])},[(t.openBlock(),t.createElementBlock("svg",{class:t.normalizeClass(["w-4 h-4 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},El,2))],10,wl))}},Sl={class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":"Clear"},Tl=["disabled"],$l=[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.19102 3.19102C3.44571 2.93633 3.85864 2.93633 4.11333 3.19102L12.809 11.8867C13.0637 12.1414 13.0637 12.5543 12.809 12.809C12.5543 13.0637 12.1414 13.0637 11.8867 12.809L3.19102 4.11333C2.93633 3.85864 2.93633 3.44571 3.19102 3.19102Z",fill:"currentColor"},null,-1),t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.809 3.19102C13.0637 3.44571 13.0637 3.85864 12.809 4.11333L4.11333 12.809C3.85864 13.0637 3.44571 13.0637 3.19102 12.809C2.93633 12.5543 2.93633 12.1414 3.19102 11.8867L11.8867 3.19102C12.1414 2.93633 12.5543 2.93633 12.809 3.19102Z",fill:"currentColor"},null,-1)],jt={__name:"ClearBtn",props:{disabled:Boolean},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",Sl,[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled},[(t.openBlock(),t.createElementBlock("svg",{class:t.normalizeClass(["w-4 h-4 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$l,2))],10,Tl)]))}},Vl={class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":"Favorite"},Bl=["disabled"],Nl=[t.createElementVNode("path",{d:"M14.9491 5.89315C14.8278 5.53128 14.5111 5.27252 14.1226 5.21783L10.5264 4.7114L8.91813 1.55315C8.74435 1.21195 8.39257 1 7.99998 1C7.60739 1 7.25557 1.21195 7.08183 1.55315L5.47358 4.7114L1.8774 5.21783C1.48888 5.27252 1.17219 5.53128 1.05086 5.89315C0.929554 6.25501 1.02881 6.64477 1.30993 6.91038L3.91217 9.36871L3.29786 12.8399C3.2315 13.215 3.38755 13.5868 3.7052 13.8105C3.88128 13.9344 4.08938 14 4.30704 14C4.47232 14 4.63705 13.9606 4.78341 13.886L7.99995 12.2471L11.2165 13.886C11.3628 13.9606 11.5276 14 11.6929 14C11.9106 14 12.1187 13.9345 12.2948 13.8105C12.6124 13.5868 12.7685 13.215 12.7021 12.84L12.0878 9.36871L14.6901 6.91035C14.9712 6.64477 15.0704 6.25498 14.9491 5.89315ZM14.0266 6.25082L11.2455 8.87813C11.1335 8.98392 11.0824 9.13637 11.1089 9.28575L11.7654 12.9956C11.7701 13.0226 11.759 13.0493 11.7362 13.0653C11.7202 13.0766 11.7038 13.079 11.6929 13.079C11.6809 13.079 11.6694 13.0762 11.6587 13.0708L8.22108 11.3192C8.15189 11.284 8.07593 11.2663 7.99998 11.2663C7.92402 11.2663 7.84807 11.284 7.77882 11.3193L4.34118 13.0708C4.33052 13.0763 4.31904 13.079 4.30701 13.079C4.29611 13.079 4.27969 13.0767 4.26373 13.0654C4.24092 13.0494 4.22975 13.0226 4.2345 12.9957L4.89104 9.28584C4.91747 9.13646 4.86637 8.98401 4.75439 8.87822L1.97327 6.25091C1.95308 6.23184 1.94595 6.20383 1.95466 6.17786C1.9634 6.15185 1.98612 6.13326 2.01405 6.12933L5.85743 5.58807C6.0122 5.56626 6.14599 5.47208 6.21521 5.33616L7.93404 1.9608C7.94653 1.9363 7.97178 1.92107 7.99998 1.92107C8.02818 1.92107 8.05343 1.9363 8.06591 1.9608L9.78468 5.33607C9.85391 5.47199 9.9877 5.5662 10.1425 5.58799L13.9859 6.12924C14.0138 6.1332 14.0365 6.15176 14.0452 6.17777C14.0539 6.20374 14.0468 6.23175 14.0266 6.25082Z",fill:"currentColor"},null,-1)],Ll=[t.createElementVNode("path",{d:"M7.47207 1.31905C7.57125 1.12371 7.77589 1 8.00001 1C8.22413 1 8.42877 1.12367 8.52795 1.31905L10.3721 4.95175L14.4959 5.53427C14.7177 5.5656 14.9019 5.7166 14.9712 5.9238C15.0404 6.13101 14.9827 6.35843 14.8222 6.51049L11.8382 9.33816L12.5427 13.3309C12.5806 13.5456 12.4897 13.7626 12.3084 13.8906C12.1272 14.0187 11.8868 14.0356 11.6884 13.9342L8.00004 12.0491L4.31158 13.9343C4.11323 14.0356 3.87286 14.0187 3.69157 13.8907C3.51028 13.7627 3.4195 13.5457 3.45736 13.3309L4.1618 9.33819L1.17781 6.51052C1.01735 6.35846 0.959571 6.13101 1.02884 5.92383C1.09807 5.71663 1.28232 5.56563 1.50409 5.53431L5.62787 4.95178L7.47207 1.31905Z",fill:"currentColor"},null,-1)],Ol={__name:"FavoriteBtn",props:{disabled:Boolean,isFilled:Boolean},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",Vl,[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled},[e.isFilled?(t.openBlock(),t.createElementBlock("svg",{key:1,class:t.normalizeClass(["w-4 h-4 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ll,2)):(t.openBlock(),t.createElementBlock("svg",{key:0,class:t.normalizeClass(["w-4 h-4 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Nl,2))],10,Bl)]))}},Il={class:"tooltip tooltip-top tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!text-xs before:!py-1 before:!px-2","data-tip":"AI Translate"},Ml=["disabled"],Al=[t.createElementVNode("path",{d:"M6.8544 3.20309C5.39975 2.89815 4.26277 1.76117 3.95787 0.30649C3.92042 0.12792 3.76292 0 3.58041 0C3.3979 0 3.2404 0.12792 3.20297 0.30652C2.89805 1.76117 1.76107 2.89812 0.306418 3.20302C0.127818 3.24045 -0.00012207 3.39798 -0.00012207 3.58046C-0.00012207 3.76295 0.127798 3.92047 0.306418 3.9579C1.76105 4.26285 2.89798 5.3998 3.2029 6.85448C3.24033 7.03307 3.39783 7.16102 3.58034 7.16102C3.76282 7.16102 3.92035 7.0331 3.95778 6.85448C4.26272 5.39983 5.39973 4.26287 6.85438 3.95799C7.03297 3.92056 7.16092 3.76306 7.16092 3.58056C7.1609 3.39805 7.03297 3.24052 6.8544 3.20309ZM3.58036 5.60938C3.14292 4.73132 2.42956 4.01792 1.55151 3.58049C2.42958 3.14305 3.14297 2.42968 3.58041 1.55161C4.01785 2.4297 4.73122 3.14307 5.60926 3.58053C4.73119 4.01797 4.0178 4.73132 3.58036 5.60938Z",fill:"currentColor"},null,-1),t.createElementVNode("path",{d:"M6.21683 9.574C5.53147 9.4303 4.99578 8.8947 4.85209 8.2093C4.81466 8.0307 4.65716 7.90271 4.47465 7.90271C4.29217 7.90271 4.13464 8.0306 4.09721 8.2092C3.95352 8.8946 3.4178 9.4303 2.73244 9.574C2.55385 9.6114 2.4259 9.7689 2.4259 9.9514C2.4259 10.1339 2.55383 10.2914 2.73244 10.3288C3.41778 10.4725 3.95349 11.0082 4.09716 11.6936C4.13459 11.8722 4.2921 12.0002 4.4746 12.0002C4.65709 12.0002 4.81461 11.8723 4.85204 11.6936C4.99574 11.0082 5.53145 10.4725 6.21683 10.3289C6.39543 10.2914 6.52337 10.1339 6.52337 9.9514C6.52337 9.7689 6.39545 9.6114 6.21683 9.574ZM4.47463 10.6408C4.29163 10.3688 4.05725 10.1345 3.78526 9.9515C4.0573 9.7684 4.29163 9.5341 4.47463 9.2621C4.65765 9.5341 4.892 9.7685 5.164 9.9515C4.892 10.1345 4.65763 10.3688 4.47463 10.6408Z",fill:"currentColor"},null,-1),t.createElementVNode("path",{d:"M11.4271 6.00324C10.5007 5.80904 9.7766 5.08496 9.5825 4.15859C9.545 3.98 9.3875 3.85205 9.205 3.85205C9.0225 3.85205 8.865 3.97995 8.8276 4.15857C8.6334 5.08496 7.90932 5.80902 6.98293 6.0032C6.80434 6.04063 6.67639 6.19815 6.67639 6.38064C6.67639 6.56312 6.80431 6.72062 6.98293 6.75807C7.9093 6.95228 8.6334 7.67633 8.8275 8.6027C8.865 8.7813 9.0225 8.9093 9.205 8.9093C9.3875 8.9093 9.545 8.7814 9.5824 8.6027C9.7766 7.67633 10.5007 6.95228 11.4271 6.75812C11.6057 6.72067 11.7336 6.56317 11.7336 6.38068C11.7336 6.1982 11.6057 6.04067 11.4271 6.00324ZM9.205 7.47681C8.9365 7.02634 8.5593 6.64914 8.1089 6.38066C8.5593 6.11218 8.9365 5.73502 9.205 5.28453C9.4735 5.73502 9.8507 6.11221 10.3012 6.38068C9.8507 6.64916 9.4735 7.02636 9.205 7.47681Z",fill:"currentColor"},null,-1)],Rl=[t.createStaticVNode('<path d="M6.8544 3.20309C5.39975 2.89815 4.26277 1.76117 3.95787 0.30649C3.92042 0.12792 3.76292 0 3.58041 0C3.3979 0 3.2404 0.12792 3.20297 0.30652C2.89805 1.76117 1.76107 2.89812 0.306418 3.20302C0.127818 3.24045 -0.00012207 3.39798 -0.00012207 3.58046C-0.00012207 3.76295 0.127798 3.92047 0.306418 3.9579C1.76105 4.26285 2.89798 5.3998 3.2029 6.85448C3.24033 7.03307 3.39783 7.16102 3.58034 7.16102C3.76282 7.16102 3.92035 7.0331 3.95778 6.85448C4.26272 5.39983 5.39973 4.26287 6.85438 3.95799C7.03297 3.92056 7.16092 3.76306 7.16092 3.58056C7.1609 3.39805 7.03297 3.24052 6.8544 3.20309ZM3.58036 5.60938C3.14292 4.73132 2.42956 4.01792 1.55151 3.58049C2.42958 3.14305 3.14297 2.42968 3.58041 1.55161C4.01785 2.4297 4.73122 3.14307 5.60926 3.58053C4.73119 4.01797 4.0178 4.73132 3.58036 5.60938Z" fill="currentColor"></path><path d="M6.21683 9.574C5.53147 9.4303 4.99578 8.8947 4.85209 8.2093C4.81466 8.0307 4.65716 7.90271 4.47465 7.90271C4.29217 7.90271 4.13464 8.0306 4.09721 8.2092C3.95352 8.8946 3.4178 9.4303 2.73244 9.574C2.55385 9.6114 2.4259 9.7689 2.4259 9.9514C2.4259 10.1339 2.55383 10.2914 2.73244 10.3288C3.41778 10.4725 3.95349 11.0082 4.09716 11.6936C4.13459 11.8722 4.2921 12.0002 4.4746 12.0002C4.65709 12.0002 4.81461 11.8723 4.85204 11.6936C4.99574 11.0082 5.53145 10.4725 6.21683 10.3289C6.39543 10.2914 6.52337 10.1339 6.52337 9.9514C6.52337 9.7689 6.39545 9.6114 6.21683 9.574ZM4.47463 10.6408C4.29163 10.3688 4.05725 10.1345 3.78526 9.9515C4.0573 9.7684 4.29163 9.5341 4.47463 9.2621C4.65765 9.5341 4.892 9.7685 5.164 9.9515C4.892 10.1345 4.65763 10.3688 4.47463 10.6408Z" fill="currentColor"></path><path d="M11.4271 6.00324C10.5007 5.80904 9.7766 5.08496 9.5825 4.15859C9.545 3.98 9.3875 3.85205 9.205 3.85205C9.0225 3.85205 8.865 3.97995 8.8276 4.15857C8.6334 5.08496 7.90932 5.80902 6.98293 6.0032C6.80434 6.04063 6.67639 6.19815 6.67639 6.38064C6.67639 6.56312 6.80431 6.72062 6.98293 6.75807C7.9093 6.95228 8.6334 7.67633 8.8275 8.6027C8.865 8.7813 9.0225 8.9093 9.205 8.9093C9.3875 8.9093 9.545 8.7814 9.5824 8.6027C9.7766 7.67633 10.5007 6.95228 11.4271 6.75812C11.6057 6.72067 11.7336 6.56317 11.7336 6.38068C11.7336 6.1982 11.6057 6.04067 11.4271 6.00324ZM9.205 7.47681C8.9365 7.02634 8.5593 6.64914 8.1089 6.38066C8.5593 6.11218 8.9365 5.73502 9.205 5.28453C9.4735 5.73502 9.8507 6.11221 10.3012 6.38068C9.8507 6.64916 9.4735 7.02636 9.205 7.47681Z" fill="currentColor"></path><circle cx="3.5" cy="3.5" r="1.5" fill="currentColor"></circle><ellipse cx="4.5" cy="10" rx="0.5" ry="1" fill="currentColor"></ellipse><path d="M3.5 1L4.79904 2.5H2.20096L3.5 1Z" fill="currentColor"></path><path d="M6 3.5L4.5 4.79904L4.5 2.20096L6 3.5Z" fill="currentColor"></path><path d="M10.3697 6.67832L8.22108 7.01422L9.5776 4.65296L10.3697 6.67832Z" fill="currentColor"></path><path d="M8.27756 5.34149L10.768 6.00067L9.11199 7.77878L8.27756 5.34149Z" fill="currentColor"></path><path d="M1 3.5L2.5 2.20096L2.5 4.79904L1 3.5Z" fill="currentColor"></path><path d="M3.5 6L2.20096 4.5L4.79904 4.5L3.5 6Z" fill="currentColor"></path><circle cx="9" cy="6" r="1" fill="currentColor"></circle><path d="M5.49718 9.92495L4.03391 10.4693L3.96891 9.60573L5.49718 9.92495Z" fill="currentColor"></path><path d="M3.54089 9.71696L5.10212 9.72621L4.857 10.5568L3.54089 9.71696Z" fill="currentColor"></path><path d="M3.50071 9.96247L5.0159 9.58606L4.9834 10.4515L3.50071 9.96247Z" fill="currentColor"></path>',15)],Dl={__name:"AIBtn",props:{disabled:Boolean,isFilled:Boolean},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",Il,[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled},[e.isFilled?(t.openBlock(),t.createElementBlock("svg",{key:1,class:t.normalizeClass(["w-4 h-4 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Rl,2)):(t.openBlock(),t.createElementBlock("svg",{key:0,class:t.normalizeClass(["w-4 h-4 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Al,2))],10,Ml)]))}},Pl=["data-tip"],Fl=["disabled"],jl=[t.createElementVNode("path",{d:"M13.9023 3.26667L10.8093 0.1C10.7767 0.0666667 10.7116 0 10.5814 0H3.74419C3.12558 0 2.60465 0.533333 2.60465 1.16667V2.66667H1.13953C0.52093 2.66667 0 3.2 0 3.83333V14.8667C0 15.4667 0.52093 16 1.13953 16H10.2558C10.8744 16 11.3953 15.4667 11.3953 14.8333V13.3333H12.8605C13.4791 13.3333 14 12.8 14 12.1667V3.5C14 3.4 13.9674 3.3 13.9023 3.26667ZM12.893 3.16667H11.3954C11.1349 3.16667 10.907 2.93333 10.907 2.66667V1.13333L12.893 3.16667ZM10.2558 15.3333H1.13953C0.87907 15.3333 0.651163 15.1 0.651163 14.8333V3.83333C0.651163 3.53333 0.87907 3.33333 1.13953 3.33333H7.68372V5.33333C7.68372 5.96667 8.20465 6.5 8.82326 6.5H10.7767V14.8667C10.7442 15.1 10.5488 15.3333 10.2558 15.3333ZM9.31163 4.8L10.2884 5.8H8.7907C8.53023 5.8 8.30233 5.56667 8.30233 5.3V3.76667L9.31163 4.8ZM12.8605 12.6667H11.3953V6.13333C11.3953 6.06667 11.3628 5.96667 11.2977 5.9L8.20465 2.73333C8.17209 2.7 8.07442 2.66667 8.0093 2.66667H3.25581V1.16667C3.25581 0.9 3.45116 0.666666 3.74419 0.666666H10.2558V2.66667C10.2558 3.3 10.7767 3.83333 11.3954 3.83333H13.3488V12.2C13.3488 12.4667 13.1209 12.6667 12.8605 12.6667Z",fill:"currentColor"},null,-1)],zt={__name:"CopyBtn",props:{disabled:Boolean},setup(e){const o=t.ref("Copy"),n=()=>{o.value="Copied",setTimeout(()=>{o.value="Copy"},1e3)};return(l,r)=>(t.openBlock(),t.createElementBlock("div",{class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":o.value},[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled,onClick:n},[(t.openBlock(),t.createElementBlock("svg",{class:t.normalizeClass(["w-3 h-3 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},jl,2))],10,Fl)],8,Pl))}},zl={class:"flex flex-row px-1 pr-10 pt-1 items-center bg-transparent relative"},Hl={class:"ml-1 text-sm text-base-content/70"},Zl={key:0,class:"italic"},Ul={class:"absolute right-1 top-1 flex flex-col items-center gap-0"},Ht=G({__name:"InputBtnGroup",props:{loading:{type:Boolean,default:!1},isTTS:{type:Boolean,default:!0},src:{type:String,default:""},srcLabel:{type:String,default:""},type:{type:String,default:""},phonetic:{type:String,default:""},hasClearBtn:{type:Boolean,default:!1},hasFavoriteBtn:{type:Boolean,default:!1},hasAIBtn:{type:Boolean,default:!1},hasCopyBtn:{type:Boolean,default:!1},isFavorite:{type:Boolean,default:!1},isAITranslate:{type:Boolean,default:!1},onFavorite:{type:Function,default:()=>{}}},emits:["clear","favorite","loadTTS","aiTranslate","copy"],setup(e,{emit:o}){const n=o;return(l,r)=>(t.openBlock(),t.createElementBlock("div",zl,[e.src&&e.isTTS?(t.openBlock(),t.createBlock(kl,{key:0,type:e.type,onLoadTTS:r[0]||(r[0]=a=>n("loadTTS"))},null,8,["type"])):t.createCommentVNode("",!0),t.createElementVNode("div",Hl,[t.createTextVNode(t.toDisplayString(e.srcLabel)+" ",1),e.phonetic?(t.openBlock(),t.createElementBlock("span",Zl,"- "+t.toDisplayString(e.phonetic),1)):t.createCommentVNode("",!0)]),e.loading?(t.openBlock(),t.createBlock(qe,{key:1,class:"absolute right-6 top-2"})):t.createCommentVNode("",!0),t.createElementVNode("div",Ul,[e.hasClearBtn?(t.openBlock(),t.createBlock(jt,{key:0,onClick:r[1]||(r[1]=a=>n("clear")),disabled:e.loading},null,8,["disabled"])):t.createCommentVNode("",!0),e.src&&e.hasAIBtn?(t.openBlock(),t.createBlock(Dl,{key:1,isFilled:e.isAITranslate,onClick:r[2]||(r[2]=a=>n("aiTranslate")),disabled:e.loading},null,8,["isFilled","disabled"])):t.createCommentVNode("",!0),e.src&&e.hasFavoriteBtn?(t.openBlock(),t.createBlock(Ol,{key:2,isFilled:e.isFavorite,onClick:r[3]||(r[3]=a=>n("favorite")),disabled:e.loading},null,8,["isFilled","disabled"])):t.createCommentVNode("",!0),e.src&&e.hasCopyBtn?(t.openBlock(),t.createBlock(zt,{key:3,onClick:r[4]||(r[4]=a=>n("copy")),disabled:e.loading},null,8,["disabled"])):t.createCommentVNode("",!0)])]))}},[["__scopeId","data-v-faca0157"]]),J=he("translation",()=>{const e=t.ref(null),o=t.ref(null),n=t.ref(null),l=t.ref({src:null,target:null}),r=t.ref(null),a=t.ref([]),i=t.ref([]),s=t.ref([]),c=t.ref([]),d=t.ref({src:null,target:null}),u=ae(),f=t.computed(()=>u.getLabel(e.value)),C=t.computed(()=>u.getLabel(o.value));function h(g){e.value=g.src,o.value=g.target,n.value=g.text,l.value=g.phonetic,r.value=g.result,a.value=g.dictionary,i.value=g.definitions,s.value=g.synonyms,c.value=g.examples,d.value=g.tts}function b(){e.value=null,o.value=null,n.value=null,l.value={src:null,target:null},r.value=null,a.value=[],i.value=[],s.value=[],c.value=[],d.value={src:null,target:null}}return{src:e,srcLabel:f,target:o,targetLabel:C,phonetic:l,text:n,result:r,dictionary:a,definitions:i,synonyms:s,examples:c,tts:d,init:h,reset:b}});function Wl(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}function $e(e){return typeof e=="function"?e():t.unref(e)}const ql=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Zt=()=>{};function Gl(e,o){function n(...l){return new Promise((r,a)=>{Promise.resolve(e(()=>o.apply(this,l),{fn:o,thisArg:this,args:l})).then(r).catch(a)})}return n}function Jl(e,o={}){let n,l,r=Zt;const a=s=>{clearTimeout(s),r(),r=Zt};return s=>{const c=$e(e),d=$e(o.maxWait);return n&&a(n),c<=0||d!==void 0&&d<=0?(l&&(a(l),l=null),Promise.resolve(s())):new Promise((u,f)=>{r=o.rejectOnCancel?f:u,d&&!l&&(l=setTimeout(()=>{n&&a(n),l=null,u(s())},d)),n=setTimeout(()=>{l&&a(l),l=null,u(s())},c)})}}function Yl(e,o=200,n={}){return Gl(Jl(o,n),e)}function Ut(e){var o;const n=$e(e);return(o=n==null?void 0:n.$el)!=null?o:n}const Ql=ql?window:void 0;function Xl(){const e=t.ref(!1),o=t.getCurrentInstance();return o&&t.onMounted(()=>{e.value=!0},o),e}function Kl(e){const o=Xl();return t.computed(()=>(o.value,!!e()))}function er(e,o,n={}){const{window:l=Ql,...r}=n;let a;const i=Kl(()=>l&&"ResizeObserver"in l),s=()=>{a&&(a.disconnect(),a=void 0)},c=t.computed(()=>Array.isArray(e)?e.map(f=>Ut(f)):[Ut(e)]),d=t.watch(c,f=>{if(s(),i.value&&l){a=new ResizeObserver(o);for(const C of f)C&&a.observe(C,r)}},{immediate:!0,flush:"post"}),u=()=>{s(),d()};return Wl(u),{isSupported:i,stop:u}}function Ve(e){var o;const n=t.ref(e==null?void 0:e.element),l=t.ref(e==null?void 0:e.input),r=(o=e==null?void 0:e.styleProp)!=null?o:"height",a=t.ref(1);function i(){var s;if(!n.value)return;let c="";n.value.style[r]="1px",a.value=(s=n.value)==null?void 0:s.scrollHeight,e!=null&&e.styleTarget?$e(e.styleTarget).style[r]=`${a.value}px`:c=`${a.value}px`,n.value.style[r]=c}return t.watch([l,n],()=>t.nextTick(i),{immediate:!0}),t.watch(a,()=>{var s;return(s=e==null?void 0:e.onResize)==null?void 0:s.call(e)}),er(n,()=>i()),e!=null&&e.watch&&t.watch(e.watch,i,{immediate:!0,deep:!0}),{textarea:n,input:l,triggerResize:i}}const tr={class:"bg-base-100 relative z-10 border border-base-300 rounded"},nr=G({__name:"Input",props:{text:{type:String,default:""},isTTS:{type:Boolean,default:!0}},emits:["change","clear","loadTTS"],setup(e,{emit:o}){const n=J(),l=e,r=t.ref(l.text),a=t.computed(()=>n.src),i=t.computed(()=>n.srcLabel),s=t.computed(()=>{var b;return(b=n.phonetic)==null?void 0:b.src}),{textarea:c}=Ve({input:r,styleProp:"minHeight"}),d=o,u=Yl(()=>{d("change",r.value)},se.INPUT_DEBOUNCE);t.onMounted(()=>{h()});function f(){if(!r.value){C();return}u()}function C(){d("clear"),r.value="",c.value.focus()}async function h(){await t.nextTick(),c.value.select()}return t.watch(()=>l.text,b=>{r.value!==b&&h(),r.value=b}),(b,g)=>(t.openBlock(),t.createElementBlock("div",tr,[t.createVNode(Ht,{src:a.value,srcLabel:i.value,isTTS:e.isTTS,type:"src",phonetic:s.value,hasClearBtn:r.value.length>0,onClear:C,onLoadTTS:g[0]||(g[0]=S=>d("loadTTS"))},null,8,["src","srcLabel","isTTS","phonetic","hasClearBtn"]),t.withDirectives(t.createElementVNode("textarea",{ref_key:"textarea",ref:c,"onUpdate:modelValue":g[1]||(g[1]=S=>r.value=S),class:"w-full outline-none px-2 pr-8 bg-transparent text-base-content resize-none pb-3 overflow-x-hidden overflow-y-hidden",autofocus:"",rows:"2",onInput:f,onFocus:h},null,544),[[t.vModelText,r.value,void 0,{trim:!0}]])]))}},[["__scopeId","data-v-66ae5655"]]),or={class:"bg-base-100 relative z-10 rounded-md h-full"},lr={class:"bg-transparent"},rr=G({__name:"Result",props:{isFavoriteFeatureEnabled:Boolean,isAITranslateFeatureEnabled:Boolean,isAITranslate:Boolean,isFavorite:Boolean,isTTS:{type:Boolean,default:!0}},emits:["loadTTS","favorite","aiTranslate","copy"],setup(e,{emit:o}){const n=J(),l=t.computed(()=>n.result),r=t.computed(()=>n.target),a=t.computed(()=>n.targetLabel),i=t.computed(()=>{var C;return(C=n.phonetic)==null?void 0:C.target}),s=ne(),c=t.computed(()=>s.isLoading("translation")),{textarea:d,input:u}=Ve({input:l,styleProp:"minHeight"}),f=o;return(C,h)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["relative p-0.5 bg-[length:300%_300%] bg-[position:0%_50%] border border-base-300 rounded",{"bg-gradient-to-br from-[#8556f0] via-[#d6b379] via-[#6bedd1] to-[#439beb] animate-moveGradient border border-base-100":e.isAITranslate&&!c.value}])},[t.createElementVNode("div",or,[t.createVNode(Ht,{loading:c.value,src:r.value,srcLabel:a.value,isTTS:e.isTTS,type:"target",hasFavoriteBtn:e.isFavoriteFeatureEnabled,hasAIBtn:e.isAITranslateFeatureEnabled,hasCopyBtn:!0,isFavorite:e.isFavorite,isAITranslate:e.isAITranslate,phonetic:i.value,onFavorite:h[0]||(h[0]=b=>f("favorite")),onLoadTTS:h[1]||(h[1]=b=>f("loadTTS")),onAiTranslate:h[2]||(h[2]=b=>f("aiTranslate")),onCopy:h[3]||(h[3]=b=>f("copy"))},null,8,["loading","src","srcLabel","isTTS","hasFavoriteBtn","hasAIBtn","isFavorite","isAITranslate","phonetic"]),t.createElementVNode("div",lr,[t.withDirectives(t.createElementVNode("textarea",{ref_key:"textarea",ref:d,"onUpdate:modelValue":h[4]||(h[4]=b=>t.isRef(u)?u.value=b:null),class:"w-full outline-none px-2 pr-8 bg-transparent text-base-content resize-none pb-3 overflow-x-hidden overflow-y-hidden",readonly:"",rows:"2",spellcheck:"false"},null,512),[[t.vModelText,t.unref(u)]])])])],2))}},[["__scopeId","data-v-88599360"]]),ar={class:"btn btn-xs btn-circle btn-ghost"},Be={__name:"ToggleBtn",props:{isExpanded:Boolean},setup(e){const o=e;return(n,l)=>(t.openBlock(),t.createElementBlock("button",ar,[o.isExpanded?(t.openBlock(),t.createBlock(t.unref(To),{key:0,class:"w-7 text-base-content/50"})):(t.openBlock(),t.createBlock(t.unref(ko),{key:1,class:"w-7 text-base-content/50"}))]))}},sr=t.createElementVNode("h2",{class:"card-title text-base font-bold text-base-content"},"Dictionary",-1),ir={class:"capitalize text-xs font-normal text-base-content/70 mb-1"},cr={class:"list-none list-inside"},dr=["onClick"],ur={class:"text-sm font-normal text-base-content/80 leading-4"},fr={__name:"Dictionary",emits:["translate"],setup(e,{emit:o}){const n=t.ref(!0),l=J(),r=ae(),a=t.computed(()=>l.dictionary),i=o,s=()=>{n.value=!n.value},c=d=>{i("translate",d,l.target,l.src),r.src=l.target,r.target=l.src,window.scrollTo(0,0)};return(d,u)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"flex justify-between items-center",onClick:s},[sr,t.createVNode(Be,{isExpanded:n.value},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",n.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value,(f,C)=>(t.openBlock(),t.createElementBlock("li",{key:`${f.pos}-${C}`,class:"mb-2"},[t.createElementVNode("h5",ir,t.toDisplayString(f.pos),1),t.createElementVNode("ul",cr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f.items,(h,b)=>(t.openBlock(),t.createElementBlock("li",{key:`${h.word}-${b}`},[t.createElementVNode("span",{class:"m-0.5 font-normal badge badge-ghost bg-primary text-primary-content cursor-pointer border-0 rounded",onClick:g=>c(h.word)},t.toDisplayString(h.word),9,dr),t.createElementVNode("small",ur," - "+t.toDisplayString(h.reverse_translation.join(", ")),1)]))),128))])]))),128))])],2)],64))}},pr=t.createElementVNode("h2",{class:"card-title text-base font-bold text-base-content"},"Definitions",-1),mr={class:"capitalize text-xs font-normal text-base-content/70 mb-1"},hr={class:"text-sm text-base-content list-disc list-outside ml-5"},gr=t.createElementVNode("br",null,null,-1),br={key:0,class:"italic text-base-content/70"},Cr={__name:"Definition",setup(e){const o=t.ref(!0),n=J(),l=t.computed(()=>n.definitions),r=()=>{o.value=!o.value};return(a,i)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"flex justify-between items-center",onClick:r},[pr,t.createVNode(Be,{isExpanded:o.value},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",o.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(s,c)=>(t.openBlock(),t.createElementBlock("li",{key:`${s.pos}-${c}`,class:"mb-2"},[t.createElementVNode("h5",mr,t.toDisplayString(s.pos),1),t.createElementVNode("ul",hr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.items,(d,u)=>(t.openBlock(),t.createElementBlock("li",{key:`${d.gloss}-${u}`,class:"mb-1"},[t.createElementVNode("span",null,t.toDisplayString(d.gloss),1),gr,d.example?(t.openBlock(),t.createElementBlock("small",br,'"'+t.toDisplayString(d.example)+'"',1)):t.createCommentVNode("",!0)]))),128))])]))),128))])],2)],64))}},xr=t.createElementVNode("h2",{class:"card-title text-base font-bold text-base-content"},"Examples",-1),vr={class:"text-base-content text-sm list-disc list-outside ml-5 my-2"},yr=["innerHTML"],wr={__name:"Example",setup(e){const o=t.ref(!0),n=J(),l=t.computed(()=>n.examples),r=()=>{o.value=!o.value};return(a,i)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"flex justify-between items-center",onClick:r},[xr,t.createVNode(Be,{isExpanded:o.value},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",o.value?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",vr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(s,c)=>(t.openBlock(),t.createElementBlock("li",{key:`${s.definition_id}-${c}`,innerHTML:s},null,8,yr))),128))])],2)],64))}},Er=t.createElementVNode("h2",{class:"card-title text-base font-bold text-base-content"},"Synonyms",-1),_r={class:"capitalize text-xs font-normal text-base-content/70 mb-1"},kr={class:"list-none list-inside"},Sr={class:"flex flex-wrap"},Tr=["onClick"],$r={__name:"Synonyms",emits:["translate"],setup(e,{emit:o}){const n=t.ref(!0),l=J(),r=t.computed(()=>l.synonyms),a=o,i=()=>{n.value=!n.value},s=c=>{a("translate",c),window.scrollTo(0,0)};return(c,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"flex justify-between items-center",onClick:i},[Er,t.createVNode(Be,{isExpanded:n.value},null,8,["isExpanded"])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",n.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,(u,f)=>(t.openBlock(),t.createElementBlock("li",{key:`${u.pos}-${f}`,class:"mb-2"},[t.createElementVNode("h5",_r,t.toDisplayString(u.pos),1),t.createElementVNode("ul",kr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.items,(C,h)=>(t.openBlock(),t.createElementBlock("li",{key:`${C.word}-${h}`,class:"mb-2"},[t.createElementVNode("div",Sr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(C.synonym,(b,g)=>(t.openBlock(),t.createElementBlock("span",{key:`${b}-${g}`,class:"m-0.5 ml-0 font-normal badge badge-ghost bg-primary text-primary-content cursor-pointer border-0 rounded",onClick:S=>s(b)},t.toDisplayString(b),9,Tr))),128))])]))),128))])]))),128))])],2)],64))}},Vr=["disabled"],Br=[t.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12h1m-3.5-6.5 1-1M12 3V2M5.5 5.5l-1-1M3 12H2m8 10h4m3-10a5 5 0 1 0-7 4.584V19h4v-2.416A5.001 5.001 0 0 0 17 12z"},null,-1)],Nr=[t.createElementVNode("path",{fill:"currentColor",d:"M12 7a5 5 0 0 0-2 9.584V19h4v-2.416A5.001 5.001 0 0 0 12 7z"},null,-1),t.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12h1m-3.5-6.5 1-1M12 3V2M5.5 5.5l-1-1M3 12H2m8 10h4m3-10a5 5 0 1 0-7 4.584V19h4v-2.416A5.001 5.001 0 0 0 17 12z"},null,-1)],Lr={__name:"ChevronAIBtn",props:{disabled:Boolean,isExpanded:Boolean},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled},[e.isExpanded?(t.openBlock(),t.createElementBlock("svg",{key:1,class:t.normalizeClass(["w-6 h-6 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none"},Nr,2)):(t.openBlock(),t.createElementBlock("svg",{key:0,class:t.normalizeClass(["w-6 h-6 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none"},Br,2))],10,Vr))}},Or={class:"p-2 gap-0 relative z-10"},Ir={class:"flex justify-between items-center"},Mr=t.createElementVNode("h2",{class:"card-title text-base font-bold text-base-content"},"AI Summary",-1),Ar={class:"flex items-center"},Rr={class:"tooltip tooltip-bottom tooltip-small before:!bg-base-100 before:!border before:!border-solid before:!border-base-300 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded before:!text-base-content/70 before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":"AI Summarize"},Dr={key:0,class:"text-base-content list-none list-outside"},Pr=["innerHTML"],Fr={__name:"AIExplanation",props:{isAIExplain:{type:Boolean,default:!1,required:!0},explanation:{type:Object,required:!0}},emits:["aiExplain"],setup(e,{emit:o}){const n=ne(),l=t.computed(()=>n.isLoading("aiExplanation")),r=o;function a(){r("aiExplain")}return(i,s)=>{var c,d;return t.openBlock(),t.createElementBlock("div",Or,[t.createElementVNode("div",Ir,[Mr,t.createElementVNode("div",Ar,[l.value?(t.openBlock(),t.createBlock(qe,{key:0})):t.createCommentVNode("",!0),t.createElementVNode("div",Rr,[t.createVNode(Lr,{isExpanded:e.isAIExplain,disabled:l.value,onClick:a},null,8,["isExpanded","disabled"])])])]),t.createElementVNode("div",{class:t.normalizeClass(["overflow-hidden",e.isAIExplain?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"])},[(c=e.explanation)!=null&&c.result?(t.openBlock(),t.createElementBlock("ul",Dr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(((d=e.explanation)==null?void 0:d.result.split(`
|
|
18
|
+
`))||[],(u,f)=>(t.openBlock(),t.createElementBlock("li",{key:`${u}-${f}`,innerHTML:u},null,8,Pr))),128))])):t.createCommentVNode("",!0)],2)])}}};function jr(){document.documentElement.setAttribute("dir","rtl")}function zr(){document.documentElement.removeAttribute("dir")}const Wt={supportRTL:jr,removeRTL:zr},Hr=["ar","fa","iw","yi","ur","pa"],Zr=e=>(t.pushScopeId("data-v-08f9cb53"),e=e(),t.popScopeId(),e),Ur={class:"pb-6"},Wr={class:"flex flex-col lg:flex-row lg:gap-2"},qr={id:"input",class:"w-full lg:w-[calc(50%-1rem)] flex mt-1"},Gr=Zr(()=>t.createElementVNode("div",{class:"w-6 h-4 mx-auto hidden lg:block"},null,-1)),Jr={class:"w-full lg:w-[calc(50%-1rem)] flex mt-1"},Yr={key:0,class:"masonry-container mt-1"},Qr={key:0,class:"masonry-item border border-base-300 bg-base-100"},Xr={key:1,class:"masonry-item border border-base-300 bg-base-100"},Kr={class:"p-2"},ea={key:2,class:"masonry-item border border-base-300 bg-base-100"},ta={class:"p-2"},na={key:3,class:"masonry-item border border-base-300 bg-base-100"},oa={class:"p-2"},la={key:4,class:"masonry-item border border-base-300 bg-base-100"},ra={class:"p-2"},aa={key:1,class:"text-base-content italic font-medium"},sa=G({__name:"TranslateTab",props:{opt:Object,languages:Object,translation:Object,explanation:Object,tts:Object,isTTS:Boolean,isFavoriteFeatureEnabled:Boolean,isAITranslateFeatureEnabled:Boolean,isFavorite:Boolean,isAITranslate:Boolean,isAIExplain:Boolean,aiExplainMinLength:Number},emits:["opt","translate","loadTTS","favorite","aiTranslate","aiExplain","copy"],setup(e,{emit:o}){const n=t.ref(""),l=e,r=t.inject("translationStore"),a=t.inject("ttsStore"),i=t.inject("languageStore"),s=t.inject("loaderStore"),c=o,d=()=>{const k=l.opt.target;Hr.includes(k)?Wt.supportRTL():Wt.removeRTL()};t.watch(()=>l.translation,k=>{s.setLoading("translation",!1),k&&(n.value=k.text,r.init(k),a.reset())},{immediate:!0}),t.watch([()=>l.explanation,()=>l.isAIExplain],([k])=>{k!=null&&k.result&&s.setLoading("aiExplanation",!1)},{immediate:!0,deep:!0}),t.watch(()=>l.tts,k=>{if(!k){a.reset();return}a.set(k)},{immediate:!0}),t.watch([()=>l.opt,()=>l.languages],([k,v])=>{i.init(k,v),d()}),t.watch([()=>i.src,()=>i.target],([k,v])=>{c("opt",{src:k,target:v}),h(n.value)}),t.onMounted(()=>{i.init(l.opt,l.languages),d()});function u(){n.value="",l.isAITranslate&&b(),r.reset()}function f(k){n.value=k,h(k)}function C(k){const v=k==="src"?r.text:r.result;c("loadTTS",{type:k,data:v})}function h(k,v=i.src,x=i.target){k&&(S(),n.value=k,s.setLoading("translation",!0),c("translate",{src:v,target:x,text:k}))}function b(){l.isAITranslate||s.setLoading("translation",!0),c("aiTranslate",{src:i.src,target:i.target,text:n.value})}function g(){l.isAIExplain||s.setLoading("aiExplanation",!0),c("aiExplain",{src:i.src,target:i.target,text:n.value})}function S(){const k=document.getElementById("input");k&&k.getBoundingClientRect().top<0&&k.scrollIntoView({behavior:"smooth"})}return(k,v)=>{var x,y,w,V,E;return t.openBlock(),t.createElementBlock("div",Ur,[t.createVNode(Cl),t.createElementVNode("div",Wr,[t.createElementVNode("div",qr,[t.createVNode(nr,{text:n.value,isTTS:e.isTTS,onChange:f,onClear:u,onLoadTTS:v[0]||(v[0]=_=>C("src")),class:"flex-grow flex flex-col"},null,8,["text","isTTS"])]),Gr,t.createElementVNode("div",Jr,[t.createVNode(rr,{isFavoriteFeatureEnabled:e.isFavoriteFeatureEnabled,isAITranslateFeatureEnabled:e.isAITranslateFeatureEnabled,isAITranslate:e.isAITranslate,isFavorite:e.isFavorite,isTTS:e.isTTS,onCopy:v[1]||(v[1]=_=>{var B;return k.$emit("copy",(B=t.unref(r))==null?void 0:B.result)}),onAiTranslate:b,onFavorite:v[2]||(v[2]=_=>k.$emit("favorite")),onLoadTTS:v[3]||(v[3]=_=>C("target")),class:"flex-grow flex flex-col"},null,8,["isFavoriteFeatureEnabled","isAITranslateFeatureEnabled","isAITranslate","isFavorite","isTTS"])])]),e.translation?(t.openBlock(),t.createElementBlock("div",Yr,[((x=t.unref(r).result)==null?void 0:x.length)>e.aiExplainMinLength?(t.openBlock(),t.createElementBlock("div",Qr,[t.createVNode(Fr,{isAIExplain:e.isAIExplain,explanation:e.explanation,onAiExplain:g},null,8,["isAIExplain","explanation"])])):t.createCommentVNode("",!0),(y=t.unref(r).dictionary)!=null&&y.length?(t.openBlock(),t.createElementBlock("div",Xr,[t.createElementVNode("div",Kr,[t.createVNode(fr,{onTranslate:h})])])):t.createCommentVNode("",!0),(w=t.unref(r).definitions)!=null&&w.length?(t.openBlock(),t.createElementBlock("div",ea,[t.createElementVNode("div",ta,[t.createVNode(Cr)])])):t.createCommentVNode("",!0),(V=t.unref(r).synonyms)!=null&&V.length?(t.openBlock(),t.createElementBlock("div",na,[t.createElementVNode("div",oa,[t.createVNode($r,{onTranslate:h})])])):t.createCommentVNode("",!0),(E=t.unref(r).examples)!=null&&E.length?(t.openBlock(),t.createElementBlock("div",la,[t.createElementVNode("div",ra,[t.createVNode(wr)])])):t.createCommentVNode("",!0)])):(t.openBlock(),t.createElementBlock("span",aa,"Service unavailable"))])}}},[["__scopeId","data-v-08f9cb53"]]),ia=["disabled"],ca=[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)],da={__name:"RetryBtn",props:{disabled:Boolean},emits:["click"],setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("button",{class:"bg-base-100 rounded-full hover:bg-base-200 focus:outline-none active:scale-95",onClick:n[0]||(n[0]=l=>o.$emit("click")),disabled:e.disabled,"aria-label":"Retry"},[(t.openBlock(),t.createElementBlock("svg",{class:t.normalizeClass(["h-5 w-5 text-primary",{"opacity-50":e.disabled}]),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},ca,2))],8,ia))}},ua=["data-tip"],fa=["disabled"],pa=[t.createElementVNode("path",{d:"M2.293,21.707a1,1,0,0,0,1.414,0l3.2-3.2A9.581,9.581,0,0,0,12,20c4.325,0,8.227-3,9.938-7.654a.993.993,0,0,0,0-.692A12.6,12.6,0,0,0,18.7,6.719l3.012-3.012a1,1,0,1,0-1.414-1.414l-3.2,3.2A9.581,9.581,0,0,0,12,4C7.675,4,3.773,7,2.062,11.654a.993.993,0,0,0,0,.692,12.6,12.6,0,0,0,3.243,4.935L2.293,20.293A1,1,0,0,0,2.293,21.707ZM17.266,8.148A10.454,10.454,0,0,1,19.929,12c-1.478,3.657-4.556,6-7.929,6a7.52,7.52,0,0,1-3.632-.954l1.613-1.613A3.947,3.947,0,0,0,12,16a4,4,0,0,0,4-4,3.947,3.947,0,0,0-.567-2.019Zm-7.191,4.363A1.96,1.96,0,0,1,10,12a2,2,0,0,1,2-2,1.96,1.96,0,0,1,.511.075Zm3.85-1.022A1.96,1.96,0,0,1,14,12a2,2,0,0,1-2,2,1.96,1.96,0,0,1-.511-.075ZM4.071,12C5.549,8.343,8.627,6,12,6a7.52,7.52,0,0,1,3.632.954L14.019,8.567A3.947,3.947,0,0,0,12,8a4,4,0,0,0-4,4,3.947,3.947,0,0,0,.567,2.019L6.734,15.852A10.454,10.454,0,0,1,4.071,12Z"},null,-1)],ma=[t.createElementVNode("path",{d:"M12,7a4,4,0,1,0,4,4A4,4,0,0,0,12,7Zm0,6a2,2,0,1,1,2-2A2,2,0,0,1,12,13Zm6.5,2v1.5H20a1,1,0,0,1,0,2H18.5V20a1,1,0,0,1-2,0V18.5H15a1,1,0,0,1,0-2h1.5V15a1,1,0,0,1,2,0Zm3.438-4.345a.987.987,0,0,1,0,.69,13.339,13.339,0,0,1-1.08,2.264,1,1,0,1,1-1.715-1.028A11.3,11.3,0,0,0,19.928,11C18.451,7.343,15.373,5,12,5S5.549,7.343,4.072,11a9.315,9.315,0,0,0,6.167,5.787,1,1,0,1,1-.478,1.942,11.393,11.393,0,0,1-7.7-7.383.99.99,0,0,1,0-.691C3.773,6,7.674,3,12,3S20.227,6,21.938,10.655Z"},null,-1)],ha={__name:"ToggleDiffBtn",props:{disabled:Boolean,isDiffMode:Boolean},emits:["toggle"],setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",{class:"tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2","data-tip":e.isDiffMode?"Hide Differences":"Show Differences"},[t.createElementVNode("button",{class:t.normalizeClass(["btn btn-xs btn-circle",[{"btn-ghost":!e.disabled},{"!bg-transparent !border-none !shadow-none !ring-0":e.disabled}]]),disabled:e.disabled,onClick:n[0]||(n[0]=l=>o.$emit("toggle"))},[e.isDiffMode?(t.openBlock(),t.createElementBlock("svg",{key:1,class:t.normalizeClass(["w-4 h-4 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},ma,2)):(t.openBlock(),t.createElementBlock("svg",{key:0,class:t.normalizeClass(["w-4 h-4 text-primary",[{"opacity-100":!e.disabled},{"opacity-50 transform ":e.disabled}]]),fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},pa,2))],10,fa)],8,ua))}},ga={class:"flex flex-row px-2 pr-10 items-center bg-transparent relative"},ba={class:"absolute right-1 top-1 flex flex-col items-center gap-0"},qt={__name:"InputBtnGroup",props:{loading:{type:Boolean,default:!1},src:{type:String,default:""},hasCopyBtn:{type:Boolean,default:!1},hasClearBtn:{type:Boolean,default:!1},showDiffToggle:{type:Boolean,default:!1},isDiffMode:{type:Boolean,default:!1},hasInfoBtn:{type:Boolean,default:!1}},emits:["copy","clear","toggleDiff","info"],setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("div",ga,[e.loading?(t.openBlock(),t.createBlock(qe,{key:0,class:"absolute right-6 top-2"})):t.createCommentVNode("",!0),t.createElementVNode("div",ba,[e.showDiffToggle?(t.openBlock(),t.createBlock(ha,{key:0,disabled:e.loading,isDiffMode:e.isDiffMode,onToggle:n[0]||(n[0]=l=>o.$emit("toggleDiff"))},null,8,["disabled","isDiffMode"])):t.createCommentVNode("",!0),e.hasClearBtn&&e.src?(t.openBlock(),t.createBlock(jt,{key:1,onClick:n[1]||(n[1]=l=>o.$emit("clear")),disabled:e.loading},null,8,["disabled"])):t.createCommentVNode("",!0),e.hasCopyBtn&&e.src?(t.openBlock(),t.createBlock(zt,{key:2,onClick:n[2]||(n[2]=l=>o.$emit("copy"))})):t.createCommentVNode("",!0)])]))}},Ca={class:"bg-base-100 relative z-10 border border-base-300 rounded"},xa=["onKeydown","placeholder"],va=G({__name:"Input",props:{text:{type:String,default:""}},emits:["change","clear","improve"],setup(e,{emit:o}){const n=e,l=t.ref(n.text),{textarea:r}=Ve({input:l,styleProp:"minHeight"}),a=o;function i(){if(!l.value){s();return}a("change",l.value)}function s(){a("clear"),l.value="",r.value.focus()}function c(){r.value&&r.value.select()}function d(){l.value&&a("improve",l.value)}return t.watch(()=>n.text,u=>{l.value!==u&&(l.value=u,t.nextTick(c))}),t.onMounted(()=>{l.value=n.text,t.nextTick(()=>{r.value.focus(),c()})}),(u,f)=>(t.openBlock(),t.createElementBlock("div",Ca,[t.createVNode(qt,{src:e.text,hasClearBtn:!0,hasInfoBtn:!0,onClear:s,class:"mb-1"},null,8,["src"]),t.withDirectives(t.createElementVNode("textarea",{ref_key:"textarea",ref:r,"onUpdate:modelValue":f[0]||(f[0]=C=>l.value=C),class:"w-full outline-none px-2 pr-8 bg-transparent text-base-content resize-none pb-3 overflow-x-hidden overflow-y-hidden h-full",autofocus:"",rows:"2",onInput:i,onFocus:c,onKeydown:t.withKeys(t.withModifiers(d,["ctrl","prevent"]),["enter"]),placeholder:`Min ${t.unref(se).IMPROVE_INPUT_MIN_LENGTH} characters. ${t.unref(Me)?"":"Ctrl+Enter to improve"}`},null,40,xa),[[t.vModelText,l.value,void 0,{trim:!0}]])]))}},[["__scopeId","data-v-66614870"]]);function Z(){}Z.prototype={diff:function(o,n){var l,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=r.callback;typeof r=="function"&&(a=r,r={});var i=this;function s(y){return y=i.postProcess(y,r),a?(setTimeout(function(){a(y)},0),!0):y}o=this.castInput(o,r),n=this.castInput(n,r),o=this.removeEmpty(this.tokenize(o,r)),n=this.removeEmpty(this.tokenize(n,r));var c=n.length,d=o.length,u=1,f=c+d;r.maxEditLength!=null&&(f=Math.min(f,r.maxEditLength));var C=(l=r.timeout)!==null&&l!==void 0?l:1/0,h=Date.now()+C,b=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(b[0],n,o,0,r);if(b[0].oldPos+1>=d&&g+1>=c)return s(Gt(i,b[0].lastComponent,n,o,i.useLongestToken));var S=-1/0,k=1/0;function v(){for(var y=Math.max(S,-u);y<=Math.min(k,u);y+=2){var w=void 0,V=b[y-1],E=b[y+1];V&&(b[y-1]=void 0);var _=!1;if(E){var B=E.oldPos-y;_=E&&0<=B&&B<c}var p=V&&V.oldPos+1<d;if(!_&&!p){b[y]=void 0;continue}if(!p||_&&V.oldPos<E.oldPos?w=i.addToPath(E,!0,!1,0,r):w=i.addToPath(V,!1,!0,1,r),g=i.extractCommon(w,n,o,y,r),w.oldPos+1>=d&&g+1>=c)return s(Gt(i,w.lastComponent,n,o,i.useLongestToken));b[y]=w,w.oldPos+1>=d&&(k=Math.min(k,y-1)),g+1>=c&&(S=Math.max(S,y+1))}u++}if(a)(function y(){setTimeout(function(){if(u>f||Date.now()>h)return a();v()||y()},0)})();else for(;u<=f&&Date.now()<=h;){var x=v();if(x)return x}},addToPath:function(o,n,l,r,a){var i=o.lastComponent;return i&&!a.oneChangePerToken&&i.added===n&&i.removed===l?{oldPos:o.oldPos+r,lastComponent:{count:i.count+1,added:n,removed:l,previousComponent:i.previousComponent}}:{oldPos:o.oldPos+r,lastComponent:{count:1,added:n,removed:l,previousComponent:i}}},extractCommon:function(o,n,l,r,a){for(var i=n.length,s=l.length,c=o.oldPos,d=c-r,u=0;d+1<i&&c+1<s&&this.equals(l[c+1],n[d+1],a);)d++,c++,u++,a.oneChangePerToken&&(o.lastComponent={count:1,previousComponent:o.lastComponent,added:!1,removed:!1});return u&&!a.oneChangePerToken&&(o.lastComponent={count:u,previousComponent:o.lastComponent,added:!1,removed:!1}),o.oldPos=c,d},equals:function(o,n,l){return l.comparator?l.comparator(o,n):o===n||l.ignoreCase&&o.toLowerCase()===n.toLowerCase()},removeEmpty:function(o){for(var n=[],l=0;l<o.length;l++)o[l]&&n.push(o[l]);return n},castInput:function(o){return o},tokenize:function(o){return Array.from(o)},join:function(o){return o.join("")},postProcess:function(o){return o}};function Gt(e,o,n,l,r){for(var a=[],i;o;)a.push(o),i=o.previousComponent,delete o.previousComponent,o=i;a.reverse();for(var s=0,c=a.length,d=0,u=0;s<c;s++){var f=a[s];if(f.removed)f.value=e.join(l.slice(u,u+f.count)),u+=f.count;else{if(!f.added&&r){var C=n.slice(d,d+f.count);C=C.map(function(h,b){var g=l[u+b];return g.length>h.length?g:h}),f.value=e.join(C)}else f.value=e.join(n.slice(d,d+f.count));d+=f.count,f.added||(u+=f.count)}}return a}function Jt(e,o){var n;for(n=0;n<e.length&&n<o.length;n++)if(e[n]!=o[n])return e.slice(0,n);return e.slice(0,n)}function Yt(e,o){var n;if(!e||!o||e[e.length-1]!=o[o.length-1])return"";for(n=0;n<e.length&&n<o.length;n++)if(e[e.length-(n+1)]!=o[o.length-(n+1)])return e.slice(-n);return e.slice(-n)}function Je(e,o,n){if(e.slice(0,o.length)!=o)throw Error("string ".concat(JSON.stringify(e)," doesn't start with prefix ").concat(JSON.stringify(o),"; this is a bug"));return n+e.slice(o.length)}function Ye(e,o,n){if(!o)return e+n;if(e.slice(-o.length)!=o)throw Error("string ".concat(JSON.stringify(e)," doesn't end with suffix ").concat(JSON.stringify(o),"; this is a bug"));return e.slice(0,-o.length)+n}function ge(e,o){return Je(e,o,"")}function Ne(e,o){return Ye(e,o,"")}function Qt(e,o){return o.slice(0,ya(e,o))}function ya(e,o){var n=0;e.length>o.length&&(n=e.length-o.length);var l=o.length;e.length<o.length&&(l=e.length);var r=Array(l),a=0;r[0]=0;for(var i=1;i<l;i++){for(o[i]==o[a]?r[i]=r[a]:r[i]=a;a>0&&o[i]!=o[a];)a=r[a];o[i]==o[a]&&a++}a=0;for(var s=n;s<e.length;s++){for(;a>0&&e[s]!=o[a];)a=r[a];e[s]==o[a]&&a++}return a}var Le="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",wa=new RegExp("[".concat(Le,"]+|\\s+|[^").concat(Le,"]"),"ug"),Oe=new Z;Oe.equals=function(e,o,n){return n.ignoreCase&&(e=e.toLowerCase(),o=o.toLowerCase()),e.trim()===o.trim()},Oe.tokenize=function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n;if(o.intlSegmenter){if(o.intlSegmenter.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');n=Array.from(o.intlSegmenter.segment(e),function(a){return a.segment})}else n=e.match(wa)||[];var l=[],r=null;return n.forEach(function(a){/\s/.test(a)?r==null?l.push(a):l.push(l.pop()+a):/\s/.test(r)?l[l.length-1]==r?l.push(l.pop()+a):l.push(r+a):l.push(a),r=a}),l},Oe.join=function(e){return e.map(function(o,n){return n==0?o:o.replace(/^\s+/,"")}).join("")},Oe.postProcess=function(e,o){if(!e||o.oneChangePerToken)return e;var n=null,l=null,r=null;return e.forEach(function(a){a.added?l=a:a.removed?r=a:((l||r)&&Xt(n,r,l,a),n=a,l=null,r=null)}),(l||r)&&Xt(n,r,l,null),e};function Xt(e,o,n,l){if(o&&n){var r=o.value.match(/^\s*/)[0],a=o.value.match(/\s*$/)[0],i=n.value.match(/^\s*/)[0],s=n.value.match(/\s*$/)[0];if(e){var c=Jt(r,i);e.value=Ye(e.value,i,c),o.value=ge(o.value,c),n.value=ge(n.value,c)}if(l){var d=Yt(a,s);l.value=Je(l.value,s,d),o.value=Ne(o.value,d),n.value=Ne(n.value,d)}}else if(n)e&&(n.value=n.value.replace(/^\s*/,"")),l&&(l.value=l.value.replace(/^\s*/,""));else if(e&&l){var u=l.value.match(/^\s*/)[0],f=o.value.match(/^\s*/)[0],C=o.value.match(/\s*$/)[0],h=Jt(u,f);o.value=ge(o.value,h);var b=Yt(ge(u,h),C);o.value=Ne(o.value,b),l.value=Je(l.value,u,b),e.value=Ye(e.value,u,u.slice(0,u.length-b.length))}else if(l){var g=l.value.match(/^\s*/)[0],S=o.value.match(/\s*$/)[0],k=Qt(S,g);o.value=Ne(o.value,k)}else if(e){var v=e.value.match(/\s*$/)[0],x=o.value.match(/^\s*/)[0],y=Qt(v,x);o.value=ge(o.value,y)}}var Kt=new Z;Kt.tokenize=function(e){var o=new RegExp("(\\r?\\n)|[".concat(Le,"]+|[^\\S\\n\\r]+|[^").concat(Le,"]"),"ug");return e.match(o)||[]};function Ea(e,o,n){return Kt.diff(e,o,n)}var Qe=new Z;Qe.tokenize=function(e,o){o.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
19
19
|
`));var n=[],l=e.split(/(\n|\r\n)/);l[l.length-1]||l.pop();for(var r=0;r<l.length;r++){var a=l[r];r%2&&!o.newlineIsToken?n[n.length-1]+=a:n.push(a)}return n},Qe.equals=function(e,o,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
20
20
|
`))&&(e=e.trim()),(!n.newlineIsToken||!o.includes(`
|
|
21
21
|
`))&&(o=o.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
22
22
|
`)&&(e=e.slice(0,-1)),o.endsWith(`
|
|
23
|
-
`)&&(o=o.slice(0,-1))),Z.prototype.equals.call(this,e,o,n)};var wa=new Z;wa.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Ea=new Z;Ea.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Xe(e){"@babel/helpers - typeof";return Xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Xe(e)}var be=new Z;be.useLongestToken=!0,be.tokenize=Qe.tokenize,be.castInput=function(e,o){var n=o.undefinedReplacement,l=o.stringifyReplacer,r=l===void 0?function(a,i){return typeof i>"u"?n:i}:l;return typeof e=="string"?e:JSON.stringify(Ke(e,null,null,r),r," ")},be.equals=function(e,o,n){return Z.prototype.equals.call(be,e.replace(/,([\r\n])/g,"$1"),o.replace(/,([\r\n])/g,"$1"),n)};function Ke(e,o,n,l,r){o=o||[],n=n||[],l&&(e=l(r,e));var a;for(a=0;a<o.length;a+=1)if(o[a]===e)return n[a];var i;if(Object.prototype.toString.call(e)==="[object Array]"){for(o.push(e),i=new Array(e.length),n.push(i),a=0;a<e.length;a+=1)i[a]=Ke(e[a],o,n,l,r);return o.pop(),n.pop(),i}if(e&&e.toJSON&&(e=e.toJSON()),Xe(e)==="object"&&e!==null){o.push(e),i={},n.push(i);var s=[],c;for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],i[c]=Ke(e[c],o,n,l,c);o.pop(),n.pop()}else i=e;return i}var et=new Z;et.tokenize=function(e){return e.slice()},et.join=et.removeEmpty=function(e){return e};const _a={class:"bg-base-100 relative z-10 border border-base-300 rounded"},ka={class:"flex justify-end items-center mb-1"},Sa={class:"bg-transparent"},Ta=["innerHTML"],$a={__name:"Result",props:{text:{type:String,default:""},originalText:{type:String,default:""},type:{type:String,default:"improve"}},emits:["copy","change","clear"],setup(e,{emit:o}){const n=e,l=ne(),r=t.computed(()=>l.isLoading("writing")),a=t.computed(()=>r.value?"":n.text),i=t.ref(""),s=t.ref(se.DEFAULT_DIFF_MODE),{textarea:c}=Ve({input:a,styleProp:"minHeight"}),d=o;function u(){!r.value&&a.value&&d("copy",a.value)}function f(h,b){return ya(h,b).map(S=>S.added?`<span class="bg-addedBg inline leading-snug animate-addedText">${S.value}</span>`:S.removed?`<span class="bg-removedBg inline leading-snug animate-removedText">${S.value}</span>`:S.value).join("")}function C(){s.value=!s.value,se.DEFAULT_DIFF_MODE=s.value}return t.watch(()=>n.text,h=>{n.type==="check"&&(i.value=f(n.originalText,h))},{immediate:!0}),t.watch(a,h=>{d("change",h)}),(h,b)=>(t.openBlock(),t.createElementBlock("div",_a,[t.createElementVNode("div",ka,[t.createVNode(qt,{loading:r.value,src:a.value,hasCopyBtn:!r.value&&!!a.value,showDiffToggle:e.type==="check",isDiffMode:s.value,onCopy:u,onToggleDiff:C},null,8,["loading","src","hasCopyBtn","showDiffToggle","isDiffMode"])]),t.createElementVNode("div",Sa,[e.type!=="check"||!s.value?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:0,ref_key:"textarea",ref:c,"onUpdate:modelValue":b[0]||(b[0]=g=>a.value=g),class:"w-full outline-none px-1 pr-8 bg-transparent text-base-content resize-none pb-3 overflow-x-hidden overflow-y-hidden font-sans text-base leading-normal",readonly:"",spellcheck:"false"},null,512)),[[t.vModelText,a.value]]):(t.openBlock(),t.createElementBlock("pre",{key:1,class:"w-full min-h-[80px] outline-none px-1 pr-8 bg-transparent text-base-content resize-none pb-3 overflow-x-hidden overflow-y-hidden whitespace-pre-wrap break-words font-sans text-base leading-normal",innerHTML:r.value?"":i.value},null,8,Ta))])]))}},Va="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%3e%3cpath%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'%20d='M21%2012h1m-3.5-6.5%201-1M12%203V2M5.5%205.5l-1-1M3%2012H2m8%2010h4m3-10a5%205%200%201%200-7%204.584V19h4v-2.416A5.001%205.001%200%200%200%2017%2012z'/%3e%3c/svg%3e",Ba="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.8544%203.20309C5.39975%202.89815%204.26277%201.76117%203.95787%200.30649C3.92042%200.12792%203.76292%200%203.58041%200C3.3979%200%203.2404%200.12792%203.20297%200.30652C2.89805%201.76117%201.76107%202.89812%200.306418%203.20302C0.127818%203.24045%20-0.00012207%203.39798%20-0.00012207%203.58046C-0.00012207%203.76295%200.127798%203.92047%200.306418%203.9579C1.76105%204.26285%202.89798%205.3998%203.2029%206.85448C3.24033%207.03307%203.39783%207.16102%203.58034%207.16102C3.76282%207.16102%203.92035%207.0331%203.95778%206.85448C4.26272%205.39983%205.39973%204.26287%206.85438%203.95799C7.03297%203.92056%207.16092%203.76306%207.16092%203.58056C7.1609%203.39805%207.03297%203.24052%206.8544%203.20309ZM3.58036%205.60938C3.14292%204.73132%202.42956%204.01792%201.55151%203.58049C2.42958%203.14305%203.14297%202.42968%203.58041%201.55161C4.01785%202.4297%204.73122%203.14307%205.60926%203.58053C4.73119%204.01797%204.0178%204.73132%203.58036%205.60938Z'%20fill='currentColor'/%3e%3cpath%20d='M6.21683%209.574C5.53147%209.4303%204.99578%208.8947%204.85209%208.2093C4.81466%208.0307%204.65716%207.90271%204.47465%207.90271C4.29217%207.90271%204.13464%208.0306%204.09721%208.2092C3.95352%208.8946%203.4178%209.4303%202.73244%209.574C2.55385%209.6114%202.4259%209.7689%202.4259%209.9514C2.4259%2010.1339%202.55383%2010.2914%202.73244%2010.3288C3.41778%2010.4725%203.95349%2011.0082%204.09716%2011.6936C4.13459%2011.8722%204.2921%2012.0002%204.4746%2012.0002C4.65709%2012.0002%204.81461%2011.8723%204.85204%2011.6936C4.99574%2011.0082%205.53145%2010.4725%206.21683%2010.3289C6.39543%2010.2914%206.52337%2010.1339%206.52337%209.9514C6.52337%209.7689%206.39545%209.6114%206.21683%209.574ZM4.47463%2010.6408C4.29163%2010.3688%204.05725%2010.1345%203.78526%209.9515C4.0573%209.7684%204.29163%209.5341%204.47463%209.2621C4.65765%209.5341%204.892%209.7685%205.164%209.9515C4.892%2010.1345%204.65763%2010.3688%204.47463%2010.6408Z'%20fill='currentColor'/%3e%3cpath%20d='M11.4271%206.00324C10.5007%205.80904%209.7766%205.08496%209.5825%204.15859C9.545%203.98%209.3875%203.85205%209.205%203.85205C9.0225%203.85205%208.865%203.97995%208.8276%204.15857C8.6334%205.08496%207.90932%205.80902%206.98293%206.0032C6.80434%206.04063%206.67639%206.19815%206.67639%206.38064C6.67639%206.56312%206.80431%206.72062%206.98293%206.75807C7.9093%206.95228%208.6334%207.67633%208.8275%208.6027C8.865%208.7813%209.0225%208.9093%209.205%208.9093C9.3875%208.9093%209.545%208.7814%209.5824%208.6027C9.7766%207.67633%2010.5007%206.95228%2011.4271%206.75812C11.6057%206.72067%2011.7336%206.56317%2011.7336%206.38068C11.7336%206.1982%2011.6057%206.04067%2011.4271%206.00324ZM9.205%207.47681C8.9365%207.02634%208.5593%206.64914%208.1089%206.38066C8.5593%206.11218%208.9365%205.73502%209.205%205.28453C9.4735%205.73502%209.8507%206.11221%2010.3012%206.38068C9.8507%206.64916%209.4735%207.02636%209.205%207.47681Z'%20fill='currentColor'/%3e%3c/svg%3e",Na="data:image/svg+xml,%3csvg%20class='w-5%20h-5'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%20fill='currentColor'%20aria-hidden='true'%20%3e%3cpath%20fill-rule='evenodd'%20d='M5.293%207.293a1%201%200%20011.414%200L10%2010.586l3.293-3.293a1%201%200%20111.414%201.414l-4%204a1%201%200%2001-1.414%200l-4-4a1%201%200%20010-1.414z'%20clip-rule='evenodd'%20/%3e%3c/svg%3e",La="data:image/svg+xml,%3csvg%20class='w-5%20h-5'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%20fill='currentColor'%20aria-hidden='true'%20%3e%3cpath%20fill-rule='evenodd'%20d='M5.293%207.293a1%201%200%20011.414%200L10%2010.586l3.293-3.293a1%201%200%20111.414%201.414l-4%204a1%201%200%2001-1.414%200l-4-4a1%201%200%20010-1.414z'%20clip-rule='evenodd'%20/%3e%3c/svg%3e",tt=e=>(t.pushScopeId("data-v-345bc0b4"),e=e(),t.popScopeId(),e),Oa={class:"flex rounded-md w-full"},Ia=["disabled"],Ma={class:"flex items-center text-xs"},Aa=["src"],Ra=tt(()=>t.createElementVNode("div",{class:"w-px bg-base-300"},null,-1)),Da={class:"relative block"},Pa=["aria-expanded","disabled"],Fa=[tt(()=>t.createElementVNode("span",{class:"sr-only"},"Open options",-1)),tt(()=>t.createElementVNode("img",{src:La,alt:"Chevron down",class:"w-4 h-4 fill-current"},null,-1))],ja={key:0,class:"origin-top-right absolute left-0 mt-1 w-full rounded-md shadow-lg bg-base-100 ring-1 ring-base-300 focus:outline-none z-50",role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu"},za={class:"py-1",role:"none"},Ha=["onClick"],Za={class:"flex items-center"},Ua=["src"],Wa=G({__name:"ButtonSelect",props:{modelValue:{type:String,required:!0},options:{type:Array,required:!0},isTextEmpty:{type:Boolean,default:!0},hasResult:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(e,{emit:o}){const n=e,l=o,r=t.ref(!1),a=t.ref(n.modelValue),i=t.ref(null),s=t.computed(()=>n.options.find(h=>h.value===a.value)||n.options[0]);function c(){l("action")}function d(){n.loading||(r.value=!r.value)}function u(h){h.value!==a.value&&(a.value=h.value,l("update:modelValue",h.value)),r.value=!1}function f(h){return new URL(Object.assign({"../../assets/icons/ai-explain.svg":Va,"../../assets/icons/ai-translate.svg":Ba,"../../assets/icons/chevron-down.svg":Na})[`../../assets/icons/${h}.svg`],typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Ie&&Ie.tagName.toUpperCase()==="SCRIPT"&&Ie.src||new URL("popup.umd.js",document.baseURI).href).href}function C(h){i.value&&!i.value.contains(h.target)&&(r.value=!1)}return t.watch(()=>n.modelValue,h=>{h!==a.value&&(a.value=h)}),t.watch(()=>n.isTextEmpty,h=>{h&&(r.value=!1)}),t.onMounted(()=>{document.addEventListener("click",C)}),t.onUnmounted(()=>{document.removeEventListener("click",C)}),(h,b)=>(t.openBlock(),t.createElementBlock("div",{class:"relative inline-block text-left flex-1",ref_key:"dropdownRef",ref:i},[t.createElementVNode("div",{class:t.normalizeClass(["relative rounded-lg overflow-hidden border-2 shadow-lg",e.isTextEmpty||n.loading?"border-base-300":"border-primary"])},[t.createElementVNode("div",Oa,[t.createElementVNode("button",{onClick:c,class:t.normalizeClass(["px-2 py-1 text-sm font-medium rounded-s focus:z-10 focus:outline-none flex-grow text-left relative",[e.isTextEmpty||n.loading?"bg-base-300 text-base-content/50 cursor-not-allowed":"bg-primary text-primary-content"]]),disabled:e.isTextEmpty||n.loading},[t.createElementVNode("div",Ma,[t.createElementVNode("img",{src:f(s.value.icon),alt:"",class:"w-4 h-4 mr-2"},null,8,Aa),t.createTextVNode(" "+t.toDisplayString(s.value.label),1)])],10,Ia),Ra,t.createElementVNode("div",Da,[t.createElementVNode("button",{onClick:d,type:"button",class:t.normalizeClass(["h-full px-1 py-1 text-sm font-medium rounded-e focus:z-10 focus:outline-none",[e.isTextEmpty||n.loading?"bg-base-300 text-base-content/50 cursor-not-allowed":"bg-primary text-primary-content"]]),"aria-haspopup":"true","aria-expanded":r.value,disabled:e.isTextEmpty||n.loading},Fa,10,Pa)])])],2),r.value?(t.openBlock(),t.createElementBlock("div",ja,[t.createElementVNode("div",za,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.options,g=>(t.openBlock(),t.createElementBlock("a",{key:g.value,onClick:S=>u(g),href:"#",class:"block px-1 py-1 text-sm text-base-content hover:bg-base-200 hover:text-primary",role:"menuitem"},[t.createElementVNode("div",Za,[t.createElementVNode("img",{src:f(g.icon),alt:"",class:"w-4 h-4 mr-2"},null,8,Ua),t.createTextVNode(" "+t.toDisplayString(g.label),1)])],8,Ha))),128))])])):t.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-345bc0b4"]]),qa={class:"w-full mt-1"},Ga={class:"flex flex-col lg:flex-row lg:items-stretch lg:space-x-4 lg:min-h-[50vh]"},Ja={class:"lg:flex-grow lg:w-0 flex flex-col"},Ya={class:"flex flex-row lg:flex-col items-center justify-center place-content-center min-h-full"},Qa={class:"flex items-center",style:{"max-width":"300px"}},Xa={class:"lg:flex-grow lg:w-0 flex flex-col"},Ka={__name:"WriteTab",props:{opt:{type:Object,required:!0},languages:{type:Object,required:!0},writing:{type:Object,default:null}},emits:["opt","write","copy"],setup(e,{emit:o}){const n=t.inject("writingStore"),l=t.inject("loaderStore"),r=e,a=o,i=[{value:"check",label:"Check",icon:"ai-translate"},{value:"improve",label:"Improve",icon:"ai-explain"},{value:"improve-plus",label:"Improve +++",icon:"ai-explain"},{value:"simplify",label:"Simplify",icon:"ai-translate"},{value:"more-detailed",label:"More detailed",icon:"ai-explain"}];t.watch(()=>r.writing,g=>{l.setLoading("writing",!1),g&&(n.reset(),n.init(g))},{immediate:!0}),t.watch(()=>r.opt,g=>{g.src!==n.src&&n.init({...n.$state,src:g.src})},{deep:!0});function s(g){n.init({...n.$state,text:g})}function c(){n.reset()}function d(g){n.init({...n.$state,result:g})}function u(){n.init({...n.$state,result:"",suggestions:[]})}function f(g=null){n.text.length<se.IMPROVE_INPUT_MIN_LENGTH||(l.setLoading("writing",!0),h(n.text,r.opt.type,g))}function C(){f("retry")}function h(g,S=r.opt.type,k){g&&(l.setLoading("writing",!0),a("write",{src:r.opt.src,text:g,action:S,flag:k}))}function b(g){l.setLoading("writing",!0),a("opt",{...r.opt,type:g,text:n.text})}return(g,S)=>{var k,v;return t.openBlock(),t.createElementBlock("div",qa,[t.createElementVNode("div",Ga,[t.createElementVNode("div",Ja,[t.createVNode(Ca,{class:"my-2 lg:my-0 w-full flex-grow lg:min-h-[50vh]",text:t.unref(n).text,onChange:s,onClear:c,onImprove:f},null,8,["text"])]),t.createElementVNode("div",Ya,[t.createElementVNode("div",Qa,[t.createVNode(Wa,{class:"w-full",modelValue:r.opt.type,options:i,loading:t.unref(l).isLoading("writing"),isTextEmpty:t.unref(n).text&&((k=t.unref(n).text)==null?void 0:k.length)<t.unref(se).IMPROVE_INPUT_MIN_LENGTH,hasResult:!!t.unref(n).result,"onUpdate:modelValue":b,onAction:f},null,8,["modelValue","loading","isTextEmpty","hasResult"])]),t.createVNode(ia,{class:"ml-2 lg:m-2",disabled:((v=t.unref(n).text)==null?void 0:v.length)<5||!t.unref(n).result,onClick:C},null,8,["disabled"])]),t.createElementVNode("div",Xa,[t.createVNode($a,{class:"my-2 lg:my-0 w-full flex-grow lg:min-h-[50vh]",text:t.unref(n).result,originalText:t.unref(n).text,type:r.opt.type,onChange:d,onClear:u,onCopy:S[0]||(S[0]=x=>{var y;return a("copy",(y=t.unref(n))==null?void 0:y.result)})},null,8,["text","originalText","type"])])])])}}},en=he("writing",()=>{const e=t.ref(null),o=t.ref(""),n=t.ref(""),l=t.ref([]),r=t.ref(null),a=ae(),i=t.computed(()=>a.getLabel(e.value));function s(d){e.value=d.src,o.value=d.text,n.value=d.result,l.value=d.suggestions,r.value=d.action}function c(){e.value=null,o.value="",n.value="",l.value=[],r.value=null}return{src:e,srcLabel:i,text:o,result:n,suggestions:l,action:r,init:s,reset:c}}),tn=e=>(t.pushScopeId("data-v-e4dbf9d3"),e=e(),t.popScopeId(),e),es=["data-theme"],ts={class:"flex-none py-2 pl-3 pr-2 shadow border border-base-300"},ns={class:"flex-none"},os={class:"flex w-full border-b border-base-300 items-center"},ls={key:0,class:"text-xs text-base-content/40 ml-1 italic"},rs=[tn(()=>t.createElementVNode("small",null,"(Tab)",-1))],as={key:0,class:"text-xs text-base-content/40 ml-1 italic"},ss=[tn(()=>t.createElementVNode("small",null,"(Tab)",-1))],is={class:"flex-1 min-h-0"},cs={class:"h-full overflow-y-auto overflow-x-hidden custom-scrollbar"},ds=G({__name:"Popup",props:{options:{type:Object,default:()=>({})},data:{type:Object,default:()=>({translation:{text:"",result:"",dict:[]},writing:{text:"",result:"",suggestions:[]},explanation:{result:""},tts:{}})},headerSettings:{type:Object,default:()=>({showAccount:!0,showReader:!0,showFullscreen:!0,showSettings:!0})},theme:{type:String,default:"light"}},emits:["nav","translate","write","common"],setup(e,{emit:o}){const n=Yo();J(n),Ge(n),ae(n),ne(n),en(n);const l=J(),r=Ge(),a=ae(),i=ne(),s=en();t.provide("translationStore",l),t.provide("ttsStore",r),t.provide("languageStore",a),t.provide("loaderStore",i),t.provide("writingStore",s);const c=o,d=(v,x)=>{c("nav",{action:v,payload:x})},u=v=>{c("nav",{action:"themeChange",payload:v})},f=(v,x={})=>{c("translate",{action:v,payload:x})},C=(v,x={})=>{c("write",{action:v,payload:x})},h=(v,x={})=>{c("common",{action:v,payload:x})},b=e,g={activeTab:"translate",translateOpts:{src:"auto",target:"en"},writeOpts:{type:"check"},languages:{src:{code:"auto",name:"Auto Detect"},target:{code:"en",name:"English"}},isFavoriteFeatureEnabled:!1,isAITranslateFeatureEnabled:!1,isImprovementFeatureEnabled:!1,isFavorite:!1,isAITranslate:!1,isAIExplain:!1,aiExplainMinLength:5,isTTS:!0},S=t.computed(()=>Object.assign({},g,b.options)),k=v=>{if(v.key==="Tab"){v.preventDefault();const y=S.value.activeTab==="translate"?"write":"translate";d("activeTab",y)}};return t.onMounted(()=>{window.addEventListener("keydown",k)}),t.onUnmounted(()=>{window.removeEventListener("keydown",k)}),(v,x)=>(t.openBlock(),t.createElementBlock("div",{"data-theme":e.theme,class:"h-screen flex flex-col bg-base-100"},[t.createElementVNode("div",ts,[t.createVNode(wn,{"header-settings":e.headerSettings,"current-theme":e.theme,onReader:x[0]||(x[0]=y=>d("reader")),onLearn:x[1]||(x[1]=y=>d("learn")),onSettings:x[2]||(x[2]=y=>d("settings")),onFullScreen:x[3]||(x[3]=y=>d("fullscreen")),onAccount:x[4]||(x[4]=y=>d("account")),onThemeChange:u},null,8,["header-settings","current-theme"])]),t.createElementVNode("div",ns,[t.createElementVNode("div",os,[t.createElementVNode("button",{class:t.normalizeClass(["w-1/2 px-4 py-2 text-sm font-medium",S.value.activeTab==="translate"?"text-primary border-b-2 border-primary":"text-base-content/60 hover:text-primary"]),onClick:x[5]||(x[5]=y=>d("activeTab","translate"))},[t.createTextVNode(" Translate "),!t.unref(Me)&&S.value.activeTab!=="translate"?(t.openBlock(),t.createElementBlock("span",ls,rs)):t.createCommentVNode("",!0)],2),t.createElementVNode("button",{class:t.normalizeClass(["w-1/2 px-4 py-2 text-sm font-medium",S.value.activeTab==="write"?"text-primary border-b-2 border-primary":"text-base-content/60 hover:text-primary"]),onClick:x[6]||(x[6]=y=>d("activeTab","write"))},[t.createTextVNode(" Write "),!t.unref(Me)&&S.value.activeTab!=="write"?(t.openBlock(),t.createElementBlock("span",as,ss)):t.createCommentVNode("",!0)],2)])]),t.createElementVNode("div",is,[t.createElementVNode("div",cs,[S.value.activeTab==="translate"?(t.openBlock(),t.createBlock(ra,{key:0,opt:S.value.translateOpts,languages:S.value.languages,translation:e.data.translation,explanation:e.data.explanation,tts:e.data.tts,isTTS:S.value.isTTS,isFavoriteFeatureEnabled:S.value.isFavoriteFeatureEnabled,isAITranslateFeatureEnabled:S.value.isAITranslateFeatureEnabled,isFavorite:S.value.isFavorite,isAITranslate:S.value.isAITranslate,isAIExplain:S.value.isAIExplain,aiExplainMinLength:S.value.aiExplainMinLength,onOpt:x[7]||(x[7]=y=>f("updateOpts",y)),onTranslate:x[8]||(x[8]=y=>f("translate",y)),onLoadTTS:x[9]||(x[9]=y=>f("loadTTS",y)),onFavorite:x[10]||(x[10]=y=>f("favorite")),onAiTranslate:x[11]||(x[11]=y=>f("aiTranslate",y)),onAiExplain:x[12]||(x[12]=y=>f("aiExplain",y)),onCopy:x[13]||(x[13]=y=>h("copy",y))},null,8,["opt","languages","translation","explanation","tts","isTTS","isFavoriteFeatureEnabled","isAITranslateFeatureEnabled","isFavorite","isAITranslate","isAIExplain","aiExplainMinLength"])):t.createCommentVNode("",!0),S.value.activeTab==="write"?(t.openBlock(),t.createBlock(Ka,{key:1,opt:S.value.writeOpts,languages:S.value.languages,writing:e.data.writing,onOpt:x[14]||(x[14]=y=>C("updateOpts",y)),onWrite:x[15]||(x[15]=y=>C("write",y)),onCopy:x[16]||(x[16]=y=>h("copy",y))},null,8,["opt","languages","writing"])):t.createCommentVNode("",!0)])])],8,es))}},[["__scopeId","data-v-e4dbf9d3"]]);Y.default=ds,Object.defineProperties(Y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
23
|
+
`)&&(o=o.slice(0,-1))),Z.prototype.equals.call(this,e,o,n)};var _a=new Z;_a.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var ka=new Z;ka.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Xe(e){"@babel/helpers - typeof";return Xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Xe(e)}var be=new Z;be.useLongestToken=!0,be.tokenize=Qe.tokenize,be.castInput=function(e,o){var n=o.undefinedReplacement,l=o.stringifyReplacer,r=l===void 0?function(a,i){return typeof i>"u"?n:i}:l;return typeof e=="string"?e:JSON.stringify(Ke(e,null,null,r),r," ")},be.equals=function(e,o,n){return Z.prototype.equals.call(be,e.replace(/,([\r\n])/g,"$1"),o.replace(/,([\r\n])/g,"$1"),n)};function Ke(e,o,n,l,r){o=o||[],n=n||[],l&&(e=l(r,e));var a;for(a=0;a<o.length;a+=1)if(o[a]===e)return n[a];var i;if(Object.prototype.toString.call(e)==="[object Array]"){for(o.push(e),i=new Array(e.length),n.push(i),a=0;a<e.length;a+=1)i[a]=Ke(e[a],o,n,l,r);return o.pop(),n.pop(),i}if(e&&e.toJSON&&(e=e.toJSON()),Xe(e)==="object"&&e!==null){o.push(e),i={},n.push(i);var s=[],c;for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],i[c]=Ke(e[c],o,n,l,c);o.pop(),n.pop()}else i=e;return i}var et=new Z;et.tokenize=function(e){return e.slice()},et.join=et.removeEmpty=function(e){return e};const Sa={class:"bg-base-100 relative z-10 border border-base-300 rounded"},Ta={class:"flex justify-end items-center mb-1"},$a={class:"bg-transparent"},Va=["innerHTML"],Ba={__name:"Result",props:{text:{type:String,default:""},originalText:{type:String,default:""},type:{type:String,default:"improve"}},emits:["copy","change","clear"],setup(e,{emit:o}){const n=e,l=ne(),r=t.computed(()=>l.isLoading("writing")),a=t.computed(()=>r.value?"":n.text),i=t.ref(""),s=t.ref(se.DEFAULT_DIFF_MODE),{textarea:c}=Ve({input:a,styleProp:"minHeight"}),d=o;function u(){!r.value&&a.value&&d("copy",a.value)}function f(h,b){return Ea(h,b).map(S=>S.added?`<span class="bg-addedBg inline leading-snug animate-addedText">${S.value}</span>`:S.removed?`<span class="bg-removedBg inline leading-snug animate-removedText">${S.value}</span>`:S.value).join("")}function C(){s.value=!s.value,se.DEFAULT_DIFF_MODE=s.value}return t.watch(()=>n.text,h=>{n.type==="check"&&(i.value=f(n.originalText,h))},{immediate:!0}),t.watch(a,h=>{d("change",h)}),(h,b)=>(t.openBlock(),t.createElementBlock("div",Sa,[t.createElementVNode("div",Ta,[t.createVNode(qt,{loading:r.value,src:a.value,hasCopyBtn:!r.value&&!!a.value,showDiffToggle:e.type==="check",isDiffMode:s.value,onCopy:u,onToggleDiff:C},null,8,["loading","src","hasCopyBtn","showDiffToggle","isDiffMode"])]),t.createElementVNode("div",$a,[e.type!=="check"||!s.value?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:0,ref_key:"textarea",ref:c,"onUpdate:modelValue":b[0]||(b[0]=g=>a.value=g),class:"w-full outline-none px-1 pr-8 bg-transparent text-base-content resize-none pb-3 overflow-x-hidden overflow-y-hidden font-sans text-base leading-normal",readonly:"",spellcheck:"false"},null,512)),[[t.vModelText,a.value]]):(t.openBlock(),t.createElementBlock("pre",{key:1,class:"w-full min-h-[80px] outline-none px-1 pr-8 bg-transparent text-base-content resize-none pb-3 overflow-x-hidden overflow-y-hidden whitespace-pre-wrap break-words font-sans text-base leading-normal",innerHTML:r.value?"":i.value},null,8,Va))])]))}},Na="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%3e%3cpath%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'%20d='M21%2012h1m-3.5-6.5%201-1M12%203V2M5.5%205.5l-1-1M3%2012H2m8%2010h4m3-10a5%205%200%201%200-7%204.584V19h4v-2.416A5.001%205.001%200%200%200%2017%2012z'/%3e%3c/svg%3e",La="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.8544%203.20309C5.39975%202.89815%204.26277%201.76117%203.95787%200.30649C3.92042%200.12792%203.76292%200%203.58041%200C3.3979%200%203.2404%200.12792%203.20297%200.30652C2.89805%201.76117%201.76107%202.89812%200.306418%203.20302C0.127818%203.24045%20-0.00012207%203.39798%20-0.00012207%203.58046C-0.00012207%203.76295%200.127798%203.92047%200.306418%203.9579C1.76105%204.26285%202.89798%205.3998%203.2029%206.85448C3.24033%207.03307%203.39783%207.16102%203.58034%207.16102C3.76282%207.16102%203.92035%207.0331%203.95778%206.85448C4.26272%205.39983%205.39973%204.26287%206.85438%203.95799C7.03297%203.92056%207.16092%203.76306%207.16092%203.58056C7.1609%203.39805%207.03297%203.24052%206.8544%203.20309ZM3.58036%205.60938C3.14292%204.73132%202.42956%204.01792%201.55151%203.58049C2.42958%203.14305%203.14297%202.42968%203.58041%201.55161C4.01785%202.4297%204.73122%203.14307%205.60926%203.58053C4.73119%204.01797%204.0178%204.73132%203.58036%205.60938Z'%20fill='currentColor'/%3e%3cpath%20d='M6.21683%209.574C5.53147%209.4303%204.99578%208.8947%204.85209%208.2093C4.81466%208.0307%204.65716%207.90271%204.47465%207.90271C4.29217%207.90271%204.13464%208.0306%204.09721%208.2092C3.95352%208.8946%203.4178%209.4303%202.73244%209.574C2.55385%209.6114%202.4259%209.7689%202.4259%209.9514C2.4259%2010.1339%202.55383%2010.2914%202.73244%2010.3288C3.41778%2010.4725%203.95349%2011.0082%204.09716%2011.6936C4.13459%2011.8722%204.2921%2012.0002%204.4746%2012.0002C4.65709%2012.0002%204.81461%2011.8723%204.85204%2011.6936C4.99574%2011.0082%205.53145%2010.4725%206.21683%2010.3289C6.39543%2010.2914%206.52337%2010.1339%206.52337%209.9514C6.52337%209.7689%206.39545%209.6114%206.21683%209.574ZM4.47463%2010.6408C4.29163%2010.3688%204.05725%2010.1345%203.78526%209.9515C4.0573%209.7684%204.29163%209.5341%204.47463%209.2621C4.65765%209.5341%204.892%209.7685%205.164%209.9515C4.892%2010.1345%204.65763%2010.3688%204.47463%2010.6408Z'%20fill='currentColor'/%3e%3cpath%20d='M11.4271%206.00324C10.5007%205.80904%209.7766%205.08496%209.5825%204.15859C9.545%203.98%209.3875%203.85205%209.205%203.85205C9.0225%203.85205%208.865%203.97995%208.8276%204.15857C8.6334%205.08496%207.90932%205.80902%206.98293%206.0032C6.80434%206.04063%206.67639%206.19815%206.67639%206.38064C6.67639%206.56312%206.80431%206.72062%206.98293%206.75807C7.9093%206.95228%208.6334%207.67633%208.8275%208.6027C8.865%208.7813%209.0225%208.9093%209.205%208.9093C9.3875%208.9093%209.545%208.7814%209.5824%208.6027C9.7766%207.67633%2010.5007%206.95228%2011.4271%206.75812C11.6057%206.72067%2011.7336%206.56317%2011.7336%206.38068C11.7336%206.1982%2011.6057%206.04067%2011.4271%206.00324ZM9.205%207.47681C8.9365%207.02634%208.5593%206.64914%208.1089%206.38066C8.5593%206.11218%208.9365%205.73502%209.205%205.28453C9.4735%205.73502%209.8507%206.11221%2010.3012%206.38068C9.8507%206.64916%209.4735%207.02636%209.205%207.47681Z'%20fill='currentColor'/%3e%3c/svg%3e",Oa="data:image/svg+xml,%3csvg%20class='w-5%20h-5'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%20fill='currentColor'%20aria-hidden='true'%20%3e%3cpath%20fill-rule='evenodd'%20d='M5.293%207.293a1%201%200%20011.414%200L10%2010.586l3.293-3.293a1%201%200%20111.414%201.414l-4%204a1%201%200%2001-1.414%200l-4-4a1%201%200%20010-1.414z'%20clip-rule='evenodd'%20/%3e%3c/svg%3e",Ia="data:image/svg+xml,%3csvg%20class='w-5%20h-5'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%20fill='currentColor'%20aria-hidden='true'%20%3e%3cpath%20fill-rule='evenodd'%20d='M5.293%207.293a1%201%200%20011.414%200L10%2010.586l3.293-3.293a1%201%200%20111.414%201.414l-4%204a1%201%200%2001-1.414%200l-4-4a1%201%200%20010-1.414z'%20clip-rule='evenodd'%20/%3e%3c/svg%3e",tt=e=>(t.pushScopeId("data-v-345bc0b4"),e=e(),t.popScopeId(),e),Ma={class:"flex rounded-md w-full"},Aa=["disabled"],Ra={class:"flex items-center text-xs"},Da=["src"],Pa=tt(()=>t.createElementVNode("div",{class:"w-px bg-base-300"},null,-1)),Fa={class:"relative block"},ja=["aria-expanded","disabled"],za=[tt(()=>t.createElementVNode("span",{class:"sr-only"},"Open options",-1)),tt(()=>t.createElementVNode("img",{src:Ia,alt:"Chevron down",class:"w-4 h-4 fill-current"},null,-1))],Ha={key:0,class:"origin-top-right absolute left-0 mt-1 w-full rounded-md shadow-lg bg-base-100 ring-1 ring-base-300 focus:outline-none z-50",role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu"},Za={class:"py-1",role:"none"},Ua=["onClick"],Wa={class:"flex items-center"},qa=["src"],Ga=G({__name:"ButtonSelect",props:{modelValue:{type:String,required:!0},options:{type:Array,required:!0},isTextEmpty:{type:Boolean,default:!0},hasResult:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(e,{emit:o}){const n=e,l=o,r=t.ref(!1),a=t.ref(n.modelValue),i=t.ref(null),s=t.computed(()=>n.options.find(h=>h.value===a.value)||n.options[0]);function c(){l("action")}function d(){n.loading||(r.value=!r.value)}function u(h){h.value!==a.value&&(a.value=h.value,l("update:modelValue",h.value)),r.value=!1}function f(h){return new URL(Object.assign({"../../assets/icons/ai-explain.svg":Na,"../../assets/icons/ai-translate.svg":La,"../../assets/icons/chevron-down.svg":Oa})[`../../assets/icons/${h}.svg`],typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Ie&&Ie.tagName.toUpperCase()==="SCRIPT"&&Ie.src||new URL("popup.umd.js",document.baseURI).href).href}function C(h){i.value&&!i.value.contains(h.target)&&(r.value=!1)}return t.watch(()=>n.modelValue,h=>{h!==a.value&&(a.value=h)}),t.watch(()=>n.isTextEmpty,h=>{h&&(r.value=!1)}),t.onMounted(()=>{document.addEventListener("click",C)}),t.onUnmounted(()=>{document.removeEventListener("click",C)}),(h,b)=>(t.openBlock(),t.createElementBlock("div",{class:"relative inline-block text-left flex-1",ref_key:"dropdownRef",ref:i},[t.createElementVNode("div",{class:t.normalizeClass(["relative rounded-lg overflow-hidden border-2 shadow-lg",e.isTextEmpty||n.loading?"border-base-300":"border-primary"])},[t.createElementVNode("div",Ma,[t.createElementVNode("button",{onClick:c,class:t.normalizeClass(["px-2 py-1 text-sm font-medium rounded-s focus:z-10 focus:outline-none flex-grow text-left relative",[e.isTextEmpty||n.loading?"bg-base-300 text-base-content/50 cursor-not-allowed":"bg-primary text-primary-content"]]),disabled:e.isTextEmpty||n.loading},[t.createElementVNode("div",Ra,[t.createElementVNode("img",{src:f(s.value.icon),alt:"",class:"w-4 h-4 mr-2"},null,8,Da),t.createTextVNode(" "+t.toDisplayString(s.value.label),1)])],10,Aa),Pa,t.createElementVNode("div",Fa,[t.createElementVNode("button",{onClick:d,type:"button",class:t.normalizeClass(["h-full px-1 py-1 text-sm font-medium rounded-e focus:z-10 focus:outline-none",[e.isTextEmpty||n.loading?"bg-base-300 text-base-content/50 cursor-not-allowed":"bg-primary text-primary-content"]]),"aria-haspopup":"true","aria-expanded":r.value,disabled:e.isTextEmpty||n.loading},za,10,ja)])])],2),r.value?(t.openBlock(),t.createElementBlock("div",Ha,[t.createElementVNode("div",Za,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.options,g=>(t.openBlock(),t.createElementBlock("a",{key:g.value,onClick:S=>u(g),href:"#",class:"block px-1 py-1 text-sm text-base-content hover:bg-base-200 hover:text-primary",role:"menuitem"},[t.createElementVNode("div",Wa,[t.createElementVNode("img",{src:f(g.icon),alt:"",class:"w-4 h-4 mr-2"},null,8,qa),t.createTextVNode(" "+t.toDisplayString(g.label),1)])],8,Ua))),128))])])):t.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-345bc0b4"]]),Ja={class:"w-full mt-1"},Ya={class:"flex flex-col lg:flex-row lg:items-stretch lg:space-x-4 lg:min-h-[50vh]"},Qa={class:"lg:flex-grow lg:w-0 flex flex-col"},Xa={class:"flex flex-row lg:flex-col items-center justify-center place-content-center min-h-full"},Ka={class:"flex items-center",style:{"max-width":"300px"}},es={class:"lg:flex-grow lg:w-0 flex flex-col"},ts={__name:"WriteTab",props:{opt:{type:Object,required:!0},languages:{type:Object,required:!0},writing:{type:Object,default:null}},emits:["opt","write","copy"],setup(e,{emit:o}){const n=t.inject("writingStore"),l=t.inject("loaderStore"),r=e,a=o,i=[{value:"check",label:"Check",icon:"ai-translate"},{value:"improve",label:"Improve",icon:"ai-explain"},{value:"improve-plus",label:"Academy",icon:"ai-explain"},{value:"friendly",label:"Friendly",icon:"ai-translate"},{value:"simplify",label:"Simplify",icon:"ai-translate"},{value:"more-detailed",label:"More detailed",icon:"ai-explain"}];t.watch(()=>r.writing,g=>{l.setLoading("writing",!1),g&&(n.reset(),n.init(g))},{immediate:!0}),t.watch(()=>r.opt,g=>{g.src!==n.src&&n.init({...n.$state,src:g.src})},{deep:!0});function s(g){n.init({...n.$state,text:g})}function c(){n.reset()}function d(g){n.init({...n.$state,result:g})}function u(){n.init({...n.$state,result:"",suggestions:[]})}function f(g=null){n.text.length<se.IMPROVE_INPUT_MIN_LENGTH||(l.setLoading("writing",!0),h(n.text,r.opt.type,g))}function C(){f("retry")}function h(g,S=r.opt.type,k){g&&(l.setLoading("writing",!0),a("write",{src:r.opt.src,text:g,action:S,flag:k}))}function b(g){l.setLoading("writing",!0),a("opt",{...r.opt,type:g,text:n.text})}return(g,S)=>{var k,v;return t.openBlock(),t.createElementBlock("div",Ja,[t.createElementVNode("div",Ya,[t.createElementVNode("div",Qa,[t.createVNode(va,{class:"my-2 lg:my-0 w-full flex-grow lg:min-h-[50vh]",text:t.unref(n).text,onChange:s,onClear:c,onImprove:f},null,8,["text"])]),t.createElementVNode("div",Xa,[t.createElementVNode("div",Ka,[t.createVNode(Ga,{class:"w-full",modelValue:r.opt.type,options:i,loading:t.unref(l).isLoading("writing"),isTextEmpty:t.unref(n).text&&((k=t.unref(n).text)==null?void 0:k.length)<t.unref(se).IMPROVE_INPUT_MIN_LENGTH,hasResult:!!t.unref(n).result,"onUpdate:modelValue":b,onAction:f},null,8,["modelValue","loading","isTextEmpty","hasResult"])]),t.createVNode(da,{class:"ml-2 lg:m-2",disabled:((v=t.unref(n).text)==null?void 0:v.length)<5||!t.unref(n).result,onClick:C},null,8,["disabled"])]),t.createElementVNode("div",es,[t.createVNode(Ba,{class:"my-2 lg:my-0 w-full flex-grow lg:min-h-[50vh]",text:t.unref(n).result,originalText:t.unref(n).text,type:r.opt.type,onChange:d,onClear:u,onCopy:S[0]||(S[0]=x=>{var y;return a("copy",(y=t.unref(n))==null?void 0:y.result)})},null,8,["text","originalText","type"])])])])}}},en=he("writing",()=>{const e=t.ref(null),o=t.ref(""),n=t.ref(""),l=t.ref([]),r=t.ref(null),a=ae(),i=t.computed(()=>a.getLabel(e.value));function s(d){e.value=d.src,o.value=d.text,n.value=d.result,l.value=d.suggestions,r.value=d.action}function c(){e.value=null,o.value="",n.value="",l.value=[],r.value=null}return{src:e,srcLabel:i,text:o,result:n,suggestions:l,action:r,init:s,reset:c}}),tn=e=>(t.pushScopeId("data-v-8885ead1"),e=e(),t.popScopeId(),e),ns=["data-theme"],os={class:"flex-none py-2 pl-3 pr-2 shadow border border-base-300"},ls={class:"flex-none"},rs={class:"flex w-full border-b border-base-300 items-center"},as={key:0,class:"text-xs text-base-content/40 ml-1 italic"},ss=[tn(()=>t.createElementVNode("small",null,"(Tab)",-1))],is={key:0,class:"text-xs text-base-content/40 ml-1 italic"},cs=[tn(()=>t.createElementVNode("small",null,"(Tab)",-1))],ds={class:"flex-1 min-h-0"},us={class:"h-full overflow-y-auto overflow-x-hidden custom-scrollbar"},fs=G({__name:"Popup",props:{options:{type:Object,default:()=>({})},data:{type:Object,default:()=>({translation:{text:"",result:"",dict:[]},writing:{text:"",result:"",suggestions:[]},explanation:{result:""},tts:{}})},headerSettings:{type:Object,default:()=>({showAccount:!0,showReader:!0,showFullscreen:!0,showSettings:!0})},theme:{type:String,default:"light"},isPremium:{type:Boolean,default:!1}},emits:["nav","translate","write","common"],setup(e,{emit:o}){const n=Xo();J(n),Ge(n),ae(n),ne(n),en(n);const l=J(),r=Ge(),a=ae(),i=ne(),s=en();t.provide("translationStore",l),t.provide("ttsStore",r),t.provide("languageStore",a),t.provide("loaderStore",i),t.provide("writingStore",s);const c=o,d=(v,x)=>{c("nav",{action:v,payload:x})},u=v=>{c("nav",{action:"themeChange",payload:v})},f=(v,x={})=>{c("translate",{action:v,payload:x})},C=(v,x={})=>{c("write",{action:v,payload:x})},h=(v,x={})=>{c("common",{action:v,payload:x})},b=e,g={activeTab:"translate",translateOpts:{src:"auto",target:"en"},writeOpts:{type:"check"},languages:{src:{code:"auto",name:"Auto Detect"},target:{code:"en",name:"English"}},isFavoriteFeatureEnabled:!1,isAITranslateFeatureEnabled:!1,isImprovementFeatureEnabled:!1,isFavorite:!1,isAITranslate:!1,isAIExplain:!1,aiExplainMinLength:5,isTTS:!0},S=t.computed(()=>Object.assign({},g,b.options)),k=v=>{if(v.key==="Tab"){v.preventDefault();const y=S.value.activeTab==="translate"?"write":"translate";d("activeTab",y)}};return t.onMounted(()=>{window.addEventListener("keydown",k)}),t.onUnmounted(()=>{window.removeEventListener("keydown",k)}),(v,x)=>(t.openBlock(),t.createElementBlock("div",{"data-theme":e.theme,class:"h-screen flex flex-col bg-base-100"},[t.createElementVNode("div",os,[t.createVNode(_n,{"header-settings":e.headerSettings,"current-theme":e.theme,"is-premium":e.isPremium,onReader:x[0]||(x[0]=y=>d("reader")),onLearn:x[1]||(x[1]=y=>d("learn")),onSettings:x[2]||(x[2]=y=>d("settings")),onFullScreen:x[3]||(x[3]=y=>d("fullscreen")),onAccount:x[4]||(x[4]=y=>d("account")),onThemeChange:u},null,8,["header-settings","current-theme","is-premium"])]),t.createElementVNode("div",ls,[t.createElementVNode("div",rs,[t.createElementVNode("button",{class:t.normalizeClass(["w-1/2 px-4 py-2 text-sm font-medium",S.value.activeTab==="translate"?"text-primary border-b-2 border-primary":"text-base-content/60 hover:text-primary"]),onClick:x[5]||(x[5]=y=>d("activeTab","translate"))},[t.createTextVNode(" Translate "),!t.unref(Me)&&S.value.activeTab!=="translate"?(t.openBlock(),t.createElementBlock("span",as,ss)):t.createCommentVNode("",!0)],2),t.createElementVNode("button",{class:t.normalizeClass(["w-1/2 px-4 py-2 text-sm font-medium",S.value.activeTab==="write"?"text-primary border-b-2 border-primary":"text-base-content/60 hover:text-primary"]),onClick:x[6]||(x[6]=y=>d("activeTab","write"))},[t.createTextVNode(" Write "),!t.unref(Me)&&S.value.activeTab!=="write"?(t.openBlock(),t.createElementBlock("span",is,cs)):t.createCommentVNode("",!0)],2)])]),t.createElementVNode("div",ds,[t.createElementVNode("div",us,[S.value.activeTab==="translate"?(t.openBlock(),t.createBlock(sa,{key:0,opt:S.value.translateOpts,languages:S.value.languages,translation:e.data.translation,explanation:e.data.explanation,tts:e.data.tts,isTTS:S.value.isTTS,isFavoriteFeatureEnabled:S.value.isFavoriteFeatureEnabled,isAITranslateFeatureEnabled:S.value.isAITranslateFeatureEnabled,isFavorite:S.value.isFavorite,isAITranslate:S.value.isAITranslate,isAIExplain:S.value.isAIExplain,aiExplainMinLength:S.value.aiExplainMinLength,onOpt:x[7]||(x[7]=y=>f("updateOpts",y)),onTranslate:x[8]||(x[8]=y=>f("translate",y)),onLoadTTS:x[9]||(x[9]=y=>f("loadTTS",y)),onFavorite:x[10]||(x[10]=y=>f("favorite")),onAiTranslate:x[11]||(x[11]=y=>f("aiTranslate",y)),onAiExplain:x[12]||(x[12]=y=>f("aiExplain",y)),onCopy:x[13]||(x[13]=y=>h("copy",y))},null,8,["opt","languages","translation","explanation","tts","isTTS","isFavoriteFeatureEnabled","isAITranslateFeatureEnabled","isFavorite","isAITranslate","isAIExplain","aiExplainMinLength"])):t.createCommentVNode("",!0),S.value.activeTab==="write"?(t.openBlock(),t.createBlock(ts,{key:1,opt:S.value.writeOpts,languages:S.value.languages,writing:e.data.writing,onOpt:x[14]||(x[14]=y=>C("updateOpts",y)),onWrite:x[15]||(x[15]=y=>C("write",y)),onCopy:x[16]||(x[16]=y=>h("copy",y))},null,8,["opt","languages","writing"])):t.createCommentVNode("",!0)])])],8,ns))}},[["__scopeId","data-v-8885ead1"]]);Y.default=fs,Object.defineProperties(Y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|