@ddict/popup 1.0.13 → 1.0.15
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 +1334 -1283
- package/dist/popup.umd.js +8 -8
- package/package.json +1 -1
package/dist/popup.umd.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
(function(G,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(G=typeof globalThis<"u"?globalThis:G||self,n(G.Popup={},G.Vue))})(this,function(G,n){"use strict";const Ot="data:image/svg+xml,%3csvg%20width='96'%20height='32'%20viewBox='0%200%2096%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M40.151%208.94498H35.7256V23.055H40.151C44.7473%2023.055%2047.826%2020.0825%2047.826%2015.9795C47.8267%2011.8093%2044.7678%208.94498%2040.151%208.94498ZM40.1312%2021.025H37.993V10.9974H40.1312C43.4217%2010.9974%2045.4972%2012.9846%2045.4972%2015.9795C45.4965%2018.9296%2043.4012%2021.025%2040.1312%2021.025Z'%20fill='%233B5695'/%3e%3cpath%20d='M54.5158%208.94498H50.0903V23.055H54.5158C59.1121%2023.055%2062.1908%2020.0825%2062.1908%2015.9795C62.1914%2011.8093%2059.1351%208.94498%2054.5158%208.94498ZM54.496%2021.025H52.3578V10.9974H54.496C57.789%2010.9974%2059.8619%2012.9846%2059.8619%2015.9795C59.8613%2018.9296%2057.766%2021.025%2054.496%2021.025Z'%20fill='%233B5695'/%3e%3cpath%20d='M66.7237%208.94498H64.4575V23.055H66.7237V8.94498Z'%20fill='%233B5695'/%3e%3cpath%20d='M76.4301%2010.7837C78.29%2010.7837%2079.7436%2011.6603%2080.7487%2013.2207L82.4589%2011.9591C81.2401%209.97057%2078.9957%208.70953%2076.409%208.70953C72.3898%208.64555%2068.9048%2011.9591%2068.9906%2016C68.9048%2020.0403%2072.3898%2023.3544%2076.409%2023.2905C79.0385%2023.2905%2081.2618%2022.0294%2082.4589%2020.0409L80.7487%2018.7793C79.7436%2020.3397%2078.29%2021.2163%2076.4301%2021.2163C73.544%2021.2163%2071.3418%2018.993%2071.3418%2016C71.3418%2013.007%2073.5433%2010.7837%2076.4301%2010.7837Z'%20fill='%233B5695'/%3e%3cpath%20d='M83.3135%208.94498V10.9757H88.0595V23.055H90.3256V10.9757H95.0934V8.94498H83.3135Z'%20fill='%233B5695'/%3e%3cpath%20d='M8.66351%204.7121H4.604V15.4427L6.87208%2013.3839V6.79143H8.64559C11.4639%206.79143%2013.2835%208.47857%2013.2835%2011.0877C13.2835%2013.6916%2011.421%2015.4427%208.64559%2015.4427H4.604V17.5016H8.66351C12.7531%2017.5016%2015.6098%2014.8644%2015.6098%2011.0877C15.6104%207.27575%2012.8196%204.7121%208.66351%204.7121Z'%20fill='%233B5695'/%3e%3cpath%20d='M26.2425%209.25528H21.5502L20.7537%2014.293L21.4523%2014.3308L21.4069%2014.7294C21.3916%2014.8656%2021.3289%2015.0448%2021.112%2015.1734C21.1017%2015.9399%2021.0845%2017.0493%2020.9706%2018.1766H26.5937V19.8586H21.4677C22.4133%2022.9424%2024.1254%2024.9648%2026.5611%2025.8669L27.1536%2026.0864L26.6795%2026.5048C26.4875%2026.6737%2026.2182%2027.0141%2026.0896%2027.2489L25.9258%2027.5438L25.6155%2027.4152C23.167%2026.4095%2021.4223%2024.4926%2020.2905%2021.563C19.3602%2024.3365%2017.5797%2026.2553%2014.8592%2027.428L14.5438%2027.5617L14.3775%2027.2642C14.2764%2027.08%2014.0294%2026.7876%2013.8151%2026.5989L13.3564%2026.1951L13.9239%2025.9655C16.4555%2024.9392%2018.064%2023.1414%2018.8228%2020.4837C19.6647%2019.8381%2020.2099%2018.8221%2020.2169%2017.6801V4.53231C20.2169%202.58349%2018.6334%201%2016.6846%201H3.53487C1.58349%201%200%202.58349%200%204.53231V17.6795C0%2019.6283%201.58349%2021.2143%203.53487%2021.2143H8.25528V27.2431C8.25528%2029.3135%209.93986%2031%2012.0096%2031H26.2431C28.3161%2031%2029.9974%2029.3129%2029.9974%2027.2431V13.0096C29.9974%2010.9392%2028.3154%209.25528%2026.2425%209.25528ZM3.53487%2019.4517C2.55662%2019.4517%201.762%2018.6603%201.762%2017.6788V4.53231C1.762%203.55662%202.55598%202.762%203.53487%202.762H16.6839C17.6571%202.762%2018.4517%203.55598%2018.4517%204.53231V17.6795C18.4517%2017.778%2018.444%2017.8733%2018.4267%2017.9667C18.3941%2018.1811%2018.3231%2018.38%2018.215%2018.5592C17.9149%2019.0934%2017.3372%2019.4517%2016.6846%2019.4517H3.53487Z'%20fill='%233B5695'/%3e%3c/svg%3e",kt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.5%203.25C5.25736%203.25%204.25%204.25736%204.25%205.5H3.5H2.75C2.75%203.42893%204.42893%201.75%206.5%201.75H17.5C17.9142%201.75%2018.25%202.08579%2018.25%202.5V15.5C18.25%2015.9142%2017.9142%2016.25%2017.5%2016.25H6.5C5.26293%2016.25%204.25%2017.2576%204.25%2018.5C4.25%2018.9142%203.91421%2019.25%203.5%2019.25C3.08579%2019.25%202.75%2018.9142%202.75%2018.5V5.5C2.75%205.49993%202.75%205.5%203.5%205.5C4.25%205.5%204.25%205.49993%204.25%205.5V15.5017C4.87779%2015.0296%205.65755%2014.75%206.5%2014.75H16.75V3.25H6.5Z'%20fill='%233B5695'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M20.5%202.75C20.9142%202.75%2021.25%203.08579%2021.25%203.5V21.5C21.25%2021.9142%2020.9142%2022.25%2020.5%2022.25H6.5C4.42893%2022.25%202.75%2020.5711%202.75%2018.5C2.75%2016.4289%204.42893%2014.75%206.5%2014.75H17.4995C17.4996%2014.75%2017.5%2014.75%2017.5%2015.5C17.5%2016.25%2017.5001%2016.25%2017.5%2016.25H6.5C5.25736%2016.25%204.25%2017.2574%204.25%2018.5C4.25%2019.7426%205.25736%2020.75%206.5%2020.75H19.75V3.5C19.75%203.08579%2020.0858%202.75%2020.5%202.75ZM18.25%2015.5C18.25%2015.9142%2017.9142%2016.25%2017.5%2016.25V15.5L17.4995%2014.75C17.9137%2014.75%2018.25%2015.0858%2018.25%2015.5Z'%20fill='%233B5695'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.25%2018.5C6.25%2018.0858%206.58579%2017.75%207%2017.75H17C17.4142%2017.75%2017.75%2018.0858%2017.75%2018.5C17.75%2018.9142%2017.4142%2019.25%2017%2019.25H7C6.58579%2019.25%206.25%2018.9142%206.25%2018.5Z'%20fill='%233B5695'/%3e%3c/svg%3e",Vt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.467%202.47236C2.75841%202.17799%203.23328%202.17559%203.52764%202.467L8.52765%207.41675C8.82201%207.70816%208.82441%208.18303%208.533%208.4774C8.24159%208.77176%207.76672%208.77416%207.47235%208.48275L2.47236%203.533C2.17799%203.24159%202.17559%202.76672%202.467%202.47236Z'%20fill='%233B5695'/%3e%3cpath%20d='M8.533%2015.4724C8.82441%2015.7667%208.82201%2016.2416%208.52765%2016.533L3.52765%2021.4828C3.23328%2021.7742%202.75841%2021.7718%202.467%2021.4774C2.17559%2021.183%202.17799%2020.7082%202.47236%2020.4167L7.47235%2015.467C7.76672%2015.1756%208.24159%2015.178%208.533%2015.4724Z'%20fill='%233B5695'/%3e%3cpath%20d='M15.52%2015.4697C15.8129%2015.1768%2016.2877%2015.1768%2016.5806%2015.4697L21.5304%2020.4194C21.8233%2020.7123%2021.8233%2021.1872%2021.5304%2021.4801C21.2375%2021.773%2020.7626%2021.773%2020.4697%2021.4801L15.52%2016.5303C15.2271%2016.2374%2015.2271%2015.7626%2015.52%2015.4697Z'%20fill='%233B5695'/%3e%3cpath%20d='M21.4801%202.46967C21.773%202.76256%2021.773%203.23744%2021.4801%203.53033L16.5303%208.48008C16.2374%208.77297%2015.7626%208.77297%2015.4697%208.48008C15.1768%208.18719%2015.1768%207.71231%2015.4697%207.41942L20.4194%202.46967C20.7123%202.17678%2021.1872%202.17678%2021.4801%202.46967Z'%20fill='%233B5695'/%3e%3cpath%20d='M15.75%203C15.75%202.58579%2016.0858%202.25%2016.5%202.25H21C21.4142%202.25%2021.75%202.58579%2021.75%203V7.5C21.75%207.91421%2021.4142%208.25%2021%208.25C20.5858%208.25%2020.25%207.91421%2020.25%207.5V3.75H16.5C16.0858%203.75%2015.75%203.41421%2015.75%203Z'%20fill='%233B5695'/%3e%3cpath%20d='M21%2015.75C21.4142%2015.75%2021.75%2016.0858%2021.75%2016.5V21C21.75%2021.4142%2021.4142%2021.75%2021%2021.75H16.5C16.0858%2021.75%2015.75%2021.4142%2015.75%2021C15.75%2020.5858%2016.0858%2020.25%2016.5%2020.25H20.25V16.5C20.25%2016.0858%2020.5858%2015.75%2021%2015.75Z'%20fill='%233B5695'/%3e%3cpath%20d='M3%2015.75C3.41421%2015.75%203.75%2016.0858%203.75%2016.5V20.25H7.5C7.91421%2020.25%208.25%2020.5858%208.25%2021C8.25%2021.4142%207.91421%2021.75%207.5%2021.75H3C2.58579%2021.75%202.25%2021.4142%202.25%2021V16.5C2.25%2016.0858%202.58579%2015.75%203%2015.75Z'%20fill='%233B5695'/%3e%3cpath%20d='M2.25%203C2.25%202.58579%202.58579%202.25%203%202.25H7.5C7.91421%202.25%208.25%202.58579%208.25%203C8.25%203.41421%207.91421%203.75%207.5%203.75H3.75V7.5C3.75%207.91421%203.41421%208.25%203%208.25C2.58579%208.25%202.25%207.91421%202.25%207.5V3Z'%20fill='%233B5695'/%3e%3c/svg%3e",$t="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.12596%201.63869C9.46935%201.54364%209.83221%201.70329%209.99413%202.02068C10.3672%202.75191%2011.1261%203.25%2012%203.25C12.8739%203.25%2013.6328%202.75191%2014.0059%202.02068C14.1678%201.70329%2014.5307%201.54364%2014.874%201.63869C16.5585%202.10497%2018.0759%202.9704%2019.3184%204.12574C19.5611%204.35137%2019.6269%204.70948%2019.4804%205.00666C19.3331%205.30535%2019.25%205.6419%2019.25%206C19.25%207.24263%2020.2574%208.25%2021.5%208.25L21.5314%208.24977C21.8629%208.24504%2022.1583%208.45859%2022.2576%208.77495C22.5777%209.79397%2022.75%2010.8776%2022.75%2012C22.75%2012.7408%2022.6749%2013.4649%2022.5318%2014.1648C22.4548%2014.5411%2022.1059%2014.7985%2021.7237%2014.7609C21.6504%2014.7537%2021.5758%2014.75%2021.5%2014.75C20.2574%2014.75%2019.25%2015.7574%2019.25%2017C19.25%2017.5531%2019.4486%2018.0579%2019.7793%2018.4498C20.027%2018.7434%2020.0128%2019.1767%2019.7465%2019.4535C18.4777%2020.7719%2016.8745%2021.7678%2015.0721%2022.3044C14.6807%2022.4209%2014.2681%2022.2029%2014.1437%2021.814C13.8535%2020.906%2013.0024%2020.25%2012%2020.25C10.9976%2020.25%2010.1465%2020.906%209.85629%2021.814C9.73195%2022.2029%209.31927%2022.4209%208.92789%2022.3044C7.12545%2021.7678%205.52229%2020.7719%204.25353%2019.4535C3.98716%2019.1767%203.97299%2018.7434%204.22072%2018.4498C4.55139%2018.0579%204.75%2017.5531%204.75%2017C4.75%2015.7574%203.74264%2014.75%202.5%2014.75C2.42423%2014.75%202.34963%2014.7537%202.27634%2014.7609C1.89406%2014.7985%201.54519%2014.5411%201.46821%2014.1648C1.32505%2013.4649%201.25%2012.7408%201.25%2012C1.25%2010.8776%201.42227%209.79398%201.74236%208.77494C1.84173%208.45859%202.13705%208.24504%202.4686%208.24977L2.5%208.25C3.74264%208.25%204.75%207.24263%204.75%206C4.75%205.6419%204.66689%205.30535%204.51962%205.00666C4.3731%204.70948%204.43894%204.35137%204.68159%204.12574C5.92411%202.9704%207.44153%202.10497%209.12596%201.63869ZM6.08277%204.88991C6.19152%205.24123%206.25%205.61424%206.25%206C6.25%207.88945%204.85261%209.45253%203.03493%209.71213C2.84898%2010.4432%202.75%2011.2096%202.75%2012C2.75%2012.4294%202.77921%2012.8516%202.83567%2013.2648C4.74948%2013.4346%206.25%2015.0421%206.25%2017C6.25%2017.6669%206.0754%2018.2941%205.76971%2018.8372C6.62645%2019.6184%207.63002%2020.2404%208.73362%2020.657C9.37706%2019.5189%2010.598%2018.75%2012%2018.75C13.402%2018.75%2014.6229%2019.5189%2015.2664%2020.657C16.37%2020.2404%2017.3735%2019.6184%2018.2303%2018.8372C17.9246%2018.2941%2017.75%2017.6669%2017.75%2017C17.75%2015.0421%2019.2505%2013.4346%2021.1643%2013.2648C21.2208%2012.8516%2021.25%2012.4294%2021.25%2012C21.25%2011.2096%2021.151%2010.4432%2020.9651%209.71213C19.1474%209.45252%2017.75%207.88945%2017.75%206C17.75%205.61424%2017.8085%205.24123%2017.9172%204.88991C17.0618%204.1771%2016.0762%203.61614%2015.0018%203.24775C14.3184%204.15897%2013.2287%204.75%2012%204.75C10.7713%204.75%209.68158%204.15897%208.99819%203.24775C7.92382%203.61614%206.93823%204.1771%206.08277%204.88991Z'%20fill='%233B5695'/%3e%3cpath%20d='M7.75%2012C7.75%209.65278%209.65279%207.75%2012%207.75C14.3472%207.75%2016.25%209.65278%2016.25%2012C16.25%2014.3472%2014.3472%2016.25%2012%2016.25C9.65279%2016.25%207.75%2014.3472%207.75%2012ZM12%209.25C10.4812%209.25%209.25%2010.4812%209.25%2012C9.25%2013.5188%2010.4812%2014.75%2012%2014.75C13.5188%2014.75%2014.75%2013.5188%2014.75%2012C14.75%2010.4812%2013.5188%209.25%2012%209.25Z'%20fill='%233B5695'/%3e%3c/svg%3e",Nt={class:"flex justify-between"},It=n.createElementVNode("div",{class:"flex flex-row"},[n.createElementVNode("img",{src:Ot,alt:"Vue logo",class:"w-24"})],-1),Bt={class:"flex"},Lt=[n.createElementVNode("img",{src:kt,alt:"Reader",class:"w-7"},null,-1)],Tt=[n.createElementVNode("img",{src:Vt,alt:"Full screen",class:"w-7"},null,-1)],Rt=[n.createElementVNode("img",{src:$t,alt:"Setting",class:"w-7"},null,-1)],Mt={__name:"Header",emits:["settings","fullScreen","reader"],setup(e,{emit:l}){const t=l;return(o,s)=>(n.openBlock(),n.createElementBlock("div",Nt,[It,n.createElementVNode("div",Bt,[n.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:s[0]||(s[0]=a=>t("reader"))},Lt),n.createElementVNode("button",{class:"btn btn-ghost btn-circle md:hidden",onClick:s[1]||(s[1]=a=>t("fullScreen"))},Tt),n.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:s[2]||(s[2]=a=>t("settings"))},Rt)])]))}};function oe(e,l,t){let o=t.initialDeps??[],s;return()=>{var a,i,r,c;let u;t.key&&((a=t.debug)!=null&&a.call(t))&&(u=Date.now());const m=e();if(!(m.length!==o.length||m.some((g,b)=>o[b]!==g)))return s;o=m;let h;if(t.key&&((i=t.debug)!=null&&i.call(t))&&(h=Date.now()),s=l(...m),t.key&&((r=t.debug)!=null&&r.call(t))){const g=Math.round((Date.now()-u)*100)/100,b=Math.round((Date.now()-h)*100)/100,y=b/16,I=(N,E)=>{for(N=String(N);N.length<E;)N=" "+N;return N};console.info(`%c⏱ ${I(b,5)} /${I(g,5)} ms`,`
|
|
1
|
+
(function(G,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(G=typeof globalThis<"u"?globalThis:G||self,n(G.Popup={},G.Vue))})(this,function(G,n){"use strict";const kt="data:image/svg+xml,%3csvg%20width='96'%20height='32'%20viewBox='0%200%2096%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M40.151%208.94498H35.7256V23.055H40.151C44.7473%2023.055%2047.826%2020.0825%2047.826%2015.9795C47.8267%2011.8093%2044.7678%208.94498%2040.151%208.94498ZM40.1312%2021.025H37.993V10.9974H40.1312C43.4217%2010.9974%2045.4972%2012.9846%2045.4972%2015.9795C45.4965%2018.9296%2043.4012%2021.025%2040.1312%2021.025Z'%20fill='%233B5695'/%3e%3cpath%20d='M54.5158%208.94498H50.0903V23.055H54.5158C59.1121%2023.055%2062.1908%2020.0825%2062.1908%2015.9795C62.1914%2011.8093%2059.1351%208.94498%2054.5158%208.94498ZM54.496%2021.025H52.3578V10.9974H54.496C57.789%2010.9974%2059.8619%2012.9846%2059.8619%2015.9795C59.8613%2018.9296%2057.766%2021.025%2054.496%2021.025Z'%20fill='%233B5695'/%3e%3cpath%20d='M66.7237%208.94498H64.4575V23.055H66.7237V8.94498Z'%20fill='%233B5695'/%3e%3cpath%20d='M76.4301%2010.7837C78.29%2010.7837%2079.7436%2011.6603%2080.7487%2013.2207L82.4589%2011.9591C81.2401%209.97057%2078.9957%208.70953%2076.409%208.70953C72.3898%208.64555%2068.9048%2011.9591%2068.9906%2016C68.9048%2020.0403%2072.3898%2023.3544%2076.409%2023.2905C79.0385%2023.2905%2081.2618%2022.0294%2082.4589%2020.0409L80.7487%2018.7793C79.7436%2020.3397%2078.29%2021.2163%2076.4301%2021.2163C73.544%2021.2163%2071.3418%2018.993%2071.3418%2016C71.3418%2013.007%2073.5433%2010.7837%2076.4301%2010.7837Z'%20fill='%233B5695'/%3e%3cpath%20d='M83.3135%208.94498V10.9757H88.0595V23.055H90.3256V10.9757H95.0934V8.94498H83.3135Z'%20fill='%233B5695'/%3e%3cpath%20d='M8.66351%204.7121H4.604V15.4427L6.87208%2013.3839V6.79143H8.64559C11.4639%206.79143%2013.2835%208.47857%2013.2835%2011.0877C13.2835%2013.6916%2011.421%2015.4427%208.64559%2015.4427H4.604V17.5016H8.66351C12.7531%2017.5016%2015.6098%2014.8644%2015.6098%2011.0877C15.6104%207.27575%2012.8196%204.7121%208.66351%204.7121Z'%20fill='%233B5695'/%3e%3cpath%20d='M26.2425%209.25528H21.5502L20.7537%2014.293L21.4523%2014.3308L21.4069%2014.7294C21.3916%2014.8656%2021.3289%2015.0448%2021.112%2015.1734C21.1017%2015.9399%2021.0845%2017.0493%2020.9706%2018.1766H26.5937V19.8586H21.4677C22.4133%2022.9424%2024.1254%2024.9648%2026.5611%2025.8669L27.1536%2026.0864L26.6795%2026.5048C26.4875%2026.6737%2026.2182%2027.0141%2026.0896%2027.2489L25.9258%2027.5438L25.6155%2027.4152C23.167%2026.4095%2021.4223%2024.4926%2020.2905%2021.563C19.3602%2024.3365%2017.5797%2026.2553%2014.8592%2027.428L14.5438%2027.5617L14.3775%2027.2642C14.2764%2027.08%2014.0294%2026.7876%2013.8151%2026.5989L13.3564%2026.1951L13.9239%2025.9655C16.4555%2024.9392%2018.064%2023.1414%2018.8228%2020.4837C19.6647%2019.8381%2020.2099%2018.8221%2020.2169%2017.6801V4.53231C20.2169%202.58349%2018.6334%201%2016.6846%201H3.53487C1.58349%201%200%202.58349%200%204.53231V17.6795C0%2019.6283%201.58349%2021.2143%203.53487%2021.2143H8.25528V27.2431C8.25528%2029.3135%209.93986%2031%2012.0096%2031H26.2431C28.3161%2031%2029.9974%2029.3129%2029.9974%2027.2431V13.0096C29.9974%2010.9392%2028.3154%209.25528%2026.2425%209.25528ZM3.53487%2019.4517C2.55662%2019.4517%201.762%2018.6603%201.762%2017.6788V4.53231C1.762%203.55662%202.55598%202.762%203.53487%202.762H16.6839C17.6571%202.762%2018.4517%203.55598%2018.4517%204.53231V17.6795C18.4517%2017.778%2018.444%2017.8733%2018.4267%2017.9667C18.3941%2018.1811%2018.3231%2018.38%2018.215%2018.5592C17.9149%2019.0934%2017.3372%2019.4517%2016.6846%2019.4517H3.53487Z'%20fill='%233B5695'/%3e%3c/svg%3e",$t="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.5%203.25C5.25736%203.25%204.25%204.25736%204.25%205.5H3.5H2.75C2.75%203.42893%204.42893%201.75%206.5%201.75H17.5C17.9142%201.75%2018.25%202.08579%2018.25%202.5V15.5C18.25%2015.9142%2017.9142%2016.25%2017.5%2016.25H6.5C5.26293%2016.25%204.25%2017.2576%204.25%2018.5C4.25%2018.9142%203.91421%2019.25%203.5%2019.25C3.08579%2019.25%202.75%2018.9142%202.75%2018.5V5.5C2.75%205.49993%202.75%205.5%203.5%205.5C4.25%205.5%204.25%205.49993%204.25%205.5V15.5017C4.87779%2015.0296%205.65755%2014.75%206.5%2014.75H16.75V3.25H6.5Z'%20fill='%233B5695'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M20.5%202.75C20.9142%202.75%2021.25%203.08579%2021.25%203.5V21.5C21.25%2021.9142%2020.9142%2022.25%2020.5%2022.25H6.5C4.42893%2022.25%202.75%2020.5711%202.75%2018.5C2.75%2016.4289%204.42893%2014.75%206.5%2014.75H17.4995C17.4996%2014.75%2017.5%2014.75%2017.5%2015.5C17.5%2016.25%2017.5001%2016.25%2017.5%2016.25H6.5C5.25736%2016.25%204.25%2017.2574%204.25%2018.5C4.25%2019.7426%205.25736%2020.75%206.5%2020.75H19.75V3.5C19.75%203.08579%2020.0858%202.75%2020.5%202.75ZM18.25%2015.5C18.25%2015.9142%2017.9142%2016.25%2017.5%2016.25V15.5L17.4995%2014.75C17.9137%2014.75%2018.25%2015.0858%2018.25%2015.5Z'%20fill='%233B5695'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.25%2018.5C6.25%2018.0858%206.58579%2017.75%207%2017.75H17C17.4142%2017.75%2017.75%2018.0858%2017.75%2018.5C17.75%2018.9142%2017.4142%2019.25%2017%2019.25H7C6.58579%2019.25%206.25%2018.9142%206.25%2018.5Z'%20fill='%233B5695'/%3e%3c/svg%3e",Vt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.467%202.47236C2.75841%202.17799%203.23328%202.17559%203.52764%202.467L8.52765%207.41675C8.82201%207.70816%208.82441%208.18303%208.533%208.4774C8.24159%208.77176%207.76672%208.77416%207.47235%208.48275L2.47236%203.533C2.17799%203.24159%202.17559%202.76672%202.467%202.47236Z'%20fill='%233B5695'/%3e%3cpath%20d='M8.533%2015.4724C8.82441%2015.7667%208.82201%2016.2416%208.52765%2016.533L3.52765%2021.4828C3.23328%2021.7742%202.75841%2021.7718%202.467%2021.4774C2.17559%2021.183%202.17799%2020.7082%202.47236%2020.4167L7.47235%2015.467C7.76672%2015.1756%208.24159%2015.178%208.533%2015.4724Z'%20fill='%233B5695'/%3e%3cpath%20d='M15.52%2015.4697C15.8129%2015.1768%2016.2877%2015.1768%2016.5806%2015.4697L21.5304%2020.4194C21.8233%2020.7123%2021.8233%2021.1872%2021.5304%2021.4801C21.2375%2021.773%2020.7626%2021.773%2020.4697%2021.4801L15.52%2016.5303C15.2271%2016.2374%2015.2271%2015.7626%2015.52%2015.4697Z'%20fill='%233B5695'/%3e%3cpath%20d='M21.4801%202.46967C21.773%202.76256%2021.773%203.23744%2021.4801%203.53033L16.5303%208.48008C16.2374%208.77297%2015.7626%208.77297%2015.4697%208.48008C15.1768%208.18719%2015.1768%207.71231%2015.4697%207.41942L20.4194%202.46967C20.7123%202.17678%2021.1872%202.17678%2021.4801%202.46967Z'%20fill='%233B5695'/%3e%3cpath%20d='M15.75%203C15.75%202.58579%2016.0858%202.25%2016.5%202.25H21C21.4142%202.25%2021.75%202.58579%2021.75%203V7.5C21.75%207.91421%2021.4142%208.25%2021%208.25C20.5858%208.25%2020.25%207.91421%2020.25%207.5V3.75H16.5C16.0858%203.75%2015.75%203.41421%2015.75%203Z'%20fill='%233B5695'/%3e%3cpath%20d='M21%2015.75C21.4142%2015.75%2021.75%2016.0858%2021.75%2016.5V21C21.75%2021.4142%2021.4142%2021.75%2021%2021.75H16.5C16.0858%2021.75%2015.75%2021.4142%2015.75%2021C15.75%2020.5858%2016.0858%2020.25%2016.5%2020.25H20.25V16.5C20.25%2016.0858%2020.5858%2015.75%2021%2015.75Z'%20fill='%233B5695'/%3e%3cpath%20d='M3%2015.75C3.41421%2015.75%203.75%2016.0858%203.75%2016.5V20.25H7.5C7.91421%2020.25%208.25%2020.5858%208.25%2021C8.25%2021.4142%207.91421%2021.75%207.5%2021.75H3C2.58579%2021.75%202.25%2021.4142%202.25%2021V16.5C2.25%2016.0858%202.58579%2015.75%203%2015.75Z'%20fill='%233B5695'/%3e%3cpath%20d='M2.25%203C2.25%202.58579%202.58579%202.25%203%202.25H7.5C7.91421%202.25%208.25%202.58579%208.25%203C8.25%203.41421%207.91421%203.75%207.5%203.75H3.75V7.5C3.75%207.91421%203.41421%208.25%203%208.25C2.58579%208.25%202.25%207.91421%202.25%207.5V3Z'%20fill='%233B5695'/%3e%3c/svg%3e",Tt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.12596%201.63869C9.46935%201.54364%209.83221%201.70329%209.99413%202.02068C10.3672%202.75191%2011.1261%203.25%2012%203.25C12.8739%203.25%2013.6328%202.75191%2014.0059%202.02068C14.1678%201.70329%2014.5307%201.54364%2014.874%201.63869C16.5585%202.10497%2018.0759%202.9704%2019.3184%204.12574C19.5611%204.35137%2019.6269%204.70948%2019.4804%205.00666C19.3331%205.30535%2019.25%205.6419%2019.25%206C19.25%207.24263%2020.2574%208.25%2021.5%208.25L21.5314%208.24977C21.8629%208.24504%2022.1583%208.45859%2022.2576%208.77495C22.5777%209.79397%2022.75%2010.8776%2022.75%2012C22.75%2012.7408%2022.6749%2013.4649%2022.5318%2014.1648C22.4548%2014.5411%2022.1059%2014.7985%2021.7237%2014.7609C21.6504%2014.7537%2021.5758%2014.75%2021.5%2014.75C20.2574%2014.75%2019.25%2015.7574%2019.25%2017C19.25%2017.5531%2019.4486%2018.0579%2019.7793%2018.4498C20.027%2018.7434%2020.0128%2019.1767%2019.7465%2019.4535C18.4777%2020.7719%2016.8745%2021.7678%2015.0721%2022.3044C14.6807%2022.4209%2014.2681%2022.2029%2014.1437%2021.814C13.8535%2020.906%2013.0024%2020.25%2012%2020.25C10.9976%2020.25%2010.1465%2020.906%209.85629%2021.814C9.73195%2022.2029%209.31927%2022.4209%208.92789%2022.3044C7.12545%2021.7678%205.52229%2020.7719%204.25353%2019.4535C3.98716%2019.1767%203.97299%2018.7434%204.22072%2018.4498C4.55139%2018.0579%204.75%2017.5531%204.75%2017C4.75%2015.7574%203.74264%2014.75%202.5%2014.75C2.42423%2014.75%202.34963%2014.7537%202.27634%2014.7609C1.89406%2014.7985%201.54519%2014.5411%201.46821%2014.1648C1.32505%2013.4649%201.25%2012.7408%201.25%2012C1.25%2010.8776%201.42227%209.79398%201.74236%208.77494C1.84173%208.45859%202.13705%208.24504%202.4686%208.24977L2.5%208.25C3.74264%208.25%204.75%207.24263%204.75%206C4.75%205.6419%204.66689%205.30535%204.51962%205.00666C4.3731%204.70948%204.43894%204.35137%204.68159%204.12574C5.92411%202.9704%207.44153%202.10497%209.12596%201.63869ZM6.08277%204.88991C6.19152%205.24123%206.25%205.61424%206.25%206C6.25%207.88945%204.85261%209.45253%203.03493%209.71213C2.84898%2010.4432%202.75%2011.2096%202.75%2012C2.75%2012.4294%202.77921%2012.8516%202.83567%2013.2648C4.74948%2013.4346%206.25%2015.0421%206.25%2017C6.25%2017.6669%206.0754%2018.2941%205.76971%2018.8372C6.62645%2019.6184%207.63002%2020.2404%208.73362%2020.657C9.37706%2019.5189%2010.598%2018.75%2012%2018.75C13.402%2018.75%2014.6229%2019.5189%2015.2664%2020.657C16.37%2020.2404%2017.3735%2019.6184%2018.2303%2018.8372C17.9246%2018.2941%2017.75%2017.6669%2017.75%2017C17.75%2015.0421%2019.2505%2013.4346%2021.1643%2013.2648C21.2208%2012.8516%2021.25%2012.4294%2021.25%2012C21.25%2011.2096%2021.151%2010.4432%2020.9651%209.71213C19.1474%209.45252%2017.75%207.88945%2017.75%206C17.75%205.61424%2017.8085%205.24123%2017.9172%204.88991C17.0618%204.1771%2016.0762%203.61614%2015.0018%203.24775C14.3184%204.15897%2013.2287%204.75%2012%204.75C10.7713%204.75%209.68158%204.15897%208.99819%203.24775C7.92382%203.61614%206.93823%204.1771%206.08277%204.88991Z'%20fill='%233B5695'/%3e%3cpath%20d='M7.75%2012C7.75%209.65278%209.65279%207.75%2012%207.75C14.3472%207.75%2016.25%209.65278%2016.25%2012C16.25%2014.3472%2014.3472%2016.25%2012%2016.25C9.65279%2016.25%207.75%2014.3472%207.75%2012ZM12%209.25C10.4812%209.25%209.25%2010.4812%209.25%2012C9.25%2013.5188%2010.4812%2014.75%2012%2014.75C13.5188%2014.75%2014.75%2013.5188%2014.75%2012C14.75%2010.4812%2013.5188%209.25%2012%209.25Z'%20fill='%233B5695'/%3e%3c/svg%3e",Nt={class:"flex justify-between"},It=n.createElementVNode("div",{class:"flex flex-row"},[n.createElementVNode("img",{src:kt,alt:"Vue logo",class:"w-24"})],-1),Bt={class:"flex"},Lt=[n.createElementVNode("img",{src:$t,alt:"Reader",class:"w-7"},null,-1)],Rt=[n.createElementVNode("img",{src:Vt,alt:"Full screen",class:"w-7"},null,-1)],Mt=[n.createElementVNode("img",{src:Tt,alt:"Setting",class:"w-7"},null,-1)],Pt={__name:"Header",emits:["settings","fullScreen","reader"],setup(e,{emit:l}){const t=l;return(o,s)=>(n.openBlock(),n.createElementBlock("div",Nt,[It,n.createElementVNode("div",Bt,[n.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:s[0]||(s[0]=a=>t("reader"))},Lt),n.createElementVNode("button",{class:"btn btn-ghost btn-circle md:hidden",onClick:s[1]||(s[1]=a=>t("fullScreen"))},Rt),n.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:s[2]||(s[2]=a=>t("settings"))},Mt)])]))}};function oe(e,l,t){let o=t.initialDeps??[],s;return()=>{var a,i,r,c;let u;t.key&&((a=t.debug)!=null&&a.call(t))&&(u=Date.now());const p=e();if(!(p.length!==o.length||p.some((x,h)=>o[h]!==x)))return s;o=p;let b;if(t.key&&((i=t.debug)!=null&&i.call(t))&&(b=Date.now()),s=l(...p),t.key&&((r=t.debug)!=null&&r.call(t))){const x=Math.round((Date.now()-u)*100)/100,h=Math.round((Date.now()-b)*100)/100,g=h/16,$=(I,E)=>{for(I=String(I);I.length<E;)I=" "+I;return I};console.info(`%c⏱ ${$(h,5)} /${$(x,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
|
-
color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(c=t==null?void 0:t.onChange)==null||c.call(t,s),s}}function ye(e,l){if(e===void 0)throw new Error("Unexpected undefined");return e}const Pt=(e,l)=>Math.abs(e-l)<1,Dt=(e,l,t)=>{let o;return function(...s){e.clearTimeout(o),o=e.setTimeout(()=>l.apply(this,s),t)}},At=e=>e,Ft=e=>{const l=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let s=l;s<=t;s++)o.push(s);return o},jt=(e,l)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;const s=i=>{const{width:r,height:c}=i;l({width:Math.round(r),height:Math.round(c)})};if(s(t.getBoundingClientRect()),!o.ResizeObserver)return()=>{};const a=new o.ResizeObserver(i=>{const r=i[0];if(r!=null&&r.borderBoxSize){const c=r.borderBoxSize[0];if(c){s({width:c.inlineSize,height:c.blockSize});return}}s(t.getBoundingClientRect())});return a.observe(t,{box:"border-box"}),()=>{a.unobserve(t)}},Re={passive:!0},Ht=typeof window>"u"?!0:"onscrollend"in window,zt=(e,l)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;let s=0;const a=Ht?()=>{}:Dt(o,()=>{l(s,!1)},e.options.isScrollingResetDelay),i=u=>()=>{s=t[e.options.horizontal?"scrollLeft":"scrollTop"],a(),l(s,u)},r=i(!0),c=i(!1);return c(),t.addEventListener("scroll",r,Re),t.addEventListener("scrollend",c,Re),()=>{t.removeEventListener("scroll",r),t.removeEventListener("scrollend",c)}},Ut=(e,l,t)=>{if(l!=null&&l.borderBoxSize){const o=l.borderBoxSize[0];if(o)return Math.round(o[t.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[t.options.horizontal?"width":"height"])},Zt=(e,{adjustments:l=0,behavior:t},o)=>{var s,a;const i=e+l;(a=(s=o.scrollElement)==null?void 0:s.scrollTo)==null||a.call(s,{[o.options.horizontal?"left":"top"]:i,behavior:t})};class Wt{constructor(l){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 t=null;const o=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(a=>{this._measureElement(a.target,a)})}));return{disconnect:()=>{var s;return(s=o())==null?void 0:s.disconnect()},observe:s=>{var a;return(a=o())==null?void 0:a.observe(s,{box:"border-box"})},unobserve:s=>{var a;return(a=o())==null?void 0:a.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([o,s])=>{typeof s>"u"&&delete t[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:At,rangeExtractor:Ft,onChange:()=>{},measureElement:Ut,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,...t}},this.notify=(t,o)=>{var s,a;const{startIndex:i,endIndex:r}=this.range??{startIndex:void 0,endIndex:void 0},c=this.calculateRange();(t||i!==(c==null?void 0:c.startIndex)||r!==(c==null?void 0:c.endIndex))&&((a=(s=this.options).onChange)==null||a.call(s,this,o))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.observer.disconnect(),this.elementsCache.clear()},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.notify(!1,!1);return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(s,a)=>{this.scrollAdjustments=0,this.scrollDirection=a?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s;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=(t,o)=>{const s=new Map,a=new Map;for(let i=o-1;i>=0;i--){const r=t[i];if(s.has(r.lane))continue;const c=a.get(r.lane);if(c==null||r.end>c.end?a.set(r.lane,r):r.end<c.end&&s.set(r.lane,!0),s.size===this.options.lanes)break}return a.size===this.options.lanes?Array.from(a.values()).sort((i,r)=>i.end===r.end?i.index-r.index:i.end-r.end)[0]:void 0},this.getMeasurementOptions=oe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,o,s,a,i)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:o,scrollMargin:s,getItemKey:a,enabled:i}),{key:!1}),this.getMeasurements=oe(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:o,scrollMargin:s,getItemKey:a,enabled:i},r)=>{var c;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(p=>{this.itemSizeCache.set(p.key,p.size)}));const u=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const m=this.measurementsCache.slice(0,u);for(let p=u;p<t;p++){let h=(c=this.measurementsCache[p])==null?void 0:c.measureElement;h||(h=L=>{const _=a(p),O=this.elementsCache.get(_);if(!L){O&&(this.observer.unobserve(O),this.elementsCache.delete(_));return}O!==L&&(O&&this.observer.unobserve(O),this.observer.observe(L),this.elementsCache.set(_,L)),L.isConnected&&this.resizeItem(p,this.options.measureElement(L,void 0,this))});const g=a(p),b=this.options.lanes===1?m[p-1]:this.getFurthestMeasurement(m,p),y=b?b.end+this.options.gap:o+s,I=r.get(g),N=typeof I=="number"?I:this.options.estimateSize(p),E=y+N,$=b?b.lane:p%this.options.lanes;m[p]={index:p,start:y,size:N,end:E,key:g,lane:$,measureElement:h}}return this.measurementsCache=m,m},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=oe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(t,o,s)=>this.range=t.length>0&&o>0?Gt({measurements:t,outerSize:o,scrollOffset:s}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=oe(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(t,o,s,a)=>o===null?[]:t({startIndex:o.startIndex,endIndex:o.endIndex,overscan:s,count:a}),{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const o=this.options.indexAttribute,s=t.getAttribute(o);return s?parseInt(s,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(t,o)=>{const s=this.indexFromElement(t),a=this.getMeasurements()[s];if(!a||!t.isConnected){this.elementsCache.forEach((r,c)=>{r===t&&(this.observer.unobserve(t),this.elementsCache.delete(c))});return}const i=this.elementsCache.get(a.key);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(a.key,t)),this.resizeItem(s,this.options.measureElement(t,o,this))},this.resizeItem=(t,o)=>{const s=this.getMeasurements()[t];if(!s)return;const a=this.itemSizeCache.get(s.key)??s.size,i=o-a;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,i,this):s.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(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,o)),this.notify(!0,!1))},this.measureElement=t=>{t&&this._measureElement(t,void 0)},this.getVirtualItems=oe(()=>[this.getIndexes(),this.getMeasurements()],(t,o)=>{const s=[];for(let a=0,i=t.length;a<i;a++){const r=t[a],c=o[r];s.push(c)}return s},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const o=this.getMeasurements();if(o.length!==0)return ye(o[Me(0,o.length-1,s=>ye(o[s]).start,t)])},this.getOffsetForAlignment=(t,o)=>{const s=this.getSize(),a=this.getScrollOffset();o==="auto"&&(t<=a?o="start":t>=a+s?o="end":o="start"),o==="start"?t=t:o==="end"?t=t-s:o==="center"&&(t=t-s/2);const i=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[i]:this.scrollElement[i]:0)-s;return Math.max(Math.min(c,t),0)},this.getOffsetForIndex=(t,o="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getMeasurements()[t];if(!s)return;const a=this.getSize(),i=this.getScrollOffset();if(o==="auto")if(s.end>=i+a-this.options.scrollPaddingEnd)o="end";else if(s.start<=i+this.options.scrollPaddingStart)o="start";else return[i,o];const r=o==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(r,o),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(t,{align:o="start",behavior:s}={})=>{this.cancelScrollToIndex(),s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,o),{adjustments:void 0,behavior:s})},this.scrollToIndex=(t,{align:o="auto",behavior:s}={})=>{t=Math.max(0,Math.min(t,this.options.count-1)),this.cancelScrollToIndex(),s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const a=this.getOffsetForIndex(t,o);if(!a)return;const[i,r]=a;this._scrollToOffset(i,{adjustments:void 0,behavior:s}),s!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(t))){const[u]=ye(this.getOffsetForIndex(t,r));Pt(u,this.getScrollOffset())||this.scrollToIndex(t,{align:r,behavior:s})}else this.scrollToIndex(t,{align:r,behavior:s})}))},this.scrollBy=(t,{behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var t;const o=this.getMeasurements();let s;return o.length===0?s=this.options.paddingStart:s=this.options.lanes===1?((t=o[o.length-1])==null?void 0:t.end)??0:Math.max(...o.slice(-this.options.lanes).map(a=>a.end)),s-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(t,{adjustments:o,behavior:s})=>{this.options.scrollToFn(t,{behavior:s,adjustments:o},this)},this.measure=()=>{var t,o;this.itemSizeCache=new Map,(o=(t=this.options).onChange)==null||o.call(t,this,!1)},this.setOptions(l)}}const Me=(e,l,t,o)=>{for(;e<=l;){const s=(e+l)/2|0,a=t(s);if(a<o)e=s+1;else if(a>o)l=s-1;else return s}return e>0?e-1:0};function Gt({measurements:e,outerSize:l,scrollOffset:t}){const o=e.length-1,a=Me(0,o,r=>e[r].start,t);let i=a;for(;i<o&&e[i].end<t+l;)i++;return{startIndex:a,endIndex:i}}function qt(e){const l=new Wt(n.unref(e)),t=n.shallowRef(l),o=l._didMount();return n.watch(()=>n.unref(e).getScrollElement(),s=>{s&&l._willUpdate()},{immediate:!0}),n.watch(()=>n.unref(e),s=>{l.setOptions({...s,onChange:(a,i)=>{var r;n.triggerRef(t),(r=s.onChange)==null||r.call(s,a,i)}}),l._willUpdate(),n.triggerRef(t)},{immediate:!0}),n.onScopeDispose(o),t}function Jt(e){return qt(n.computed(()=>({observeElementRect:jt,observeElementOffset:zt,scrollToFn:Zt,...n.unref(e)})))}function Kt(e,l,t){let o=n.ref(t==null?void 0:t.value),s=n.computed(()=>e.value!==void 0);return[n.computed(()=>s.value?e.value:o.value),function(a){return s.value||(o.value=a),l==null?void 0:l(a)}]}function Yt(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(l=>setTimeout(()=>{throw l}))}function ue(){let e=[],l={addEventListener(t,o,s,a){return t.addEventListener(o,s,a),l.add(()=>t.removeEventListener(o,s,a))},requestAnimationFrame(...t){let o=requestAnimationFrame(...t);l.add(()=>cancelAnimationFrame(o))},nextFrame(...t){l.requestAnimationFrame(()=>{l.requestAnimationFrame(...t)})},setTimeout(...t){let o=setTimeout(...t);l.add(()=>clearTimeout(o))},microTask(...t){let o={current:!0};return Yt(()=>{o.current&&t[0]()}),l.add(()=>{o.current=!1})},style(t,o,s){let a=t.style.getPropertyValue(o);return Object.assign(t.style,{[o]:s}),this.add(()=>{Object.assign(t.style,{[o]:a})})},group(t){let o=ue();return t(o),this.add(()=>o.dispose())},add(t){return e.push(t),()=>{let o=e.indexOf(t);if(o>=0)for(let s of e.splice(o,1))s()}},dispose(){for(let t of e.splice(0))t()}};return l}function Qt(){let e=ue();return n.onUnmounted(()=>e.dispose()),e}function Xt(){let e=Qt();return l=>{e.dispose(),e.nextFrame(l)}}let en=Symbol("headlessui.useid"),tn=0;function le(){return n.inject(en,()=>`${++tn}`)()}function k(e){var l;if(e==null||e.value==null)return null;let t=(l=e.value.$el)!=null?l:e.value;return t instanceof Node?t:null}function U(e,l,...t){if(e in l){let s=l[e];return typeof s=="function"?s(...t):s}let o=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(l).map(s=>`"${s}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(o,U),o}var nn=Object.defineProperty,on=(e,l,t)=>l in e?nn(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,Pe=(e,l,t)=>(on(e,typeof l!="symbol"?l+"":l,t),t);let ln=class{constructor(){Pe(this,"current",this.detect()),Pe(this,"currentId",0)}set(l){this.current!==l&&(this.currentId=0,this.current=l)}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"}},Ee=new ln;function Se(e){if(Ee.isServer)return null;if(e instanceof Node)return e.ownerDocument;if(e!=null&&e.hasOwnProperty("value")){let l=k(e);if(l)return l.ownerDocument}return document}let De=["[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 sn=(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))(sn||{}),rn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(rn||{}),an=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(an||{}),Ae=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ae||{});function cn(e,l=0){var t;return e===((t=Se(e))==null?void 0:t.body)?!1:U(l,{0(){return e.matches(De)},1(){let o=e;for(;o!==null;){if(o.matches(De))return!0;o=o.parentElement}return!1}})}var un=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(un||{});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 dn(e,l=t=>t){return e.slice().sort((t,o)=>{let s=l(t),a=l(o);if(s===null||a===null)return 0;let i=s.compareDocumentPosition(a);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function fn(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function pn(){return/Android/gi.test(window.navigator.userAgent)}function Fe(){return fn()||pn()}function de(e,l,t){Ee.isServer||n.watchEffect(o=>{document.addEventListener(e,l,t),o(()=>document.removeEventListener(e,l,t))})}function mn(e,l,t){Ee.isServer||n.watchEffect(o=>{window.addEventListener(e,l,t),o(()=>window.removeEventListener(e,l,t))})}function hn(e,l,t=n.computed(()=>!0)){function o(a,i){if(!t.value||a.defaultPrevented)return;let r=i(a);if(r===null||!r.getRootNode().contains(r))return;let c=function u(m){return typeof m=="function"?u(m()):Array.isArray(m)||m instanceof Set?m:[m]}(e);for(let u of c){if(u===null)continue;let m=u instanceof HTMLElement?u:k(u);if(m!=null&&m.contains(r)||a.composed&&a.composedPath().includes(m))return}return!cn(r,Ae.Loose)&&r.tabIndex!==-1&&a.preventDefault(),l(a,r)}let s=n.ref(null);de("pointerdown",a=>{var i,r;t.value&&(s.value=((r=(i=a.composedPath)==null?void 0:i.call(a))==null?void 0:r[0])||a.target)},!0),de("mousedown",a=>{var i,r;t.value&&(s.value=((r=(i=a.composedPath)==null?void 0:i.call(a))==null?void 0:r[0])||a.target)},!0),de("click",a=>{Fe()||s.value&&(o(a,()=>s.value),s.value=null)},!0),de("touchend",a=>o(a,()=>a.target instanceof HTMLElement?a.target:null),!0),mn("blur",a=>o(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function je(e,l){if(e)return e;let t=l??"button";if(typeof t=="string"&&t.toLowerCase()==="button")return"button"}function gn(e,l){let t=n.ref(je(e.value.type,e.value.as));return n.onMounted(()=>{t.value=je(e.value.type,e.value.as)}),n.watchEffect(()=>{var o;t.value||k(l)&&k(l)instanceof HTMLButtonElement&&!((o=k(l))!=null&&o.hasAttribute("type"))&&(t.value="button")}),t}function He(e){return[e.screenX,e.screenY]}function bn(){let e=n.ref([-1,-1]);return{wasMoved(l){let t=He(l);return e.value[0]===t[0]&&e.value[1]===t[1]?!1:(e.value=t,!0)},update(l){e.value=He(l)}}}function vn({container:e,accept:l,walk:t,enabled:o}){n.watchEffect(()=>{let s=e.value;if(!s||o!==void 0&&!o.value)return;let a=Se(e);if(!a)return;let i=Object.assign(c=>l(c),{acceptNode:l}),r=a.createTreeWalker(s,NodeFilter.SHOW_ELEMENT,i,!1);for(;r.nextNode();)t(r.currentNode)})}var se=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(se||{}),Cn=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Cn||{});function q({visible:e=!0,features:l=0,ourProps:t,theirProps:o,...s}){var a;let i=Ue(o,t),r=Object.assign(s,{props:i});if(e||l&2&&i.static)return Oe(r);if(l&1){let c=(a=i.unmount)==null||a?0:1;return U(c,{0(){return null},1(){return Oe({...s,props:{...i,hidden:!0,style:{display:"none"}}})}})}return Oe(r)}function Oe({props:e,attrs:l,slots:t,slot:o,name:s}){var a,i;let{as:r,...c}=fe(e,["unmount","static"]),u=(a=t.default)==null?void 0:a.call(t,o),m={};if(o){let p=!1,h=[];for(let[g,b]of Object.entries(o))typeof b=="boolean"&&(p=!0),b===!0&&h.push(g);p&&(m["data-headlessui-state"]=h.join(" "))}if(r==="template"){if(u=ze(u??[]),Object.keys(c).length>0||Object.keys(l).length>0){let[p,...h]=u??[];if(!xn(p)||h.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${s} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(c).concat(Object.keys(l)).map(y=>y.trim()).filter((y,I,N)=>N.indexOf(y)===I).sort((y,I)=>y.localeCompare(I)).map(y=>` - ${y}`).join(`
|
|
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(
|
|
4
|
+
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(c=t==null?void 0:t.onChange)==null||c.call(t,s),s}}function Ee(e,l){if(e===void 0)throw new Error("Unexpected undefined");return e}const Dt=(e,l)=>Math.abs(e-l)<1,At=(e,l,t)=>{let o;return function(...s){e.clearTimeout(o),o=e.setTimeout(()=>l.apply(this,s),t)}},Ft=e=>e,jt=e=>{const l=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let s=l;s<=t;s++)o.push(s);return o},Ht=(e,l)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;const s=i=>{const{width:r,height:c}=i;l({width:Math.round(r),height:Math.round(c)})};if(s(t.getBoundingClientRect()),!o.ResizeObserver)return()=>{};const a=new o.ResizeObserver(i=>{const r=i[0];if(r!=null&&r.borderBoxSize){const c=r.borderBoxSize[0];if(c){s({width:c.inlineSize,height:c.blockSize});return}}s(t.getBoundingClientRect())});return a.observe(t,{box:"border-box"}),()=>{a.unobserve(t)}},Re={passive:!0},zt=typeof window>"u"?!0:"onscrollend"in window,Ut=(e,l)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;let s=0;const a=zt?()=>{}:At(o,()=>{l(s,!1)},e.options.isScrollingResetDelay),i=u=>()=>{s=t[e.options.horizontal?"scrollLeft":"scrollTop"],a(),l(s,u)},r=i(!0),c=i(!1);return c(),t.addEventListener("scroll",r,Re),t.addEventListener("scrollend",c,Re),()=>{t.removeEventListener("scroll",r),t.removeEventListener("scrollend",c)}},Zt=(e,l,t)=>{if(l!=null&&l.borderBoxSize){const o=l.borderBoxSize[0];if(o)return Math.round(o[t.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[t.options.horizontal?"width":"height"])},Wt=(e,{adjustments:l=0,behavior:t},o)=>{var s,a;const i=e+l;(a=(s=o.scrollElement)==null?void 0:s.scrollTo)==null||a.call(s,{[o.options.horizontal?"left":"top"]:i,behavior:t})};class Gt{constructor(l){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 t=null;const o=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(a=>{this._measureElement(a.target,a)})}));return{disconnect:()=>{var s;return(s=o())==null?void 0:s.disconnect()},observe:s=>{var a;return(a=o())==null?void 0:a.observe(s,{box:"border-box"})},unobserve:s=>{var a;return(a=o())==null?void 0:a.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([o,s])=>{typeof s>"u"&&delete t[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ft,rangeExtractor:jt,onChange:()=>{},measureElement:Zt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,...t}},this.notify=(t,o)=>{var s,a;const{startIndex:i,endIndex:r}=this.range??{startIndex:void 0,endIndex:void 0},c=this.calculateRange();(t||i!==(c==null?void 0:c.startIndex)||r!==(c==null?void 0:c.endIndex))&&((a=(s=this.options).onChange)==null||a.call(s,this,o))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.observer.disconnect(),this.elementsCache.clear()},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.notify(!1,!1);return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(s,a)=>{this.scrollAdjustments=0,this.scrollDirection=a?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s;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=(t,o)=>{const s=new Map,a=new Map;for(let i=o-1;i>=0;i--){const r=t[i];if(s.has(r.lane))continue;const c=a.get(r.lane);if(c==null||r.end>c.end?a.set(r.lane,r):r.end<c.end&&s.set(r.lane,!0),s.size===this.options.lanes)break}return a.size===this.options.lanes?Array.from(a.values()).sort((i,r)=>i.end===r.end?i.index-r.index:i.end-r.end)[0]:void 0},this.getMeasurementOptions=oe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,o,s,a,i)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:o,scrollMargin:s,getItemKey:a,enabled:i}),{key:!1}),this.getMeasurements=oe(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:o,scrollMargin:s,getItemKey:a,enabled:i},r)=>{var c;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(m=>{this.itemSizeCache.set(m.key,m.size)}));const u=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const p=this.measurementsCache.slice(0,u);for(let m=u;m<t;m++){let b=(c=this.measurementsCache[m])==null?void 0:c.measureElement;b||(b=B=>{const _=a(m),O=this.elementsCache.get(_);if(!B){O&&(this.observer.unobserve(O),this.elementsCache.delete(_));return}O!==B&&(O&&this.observer.unobserve(O),this.observer.observe(B),this.elementsCache.set(_,B)),B.isConnected&&this.resizeItem(m,this.options.measureElement(B,void 0,this))});const x=a(m),h=this.options.lanes===1?p[m-1]:this.getFurthestMeasurement(p,m),g=h?h.end+this.options.gap:o+s,$=r.get(x),I=typeof $=="number"?$:this.options.estimateSize(m),E=g+I,T=h?h.lane:m%this.options.lanes;p[m]={index:m,start:g,size:I,end:E,key:x,lane:T,measureElement:b}}return this.measurementsCache=p,p},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=oe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(t,o,s)=>this.range=t.length>0&&o>0?qt({measurements:t,outerSize:o,scrollOffset:s}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=oe(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(t,o,s,a)=>o===null?[]:t({startIndex:o.startIndex,endIndex:o.endIndex,overscan:s,count:a}),{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const o=this.options.indexAttribute,s=t.getAttribute(o);return s?parseInt(s,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(t,o)=>{const s=this.indexFromElement(t),a=this.getMeasurements()[s];if(!a||!t.isConnected){this.elementsCache.forEach((r,c)=>{r===t&&(this.observer.unobserve(t),this.elementsCache.delete(c))});return}const i=this.elementsCache.get(a.key);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(a.key,t)),this.resizeItem(s,this.options.measureElement(t,o,this))},this.resizeItem=(t,o)=>{const s=this.getMeasurements()[t];if(!s)return;const a=this.itemSizeCache.get(s.key)??s.size,i=o-a;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,i,this):s.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(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,o)),this.notify(!0,!1))},this.measureElement=t=>{t&&this._measureElement(t,void 0)},this.getVirtualItems=oe(()=>[this.getIndexes(),this.getMeasurements()],(t,o)=>{const s=[];for(let a=0,i=t.length;a<i;a++){const r=t[a],c=o[r];s.push(c)}return s},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const o=this.getMeasurements();if(o.length!==0)return Ee(o[Me(0,o.length-1,s=>Ee(o[s]).start,t)])},this.getOffsetForAlignment=(t,o)=>{const s=this.getSize(),a=this.getScrollOffset();o==="auto"&&(t<=a?o="start":t>=a+s?o="end":o="start"),o==="start"?t=t:o==="end"?t=t-s:o==="center"&&(t=t-s/2);const i=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[i]:this.scrollElement[i]:0)-s;return Math.max(Math.min(c,t),0)},this.getOffsetForIndex=(t,o="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getMeasurements()[t];if(!s)return;const a=this.getSize(),i=this.getScrollOffset();if(o==="auto")if(s.end>=i+a-this.options.scrollPaddingEnd)o="end";else if(s.start<=i+this.options.scrollPaddingStart)o="start";else return[i,o];const r=o==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(r,o),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(t,{align:o="start",behavior:s}={})=>{this.cancelScrollToIndex(),s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,o),{adjustments:void 0,behavior:s})},this.scrollToIndex=(t,{align:o="auto",behavior:s}={})=>{t=Math.max(0,Math.min(t,this.options.count-1)),this.cancelScrollToIndex(),s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const a=this.getOffsetForIndex(t,o);if(!a)return;const[i,r]=a;this._scrollToOffset(i,{adjustments:void 0,behavior:s}),s!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(t))){const[u]=Ee(this.getOffsetForIndex(t,r));Dt(u,this.getScrollOffset())||this.scrollToIndex(t,{align:r,behavior:s})}else this.scrollToIndex(t,{align:r,behavior:s})}))},this.scrollBy=(t,{behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var t;const o=this.getMeasurements();let s;return o.length===0?s=this.options.paddingStart:s=this.options.lanes===1?((t=o[o.length-1])==null?void 0:t.end)??0:Math.max(...o.slice(-this.options.lanes).map(a=>a.end)),s-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(t,{adjustments:o,behavior:s})=>{this.options.scrollToFn(t,{behavior:s,adjustments:o},this)},this.measure=()=>{var t,o;this.itemSizeCache=new Map,(o=(t=this.options).onChange)==null||o.call(t,this,!1)},this.setOptions(l)}}const Me=(e,l,t,o)=>{for(;e<=l;){const s=(e+l)/2|0,a=t(s);if(a<o)e=s+1;else if(a>o)l=s-1;else return s}return e>0?e-1:0};function qt({measurements:e,outerSize:l,scrollOffset:t}){const o=e.length-1,a=Me(0,o,r=>e[r].start,t);let i=a;for(;i<o&&e[i].end<t+l;)i++;return{startIndex:a,endIndex:i}}function Jt(e){const l=new Gt(n.unref(e)),t=n.shallowRef(l),o=l._didMount();return n.watch(()=>n.unref(e).getScrollElement(),s=>{s&&l._willUpdate()},{immediate:!0}),n.watch(()=>n.unref(e),s=>{l.setOptions({...s,onChange:(a,i)=>{var r;n.triggerRef(t),(r=s.onChange)==null||r.call(s,a,i)}}),l._willUpdate(),n.triggerRef(t)},{immediate:!0}),n.onScopeDispose(o),t}function Kt(e){return Jt(n.computed(()=>({observeElementRect:Ht,observeElementOffset:Ut,scrollToFn:Wt,...n.unref(e)})))}function Yt(e,l,t){let o=n.ref(t==null?void 0:t.value),s=n.computed(()=>e.value!==void 0);return[n.computed(()=>s.value?e.value:o.value),function(a){return s.value||(o.value=a),l==null?void 0:l(a)}]}function Qt(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(l=>setTimeout(()=>{throw l}))}function ue(){let e=[],l={addEventListener(t,o,s,a){return t.addEventListener(o,s,a),l.add(()=>t.removeEventListener(o,s,a))},requestAnimationFrame(...t){let o=requestAnimationFrame(...t);l.add(()=>cancelAnimationFrame(o))},nextFrame(...t){l.requestAnimationFrame(()=>{l.requestAnimationFrame(...t)})},setTimeout(...t){let o=setTimeout(...t);l.add(()=>clearTimeout(o))},microTask(...t){let o={current:!0};return Qt(()=>{o.current&&t[0]()}),l.add(()=>{o.current=!1})},style(t,o,s){let a=t.style.getPropertyValue(o);return Object.assign(t.style,{[o]:s}),this.add(()=>{Object.assign(t.style,{[o]:a})})},group(t){let o=ue();return t(o),this.add(()=>o.dispose())},add(t){return e.push(t),()=>{let o=e.indexOf(t);if(o>=0)for(let s of e.splice(o,1))s()}},dispose(){for(let t of e.splice(0))t()}};return l}function Xt(){let e=ue();return n.onUnmounted(()=>e.dispose()),e}function en(){let e=Xt();return l=>{e.dispose(),e.nextFrame(l)}}let tn=Symbol("headlessui.useid"),nn=0;function le(){return n.inject(tn,()=>`${++nn}`)()}function k(e){var l;if(e==null||e.value==null)return null;let t=(l=e.value.$el)!=null?l:e.value;return t instanceof Node?t:null}function U(e,l,...t){if(e in l){let s=l[e];return typeof s=="function"?s(...t):s}let o=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(l).map(s=>`"${s}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(o,U),o}var on=Object.defineProperty,ln=(e,l,t)=>l in e?on(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,Pe=(e,l,t)=>(ln(e,typeof l!="symbol"?l+"":l,t),t);let sn=class{constructor(){Pe(this,"current",this.detect()),Pe(this,"currentId",0)}set(l){this.current!==l&&(this.currentId=0,this.current=l)}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"}},Se=new sn;function Oe(e){if(Se.isServer)return null;if(e instanceof Node)return e.ownerDocument;if(e!=null&&e.hasOwnProperty("value")){let l=k(e);if(l)return l.ownerDocument}return document}let De=["[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 rn=(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))(rn||{}),an=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(an||{}),cn=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(cn||{}),Ae=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ae||{});function un(e,l=0){var t;return e===((t=Oe(e))==null?void 0:t.body)?!1:U(l,{0(){return e.matches(De)},1(){let o=e;for(;o!==null;){if(o.matches(De))return!0;o=o.parentElement}return!1}})}var dn=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(dn||{});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 fn(e,l=t=>t){return e.slice().sort((t,o)=>{let s=l(t),a=l(o);if(s===null||a===null)return 0;let i=s.compareDocumentPosition(a);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function pn(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function mn(){return/Android/gi.test(window.navigator.userAgent)}function Fe(){return pn()||mn()}function de(e,l,t){Se.isServer||n.watchEffect(o=>{document.addEventListener(e,l,t),o(()=>document.removeEventListener(e,l,t))})}function hn(e,l,t){Se.isServer||n.watchEffect(o=>{window.addEventListener(e,l,t),o(()=>window.removeEventListener(e,l,t))})}function gn(e,l,t=n.computed(()=>!0)){function o(a,i){if(!t.value||a.defaultPrevented)return;let r=i(a);if(r===null||!r.getRootNode().contains(r))return;let c=function u(p){return typeof p=="function"?u(p()):Array.isArray(p)||p instanceof Set?p:[p]}(e);for(let u of c){if(u===null)continue;let p=u instanceof HTMLElement?u:k(u);if(p!=null&&p.contains(r)||a.composed&&a.composedPath().includes(p))return}return!un(r,Ae.Loose)&&r.tabIndex!==-1&&a.preventDefault(),l(a,r)}let s=n.ref(null);de("pointerdown",a=>{var i,r;t.value&&(s.value=((r=(i=a.composedPath)==null?void 0:i.call(a))==null?void 0:r[0])||a.target)},!0),de("mousedown",a=>{var i,r;t.value&&(s.value=((r=(i=a.composedPath)==null?void 0:i.call(a))==null?void 0:r[0])||a.target)},!0),de("click",a=>{Fe()||s.value&&(o(a,()=>s.value),s.value=null)},!0),de("touchend",a=>o(a,()=>a.target instanceof HTMLElement?a.target:null),!0),hn("blur",a=>o(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function je(e,l){if(e)return e;let t=l??"button";if(typeof t=="string"&&t.toLowerCase()==="button")return"button"}function bn(e,l){let t=n.ref(je(e.value.type,e.value.as));return n.onMounted(()=>{t.value=je(e.value.type,e.value.as)}),n.watchEffect(()=>{var o;t.value||k(l)&&k(l)instanceof HTMLButtonElement&&!((o=k(l))!=null&&o.hasAttribute("type"))&&(t.value="button")}),t}function He(e){return[e.screenX,e.screenY]}function vn(){let e=n.ref([-1,-1]);return{wasMoved(l){let t=He(l);return e.value[0]===t[0]&&e.value[1]===t[1]?!1:(e.value=t,!0)},update(l){e.value=He(l)}}}function Cn({container:e,accept:l,walk:t,enabled:o}){n.watchEffect(()=>{let s=e.value;if(!s||o!==void 0&&!o.value)return;let a=Oe(e);if(!a)return;let i=Object.assign(c=>l(c),{acceptNode:l}),r=a.createTreeWalker(s,NodeFilter.SHOW_ELEMENT,i,!1);for(;r.nextNode();)t(r.currentNode)})}var se=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(se||{}),_n=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(_n||{});function q({visible:e=!0,features:l=0,ourProps:t,theirProps:o,...s}){var a;let i=Ue(o,t),r=Object.assign(s,{props:i});if(e||l&2&&i.static)return ke(r);if(l&1){let c=(a=i.unmount)==null||a?0:1;return U(c,{0(){return null},1(){return ke({...s,props:{...i,hidden:!0,style:{display:"none"}}})}})}return ke(r)}function ke({props:e,attrs:l,slots:t,slot:o,name:s}){var a,i;let{as:r,...c}=fe(e,["unmount","static"]),u=(a=t.default)==null?void 0:a.call(t,o),p={};if(o){let m=!1,b=[];for(let[x,h]of Object.entries(o))typeof h=="boolean"&&(m=!0),h===!0&&b.push(x);m&&(p["data-headlessui-state"]=b.join(" "))}if(r==="template"){if(u=ze(u??[]),Object.keys(c).length>0||Object.keys(l).length>0){let[m,...b]=u??[];if(!yn(m)||b.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${s} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(c).concat(Object.keys(l)).map(g=>g.trim()).filter((g,$,I)=>I.indexOf(g)===$).sort((g,$)=>g.localeCompare($)).map(g=>` - ${g}`).join(`
|
|
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 g=Ue((i=p.props)!=null?i:{},c,m),b=n.cloneVNode(p,g,!0);for(let y in g)y.startsWith("on")&&(b.props||(b.props={}),b.props[y]=g[y]);return b}return Array.isArray(u)&&u.length===1?u[0]:u}return n.h(r,Object.assign({},c,m),{default:()=>u})}function ze(e){return e.flatMap(l=>l.type===n.Fragment?ze(l.children):[l])}function Ue(...e){if(e.length===0)return{};if(e.length===1)return e[0];let l={},t={};for(let o of e)for(let s in o)s.startsWith("on")&&typeof o[s]=="function"?(t[s]!=null||(t[s]=[]),t[s].push(o[s])):l[s]=o[s];if(l.disabled||l["aria-disabled"])return Object.assign(l,Object.fromEntries(Object.keys(t).map(o=>[o,void 0])));for(let o in t)Object.assign(l,{[o](s,...a){let i=t[o];for(let r of i){if(s instanceof Event&&s.defaultPrevented)return;r(s,...a)}}});return l}function _n(e){let l=Object.assign({},e);for(let t in l)l[t]===void 0&&delete l[t];return l}function fe(e,l=[]){let t=Object.assign({},e);for(let o of l)o in t&&delete t[o];return t}function xn(e){return e==null?!1:typeof e.type=="string"||typeof e.type=="object"||typeof e.type=="function"}var Ze=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Ze||{});let wn=n.defineComponent({name:"Hidden",props:{as:{type:[Object,String],default:"div"},features:{type:Number,default:1}},setup(e,{slots:l,attrs:t}){return()=>{var o;let{features:s,...a}=e,i={"aria-hidden":(s&2)===2?!0:(o=a["aria-hidden"])!=null?o:void 0,hidden:(s&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",...(s&4)===4&&(s&2)!==2&&{display:"none"}}};return q({ourProps:i,theirProps:a,slot:{},attrs:t,slots:l,name:"Hidden"})}}}),We=Symbol("Context");var re=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(re||{});function yn(){return n.inject(We,null)}function En(e){n.provide(We,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||{}),Ge=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Ge||{});function Sn(e){function l(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",l))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",l),l())}let J=[];Sn(()=>{function e(l){l.target instanceof HTMLElement&&l.target!==document.body&&J[0]!==l.target&&(J.unshift(l.target),J=J.filter(t=>t!=null&&t.isConnected),J.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 On(e){throw new Error("Unexpected object: "+e)}var M=(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))(M||{});function qe(e,l){let t=l.resolveItems();if(t.length<=0)return null;let o=l.resolveActiveIndex(),s=o??-1;switch(e.focus){case 0:{for(let a=0;a<t.length;++a)if(!l.resolveDisabled(t[a],a,t))return a;return o}case 1:{s===-1&&(s=t.length);for(let a=s-1;a>=0;--a)if(!l.resolveDisabled(t[a],a,t))return a;return o}case 2:{for(let a=s+1;a<t.length;++a)if(!l.resolveDisabled(t[a],a,t))return a;return o}case 3:{for(let a=t.length-1;a>=0;--a)if(!l.resolveDisabled(t[a],a,t))return a;return o}case 4:{for(let a=0;a<t.length;++a)if(l.resolveId(t[a],a,t)===e.id)return a;return o}case 5:return null;default:On(e)}}function Je(e={},l=null,t=[]){for(let[o,s]of Object.entries(e))Ye(t,Ke(l,o),s);return t}function Ke(e,l){return e?e+"["+l+"]":l}function Ye(e,l,t){if(Array.isArray(t))for(let[o,s]of t.entries())Ye(e,Ke(l,o.toString()),s);else t instanceof Date?e.push([l,t.toISOString()]):typeof t=="boolean"?e.push([l,t?"1":"0"]):typeof t=="string"?e.push([l,t]):typeof t=="number"?e.push([l,`${t}`]):t==null?e.push([l,""]):Je(t,l,e)}function kn(e,l){return e===l}var Vn=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Vn||{}),$n=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))($n||{}),Nn=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(Nn||{});let Qe=Symbol("ComboboxContext");function K(e){let l=n.inject(Qe,null);if(l===null){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,K),t}return l}let Xe=Symbol("VirtualContext"),In=n.defineComponent({name:"VirtualProvider",setup(e,{slots:l}){let t=K("VirtualProvider"),o=n.computed(()=>{let r=k(t.optionsRef);if(!r)return{start:0,end:0};let c=window.getComputedStyle(r);return{start:parseFloat(c.paddingBlockStart||c.paddingTop),end:parseFloat(c.paddingBlockEnd||c.paddingBottom)}}),s=Jt(n.computed(()=>({scrollPaddingStart:o.value.start,scrollPaddingEnd:o.value.end,count:t.virtual.value.options.length,estimateSize(){return 40},getScrollElement(){return k(t.optionsRef)},overscan:12}))),a=n.computed(()=>{var r;return(r=t.virtual.value)==null?void 0:r.options}),i=n.ref(0);return n.watch([a],()=>{i.value+=1}),n.provide(Xe,t.virtual.value?s:null),()=>[n.h("div",{style:{position:"relative",width:"100%",height:`${s.value.getTotalSize()}px`},ref:r=>{if(r){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||t.activationTrigger.value===0)return;t.activeOptionIndex.value!==null&&t.virtual.value.options.length>t.activeOptionIndex.value&&s.value.scrollToIndex(t.activeOptionIndex.value)}}},s.value.getVirtualItems().map(r=>n.cloneVNode(l.default({option:t.virtual.value.options[r.index],open:t.comboboxState.value===0})[0],{key:`${i.value}-${r.index}`,"data-index":r.index,"aria-setsize":t.virtual.value.options.length,"aria-posinset":r.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${r.start}px)`,overflowAnchor:"none"}})))]}}),Bn=n.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:l,attrs:t,emit:o}){let s=n.ref(1),a=n.ref(null),i=n.ref(null),r=n.ref(null),c=n.ref(null),u=n.ref({static:!1,hold:!1}),m=n.ref([]),p=n.ref(null),h=n.ref(2),g=n.ref(!1);function b(d=f=>f){let f=p.value!==null?m.value[p.value]:null,x=d(m.value.slice()),w=x.length>0&&x[0].dataRef.order.value!==null?x.sort((B,F)=>B.dataRef.order.value-F.dataRef.order.value):dn(x,B=>k(B.dataRef.domRef)),V=f?w.indexOf(f):null;return V===-1&&(V=null),{options:w,activeOptionIndex:V}}let y=n.computed(()=>e.multiple?1:0),I=n.computed(()=>e.nullable),[N,E]=Kt(n.computed(()=>e.modelValue),d=>o("update:modelValue",d),n.computed(()=>e.defaultValue)),$=n.computed(()=>N.value===void 0?U(y.value,{1:[],0:void 0}):N.value),L=null,_=null;function O(d){return U(y.value,{0(){return E==null?void 0:E(d)},1:()=>{let f=n.toRaw(v.value.value).slice(),x=n.toRaw(d),w=f.findIndex(V=>v.compare(x,n.toRaw(V)));return w===-1?f.push(x):f.splice(w,1),E==null?void 0:E(f)}})}let C=n.computed(()=>{});n.watch([C],([d],[f])=>{if(v.virtual.value&&d&&f&&p.value!==null){let x=d.indexOf(f[p.value]);x!==-1?p.value=x:p.value=null}});let v={comboboxState:s,value:$,mode:y,compare(d,f){if(typeof e.by=="string"){let x=e.by;return(d==null?void 0:d[x])===(f==null?void 0:f[x])}return e.by===null?kn(d,f):e.by(d,f)},calculateIndex(d){return v.virtual.value?e.by===null?v.virtual.value.options.indexOf(d):v.virtual.value.options.findIndex(f=>v.compare(f,d)):m.value.findIndex(f=>v.compare(f.dataRef.value,d))},defaultValue:n.computed(()=>e.defaultValue),nullable:I,immediate:n.computed(()=>!1),virtual:n.computed(()=>null),inputRef:i,labelRef:a,buttonRef:r,optionsRef:c,disabled:n.computed(()=>e.disabled),options:m,change(d){E(d)},activeOptionIndex:n.computed(()=>{if(g.value&&p.value===null&&(v.virtual.value?v.virtual.value.options.length>0:m.value.length>0)){if(v.virtual.value){let f=v.virtual.value.options.findIndex(x=>{var w;return!((w=v.virtual.value)!=null&&w.disabled(x))});if(f!==-1)return f}let d=m.value.findIndex(f=>!f.dataRef.disabled);if(d!==-1)return d}return p.value}),activationTrigger:h,optionsPropsRef:u,closeCombobox(){g.value=!1,!e.disabled&&s.value!==1&&(s.value=1,p.value=null)},openCombobox(){if(g.value=!0,!e.disabled&&s.value!==0){if(v.value.value){let d=v.calculateIndex(v.value.value);d!==-1&&(p.value=d)}s.value=0}},setActivationTrigger(d){h.value=d},goToOption(d,f,x){g.value=!1,L!==null&&cancelAnimationFrame(L),L=requestAnimationFrame(()=>{if(e.disabled||c.value&&!u.value.static&&s.value===1)return;if(v.virtual.value){p.value=d===M.Specific?f:qe({focus:d},{resolveItems:()=>v.virtual.value.options,resolveActiveIndex:()=>{var B,F;return(F=(B=v.activeOptionIndex.value)!=null?B:v.virtual.value.options.findIndex(j=>{var R;return!((R=v.virtual.value)!=null&&R.disabled(j))}))!=null?F:null},resolveDisabled:B=>v.virtual.value.disabled(B),resolveId(){throw new Error("Function not implemented.")}}),h.value=x??2;return}let w=b();if(w.activeOptionIndex===null){let B=w.options.findIndex(F=>!F.dataRef.disabled);B!==-1&&(w.activeOptionIndex=B)}let V=d===M.Specific?f:qe({focus:d},{resolveItems:()=>w.options,resolveActiveIndex:()=>w.activeOptionIndex,resolveId:B=>B.id,resolveDisabled:B=>B.dataRef.disabled});p.value=V,h.value=x??2,m.value=w.options})},selectOption(d){let f=m.value.find(w=>w.id===d);if(!f)return;let{dataRef:x}=f;O(x.value)},selectActiveOption(){if(v.activeOptionIndex.value!==null){if(v.virtual.value)O(v.virtual.value.options[v.activeOptionIndex.value]);else{let{dataRef:d}=m.value[v.activeOptionIndex.value];O(d.value)}v.goToOption(M.Specific,v.activeOptionIndex.value)}},registerOption(d,f){let x=n.reactive({id:d,dataRef:f});if(v.virtual.value){m.value.push(x);return}_&&cancelAnimationFrame(_);let w=b(V=>(V.push(x),V));p.value===null&&v.isSelected(f.value.value)&&(w.activeOptionIndex=w.options.indexOf(x)),m.value=w.options,p.value=w.activeOptionIndex,h.value=2,w.options.some(V=>!k(V.dataRef.domRef))&&(_=requestAnimationFrame(()=>{let V=b();m.value=V.options,p.value=V.activeOptionIndex}))},unregisterOption(d,f){if(L!==null&&cancelAnimationFrame(L),f&&(g.value=!0),v.virtual.value){m.value=m.value.filter(w=>w.id!==d);return}let x=b(w=>{let V=w.findIndex(B=>B.id===d);return V!==-1&&w.splice(V,1),w});m.value=x.options,p.value=x.activeOptionIndex,h.value=2},isSelected(d){return U(y.value,{0:()=>v.compare(n.toRaw(v.value.value),n.toRaw(d)),1:()=>n.toRaw(v.value.value).some(f=>v.compare(n.toRaw(f),n.toRaw(d)))})},isActive(d){return p.value===v.calculateIndex(d)}};hn([i,r,c],()=>v.closeCombobox(),n.computed(()=>s.value===0)),n.provide(Qe,v),En(n.computed(()=>U(s.value,{0:re.Open,1:re.Closed})));let S=n.computed(()=>{var d;return(d=k(i))==null?void 0:d.closest("form")});return n.onMounted(()=>{n.watch([S],()=>{if(!S.value||e.defaultValue===void 0)return;function d(){v.change(e.defaultValue)}return S.value.addEventListener("reset",d),()=>{var f;(f=S.value)==null||f.removeEventListener("reset",d)}},{immediate:!0})}),()=>{var d,f,x;let{name:w,disabled:V,form:B,...F}=e,j={open:s.value===0,disabled:V,activeIndex:v.activeOptionIndex.value,activeOption:v.activeOptionIndex.value===null?null:v.virtual.value?v.virtual.value.options[(d=v.activeOptionIndex.value)!=null?d:0]:(x=(f=v.options.value[v.activeOptionIndex.value])==null?void 0:f.dataRef.value)!=null?x:null,value:$.value};return n.h(n.Fragment,[...w!=null&&$.value!=null?Je({[w]:$.value}).map(([R,t2])=>n.h(wn,_n({features:Ze.Hidden,key:R,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:B,disabled:V,name:R,value:t2}))):[],q({theirProps:{...t,...fe(F,["by","defaultValue","immediate","modelValue","multiple","nullable","onUpdate:modelValue","virtual"])},ourProps:{},slot:j,slots:l,attrs:t,name:"Combobox"})])}}});n.defineComponent({name:"ComboboxLabel",props:{as:{type:[Object,String],default:"label"},id:{type:String,default:null}},setup(e,{attrs:l,slots:t}){var o;let s=(o=e.id)!=null?o:`headlessui-combobox-label-${le()}`,a=K("ComboboxLabel");function i(){var r;(r=k(a.inputRef))==null||r.focus({preventScroll:!0})}return()=>{let r={open:a.comboboxState.value===0,disabled:a.disabled.value},{...c}=e,u={id:s,ref:a.labelRef,onClick:i};return q({ourProps:u,theirProps:c,slot:r,attrs:l,slots:t,name:"ComboboxLabel"})}}});let Ln=n.defineComponent({name:"ComboboxButton",props:{as:{type:[Object,String],default:"button"},id:{type:String,default:null}},setup(e,{attrs:l,slots:t,expose:o}){var s;let a=(s=e.id)!=null?s:`headlessui-combobox-button-${le()}`,i=K("ComboboxButton");o({el:i.buttonRef,$el:i.buttonRef});function r(m){i.disabled.value||(i.comboboxState.value===0?i.closeCombobox():(m.preventDefault(),i.openCombobox()),n.nextTick(()=>{var p;return(p=k(i.inputRef))==null?void 0:p.focus({preventScroll:!0})}))}function c(m){switch(m.key){case D.ArrowDown:m.preventDefault(),m.stopPropagation(),i.comboboxState.value===1&&i.openCombobox(),n.nextTick(()=>{var p;return(p=i.inputRef.value)==null?void 0:p.focus({preventScroll:!0})});return;case D.ArrowUp:m.preventDefault(),m.stopPropagation(),i.comboboxState.value===1&&(i.openCombobox(),n.nextTick(()=>{i.value.value||i.goToOption(M.Last)})),n.nextTick(()=>{var p;return(p=i.inputRef.value)==null?void 0:p.focus({preventScroll:!0})});return;case D.Escape:if(i.comboboxState.value!==0)return;m.preventDefault(),i.optionsRef.value&&!i.optionsPropsRef.value.static&&m.stopPropagation(),i.closeCombobox(),n.nextTick(()=>{var p;return(p=i.inputRef.value)==null?void 0:p.focus({preventScroll:!0})});return}}let u=gn(n.computed(()=>({as:e.as,type:l.type})),i.buttonRef);return()=>{var m,p;let h={open:i.comboboxState.value===0,disabled:i.disabled.value,value:i.value.value},{...g}=e,b={ref:i.buttonRef,id:a,type:u.value,tabindex:"-1","aria-haspopup":"listbox","aria-controls":(m=k(i.optionsRef))==null?void 0:m.id,"aria-expanded":i.comboboxState.value===0,"aria-labelledby":i.labelRef.value?[(p=k(i.labelRef))==null?void 0:p.id,a].join(" "):void 0,disabled:i.disabled.value===!0?!0:void 0,onKeydown:c,onClick:r};return q({ourProps:b,theirProps:g,slot:h,attrs:l,slots:t,name:"ComboboxButton"})}}}),Tn=n.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:l,attrs:t,slots:o,expose:s}){var a;let i=(a=e.id)!=null?a:`headlessui-combobox-input-${le()}`,r=K("ComboboxInput"),c=n.computed(()=>Se(k(r.inputRef))),u={value:!1};s({el:r.inputRef,$el:r.inputRef});function m(){r.change(null);let _=k(r.optionsRef);_&&(_.scrollTop=0),r.goToOption(M.Nothing)}let p=n.computed(()=>{var _;let O=r.value.value;return k(r.inputRef)?typeof e.displayValue<"u"&&O!==void 0?(_=e.displayValue(O))!=null?_:"":typeof O=="string"?O:"":""});n.onMounted(()=>{n.watch([p,r.comboboxState,c],([_,O],[C,v])=>{if(u.value)return;let S=k(r.inputRef);S&&((v===0&&O===1||_!==C)&&(S.value=_),requestAnimationFrame(()=>{var d;if(u.value||!S||((d=c.value)==null?void 0:d.activeElement)!==S)return;let{selectionStart:f,selectionEnd:x}=S;Math.abs((x??0)-(f??0))===0&&f===0&&S.setSelectionRange(S.value.length,S.value.length)}))},{immediate:!0}),n.watch([r.comboboxState],([_],[O])=>{if(_===0&&O===1){if(u.value)return;let C=k(r.inputRef);if(!C)return;let v=C.value,{selectionStart:S,selectionEnd:d,selectionDirection:f}=C;C.value="",C.value=v,f!==null?C.setSelectionRange(S,d,f):C.setSelectionRange(S,d)}})});let h=n.ref(!1);function g(){h.value=!0}function b(){ue().nextFrame(()=>{h.value=!1})}let y=Xt();function I(_){switch(u.value=!0,y(()=>{u.value=!1}),_.key){case D.Enter:if(u.value=!1,r.comboboxState.value!==0||h.value)return;if(_.preventDefault(),_.stopPropagation(),r.activeOptionIndex.value===null){r.closeCombobox();return}r.selectActiveOption(),r.mode.value===0&&r.closeCombobox();break;case D.ArrowDown:return u.value=!1,_.preventDefault(),_.stopPropagation(),U(r.comboboxState.value,{0:()=>r.goToOption(M.Next),1:()=>r.openCombobox()});case D.ArrowUp:return u.value=!1,_.preventDefault(),_.stopPropagation(),U(r.comboboxState.value,{0:()=>r.goToOption(M.Previous),1:()=>{r.openCombobox(),n.nextTick(()=>{r.value.value||r.goToOption(M.Last)})}});case D.Home:if(_.shiftKey)break;return u.value=!1,_.preventDefault(),_.stopPropagation(),r.goToOption(M.First);case D.PageUp:return u.value=!1,_.preventDefault(),_.stopPropagation(),r.goToOption(M.First);case D.End:if(_.shiftKey)break;return u.value=!1,_.preventDefault(),_.stopPropagation(),r.goToOption(M.Last);case D.PageDown:return u.value=!1,_.preventDefault(),_.stopPropagation(),r.goToOption(M.Last);case D.Escape:if(u.value=!1,r.comboboxState.value!==0)return;_.preventDefault(),r.optionsRef.value&&!r.optionsPropsRef.value.static&&_.stopPropagation(),r.nullable.value&&r.mode.value===0&&r.value.value===null&&m(),r.closeCombobox();break;case D.Tab:if(u.value=!1,r.comboboxState.value!==0)return;r.mode.value===0&&r.activationTrigger.value!==1&&r.selectActiveOption(),r.closeCombobox();break}}function N(_){l("change",_),r.nullable.value&&r.mode.value===0&&_.target.value===""&&m(),r.openCombobox()}function E(_){var O,C,v;let S=(O=_.relatedTarget)!=null?O:J.find(d=>d!==_.currentTarget);if(u.value=!1,!((C=k(r.optionsRef))!=null&&C.contains(S))&&!((v=k(r.buttonRef))!=null&&v.contains(S))&&r.comboboxState.value===0)return _.preventDefault(),r.mode.value===0&&(r.nullable.value&&r.value.value===null?m():r.activationTrigger.value!==1&&r.selectActiveOption()),r.closeCombobox()}function $(_){var O,C,v;let S=(O=_.relatedTarget)!=null?O:J.find(d=>d!==_.currentTarget);(C=k(r.buttonRef))!=null&&C.contains(S)||(v=k(r.optionsRef))!=null&&v.contains(S)||r.disabled.value||r.immediate.value&&r.comboboxState.value!==0&&(r.openCombobox(),ue().nextFrame(()=>{r.setActivationTrigger(1)}))}let L=n.computed(()=>{var _,O,C,v;return(v=(C=(O=e.defaultValue)!=null?O:r.defaultValue.value!==void 0?(_=e.displayValue)==null?void 0:_.call(e,r.defaultValue.value):null)!=null?C:r.defaultValue.value)!=null?v:""});return()=>{var _,O,C,v,S,d,f;let x={open:r.comboboxState.value===0},{displayValue:w,onChange:V,...B}=e,F={"aria-controls":(_=r.optionsRef.value)==null?void 0:_.id,"aria-expanded":r.comboboxState.value===0,"aria-activedescendant":r.activeOptionIndex.value===null?void 0:r.virtual.value?(O=r.options.value.find(j=>!r.virtual.value.disabled(j.dataRef.value)&&r.compare(j.dataRef.value,r.virtual.value.options[r.activeOptionIndex.value])))==null?void 0:O.id:(C=r.options.value[r.activeOptionIndex.value])==null?void 0:C.id,"aria-labelledby":(d=(v=k(r.labelRef))==null?void 0:v.id)!=null?d:(S=k(r.buttonRef))==null?void 0:S.id,"aria-autocomplete":"list",id:i,onCompositionstart:g,onCompositionend:b,onKeydown:I,onInput:N,onFocus:$,onBlur:E,role:"combobox",type:(f=t.type)!=null?f:"text",tabIndex:0,ref:r.inputRef,defaultValue:L.value,disabled:r.disabled.value===!0?!0:void 0};return q({ourProps:F,theirProps:B,slot:x,attrs:t,slots:o,features:se.RenderStrategy|se.Static,name:"ComboboxInput"})}}}),Rn=n.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:l,slots:t,expose:o}){let s=K("ComboboxOptions"),a=`headlessui-combobox-options-${le()}`;o({el:s.optionsRef,$el:s.optionsRef}),n.watchEffect(()=>{s.optionsPropsRef.value.static=e.static}),n.watchEffect(()=>{s.optionsPropsRef.value.hold=e.hold});let i=yn(),r=n.computed(()=>i!==null?(i.value&re.Open)===re.Open:s.comboboxState.value===0);vn({container:n.computed(()=>k(s.optionsRef)),enabled:n.computed(()=>s.comboboxState.value===0),accept(u){return u.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:u.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(u){u.setAttribute("role","none")}});function c(u){u.preventDefault()}return()=>{var u,m,p;let h={open:s.comboboxState.value===0},g={"aria-labelledby":(p=(u=k(s.labelRef))==null?void 0:u.id)!=null?p:(m=k(s.buttonRef))==null?void 0:m.id,id:a,ref:s.optionsRef,role:"listbox","aria-multiselectable":s.mode.value===1?!0:void 0,onMousedown:c},b=fe(e,["hold"]);return q({ourProps:g,theirProps:b,slot:h,attrs:l,slots:s.virtual.value&&s.comboboxState.value===0?{...t,default:()=>[n.h(In,{},t.default)]}:t,features:se.RenderStrategy|se.Static,visible:r.value,name:"ComboboxOptions"})}}}),Mn=n.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:l,attrs:t,expose:o}){let s=K("ComboboxOption"),a=`headlessui-combobox-option-${le()}`,i=n.ref(null),r=n.computed(()=>e.disabled);o({el:i,$el:i});let c=n.computed(()=>{var E;return s.virtual.value?s.activeOptionIndex.value===s.calculateIndex(e.value):s.activeOptionIndex.value===null?!1:((E=s.options.value[s.activeOptionIndex.value])==null?void 0:E.id)===a}),u=n.computed(()=>s.isSelected(e.value)),m=n.inject(Xe,null),p=n.computed(()=>({disabled:e.disabled,value:e.value,domRef:i,order:n.computed(()=>e.order)}));n.onMounted(()=>s.registerOption(a,p)),n.onUnmounted(()=>s.unregisterOption(a,c.value)),n.watchEffect(()=>{let E=k(i);E&&(m==null||m.value.measureElement(E))}),n.watchEffect(()=>{s.comboboxState.value===0&&c.value&&(s.virtual.value||s.activationTrigger.value!==0&&n.nextTick(()=>{var E,$;return($=(E=k(i))==null?void 0:E.scrollIntoView)==null?void 0:$.call(E,{block:"nearest"})}))});function h(E){E.preventDefault(),E.button===Ge.Left&&(r.value||(s.selectOption(a),Fe()||requestAnimationFrame(()=>{var $;return($=k(s.inputRef))==null?void 0:$.focus({preventScroll:!0})}),s.mode.value===0&&s.closeCombobox()))}function g(){var E;if(e.disabled||(E=s.virtual.value)!=null&&E.disabled(e.value))return s.goToOption(M.Nothing);let $=s.calculateIndex(e.value);s.goToOption(M.Specific,$)}let b=bn();function y(E){b.update(E)}function I(E){var $;if(!b.wasMoved(E)||e.disabled||($=s.virtual.value)!=null&&$.disabled(e.value)||c.value)return;let L=s.calculateIndex(e.value);s.goToOption(M.Specific,L,0)}function N(E){var $;b.wasMoved(E)&&(e.disabled||($=s.virtual.value)!=null&&$.disabled(e.value)||c.value&&(s.optionsPropsRef.value.hold||s.goToOption(M.Nothing)))}return()=>{let{disabled:E}=e,$={active:c.value,selected:u.value,disabled:E},L={id:a,ref:i,role:"option",tabIndex:E===!0?void 0:-1,"aria-disabled":E===!0?!0:void 0,"aria-selected":u.value,disabled:void 0,onMousedown:h,onFocus:g,onPointerenter:y,onMouseenter:y,onPointermove:I,onMousemove:I,onPointerleave:N,onMouseleave:N},_=fe(e,["order","value"]);return q({ourProps:L,theirProps:_,slot:$,attrs:t,slots:l,name:"ComboboxOption"})}}});function Pn(e,l){return n.openBlock(),n.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[n.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 Dn(e,l){return n.openBlock(),n.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[n.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 An(e,l){return n.openBlock(),n.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[n.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"})])}const et={__name:"Select",props:n.mergeModels({languages:{type:Object,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=n.useModel(e,"modelValue"),o=n.ref(""),s=n.ref(null),a=n.computed(()=>Object.entries(l.languages).filter(([,r])=>r.toLowerCase().includes(o.value.toLowerCase()))),i=r=>{r.target.value="",o.value="",s.value&&s.value.$el.click()};return(r,c)=>(n.openBlock(),n.createBlock(n.unref(Bn),{modelValue:t.value,"onUpdate:modelValue":c[3]||(c[3]=u=>t.value=u),as:"div",class:"relative mt-1"},{default:n.withCtx(()=>[n.createVNode(n.unref(Tn),{class:"w-full bg-white border border-gray-300 rounded py-2.5 pl-3 pr-10 text-sm text-gray-800 font-medium focus:outline-none focus:ring-0.5 focus:ring-gray-400 focus:border-gray-400",onChange:c[0]||(c[0]=u=>o.value=u.target.value),displayValue:u=>e.languages[u],onFocus:c[1]||(c[1]=u=>i(u))},null,8,["displayValue"]),n.createVNode(n.unref(Ln),{ref_key:"btnSelect",ref:s,class:"absolute inset-y-0 right-0 flex items-center pr-2"},{default:n.withCtx(()=>[n.createVNode(n.unref(Dn),{class:"h-5 w-5 text-gray-400","aria-hidden":"true",onClick:c[2]||(c[2]=u=>i(u))})]),_:1},512),n.createVNode(n.unref(Rn),{class:"absolute mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm z-50"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value,([u,m])=>(n.openBlock(),n.createBlock(n.unref(Mn),{key:u,value:u},{default:n.withCtx(({active:p,selected:h})=>[n.createElementVNode("li",{class:n.normalizeClass(["relative cursor-default select-none py-2 pl-3 pr-9",p?"bg-[#3B5695] text-white":"text-textCustom"])},[n.createElementVNode("span",{class:n.normalizeClass(["block truncate",h&&"font-semibold"])},n.toDisplayString(m),3)],2)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"]))}},tt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.68688%202.3131C3.88214%202.50837%203.88214%202.82495%203.68688%203.02021L2.04043%204.66666L3.68688%206.3131C3.88214%206.50837%203.88214%206.82495%203.68688%207.02021C3.49162%207.21547%203.17504%207.21547%202.97977%207.02021L0.979775%205.02021C0.784513%204.82495%200.784513%204.50837%200.979775%204.3131L2.97977%202.3131C3.17504%202.11784%203.49162%202.11784%203.68688%202.3131Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M12.3131%208.97977C12.5084%208.78451%2012.825%208.78451%2013.0202%208.97977L15.0202%2010.9798C15.2155%2011.175%2015.2155%2011.4916%2015.0202%2011.6869L13.0202%2013.6869C12.825%2013.8821%2012.5084%2013.8821%2012.3131%2013.6869C12.1178%2013.4916%2012.1178%2013.175%2012.3131%2012.9798L13.9596%2011.3333L12.3131%209.68688C12.1178%209.49161%2012.1178%209.17503%2012.3131%208.97977Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M0.833328%204.66666C0.833328%204.39051%201.05719%204.16666%201.33333%204.16666H14.6667C14.9428%204.16666%2015.1667%204.39051%2015.1667%204.66666C15.1667%204.9428%2014.9428%205.16666%2014.6667%205.16666H1.33333C1.05719%205.16666%200.833328%204.9428%200.833328%204.66666Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M0.833328%2011.3333C0.833328%2011.0572%201.05719%2010.8333%201.33333%2010.8333H14.6667C14.9428%2010.8333%2015.1667%2011.0572%2015.1667%2011.3333C15.1667%2011.6095%2014.9428%2011.8333%2014.6667%2011.8333H1.33333C1.05719%2011.8333%200.833328%2011.6095%200.833328%2011.3333Z'%20fill='%237E7E7E'/%3e%3c/svg%3e",Fn={key:0},jn=[n.createElementVNode("img",{src:tt,alt:"swap",class:"w-4"},null,-1)],Hn=[n.createElementVNode("img",{src:tt,alt:"swap",class:"w-4"},null,-1)],zn={__name:"SwapBtn",props:{isBidirect:{type:Boolean,default:!1}},emits:["swap"],setup(e,{emit:l}){const t=l;return(o,s)=>e.isBidirect?(n.openBlock(),n.createElementBlock("button",{key:1,onClick:s[0]||(s[0]=a=>t("swap"))},Hn)):(n.openBlock(),n.createElementBlock("button",Fn,jn))}};var nt=!1;function pe(e,l,t){return Array.isArray(e)?(e.length=Math.max(e.length,l),e.splice(l,1,t),t):(e[l]=t,t)}function ke(e,l){if(Array.isArray(e)){e.splice(l,1);return}delete e[l]}function Un(){return ot().__VUE_DEVTOOLS_GLOBAL_HOOK__}function ot(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Zn=typeof Proxy=="function",Wn="devtools-plugin:setup",Gn="plugin:settings:set";let ee,Ve;function qn(){var e;return ee!==void 0||(typeof window<"u"&&window.performance?(ee=!0,Ve=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(ee=!0,Ve=globalThis.perf_hooks.performance):ee=!1),ee}function Jn(){return qn()?Ve.now():Date.now()}class Kn{constructor(l,t){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=l,this.hook=t;const o={};if(l.settings)for(const i in l.settings){const r=l.settings[i];o[i]=r.defaultValue}const s=`__vue-devtools-plugin-settings__${l.id}`;let a=Object.assign({},o);try{const i=localStorage.getItem(s),r=JSON.parse(i);Object.assign(a,r)}catch{}this.fallbacks={getSettings(){return a},setSettings(i){try{localStorage.setItem(s,JSON.stringify(i))}catch{}a=i},now(){return Jn()}},t&&t.on(Gn,(i,r)=>{i===this.plugin.id&&this.fallbacks.setSettings(r)}),this.proxiedOn=new Proxy({},{get:(i,r)=>this.target?this.target.on[r]:(...c)=>{this.onQueue.push({method:r,args:c})}}),this.proxiedTarget=new Proxy({},{get:(i,r)=>this.target?this.target[r]:r==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(r)?(...c)=>(this.targetQueue.push({method:r,args:c,resolve:()=>{}}),this.fallbacks[r](...c)):(...c)=>new Promise(u=>{this.targetQueue.push({method:r,args:c,resolve:u})})})}async setRealTarget(l){this.target=l;for(const t of this.onQueue)this.target.on[t.method](...t.args);for(const t of this.targetQueue)t.resolve(await this.target[t.method](...t.args))}}function lt(e,l){const t=e,o=ot(),s=Un(),a=Zn&&t.enableEarlyProxy;if(s&&(o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!a))s.emit(Wn,e,l);else{const i=a?new Kn(t,s):null;(o.__VUE_DEVTOOLS_PLUGINS__=o.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:t,setupFn:l,proxy:i}),i&&l(i.proxiedTarget)}}/*!
|
|
7
|
+
`));let x=Ue((i=m.props)!=null?i:{},c,p),h=n.cloneVNode(m,x,!0);for(let g in x)g.startsWith("on")&&(h.props||(h.props={}),h.props[g]=x[g]);return h}return Array.isArray(u)&&u.length===1?u[0]:u}return n.h(r,Object.assign({},c,p),{default:()=>u})}function ze(e){return e.flatMap(l=>l.type===n.Fragment?ze(l.children):[l])}function Ue(...e){if(e.length===0)return{};if(e.length===1)return e[0];let l={},t={};for(let o of e)for(let s in o)s.startsWith("on")&&typeof o[s]=="function"?(t[s]!=null||(t[s]=[]),t[s].push(o[s])):l[s]=o[s];if(l.disabled||l["aria-disabled"])return Object.assign(l,Object.fromEntries(Object.keys(t).map(o=>[o,void 0])));for(let o in t)Object.assign(l,{[o](s,...a){let i=t[o];for(let r of i){if(s instanceof Event&&s.defaultPrevented)return;r(s,...a)}}});return l}function xn(e){let l=Object.assign({},e);for(let t in l)l[t]===void 0&&delete l[t];return l}function fe(e,l=[]){let t=Object.assign({},e);for(let o of l)o in t&&delete t[o];return t}function yn(e){return e==null?!1:typeof e.type=="string"||typeof e.type=="object"||typeof e.type=="function"}var Ze=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Ze||{});let wn=n.defineComponent({name:"Hidden",props:{as:{type:[Object,String],default:"div"},features:{type:Number,default:1}},setup(e,{slots:l,attrs:t}){return()=>{var o;let{features:s,...a}=e,i={"aria-hidden":(s&2)===2?!0:(o=a["aria-hidden"])!=null?o:void 0,hidden:(s&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",...(s&4)===4&&(s&2)!==2&&{display:"none"}}};return q({ourProps:i,theirProps:a,slot:{},attrs:t,slots:l,name:"Hidden"})}}}),We=Symbol("Context");var re=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(re||{});function En(){return n.inject(We,null)}function Sn(e){n.provide(We,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||{}),Ge=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Ge||{});function On(e){function l(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",l))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",l),l())}let J=[];On(()=>{function e(l){l.target instanceof HTMLElement&&l.target!==document.body&&J[0]!==l.target&&(J.unshift(l.target),J=J.filter(t=>t!=null&&t.isConnected),J.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 kn(e){throw new Error("Unexpected object: "+e)}var M=(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))(M||{});function qe(e,l){let t=l.resolveItems();if(t.length<=0)return null;let o=l.resolveActiveIndex(),s=o??-1;switch(e.focus){case 0:{for(let a=0;a<t.length;++a)if(!l.resolveDisabled(t[a],a,t))return a;return o}case 1:{s===-1&&(s=t.length);for(let a=s-1;a>=0;--a)if(!l.resolveDisabled(t[a],a,t))return a;return o}case 2:{for(let a=s+1;a<t.length;++a)if(!l.resolveDisabled(t[a],a,t))return a;return o}case 3:{for(let a=t.length-1;a>=0;--a)if(!l.resolveDisabled(t[a],a,t))return a;return o}case 4:{for(let a=0;a<t.length;++a)if(l.resolveId(t[a],a,t)===e.id)return a;return o}case 5:return null;default:kn(e)}}function Je(e={},l=null,t=[]){for(let[o,s]of Object.entries(e))Ye(t,Ke(l,o),s);return t}function Ke(e,l){return e?e+"["+l+"]":l}function Ye(e,l,t){if(Array.isArray(t))for(let[o,s]of t.entries())Ye(e,Ke(l,o.toString()),s);else t instanceof Date?e.push([l,t.toISOString()]):typeof t=="boolean"?e.push([l,t?"1":"0"]):typeof t=="string"?e.push([l,t]):typeof t=="number"?e.push([l,`${t}`]):t==null?e.push([l,""]):Je(t,l,e)}function $n(e,l){return e===l}var Vn=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Vn||{}),Tn=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Tn||{}),Nn=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(Nn||{});let Qe=Symbol("ComboboxContext");function K(e){let l=n.inject(Qe,null);if(l===null){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,K),t}return l}let Xe=Symbol("VirtualContext"),In=n.defineComponent({name:"VirtualProvider",setup(e,{slots:l}){let t=K("VirtualProvider"),o=n.computed(()=>{let r=k(t.optionsRef);if(!r)return{start:0,end:0};let c=window.getComputedStyle(r);return{start:parseFloat(c.paddingBlockStart||c.paddingTop),end:parseFloat(c.paddingBlockEnd||c.paddingBottom)}}),s=Kt(n.computed(()=>({scrollPaddingStart:o.value.start,scrollPaddingEnd:o.value.end,count:t.virtual.value.options.length,estimateSize(){return 40},getScrollElement(){return k(t.optionsRef)},overscan:12}))),a=n.computed(()=>{var r;return(r=t.virtual.value)==null?void 0:r.options}),i=n.ref(0);return n.watch([a],()=>{i.value+=1}),n.provide(Xe,t.virtual.value?s:null),()=>[n.h("div",{style:{position:"relative",width:"100%",height:`${s.value.getTotalSize()}px`},ref:r=>{if(r){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||t.activationTrigger.value===0)return;t.activeOptionIndex.value!==null&&t.virtual.value.options.length>t.activeOptionIndex.value&&s.value.scrollToIndex(t.activeOptionIndex.value)}}},s.value.getVirtualItems().map(r=>n.cloneVNode(l.default({option:t.virtual.value.options[r.index],open:t.comboboxState.value===0})[0],{key:`${i.value}-${r.index}`,"data-index":r.index,"aria-setsize":t.virtual.value.options.length,"aria-posinset":r.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${r.start}px)`,overflowAnchor:"none"}})))]}}),Bn=n.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:l,attrs:t,emit:o}){let s=n.ref(1),a=n.ref(null),i=n.ref(null),r=n.ref(null),c=n.ref(null),u=n.ref({static:!1,hold:!1}),p=n.ref([]),m=n.ref(null),b=n.ref(2),x=n.ref(!1);function h(d=f=>f){let f=m.value!==null?p.value[m.value]:null,y=d(p.value.slice()),w=y.length>0&&y[0].dataRef.order.value!==null?y.sort((N,F)=>N.dataRef.order.value-F.dataRef.order.value):fn(y,N=>k(N.dataRef.domRef)),V=f?w.indexOf(f):null;return V===-1&&(V=null),{options:w,activeOptionIndex:V}}let g=n.computed(()=>e.multiple?1:0),$=n.computed(()=>e.nullable),[I,E]=Yt(n.computed(()=>e.modelValue),d=>o("update:modelValue",d),n.computed(()=>e.defaultValue)),T=n.computed(()=>I.value===void 0?U(g.value,{1:[],0:void 0}):I.value),B=null,_=null;function O(d){return U(g.value,{0(){return E==null?void 0:E(d)},1:()=>{let f=n.toRaw(v.value.value).slice(),y=n.toRaw(d),w=f.findIndex(V=>v.compare(y,n.toRaw(V)));return w===-1?f.push(y):f.splice(w,1),E==null?void 0:E(f)}})}let C=n.computed(()=>{});n.watch([C],([d],[f])=>{if(v.virtual.value&&d&&f&&m.value!==null){let y=d.indexOf(f[m.value]);y!==-1?m.value=y:m.value=null}});let v={comboboxState:s,value:T,mode:g,compare(d,f){if(typeof e.by=="string"){let y=e.by;return(d==null?void 0:d[y])===(f==null?void 0:f[y])}return e.by===null?$n(d,f):e.by(d,f)},calculateIndex(d){return v.virtual.value?e.by===null?v.virtual.value.options.indexOf(d):v.virtual.value.options.findIndex(f=>v.compare(f,d)):p.value.findIndex(f=>v.compare(f.dataRef.value,d))},defaultValue:n.computed(()=>e.defaultValue),nullable:$,immediate:n.computed(()=>!1),virtual:n.computed(()=>null),inputRef:i,labelRef:a,buttonRef:r,optionsRef:c,disabled:n.computed(()=>e.disabled),options:p,change(d){E(d)},activeOptionIndex:n.computed(()=>{if(x.value&&m.value===null&&(v.virtual.value?v.virtual.value.options.length>0:p.value.length>0)){if(v.virtual.value){let f=v.virtual.value.options.findIndex(y=>{var w;return!((w=v.virtual.value)!=null&&w.disabled(y))});if(f!==-1)return f}let d=p.value.findIndex(f=>!f.dataRef.disabled);if(d!==-1)return d}return m.value}),activationTrigger:b,optionsPropsRef:u,closeCombobox(){x.value=!1,!e.disabled&&s.value!==1&&(s.value=1,m.value=null)},openCombobox(){if(x.value=!0,!e.disabled&&s.value!==0){if(v.value.value){let d=v.calculateIndex(v.value.value);d!==-1&&(m.value=d)}s.value=0}},setActivationTrigger(d){b.value=d},goToOption(d,f,y){x.value=!1,B!==null&&cancelAnimationFrame(B),B=requestAnimationFrame(()=>{if(e.disabled||c.value&&!u.value.static&&s.value===1)return;if(v.virtual.value){m.value=d===M.Specific?f:qe({focus:d},{resolveItems:()=>v.virtual.value.options,resolveActiveIndex:()=>{var N,F;return(F=(N=v.activeOptionIndex.value)!=null?N:v.virtual.value.options.findIndex(j=>{var R;return!((R=v.virtual.value)!=null&&R.disabled(j))}))!=null?F:null},resolveDisabled:N=>v.virtual.value.disabled(N),resolveId(){throw new Error("Function not implemented.")}}),b.value=y??2;return}let w=h();if(w.activeOptionIndex===null){let N=w.options.findIndex(F=>!F.dataRef.disabled);N!==-1&&(w.activeOptionIndex=N)}let V=d===M.Specific?f:qe({focus:d},{resolveItems:()=>w.options,resolveActiveIndex:()=>w.activeOptionIndex,resolveId:N=>N.id,resolveDisabled:N=>N.dataRef.disabled});m.value=V,b.value=y??2,p.value=w.options})},selectOption(d){let f=p.value.find(w=>w.id===d);if(!f)return;let{dataRef:y}=f;O(y.value)},selectActiveOption(){if(v.activeOptionIndex.value!==null){if(v.virtual.value)O(v.virtual.value.options[v.activeOptionIndex.value]);else{let{dataRef:d}=p.value[v.activeOptionIndex.value];O(d.value)}v.goToOption(M.Specific,v.activeOptionIndex.value)}},registerOption(d,f){let y=n.reactive({id:d,dataRef:f});if(v.virtual.value){p.value.push(y);return}_&&cancelAnimationFrame(_);let w=h(V=>(V.push(y),V));m.value===null&&v.isSelected(f.value.value)&&(w.activeOptionIndex=w.options.indexOf(y)),p.value=w.options,m.value=w.activeOptionIndex,b.value=2,w.options.some(V=>!k(V.dataRef.domRef))&&(_=requestAnimationFrame(()=>{let V=h();p.value=V.options,m.value=V.activeOptionIndex}))},unregisterOption(d,f){if(B!==null&&cancelAnimationFrame(B),f&&(x.value=!0),v.virtual.value){p.value=p.value.filter(w=>w.id!==d);return}let y=h(w=>{let V=w.findIndex(N=>N.id===d);return V!==-1&&w.splice(V,1),w});p.value=y.options,m.value=y.activeOptionIndex,b.value=2},isSelected(d){return U(g.value,{0:()=>v.compare(n.toRaw(v.value.value),n.toRaw(d)),1:()=>n.toRaw(v.value.value).some(f=>v.compare(n.toRaw(f),n.toRaw(d)))})},isActive(d){return m.value===v.calculateIndex(d)}};gn([i,r,c],()=>v.closeCombobox(),n.computed(()=>s.value===0)),n.provide(Qe,v),Sn(n.computed(()=>U(s.value,{0:re.Open,1:re.Closed})));let S=n.computed(()=>{var d;return(d=k(i))==null?void 0:d.closest("form")});return n.onMounted(()=>{n.watch([S],()=>{if(!S.value||e.defaultValue===void 0)return;function d(){v.change(e.defaultValue)}return S.value.addEventListener("reset",d),()=>{var f;(f=S.value)==null||f.removeEventListener("reset",d)}},{immediate:!0})}),()=>{var d,f,y;let{name:w,disabled:V,form:N,...F}=e,j={open:s.value===0,disabled:V,activeIndex:v.activeOptionIndex.value,activeOption:v.activeOptionIndex.value===null?null:v.virtual.value?v.virtual.value.options[(d=v.activeOptionIndex.value)!=null?d:0]:(y=(f=v.options.value[v.activeOptionIndex.value])==null?void 0:f.dataRef.value)!=null?y:null,value:T.value};return n.h(n.Fragment,[...w!=null&&T.value!=null?Je({[w]:T.value}).map(([R,es])=>n.h(wn,xn({features:Ze.Hidden,key:R,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:N,disabled:V,name:R,value:es}))):[],q({theirProps:{...t,...fe(F,["by","defaultValue","immediate","modelValue","multiple","nullable","onUpdate:modelValue","virtual"])},ourProps:{},slot:j,slots:l,attrs:t,name:"Combobox"})])}}});n.defineComponent({name:"ComboboxLabel",props:{as:{type:[Object,String],default:"label"},id:{type:String,default:null}},setup(e,{attrs:l,slots:t}){var o;let s=(o=e.id)!=null?o:`headlessui-combobox-label-${le()}`,a=K("ComboboxLabel");function i(){var r;(r=k(a.inputRef))==null||r.focus({preventScroll:!0})}return()=>{let r={open:a.comboboxState.value===0,disabled:a.disabled.value},{...c}=e,u={id:s,ref:a.labelRef,onClick:i};return q({ourProps:u,theirProps:c,slot:r,attrs:l,slots:t,name:"ComboboxLabel"})}}});let Ln=n.defineComponent({name:"ComboboxButton",props:{as:{type:[Object,String],default:"button"},id:{type:String,default:null}},setup(e,{attrs:l,slots:t,expose:o}){var s;let a=(s=e.id)!=null?s:`headlessui-combobox-button-${le()}`,i=K("ComboboxButton");o({el:i.buttonRef,$el:i.buttonRef});function r(p){i.disabled.value||(i.comboboxState.value===0?i.closeCombobox():(p.preventDefault(),i.openCombobox()),n.nextTick(()=>{var m;return(m=k(i.inputRef))==null?void 0:m.focus({preventScroll:!0})}))}function c(p){switch(p.key){case D.ArrowDown:p.preventDefault(),p.stopPropagation(),i.comboboxState.value===1&&i.openCombobox(),n.nextTick(()=>{var m;return(m=i.inputRef.value)==null?void 0:m.focus({preventScroll:!0})});return;case D.ArrowUp:p.preventDefault(),p.stopPropagation(),i.comboboxState.value===1&&(i.openCombobox(),n.nextTick(()=>{i.value.value||i.goToOption(M.Last)})),n.nextTick(()=>{var m;return(m=i.inputRef.value)==null?void 0:m.focus({preventScroll:!0})});return;case D.Escape:if(i.comboboxState.value!==0)return;p.preventDefault(),i.optionsRef.value&&!i.optionsPropsRef.value.static&&p.stopPropagation(),i.closeCombobox(),n.nextTick(()=>{var m;return(m=i.inputRef.value)==null?void 0:m.focus({preventScroll:!0})});return}}let u=bn(n.computed(()=>({as:e.as,type:l.type})),i.buttonRef);return()=>{var p,m;let b={open:i.comboboxState.value===0,disabled:i.disabled.value,value:i.value.value},{...x}=e,h={ref:i.buttonRef,id:a,type:u.value,tabindex:"-1","aria-haspopup":"listbox","aria-controls":(p=k(i.optionsRef))==null?void 0:p.id,"aria-expanded":i.comboboxState.value===0,"aria-labelledby":i.labelRef.value?[(m=k(i.labelRef))==null?void 0:m.id,a].join(" "):void 0,disabled:i.disabled.value===!0?!0:void 0,onKeydown:c,onClick:r};return q({ourProps:h,theirProps:x,slot:b,attrs:l,slots:t,name:"ComboboxButton"})}}}),Rn=n.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:l,attrs:t,slots:o,expose:s}){var a;let i=(a=e.id)!=null?a:`headlessui-combobox-input-${le()}`,r=K("ComboboxInput"),c=n.computed(()=>Oe(k(r.inputRef))),u={value:!1};s({el:r.inputRef,$el:r.inputRef});function p(){r.change(null);let _=k(r.optionsRef);_&&(_.scrollTop=0),r.goToOption(M.Nothing)}let m=n.computed(()=>{var _;let O=r.value.value;return k(r.inputRef)?typeof e.displayValue<"u"&&O!==void 0?(_=e.displayValue(O))!=null?_:"":typeof O=="string"?O:"":""});n.onMounted(()=>{n.watch([m,r.comboboxState,c],([_,O],[C,v])=>{if(u.value)return;let S=k(r.inputRef);S&&((v===0&&O===1||_!==C)&&(S.value=_),requestAnimationFrame(()=>{var d;if(u.value||!S||((d=c.value)==null?void 0:d.activeElement)!==S)return;let{selectionStart:f,selectionEnd:y}=S;Math.abs((y??0)-(f??0))===0&&f===0&&S.setSelectionRange(S.value.length,S.value.length)}))},{immediate:!0}),n.watch([r.comboboxState],([_],[O])=>{if(_===0&&O===1){if(u.value)return;let C=k(r.inputRef);if(!C)return;let v=C.value,{selectionStart:S,selectionEnd:d,selectionDirection:f}=C;C.value="",C.value=v,f!==null?C.setSelectionRange(S,d,f):C.setSelectionRange(S,d)}})});let b=n.ref(!1);function x(){b.value=!0}function h(){ue().nextFrame(()=>{b.value=!1})}let g=en();function $(_){switch(u.value=!0,g(()=>{u.value=!1}),_.key){case D.Enter:if(u.value=!1,r.comboboxState.value!==0||b.value)return;if(_.preventDefault(),_.stopPropagation(),r.activeOptionIndex.value===null){r.closeCombobox();return}r.selectActiveOption(),r.mode.value===0&&r.closeCombobox();break;case D.ArrowDown:return u.value=!1,_.preventDefault(),_.stopPropagation(),U(r.comboboxState.value,{0:()=>r.goToOption(M.Next),1:()=>r.openCombobox()});case D.ArrowUp:return u.value=!1,_.preventDefault(),_.stopPropagation(),U(r.comboboxState.value,{0:()=>r.goToOption(M.Previous),1:()=>{r.openCombobox(),n.nextTick(()=>{r.value.value||r.goToOption(M.Last)})}});case D.Home:if(_.shiftKey)break;return u.value=!1,_.preventDefault(),_.stopPropagation(),r.goToOption(M.First);case D.PageUp:return u.value=!1,_.preventDefault(),_.stopPropagation(),r.goToOption(M.First);case D.End:if(_.shiftKey)break;return u.value=!1,_.preventDefault(),_.stopPropagation(),r.goToOption(M.Last);case D.PageDown:return u.value=!1,_.preventDefault(),_.stopPropagation(),r.goToOption(M.Last);case D.Escape:if(u.value=!1,r.comboboxState.value!==0)return;_.preventDefault(),r.optionsRef.value&&!r.optionsPropsRef.value.static&&_.stopPropagation(),r.nullable.value&&r.mode.value===0&&r.value.value===null&&p(),r.closeCombobox();break;case D.Tab:if(u.value=!1,r.comboboxState.value!==0)return;r.mode.value===0&&r.activationTrigger.value!==1&&r.selectActiveOption(),r.closeCombobox();break}}function I(_){l("change",_),r.nullable.value&&r.mode.value===0&&_.target.value===""&&p(),r.openCombobox()}function E(_){var O,C,v;let S=(O=_.relatedTarget)!=null?O:J.find(d=>d!==_.currentTarget);if(u.value=!1,!((C=k(r.optionsRef))!=null&&C.contains(S))&&!((v=k(r.buttonRef))!=null&&v.contains(S))&&r.comboboxState.value===0)return _.preventDefault(),r.mode.value===0&&(r.nullable.value&&r.value.value===null?p():r.activationTrigger.value!==1&&r.selectActiveOption()),r.closeCombobox()}function T(_){var O,C,v;let S=(O=_.relatedTarget)!=null?O:J.find(d=>d!==_.currentTarget);(C=k(r.buttonRef))!=null&&C.contains(S)||(v=k(r.optionsRef))!=null&&v.contains(S)||r.disabled.value||r.immediate.value&&r.comboboxState.value!==0&&(r.openCombobox(),ue().nextFrame(()=>{r.setActivationTrigger(1)}))}let B=n.computed(()=>{var _,O,C,v;return(v=(C=(O=e.defaultValue)!=null?O:r.defaultValue.value!==void 0?(_=e.displayValue)==null?void 0:_.call(e,r.defaultValue.value):null)!=null?C:r.defaultValue.value)!=null?v:""});return()=>{var _,O,C,v,S,d,f;let y={open:r.comboboxState.value===0},{displayValue:w,onChange:V,...N}=e,F={"aria-controls":(_=r.optionsRef.value)==null?void 0:_.id,"aria-expanded":r.comboboxState.value===0,"aria-activedescendant":r.activeOptionIndex.value===null?void 0:r.virtual.value?(O=r.options.value.find(j=>!r.virtual.value.disabled(j.dataRef.value)&&r.compare(j.dataRef.value,r.virtual.value.options[r.activeOptionIndex.value])))==null?void 0:O.id:(C=r.options.value[r.activeOptionIndex.value])==null?void 0:C.id,"aria-labelledby":(d=(v=k(r.labelRef))==null?void 0:v.id)!=null?d:(S=k(r.buttonRef))==null?void 0:S.id,"aria-autocomplete":"list",id:i,onCompositionstart:x,onCompositionend:h,onKeydown:$,onInput:I,onFocus:T,onBlur:E,role:"combobox",type:(f=t.type)!=null?f:"text",tabIndex:0,ref:r.inputRef,defaultValue:B.value,disabled:r.disabled.value===!0?!0:void 0};return q({ourProps:F,theirProps:N,slot:y,attrs:t,slots:o,features:se.RenderStrategy|se.Static,name:"ComboboxInput"})}}}),Mn=n.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:l,slots:t,expose:o}){let s=K("ComboboxOptions"),a=`headlessui-combobox-options-${le()}`;o({el:s.optionsRef,$el:s.optionsRef}),n.watchEffect(()=>{s.optionsPropsRef.value.static=e.static}),n.watchEffect(()=>{s.optionsPropsRef.value.hold=e.hold});let i=En(),r=n.computed(()=>i!==null?(i.value&re.Open)===re.Open:s.comboboxState.value===0);Cn({container:n.computed(()=>k(s.optionsRef)),enabled:n.computed(()=>s.comboboxState.value===0),accept(u){return u.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:u.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(u){u.setAttribute("role","none")}});function c(u){u.preventDefault()}return()=>{var u,p,m;let b={open:s.comboboxState.value===0},x={"aria-labelledby":(m=(u=k(s.labelRef))==null?void 0:u.id)!=null?m:(p=k(s.buttonRef))==null?void 0:p.id,id:a,ref:s.optionsRef,role:"listbox","aria-multiselectable":s.mode.value===1?!0:void 0,onMousedown:c},h=fe(e,["hold"]);return q({ourProps:x,theirProps:h,slot:b,attrs:l,slots:s.virtual.value&&s.comboboxState.value===0?{...t,default:()=>[n.h(In,{},t.default)]}:t,features:se.RenderStrategy|se.Static,visible:r.value,name:"ComboboxOptions"})}}}),Pn=n.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:l,attrs:t,expose:o}){let s=K("ComboboxOption"),a=`headlessui-combobox-option-${le()}`,i=n.ref(null),r=n.computed(()=>e.disabled);o({el:i,$el:i});let c=n.computed(()=>{var E;return s.virtual.value?s.activeOptionIndex.value===s.calculateIndex(e.value):s.activeOptionIndex.value===null?!1:((E=s.options.value[s.activeOptionIndex.value])==null?void 0:E.id)===a}),u=n.computed(()=>s.isSelected(e.value)),p=n.inject(Xe,null),m=n.computed(()=>({disabled:e.disabled,value:e.value,domRef:i,order:n.computed(()=>e.order)}));n.onMounted(()=>s.registerOption(a,m)),n.onUnmounted(()=>s.unregisterOption(a,c.value)),n.watchEffect(()=>{let E=k(i);E&&(p==null||p.value.measureElement(E))}),n.watchEffect(()=>{s.comboboxState.value===0&&c.value&&(s.virtual.value||s.activationTrigger.value!==0&&n.nextTick(()=>{var E,T;return(T=(E=k(i))==null?void 0:E.scrollIntoView)==null?void 0:T.call(E,{block:"nearest"})}))});function b(E){E.preventDefault(),E.button===Ge.Left&&(r.value||(s.selectOption(a),Fe()||requestAnimationFrame(()=>{var T;return(T=k(s.inputRef))==null?void 0:T.focus({preventScroll:!0})}),s.mode.value===0&&s.closeCombobox()))}function x(){var E;if(e.disabled||(E=s.virtual.value)!=null&&E.disabled(e.value))return s.goToOption(M.Nothing);let T=s.calculateIndex(e.value);s.goToOption(M.Specific,T)}let h=vn();function g(E){h.update(E)}function $(E){var T;if(!h.wasMoved(E)||e.disabled||(T=s.virtual.value)!=null&&T.disabled(e.value)||c.value)return;let B=s.calculateIndex(e.value);s.goToOption(M.Specific,B,0)}function I(E){var T;h.wasMoved(E)&&(e.disabled||(T=s.virtual.value)!=null&&T.disabled(e.value)||c.value&&(s.optionsPropsRef.value.hold||s.goToOption(M.Nothing)))}return()=>{let{disabled:E}=e,T={active:c.value,selected:u.value,disabled:E},B={id:a,ref:i,role:"option",tabIndex:E===!0?void 0:-1,"aria-disabled":E===!0?!0:void 0,"aria-selected":u.value,disabled:void 0,onMousedown:b,onFocus:x,onPointerenter:g,onMouseenter:g,onPointermove:$,onMousemove:$,onPointerleave:I,onMouseleave:I},_=fe(e,["order","value"]);return q({ourProps:B,theirProps:_,slot:T,attrs:t,slots:l,name:"ComboboxOption"})}}});function Dn(e,l){return n.openBlock(),n.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[n.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 An(e,l){return n.openBlock(),n.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[n.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 Fn(e,l){return n.openBlock(),n.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[n.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"})])}const et={__name:"Select",props:n.mergeModels({languages:{type:Object,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=n.useModel(e,"modelValue"),o=n.ref(""),s=n.ref(null),a=n.computed(()=>Object.entries(l.languages).filter(([,r])=>r.toLowerCase().includes(o.value.toLowerCase()))),i=r=>{r.target.value="",o.value="",s.value&&s.value.$el.click()};return(r,c)=>(n.openBlock(),n.createBlock(n.unref(Bn),{modelValue:t.value,"onUpdate:modelValue":c[3]||(c[3]=u=>t.value=u),as:"div",class:"relative mt-1"},{default:n.withCtx(()=>[n.createVNode(n.unref(Rn),{class:"w-full bg-white border border-gray-300 rounded py-2.5 pl-3 pr-10 text-sm text-gray-800 font-medium focus:outline-none focus:ring-0.5 focus:ring-gray-400 focus:border-gray-400",onChange:c[0]||(c[0]=u=>o.value=u.target.value),displayValue:u=>e.languages[u],onFocus:c[1]||(c[1]=u=>i(u))},null,8,["displayValue"]),n.createVNode(n.unref(Ln),{ref_key:"btnSelect",ref:s,class:"absolute inset-y-0 right-0 flex items-center pr-2"},{default:n.withCtx(()=>[n.createVNode(n.unref(An),{class:"h-5 w-5 text-gray-400","aria-hidden":"true",onClick:c[2]||(c[2]=u=>i(u))})]),_:1},512),n.createVNode(n.unref(Mn),{class:"absolute mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm z-50"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value,([u,p])=>(n.openBlock(),n.createBlock(n.unref(Pn),{key:u,value:u},{default:n.withCtx(({active:m,selected:b})=>[n.createElementVNode("li",{class:n.normalizeClass(["relative cursor-default select-none py-2 pl-3 pr-9",m?"bg-[#3B5695] text-white":"text-textCustom"])},[n.createElementVNode("span",{class:n.normalizeClass(["block truncate",b&&"font-semibold"])},n.toDisplayString(p),3)],2)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"]))}},tt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.68688%202.3131C3.88214%202.50837%203.88214%202.82495%203.68688%203.02021L2.04043%204.66666L3.68688%206.3131C3.88214%206.50837%203.88214%206.82495%203.68688%207.02021C3.49162%207.21547%203.17504%207.21547%202.97977%207.02021L0.979775%205.02021C0.784513%204.82495%200.784513%204.50837%200.979775%204.3131L2.97977%202.3131C3.17504%202.11784%203.49162%202.11784%203.68688%202.3131Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M12.3131%208.97977C12.5084%208.78451%2012.825%208.78451%2013.0202%208.97977L15.0202%2010.9798C15.2155%2011.175%2015.2155%2011.4916%2015.0202%2011.6869L13.0202%2013.6869C12.825%2013.8821%2012.5084%2013.8821%2012.3131%2013.6869C12.1178%2013.4916%2012.1178%2013.175%2012.3131%2012.9798L13.9596%2011.3333L12.3131%209.68688C12.1178%209.49161%2012.1178%209.17503%2012.3131%208.97977Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M0.833328%204.66666C0.833328%204.39051%201.05719%204.16666%201.33333%204.16666H14.6667C14.9428%204.16666%2015.1667%204.39051%2015.1667%204.66666C15.1667%204.9428%2014.9428%205.16666%2014.6667%205.16666H1.33333C1.05719%205.16666%200.833328%204.9428%200.833328%204.66666Z'%20fill='%237E7E7E'/%3e%3cpath%20d='M0.833328%2011.3333C0.833328%2011.0572%201.05719%2010.8333%201.33333%2010.8333H14.6667C14.9428%2010.8333%2015.1667%2011.0572%2015.1667%2011.3333C15.1667%2011.6095%2014.9428%2011.8333%2014.6667%2011.8333H1.33333C1.05719%2011.8333%200.833328%2011.6095%200.833328%2011.3333Z'%20fill='%237E7E7E'/%3e%3c/svg%3e",jn={key:0},Hn=[n.createElementVNode("img",{src:tt,alt:"swap",class:"w-4"},null,-1)],zn=[n.createElementVNode("img",{src:tt,alt:"swap",class:"w-4"},null,-1)],Un={__name:"SwapBtn",props:{isBidirect:{type:Boolean,default:!1}},emits:["swap"],setup(e,{emit:l}){const t=l;return(o,s)=>e.isBidirect?(n.openBlock(),n.createElementBlock("button",{key:1,onClick:s[0]||(s[0]=a=>t("swap"))},zn)):(n.openBlock(),n.createElementBlock("button",jn,Hn))}};var nt=!1;function pe(e,l,t){return Array.isArray(e)?(e.length=Math.max(e.length,l),e.splice(l,1,t),t):(e[l]=t,t)}function $e(e,l){if(Array.isArray(e)){e.splice(l,1);return}delete e[l]}function Zn(){return ot().__VUE_DEVTOOLS_GLOBAL_HOOK__}function ot(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Wn=typeof Proxy=="function",Gn="devtools-plugin:setup",qn="plugin:settings:set";let ee,Ve;function Jn(){var e;return ee!==void 0||(typeof window<"u"&&window.performance?(ee=!0,Ve=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(ee=!0,Ve=globalThis.perf_hooks.performance):ee=!1),ee}function Kn(){return Jn()?Ve.now():Date.now()}class Yn{constructor(l,t){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=l,this.hook=t;const o={};if(l.settings)for(const i in l.settings){const r=l.settings[i];o[i]=r.defaultValue}const s=`__vue-devtools-plugin-settings__${l.id}`;let a=Object.assign({},o);try{const i=localStorage.getItem(s),r=JSON.parse(i);Object.assign(a,r)}catch{}this.fallbacks={getSettings(){return a},setSettings(i){try{localStorage.setItem(s,JSON.stringify(i))}catch{}a=i},now(){return Kn()}},t&&t.on(qn,(i,r)=>{i===this.plugin.id&&this.fallbacks.setSettings(r)}),this.proxiedOn=new Proxy({},{get:(i,r)=>this.target?this.target.on[r]:(...c)=>{this.onQueue.push({method:r,args:c})}}),this.proxiedTarget=new Proxy({},{get:(i,r)=>this.target?this.target[r]:r==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(r)?(...c)=>(this.targetQueue.push({method:r,args:c,resolve:()=>{}}),this.fallbacks[r](...c)):(...c)=>new Promise(u=>{this.targetQueue.push({method:r,args:c,resolve:u})})})}async setRealTarget(l){this.target=l;for(const t of this.onQueue)this.target.on[t.method](...t.args);for(const t of this.targetQueue)t.resolve(await this.target[t.method](...t.args))}}function lt(e,l){const t=e,o=ot(),s=Zn(),a=Wn&&t.enableEarlyProxy;if(s&&(o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!a))s.emit(Gn,e,l);else{const i=a?new Yn(t,s):null;(o.__VUE_DEVTOOLS_PLUGINS__=o.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:t,setupFn:l,proxy:i}),i&&l(i.proxiedTarget)}}/*!
|
|
8
8
|
* pinia v2.1.7
|
|
9
9
|
* (c) 2023 Eduardo San Martin Morote
|
|
10
10
|
* @license MIT
|
|
11
|
-
*/let ae;const ie=e=>ae=e,st=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function Y(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var z;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(z||(z={}));const me=typeof window<"u",ce=(process.env.NODE_ENV!=="production"||!1)&&process.env.NODE_ENV!=="test"&&me,rt=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 ae;const ie=e=>ae=e,st=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function Y(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var z;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(z||(z={}));const me=typeof window<"u",ce=(process.env.NODE_ENV!=="production"||!1)&&process.env.NODE_ENV!=="test"&&me,rt=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 Qn(e,{autoBom:l=!1}={}){return l&&/^\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 Te(e,l,t){const o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){ct(o.response,l,t)},o.onerror=function(){console.error("could not download file")},o.send()}function at(e){const l=new XMLHttpRequest;l.open("HEAD",e,!1);try{l.send()}catch{}return l.status>=200&&l.status<=299}function he(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{const t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}const ge=typeof navigator=="object"?navigator:{userAgent:""},it=/Macintosh/.test(ge.userAgent)&&/AppleWebKit/.test(ge.userAgent)&&!/Safari/.test(ge.userAgent),ct=me?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!it?Xn:"msSaveOrOpenBlob"in ge?eo:to:()=>{};function Xn(e,l="download",t){const o=document.createElement("a");o.download=l,o.rel="noopener",typeof e=="string"?(o.href=e,o.origin!==location.origin?at(o.href)?Te(e,l,t):(o.target="_blank",he(o)):he(o)):(o.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(o.href)},4e4),setTimeout(function(){he(o)},0))}function eo(e,l="download",t){if(typeof e=="string")if(at(e))Te(e,l,t);else{const o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){he(o)})}else navigator.msSaveOrOpenBlob(Qn(e,t),l)}function to(e,l,t,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof e=="string")return Te(e,l,t);const s=e.type==="application/octet-stream",a=/constructor/i.test(String(rt.HTMLElement))||"safari"in rt,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||s&&a||it)&&typeof FileReader<"u"){const r=new FileReader;r.onloadend=function(){let c=r.result;if(typeof c!="string")throw o=null,new Error("Wrong reader.result type");c=i?c:c.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=c:location.assign(c),o=null},r.readAsDataURL(e)}else{const r=URL.createObjectURL(e);o?o.location.assign(r):location.href=r,o=null,setTimeout(function(){URL.revokeObjectURL(r)},4e4)}}function L(e,l){const t="🍍 "+e;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(t,l):l==="error"?console.error(t):l==="warn"?console.warn(t):console.log(t)}function Ne(e){return"_a"in e&&"install"in e}function ut(){if(!("clipboard"in navigator))return L("Your browser doesn't support the Clipboard API","error"),!0}function dt(e){return e instanceof Error&&e.message.toLowerCase().includes("document is not focused")?(L('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function no(e){if(!ut())try{await navigator.clipboard.writeText(JSON.stringify(e.state.value)),L("Global state copied to clipboard.")}catch(l){if(dt(l))return;L("Failed to serialize the state. Check the console for more details.","error"),console.error(l)}}async function oo(e){if(!ut())try{ft(e,JSON.parse(await navigator.clipboard.readText())),L("Global state pasted from clipboard.")}catch(l){if(dt(l))return;L("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(l)}}async function lo(e){try{ct(new Blob([JSON.stringify(e.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(l){L("Failed to export the state as JSON. Check the console for more details.","error"),console.error(l)}}let Z;function so(){Z||(Z=document.createElement("input"),Z.type="file",Z.accept=".json");function e(){return new Promise((l,t)=>{Z.onchange=async()=>{const o=Z.files;if(!o)return l(null);const s=o.item(0);return l(s?{text:await s.text(),file:s}:null)},Z.oncancel=()=>l(null),Z.onerror=t,Z.click()})}return e}async function ro(e){try{const t=await so()();if(!t)return;const{text:o,file:s}=t;ft(e,JSON.parse(o)),L(`Global state imported from "${s.name}".`)}catch(l){L("Failed to import the state from JSON. Check the console for more details.","error"),console.error(l)}}function ft(e,l){for(const t in l){const o=e.state.value[t];o?Object.assign(o,l[t]):e.state.value[t]=l[t]}}function H(e){return{_custom:{display:e}}}const pt="🍍 Pinia (root)",Ie="_root";function ao(e){return Ne(e)?{id:Ie,label:pt}:{id:e.$id,label:e.$id}}function io(e){if(Ne(e)){const t=Array.from(e._s.keys()),o=e._s;return{state:t.map(a=>({editable:!0,key:a,value:e.state.value[a]})),getters:t.filter(a=>o.get(a)._getters).map(a=>{const i=o.get(a);return{editable:!1,key:a,value:i._getters.reduce((r,c)=>(r[c]=i[c],r),{})}})}}const l={state:Object.keys(e.$state).map(t=>({editable:!0,key:t,value:e.$state[t]}))};return e._getters&&e._getters.length&&(l.getters=e._getters.map(t=>({editable:!1,key:t,value:e[t]}))),e._customProperties.size&&(l.customProperties=Array.from(e._customProperties).map(t=>({editable:!0,key:t,value:e[t]}))),l}function co(e){return e?Array.isArray(e)?e.reduce((l,t)=>(l.keys.push(t.key),l.operations.push(t.type),l.oldValue[t.key]=t.oldValue,l.newValue[t.key]=t.newValue,l),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:H(e.type),key:H(e.key),oldValue:e.oldValue,newValue:e.newValue}:{}}function uo(e){switch(e){case z.direct:return"mutation";case z.patchFunction:return"$patch";case z.patchObject:return"$patch";default:return"unknown"}}let te=!0;const be=[],Q="pinia:mutations",P="pinia",{assign:fo}=Object,ve=e=>"🍍 "+e;function po(e,l){lt({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:be,app:e},t=>{typeof t.now!="function"&&L("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."),t.addTimelineLayer({id:Q,label:"Pinia 🍍",color:15064968}),t.addInspector({id:P,label:"Pinia 🍍",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{no(l)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await oo(l),t.sendInspectorTree(P),t.sendInspectorState(P)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{lo(l)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await ro(l),t.sendInspectorTree(P),t.sendInspectorState(P)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:o=>{const s=l._s.get(o);s?typeof s.$reset!="function"?L(`Cannot reset "${o}" store because it doesn't have a "$reset" method implemented.`,"warn"):(s.$reset(),L(`Store "${o}" reset.`)):L(`Cannot reset "${o}" store because it wasn't found.`,"warn")}}]}),t.on.inspectComponent((o,s)=>{const a=o.componentInstance&&o.componentInstance.proxy;if(a&&a._pStores){const i=o.componentInstance.proxy._pStores;Object.values(i).forEach(r=>{o.instanceData.state.push({type:ve(r.$id),key:"state",editable:!0,value:r._isOptionsAPI?{_custom:{value:n.toRaw(r.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>r.$reset()}]}}:Object.keys(r.$state).reduce((c,u)=>(c[u]=r.$state[u],c),{})}),r._getters&&r._getters.length&&o.instanceData.state.push({type:ve(r.$id),key:"getters",editable:!1,value:r._getters.reduce((c,u)=>{try{c[u]=r[u]}catch(p){c[u]=p}return c},{})})})}}),t.on.getInspectorTree(o=>{if(o.app===e&&o.inspectorId===P){let s=[l];s=s.concat(Array.from(l._s.values())),o.rootNodes=(o.filter?s.filter(a=>"$id"in a?a.$id.toLowerCase().includes(o.filter.toLowerCase()):pt.toLowerCase().includes(o.filter.toLowerCase())):s).map(ao)}}),t.on.getInspectorState(o=>{if(o.app===e&&o.inspectorId===P){const s=o.nodeId===Ie?l:l._s.get(o.nodeId);if(!s)return;s&&(o.state=io(s))}}),t.on.editInspectorState((o,s)=>{if(o.app===e&&o.inspectorId===P){const a=o.nodeId===Ie?l:l._s.get(o.nodeId);if(!a)return L(`store "${o.nodeId}" not found`,"error");const{path:i}=o;Ne(a)?i.unshift("state"):(i.length!==1||!a._customProperties.has(i[0])||i[0]in a.$state)&&i.unshift("$state"),te=!1,o.set(a,i,o.state.value),te=!0}}),t.on.editComponentState(o=>{if(o.type.startsWith("🍍")){const s=o.type.replace(/^🍍\s*/,""),a=l._s.get(s);if(!a)return L(`store "${s}" not found`,"error");const{path:i}=o;if(i[0]!=="state")return L(`Invalid path for store "${s}":
|
|
12
12
|
${i}
|
|
13
|
-
Only state can be modified.`);i[0]="$state",te=!1,o.set(a,i,o.state.value),te=!0}})})}function
|
|
13
|
+
Only state can be modified.`);i[0]="$state",te=!1,o.set(a,i,o.state.value),te=!0}})})}function mo(e,l){be.includes(ve(l.$id))||be.push(ve(l.$id)),lt({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:be,app:e,settings:{logStoreChanges:{label:"Notify about new/deleted stores",type:"boolean",defaultValue:!0}}},t=>{const o=typeof t.now=="function"?t.now.bind(t):Date.now;l.$onAction(({after:i,onError:r,name:c,args:u})=>{const p=mt++;t.addTimelineEvent({layerId:Q,event:{time:o(),title:"🛫 "+c,subtitle:"start",data:{store:H(l.$id),action:H(c),args:u},groupId:p}}),i(m=>{W=void 0,t.addTimelineEvent({layerId:Q,event:{time:o(),title:"🛬 "+c,subtitle:"end",data:{store:H(l.$id),action:H(c),args:u,result:m},groupId:p}})}),r(m=>{W=void 0,t.addTimelineEvent({layerId:Q,event:{time:o(),logType:"error",title:"💥 "+c,subtitle:"end",data:{store:H(l.$id),action:H(c),args:u,error:m},groupId:p}})})},!0),l._customProperties.forEach(i=>{n.watch(()=>n.unref(l[i]),(r,c)=>{t.notifyComponentUpdate(),t.sendInspectorState(P),te&&t.addTimelineEvent({layerId:Q,event:{time:o(),title:"Change",subtitle:i,data:{newValue:r,oldValue:c},groupId:W}})},{deep:!0})}),l.$subscribe(({events:i,type:r},c)=>{if(t.notifyComponentUpdate(),t.sendInspectorState(P),!te)return;const u={time:o(),title:uo(r),data:fo({store:H(l.$id)},co(i)),groupId:W};r===z.patchFunction?u.subtitle="⤵️":r===z.patchObject?u.subtitle="🧩":i&&!Array.isArray(i)&&(u.subtitle=i.type),i&&(u.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:i}}),t.addTimelineEvent({layerId:Q,event:u})},{detached:!0,flush:"sync"});const s=l._hotUpdate;l._hotUpdate=n.markRaw(i=>{s(i),t.addTimelineEvent({layerId:Q,event:{time:o(),title:"🔥 "+l.$id,subtitle:"HMR update",data:{store:H(l.$id),info:H("HMR update")}}}),t.notifyComponentUpdate(),t.sendInspectorTree(P),t.sendInspectorState(P)});const{$dispose:a}=l;l.$dispose=()=>{a(),t.notifyComponentUpdate(),t.sendInspectorTree(P),t.sendInspectorState(P),t.getSettings().logStoreChanges&&L(`Disposed "${l.$id}" store 🗑`)},t.notifyComponentUpdate(),t.sendInspectorTree(P),t.sendInspectorState(P),t.getSettings().logStoreChanges&&L(`"${l.$id}" store installed 🆕`)})}let mt=0,W;function ht(e,l,t){const o=l.reduce((s,a)=>(s[a]=n.toRaw(e)[a],s),{});for(const s in o)e[s]=function(){const a=mt,i=t?new Proxy(e,{get(...c){return W=a,Reflect.get(...c)},set(...c){return W=a,Reflect.set(...c)}}):e;W=a;const r=o[s].apply(i,arguments);return W=void 0,r}}function ho({app:e,store:l,options:t}){if(l.$id.startsWith("__hot:"))return;l._isOptionsAPI=!!t.state,ht(l,Object.keys(t.actions),l._isOptionsAPI);const o=l._hotUpdate;n.toRaw(l)._hotUpdate=function(s){o.apply(this,arguments),ht(l,Object.keys(s._hmrPayload.actions),!!l._isOptionsAPI)},mo(e,l)}function go(){const e=n.effectScope(!0),l=e.run(()=>n.ref({}));let t=[],o=[];const s=n.markRaw({install(a){ie(s),s._a=a,a.provide(st,s),a.config.globalProperties.$pinia=s,ce&&po(a,s),o.forEach(i=>t.push(i)),o=[]},use(a){return!this._a&&!nt?o.push(a):t.push(a),this},_p:t,_a:null,_e:e,_s:new Map,state:l});return ce&&typeof Proxy<"u"&&s.use(ho),s}function gt(e,l){for(const t in l){const o=l[t];if(!(t in e))continue;const s=e[t];Y(s)&&Y(o)&&!n.isRef(o)&&!n.isReactive(o)?e[t]=gt(s,o):e[t]=o}return e}const bt=()=>{};function vt(e,l,t,o=bt){e.push(l);const s=()=>{const a=e.indexOf(l);a>-1&&(e.splice(a,1),o())};return!t&&n.getCurrentScope()&&n.onScopeDispose(s),s}function ne(e,...l){e.slice().forEach(t=>{t(...l)})}const bo=e=>e();function Be(e,l){e instanceof Map&&l instanceof Map&&l.forEach((t,o)=>e.set(o,t)),e instanceof Set&&l instanceof Set&&l.forEach(e.add,e);for(const t in l){if(!l.hasOwnProperty(t))continue;const o=l[t],s=e[t];Y(s)&&Y(o)&&e.hasOwnProperty(t)&&!n.isRef(o)&&!n.isReactive(o)?e[t]=Be(s,o):e[t]=o}return e}const vo=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function Co(e){return!Y(e)||!e.hasOwnProperty(vo)}const{assign:A}=Object;function Ct(e){return!!(n.isRef(e)&&e.effect)}function _t(e,l,t,o){const{state:s,actions:a,getters:i}=l,r=t.state.value[e];let c;function u(){!r&&(process.env.NODE_ENV==="production"||!o)&&(t.state.value[e]=s?s():{});const p=process.env.NODE_ENV!=="production"&&o?n.toRefs(n.ref(s?s():{}).value):n.toRefs(t.state.value[e]);return A(p,a,Object.keys(i||{}).reduce((m,b)=>(process.env.NODE_ENV!=="production"&&b in p&&console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${b}" in store "${e}".`),m[b]=n.markRaw(n.computed(()=>{ie(t);const x=t._s.get(e);return i[b].call(x,x)})),m),{}))}return c=Le(e,u,l,t,o,!0),c}function Le(e,l,t={},o,s,a){let i;const r=A({actions:{}},t);if(process.env.NODE_ENV!=="production"&&!o._e.active)throw new Error("Pinia destroyed");const c={deep:!0};process.env.NODE_ENV!=="production"&&!nt&&(c.onTrigger=d=>{u?x=d:u==!1&&!C._hotUpdating&&(Array.isArray(x)?x.push(d):console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let u,p,m=[],b=[],x;const h=o.state.value[e];!a&&!h&&(process.env.NODE_ENV==="production"||!s)&&(o.state.value[e]={});const g=n.ref({});let $;function I(d){let f;u=p=!1,process.env.NODE_ENV!=="production"&&(x=[]),typeof d=="function"?(d(o.state.value[e]),f={type:z.patchFunction,storeId:e,events:x}):(Be(o.state.value[e],d),f={type:z.patchObject,payload:d,storeId:e,events:x});const y=$=Symbol();n.nextTick().then(()=>{$===y&&(u=!0)}),p=!0,ne(m,f,o.state.value[e])}const E=a?function(){const{state:f}=t,y=f?f():{};this.$patch(w=>{A(w,y)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`)}:bt;function T(){i.stop(),m=[],b=[],o._s.delete(e)}function B(d,f){return function(){ie(o);const y=Array.from(arguments),w=[],V=[];function N(R){w.push(R)}function F(R){V.push(R)}ne(b,{args:y,name:d,store:C,after:N,onError:F});let j;try{j=f.apply(this&&this.$id===e?this:C,y)}catch(R){throw ne(V,R),R}return j instanceof Promise?j.then(R=>(ne(w,R),R)).catch(R=>(ne(V,R),Promise.reject(R))):(ne(w,j),j)}}const _=n.markRaw({actions:{},getters:{},state:[],hotState:g}),O={_p:o,$id:e,$onAction:vt.bind(null,b),$patch:I,$reset:E,$subscribe(d,f={}){const y=vt(m,d,f.detached,()=>w()),w=i.run(()=>n.watch(()=>o.state.value[e],V=>{(f.flush==="sync"?p:u)&&d({storeId:e,type:z.direct,events:x},V)},A({},c,f)));return y},$dispose:T},C=n.reactive(process.env.NODE_ENV!=="production"||ce?A({_hmrPayload:_,_customProperties:n.markRaw(new Set)},O):O);o._s.set(e,C);const S=(o._a&&o._a.runWithContext||bo)(()=>o._e.run(()=>(i=n.effectScope()).run(l)));for(const d in S){const f=S[d];if(n.isRef(f)&&!Ct(f)||n.isReactive(f))process.env.NODE_ENV!=="production"&&s?pe(g.value,d,n.toRef(S,d)):a||(h&&Co(f)&&(n.isRef(f)?f.value=h[d]:Be(f,h[d])),o.state.value[e][d]=f),process.env.NODE_ENV!=="production"&&_.state.push(d);else if(typeof f=="function"){const y=process.env.NODE_ENV!=="production"&&s?f:B(d,f);S[d]=y,process.env.NODE_ENV!=="production"&&(_.actions[d]=f),r.actions[d]=f}else process.env.NODE_ENV!=="production"&&Ct(f)&&(_.getters[d]=a?t.getters[d]:f,me&&(S._getters||(S._getters=n.markRaw([]))).push(d))}if(A(C,S),A(n.toRaw(C),S),Object.defineProperty(C,"$state",{get:()=>process.env.NODE_ENV!=="production"&&s?g.value:o.state.value[e],set:d=>{if(process.env.NODE_ENV!=="production"&&s)throw new Error("cannot set hotState");I(f=>{A(f,d)})}}),process.env.NODE_ENV!=="production"&&(C._hotUpdate=n.markRaw(d=>{C._hotUpdating=!0,d._hmrPayload.state.forEach(f=>{if(f in C.$state){const y=d.$state[f],w=C.$state[f];typeof y=="object"&&Y(y)&&Y(w)?gt(y,w):d.$state[f]=w}pe(C,f,n.toRef(d.$state,f))}),Object.keys(C.$state).forEach(f=>{f in d.$state||$e(C,f)}),u=!1,p=!1,o.state.value[e]=n.toRef(d._hmrPayload,"hotState"),p=!0,n.nextTick().then(()=>{u=!0});for(const f in d._hmrPayload.actions){const y=d[f];pe(C,f,B(f,y))}for(const f in d._hmrPayload.getters){const y=d._hmrPayload.getters[f],w=a?n.computed(()=>(ie(o),y.call(C,C))):y;pe(C,f,w)}Object.keys(C._hmrPayload.getters).forEach(f=>{f in d._hmrPayload.getters||$e(C,f)}),Object.keys(C._hmrPayload.actions).forEach(f=>{f in d._hmrPayload.actions||$e(C,f)}),C._hmrPayload=d._hmrPayload,C._getters=d._getters,C._hotUpdating=!1})),ce){const d={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(f=>{Object.defineProperty(C,f,A({value:C[f]},d))})}return o._p.forEach(d=>{if(ce){const f=i.run(()=>d({store:C,app:o._a,pinia:o,options:r}));Object.keys(f||{}).forEach(y=>C._customProperties.add(y)),A(C,f)}else A(C,i.run(()=>d({store:C,app:o._a,pinia:o,options:r})))}),process.env.NODE_ENV!=="production"&&C.$state&&typeof C.$state=="object"&&typeof C.$state.constructor=="function"&&!C.$state.constructor.toString().includes("[native code]")&&console.warn(`[🍍]: The "state" must be a plain object. It cannot be
|
|
14
14
|
state: () => new MyClass()
|
|
15
|
-
Found in store "${C.$id}".`),
|
|
15
|
+
Found in store "${C.$id}".`),h&&a&&t.hydrate&&t.hydrate(C.$state,h),u=!0,p=!0,C}function Ce(e,l,t){let o,s;const a=typeof l=="function";if(typeof e=="string")o=e,s=a?t:l;else if(s=e,o=e.id,process.env.NODE_ENV!=="production"&&typeof o!="string")throw new Error('[🍍]: "defineStore()" must be passed a store id as its first argument.');function i(r,c){const u=n.hasInjectionContext();if(r=(process.env.NODE_ENV==="test"&&ae&&ae._testing?null:r)||(u?n.inject(st,null):null),r&&ie(r),process.env.NODE_ENV!=="production"&&!ae)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.`);r=ae,r._s.has(o)||(a?Le(o,l,s,r):_t(o,s,r),process.env.NODE_ENV!=="production"&&(i._pinia=r));const m=r._s.get(o);if(process.env.NODE_ENV!=="production"&&c){const p="__hot:"+o,h=a?Le(p,l,s,r,!0):_t(p,A({},s),r,!0);c._hotUpdate(h),delete r.state.value[p],r._s.delete(p)}if(process.env.NODE_ENV!=="production"&&me){const p=n.getCurrentInstance();if(p&&p.proxy&&!c){const h=p.proxy,g="_pStores"in h?h._pStores:h._pStores={};g[o]=m}}return m}return i.$id=o,i}const Ce=Te("language",()=>{const e=n.ref("auto"),l=n.ref("en"),t=n.ref({src:[],target:[]}),o=n.computed(()=>t.value.src[e.value]),s=n.computed(()=>t.value.target[l.value]);function a(c,u){e.value=c==null?void 0:c.src,l.value=c==null?void 0:c.target,t.value=u}function i(){if(!t.value.src[l.value]||!t.value.target[e.value])return;const c=e.value;e.value=l.value,l.value=c}function r(c){return t.value.src[c]||t.value.target[c]}return{languages:t,src:e,target:l,srcLabel:o,targetLabel:s,init:a,swap:i,getLabel:r}}),Co={key:0,class:"flex"},_o={__name:"Selects",setup(e){const l=Ce();function t(){l.swap()}return(o,s)=>n.unref(l).languages?(n.openBlock(),n.createElementBlock("div",Co,[n.createVNode(et,{modelValue:n.unref(l).src,"onUpdate:modelValue":s[0]||(s[0]=a=>n.unref(l).src=a),languages:n.unref(l).languages.src,class:"grow"},null,8,["modelValue","languages"]),n.createVNode(zn,{isBidirect:n.unref(l).src!=="auto",class:"grow-0 mx-3",onSwap:t},null,8,["isBidirect"]),n.createVNode(et,{modelValue:n.unref(l).target,"onUpdate:modelValue":s[1]||(s[1]=a=>n.unref(l).target=a),languages:n.unref(l).languages.target,class:"grow"},null,8,["modelValue","languages"])])):n.createCommentVNode("",!0)}},xo={INPUT_MAX_LENGTH:5e3,INPUT_DEBOUNCE:500},_e=(e,l)=>{const t=e.__vccOpts||e;for(const[o,s]of l)t[o]=s;return t},wo={},yo={class:"mr-2 loading loading-dots loading-xs"};function Eo(e,l){return n.openBlock(),n.createElementBlock("span",yo)}const So=_e(wo,[["render",Eo]]),Oo="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.33325%204.66667H3.51125C3.82693%204.6667%204.13239%204.55473%204.37325%204.35067L6.83392%202.26667C6.99592%202.12953%207.19374%202.04156%207.40407%202.01312C7.61441%201.98468%207.82849%202.01696%208.02109%202.10615C8.21369%202.19534%208.37678%202.33772%208.49114%202.51652C8.60551%202.69532%208.66638%202.90309%208.66659%203.11534V12.8847C8.66649%2013.097%208.60565%2013.305%208.49125%2013.4839C8.37685%2013.6628%208.21367%2013.8053%208.02094%2013.8945C7.82822%2013.9837%207.614%2014.0159%207.40356%2013.9874C7.19312%2013.9588%206.99523%2013.8707%206.83325%2013.7333L4.37325%2011.6487C4.13229%2011.4449%203.82685%2011.3331%203.51125%2011.3333H2.33325C2.06804%2011.3333%201.81368%2011.228%201.62615%2011.0404C1.43861%2010.8529%201.33325%2010.5986%201.33325%2010.3333V5.66667C1.33325%205.40145%201.43861%205.1471%201.62615%204.95956C1.81368%204.77203%202.06804%204.66667%202.33325%204.66667ZM11.1779%2011.18C11.5969%2010.763%2011.9294%2010.2674%2012.1562%209.72156C12.3831%209.17572%2012.4999%208.59044%2012.4999%207.99934C12.4999%207.40823%2012.3831%206.82295%2012.1562%206.27711C11.9294%205.73127%2011.5969%205.23564%2011.1779%204.81867C11.1317%204.77098%2011.0765%204.73297%2011.0155%204.70686C10.9544%204.68075%2010.8888%204.66705%2010.8224%204.66657C10.756%204.66609%2010.6902%204.67883%2010.6288%204.70406C10.5674%204.72929%2010.5116%204.76649%2010.4647%204.8135C10.4179%204.86051%2010.3808%204.91639%2010.3558%204.97787C10.3307%205.03935%2010.3181%205.10521%2010.3188%205.17159C10.3195%205.23798%2010.3334%205.30357%2010.3597%205.36453C10.3859%205.42549%2010.4241%205.48061%2010.4719%205.52667C10.7977%205.85079%2011.0562%206.23609%2011.2326%206.66043C11.409%207.08477%2011.4998%207.53979%2011.4998%207.99934C11.4998%208.45888%2011.409%208.9139%2011.2326%209.33824C11.0562%209.76258%2010.7977%2010.1479%2010.4719%2010.472C10.4241%2010.5181%2010.3859%2010.5732%2010.3597%2010.6341C10.3334%2010.6951%2010.3195%2010.7607%2010.3188%2010.8271C10.3181%2010.8935%2010.3307%2010.9593%2010.3558%2011.0208C10.3808%2011.0823%2010.4179%2011.1382%2010.4647%2011.1852C10.5116%2011.2322%2010.5674%2011.2694%2010.6288%2011.2946C10.6902%2011.3198%2010.756%2011.3326%2010.8224%2011.3321C10.8888%2011.3316%2010.9544%2011.3179%2011.0155%2011.2918C11.0765%2011.2657%2011.1317%2011.2277%2011.1779%2011.18ZM12.7113%2013.2127C12.6123%2013.2126%2012.5157%2013.1832%2012.4335%2013.1281C12.3513%2013.0731%2012.2873%2012.9949%2012.2495%2012.9035C12.2118%2012.8121%2012.202%2012.7115%2012.2214%2012.6146C12.2408%2012.5176%2012.2886%2012.4285%2012.3586%2012.3587C12.9317%2011.7866%2013.3865%2011.1071%2013.6967%2010.359C14.0069%209.61101%2014.1666%208.80915%2014.1666%207.99934C14.1666%207.18952%2014.0069%206.38766%2013.6967%205.63963C13.3865%204.8916%2012.9317%204.2121%2012.3586%203.64C12.3122%203.59351%2012.2754%203.53834%2012.2503%203.47764C12.2252%203.41693%2012.2124%203.35188%2012.2124%203.2862C12.2125%203.22052%2012.2255%203.15549%2012.2507%203.09483C12.2759%203.03417%2012.3128%202.97907%2012.3593%202.93267C12.4057%202.88627%2012.4609%202.84948%2012.5216%202.8244C12.5823%202.79932%2012.6474%202.78645%2012.7131%202.78651C12.7787%202.78657%2012.8438%202.79957%2012.9044%202.82476C12.9651%202.84995%2013.0202%202.88685%2013.0666%202.93334C13.7327%203.59825%2014.2612%204.38801%2014.6218%205.25741C14.9824%206.12681%2015.168%207.05879%2015.168%208C15.168%208.94122%2014.9824%209.87319%2014.6218%2010.7426C14.2612%2011.612%2013.7327%2012.4018%2013.0666%2013.0667C13.02%2013.1134%2012.9646%2013.1504%2012.9036%2013.1756C12.8426%2013.2007%2012.7772%2013.2129%2012.7113%2013.2127Z'%20fill='%233B5695'/%3e%3c/svg%3e",ko="data:image/svg+xml,%3csvg%20class='swap-on%20fill-current%20h-4%20w-4'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill-rule='evenodd'%20d='M4.5%207.5a3%203%200%200%201%203-3h9a3%203%200%200%201%203%203v9a3%203%200%200%201-3%203h-9a3%203%200%200%201-3-3v-9Z'%20clip-rule='evenodd'%20fill='%238595BE'/%3e%3c/svg%3e",Vo={key:0,src:Oo,alt:"Play"},$o={key:1,src:ko,alt:"Stop"},No={__name:"SpeakBtn",props:{url:{type:String,default:""}},setup(e){const l=e,t=n.ref(!1);let o=new Audio(l.url);n.watch(()=>l.url,a=>{o=new Audio(a)});function s(){t.value?(o.pause(),o.currentTime=0,t.value=!1):(o.play(),t.value=!0)}return o.onended=()=>{t.value=!1},(a,i)=>(n.openBlock(),n.createElementBlock("button",{class:"btn btn-xs btn-ghost btn-circle",onClick:n.withModifiers(s,["prevent"])},[t.value?(n.openBlock(),n.createElementBlock("img",$o)):(n.openBlock(),n.createElementBlock("img",Vo))]))}},Io="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.19102%203.19102C3.44571%202.93633%203.85864%202.93633%204.11333%203.19102L12.809%2011.8867C13.0637%2012.1414%2013.0637%2012.5543%2012.809%2012.809C12.5543%2013.0637%2012.1414%2013.0637%2011.8867%2012.809L3.19102%204.11333C2.93633%203.85864%202.93633%203.44571%203.19102%203.19102Z'%20fill='%231A1F2A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.809%203.19102C13.0637%203.44571%2013.0637%203.85864%2012.809%204.11333L4.11333%2012.809C3.85864%2013.0637%203.44571%2013.0637%203.19102%2012.809C2.93633%2012.5543%202.93633%2012.1414%203.19102%2011.8867L11.8867%203.19102C12.1414%202.93633%2012.5543%202.93633%2012.809%203.19102Z'%20fill='%231A1F2A'/%3e%3c/svg%3e",Bo={},Lo={class:"btn btn-xs btn-circle btn-ghost"},To=[n.createElementVNode("img",{src:Io,alt:"Clear",class:"w-4"},null,-1)];function Ro(e,l){return n.openBlock(),n.createElementBlock("button",Lo,To)}const Mo=_e(Bo,[["render",Ro]]),Po="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.47207%201.31905C7.57125%201.12371%207.77589%201%208.00001%201C8.22413%201%208.42877%201.12367%208.52795%201.31905L10.3721%204.95175L14.4959%205.53427C14.7177%205.5656%2014.9019%205.7166%2014.9712%205.9238C15.0404%206.13101%2014.9827%206.35843%2014.8222%206.51049L11.8382%209.33816L12.5427%2013.3309C12.5806%2013.5456%2012.4897%2013.7626%2012.3084%2013.8906C12.1272%2014.0187%2011.8868%2014.0356%2011.6884%2013.9342L8.00004%2012.0491L4.31158%2013.9343C4.11323%2014.0356%203.87286%2014.0187%203.69157%2013.8907C3.51028%2013.7627%203.4195%2013.5457%203.45736%2013.3309L4.1618%209.33819L1.17781%206.51052C1.01735%206.35846%200.959571%206.13101%201.02884%205.92383C1.09807%205.71663%201.28232%205.56563%201.50409%205.53431L5.62787%204.95178L7.47207%201.31905Z'%20fill='%23FFC857'/%3e%3c/svg%3e",Do="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.9491%205.89315C14.8278%205.53128%2014.5111%205.27252%2014.1226%205.21783L10.5264%204.7114L8.91813%201.55315C8.74435%201.21195%208.39257%201%207.99998%201C7.60739%201%207.25557%201.21195%207.08183%201.55315L5.47358%204.7114L1.8774%205.21783C1.48888%205.27252%201.17219%205.53128%201.05086%205.89315C0.929554%206.25501%201.02881%206.64477%201.30993%206.91038L3.91217%209.36871L3.29786%2012.8399C3.2315%2013.215%203.38755%2013.5868%203.7052%2013.8105C3.88128%2013.9344%204.08938%2014%204.30704%2014C4.47232%2014%204.63705%2013.9606%204.78341%2013.886L7.99995%2012.2471L11.2165%2013.886C11.3628%2013.9606%2011.5276%2014%2011.6929%2014C11.9106%2014%2012.1187%2013.9345%2012.2948%2013.8105C12.6124%2013.5868%2012.7685%2013.215%2012.7021%2012.84L12.0878%209.36871L14.6901%206.91035C14.9712%206.64477%2015.0704%206.25498%2014.9491%205.89315ZM14.0266%206.25082L11.2455%208.87813C11.1335%208.98392%2011.0824%209.13637%2011.1089%209.28575L11.7654%2012.9956C11.7701%2013.0226%2011.759%2013.0493%2011.7362%2013.0653C11.7202%2013.0766%2011.7038%2013.079%2011.6929%2013.079C11.6809%2013.079%2011.6694%2013.0762%2011.6587%2013.0708L8.22108%2011.3192C8.15189%2011.284%208.07593%2011.2663%207.99998%2011.2663C7.92402%2011.2663%207.84807%2011.284%207.77882%2011.3193L4.34118%2013.0708C4.33052%2013.0763%204.31904%2013.079%204.30701%2013.079C4.29611%2013.079%204.27969%2013.0767%204.26373%2013.0654C4.24092%2013.0494%204.22975%2013.0226%204.2345%2012.9957L4.89104%209.28584C4.91747%209.13646%204.86637%208.98401%204.75439%208.87822L1.97327%206.25091C1.95308%206.23184%201.94595%206.20383%201.95466%206.17786C1.9634%206.15185%201.98612%206.13326%202.01405%206.12933L5.85743%205.58807C6.0122%205.56626%206.14599%205.47208%206.21521%205.33616L7.93404%201.9608C7.94653%201.9363%207.97178%201.92107%207.99998%201.92107C8.02818%201.92107%208.05343%201.9363%208.06591%201.9608L9.78468%205.33607C9.85391%205.47199%209.9877%205.5662%2010.1425%205.58799L13.9859%206.12924C14.0138%206.1332%2014.0365%206.15176%2014.0452%206.17777C14.0539%206.20374%2014.0468%206.23175%2014.0266%206.25082Z'%20fill='%231A1F2A'/%3e%3c/svg%3e",Ao={class:"btn btn-xs btn-circle btn-ghost"},Fo={key:0,src:Po,alt:"Clear",class:"w-4"},jo={key:1,src:Do,alt:"Clear",class:"w-4"},Ho={__name:"FavoriteBtn",props:{isFilled:Boolean},setup(e){const l=e;return(t,o)=>(n.openBlock(),n.createElementBlock("button",Ao,[l.isFilled?(n.openBlock(),n.createElementBlock("img",Fo)):(n.openBlock(),n.createElementBlock("img",jo))]))}},zo={class:"flex flex-row rounded-t-lg bg-white border border-b-0 px-1 pr-1 pt-1 gap-1 items-center"},Uo={class:"text-sm text-gray-600"},Zo={key:0,class:"italic"},Wo=n.createElementVNode("div",{class:"flex-grow"},null,-1),xt={__name:"TranslationBtnGroup",props:{loading:{type:Boolean,default:!1},src:{type:String,default:""},srcLabel:{type:String,default:""},tts:{type:String,default:""},phonetic:{type:String,default:""},isClearBtn:{type:Boolean,default:!1},isFavoriteBtn:{type:Boolean,default:!1},isFavorite:{type:Boolean,default:!1},onFavorite:{type:Function,default:()=>{}}},emits:["clear","favorite"],setup(e,{emit:l}){const t=e,o=l;return(s,a)=>(n.openBlock(),n.createElementBlock("div",zo,[t.tts?(n.openBlock(),n.createBlock(No,{key:0,url:t.tts},null,8,["url"])):n.createCommentVNode("",!0),n.createElementVNode("div",Uo,[n.createTextVNode(n.toDisplayString(e.srcLabel)+" ",1),e.phonetic?(n.openBlock(),n.createElementBlock("span",Zo,"- ["+n.toDisplayString(t.phonetic)+"]",1)):n.createCommentVNode("",!0)]),Wo,t.loading?(n.openBlock(),n.createBlock(So,{key:1})):n.createCommentVNode("",!0),t.src&&t.isClearBtn?(n.openBlock(),n.createBlock(Mo,{key:2,onClick:a[0]||(a[0]=i=>o("clear"))})):n.createCommentVNode("",!0),t.src&&t.isFavoriteBtn?(n.openBlock(),n.createBlock(Ho,{key:3,isFilled:t.isFavorite,onClick:a[1]||(a[1]=i=>o("favorite"))},null,8,["isFilled"])):n.createCommentVNode("",!0)]))}},X=Te("translation",()=>{const e=n.ref(null),l=n.ref(null),t=n.ref({src:null,target:null}),o=n.ref(null),s=n.ref([]),a=n.ref([]),i=n.ref([]),r=n.ref([]),c=n.ref({src:null,target:null}),u=Ce(),m=n.computed(()=>u.getLabel(e.value)),p=n.computed(()=>u.getLabel(l.value));function h(b){e.value=b.src,l.value=b.target,t.value=b.phonetic,o.value=b.result,s.value=b.dictionary,a.value=b.definitions,i.value=b.synonyms,r.value=b.examples,c.value=b.tts}function g(){e.value=null,l.value=null,t.value={src:null,target:null},o.value=null,s.value=[],a.value=[],i.value=[],r.value=[],c.value={src:null,target:null}}return{src:e,srcLabel:m,target:l,targetLabel:p,phonetic:t,result:o,dictionary:s,definitions:a,synonyms:i,examples:r,tts:c,init:h,reset:g}});function Go(e){return n.getCurrentScope()?(n.onScopeDispose(e),!0):!1}function xe(e){return typeof e=="function"?e():n.unref(e)}const qo=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const wt=()=>{};function Jo(e,l){function t(...o){return new Promise((s,a)=>{Promise.resolve(e(()=>l.apply(this,o),{fn:l,thisArg:this,args:o})).then(s).catch(a)})}return t}function Ko(e,l={}){let t,o,s=wt;const a=r=>{clearTimeout(r),s(),s=wt};return r=>{const c=xe(e),u=xe(l.maxWait);return t&&a(t),c<=0||u!==void 0&&u<=0?(o&&(a(o),o=null),Promise.resolve(r())):new Promise((m,p)=>{s=l.rejectOnCancel?p:m,u&&!o&&(o=setTimeout(()=>{t&&a(t),o=null,m(r())},u)),t=setTimeout(()=>{o&&a(o),o=null,m(r())},c)})}}function Yo(e,l=200,t={}){return Jo(Ko(l,t),e)}function yt(e){var l;const t=xe(e);return(l=t==null?void 0:t.$el)!=null?l:t}const Qo=qo?window:void 0;function Xo(){const e=n.ref(!1),l=n.getCurrentInstance();return l&&n.onMounted(()=>{e.value=!0},l),e}function el(e){const l=Xo();return n.computed(()=>(l.value,!!e()))}function tl(e,l,t={}){const{window:o=Qo,...s}=t;let a;const i=el(()=>o&&"ResizeObserver"in o),r=()=>{a&&(a.disconnect(),a=void 0)},c=n.computed(()=>Array.isArray(e)?e.map(p=>yt(p)):[yt(e)]),u=n.watch(c,p=>{if(r(),i.value&&o){a=new ResizeObserver(l);for(const h of p)h&&a.observe(h,s)}},{immediate:!0,flush:"post"}),m=()=>{r(),u()};return Go(m),{isSupported:i,stop:m}}function Et(e){var l;const t=n.ref(e==null?void 0:e.element),o=n.ref(e==null?void 0:e.input),s=(l=e==null?void 0:e.styleProp)!=null?l:"height",a=n.ref(1);function i(){var r;if(!t.value)return;let c="";t.value.style[s]="1px",a.value=(r=t.value)==null?void 0:r.scrollHeight,e!=null&&e.styleTarget?xe(e.styleTarget).style[s]=`${a.value}px`:c=`${a.value}px`,t.value.style[s]=c}return n.watch([o,t],()=>n.nextTick(i),{immediate:!0}),n.watch(a,()=>{var r;return(r=e==null?void 0:e.onResize)==null?void 0:r.call(e)}),tl(t,()=>i()),e!=null&&e.watch&&n.watch(e.watch,i,{immediate:!0,deep:!0}),{textarea:t,input:o,triggerResize:i}}const nl=_e({__name:"TranslationInput",props:{text:{type:String,default:""}},emits:["change","clear"],setup(e,{emit:l}){const t=X(),o=e,s=n.ref(""),a=n.computed(()=>t.src),i=n.computed(()=>t.srcLabel),r=n.computed(()=>{var y;return(y=t.phonetic)==null?void 0:y.src}),c=n.computed(()=>{var y;return(y=t.tts)==null?void 0:y.src}),{textarea:u}=Et({input:s,styleProp:"minHeight"}),m=l,p=Yo(()=>{m("change",s.value)},xo.INPUT_DEBOUNCE);function h(){if(!s.value){g();return}p()}function g(){m("clear"),s.value="",u.value.focus()}async function b(){await n.nextTick(),u.value.select()}return n.watch(()=>o.text,y=>{s.value!==y&&b(),s.value=y}),(y,I)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(xt,{src:a.value,srcLabel:i.value,tts:c.value,phonetic:r.value,isClearBtn:!0,onClear:g},null,8,["src","srcLabel","tts","phonetic"]),n.withDirectives(n.createElementVNode("textarea",{ref_key:"textarea",ref:u,"onUpdate:modelValue":I[0]||(I[0]=N=>s.value=N),class:"w-full border rounded-b-md border-t-0 outline-none outline-0 px-3 pl-5 bg-white text-gray-800 font-semibold resize-none pb-3 overflow-x-hidden overflow-y-hidden",autofocus:"",rows:"2",onInput:h,onFocus:b},null,544),[[n.vModelText,s.value,void 0,{trim:!0}]])],64))}},[["__scopeId","data-v-bfa5aec3"]]),ol="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.2018%204.409H8.2373L7.46364%202H2.79867C2.35907%202%202%202.3595%202%202.7995V10.937C2%2011.376%202.36008%2011.7355%202.79867%2011.7355H7.79971L8.53636%2014H13.2013C13.6404%2014%2014%2013.6465%2014%2013.214V5.195C14%204.7625%2013.6404%204.409%2013.2018%204.409ZM5.3702%208.749C4.33499%208.749%203.49481%207.909%203.49481%206.874C3.49481%205.839%204.33499%204.999%205.3702%204.999C5.87631%204.999%206.3004%205.1865%206.62646%205.487L6.13136%205.963C5.9244%205.77181%205.65196%205.66729%205.3702%205.671C4.71757%205.671%204.18846%206.211%204.18846%206.8755C4.18846%207.54%204.71757%208.08%205.3697%208.08C6.12336%208.08%206.43492%207.54%206.46493%207.176L5.3707%207.175V6.533H7.12607C7.15107%206.648%207.17108%206.7615%207.17108%206.915C7.17108%207.9885%206.45393%208.7495%205.3697%208.7495L5.3702%208.749ZM13.7504%2013.214C13.7504%2013.509%2013.5044%2013.75%2013.2018%2013.75H8.76341L10.5883%2011.735H10.5908L10.2207%2010.584L10.2237%2010.5815C10.2237%2010.5815%2010.5078%2010.3375%2010.8623%209.9615C11.2184%2010.347%2011.6775%2010.811%2012.2716%2011.364L12.6572%2010.978C12.0211%2010.401%2011.555%209.943%2011.2119%209.5755C11.6715%209.032%2012.1381%208.348%2012.2366%207.722H13.2538V7.723H13.2548V7.253H10.9884V6.493H10.2527V7.253H9.15049L8.31432%204.648L8.31732%204.659H13.2018C13.5044%204.659%2013.7504%204.899%2013.7504%205.195V13.214ZM10.5078%209.5585C10.2397%209.8325%2010.0362%209.995%2010.0362%209.995L10.0322%209.997L9.30202%207.723H11.6845C11.531%208.265%2011.1904%208.777%2010.8588%209.175C10.2707%208.479%2010.2687%208.253%2010.2687%208.253H9.6576C9.6576%208.253%209.6826%208.5925%2010.5078%209.5585Z'%20fill='%237E7E7E'/%3e%3c/svg%3e",St=Te("loader",()=>({loading:n.ref(!1)})),ll=e=>(n.pushScopeId("data-v-6aeed8dd"),e=e(),n.popScopeId(),e),sl={class:"flex flex-col"},rl=ll(()=>n.createElementVNode("div",{class:"w-full flex align-item-center justify-end"},[n.createElementVNode("span",{class:"text-sm"},"Powered by Google Translate"),n.createElementVNode("img",{src:ol,alt:"Google",class:"h-5 ml-2"})],-1)),al=_e({__name:"TranslationResult",props:{isFavoriteFeatureEnabled:Boolean},setup(e){const l=X(),t=n.ref(!1),o=n.computed(()=>l.result),s=n.computed(()=>l.target),a=n.computed(()=>l.targetLabel),i=n.computed(()=>{var h;return(h=l.phonetic)==null?void 0:h.target}),r=n.computed(()=>{var h;return(h=l.tts)==null?void 0:h.target}),c=e,u=St(),{textarea:m,input:p}=Et({input:o,styleProp:"minHeight"});return(h,g)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(xt,{loading:n.unref(u).loading,src:s.value,srcLabel:a.value,tts:r.value,isFavoriteBtn:c.isFavoriteFeatureEnabled,isFavorite:t.value,phonetic:i.value,onFavorite:g[0]||(g[0]=b=>t.value=!t.value)},null,8,["loading","src","srcLabel","tts","isFavoriteBtn","isFavorite","phonetic"]),n.createElementVNode("div",sl,[n.withDirectives(n.createElementVNode("textarea",{ref_key:"textarea",ref:m,"onUpdate:modelValue":g[1]||(g[1]=b=>n.isRef(p)?p.value=b:null),class:"w-full border rounded-b-md border-t-0 outline-none outline-0 px-3 pl-5 bg-white text-gray-800 font-semibold resize-none pb-3 overflow-x-hidden overflow-y-hidden",readonly:"",rows:"2",spellcheck:"false"},null,512),[[n.vModelText,n.unref(p)]]),rl])],64))}},[["__scopeId","data-v-6aeed8dd"]]),il={class:"btn btn-sm btn-circle btn-ghost"},we={__name:"ToggleBtn",props:{isExpanded:Boolean},setup(e){const l=e;return(t,o)=>(n.openBlock(),n.createElementBlock("button",il,[l.isExpanded?(n.openBlock(),n.createBlock(n.unref(An),{key:0,class:"w-7 text-gray-400"})):(n.openBlock(),n.createBlock(n.unref(Pn),{key:1,class:"w-7 text-gray-400"}))]))}},cl={class:"card border bg-white rounded-lg"},ul={class:"card-body px-4 py-2 gap-0"},dl={class:"flex justify-between items-center"},fl=n.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Translations",-1),pl={class:"capitalize text-base font-normal text-textSecondary mb-1"},ml={class:"list-none list-inside"},hl=["onClick"],gl={class:"text-base font-normal text-gray-800 leading-4"},bl={__name:"Dictionary",emits:["translate"],setup(e,{emit:l}){const t=n.ref(!0),o=X(),s=Ce(),a=n.computed(()=>o.dictionary),i=l,r=()=>{t.value=!t.value},c=u=>{i("translate",u,o.target,o.src),s.src=o.target,s.target=o.src};return(u,m)=>(n.openBlock(),n.createElementBlock("div",cl,[n.createElementVNode("div",ul,[n.createElementVNode("div",dl,[fl,n.createVNode(we,{isExpanded:t.value,onClick:r},null,8,["isExpanded"])]),n.createElementVNode("div",{class:n.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",t.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[n.createElementVNode("ul",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value,(p,h)=>(n.openBlock(),n.createElementBlock("li",{key:`${p.pos}-${h}`,class:"mb-2"},[n.createElementVNode("h5",pl,n.toDisplayString(p.pos),1),n.createElementVNode("ul",ml,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(p.items,(g,b)=>(n.openBlock(),n.createElementBlock("li",{key:`${g.word}-${b}`},[n.createElementVNode("span",{class:"p-3 m-0.5 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded-lg",onClick:y=>c(g.word)},n.toDisplayString(g.word),9,hl),n.createElementVNode("small",gl," - "+n.toDisplayString(g.reverse_translation.join(", ")),1)]))),128))])]))),128))])],2)])]))}},vl={class:"card border bg-white rounded-lg"},Cl={class:"card-body px-4 py-2 gap-0"},_l={class:"flex justify-between items-center"},xl=n.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Definitions",-1),wl={class:"capitalize text-base font-normal text-textSecondary mb-1"},yl={class:"text-base text-textCustom list-decimal list-outside ml-5"},El=n.createElementVNode("br",null,null,-1),Sl={key:0,class:"italic"},Ol={__name:"Definition",setup(e){const l=n.ref(!0),t=X(),o=n.computed(()=>t.definitions),s=()=>{l.value=!l.value};return(a,i)=>(n.openBlock(),n.createElementBlock("div",vl,[n.createElementVNode("div",Cl,[n.createElementVNode("div",_l,[xl,n.createVNode(we,{isExpanded:l.value,onClick:s},null,8,["isExpanded"])]),n.createElementVNode("div",{class:n.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",l.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[n.createElementVNode("ul",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.value,(r,c)=>(n.openBlock(),n.createElementBlock("li",{key:`${r.pos}-${c}`,class:"mb-2"},[n.createElementVNode("h5",wl,n.toDisplayString(r.pos),1),n.createElementVNode("ul",yl,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.items,(u,m)=>(n.openBlock(),n.createElementBlock("li",{key:`${u.gloss}-${m}`,class:"mb-1"},[n.createElementVNode("span",null,n.toDisplayString(u.gloss),1),El,u.example?(n.openBlock(),n.createElementBlock("small",Sl,'"'+n.toDisplayString(u.example)+'"',1)):n.createCommentVNode("",!0)]))),128))])]))),128))])],2)])]))}},kl={class:"card border bg-white rounded-lg"},Vl={class:"card-body px-4 py-2 gap-0"},$l={class:"flex justify-between items-center"},Nl=n.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Examples",-1),Il={class:"text-textCustom list-decimal list-outside ml-7 mt-2"},Bl=["innerHTML"],Ll={__name:"Example",setup(e){const l=n.ref(!0),t=X(),o=n.computed(()=>t.examples),s=()=>{l.value=!l.value};return(a,i)=>(n.openBlock(),n.createElementBlock("div",kl,[n.createElementVNode("div",Vl,[n.createElementVNode("div",$l,[Nl,n.createVNode(we,{isExpanded:l.value,onClick:s},null,8,["isExpanded"])]),n.createElementVNode("div",{class:n.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",l.value?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"])},[n.createElementVNode("ul",Il,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.value,(r,c)=>(n.openBlock(),n.createElementBlock("li",{key:`${r.definition_id}-${c}`,innerHTML:r},null,8,Bl))),128))])],2)])]))}},Tl={class:"card border bg-white rounded-lg"},Rl={class:"card-body px-4 py-2 gap-0"},Ml={class:"flex justify-between items-center"},Pl=n.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Synonyms",-1),Dl={class:"capitalize text-base font-normal text-textSecondary mb-1"},Al={class:"list-none list-inside"},Fl={class:"flex flex-wrap"},jl=["onClick"],Hl={__name:"Synonyms",emits:["translate"],setup(e,{emit:l}){const t=n.ref(!0),o=X(),s=n.computed(()=>o.synonyms),a=l,i=()=>{t.value=!t.value},r=c=>{a("translate",c)};return(c,u)=>(n.openBlock(),n.createElementBlock("div",Tl,[n.createElementVNode("div",Rl,[n.createElementVNode("div",Ml,[Pl,n.createVNode(we,{isExpanded:t.value,onClick:i},null,8,["isExpanded"])]),n.createElementVNode("div",{class:n.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",t.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[n.createElementVNode("ul",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value,(m,p)=>(n.openBlock(),n.createElementBlock("li",{key:`${m.pos}-${p}`,class:"mb-2"},[n.createElementVNode("h5",Dl,n.toDisplayString(m.pos),1),n.createElementVNode("ul",Al,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.items,(h,g)=>(n.openBlock(),n.createElementBlock("li",{key:`${h.word}-${g}`,class:"mb-2"},[n.createElementVNode("div",Fl,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h.synonym,(b,y)=>(n.openBlock(),n.createElementBlock("span",{key:`${b}-${y}`,class:"p-3 m-0.5 ml-0 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded-lg",onClick:I=>r(b)},n.toDisplayString(b),9,jl))),128))])]))),128))])]))),128))])],2)])]))}},zl={class:"bg-white min-h-screen flex flex-col"},Ul={class:"py-2 px-5 shadow-lg"},Zl={class:"px-5 flex-grow"},Wl={class:"flex flex-col lg:flex-row lg:gap-2"},Gl={class:"w-full lg:w-[calc(50%-1rem)] my-2"},ql=n.createElementVNode("div",{class:"w-6 h-4 mx-auto hidden lg:block"},null,-1),Jl={class:"w-full lg:w-[calc(50%-1rem)] my-2"},Kl={class:"grid grid-cols-1 lg:grid-cols-3 gap-4"},Yl={key:0,class:"w-full my-4"},Ql={key:1,class:"text-textCustom italic font-medium"},Xl=n.createElementVNode("div",{class:"mt-auto py-5 px-5"},[n.createElementVNode("span",{class:"block text-center text-gray-700"}," The site is not affiliated with Google Translate "),n.createElementVNode("span",{class:"block text-center text-gray-700"},"Since 2011")],-1),e2={__name:"Popup",props:{opt:{type:Object,default:null},languages:{type:Object,default:null},translation:{type:Object,default:null},isFavoriteFeatureEnabled:{type:Boolean,default:!1}},emits:["opt","translate","reader","settings","fullscreen"],setup(e,{emit:l}){const t=ho(),o=X(t),s=Ce(t),a=St(t),i=e,r=l,c=n.ref("");n.watch(()=>i.translation,h=>{try{a.loading=!1,c.value=h.text,o.init(h)}catch(g){console.error(g)}},{immediate:!0}),n.watch([()=>i.opt,()=>i.languages],([h,g])=>{s.init(h,g),p(c.value)}),n.watch([()=>s.src,()=>s.target],([h,g])=>{r("opt",{src:h,target:g}),p(c.value)}),n.onMounted(()=>{s.init(i.opt,i.languages)});function u(){c.value="",o.reset()}function m(h){p(h)}function p(h,g=s.src,b=s.target){h&&(c.value=h,a.loading=!0,r("translate",{src:g,target:b,text:h}))}return(h,g)=>(n.openBlock(),n.createElementBlock("div",zl,[n.createElementVNode("div",Ul,[n.createVNode(Mt,{onReader:g[0]||(g[0]=b=>r("reader")),onSettings:g[1]||(g[1]=b=>r("settings")),onFullScreen:g[2]||(g[2]=b=>r("fullscreen"))})]),n.createElementVNode("div",Zl,[n.createVNode(_o,{class:"my-4"}),n.createElementVNode("div",Wl,[n.createElementVNode("div",Gl,[n.createVNode(nl,{text:c.value,onChange:m,onClear:u},null,8,["text"])]),ql,n.createElementVNode("div",Jl,[n.createVNode(al,{isFavoriteFeatureEnabled:e.isFavoriteFeatureEnabled},null,8,["isFavoriteFeatureEnabled"])])]),i.translation?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("div",Kl,[n.unref(o).dictionary.length?(n.openBlock(),n.createBlock(bl,{key:0,onTranslate:p})):n.createCommentVNode("",!0),n.unref(o).definitions.length?(n.openBlock(),n.createBlock(Ol,{key:1})):n.createCommentVNode("",!0),n.unref(o).synonyms.length?(n.openBlock(),n.createBlock(Hl,{key:2,onTranslate:p})):n.createCommentVNode("",!0)]),n.unref(o).examples.length?(n.openBlock(),n.createElementBlock("div",Yl,[n.createVNode(Ll)])):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock("span",Ql,"Service unavailable"))]),Xl]))}};G.default=e2,Object.defineProperties(G,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
17
|
+
This will fail in production.`);r=ae,r._s.has(o)||(a?Le(o,l,s,r):_t(o,s,r),process.env.NODE_ENV!=="production"&&(i._pinia=r));const p=r._s.get(o);if(process.env.NODE_ENV!=="production"&&c){const m="__hot:"+o,b=a?Le(m,l,s,r,!0):_t(m,A({},s),r,!0);c._hotUpdate(b),delete r.state.value[m],r._s.delete(m)}if(process.env.NODE_ENV!=="production"&&me){const m=n.getCurrentInstance();if(m&&m.proxy&&!c){const b=m.proxy,x="_pStores"in b?b._pStores:b._pStores={};x[o]=p}}return p}return i.$id=o,i}const _e=Ce("language",()=>{const e=n.ref("auto"),l=n.ref("en"),t=n.ref({src:[],target:[]}),o=n.computed(()=>t.value.src[e.value]),s=n.computed(()=>t.value.target[l.value]);function a(c,u){e.value=c==null?void 0:c.src,l.value=c==null?void 0:c.target,t.value=u}function i(){if(!t.value.src[l.value]||!t.value.target[e.value])return;const c=e.value;e.value=l.value,l.value=c}function r(c){return t.value.src[c]||t.value.target[c]}return{languages:t,src:e,target:l,srcLabel:o,targetLabel:s,init:a,swap:i,getLabel:r}}),_o={key:0,class:"flex"},xo={__name:"Selects",setup(e){const l=_e();function t(){l.swap()}return(o,s)=>n.unref(l).languages?(n.openBlock(),n.createElementBlock("div",_o,[n.createVNode(et,{modelValue:n.unref(l).src,"onUpdate:modelValue":s[0]||(s[0]=a=>n.unref(l).src=a),languages:n.unref(l).languages.src,class:"grow"},null,8,["modelValue","languages"]),n.createVNode(Un,{isBidirect:n.unref(l).src!=="auto",class:"grow-0 mx-3",onSwap:t},null,8,["isBidirect"]),n.createVNode(et,{modelValue:n.unref(l).target,"onUpdate:modelValue":s[1]||(s[1]=a=>n.unref(l).target=a),languages:n.unref(l).languages.target,class:"grow"},null,8,["modelValue","languages"])])):n.createCommentVNode("",!0)}},yo={INPUT_MAX_LENGTH:5e3,INPUT_DEBOUNCE:500},xe=(e,l)=>{const t=e.__vccOpts||e;for(const[o,s]of l)t[o]=s;return t},wo={},Eo={class:"mr-2 loading loading-dots loading-xs"};function So(e,l){return n.openBlock(),n.createElementBlock("span",Eo)}const Oo=xe(wo,[["render",So]]),ko="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.33325%204.66667H3.51125C3.82693%204.6667%204.13239%204.55473%204.37325%204.35067L6.83392%202.26667C6.99592%202.12953%207.19374%202.04156%207.40407%202.01312C7.61441%201.98468%207.82849%202.01696%208.02109%202.10615C8.21369%202.19534%208.37678%202.33772%208.49114%202.51652C8.60551%202.69532%208.66638%202.90309%208.66659%203.11534V12.8847C8.66649%2013.097%208.60565%2013.305%208.49125%2013.4839C8.37685%2013.6628%208.21367%2013.8053%208.02094%2013.8945C7.82822%2013.9837%207.614%2014.0159%207.40356%2013.9874C7.19312%2013.9588%206.99523%2013.8707%206.83325%2013.7333L4.37325%2011.6487C4.13229%2011.4449%203.82685%2011.3331%203.51125%2011.3333H2.33325C2.06804%2011.3333%201.81368%2011.228%201.62615%2011.0404C1.43861%2010.8529%201.33325%2010.5986%201.33325%2010.3333V5.66667C1.33325%205.40145%201.43861%205.1471%201.62615%204.95956C1.81368%204.77203%202.06804%204.66667%202.33325%204.66667ZM11.1779%2011.18C11.5969%2010.763%2011.9294%2010.2674%2012.1562%209.72156C12.3831%209.17572%2012.4999%208.59044%2012.4999%207.99934C12.4999%207.40823%2012.3831%206.82295%2012.1562%206.27711C11.9294%205.73127%2011.5969%205.23564%2011.1779%204.81867C11.1317%204.77098%2011.0765%204.73297%2011.0155%204.70686C10.9544%204.68075%2010.8888%204.66705%2010.8224%204.66657C10.756%204.66609%2010.6902%204.67883%2010.6288%204.70406C10.5674%204.72929%2010.5116%204.76649%2010.4647%204.8135C10.4179%204.86051%2010.3808%204.91639%2010.3558%204.97787C10.3307%205.03935%2010.3181%205.10521%2010.3188%205.17159C10.3195%205.23798%2010.3334%205.30357%2010.3597%205.36453C10.3859%205.42549%2010.4241%205.48061%2010.4719%205.52667C10.7977%205.85079%2011.0562%206.23609%2011.2326%206.66043C11.409%207.08477%2011.4998%207.53979%2011.4998%207.99934C11.4998%208.45888%2011.409%208.9139%2011.2326%209.33824C11.0562%209.76258%2010.7977%2010.1479%2010.4719%2010.472C10.4241%2010.5181%2010.3859%2010.5732%2010.3597%2010.6341C10.3334%2010.6951%2010.3195%2010.7607%2010.3188%2010.8271C10.3181%2010.8935%2010.3307%2010.9593%2010.3558%2011.0208C10.3808%2011.0823%2010.4179%2011.1382%2010.4647%2011.1852C10.5116%2011.2322%2010.5674%2011.2694%2010.6288%2011.2946C10.6902%2011.3198%2010.756%2011.3326%2010.8224%2011.3321C10.8888%2011.3316%2010.9544%2011.3179%2011.0155%2011.2918C11.0765%2011.2657%2011.1317%2011.2277%2011.1779%2011.18ZM12.7113%2013.2127C12.6123%2013.2126%2012.5157%2013.1832%2012.4335%2013.1281C12.3513%2013.0731%2012.2873%2012.9949%2012.2495%2012.9035C12.2118%2012.8121%2012.202%2012.7115%2012.2214%2012.6146C12.2408%2012.5176%2012.2886%2012.4285%2012.3586%2012.3587C12.9317%2011.7866%2013.3865%2011.1071%2013.6967%2010.359C14.0069%209.61101%2014.1666%208.80915%2014.1666%207.99934C14.1666%207.18952%2014.0069%206.38766%2013.6967%205.63963C13.3865%204.8916%2012.9317%204.2121%2012.3586%203.64C12.3122%203.59351%2012.2754%203.53834%2012.2503%203.47764C12.2252%203.41693%2012.2124%203.35188%2012.2124%203.2862C12.2125%203.22052%2012.2255%203.15549%2012.2507%203.09483C12.2759%203.03417%2012.3128%202.97907%2012.3593%202.93267C12.4057%202.88627%2012.4609%202.84948%2012.5216%202.8244C12.5823%202.79932%2012.6474%202.78645%2012.7131%202.78651C12.7787%202.78657%2012.8438%202.79957%2012.9044%202.82476C12.9651%202.84995%2013.0202%202.88685%2013.0666%202.93334C13.7327%203.59825%2014.2612%204.38801%2014.6218%205.25741C14.9824%206.12681%2015.168%207.05879%2015.168%208C15.168%208.94122%2014.9824%209.87319%2014.6218%2010.7426C14.2612%2011.612%2013.7327%2012.4018%2013.0666%2013.0667C13.02%2013.1134%2012.9646%2013.1504%2012.9036%2013.1756C12.8426%2013.2007%2012.7772%2013.2129%2012.7113%2013.2127Z'%20fill='%233B5695'/%3e%3c/svg%3e",$o="data:image/svg+xml,%3csvg%20class='swap-on%20fill-current%20h-4%20w-4'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill-rule='evenodd'%20d='M4.5%207.5a3%203%200%200%201%203-3h9a3%203%200%200%201%203%203v9a3%203%200%200%201-3%203h-9a3%203%200%200%201-3-3v-9Z'%20clip-rule='evenodd'%20fill='%238595BE'/%3e%3c/svg%3e",xt=Ce("tts",()=>{const e=n.ref({src:null,target:null});function l(s){s.src&&(e.value.src=s.src),s.target&&(e.value.target=s.target)}function t(s){if(s==="src")return e.value.src;if(s==="target")return e.value.target}function o(){e.value={src:null,target:null}}return{tts:e,set:l,get:t,reset:o}}),Vo=[n.createElementVNode("img",{src:ko,alt:"Play"},null,-1)],To=[n.createElementVNode("img",{src:$o,alt:"Stop"},null,-1)],No={__name:"SpeakBtn",props:{type:{type:String,default:""}},emits:["loadTTS"],setup(e,{emit:l}){const t=xt(),o=e,s=l,a=n.computed(()=>t.tts[o.type]),i=n.ref(!1),r=new Audio;n.watch(a,()=>{if(!a.value){i.value=!1;return}u()},{immediate:!0});function c(){if(a.value){u();return}i.value=!0,s("loadTTS")}function u(){a.value&&(r.src=a.value,i.value=!0,r.play().catch(()=>{i.value=!1}))}function p(){r.pause(),r.currentTime=0,i.value=!1}return r.onended=()=>{i.value=!1},(m,b)=>i.value?(n.openBlock(),n.createElementBlock("button",{key:1,class:"btn btn-xs btn-ghost btn-circle",onClick:n.withModifiers(p,["prevent"])},To)):(n.openBlock(),n.createElementBlock("button",{key:0,class:"btn btn-xs btn-ghost btn-circle",onClick:n.withModifiers(c,["prevent"])},Vo))}},Io="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.19102%203.19102C3.44571%202.93633%203.85864%202.93633%204.11333%203.19102L12.809%2011.8867C13.0637%2012.1414%2013.0637%2012.5543%2012.809%2012.809C12.5543%2013.0637%2012.1414%2013.0637%2011.8867%2012.809L3.19102%204.11333C2.93633%203.85864%202.93633%203.44571%203.19102%203.19102Z'%20fill='%231A1F2A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.809%203.19102C13.0637%203.44571%2013.0637%203.85864%2012.809%204.11333L4.11333%2012.809C3.85864%2013.0637%203.44571%2013.0637%203.19102%2012.809C2.93633%2012.5543%202.93633%2012.1414%203.19102%2011.8867L11.8867%203.19102C12.1414%202.93633%2012.5543%202.93633%2012.809%203.19102Z'%20fill='%231A1F2A'/%3e%3c/svg%3e",Bo={},Lo={class:"btn btn-xs btn-circle btn-ghost"},Ro=[n.createElementVNode("img",{src:Io,alt:"Clear",class:"w-4"},null,-1)];function Mo(e,l){return n.openBlock(),n.createElementBlock("button",Lo,Ro)}const Po=xe(Bo,[["render",Mo]]),Do="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.47207%201.31905C7.57125%201.12371%207.77589%201%208.00001%201C8.22413%201%208.42877%201.12367%208.52795%201.31905L10.3721%204.95175L14.4959%205.53427C14.7177%205.5656%2014.9019%205.7166%2014.9712%205.9238C15.0404%206.13101%2014.9827%206.35843%2014.8222%206.51049L11.8382%209.33816L12.5427%2013.3309C12.5806%2013.5456%2012.4897%2013.7626%2012.3084%2013.8906C12.1272%2014.0187%2011.8868%2014.0356%2011.6884%2013.9342L8.00004%2012.0491L4.31158%2013.9343C4.11323%2014.0356%203.87286%2014.0187%203.69157%2013.8907C3.51028%2013.7627%203.4195%2013.5457%203.45736%2013.3309L4.1618%209.33819L1.17781%206.51052C1.01735%206.35846%200.959571%206.13101%201.02884%205.92383C1.09807%205.71663%201.28232%205.56563%201.50409%205.53431L5.62787%204.95178L7.47207%201.31905Z'%20fill='%23FFC857'/%3e%3c/svg%3e",Ao="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.9491%205.89315C14.8278%205.53128%2014.5111%205.27252%2014.1226%205.21783L10.5264%204.7114L8.91813%201.55315C8.74435%201.21195%208.39257%201%207.99998%201C7.60739%201%207.25557%201.21195%207.08183%201.55315L5.47358%204.7114L1.8774%205.21783C1.48888%205.27252%201.17219%205.53128%201.05086%205.89315C0.929554%206.25501%201.02881%206.64477%201.30993%206.91038L3.91217%209.36871L3.29786%2012.8399C3.2315%2013.215%203.38755%2013.5868%203.7052%2013.8105C3.88128%2013.9344%204.08938%2014%204.30704%2014C4.47232%2014%204.63705%2013.9606%204.78341%2013.886L7.99995%2012.2471L11.2165%2013.886C11.3628%2013.9606%2011.5276%2014%2011.6929%2014C11.9106%2014%2012.1187%2013.9345%2012.2948%2013.8105C12.6124%2013.5868%2012.7685%2013.215%2012.7021%2012.84L12.0878%209.36871L14.6901%206.91035C14.9712%206.64477%2015.0704%206.25498%2014.9491%205.89315ZM14.0266%206.25082L11.2455%208.87813C11.1335%208.98392%2011.0824%209.13637%2011.1089%209.28575L11.7654%2012.9956C11.7701%2013.0226%2011.759%2013.0493%2011.7362%2013.0653C11.7202%2013.0766%2011.7038%2013.079%2011.6929%2013.079C11.6809%2013.079%2011.6694%2013.0762%2011.6587%2013.0708L8.22108%2011.3192C8.15189%2011.284%208.07593%2011.2663%207.99998%2011.2663C7.92402%2011.2663%207.84807%2011.284%207.77882%2011.3193L4.34118%2013.0708C4.33052%2013.0763%204.31904%2013.079%204.30701%2013.079C4.29611%2013.079%204.27969%2013.0767%204.26373%2013.0654C4.24092%2013.0494%204.22975%2013.0226%204.2345%2012.9957L4.89104%209.28584C4.91747%209.13646%204.86637%208.98401%204.75439%208.87822L1.97327%206.25091C1.95308%206.23184%201.94595%206.20383%201.95466%206.17786C1.9634%206.15185%201.98612%206.13326%202.01405%206.12933L5.85743%205.58807C6.0122%205.56626%206.14599%205.47208%206.21521%205.33616L7.93404%201.9608C7.94653%201.9363%207.97178%201.92107%207.99998%201.92107C8.02818%201.92107%208.05343%201.9363%208.06591%201.9608L9.78468%205.33607C9.85391%205.47199%209.9877%205.5662%2010.1425%205.58799L13.9859%206.12924C14.0138%206.1332%2014.0365%206.15176%2014.0452%206.17777C14.0539%206.20374%2014.0468%206.23175%2014.0266%206.25082Z'%20fill='%231A1F2A'/%3e%3c/svg%3e",Fo={class:"btn btn-xs btn-circle btn-ghost"},jo={key:0,src:Do,alt:"Clear",class:"w-4"},Ho={key:1,src:Ao,alt:"Clear",class:"w-4"},zo={__name:"FavoriteBtn",props:{isFilled:Boolean},setup(e){const l=e;return(t,o)=>(n.openBlock(),n.createElementBlock("button",Fo,[l.isFilled?(n.openBlock(),n.createElementBlock("img",jo)):(n.openBlock(),n.createElementBlock("img",Ho))]))}},Uo={class:"flex flex-row rounded-t-lg bg-white border border-b-0 px-1 pr-1 pt-1 gap-1 items-center"},Zo={class:"text-sm text-gray-600"},Wo={key:0,class:"italic"},Go=n.createElementVNode("div",{class:"flex-grow"},null,-1),yt={__name:"TranslationBtnGroup",props:{loading:{type:Boolean,default:!1},src:{type:String,default:""},srcLabel:{type:String,default:""},type:{type:String,default:""},phonetic:{type:String,default:""},isClearBtn:{type:Boolean,default:!1},isFavoriteBtn:{type:Boolean,default:!1},isFavorite:{type:Boolean,default:!1},onFavorite:{type:Function,default:()=>{}}},emits:["clear","favorite","loadTTS"],setup(e,{emit:l}){const t=e,o=l;return(s,a)=>(n.openBlock(),n.createElementBlock("div",Uo,[n.createVNode(No,{type:t.type,onLoadTTS:a[0]||(a[0]=i=>o("loadTTS"))},null,8,["type"]),n.createElementVNode("div",Zo,[n.createTextVNode(n.toDisplayString(e.srcLabel)+" ",1),e.phonetic?(n.openBlock(),n.createElementBlock("span",Wo,"- ["+n.toDisplayString(t.phonetic)+"]",1)):n.createCommentVNode("",!0)]),Go,t.loading?(n.openBlock(),n.createBlock(Oo,{key:0})):n.createCommentVNode("",!0),t.src&&t.isClearBtn?(n.openBlock(),n.createBlock(Po,{key:1,onClick:a[1]||(a[1]=i=>o("clear"))})):n.createCommentVNode("",!0),t.src&&t.isFavoriteBtn?(n.openBlock(),n.createBlock(zo,{key:2,isFilled:t.isFavorite,onClick:a[2]||(a[2]=i=>o("favorite"))},null,8,["isFilled"])):n.createCommentVNode("",!0)]))}},X=Ce("translation",()=>{const e=n.ref(null),l=n.ref(null),t=n.ref(null),o=n.ref({src:null,target:null}),s=n.ref(null),a=n.ref([]),i=n.ref([]),r=n.ref([]),c=n.ref([]),u=n.ref({src:null,target:null}),p=_e(),m=n.computed(()=>p.getLabel(e.value)),b=n.computed(()=>p.getLabel(l.value));function x(g){e.value=g.src,l.value=g.target,t.value=g.text,o.value=g.phonetic,s.value=g.result,a.value=g.dictionary,i.value=g.definitions,r.value=g.synonyms,c.value=g.examples,u.value=g.tts}function h(){e.value=null,l.value=null,t.value=null,o.value={src:null,target:null},s.value=null,a.value=[],i.value=[],r.value=[],c.value=[],u.value={src:null,target:null}}return{src:e,srcLabel:m,target:l,targetLabel:b,phonetic:o,text:t,result:s,dictionary:a,definitions:i,synonyms:r,examples:c,tts:u,init:x,reset:h}});function qo(e){return n.getCurrentScope()?(n.onScopeDispose(e),!0):!1}function ye(e){return typeof e=="function"?e():n.unref(e)}const Jo=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const wt=()=>{};function Ko(e,l){function t(...o){return new Promise((s,a)=>{Promise.resolve(e(()=>l.apply(this,o),{fn:l,thisArg:this,args:o})).then(s).catch(a)})}return t}function Yo(e,l={}){let t,o,s=wt;const a=r=>{clearTimeout(r),s(),s=wt};return r=>{const c=ye(e),u=ye(l.maxWait);return t&&a(t),c<=0||u!==void 0&&u<=0?(o&&(a(o),o=null),Promise.resolve(r())):new Promise((p,m)=>{s=l.rejectOnCancel?m:p,u&&!o&&(o=setTimeout(()=>{t&&a(t),o=null,p(r())},u)),t=setTimeout(()=>{o&&a(o),o=null,p(r())},c)})}}function Qo(e,l=200,t={}){return Ko(Yo(l,t),e)}function Et(e){var l;const t=ye(e);return(l=t==null?void 0:t.$el)!=null?l:t}const Xo=Jo?window:void 0;function el(){const e=n.ref(!1),l=n.getCurrentInstance();return l&&n.onMounted(()=>{e.value=!0},l),e}function tl(e){const l=el();return n.computed(()=>(l.value,!!e()))}function nl(e,l,t={}){const{window:o=Xo,...s}=t;let a;const i=tl(()=>o&&"ResizeObserver"in o),r=()=>{a&&(a.disconnect(),a=void 0)},c=n.computed(()=>Array.isArray(e)?e.map(m=>Et(m)):[Et(e)]),u=n.watch(c,m=>{if(r(),i.value&&o){a=new ResizeObserver(l);for(const b of m)b&&a.observe(b,s)}},{immediate:!0,flush:"post"}),p=()=>{r(),u()};return qo(p),{isSupported:i,stop:p}}function St(e){var l;const t=n.ref(e==null?void 0:e.element),o=n.ref(e==null?void 0:e.input),s=(l=e==null?void 0:e.styleProp)!=null?l:"height",a=n.ref(1);function i(){var r;if(!t.value)return;let c="";t.value.style[s]="1px",a.value=(r=t.value)==null?void 0:r.scrollHeight,e!=null&&e.styleTarget?ye(e.styleTarget).style[s]=`${a.value}px`:c=`${a.value}px`,t.value.style[s]=c}return n.watch([o,t],()=>n.nextTick(i),{immediate:!0}),n.watch(a,()=>{var r;return(r=e==null?void 0:e.onResize)==null?void 0:r.call(e)}),nl(t,()=>i()),e!=null&&e.watch&&n.watch(e.watch,i,{immediate:!0,deep:!0}),{textarea:t,input:o,triggerResize:i}}const ol=xe({__name:"TranslationInput",props:{text:{type:String,default:""}},emits:["change","clear","loadTTS"],setup(e,{emit:l}){const t=X(),o=e,s=n.ref(""),a=n.computed(()=>t.src),i=n.computed(()=>t.srcLabel),r=n.computed(()=>{var h;return(h=t.phonetic)==null?void 0:h.src}),{textarea:c}=St({input:s,styleProp:"minHeight"}),u=l,p=Qo(()=>{u("change",s.value)},yo.INPUT_DEBOUNCE);function m(){if(!s.value){b();return}p()}function b(){u("clear"),s.value="",c.value.focus()}async function x(){await n.nextTick(),c.value.select()}return n.watch(()=>o.text,h=>{s.value!==h&&x(),s.value=h}),(h,g)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(yt,{src:a.value,srcLabel:i.value,type:"src",phonetic:r.value,isClearBtn:!0,onClear:b,onLoadTTS:g[0]||(g[0]=$=>u("loadTTS"))},null,8,["src","srcLabel","phonetic"]),n.withDirectives(n.createElementVNode("textarea",{ref_key:"textarea",ref:c,"onUpdate:modelValue":g[1]||(g[1]=$=>s.value=$),class:"w-full border rounded-b-md border-t-0 outline-none outline-0 px-3 pl-5 bg-white text-gray-800 font-semibold resize-none pb-3 overflow-x-hidden overflow-y-hidden",autofocus:"",rows:"2",onInput:m,onFocus:x},null,544),[[n.vModelText,s.value,void 0,{trim:!0}]])],64))}},[["__scopeId","data-v-90bf3e0d"]]),Ot=Ce("loader",()=>({loading:n.ref(!1)})),ll=e=>(n.pushScopeId("data-v-4b9f4a7b"),e=e(),n.popScopeId(),e),sl={class:"flex flex-col"},rl=ll(()=>n.createElementVNode("div",{class:"w-full flex align-item-center justify-end mt-2"},null,-1)),al=xe({__name:"TranslationResult",props:{isFavoriteFeatureEnabled:Boolean},emits:["loadTTS"],setup(e,{emit:l}){const t=X(),o=n.ref(!1),s=n.computed(()=>t.result),a=n.computed(()=>t.target),i=n.computed(()=>t.targetLabel),r=n.computed(()=>{var x;return(x=t.phonetic)==null?void 0:x.target}),c=e,u=Ot(),{textarea:p,input:m}=St({input:s,styleProp:"minHeight"}),b=l;return(x,h)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(yt,{loading:n.unref(u).loading,src:a.value,srcLabel:i.value,type:"target",isFavoriteBtn:c.isFavoriteFeatureEnabled,isFavorite:o.value,phonetic:r.value,onFavorite:h[0]||(h[0]=g=>o.value=!o.value),onLoadTTS:h[1]||(h[1]=g=>b("loadTTS"))},null,8,["loading","src","srcLabel","isFavoriteBtn","isFavorite","phonetic"]),n.createElementVNode("div",sl,[n.withDirectives(n.createElementVNode("textarea",{ref_key:"textarea",ref:p,"onUpdate:modelValue":h[2]||(h[2]=g=>n.isRef(m)?m.value=g:null),class:"w-full border rounded-b-md border-t-0 outline-none outline-0 px-3 pl-5 bg-white text-gray-800 font-semibold resize-none pb-3 overflow-x-hidden overflow-y-hidden",readonly:"",rows:"2",spellcheck:"false"},null,512),[[n.vModelText,n.unref(m)]]),rl])],64))}},[["__scopeId","data-v-4b9f4a7b"]]),il={class:"btn btn-sm btn-circle btn-ghost"},we={__name:"ToggleBtn",props:{isExpanded:Boolean},setup(e){const l=e;return(t,o)=>(n.openBlock(),n.createElementBlock("button",il,[l.isExpanded?(n.openBlock(),n.createBlock(n.unref(Fn),{key:0,class:"w-7 text-gray-400"})):(n.openBlock(),n.createBlock(n.unref(Dn),{key:1,class:"w-7 text-gray-400"}))]))}},cl={class:"card border bg-white rounded-lg"},ul={class:"card-body px-4 py-2 gap-0"},dl={class:"flex justify-between items-center"},fl=n.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Translations",-1),pl={class:"capitalize text-base font-normal text-textSecondary mb-1"},ml={class:"list-none list-inside"},hl=["onClick"],gl={class:"text-base font-normal text-gray-800 leading-4"},bl={__name:"Dictionary",emits:["translate"],setup(e,{emit:l}){const t=n.ref(!0),o=X(),s=_e(),a=n.computed(()=>o.dictionary),i=l,r=()=>{t.value=!t.value},c=u=>{i("translate",u,o.target,o.src),s.src=o.target,s.target=o.src,window.scrollTo(0,0)};return(u,p)=>(n.openBlock(),n.createElementBlock("div",cl,[n.createElementVNode("div",ul,[n.createElementVNode("div",dl,[fl,n.createVNode(we,{isExpanded:t.value,onClick:r},null,8,["isExpanded"])]),n.createElementVNode("div",{class:n.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",t.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[n.createElementVNode("ul",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value,(m,b)=>(n.openBlock(),n.createElementBlock("li",{key:`${m.pos}-${b}`,class:"mb-2"},[n.createElementVNode("h5",pl,n.toDisplayString(m.pos),1),n.createElementVNode("ul",ml,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.items,(x,h)=>(n.openBlock(),n.createElementBlock("li",{key:`${x.word}-${h}`},[n.createElementVNode("span",{class:"p-3 m-0.5 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded-lg",onClick:g=>c(x.word)},n.toDisplayString(x.word),9,hl),n.createElementVNode("small",gl," - "+n.toDisplayString(x.reverse_translation.join(", ")),1)]))),128))])]))),128))])],2)])]))}},vl={class:"card border bg-white rounded-lg"},Cl={class:"card-body px-4 py-2 gap-0"},_l={class:"flex justify-between items-center"},xl=n.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Definitions",-1),yl={class:"capitalize text-base font-normal text-textSecondary mb-1"},wl={class:"text-base text-textCustom list-decimal list-outside ml-5"},El=n.createElementVNode("br",null,null,-1),Sl={key:0,class:"italic"},Ol={__name:"Definition",setup(e){const l=n.ref(!0),t=X(),o=n.computed(()=>t.definitions),s=()=>{l.value=!l.value};return(a,i)=>(n.openBlock(),n.createElementBlock("div",vl,[n.createElementVNode("div",Cl,[n.createElementVNode("div",_l,[xl,n.createVNode(we,{isExpanded:l.value,onClick:s},null,8,["isExpanded"])]),n.createElementVNode("div",{class:n.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",l.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[n.createElementVNode("ul",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.value,(r,c)=>(n.openBlock(),n.createElementBlock("li",{key:`${r.pos}-${c}`,class:"mb-2"},[n.createElementVNode("h5",yl,n.toDisplayString(r.pos),1),n.createElementVNode("ul",wl,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.items,(u,p)=>(n.openBlock(),n.createElementBlock("li",{key:`${u.gloss}-${p}`,class:"mb-1"},[n.createElementVNode("span",null,n.toDisplayString(u.gloss),1),El,u.example?(n.openBlock(),n.createElementBlock("small",Sl,'"'+n.toDisplayString(u.example)+'"',1)):n.createCommentVNode("",!0)]))),128))])]))),128))])],2)])]))}},kl={class:"card border bg-white rounded-lg"},$l={class:"card-body px-4 py-2 gap-0"},Vl={class:"flex justify-between items-center"},Tl=n.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Examples",-1),Nl={class:"text-textCustom list-decimal list-outside ml-7 mt-2"},Il=["innerHTML"],Bl={__name:"Example",setup(e){const l=n.ref(!0),t=X(),o=n.computed(()=>t.examples),s=()=>{l.value=!l.value};return(a,i)=>(n.openBlock(),n.createElementBlock("div",kl,[n.createElementVNode("div",$l,[n.createElementVNode("div",Vl,[Tl,n.createVNode(we,{isExpanded:l.value,onClick:s},null,8,["isExpanded"])]),n.createElementVNode("div",{class:n.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",l.value?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"])},[n.createElementVNode("ul",Nl,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.value,(r,c)=>(n.openBlock(),n.createElementBlock("li",{key:`${r.definition_id}-${c}`,innerHTML:r},null,8,Il))),128))])],2)])]))}},Ll={class:"card border bg-white rounded-lg"},Rl={class:"card-body px-4 py-2 gap-0"},Ml={class:"flex justify-between items-center"},Pl=n.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Synonyms",-1),Dl={class:"capitalize text-base font-normal text-textSecondary mb-1"},Al={class:"list-none list-inside"},Fl={class:"flex flex-wrap"},jl=["onClick"],Hl={__name:"Synonyms",emits:["translate"],setup(e,{emit:l}){const t=n.ref(!0),o=X(),s=n.computed(()=>o.synonyms),a=l,i=()=>{t.value=!t.value},r=c=>{a("translate",c),window.scrollTo(0,0)};return(c,u)=>(n.openBlock(),n.createElementBlock("div",Ll,[n.createElementVNode("div",Rl,[n.createElementVNode("div",Ml,[Pl,n.createVNode(we,{isExpanded:t.value,onClick:i},null,8,["isExpanded"])]),n.createElementVNode("div",{class:n.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",t.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[n.createElementVNode("ul",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value,(p,m)=>(n.openBlock(),n.createElementBlock("li",{key:`${p.pos}-${m}`,class:"mb-2"},[n.createElementVNode("h5",Dl,n.toDisplayString(p.pos),1),n.createElementVNode("ul",Al,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(p.items,(b,x)=>(n.openBlock(),n.createElementBlock("li",{key:`${b.word}-${x}`,class:"mb-2"},[n.createElementVNode("div",Fl,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(b.synonym,(h,g)=>(n.openBlock(),n.createElementBlock("span",{key:`${h}-${g}`,class:"p-3 m-0.5 ml-0 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded-lg",onClick:$=>r(h)},n.toDisplayString(h),9,jl))),128))])]))),128))])]))),128))])],2)])]))}},zl={class:"bg-white min-h-screen flex flex-col"},Ul={class:"py-2 px-5 shadow-lg"},Zl={class:"px-5 flex-grow"},Wl={class:"flex flex-col lg:flex-row lg:gap-2"},Gl={class:"w-full lg:w-[calc(50%-1rem)] my-2"},ql=n.createElementVNode("div",{class:"w-6 h-4 mx-auto hidden lg:block"},null,-1),Jl={class:"w-full lg:w-[calc(50%-1rem)] my-2"},Kl={class:"grid grid-cols-1 lg:grid-cols-3 gap-4"},Yl={key:0,class:"w-full my-4"},Ql={key:1,class:"text-textCustom italic font-medium"},Xl={__name:"Popup",props:{opt:{type:Object,default:null},languages:{type:Object,default:null},translation:{type:Object,default:null},tts:{type:Object,default:null},isFavoriteFeatureEnabled:{type:Boolean,default:!1}},emits:["opt","translate","reader","settings","fullscreen","loadTTS"],setup(e,{emit:l}){const t=go(),o=X(t),s=xt(t),a=_e(t),i=Ot(t),r=e,c=l,u=n.ref("");n.watch(()=>r.translation,h=>{i.loading=!1,u.value=h.text,o.init(h),s.reset()},{immediate:!0}),n.watch(()=>r.tts,h=>{if(!h){s.reset();return}s.set(h)},{immediate:!0}),n.watch([()=>r.opt,()=>r.languages],([h,g])=>{a.init(h,g)}),n.watch([()=>a.src,()=>a.target],([h,g])=>{c("opt",{src:h,target:g}),x(u.value)}),n.onMounted(()=>{a.init(r.opt,r.languages)});function p(){u.value="",o.reset()}function m(h){x(h)}function b(h){const g=h==="src"?o.text:o.result;c("loadTTS",{type:h,data:g})}function x(h,g=a.src,$=a.target){h&&(u.value=h,i.loading=!0,c("translate",{src:g,target:$,text:h}))}return(h,g)=>(n.openBlock(),n.createElementBlock("div",zl,[n.createElementVNode("div",Ul,[n.createVNode(Pt,{onReader:g[0]||(g[0]=$=>c("reader")),onSettings:g[1]||(g[1]=$=>c("settings")),onFullScreen:g[2]||(g[2]=$=>c("fullscreen"))})]),n.createElementVNode("div",Zl,[n.createVNode(xo,{class:"my-4"}),n.createElementVNode("div",Wl,[n.createElementVNode("div",Gl,[n.createVNode(ol,{text:u.value,onChange:m,onClear:p,onLoadTTS:g[3]||(g[3]=$=>b("src"))},null,8,["text"])]),ql,n.createElementVNode("div",Jl,[n.createVNode(al,{isFavoriteFeatureEnabled:e.isFavoriteFeatureEnabled,onLoadTTS:g[4]||(g[4]=$=>b("target"))},null,8,["isFavoriteFeatureEnabled"])])]),r.translation?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("div",Kl,[n.unref(o).dictionary.length?(n.openBlock(),n.createBlock(bl,{key:0,onTranslate:x})):n.createCommentVNode("",!0),n.unref(o).definitions.length?(n.openBlock(),n.createBlock(Ol,{key:1})):n.createCommentVNode("",!0),n.unref(o).synonyms.length?(n.openBlock(),n.createBlock(Hl,{key:2,onTranslate:x})):n.createCommentVNode("",!0)]),n.unref(o).examples.length?(n.openBlock(),n.createElementBlock("div",Yl,[n.createVNode(Bl)])):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock("span",Ql,"Service unavailable"))])]))}};G.default=Xl,Object.defineProperties(G,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|