@ddict/popup 1.0.9 → 1.0.11
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/README.md +5 -1
- package/dist/popup.css +1 -1
- package/dist/popup.es.js +1214 -1215
- package/dist/popup.umd.js +9 -9
- package/package.json +5 -4
package/dist/popup.umd.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
(function(q,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(q=typeof globalThis<"u"?globalThis:q||self,r(q.Popup={},q.Vue))})(this,function(q,r){"use strict";function Ot(n,i){for(var e=0;e<i.length;e++){const o=i[e];if(typeof o!="string"&&!Array.isArray(o)){for(const a in o)if(a!=="default"&&!(a in n)){const s=Object.getOwnPropertyDescriptor(o,a);s&&Object.defineProperty(n,a,s.get?s:{enumerable:!0,get:()=>o[a]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}const It="/assets/icons/logo.svg",$t="/assets/icons/book-one.svg",Ct="/assets/icons/arrow-full-screen.svg",Vt="/assets/icons/setting.svg",Nt={class:"flex justify-between"},Pt=r.createElementVNode("div",{class:"flex flex-row"},[r.createElementVNode("img",{src:It,alt:"Vue logo",class:"w-24"})],-1),Bt={class:"flex"},Rt=[r.createElementVNode("img",{src:$t,alt:"Reader",class:"w-7"},null,-1)],Dt=[r.createElementVNode("img",{src:Ct,alt:"Full screen",class:"w-7"},null,-1)],Lt=[r.createElementVNode("img",{src:Vt,alt:"Setting",class:"w-7"},null,-1)],Mt={__name:"Header",emits:["settings","fullScreen","reader"],setup(n,{emit:i}){const e=i;return(o,a)=>(r.openBlock(),r.createElementBlock("div",Nt,[Pt,r.createElementVNode("div",Bt,[r.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:a[0]||(a[0]=s=>e("reader"))},Rt),r.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:a[1]||(a[1]=s=>e("fullScreen"))},Dt),r.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:a[2]||(a[2]=s=>e("settings"))},Lt)])]))}};function oe(n,i,e){let o=e.initialDeps??[],a;return()=>{var s,d,c,p;let m;e.key&&((s=e.debug)!=null&&s.call(e))&&(m=Date.now());const g=n();if(!(g.length!==o.length||g.some((u,f)=>o[f]!==u)))return a;o=g;let l;if(e.key&&((d=e.debug)!=null&&d.call(e))&&(l=Date.now()),a=i(...g),e.key&&((c=e.debug)!=null&&c.call(e))){const u=Math.round((Date.now()-m)*100)/100,f=Math.round((Date.now()-l)*100)/100,h=f/16,v=(_,w)=>{for(_=String(_);_.length<w;)_=" "+_;return _};console.info(`%c⏱ ${v(f,5)} /${v(u,5)} ms`,`
|
|
1
|
+
(function(W,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(W=typeof globalThis<"u"?globalThis:W||self,r(W.Popup={},W.Vue))})(this,function(W,r){"use strict";function kt(n,i){for(var e=0;e<i.length;e++){const o=i[e];if(typeof o!="string"&&!Array.isArray(o)){for(const a in o)if(a!=="default"&&!(a in n)){const s=Object.getOwnPropertyDescriptor(o,a);s&&Object.defineProperty(n,a,s.get?s:{enumerable:!0,get:()=>o[a]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}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",It="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",Lt={class:"flex justify-between"},Bt=r.createElementVNode("div",{class:"flex flex-row"},[r.createElementVNode("img",{src:Ot,alt:"Vue logo",class:"w-24"})],-1),Nt={class:"flex"},Pt=[r.createElementVNode("img",{src:It,alt:"Reader",class:"w-7"},null,-1)],Mt=[r.createElementVNode("img",{src:Vt,alt:"Full screen",class:"w-7"},null,-1)],Rt=[r.createElementVNode("img",{src:$t,alt:"Setting",class:"w-7"},null,-1)],Dt={__name:"Header",emits:["settings","fullScreen","reader"],setup(n,{emit:i}){const e=i;return(o,a)=>(r.openBlock(),r.createElementBlock("div",Lt,[Bt,r.createElementVNode("div",Nt,[r.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:a[0]||(a[0]=s=>e("reader"))},Pt),r.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:a[1]||(a[1]=s=>e("fullScreen"))},Mt),r.createElementVNode("button",{class:"btn btn-ghost btn-circle",onClick:a[2]||(a[2]=s=>e("settings"))},Rt)])]))}};function oe(n,i,e){let o=e.initialDeps??[],a;return()=>{var s,d,c,p;let m;e.key&&((s=e.debug)!=null&&s.call(e))&&(m=Date.now());const v=n();if(!(v.length!==o.length||v.some((u,f)=>o[f]!==u)))return a;o=v;let l;if(e.key&&((d=e.debug)!=null&&d.call(e))&&(l=Date.now()),a=i(...v),e.key&&((c=e.debug)!=null&&c.call(e))){const u=Math.round((Date.now()-m)*100)/100,f=Math.round((Date.now()-l)*100)/100,h=f/16,g=(_,w)=>{for(_=String(_);_.length<w;)_=" "+_;return _};console.info(`%c⏱ ${g(f,5)} /${g(u,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
|
-
color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,e==null?void 0:e.key)}return(p=e==null?void 0:e.onChange)==null||p.call(e,a),a}}function Se(n,i){if(n===void 0)throw new Error("Unexpected undefined");return n}const Ft=(n,i)=>Math.abs(n-i)<1,jt=(n,i,e)=>{let o;return function(...a){n.clearTimeout(o),o=n.setTimeout(()=>i.apply(this,a),e)}},Ht=n=>n,Gt=n=>{const i=Math.max(n.startIndex-n.overscan,0),e=Math.min(n.endIndex+n.overscan,n.count-1),o=[];for(let a=i;a<=e;a++)o.push(a);return o},Ut=(n,i)=>{const e=n.scrollElement;if(!e)return;const o=n.targetWindow;if(!o)return;const a=d=>{const{width:c,height:p}=d;i({width:Math.round(c),height:Math.round(p)})};if(a(e.getBoundingClientRect()),!o.ResizeObserver)return()=>{};const s=new o.ResizeObserver(d=>{const c=d[0];if(c!=null&&c.borderBoxSize){const p=c.borderBoxSize[0];if(p){a({width:p.inlineSize,height:p.blockSize});return}}a(e.getBoundingClientRect())});return s.observe(e,{box:"border-box"}),()=>{s.unobserve(e)}},De={passive:!0},zt=typeof window>"u"?!0:"onscrollend"in window,Wt=(n,i)=>{const e=n.scrollElement;if(!e)return;const o=n.targetWindow;if(!o)return;let a=0;const s=zt?()=>{}:jt(o,()=>{i(a,!1)},n.options.isScrollingResetDelay),d=m=>()=>{a=e[n.options.horizontal?"scrollLeft":"scrollTop"],s(),i(a,m)},c=d(!0),p=d(!1);return p(),e.addEventListener("scroll",c,De),e.addEventListener("scrollend",p,De),()=>{e.removeEventListener("scroll",c),e.removeEventListener("scrollend",p)}},qt=(n,i,e)=>{if(i!=null&&i.borderBoxSize){const o=i.borderBoxSize[0];if(o)return Math.round(o[e.options.horizontal?"inlineSize":"blockSize"])}return Math.round(n.getBoundingClientRect()[e.options.horizontal?"width":"height"])},Xt=(n,{adjustments:i=0,behavior:e},o)=>{var a,s;const d=n+i;(s=(a=o.scrollElement)==null?void 0:a.scrollTo)==null||s.call(a,{[o.options.horizontal?"left":"top"]:d,behavior:e})};class Yt{constructor(i){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 e=null;const o=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(a=>{a.forEach(s=>{this._measureElement(s.target,s)})}));return{disconnect:()=>{var a;return(a=o())==null?void 0:a.disconnect()},observe:a=>{var s;return(s=o())==null?void 0:s.observe(a,{box:"border-box"})},unobserve:a=>{var s;return(s=o())==null?void 0:s.unobserve(a)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([o,a])=>{typeof a>"u"&&delete e[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ht,rangeExtractor:Gt,onChange:()=>{},measureElement:qt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,...e}},this.notify=(e,o)=>{var a,s;const{startIndex:d,endIndex:c}=this.range??{startIndex:void 0,endIndex:void 0},p=this.calculateRange();(e||d!==(p==null?void 0:p.startIndex)||c!==(p==null?void 0:p.endIndex))&&((s=(a=this.options).onChange)==null||s.call(a,this,o))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.observer.disconnect(),this.elementsCache.clear()},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;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=((e=this.scrollElement)==null?void 0:e.window)??null,this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(a,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<a?"forward":"backward":null,this.scrollOffset=a;const d=this.isScrolling;this.isScrolling=s,this.notify(d!==s,s)}))}},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=(e,o)=>{const a=new Map,s=new Map;for(let d=o-1;d>=0;d--){const c=e[d];if(a.has(c.lane))continue;const p=s.get(c.lane);if(p==null||c.end>p.end?s.set(c.lane,c):c.end<p.end&&a.set(c.lane,!0),a.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((d,c)=>d.end===c.end?d.index-c.index:d.end-c.end)[0]:void 0},this.getMeasurementOptions=oe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(e,o,a,s,d)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:o,scrollMargin:a,getItemKey:s,enabled:d}),{key:!1}),this.getMeasurements=oe(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:o,scrollMargin:a,getItemKey:s,enabled:d},c)=>{var p;if(!d)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(t=>{this.itemSizeCache.set(t.key,t.size)}));const m=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const g=this.measurementsCache.slice(0,m);for(let t=m;t<e;t++){let l=(p=this.measurementsCache[t])==null?void 0:p.measureElement;l||(l=I=>{const x=s(t),$=this.elementsCache.get(x);if(!I){$&&(this.observer.unobserve($),this.elementsCache.delete(x));return}$!==I&&($&&this.observer.unobserve($),this.observer.observe(I),this.elementsCache.set(x,I)),I.isConnected&&this.resizeItem(t,this.options.measureElement(I,void 0,this))});const u=s(t),f=this.options.lanes===1?g[t-1]:this.getFurthestMeasurement(g,t),h=f?f.end+this.options.gap:o+a,v=c.get(u),_=typeof v=="number"?v:this.options.estimateSize(t),w=h+_,k=f?f.lane:t%this.options.lanes;g[t]={index:t,start:h,size:_,end:w,key:u,lane:k,measureElement:l}}return this.measurementsCache=g,g},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=oe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(e,o,a)=>this.range=e.length>0&&o>0?Qt({measurements:e,outerSize:o,scrollOffset:a}):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],(e,o,a,s)=>o===null?[]:e({startIndex:o.startIndex,endIndex:o.endIndex,overscan:a,count:s}),{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=e=>{const o=this.options.indexAttribute,a=e.getAttribute(o);return a?parseInt(a,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(e,o)=>{const a=this.indexFromElement(e),s=this.getMeasurements()[a];if(!s||!e.isConnected){this.elementsCache.forEach((c,p)=>{c===e&&(this.observer.unobserve(e),this.elementsCache.delete(p))});return}const d=this.elementsCache.get(s.key);d!==e&&(d&&this.observer.unobserve(d),this.observer.observe(e),this.elementsCache.set(s.key,e)),this.resizeItem(a,this.options.measureElement(e,o,this))},this.resizeItem=(e,o)=>{const a=this.getMeasurements()[e];if(!a)return;const s=this.itemSizeCache.get(a.key)??a.size,d=o-s;d!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(a,d,this):a.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",d),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=d,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(a.index),this.itemSizeCache=new Map(this.itemSizeCache.set(a.key,o)),this.notify(!0,!1))},this.measureElement=e=>{e&&this._measureElement(e,void 0)},this.getVirtualItems=oe(()=>[this.getIndexes(),this.getMeasurements()],(e,o)=>{const a=[];for(let s=0,d=e.length;s<d;s++){const c=e[s],p=o[c];a.push(p)}return a},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const o=this.getMeasurements();if(o.length!==0)return Se(o[Le(0,o.length-1,a=>Se(o[a]).start,e)])},this.getOffsetForAlignment=(e,o)=>{const a=this.getSize(),s=this.getScrollOffset();o==="auto"&&(e<=s?o="start":e>=s+a?o="end":o="start"),o==="start"?e=e:o==="end"?e=e-a:o==="center"&&(e=e-a/2);const d=this.options.horizontal?"scrollWidth":"scrollHeight",p=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[d]:this.scrollElement[d]:0)-a;return Math.max(Math.min(p,e),0)},this.getOffsetForIndex=(e,o="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const a=this.getMeasurements()[e];if(!a)return;const s=this.getSize(),d=this.getScrollOffset();if(o==="auto")if(a.end>=d+s-this.options.scrollPaddingEnd)o="end";else if(a.start<=d+this.options.scrollPaddingStart)o="start";else return[d,o];const c=o==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,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=(e,{align:o="start",behavior:a}={})=>{this.cancelScrollToIndex(),a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,o),{adjustments:void 0,behavior:a})},this.scrollToIndex=(e,{align:o="auto",behavior:a}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const s=this.getOffsetForIndex(e,o);if(!s)return;const[d,c]=s;this._scrollToOffset(d,{adjustments:void 0,behavior:a}),a!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(e))){const[m]=Se(this.getOffsetForIndex(e,c));Ft(m,this.getScrollOffset())||this.scrollToIndex(e,{align:c,behavior:a})}else this.scrollToIndex(e,{align:c,behavior:a})}))},this.scrollBy=(e,{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()+e,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var e;const o=this.getMeasurements();let a;return o.length===0?a=this.options.paddingStart:a=this.options.lanes===1?((e=o[o.length-1])==null?void 0:e.end)??0:Math.max(...o.slice(-this.options.lanes).map(s=>s.end)),a-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(e,{adjustments:o,behavior:a})=>{this.options.scrollToFn(e,{behavior:a,adjustments:o},this)},this.measure=()=>{var e,o;this.itemSizeCache=new Map,(o=(e=this.options).onChange)==null||o.call(e,this,!1)},this.setOptions(i)}}const Le=(n,i,e,o)=>{for(;n<=i;){const a=(n+i)/2|0,s=e(a);if(s<o)n=a+1;else if(s>o)i=a-1;else return a}return n>0?n-1:0};function Qt({measurements:n,outerSize:i,scrollOffset:e}){const o=n.length-1,s=Le(0,o,c=>n[c].start,e);let d=s;for(;d<o&&n[d].end<e+i;)d++;return{startIndex:s,endIndex:d}}function Zt(n){const i=new Yt(r.unref(n)),e=r.shallowRef(i),o=i._didMount();return r.watch(()=>r.unref(n).getScrollElement(),a=>{a&&i._willUpdate()},{immediate:!0}),r.watch(()=>r.unref(n),a=>{i.setOptions({...a,onChange:(s,d)=>{var c;r.triggerRef(e),(c=a.onChange)==null||c.call(a,s,d)}}),i._willUpdate(),r.triggerRef(e)},{immediate:!0}),r.onScopeDispose(o),e}function Kt(n){return Zt(r.computed(()=>({observeElementRect:Ut,observeElementOffset:Wt,scrollToFn:Xt,...r.unref(n)})))}function Jt(n,i,e){let o=r.ref(e==null?void 0:e.value),a=r.computed(()=>n.value!==void 0);return[r.computed(()=>a.value?n.value:o.value),function(s){return a.value||(o.value=s),i==null?void 0:i(s)}]}function en(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(i=>setTimeout(()=>{throw i}))}function de(){let n=[],i={addEventListener(e,o,a,s){return e.addEventListener(o,a,s),i.add(()=>e.removeEventListener(o,a,s))},requestAnimationFrame(...e){let o=requestAnimationFrame(...e);i.add(()=>cancelAnimationFrame(o))},nextFrame(...e){i.requestAnimationFrame(()=>{i.requestAnimationFrame(...e)})},setTimeout(...e){let o=setTimeout(...e);i.add(()=>clearTimeout(o))},microTask(...e){let o={current:!0};return en(()=>{o.current&&e[0]()}),i.add(()=>{o.current=!1})},style(e,o,a){let s=e.style.getPropertyValue(o);return Object.assign(e.style,{[o]:a}),this.add(()=>{Object.assign(e.style,{[o]:s})})},group(e){let o=de();return e(o),this.add(()=>o.dispose())},add(e){return n.push(e),()=>{let o=n.indexOf(e);if(o>=0)for(let a of n.splice(o,1))a()}},dispose(){for(let e of n.splice(0))e()}};return i}function tn(){let n=de();return r.onUnmounted(()=>n.dispose()),n}function nn(){let n=tn();return i=>{n.dispose(),n.nextFrame(i)}}let on=Symbol("headlessui.useid"),rn=0;function re(){return r.inject(on,()=>`${++rn}`)()}function V(n){var i;if(n==null||n.value==null)return null;let e=(i=n.value.$el)!=null?i:n.value;return e instanceof Node?e:null}function U(n,i,...e){if(n in i){let a=i[n];return typeof a=="function"?a(...e):a}let o=new Error(`Tried to handle "${n}" but there is no handler defined. Only defined handlers are: ${Object.keys(i).map(a=>`"${a}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(o,U),o}var an=Object.defineProperty,ln=(n,i,e)=>i in n?an(n,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[i]=e,Me=(n,i,e)=>(ln(n,typeof i!="symbol"?i+"":i,e),e);let sn=class{constructor(){Me(this,"current",this.detect()),Me(this,"currentId",0)}set(i){this.current!==i&&(this.currentId=0,this.current=i)}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"}},Te=new sn;function Ae(n){if(Te.isServer)return null;if(n instanceof Node)return n.ownerDocument;if(n!=null&&n.hasOwnProperty("value")){let i=V(n);if(i)return i.ownerDocument}return document}let Fe=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(n=>`${n}:not([tabindex='-1'])`).join(",");var cn=(n=>(n[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n))(cn||{}),un=(n=>(n[n.Error=0]="Error",n[n.Overflow=1]="Overflow",n[n.Success=2]="Success",n[n.Underflow=3]="Underflow",n))(un||{}),dn=(n=>(n[n.Previous=-1]="Previous",n[n.Next=1]="Next",n))(dn||{}),je=(n=>(n[n.Strict=0]="Strict",n[n.Loose=1]="Loose",n))(je||{});function fn(n,i=0){var e;return n===((e=Ae(n))==null?void 0:e.body)?!1:U(i,{0(){return n.matches(Fe)},1(){let o=n;for(;o!==null;){if(o.matches(Fe))return!0;o=o.parentElement}return!1}})}var pn=(n=>(n[n.Keyboard=0]="Keyboard",n[n.Mouse=1]="Mouse",n))(pn||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",n=>{n.metaKey||n.altKey||n.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",n=>{n.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:n.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function mn(n,i=e=>e){return n.slice().sort((e,o)=>{let a=i(e),s=i(o);if(a===null||s===null)return 0;let d=a.compareDocumentPosition(s);return d&Node.DOCUMENT_POSITION_FOLLOWING?-1:d&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function _n(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function hn(){return/Android/gi.test(window.navigator.userAgent)}function He(){return _n()||hn()}function fe(n,i,e){Te.isServer||r.watchEffect(o=>{document.addEventListener(n,i,e),o(()=>document.removeEventListener(n,i,e))})}function gn(n,i,e){Te.isServer||r.watchEffect(o=>{window.addEventListener(n,i,e),o(()=>window.removeEventListener(n,i,e))})}function vn(n,i,e=r.computed(()=>!0)){function o(s,d){if(!e.value||s.defaultPrevented)return;let c=d(s);if(c===null||!c.getRootNode().contains(c))return;let p=function m(g){return typeof g=="function"?m(g()):Array.isArray(g)||g instanceof Set?g:[g]}(n);for(let m of p){if(m===null)continue;let g=m instanceof HTMLElement?m:V(m);if(g!=null&&g.contains(c)||s.composed&&s.composedPath().includes(g))return}return!fn(c,je.Loose)&&c.tabIndex!==-1&&s.preventDefault(),i(s,c)}let a=r.ref(null);fe("pointerdown",s=>{var d,c;e.value&&(a.value=((c=(d=s.composedPath)==null?void 0:d.call(s))==null?void 0:c[0])||s.target)},!0),fe("mousedown",s=>{var d,c;e.value&&(a.value=((c=(d=s.composedPath)==null?void 0:d.call(s))==null?void 0:c[0])||s.target)},!0),fe("click",s=>{He()||a.value&&(o(s,()=>a.value),a.value=null)},!0),fe("touchend",s=>o(s,()=>s.target instanceof HTMLElement?s.target:null),!0),gn("blur",s=>o(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Ge(n,i){if(n)return n;let e=i??"button";if(typeof e=="string"&&e.toLowerCase()==="button")return"button"}function bn(n,i){let e=r.ref(Ge(n.value.type,n.value.as));return r.onMounted(()=>{e.value=Ge(n.value.type,n.value.as)}),r.watchEffect(()=>{var o;e.value||V(i)&&V(i)instanceof HTMLButtonElement&&!((o=V(i))!=null&&o.hasAttribute("type"))&&(e.value="button")}),e}function Ue(n){return[n.screenX,n.screenY]}function yn(){let n=r.ref([-1,-1]);return{wasMoved(i){let e=Ue(i);return n.value[0]===e[0]&&n.value[1]===e[1]?!1:(n.value=e,!0)},update(i){n.value=Ue(i)}}}function wn({container:n,accept:i,walk:e,enabled:o}){r.watchEffect(()=>{let a=n.value;if(!a||o!==void 0&&!o.value)return;let s=Ae(n);if(!s)return;let d=Object.assign(p=>i(p),{acceptNode:i}),c=s.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,d,!1);for(;c.nextNode();)e(c.currentNode)})}var ae=(n=>(n[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n))(ae||{}),xn=(n=>(n[n.Unmount=0]="Unmount",n[n.Hidden=1]="Hidden",n))(xn||{});function X({visible:n=!0,features:i=0,ourProps:e,theirProps:o,...a}){var s;let d=We(o,e),c=Object.assign(a,{props:d});if(n||i&2&&d.static)return ke(c);if(i&1){let p=(s=d.unmount)==null||s?0:1;return U(p,{0(){return null},1(){return ke({...a,props:{...d,hidden:!0,style:{display:"none"}}})}})}return ke(c)}function ke({props:n,attrs:i,slots:e,slot:o,name:a}){var s,d;let{as:c,...p}=pe(n,["unmount","static"]),m=(s=e.default)==null?void 0:s.call(e,o),g={};if(o){let t=!1,l=[];for(let[u,f]of Object.entries(o))typeof f=="boolean"&&(t=!0),f===!0&&l.push(u);t&&(g["data-headlessui-state"]=l.join(" "))}if(c==="template"){if(m=ze(m??[]),Object.keys(p).length>0||Object.keys(i).length>0){let[t,...l]=m??[];if(!Sn(t)||l.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${a} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(p).concat(Object.keys(i)).map(h=>h.trim()).filter((h,v,_)=>_.indexOf(h)===v).sort((h,v)=>h.localeCompare(v)).map(h=>` - ${h}`).join(`
|
|
4
|
+
color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,e==null?void 0:e.key)}return(p=e==null?void 0:e.onChange)==null||p.call(e,a),a}}function Ee(n,i){if(n===void 0)throw new Error("Unexpected undefined");return n}const Ft=(n,i)=>Math.abs(n-i)<1,Ht=(n,i,e)=>{let o;return function(...a){n.clearTimeout(o),o=n.setTimeout(()=>i.apply(this,a),e)}},jt=n=>n,Gt=n=>{const i=Math.max(n.startIndex-n.overscan,0),e=Math.min(n.endIndex+n.overscan,n.count-1),o=[];for(let a=i;a<=e;a++)o.push(a);return o},Ut=(n,i)=>{const e=n.scrollElement;if(!e)return;const o=n.targetWindow;if(!o)return;const a=d=>{const{width:c,height:p}=d;i({width:Math.round(c),height:Math.round(p)})};if(a(e.getBoundingClientRect()),!o.ResizeObserver)return()=>{};const s=new o.ResizeObserver(d=>{const c=d[0];if(c!=null&&c.borderBoxSize){const p=c.borderBoxSize[0];if(p){a({width:p.inlineSize,height:p.blockSize});return}}a(e.getBoundingClientRect())});return s.observe(e,{box:"border-box"}),()=>{s.unobserve(e)}},Me={passive:!0},zt=typeof window>"u"?!0:"onscrollend"in window,Zt=(n,i)=>{const e=n.scrollElement;if(!e)return;const o=n.targetWindow;if(!o)return;let a=0;const s=zt?()=>{}:Ht(o,()=>{i(a,!1)},n.options.isScrollingResetDelay),d=m=>()=>{a=e[n.options.horizontal?"scrollLeft":"scrollTop"],s(),i(a,m)},c=d(!0),p=d(!1);return p(),e.addEventListener("scroll",c,Me),e.addEventListener("scrollend",p,Me),()=>{e.removeEventListener("scroll",c),e.removeEventListener("scrollend",p)}},Wt=(n,i,e)=>{if(i!=null&&i.borderBoxSize){const o=i.borderBoxSize[0];if(o)return Math.round(o[e.options.horizontal?"inlineSize":"blockSize"])}return Math.round(n.getBoundingClientRect()[e.options.horizontal?"width":"height"])},qt=(n,{adjustments:i=0,behavior:e},o)=>{var a,s;const d=n+i;(s=(a=o.scrollElement)==null?void 0:a.scrollTo)==null||s.call(a,{[o.options.horizontal?"left":"top"]:d,behavior:e})};class Xt{constructor(i){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 e=null;const o=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(a=>{a.forEach(s=>{this._measureElement(s.target,s)})}));return{disconnect:()=>{var a;return(a=o())==null?void 0:a.disconnect()},observe:a=>{var s;return(s=o())==null?void 0:s.observe(a,{box:"border-box"})},unobserve:a=>{var s;return(s=o())==null?void 0:s.unobserve(a)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([o,a])=>{typeof a>"u"&&delete e[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:jt,rangeExtractor:Gt,onChange:()=>{},measureElement:Wt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,...e}},this.notify=(e,o)=>{var a,s;const{startIndex:d,endIndex:c}=this.range??{startIndex:void 0,endIndex:void 0},p=this.calculateRange();(e||d!==(p==null?void 0:p.startIndex)||c!==(p==null?void 0:p.endIndex))&&((s=(a=this.options).onChange)==null||s.call(a,this,o))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.observer.disconnect(),this.elementsCache.clear()},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;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=((e=this.scrollElement)==null?void 0:e.window)??null,this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(a,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<a?"forward":"backward":null,this.scrollOffset=a;const d=this.isScrolling;this.isScrolling=s,this.notify(d!==s,s)}))}},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=(e,o)=>{const a=new Map,s=new Map;for(let d=o-1;d>=0;d--){const c=e[d];if(a.has(c.lane))continue;const p=s.get(c.lane);if(p==null||c.end>p.end?s.set(c.lane,c):c.end<p.end&&a.set(c.lane,!0),a.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((d,c)=>d.end===c.end?d.index-c.index:d.end-c.end)[0]:void 0},this.getMeasurementOptions=oe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(e,o,a,s,d)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:o,scrollMargin:a,getItemKey:s,enabled:d}),{key:!1}),this.getMeasurements=oe(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:o,scrollMargin:a,getItemKey:s,enabled:d},c)=>{var p;if(!d)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(t=>{this.itemSizeCache.set(t.key,t.size)}));const m=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const v=this.measurementsCache.slice(0,m);for(let t=m;t<e;t++){let l=(p=this.measurementsCache[t])==null?void 0:p.measureElement;l||(l=O=>{const x=s(t),I=this.elementsCache.get(x);if(!O){I&&(this.observer.unobserve(I),this.elementsCache.delete(x));return}I!==O&&(I&&this.observer.unobserve(I),this.observer.observe(O),this.elementsCache.set(x,O)),O.isConnected&&this.resizeItem(t,this.options.measureElement(O,void 0,this))});const u=s(t),f=this.options.lanes===1?v[t-1]:this.getFurthestMeasurement(v,t),h=f?f.end+this.options.gap:o+a,g=c.get(u),_=typeof g=="number"?g:this.options.estimateSize(t),w=h+_,A=f?f.lane:t%this.options.lanes;v[t]={index:t,start:h,size:_,end:w,key:u,lane:A,measureElement:l}}return this.measurementsCache=v,v},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=oe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(e,o,a)=>this.range=e.length>0&&o>0?Yt({measurements:e,outerSize:o,scrollOffset:a}):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],(e,o,a,s)=>o===null?[]:e({startIndex:o.startIndex,endIndex:o.endIndex,overscan:a,count:s}),{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=e=>{const o=this.options.indexAttribute,a=e.getAttribute(o);return a?parseInt(a,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(e,o)=>{const a=this.indexFromElement(e),s=this.getMeasurements()[a];if(!s||!e.isConnected){this.elementsCache.forEach((c,p)=>{c===e&&(this.observer.unobserve(e),this.elementsCache.delete(p))});return}const d=this.elementsCache.get(s.key);d!==e&&(d&&this.observer.unobserve(d),this.observer.observe(e),this.elementsCache.set(s.key,e)),this.resizeItem(a,this.options.measureElement(e,o,this))},this.resizeItem=(e,o)=>{const a=this.getMeasurements()[e];if(!a)return;const s=this.itemSizeCache.get(a.key)??a.size,d=o-s;d!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(a,d,this):a.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",d),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=d,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(a.index),this.itemSizeCache=new Map(this.itemSizeCache.set(a.key,o)),this.notify(!0,!1))},this.measureElement=e=>{e&&this._measureElement(e,void 0)},this.getVirtualItems=oe(()=>[this.getIndexes(),this.getMeasurements()],(e,o)=>{const a=[];for(let s=0,d=e.length;s<d;s++){const c=e[s],p=o[c];a.push(p)}return a},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const o=this.getMeasurements();if(o.length!==0)return Ee(o[Re(0,o.length-1,a=>Ee(o[a]).start,e)])},this.getOffsetForAlignment=(e,o)=>{const a=this.getSize(),s=this.getScrollOffset();o==="auto"&&(e<=s?o="start":e>=s+a?o="end":o="start"),o==="start"?e=e:o==="end"?e=e-a:o==="center"&&(e=e-a/2);const d=this.options.horizontal?"scrollWidth":"scrollHeight",p=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[d]:this.scrollElement[d]:0)-a;return Math.max(Math.min(p,e),0)},this.getOffsetForIndex=(e,o="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const a=this.getMeasurements()[e];if(!a)return;const s=this.getSize(),d=this.getScrollOffset();if(o==="auto")if(a.end>=d+s-this.options.scrollPaddingEnd)o="end";else if(a.start<=d+this.options.scrollPaddingStart)o="start";else return[d,o];const c=o==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,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=(e,{align:o="start",behavior:a}={})=>{this.cancelScrollToIndex(),a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,o),{adjustments:void 0,behavior:a})},this.scrollToIndex=(e,{align:o="auto",behavior:a}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const s=this.getOffsetForIndex(e,o);if(!s)return;const[d,c]=s;this._scrollToOffset(d,{adjustments:void 0,behavior:a}),a!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(e))){const[m]=Ee(this.getOffsetForIndex(e,c));Ft(m,this.getScrollOffset())||this.scrollToIndex(e,{align:c,behavior:a})}else this.scrollToIndex(e,{align:c,behavior:a})}))},this.scrollBy=(e,{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()+e,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var e;const o=this.getMeasurements();let a;return o.length===0?a=this.options.paddingStart:a=this.options.lanes===1?((e=o[o.length-1])==null?void 0:e.end)??0:Math.max(...o.slice(-this.options.lanes).map(s=>s.end)),a-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(e,{adjustments:o,behavior:a})=>{this.options.scrollToFn(e,{behavior:a,adjustments:o},this)},this.measure=()=>{var e,o;this.itemSizeCache=new Map,(o=(e=this.options).onChange)==null||o.call(e,this,!1)},this.setOptions(i)}}const Re=(n,i,e,o)=>{for(;n<=i;){const a=(n+i)/2|0,s=e(a);if(s<o)n=a+1;else if(s>o)i=a-1;else return a}return n>0?n-1:0};function Yt({measurements:n,outerSize:i,scrollOffset:e}){const o=n.length-1,s=Re(0,o,c=>n[c].start,e);let d=s;for(;d<o&&n[d].end<e+i;)d++;return{startIndex:s,endIndex:d}}function Qt(n){const i=new Xt(r.unref(n)),e=r.shallowRef(i),o=i._didMount();return r.watch(()=>r.unref(n).getScrollElement(),a=>{a&&i._willUpdate()},{immediate:!0}),r.watch(()=>r.unref(n),a=>{i.setOptions({...a,onChange:(s,d)=>{var c;r.triggerRef(e),(c=a.onChange)==null||c.call(a,s,d)}}),i._willUpdate(),r.triggerRef(e)},{immediate:!0}),r.onScopeDispose(o),e}function Kt(n){return Qt(r.computed(()=>({observeElementRect:Ut,observeElementOffset:Zt,scrollToFn:qt,...r.unref(n)})))}function Jt(n,i,e){let o=r.ref(e==null?void 0:e.value),a=r.computed(()=>n.value!==void 0);return[r.computed(()=>a.value?n.value:o.value),function(s){return a.value||(o.value=s),i==null?void 0:i(s)}]}function en(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(i=>setTimeout(()=>{throw i}))}function de(){let n=[],i={addEventListener(e,o,a,s){return e.addEventListener(o,a,s),i.add(()=>e.removeEventListener(o,a,s))},requestAnimationFrame(...e){let o=requestAnimationFrame(...e);i.add(()=>cancelAnimationFrame(o))},nextFrame(...e){i.requestAnimationFrame(()=>{i.requestAnimationFrame(...e)})},setTimeout(...e){let o=setTimeout(...e);i.add(()=>clearTimeout(o))},microTask(...e){let o={current:!0};return en(()=>{o.current&&e[0]()}),i.add(()=>{o.current=!1})},style(e,o,a){let s=e.style.getPropertyValue(o);return Object.assign(e.style,{[o]:a}),this.add(()=>{Object.assign(e.style,{[o]:s})})},group(e){let o=de();return e(o),this.add(()=>o.dispose())},add(e){return n.push(e),()=>{let o=n.indexOf(e);if(o>=0)for(let a of n.splice(o,1))a()}},dispose(){for(let e of n.splice(0))e()}};return i}function tn(){let n=de();return r.onUnmounted(()=>n.dispose()),n}function nn(){let n=tn();return i=>{n.dispose(),n.nextFrame(i)}}let on=Symbol("headlessui.useid"),rn=0;function re(){return r.inject(on,()=>`${++rn}`)()}function $(n){var i;if(n==null||n.value==null)return null;let e=(i=n.value.$el)!=null?i:n.value;return e instanceof Node?e:null}function U(n,i,...e){if(n in i){let a=i[n];return typeof a=="function"?a(...e):a}let o=new Error(`Tried to handle "${n}" but there is no handler defined. Only defined handlers are: ${Object.keys(i).map(a=>`"${a}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(o,U),o}var an=Object.defineProperty,ln=(n,i,e)=>i in n?an(n,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[i]=e,De=(n,i,e)=>(ln(n,typeof i!="symbol"?i+"":i,e),e);let sn=class{constructor(){De(this,"current",this.detect()),De(this,"currentId",0)}set(i){this.current!==i&&(this.currentId=0,this.current=i)}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 Te(n){if(Se.isServer)return null;if(n instanceof Node)return n.ownerDocument;if(n!=null&&n.hasOwnProperty("value")){let i=$(n);if(i)return i.ownerDocument}return document}let Fe=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(n=>`${n}:not([tabindex='-1'])`).join(",");var cn=(n=>(n[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n))(cn||{}),un=(n=>(n[n.Error=0]="Error",n[n.Overflow=1]="Overflow",n[n.Success=2]="Success",n[n.Underflow=3]="Underflow",n))(un||{}),dn=(n=>(n[n.Previous=-1]="Previous",n[n.Next=1]="Next",n))(dn||{}),He=(n=>(n[n.Strict=0]="Strict",n[n.Loose=1]="Loose",n))(He||{});function fn(n,i=0){var e;return n===((e=Te(n))==null?void 0:e.body)?!1:U(i,{0(){return n.matches(Fe)},1(){let o=n;for(;o!==null;){if(o.matches(Fe))return!0;o=o.parentElement}return!1}})}var pn=(n=>(n[n.Keyboard=0]="Keyboard",n[n.Mouse=1]="Mouse",n))(pn||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",n=>{n.metaKey||n.altKey||n.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",n=>{n.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:n.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function mn(n,i=e=>e){return n.slice().sort((e,o)=>{let a=i(e),s=i(o);if(a===null||s===null)return 0;let d=a.compareDocumentPosition(s);return d&Node.DOCUMENT_POSITION_FOLLOWING?-1:d&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function _n(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function hn(){return/Android/gi.test(window.navigator.userAgent)}function je(){return _n()||hn()}function fe(n,i,e){Se.isServer||r.watchEffect(o=>{document.addEventListener(n,i,e),o(()=>document.removeEventListener(n,i,e))})}function gn(n,i,e){Se.isServer||r.watchEffect(o=>{window.addEventListener(n,i,e),o(()=>window.removeEventListener(n,i,e))})}function vn(n,i,e=r.computed(()=>!0)){function o(s,d){if(!e.value||s.defaultPrevented)return;let c=d(s);if(c===null||!c.getRootNode().contains(c))return;let p=function m(v){return typeof v=="function"?m(v()):Array.isArray(v)||v instanceof Set?v:[v]}(n);for(let m of p){if(m===null)continue;let v=m instanceof HTMLElement?m:$(m);if(v!=null&&v.contains(c)||s.composed&&s.composedPath().includes(v))return}return!fn(c,He.Loose)&&c.tabIndex!==-1&&s.preventDefault(),i(s,c)}let a=r.ref(null);fe("pointerdown",s=>{var d,c;e.value&&(a.value=((c=(d=s.composedPath)==null?void 0:d.call(s))==null?void 0:c[0])||s.target)},!0),fe("mousedown",s=>{var d,c;e.value&&(a.value=((c=(d=s.composedPath)==null?void 0:d.call(s))==null?void 0:c[0])||s.target)},!0),fe("click",s=>{je()||a.value&&(o(s,()=>a.value),a.value=null)},!0),fe("touchend",s=>o(s,()=>s.target instanceof HTMLElement?s.target:null),!0),gn("blur",s=>o(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Ge(n,i){if(n)return n;let e=i??"button";if(typeof e=="string"&&e.toLowerCase()==="button")return"button"}function bn(n,i){let e=r.ref(Ge(n.value.type,n.value.as));return r.onMounted(()=>{e.value=Ge(n.value.type,n.value.as)}),r.watchEffect(()=>{var o;e.value||$(i)&&$(i)instanceof HTMLButtonElement&&!((o=$(i))!=null&&o.hasAttribute("type"))&&(e.value="button")}),e}function Ue(n){return[n.screenX,n.screenY]}function yn(){let n=r.ref([-1,-1]);return{wasMoved(i){let e=Ue(i);return n.value[0]===e[0]&&n.value[1]===e[1]?!1:(n.value=e,!0)},update(i){n.value=Ue(i)}}}function wn({container:n,accept:i,walk:e,enabled:o}){r.watchEffect(()=>{let a=n.value;if(!a||o!==void 0&&!o.value)return;let s=Te(n);if(!s)return;let d=Object.assign(p=>i(p),{acceptNode:i}),c=s.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,d,!1);for(;c.nextNode();)e(c.currentNode)})}var ae=(n=>(n[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n))(ae||{}),xn=(n=>(n[n.Unmount=0]="Unmount",n[n.Hidden=1]="Hidden",n))(xn||{});function q({visible:n=!0,features:i=0,ourProps:e,theirProps:o,...a}){var s;let d=Ze(o,e),c=Object.assign(a,{props:d});if(n||i&2&&d.static)return Ae(c);if(i&1){let p=(s=d.unmount)==null||s?0:1;return U(p,{0(){return null},1(){return Ae({...a,props:{...d,hidden:!0,style:{display:"none"}}})}})}return Ae(c)}function Ae({props:n,attrs:i,slots:e,slot:o,name:a}){var s,d;let{as:c,...p}=pe(n,["unmount","static"]),m=(s=e.default)==null?void 0:s.call(e,o),v={};if(o){let t=!1,l=[];for(let[u,f]of Object.entries(o))typeof f=="boolean"&&(t=!0),f===!0&&l.push(u);t&&(v["data-headlessui-state"]=l.join(" "))}if(c==="template"){if(m=ze(m??[]),Object.keys(p).length>0||Object.keys(i).length>0){let[t,...l]=m??[];if(!En(t)||l.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${a} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(p).concat(Object.keys(i)).map(h=>h.trim()).filter((h,g,_)=>_.indexOf(h)===g).sort((h,g)=>h.localeCompare(g)).map(h=>` - ${h}`).join(`
|
|
5
5
|
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map(h=>` - ${h}`).join(`
|
|
6
6
|
`)].join(`
|
|
7
|
-
`));let u=We((d=t.props)!=null?d:{},p,g),f=r.cloneVNode(t,u,!0);for(let h in u)h.startsWith("on")&&(f.props||(f.props={}),f.props[h]=u[h]);return f}return Array.isArray(m)&&m.length===1?m[0]:m}return r.h(c,Object.assign({},p,g),{default:()=>m})}function ze(n){return n.flatMap(i=>i.type===r.Fragment?ze(i.children):[i])}function We(...n){if(n.length===0)return{};if(n.length===1)return n[0];let i={},e={};for(let o of n)for(let a in o)a.startsWith("on")&&typeof o[a]=="function"?(e[a]!=null||(e[a]=[]),e[a].push(o[a])):i[a]=o[a];if(i.disabled||i["aria-disabled"])return Object.assign(i,Object.fromEntries(Object.keys(e).map(o=>[o,void 0])));for(let o in e)Object.assign(i,{[o](a,...s){let d=e[o];for(let c of d){if(a instanceof Event&&a.defaultPrevented)return;c(a,...s)}}});return i}function En(n){let i=Object.assign({},n);for(let e in i)i[e]===void 0&&delete i[e];return i}function pe(n,i=[]){let e=Object.assign({},n);for(let o of i)o in e&&delete e[o];return e}function Sn(n){return n==null?!1:typeof n.type=="string"||typeof n.type=="object"||typeof n.type=="function"}var qe=(n=>(n[n.None=1]="None",n[n.Focusable=2]="Focusable",n[n.Hidden=4]="Hidden",n))(qe||{});let Tn=r.defineComponent({name:"Hidden",props:{as:{type:[Object,String],default:"div"},features:{type:Number,default:1}},setup(n,{slots:i,attrs:e}){return()=>{var o;let{features:a,...s}=n,d={"aria-hidden":(a&2)===2?!0:(o=s["aria-hidden"])!=null?o:void 0,hidden:(a&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",...(a&4)===4&&(a&2)!==2&&{display:"none"}}};return X({ourProps:d,theirProps:s,slot:{},attrs:e,slots:i,name:"Hidden"})}}}),Xe=Symbol("Context");var le=(n=>(n[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n))(le||{});function An(){return r.inject(Xe,null)}function kn(n){r.provide(Xe,n)}var L=(n=>(n.Space=" ",n.Enter="Enter",n.Escape="Escape",n.Backspace="Backspace",n.Delete="Delete",n.ArrowLeft="ArrowLeft",n.ArrowUp="ArrowUp",n.ArrowRight="ArrowRight",n.ArrowDown="ArrowDown",n.Home="Home",n.End="End",n.PageUp="PageUp",n.PageDown="PageDown",n.Tab="Tab",n))(L||{}),Ye=(n=>(n[n.Left=0]="Left",n[n.Right=2]="Right",n))(Ye||{});function On(n){function i(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",i))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",i),i())}let Y=[];On(()=>{function n(i){i.target instanceof HTMLElement&&i.target!==document.body&&Y[0]!==i.target&&(Y.unshift(i.target),Y=Y.filter(e=>e!=null&&e.isConnected),Y.splice(10))}window.addEventListener("click",n,{capture:!0}),window.addEventListener("mousedown",n,{capture:!0}),window.addEventListener("focus",n,{capture:!0}),document.body.addEventListener("click",n,{capture:!0}),document.body.addEventListener("mousedown",n,{capture:!0}),document.body.addEventListener("focus",n,{capture:!0})});function In(n){throw new Error("Unexpected object: "+n)}var R=(n=>(n[n.First=0]="First",n[n.Previous=1]="Previous",n[n.Next=2]="Next",n[n.Last=3]="Last",n[n.Specific=4]="Specific",n[n.Nothing=5]="Nothing",n))(R||{});function Qe(n,i){let e=i.resolveItems();if(e.length<=0)return null;let o=i.resolveActiveIndex(),a=o??-1;switch(n.focus){case 0:{for(let s=0;s<e.length;++s)if(!i.resolveDisabled(e[s],s,e))return s;return o}case 1:{a===-1&&(a=e.length);for(let s=a-1;s>=0;--s)if(!i.resolveDisabled(e[s],s,e))return s;return o}case 2:{for(let s=a+1;s<e.length;++s)if(!i.resolveDisabled(e[s],s,e))return s;return o}case 3:{for(let s=e.length-1;s>=0;--s)if(!i.resolveDisabled(e[s],s,e))return s;return o}case 4:{for(let s=0;s<e.length;++s)if(i.resolveId(e[s],s,e)===n.id)return s;return o}case 5:return null;default:In(n)}}function Ze(n={},i=null,e=[]){for(let[o,a]of Object.entries(n))Je(e,Ke(i,o),a);return e}function Ke(n,i){return n?n+"["+i+"]":i}function Je(n,i,e){if(Array.isArray(e))for(let[o,a]of e.entries())Je(n,Ke(i,o.toString()),a);else e instanceof Date?n.push([i,e.toISOString()]):typeof e=="boolean"?n.push([i,e?"1":"0"]):typeof e=="string"?n.push([i,e]):typeof e=="number"?n.push([i,`${e}`]):e==null?n.push([i,""]):Ze(e,i,n)}function $n(n,i){return n===i}var Cn=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(Cn||{}),Vn=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(Vn||{}),Nn=(n=>(n[n.Pointer=0]="Pointer",n[n.Focus=1]="Focus",n[n.Other=2]="Other",n))(Nn||{});let et=Symbol("ComboboxContext");function Q(n){let i=r.inject(et,null);if(i===null){let e=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Q),e}return i}let tt=Symbol("VirtualContext"),Pn=r.defineComponent({name:"VirtualProvider",setup(n,{slots:i}){let e=Q("VirtualProvider"),o=r.computed(()=>{let c=V(e.optionsRef);if(!c)return{start:0,end:0};let p=window.getComputedStyle(c);return{start:parseFloat(p.paddingBlockStart||p.paddingTop),end:parseFloat(p.paddingBlockEnd||p.paddingBottom)}}),a=Kt(r.computed(()=>({scrollPaddingStart:o.value.start,scrollPaddingEnd:o.value.end,count:e.virtual.value.options.length,estimateSize(){return 40},getScrollElement(){return V(e.optionsRef)},overscan:12}))),s=r.computed(()=>{var c;return(c=e.virtual.value)==null?void 0:c.options}),d=r.ref(0);return r.watch([s],()=>{d.value+=1}),r.provide(tt,e.virtual.value?a:null),()=>[r.h("div",{style:{position:"relative",width:"100%",height:`${a.value.getTotalSize()}px`},ref:c=>{if(c){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||e.activationTrigger.value===0)return;e.activeOptionIndex.value!==null&&e.virtual.value.options.length>e.activeOptionIndex.value&&a.value.scrollToIndex(e.activeOptionIndex.value)}}},a.value.getVirtualItems().map(c=>r.cloneVNode(i.default({option:e.virtual.value.options[c.index],open:e.comboboxState.value===0})[0],{key:`${d.value}-${c.index}`,"data-index":c.index,"aria-setsize":e.virtual.value.options.length,"aria-posinset":c.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${c.start}px)`,overflowAnchor:"none"}})))]}}),Bn=r.defineComponent({name:"Combobox",emits:{"update:modelValue":n=>!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(n,{slots:i,attrs:e,emit:o}){let a=r.ref(1),s=r.ref(null),d=r.ref(null),c=r.ref(null),p=r.ref(null),m=r.ref({static:!1,hold:!1}),g=r.ref([]),t=r.ref(null),l=r.ref(2),u=r.ref(!1);function f(b=y=>y){let y=t.value!==null?g.value[t.value]:null,T=b(g.value.slice()),O=T.length>0&&T[0].dataRef.order.value!==null?T.sort((N,F)=>N.dataRef.order.value-F.dataRef.order.value):mn(T,N=>V(N.dataRef.domRef)),C=y?O.indexOf(y):null;return C===-1&&(C=null),{options:O,activeOptionIndex:C}}let h=r.computed(()=>n.multiple?1:0),v=r.computed(()=>n.nullable),[_,w]=Jt(r.computed(()=>n.modelValue),b=>o("update:modelValue",b),r.computed(()=>n.defaultValue)),k=r.computed(()=>_.value===void 0?U(h.value,{1:[],0:void 0}):_.value),I=null,x=null;function $(b){return U(h.value,{0(){return w==null?void 0:w(b)},1:()=>{let y=r.toRaw(S.value.value).slice(),T=r.toRaw(b),O=y.findIndex(C=>S.compare(T,r.toRaw(C)));return O===-1?y.push(T):y.splice(O,1),w==null?void 0:w(y)}})}let E=r.computed(()=>{});r.watch([E],([b],[y])=>{if(S.virtual.value&&b&&y&&t.value!==null){let T=b.indexOf(y[t.value]);T!==-1?t.value=T:t.value=null}});let S={comboboxState:a,value:k,mode:h,compare(b,y){if(typeof n.by=="string"){let T=n.by;return(b==null?void 0:b[T])===(y==null?void 0:y[T])}return n.by===null?$n(b,y):n.by(b,y)},calculateIndex(b){return S.virtual.value?n.by===null?S.virtual.value.options.indexOf(b):S.virtual.value.options.findIndex(y=>S.compare(y,b)):g.value.findIndex(y=>S.compare(y.dataRef.value,b))},defaultValue:r.computed(()=>n.defaultValue),nullable:v,immediate:r.computed(()=>!1),virtual:r.computed(()=>null),inputRef:d,labelRef:s,buttonRef:c,optionsRef:p,disabled:r.computed(()=>n.disabled),options:g,change(b){w(b)},activeOptionIndex:r.computed(()=>{if(u.value&&t.value===null&&(S.virtual.value?S.virtual.value.options.length>0:g.value.length>0)){if(S.virtual.value){let y=S.virtual.value.options.findIndex(T=>{var O;return!((O=S.virtual.value)!=null&&O.disabled(T))});if(y!==-1)return y}let b=g.value.findIndex(y=>!y.dataRef.disabled);if(b!==-1)return b}return t.value}),activationTrigger:l,optionsPropsRef:m,closeCombobox(){u.value=!1,!n.disabled&&a.value!==1&&(a.value=1,t.value=null)},openCombobox(){if(u.value=!0,!n.disabled&&a.value!==0){if(S.value.value){let b=S.calculateIndex(S.value.value);b!==-1&&(t.value=b)}a.value=0}},setActivationTrigger(b){l.value=b},goToOption(b,y,T){u.value=!1,I!==null&&cancelAnimationFrame(I),I=requestAnimationFrame(()=>{if(n.disabled||p.value&&!m.value.static&&a.value===1)return;if(S.virtual.value){t.value=b===R.Specific?y:Qe({focus:b},{resolveItems:()=>S.virtual.value.options,resolveActiveIndex:()=>{var N,F;return(F=(N=S.activeOptionIndex.value)!=null?N:S.virtual.value.options.findIndex(j=>{var B;return!((B=S.virtual.value)!=null&&B.disabled(j))}))!=null?F:null},resolveDisabled:N=>S.virtual.value.disabled(N),resolveId(){throw new Error("Function not implemented.")}}),l.value=T??2;return}let O=f();if(O.activeOptionIndex===null){let N=O.options.findIndex(F=>!F.dataRef.disabled);N!==-1&&(O.activeOptionIndex=N)}let C=b===R.Specific?y:Qe({focus:b},{resolveItems:()=>O.options,resolveActiveIndex:()=>O.activeOptionIndex,resolveId:N=>N.id,resolveDisabled:N=>N.dataRef.disabled});t.value=C,l.value=T??2,g.value=O.options})},selectOption(b){let y=g.value.find(O=>O.id===b);if(!y)return;let{dataRef:T}=y;$(T.value)},selectActiveOption(){if(S.activeOptionIndex.value!==null){if(S.virtual.value)$(S.virtual.value.options[S.activeOptionIndex.value]);else{let{dataRef:b}=g.value[S.activeOptionIndex.value];$(b.value)}S.goToOption(R.Specific,S.activeOptionIndex.value)}},registerOption(b,y){let T=r.reactive({id:b,dataRef:y});if(S.virtual.value){g.value.push(T);return}x&&cancelAnimationFrame(x);let O=f(C=>(C.push(T),C));t.value===null&&S.isSelected(y.value.value)&&(O.activeOptionIndex=O.options.indexOf(T)),g.value=O.options,t.value=O.activeOptionIndex,l.value=2,O.options.some(C=>!V(C.dataRef.domRef))&&(x=requestAnimationFrame(()=>{let C=f();g.value=C.options,t.value=C.activeOptionIndex}))},unregisterOption(b,y){if(I!==null&&cancelAnimationFrame(I),y&&(u.value=!0),S.virtual.value){g.value=g.value.filter(O=>O.id!==b);return}let T=f(O=>{let C=O.findIndex(N=>N.id===b);return C!==-1&&O.splice(C,1),O});g.value=T.options,t.value=T.activeOptionIndex,l.value=2},isSelected(b){return U(h.value,{0:()=>S.compare(r.toRaw(S.value.value),r.toRaw(b)),1:()=>r.toRaw(S.value.value).some(y=>S.compare(r.toRaw(y),r.toRaw(b)))})},isActive(b){return t.value===S.calculateIndex(b)}};vn([d,c,p],()=>S.closeCombobox(),r.computed(()=>a.value===0)),r.provide(et,S),kn(r.computed(()=>U(a.value,{0:le.Open,1:le.Closed})));let A=r.computed(()=>{var b;return(b=V(d))==null?void 0:b.closest("form")});return r.onMounted(()=>{r.watch([A],()=>{if(!A.value||n.defaultValue===void 0)return;function b(){S.change(n.defaultValue)}return A.value.addEventListener("reset",b),()=>{var y;(y=A.value)==null||y.removeEventListener("reset",b)}},{immediate:!0})}),()=>{var b,y,T;let{name:O,disabled:C,form:N,...F}=n,j={open:a.value===0,disabled:C,activeIndex:S.activeOptionIndex.value,activeOption:S.activeOptionIndex.value===null?null:S.virtual.value?S.virtual.value.options[(b=S.activeOptionIndex.value)!=null?b:0]:(T=(y=S.options.value[S.activeOptionIndex.value])==null?void 0:y.dataRef.value)!=null?T:null,value:k.value};return r.h(r.Fragment,[...O!=null&&k.value!=null?Ze({[O]:k.value}).map(([B,la])=>r.h(Tn,En({features:qe.Hidden,key:B,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:N,disabled:C,name:B,value:la}))):[],X({theirProps:{...e,...pe(F,["by","defaultValue","immediate","modelValue","multiple","nullable","onUpdate:modelValue","virtual"])},ourProps:{},slot:j,slots:i,attrs:e,name:"Combobox"})])}}});r.defineComponent({name:"ComboboxLabel",props:{as:{type:[Object,String],default:"label"},id:{type:String,default:null}},setup(n,{attrs:i,slots:e}){var o;let a=(o=n.id)!=null?o:`headlessui-combobox-label-${re()}`,s=Q("ComboboxLabel");function d(){var c;(c=V(s.inputRef))==null||c.focus({preventScroll:!0})}return()=>{let c={open:s.comboboxState.value===0,disabled:s.disabled.value},{...p}=n,m={id:a,ref:s.labelRef,onClick:d};return X({ourProps:m,theirProps:p,slot:c,attrs:i,slots:e,name:"ComboboxLabel"})}}});let Rn=r.defineComponent({name:"ComboboxButton",props:{as:{type:[Object,String],default:"button"},id:{type:String,default:null}},setup(n,{attrs:i,slots:e,expose:o}){var a;let s=(a=n.id)!=null?a:`headlessui-combobox-button-${re()}`,d=Q("ComboboxButton");o({el:d.buttonRef,$el:d.buttonRef});function c(g){d.disabled.value||(d.comboboxState.value===0?d.closeCombobox():(g.preventDefault(),d.openCombobox()),r.nextTick(()=>{var t;return(t=V(d.inputRef))==null?void 0:t.focus({preventScroll:!0})}))}function p(g){switch(g.key){case L.ArrowDown:g.preventDefault(),g.stopPropagation(),d.comboboxState.value===1&&d.openCombobox(),r.nextTick(()=>{var t;return(t=d.inputRef.value)==null?void 0:t.focus({preventScroll:!0})});return;case L.ArrowUp:g.preventDefault(),g.stopPropagation(),d.comboboxState.value===1&&(d.openCombobox(),r.nextTick(()=>{d.value.value||d.goToOption(R.Last)})),r.nextTick(()=>{var t;return(t=d.inputRef.value)==null?void 0:t.focus({preventScroll:!0})});return;case L.Escape:if(d.comboboxState.value!==0)return;g.preventDefault(),d.optionsRef.value&&!d.optionsPropsRef.value.static&&g.stopPropagation(),d.closeCombobox(),r.nextTick(()=>{var t;return(t=d.inputRef.value)==null?void 0:t.focus({preventScroll:!0})});return}}let m=bn(r.computed(()=>({as:n.as,type:i.type})),d.buttonRef);return()=>{var g,t;let l={open:d.comboboxState.value===0,disabled:d.disabled.value,value:d.value.value},{...u}=n,f={ref:d.buttonRef,id:s,type:m.value,tabindex:"-1","aria-haspopup":"listbox","aria-controls":(g=V(d.optionsRef))==null?void 0:g.id,"aria-expanded":d.comboboxState.value===0,"aria-labelledby":d.labelRef.value?[(t=V(d.labelRef))==null?void 0:t.id,s].join(" "):void 0,disabled:d.disabled.value===!0?!0:void 0,onKeydown:p,onClick:c};return X({ourProps:f,theirProps:u,slot:l,attrs:i,slots:e,name:"ComboboxButton"})}}}),Dn=r.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:n=>!0},setup(n,{emit:i,attrs:e,slots:o,expose:a}){var s;let d=(s=n.id)!=null?s:`headlessui-combobox-input-${re()}`,c=Q("ComboboxInput"),p=r.computed(()=>Ae(V(c.inputRef))),m={value:!1};a({el:c.inputRef,$el:c.inputRef});function g(){c.change(null);let x=V(c.optionsRef);x&&(x.scrollTop=0),c.goToOption(R.Nothing)}let t=r.computed(()=>{var x;let $=c.value.value;return V(c.inputRef)?typeof n.displayValue<"u"&&$!==void 0?(x=n.displayValue($))!=null?x:"":typeof $=="string"?$:"":""});r.onMounted(()=>{r.watch([t,c.comboboxState,p],([x,$],[E,S])=>{if(m.value)return;let A=V(c.inputRef);A&&((S===0&&$===1||x!==E)&&(A.value=x),requestAnimationFrame(()=>{var b;if(m.value||!A||((b=p.value)==null?void 0:b.activeElement)!==A)return;let{selectionStart:y,selectionEnd:T}=A;Math.abs((T??0)-(y??0))===0&&y===0&&A.setSelectionRange(A.value.length,A.value.length)}))},{immediate:!0}),r.watch([c.comboboxState],([x],[$])=>{if(x===0&&$===1){if(m.value)return;let E=V(c.inputRef);if(!E)return;let S=E.value,{selectionStart:A,selectionEnd:b,selectionDirection:y}=E;E.value="",E.value=S,y!==null?E.setSelectionRange(A,b,y):E.setSelectionRange(A,b)}})});let l=r.ref(!1);function u(){l.value=!0}function f(){de().nextFrame(()=>{l.value=!1})}let h=nn();function v(x){switch(m.value=!0,h(()=>{m.value=!1}),x.key){case L.Enter:if(m.value=!1,c.comboboxState.value!==0||l.value)return;if(x.preventDefault(),x.stopPropagation(),c.activeOptionIndex.value===null){c.closeCombobox();return}c.selectActiveOption(),c.mode.value===0&&c.closeCombobox();break;case L.ArrowDown:return m.value=!1,x.preventDefault(),x.stopPropagation(),U(c.comboboxState.value,{0:()=>c.goToOption(R.Next),1:()=>c.openCombobox()});case L.ArrowUp:return m.value=!1,x.preventDefault(),x.stopPropagation(),U(c.comboboxState.value,{0:()=>c.goToOption(R.Previous),1:()=>{c.openCombobox(),r.nextTick(()=>{c.value.value||c.goToOption(R.Last)})}});case L.Home:if(x.shiftKey)break;return m.value=!1,x.preventDefault(),x.stopPropagation(),c.goToOption(R.First);case L.PageUp:return m.value=!1,x.preventDefault(),x.stopPropagation(),c.goToOption(R.First);case L.End:if(x.shiftKey)break;return m.value=!1,x.preventDefault(),x.stopPropagation(),c.goToOption(R.Last);case L.PageDown:return m.value=!1,x.preventDefault(),x.stopPropagation(),c.goToOption(R.Last);case L.Escape:if(m.value=!1,c.comboboxState.value!==0)return;x.preventDefault(),c.optionsRef.value&&!c.optionsPropsRef.value.static&&x.stopPropagation(),c.nullable.value&&c.mode.value===0&&c.value.value===null&&g(),c.closeCombobox();break;case L.Tab:if(m.value=!1,c.comboboxState.value!==0)return;c.mode.value===0&&c.activationTrigger.value!==1&&c.selectActiveOption(),c.closeCombobox();break}}function _(x){i("change",x),c.nullable.value&&c.mode.value===0&&x.target.value===""&&g(),c.openCombobox()}function w(x){var $,E,S;let A=($=x.relatedTarget)!=null?$:Y.find(b=>b!==x.currentTarget);if(m.value=!1,!((E=V(c.optionsRef))!=null&&E.contains(A))&&!((S=V(c.buttonRef))!=null&&S.contains(A))&&c.comboboxState.value===0)return x.preventDefault(),c.mode.value===0&&(c.nullable.value&&c.value.value===null?g():c.activationTrigger.value!==1&&c.selectActiveOption()),c.closeCombobox()}function k(x){var $,E,S;let A=($=x.relatedTarget)!=null?$:Y.find(b=>b!==x.currentTarget);(E=V(c.buttonRef))!=null&&E.contains(A)||(S=V(c.optionsRef))!=null&&S.contains(A)||c.disabled.value||c.immediate.value&&c.comboboxState.value!==0&&(c.openCombobox(),de().nextFrame(()=>{c.setActivationTrigger(1)}))}let I=r.computed(()=>{var x,$,E,S;return(S=(E=($=n.defaultValue)!=null?$:c.defaultValue.value!==void 0?(x=n.displayValue)==null?void 0:x.call(n,c.defaultValue.value):null)!=null?E:c.defaultValue.value)!=null?S:""});return()=>{var x,$,E,S,A,b,y;let T={open:c.comboboxState.value===0},{displayValue:O,onChange:C,...N}=n,F={"aria-controls":(x=c.optionsRef.value)==null?void 0:x.id,"aria-expanded":c.comboboxState.value===0,"aria-activedescendant":c.activeOptionIndex.value===null?void 0:c.virtual.value?($=c.options.value.find(j=>!c.virtual.value.disabled(j.dataRef.value)&&c.compare(j.dataRef.value,c.virtual.value.options[c.activeOptionIndex.value])))==null?void 0:$.id:(E=c.options.value[c.activeOptionIndex.value])==null?void 0:E.id,"aria-labelledby":(b=(S=V(c.labelRef))==null?void 0:S.id)!=null?b:(A=V(c.buttonRef))==null?void 0:A.id,"aria-autocomplete":"list",id:d,onCompositionstart:u,onCompositionend:f,onKeydown:v,onInput:_,onFocus:k,onBlur:w,role:"combobox",type:(y=e.type)!=null?y:"text",tabIndex:0,ref:c.inputRef,defaultValue:I.value,disabled:c.disabled.value===!0?!0:void 0};return X({ourProps:F,theirProps:N,slot:T,attrs:e,slots:o,features:ae.RenderStrategy|ae.Static,name:"ComboboxInput"})}}}),Ln=r.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(n,{attrs:i,slots:e,expose:o}){let a=Q("ComboboxOptions"),s=`headlessui-combobox-options-${re()}`;o({el:a.optionsRef,$el:a.optionsRef}),r.watchEffect(()=>{a.optionsPropsRef.value.static=n.static}),r.watchEffect(()=>{a.optionsPropsRef.value.hold=n.hold});let d=An(),c=r.computed(()=>d!==null?(d.value&le.Open)===le.Open:a.comboboxState.value===0);wn({container:r.computed(()=>V(a.optionsRef)),enabled:r.computed(()=>a.comboboxState.value===0),accept(m){return m.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:m.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(m){m.setAttribute("role","none")}});function p(m){m.preventDefault()}return()=>{var m,g,t;let l={open:a.comboboxState.value===0},u={"aria-labelledby":(t=(m=V(a.labelRef))==null?void 0:m.id)!=null?t:(g=V(a.buttonRef))==null?void 0:g.id,id:s,ref:a.optionsRef,role:"listbox","aria-multiselectable":a.mode.value===1?!0:void 0,onMousedown:p},f=pe(n,["hold"]);return X({ourProps:u,theirProps:f,slot:l,attrs:i,slots:a.virtual.value&&a.comboboxState.value===0?{...e,default:()=>[r.h(Pn,{},e.default)]}:e,features:ae.RenderStrategy|ae.Static,visible:c.value,name:"ComboboxOptions"})}}}),Mn=r.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(n,{slots:i,attrs:e,expose:o}){let a=Q("ComboboxOption"),s=`headlessui-combobox-option-${re()}`,d=r.ref(null),c=r.computed(()=>n.disabled);o({el:d,$el:d});let p=r.computed(()=>{var w;return a.virtual.value?a.activeOptionIndex.value===a.calculateIndex(n.value):a.activeOptionIndex.value===null?!1:((w=a.options.value[a.activeOptionIndex.value])==null?void 0:w.id)===s}),m=r.computed(()=>a.isSelected(n.value)),g=r.inject(tt,null),t=r.computed(()=>({disabled:n.disabled,value:n.value,domRef:d,order:r.computed(()=>n.order)}));r.onMounted(()=>a.registerOption(s,t)),r.onUnmounted(()=>a.unregisterOption(s,p.value)),r.watchEffect(()=>{let w=V(d);w&&(g==null||g.value.measureElement(w))}),r.watchEffect(()=>{a.comboboxState.value===0&&p.value&&(a.virtual.value||a.activationTrigger.value!==0&&r.nextTick(()=>{var w,k;return(k=(w=V(d))==null?void 0:w.scrollIntoView)==null?void 0:k.call(w,{block:"nearest"})}))});function l(w){w.preventDefault(),w.button===Ye.Left&&(c.value||(a.selectOption(s),He()||requestAnimationFrame(()=>{var k;return(k=V(a.inputRef))==null?void 0:k.focus({preventScroll:!0})}),a.mode.value===0&&a.closeCombobox()))}function u(){var w;if(n.disabled||(w=a.virtual.value)!=null&&w.disabled(n.value))return a.goToOption(R.Nothing);let k=a.calculateIndex(n.value);a.goToOption(R.Specific,k)}let f=yn();function h(w){f.update(w)}function v(w){var k;if(!f.wasMoved(w)||n.disabled||(k=a.virtual.value)!=null&&k.disabled(n.value)||p.value)return;let I=a.calculateIndex(n.value);a.goToOption(R.Specific,I,0)}function _(w){var k;f.wasMoved(w)&&(n.disabled||(k=a.virtual.value)!=null&&k.disabled(n.value)||p.value&&(a.optionsPropsRef.value.hold||a.goToOption(R.Nothing)))}return()=>{let{disabled:w}=n,k={active:p.value,selected:m.value,disabled:w},I={id:s,ref:d,role:"option",tabIndex:w===!0?void 0:-1,"aria-disabled":w===!0?!0:void 0,"aria-selected":m.value,disabled:void 0,onMousedown:l,onFocus:u,onPointerenter:h,onMouseenter:h,onPointermove:v,onMousemove:v,onPointerleave:_,onMouseleave:_},x=pe(n,["order","value"]);return X({ourProps:I,theirProps:x,slot:k,attrs:e,slots:i,name:"ComboboxOption"})}}});function Fn(n,i){return r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[r.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 jn(n,i){return r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[r.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 Hn(n,i){return r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[r.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 nt={__name:"Select",props:r.mergeModels({languages:{type:Object,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const i=n,e=r.useModel(n,"modelValue"),o=r.ref(""),a=r.ref(null),s=r.computed(()=>Object.entries(i.languages).filter(([,c])=>c.toLowerCase().includes(o.value.toLowerCase()))),d=c=>{c.target.value="",o.value="",a.value&&a.value.$el.click()};return(c,p)=>(r.openBlock(),r.createBlock(r.unref(Bn),{modelValue:e.value,"onUpdate:modelValue":p[3]||(p[3]=m=>e.value=m),as:"div",class:"relative mt-1"},{default:r.withCtx(()=>[r.createVNode(r.unref(Dn),{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:p[0]||(p[0]=m=>o.value=m.target.value),displayValue:m=>n.languages[m],onFocus:p[1]||(p[1]=m=>d(m))},null,8,["displayValue"]),r.createVNode(r.unref(Rn),{ref_key:"btnSelect",ref:a,class:"absolute inset-y-0 right-0 flex items-center pr-2"},{default:r.withCtx(()=>[r.createVNode(r.unref(jn),{class:"h-5 w-5 text-gray-400","aria-hidden":"true",onClick:p[2]||(p[2]=m=>d(m))})]),_:1},512),r.createVNode(r.unref(Ln),{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:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,([m,g])=>(r.openBlock(),r.createBlock(r.unref(Mn),{key:m,value:m},{default:r.withCtx(({active:t,selected:l})=>[r.createElementVNode("li",{class:r.normalizeClass(["relative cursor-default select-none py-2 pl-3 pr-9",t?"bg-[#3B5695] text-white":"text-textCustom"])},[r.createElementVNode("span",{class:r.normalizeClass(["block truncate",l&&"font-semibold"])},r.toDisplayString(g),3)],2)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"]))}},ot="/assets/icons/transfer.svg",Gn={key:0},Un=[r.createElementVNode("img",{src:ot,alt:"swap",class:"w-4"},null,-1)],zn=[r.createElementVNode("img",{src:ot,alt:"swap",class:"w-4"},null,-1)],Wn={__name:"SwapBtn",props:{isBidirect:{type:Boolean,default:!1}},emits:["swap"],setup(n,{emit:i}){const e=i;return(o,a)=>n.isBidirect?(r.openBlock(),r.createElementBlock("button",{key:1,onClick:a[0]||(a[0]=s=>e("swap"))},zn)):(r.openBlock(),r.createElementBlock("button",Gn,Un))}};var rt=!1;function me(n,i,e){return Array.isArray(n)?(n.length=Math.max(n.length,i),n.splice(i,1,e),e):(n[i]=e,e)}function Oe(n,i){if(Array.isArray(n)){n.splice(i,1);return}delete n[i]}function qn(){return at().__VUE_DEVTOOLS_GLOBAL_HOOK__}function at(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Xn=typeof Proxy=="function",Yn="devtools-plugin:setup",Qn="plugin:settings:set";let ee,Ie;function Zn(){var n;return ee!==void 0||(typeof window<"u"&&window.performance?(ee=!0,Ie=window.performance):typeof globalThis<"u"&&(!((n=globalThis.perf_hooks)===null||n===void 0)&&n.performance)?(ee=!0,Ie=globalThis.perf_hooks.performance):ee=!1),ee}function Kn(){return Zn()?Ie.now():Date.now()}class Jn{constructor(i,e){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=i,this.hook=e;const o={};if(i.settings)for(const d in i.settings){const c=i.settings[d];o[d]=c.defaultValue}const a=`__vue-devtools-plugin-settings__${i.id}`;let s=Object.assign({},o);try{const d=localStorage.getItem(a),c=JSON.parse(d);Object.assign(s,c)}catch{}this.fallbacks={getSettings(){return s},setSettings(d){try{localStorage.setItem(a,JSON.stringify(d))}catch{}s=d},now(){return Kn()}},e&&e.on(Qn,(d,c)=>{d===this.plugin.id&&this.fallbacks.setSettings(c)}),this.proxiedOn=new Proxy({},{get:(d,c)=>this.target?this.target.on[c]:(...p)=>{this.onQueue.push({method:c,args:p})}}),this.proxiedTarget=new Proxy({},{get:(d,c)=>this.target?this.target[c]:c==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(c)?(...p)=>(this.targetQueue.push({method:c,args:p,resolve:()=>{}}),this.fallbacks[c](...p)):(...p)=>new Promise(m=>{this.targetQueue.push({method:c,args:p,resolve:m})})})}async setRealTarget(i){this.target=i;for(const e of this.onQueue)this.target.on[e.method](...e.args);for(const e of this.targetQueue)e.resolve(await this.target[e.method](...e.args))}}function lt(n,i){const e=n,o=at(),a=qn(),s=Xn&&e.enableEarlyProxy;if(a&&(o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))a.emit(Yn,n,i);else{const d=s?new Jn(e,a):null;(o.__VUE_DEVTOOLS_PLUGINS__=o.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:e,setupFn:i,proxy:d}),d&&i(d.proxiedTarget)}}/*!
|
|
7
|
+
`));let u=Ze((d=t.props)!=null?d:{},p,v),f=r.cloneVNode(t,u,!0);for(let h in u)h.startsWith("on")&&(f.props||(f.props={}),f.props[h]=u[h]);return f}return Array.isArray(m)&&m.length===1?m[0]:m}return r.h(c,Object.assign({},p,v),{default:()=>m})}function ze(n){return n.flatMap(i=>i.type===r.Fragment?ze(i.children):[i])}function Ze(...n){if(n.length===0)return{};if(n.length===1)return n[0];let i={},e={};for(let o of n)for(let a in o)a.startsWith("on")&&typeof o[a]=="function"?(e[a]!=null||(e[a]=[]),e[a].push(o[a])):i[a]=o[a];if(i.disabled||i["aria-disabled"])return Object.assign(i,Object.fromEntries(Object.keys(e).map(o=>[o,void 0])));for(let o in e)Object.assign(i,{[o](a,...s){let d=e[o];for(let c of d){if(a instanceof Event&&a.defaultPrevented)return;c(a,...s)}}});return i}function Cn(n){let i=Object.assign({},n);for(let e in i)i[e]===void 0&&delete i[e];return i}function pe(n,i=[]){let e=Object.assign({},n);for(let o of i)o in e&&delete e[o];return e}function En(n){return n==null?!1:typeof n.type=="string"||typeof n.type=="object"||typeof n.type=="function"}var We=(n=>(n[n.None=1]="None",n[n.Focusable=2]="Focusable",n[n.Hidden=4]="Hidden",n))(We||{});let Sn=r.defineComponent({name:"Hidden",props:{as:{type:[Object,String],default:"div"},features:{type:Number,default:1}},setup(n,{slots:i,attrs:e}){return()=>{var o;let{features:a,...s}=n,d={"aria-hidden":(a&2)===2?!0:(o=s["aria-hidden"])!=null?o:void 0,hidden:(a&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",...(a&4)===4&&(a&2)!==2&&{display:"none"}}};return q({ourProps:d,theirProps:s,slot:{},attrs:e,slots:i,name:"Hidden"})}}}),qe=Symbol("Context");var le=(n=>(n[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n))(le||{});function Tn(){return r.inject(qe,null)}function An(n){r.provide(qe,n)}var R=(n=>(n.Space=" ",n.Enter="Enter",n.Escape="Escape",n.Backspace="Backspace",n.Delete="Delete",n.ArrowLeft="ArrowLeft",n.ArrowUp="ArrowUp",n.ArrowRight="ArrowRight",n.ArrowDown="ArrowDown",n.Home="Home",n.End="End",n.PageUp="PageUp",n.PageDown="PageDown",n.Tab="Tab",n))(R||{}),Xe=(n=>(n[n.Left=0]="Left",n[n.Right=2]="Right",n))(Xe||{});function kn(n){function i(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",i))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",i),i())}let X=[];kn(()=>{function n(i){i.target instanceof HTMLElement&&i.target!==document.body&&X[0]!==i.target&&(X.unshift(i.target),X=X.filter(e=>e!=null&&e.isConnected),X.splice(10))}window.addEventListener("click",n,{capture:!0}),window.addEventListener("mousedown",n,{capture:!0}),window.addEventListener("focus",n,{capture:!0}),document.body.addEventListener("click",n,{capture:!0}),document.body.addEventListener("mousedown",n,{capture:!0}),document.body.addEventListener("focus",n,{capture:!0})});function On(n){throw new Error("Unexpected object: "+n)}var P=(n=>(n[n.First=0]="First",n[n.Previous=1]="Previous",n[n.Next=2]="Next",n[n.Last=3]="Last",n[n.Specific=4]="Specific",n[n.Nothing=5]="Nothing",n))(P||{});function Ye(n,i){let e=i.resolveItems();if(e.length<=0)return null;let o=i.resolveActiveIndex(),a=o??-1;switch(n.focus){case 0:{for(let s=0;s<e.length;++s)if(!i.resolveDisabled(e[s],s,e))return s;return o}case 1:{a===-1&&(a=e.length);for(let s=a-1;s>=0;--s)if(!i.resolveDisabled(e[s],s,e))return s;return o}case 2:{for(let s=a+1;s<e.length;++s)if(!i.resolveDisabled(e[s],s,e))return s;return o}case 3:{for(let s=e.length-1;s>=0;--s)if(!i.resolveDisabled(e[s],s,e))return s;return o}case 4:{for(let s=0;s<e.length;++s)if(i.resolveId(e[s],s,e)===n.id)return s;return o}case 5:return null;default:On(n)}}function Qe(n={},i=null,e=[]){for(let[o,a]of Object.entries(n))Je(e,Ke(i,o),a);return e}function Ke(n,i){return n?n+"["+i+"]":i}function Je(n,i,e){if(Array.isArray(e))for(let[o,a]of e.entries())Je(n,Ke(i,o.toString()),a);else e instanceof Date?n.push([i,e.toISOString()]):typeof e=="boolean"?n.push([i,e?"1":"0"]):typeof e=="string"?n.push([i,e]):typeof e=="number"?n.push([i,`${e}`]):e==null?n.push([i,""]):Qe(e,i,n)}function In(n,i){return n===i}var Vn=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(Vn||{}),$n=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))($n||{}),Ln=(n=>(n[n.Pointer=0]="Pointer",n[n.Focus=1]="Focus",n[n.Other=2]="Other",n))(Ln||{});let et=Symbol("ComboboxContext");function Y(n){let i=r.inject(et,null);if(i===null){let e=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Y),e}return i}let tt=Symbol("VirtualContext"),Bn=r.defineComponent({name:"VirtualProvider",setup(n,{slots:i}){let e=Y("VirtualProvider"),o=r.computed(()=>{let c=$(e.optionsRef);if(!c)return{start:0,end:0};let p=window.getComputedStyle(c);return{start:parseFloat(p.paddingBlockStart||p.paddingTop),end:parseFloat(p.paddingBlockEnd||p.paddingBottom)}}),a=Kt(r.computed(()=>({scrollPaddingStart:o.value.start,scrollPaddingEnd:o.value.end,count:e.virtual.value.options.length,estimateSize(){return 40},getScrollElement(){return $(e.optionsRef)},overscan:12}))),s=r.computed(()=>{var c;return(c=e.virtual.value)==null?void 0:c.options}),d=r.ref(0);return r.watch([s],()=>{d.value+=1}),r.provide(tt,e.virtual.value?a:null),()=>[r.h("div",{style:{position:"relative",width:"100%",height:`${a.value.getTotalSize()}px`},ref:c=>{if(c){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||e.activationTrigger.value===0)return;e.activeOptionIndex.value!==null&&e.virtual.value.options.length>e.activeOptionIndex.value&&a.value.scrollToIndex(e.activeOptionIndex.value)}}},a.value.getVirtualItems().map(c=>r.cloneVNode(i.default({option:e.virtual.value.options[c.index],open:e.comboboxState.value===0})[0],{key:`${d.value}-${c.index}`,"data-index":c.index,"aria-setsize":e.virtual.value.options.length,"aria-posinset":c.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${c.start}px)`,overflowAnchor:"none"}})))]}}),Nn=r.defineComponent({name:"Combobox",emits:{"update:modelValue":n=>!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(n,{slots:i,attrs:e,emit:o}){let a=r.ref(1),s=r.ref(null),d=r.ref(null),c=r.ref(null),p=r.ref(null),m=r.ref({static:!1,hold:!1}),v=r.ref([]),t=r.ref(null),l=r.ref(2),u=r.ref(!1);function f(b=y=>y){let y=t.value!==null?v.value[t.value]:null,S=b(v.value.slice()),k=S.length>0&&S[0].dataRef.order.value!==null?S.sort((L,F)=>L.dataRef.order.value-F.dataRef.order.value):mn(S,L=>$(L.dataRef.domRef)),V=y?k.indexOf(y):null;return V===-1&&(V=null),{options:k,activeOptionIndex:V}}let h=r.computed(()=>n.multiple?1:0),g=r.computed(()=>n.nullable),[_,w]=Jt(r.computed(()=>n.modelValue),b=>o("update:modelValue",b),r.computed(()=>n.defaultValue)),A=r.computed(()=>_.value===void 0?U(h.value,{1:[],0:void 0}):_.value),O=null,x=null;function I(b){return U(h.value,{0(){return w==null?void 0:w(b)},1:()=>{let y=r.toRaw(E.value.value).slice(),S=r.toRaw(b),k=y.findIndex(V=>E.compare(S,r.toRaw(V)));return k===-1?y.push(S):y.splice(k,1),w==null?void 0:w(y)}})}let C=r.computed(()=>{});r.watch([C],([b],[y])=>{if(E.virtual.value&&b&&y&&t.value!==null){let S=b.indexOf(y[t.value]);S!==-1?t.value=S:t.value=null}});let E={comboboxState:a,value:A,mode:h,compare(b,y){if(typeof n.by=="string"){let S=n.by;return(b==null?void 0:b[S])===(y==null?void 0:y[S])}return n.by===null?In(b,y):n.by(b,y)},calculateIndex(b){return E.virtual.value?n.by===null?E.virtual.value.options.indexOf(b):E.virtual.value.options.findIndex(y=>E.compare(y,b)):v.value.findIndex(y=>E.compare(y.dataRef.value,b))},defaultValue:r.computed(()=>n.defaultValue),nullable:g,immediate:r.computed(()=>!1),virtual:r.computed(()=>null),inputRef:d,labelRef:s,buttonRef:c,optionsRef:p,disabled:r.computed(()=>n.disabled),options:v,change(b){w(b)},activeOptionIndex:r.computed(()=>{if(u.value&&t.value===null&&(E.virtual.value?E.virtual.value.options.length>0:v.value.length>0)){if(E.virtual.value){let y=E.virtual.value.options.findIndex(S=>{var k;return!((k=E.virtual.value)!=null&&k.disabled(S))});if(y!==-1)return y}let b=v.value.findIndex(y=>!y.dataRef.disabled);if(b!==-1)return b}return t.value}),activationTrigger:l,optionsPropsRef:m,closeCombobox(){u.value=!1,!n.disabled&&a.value!==1&&(a.value=1,t.value=null)},openCombobox(){if(u.value=!0,!n.disabled&&a.value!==0){if(E.value.value){let b=E.calculateIndex(E.value.value);b!==-1&&(t.value=b)}a.value=0}},setActivationTrigger(b){l.value=b},goToOption(b,y,S){u.value=!1,O!==null&&cancelAnimationFrame(O),O=requestAnimationFrame(()=>{if(n.disabled||p.value&&!m.value.static&&a.value===1)return;if(E.virtual.value){t.value=b===P.Specific?y:Ye({focus:b},{resolveItems:()=>E.virtual.value.options,resolveActiveIndex:()=>{var L,F;return(F=(L=E.activeOptionIndex.value)!=null?L:E.virtual.value.options.findIndex(H=>{var N;return!((N=E.virtual.value)!=null&&N.disabled(H))}))!=null?F:null},resolveDisabled:L=>E.virtual.value.disabled(L),resolveId(){throw new Error("Function not implemented.")}}),l.value=S??2;return}let k=f();if(k.activeOptionIndex===null){let L=k.options.findIndex(F=>!F.dataRef.disabled);L!==-1&&(k.activeOptionIndex=L)}let V=b===P.Specific?y:Ye({focus:b},{resolveItems:()=>k.options,resolveActiveIndex:()=>k.activeOptionIndex,resolveId:L=>L.id,resolveDisabled:L=>L.dataRef.disabled});t.value=V,l.value=S??2,v.value=k.options})},selectOption(b){let y=v.value.find(k=>k.id===b);if(!y)return;let{dataRef:S}=y;I(S.value)},selectActiveOption(){if(E.activeOptionIndex.value!==null){if(E.virtual.value)I(E.virtual.value.options[E.activeOptionIndex.value]);else{let{dataRef:b}=v.value[E.activeOptionIndex.value];I(b.value)}E.goToOption(P.Specific,E.activeOptionIndex.value)}},registerOption(b,y){let S=r.reactive({id:b,dataRef:y});if(E.virtual.value){v.value.push(S);return}x&&cancelAnimationFrame(x);let k=f(V=>(V.push(S),V));t.value===null&&E.isSelected(y.value.value)&&(k.activeOptionIndex=k.options.indexOf(S)),v.value=k.options,t.value=k.activeOptionIndex,l.value=2,k.options.some(V=>!$(V.dataRef.domRef))&&(x=requestAnimationFrame(()=>{let V=f();v.value=V.options,t.value=V.activeOptionIndex}))},unregisterOption(b,y){if(O!==null&&cancelAnimationFrame(O),y&&(u.value=!0),E.virtual.value){v.value=v.value.filter(k=>k.id!==b);return}let S=f(k=>{let V=k.findIndex(L=>L.id===b);return V!==-1&&k.splice(V,1),k});v.value=S.options,t.value=S.activeOptionIndex,l.value=2},isSelected(b){return U(h.value,{0:()=>E.compare(r.toRaw(E.value.value),r.toRaw(b)),1:()=>r.toRaw(E.value.value).some(y=>E.compare(r.toRaw(y),r.toRaw(b)))})},isActive(b){return t.value===E.calculateIndex(b)}};vn([d,c,p],()=>E.closeCombobox(),r.computed(()=>a.value===0)),r.provide(et,E),An(r.computed(()=>U(a.value,{0:le.Open,1:le.Closed})));let T=r.computed(()=>{var b;return(b=$(d))==null?void 0:b.closest("form")});return r.onMounted(()=>{r.watch([T],()=>{if(!T.value||n.defaultValue===void 0)return;function b(){E.change(n.defaultValue)}return T.value.addEventListener("reset",b),()=>{var y;(y=T.value)==null||y.removeEventListener("reset",b)}},{immediate:!0})}),()=>{var b,y,S;let{name:k,disabled:V,form:L,...F}=n,H={open:a.value===0,disabled:V,activeIndex:E.activeOptionIndex.value,activeOption:E.activeOptionIndex.value===null?null:E.virtual.value?E.virtual.value.options[(b=E.activeOptionIndex.value)!=null?b:0]:(S=(y=E.options.value[E.activeOptionIndex.value])==null?void 0:y.dataRef.value)!=null?S:null,value:A.value};return r.h(r.Fragment,[...k!=null&&A.value!=null?Qe({[k]:A.value}).map(([N,la])=>r.h(Sn,Cn({features:We.Hidden,key:N,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:L,disabled:V,name:N,value:la}))):[],q({theirProps:{...e,...pe(F,["by","defaultValue","immediate","modelValue","multiple","nullable","onUpdate:modelValue","virtual"])},ourProps:{},slot:H,slots:i,attrs:e,name:"Combobox"})])}}});r.defineComponent({name:"ComboboxLabel",props:{as:{type:[Object,String],default:"label"},id:{type:String,default:null}},setup(n,{attrs:i,slots:e}){var o;let a=(o=n.id)!=null?o:`headlessui-combobox-label-${re()}`,s=Y("ComboboxLabel");function d(){var c;(c=$(s.inputRef))==null||c.focus({preventScroll:!0})}return()=>{let c={open:s.comboboxState.value===0,disabled:s.disabled.value},{...p}=n,m={id:a,ref:s.labelRef,onClick:d};return q({ourProps:m,theirProps:p,slot:c,attrs:i,slots:e,name:"ComboboxLabel"})}}});let Pn=r.defineComponent({name:"ComboboxButton",props:{as:{type:[Object,String],default:"button"},id:{type:String,default:null}},setup(n,{attrs:i,slots:e,expose:o}){var a;let s=(a=n.id)!=null?a:`headlessui-combobox-button-${re()}`,d=Y("ComboboxButton");o({el:d.buttonRef,$el:d.buttonRef});function c(v){d.disabled.value||(d.comboboxState.value===0?d.closeCombobox():(v.preventDefault(),d.openCombobox()),r.nextTick(()=>{var t;return(t=$(d.inputRef))==null?void 0:t.focus({preventScroll:!0})}))}function p(v){switch(v.key){case R.ArrowDown:v.preventDefault(),v.stopPropagation(),d.comboboxState.value===1&&d.openCombobox(),r.nextTick(()=>{var t;return(t=d.inputRef.value)==null?void 0:t.focus({preventScroll:!0})});return;case R.ArrowUp:v.preventDefault(),v.stopPropagation(),d.comboboxState.value===1&&(d.openCombobox(),r.nextTick(()=>{d.value.value||d.goToOption(P.Last)})),r.nextTick(()=>{var t;return(t=d.inputRef.value)==null?void 0:t.focus({preventScroll:!0})});return;case R.Escape:if(d.comboboxState.value!==0)return;v.preventDefault(),d.optionsRef.value&&!d.optionsPropsRef.value.static&&v.stopPropagation(),d.closeCombobox(),r.nextTick(()=>{var t;return(t=d.inputRef.value)==null?void 0:t.focus({preventScroll:!0})});return}}let m=bn(r.computed(()=>({as:n.as,type:i.type})),d.buttonRef);return()=>{var v,t;let l={open:d.comboboxState.value===0,disabled:d.disabled.value,value:d.value.value},{...u}=n,f={ref:d.buttonRef,id:s,type:m.value,tabindex:"-1","aria-haspopup":"listbox","aria-controls":(v=$(d.optionsRef))==null?void 0:v.id,"aria-expanded":d.comboboxState.value===0,"aria-labelledby":d.labelRef.value?[(t=$(d.labelRef))==null?void 0:t.id,s].join(" "):void 0,disabled:d.disabled.value===!0?!0:void 0,onKeydown:p,onClick:c};return q({ourProps:f,theirProps:u,slot:l,attrs:i,slots:e,name:"ComboboxButton"})}}}),Mn=r.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:n=>!0},setup(n,{emit:i,attrs:e,slots:o,expose:a}){var s;let d=(s=n.id)!=null?s:`headlessui-combobox-input-${re()}`,c=Y("ComboboxInput"),p=r.computed(()=>Te($(c.inputRef))),m={value:!1};a({el:c.inputRef,$el:c.inputRef});function v(){c.change(null);let x=$(c.optionsRef);x&&(x.scrollTop=0),c.goToOption(P.Nothing)}let t=r.computed(()=>{var x;let I=c.value.value;return $(c.inputRef)?typeof n.displayValue<"u"&&I!==void 0?(x=n.displayValue(I))!=null?x:"":typeof I=="string"?I:"":""});r.onMounted(()=>{r.watch([t,c.comboboxState,p],([x,I],[C,E])=>{if(m.value)return;let T=$(c.inputRef);T&&((E===0&&I===1||x!==C)&&(T.value=x),requestAnimationFrame(()=>{var b;if(m.value||!T||((b=p.value)==null?void 0:b.activeElement)!==T)return;let{selectionStart:y,selectionEnd:S}=T;Math.abs((S??0)-(y??0))===0&&y===0&&T.setSelectionRange(T.value.length,T.value.length)}))},{immediate:!0}),r.watch([c.comboboxState],([x],[I])=>{if(x===0&&I===1){if(m.value)return;let C=$(c.inputRef);if(!C)return;let E=C.value,{selectionStart:T,selectionEnd:b,selectionDirection:y}=C;C.value="",C.value=E,y!==null?C.setSelectionRange(T,b,y):C.setSelectionRange(T,b)}})});let l=r.ref(!1);function u(){l.value=!0}function f(){de().nextFrame(()=>{l.value=!1})}let h=nn();function g(x){switch(m.value=!0,h(()=>{m.value=!1}),x.key){case R.Enter:if(m.value=!1,c.comboboxState.value!==0||l.value)return;if(x.preventDefault(),x.stopPropagation(),c.activeOptionIndex.value===null){c.closeCombobox();return}c.selectActiveOption(),c.mode.value===0&&c.closeCombobox();break;case R.ArrowDown:return m.value=!1,x.preventDefault(),x.stopPropagation(),U(c.comboboxState.value,{0:()=>c.goToOption(P.Next),1:()=>c.openCombobox()});case R.ArrowUp:return m.value=!1,x.preventDefault(),x.stopPropagation(),U(c.comboboxState.value,{0:()=>c.goToOption(P.Previous),1:()=>{c.openCombobox(),r.nextTick(()=>{c.value.value||c.goToOption(P.Last)})}});case R.Home:if(x.shiftKey)break;return m.value=!1,x.preventDefault(),x.stopPropagation(),c.goToOption(P.First);case R.PageUp:return m.value=!1,x.preventDefault(),x.stopPropagation(),c.goToOption(P.First);case R.End:if(x.shiftKey)break;return m.value=!1,x.preventDefault(),x.stopPropagation(),c.goToOption(P.Last);case R.PageDown:return m.value=!1,x.preventDefault(),x.stopPropagation(),c.goToOption(P.Last);case R.Escape:if(m.value=!1,c.comboboxState.value!==0)return;x.preventDefault(),c.optionsRef.value&&!c.optionsPropsRef.value.static&&x.stopPropagation(),c.nullable.value&&c.mode.value===0&&c.value.value===null&&v(),c.closeCombobox();break;case R.Tab:if(m.value=!1,c.comboboxState.value!==0)return;c.mode.value===0&&c.activationTrigger.value!==1&&c.selectActiveOption(),c.closeCombobox();break}}function _(x){i("change",x),c.nullable.value&&c.mode.value===0&&x.target.value===""&&v(),c.openCombobox()}function w(x){var I,C,E;let T=(I=x.relatedTarget)!=null?I:X.find(b=>b!==x.currentTarget);if(m.value=!1,!((C=$(c.optionsRef))!=null&&C.contains(T))&&!((E=$(c.buttonRef))!=null&&E.contains(T))&&c.comboboxState.value===0)return x.preventDefault(),c.mode.value===0&&(c.nullable.value&&c.value.value===null?v():c.activationTrigger.value!==1&&c.selectActiveOption()),c.closeCombobox()}function A(x){var I,C,E;let T=(I=x.relatedTarget)!=null?I:X.find(b=>b!==x.currentTarget);(C=$(c.buttonRef))!=null&&C.contains(T)||(E=$(c.optionsRef))!=null&&E.contains(T)||c.disabled.value||c.immediate.value&&c.comboboxState.value!==0&&(c.openCombobox(),de().nextFrame(()=>{c.setActivationTrigger(1)}))}let O=r.computed(()=>{var x,I,C,E;return(E=(C=(I=n.defaultValue)!=null?I:c.defaultValue.value!==void 0?(x=n.displayValue)==null?void 0:x.call(n,c.defaultValue.value):null)!=null?C:c.defaultValue.value)!=null?E:""});return()=>{var x,I,C,E,T,b,y;let S={open:c.comboboxState.value===0},{displayValue:k,onChange:V,...L}=n,F={"aria-controls":(x=c.optionsRef.value)==null?void 0:x.id,"aria-expanded":c.comboboxState.value===0,"aria-activedescendant":c.activeOptionIndex.value===null?void 0:c.virtual.value?(I=c.options.value.find(H=>!c.virtual.value.disabled(H.dataRef.value)&&c.compare(H.dataRef.value,c.virtual.value.options[c.activeOptionIndex.value])))==null?void 0:I.id:(C=c.options.value[c.activeOptionIndex.value])==null?void 0:C.id,"aria-labelledby":(b=(E=$(c.labelRef))==null?void 0:E.id)!=null?b:(T=$(c.buttonRef))==null?void 0:T.id,"aria-autocomplete":"list",id:d,onCompositionstart:u,onCompositionend:f,onKeydown:g,onInput:_,onFocus:A,onBlur:w,role:"combobox",type:(y=e.type)!=null?y:"text",tabIndex:0,ref:c.inputRef,defaultValue:O.value,disabled:c.disabled.value===!0?!0:void 0};return q({ourProps:F,theirProps:L,slot:S,attrs:e,slots:o,features:ae.RenderStrategy|ae.Static,name:"ComboboxInput"})}}}),Rn=r.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(n,{attrs:i,slots:e,expose:o}){let a=Y("ComboboxOptions"),s=`headlessui-combobox-options-${re()}`;o({el:a.optionsRef,$el:a.optionsRef}),r.watchEffect(()=>{a.optionsPropsRef.value.static=n.static}),r.watchEffect(()=>{a.optionsPropsRef.value.hold=n.hold});let d=Tn(),c=r.computed(()=>d!==null?(d.value&le.Open)===le.Open:a.comboboxState.value===0);wn({container:r.computed(()=>$(a.optionsRef)),enabled:r.computed(()=>a.comboboxState.value===0),accept(m){return m.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:m.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(m){m.setAttribute("role","none")}});function p(m){m.preventDefault()}return()=>{var m,v,t;let l={open:a.comboboxState.value===0},u={"aria-labelledby":(t=(m=$(a.labelRef))==null?void 0:m.id)!=null?t:(v=$(a.buttonRef))==null?void 0:v.id,id:s,ref:a.optionsRef,role:"listbox","aria-multiselectable":a.mode.value===1?!0:void 0,onMousedown:p},f=pe(n,["hold"]);return q({ourProps:u,theirProps:f,slot:l,attrs:i,slots:a.virtual.value&&a.comboboxState.value===0?{...e,default:()=>[r.h(Bn,{},e.default)]}:e,features:ae.RenderStrategy|ae.Static,visible:c.value,name:"ComboboxOptions"})}}}),Dn=r.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(n,{slots:i,attrs:e,expose:o}){let a=Y("ComboboxOption"),s=`headlessui-combobox-option-${re()}`,d=r.ref(null),c=r.computed(()=>n.disabled);o({el:d,$el:d});let p=r.computed(()=>{var w;return a.virtual.value?a.activeOptionIndex.value===a.calculateIndex(n.value):a.activeOptionIndex.value===null?!1:((w=a.options.value[a.activeOptionIndex.value])==null?void 0:w.id)===s}),m=r.computed(()=>a.isSelected(n.value)),v=r.inject(tt,null),t=r.computed(()=>({disabled:n.disabled,value:n.value,domRef:d,order:r.computed(()=>n.order)}));r.onMounted(()=>a.registerOption(s,t)),r.onUnmounted(()=>a.unregisterOption(s,p.value)),r.watchEffect(()=>{let w=$(d);w&&(v==null||v.value.measureElement(w))}),r.watchEffect(()=>{a.comboboxState.value===0&&p.value&&(a.virtual.value||a.activationTrigger.value!==0&&r.nextTick(()=>{var w,A;return(A=(w=$(d))==null?void 0:w.scrollIntoView)==null?void 0:A.call(w,{block:"nearest"})}))});function l(w){w.preventDefault(),w.button===Xe.Left&&(c.value||(a.selectOption(s),je()||requestAnimationFrame(()=>{var A;return(A=$(a.inputRef))==null?void 0:A.focus({preventScroll:!0})}),a.mode.value===0&&a.closeCombobox()))}function u(){var w;if(n.disabled||(w=a.virtual.value)!=null&&w.disabled(n.value))return a.goToOption(P.Nothing);let A=a.calculateIndex(n.value);a.goToOption(P.Specific,A)}let f=yn();function h(w){f.update(w)}function g(w){var A;if(!f.wasMoved(w)||n.disabled||(A=a.virtual.value)!=null&&A.disabled(n.value)||p.value)return;let O=a.calculateIndex(n.value);a.goToOption(P.Specific,O,0)}function _(w){var A;f.wasMoved(w)&&(n.disabled||(A=a.virtual.value)!=null&&A.disabled(n.value)||p.value&&(a.optionsPropsRef.value.hold||a.goToOption(P.Nothing)))}return()=>{let{disabled:w}=n,A={active:p.value,selected:m.value,disabled:w},O={id:s,ref:d,role:"option",tabIndex:w===!0?void 0:-1,"aria-disabled":w===!0?!0:void 0,"aria-selected":m.value,disabled:void 0,onMousedown:l,onFocus:u,onPointerenter:h,onMouseenter:h,onPointermove:g,onMousemove:g,onPointerleave:_,onMouseleave:_},x=pe(n,["order","value"]);return q({ourProps:O,theirProps:x,slot:A,attrs:e,slots:i,name:"ComboboxOption"})}}});function Fn(n,i){return r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[r.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 Hn(n,i){return r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[r.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 jn(n,i){return r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[r.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 nt={__name:"Select",props:r.mergeModels({languages:{type:Object,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const i=n,e=r.useModel(n,"modelValue"),o=r.ref(""),a=r.ref(null),s=r.computed(()=>Object.entries(i.languages).filter(([,c])=>c.toLowerCase().includes(o.value.toLowerCase()))),d=c=>{c.target.value="",o.value="",a.value&&a.value.$el.click()};return(c,p)=>(r.openBlock(),r.createBlock(r.unref(Nn),{modelValue:e.value,"onUpdate:modelValue":p[3]||(p[3]=m=>e.value=m),as:"div",class:"relative mt-1"},{default:r.withCtx(()=>[r.createVNode(r.unref(Mn),{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:p[0]||(p[0]=m=>o.value=m.target.value),displayValue:m=>n.languages[m],onFocus:p[1]||(p[1]=m=>d(m))},null,8,["displayValue"]),r.createVNode(r.unref(Pn),{ref_key:"btnSelect",ref:a,class:"absolute inset-y-0 right-0 flex items-center pr-2"},{default:r.withCtx(()=>[r.createVNode(r.unref(Hn),{class:"h-5 w-5 text-gray-400","aria-hidden":"true",onClick:p[2]||(p[2]=m=>d(m))})]),_:1},512),r.createVNode(r.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:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,([m,v])=>(r.openBlock(),r.createBlock(r.unref(Dn),{key:m,value:m},{default:r.withCtx(({active:t,selected:l})=>[r.createElementVNode("li",{class:r.normalizeClass(["relative cursor-default select-none py-2 pl-3 pr-9",t?"bg-[#3B5695] text-white":"text-textCustom"])},[r.createElementVNode("span",{class:r.normalizeClass(["block truncate",l&&"font-semibold"])},r.toDisplayString(v),3)],2)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"]))}},ot="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",Gn={key:0},Un=[r.createElementVNode("img",{src:ot,alt:"swap",class:"w-4"},null,-1)],zn=[r.createElementVNode("img",{src:ot,alt:"swap",class:"w-4"},null,-1)],Zn={__name:"SwapBtn",props:{isBidirect:{type:Boolean,default:!1}},emits:["swap"],setup(n,{emit:i}){const e=i;return(o,a)=>n.isBidirect?(r.openBlock(),r.createElementBlock("button",{key:1,onClick:a[0]||(a[0]=s=>e("swap"))},zn)):(r.openBlock(),r.createElementBlock("button",Gn,Un))}};var rt=!1;function me(n,i,e){return Array.isArray(n)?(n.length=Math.max(n.length,i),n.splice(i,1,e),e):(n[i]=e,e)}function ke(n,i){if(Array.isArray(n)){n.splice(i,1);return}delete n[i]}function Wn(){return at().__VUE_DEVTOOLS_GLOBAL_HOOK__}function at(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const qn=typeof Proxy=="function",Xn="devtools-plugin:setup",Yn="plugin:settings:set";let ee,Oe;function Qn(){var n;return ee!==void 0||(typeof window<"u"&&window.performance?(ee=!0,Oe=window.performance):typeof globalThis<"u"&&(!((n=globalThis.perf_hooks)===null||n===void 0)&&n.performance)?(ee=!0,Oe=globalThis.perf_hooks.performance):ee=!1),ee}function Kn(){return Qn()?Oe.now():Date.now()}class Jn{constructor(i,e){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=i,this.hook=e;const o={};if(i.settings)for(const d in i.settings){const c=i.settings[d];o[d]=c.defaultValue}const a=`__vue-devtools-plugin-settings__${i.id}`;let s=Object.assign({},o);try{const d=localStorage.getItem(a),c=JSON.parse(d);Object.assign(s,c)}catch{}this.fallbacks={getSettings(){return s},setSettings(d){try{localStorage.setItem(a,JSON.stringify(d))}catch{}s=d},now(){return Kn()}},e&&e.on(Yn,(d,c)=>{d===this.plugin.id&&this.fallbacks.setSettings(c)}),this.proxiedOn=new Proxy({},{get:(d,c)=>this.target?this.target.on[c]:(...p)=>{this.onQueue.push({method:c,args:p})}}),this.proxiedTarget=new Proxy({},{get:(d,c)=>this.target?this.target[c]:c==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(c)?(...p)=>(this.targetQueue.push({method:c,args:p,resolve:()=>{}}),this.fallbacks[c](...p)):(...p)=>new Promise(m=>{this.targetQueue.push({method:c,args:p,resolve:m})})})}async setRealTarget(i){this.target=i;for(const e of this.onQueue)this.target.on[e.method](...e.args);for(const e of this.targetQueue)e.resolve(await this.target[e.method](...e.args))}}function lt(n,i){const e=n,o=at(),a=Wn(),s=qn&&e.enableEarlyProxy;if(a&&(o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))a.emit(Xn,n,i);else{const d=s?new Jn(e,a):null;(o.__VUE_DEVTOOLS_PLUGINS__=o.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:e,setupFn:i,proxy:d}),d&&i(d.proxiedTarget)}}/*!
|
|
8
8
|
* pinia v2.1.7
|
|
9
9
|
* (c) 2023 Eduardo San Martin Morote
|
|
10
10
|
* @license MIT
|
|
11
|
-
*/let ie;const se=n=>ie=n,it=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function
|
|
11
|
+
*/let ie;const se=n=>ie=n,it=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function Q(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var G;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(G||(G={}));const _e=typeof window<"u",ce=(process.env.NODE_ENV!=="production"||!1)&&process.env.NODE_ENV!=="test"&&_e,st=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 eo(n,{autoBom:i=!1}={}){return i&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(n.type)?new Blob(["\uFEFF",n],{type:n.type}):n}function Ie(n,i,e){const o=new XMLHttpRequest;o.open("GET",n),o.responseType="blob",o.onload=function(){dt(o.response,i,e)},o.onerror=function(){console.error("could not download file")},o.send()}function ct(n){const i=new XMLHttpRequest;i.open("HEAD",n,!1);try{i.send()}catch{}return i.status>=200&&i.status<=299}function he(n){try{n.dispatchEvent(new MouseEvent("click"))}catch{const e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),n.dispatchEvent(e)}}const ge=typeof navigator=="object"?navigator:{userAgent:""},ut=/Macintosh/.test(ge.userAgent)&&/AppleWebKit/.test(ge.userAgent)&&!/Safari/.test(ge.userAgent),dt=_e?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!ut?to:"msSaveOrOpenBlob"in ge?no:oo:()=>{};function to(n,i="download",e){const o=document.createElement("a");o.download=i,o.rel="noopener",typeof n=="string"?(o.href=n,o.origin!==location.origin?ct(o.href)?Ie(n,i,e):(o.target="_blank",he(o)):he(o)):(o.href=URL.createObjectURL(n),setTimeout(function(){URL.revokeObjectURL(o.href)},4e4),setTimeout(function(){he(o)},0))}function no(n,i="download",e){if(typeof n=="string")if(ct(n))Ie(n,i,e);else{const o=document.createElement("a");o.href=n,o.target="_blank",setTimeout(function(){he(o)})}else navigator.msSaveOrOpenBlob(eo(n,e),i)}function oo(n,i,e,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof n=="string")return Ie(n,i,e);const a=n.type==="application/octet-stream",s=/constructor/i.test(String(st.HTMLElement))||"safari"in st,d=/CriOS\/[\d]+/.test(navigator.userAgent);if((d||a&&s||ut)&&typeof FileReader<"u"){const c=new FileReader;c.onloadend=function(){let p=c.result;if(typeof p!="string")throw o=null,new Error("Wrong reader.result type");p=d?p:p.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=p:location.assign(p),o=null},c.readAsDataURL(n)}else{const c=URL.createObjectURL(n);o?o.location.assign(c):location.href=c,o=null,setTimeout(function(){URL.revokeObjectURL(c)},4e4)}}function B(n,i){const e="🍍 "+n;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(e,i):i==="error"?console.error(e):i==="warn"?console.warn(e):console.log(e)}function Ve(n){return"_a"in n&&"install"in n}function ft(){if(!("clipboard"in navigator))return B("Your browser doesn't support the Clipboard API","error"),!0}function pt(n){return n instanceof Error&&n.message.toLowerCase().includes("document is not focused")?(B('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function ro(n){if(!ft())try{await navigator.clipboard.writeText(JSON.stringify(n.state.value)),B("Global state copied to clipboard.")}catch(i){if(pt(i))return;B("Failed to serialize the state. Check the console for more details.","error"),console.error(i)}}async function ao(n){if(!ft())try{mt(n,JSON.parse(await navigator.clipboard.readText())),B("Global state pasted from clipboard.")}catch(i){if(pt(i))return;B("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(i)}}async function lo(n){try{dt(new Blob([JSON.stringify(n.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(i){B("Failed to export the state as JSON. Check the console for more details.","error"),console.error(i)}}let z;function io(){z||(z=document.createElement("input"),z.type="file",z.accept=".json");function n(){return new Promise((i,e)=>{z.onchange=async()=>{const o=z.files;if(!o)return i(null);const a=o.item(0);return i(a?{text:await a.text(),file:a}:null)},z.oncancel=()=>i(null),z.onerror=e,z.click()})}return n}async function so(n){try{const e=await io()();if(!e)return;const{text:o,file:a}=e;mt(n,JSON.parse(o)),B(`Global state imported from "${a.name}".`)}catch(i){B("Failed to import the state from JSON. Check the console for more details.","error"),console.error(i)}}function mt(n,i){for(const e in i){const o=n.state.value[e];o?Object.assign(o,i[e]):n.state.value[e]=i[e]}}function j(n){return{_custom:{display:n}}}const _t="🍍 Pinia (root)",$e="_root";function co(n){return Ve(n)?{id:$e,label:_t}:{id:n.$id,label:n.$id}}function uo(n){if(Ve(n)){const e=Array.from(n._s.keys()),o=n._s;return{state:e.map(s=>({editable:!0,key:s,value:n.state.value[s]})),getters:e.filter(s=>o.get(s)._getters).map(s=>{const d=o.get(s);return{editable:!1,key:s,value:d._getters.reduce((c,p)=>(c[p]=d[p],c),{})}})}}const i={state:Object.keys(n.$state).map(e=>({editable:!0,key:e,value:n.$state[e]}))};return n._getters&&n._getters.length&&(i.getters=n._getters.map(e=>({editable:!1,key:e,value:n[e]}))),n._customProperties.size&&(i.customProperties=Array.from(n._customProperties).map(e=>({editable:!0,key:e,value:n[e]}))),i}function fo(n){return n?Array.isArray(n)?n.reduce((i,e)=>(i.keys.push(e.key),i.operations.push(e.type),i.oldValue[e.key]=e.oldValue,i.newValue[e.key]=e.newValue,i),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:j(n.type),key:j(n.key),oldValue:n.oldValue,newValue:n.newValue}:{}}function po(n){switch(n){case G.direct:return"mutation";case G.patchFunction:return"$patch";case G.patchObject:return"$patch";default:return"unknown"}}let te=!0;const ve=[],K="pinia:mutations",M="pinia",{assign:mo}=Object,be=n=>"🍍 "+n;function _o(n,i){lt({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:ve,app:n},e=>{typeof e.now!="function"&&B("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."),e.addTimelineLayer({id:K,label:"Pinia 🍍",color:15064968}),e.addInspector({id:M,label:"Pinia 🍍",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{ro(i)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await ao(i),e.sendInspectorTree(M),e.sendInspectorState(M)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{lo(i)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await so(i),e.sendInspectorTree(M),e.sendInspectorState(M)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:o=>{const a=i._s.get(o);a?typeof a.$reset!="function"?B(`Cannot reset "${o}" store because it doesn't have a "$reset" method implemented.`,"warn"):(a.$reset(),B(`Store "${o}" reset.`)):B(`Cannot reset "${o}" store because it wasn't found.`,"warn")}}]}),e.on.inspectComponent((o,a)=>{const s=o.componentInstance&&o.componentInstance.proxy;if(s&&s._pStores){const d=o.componentInstance.proxy._pStores;Object.values(d).forEach(c=>{o.instanceData.state.push({type:be(c.$id),key:"state",editable:!0,value:c._isOptionsAPI?{_custom:{value:r.toRaw(c.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>c.$reset()}]}}:Object.keys(c.$state).reduce((p,m)=>(p[m]=c.$state[m],p),{})}),c._getters&&c._getters.length&&o.instanceData.state.push({type:be(c.$id),key:"getters",editable:!1,value:c._getters.reduce((p,m)=>{try{p[m]=c[m]}catch(v){p[m]=v}return p},{})})})}}),e.on.getInspectorTree(o=>{if(o.app===n&&o.inspectorId===M){let a=[i];a=a.concat(Array.from(i._s.values())),o.rootNodes=(o.filter?a.filter(s=>"$id"in s?s.$id.toLowerCase().includes(o.filter.toLowerCase()):_t.toLowerCase().includes(o.filter.toLowerCase())):a).map(co)}}),e.on.getInspectorState(o=>{if(o.app===n&&o.inspectorId===M){const a=o.nodeId===$e?i:i._s.get(o.nodeId);if(!a)return;a&&(o.state=uo(a))}}),e.on.editInspectorState((o,a)=>{if(o.app===n&&o.inspectorId===M){const s=o.nodeId===$e?i:i._s.get(o.nodeId);if(!s)return B(`store "${o.nodeId}" not found`,"error");const{path:d}=o;Ve(s)?d.unshift("state"):(d.length!==1||!s._customProperties.has(d[0])||d[0]in s.$state)&&d.unshift("$state"),te=!1,o.set(s,d,o.state.value),te=!0}}),e.on.editComponentState(o=>{if(o.type.startsWith("🍍")){const a=o.type.replace(/^🍍\s*/,""),s=i._s.get(a);if(!s)return B(`store "${a}" not found`,"error");const{path:d}=o;if(d[0]!=="state")return B(`Invalid path for store "${a}":
|
|
12
12
|
${d}
|
|
13
|
-
Only state can be modified.`);d[0]="$state",te=!1,o.set(s,d,o.state.value),te=!0}})})}function ho(n,i){ve.includes(be(i.$id))||ve.push(be(i.$id)),lt({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:ve,app:n,settings:{logStoreChanges:{label:"Notify about new/deleted stores",type:"boolean",defaultValue:!0}}},e=>{const o=typeof e.now=="function"?e.now.bind(e):Date.now;i.$onAction(({after:d,onError:c,name:p,args:m})=>{const
|
|
13
|
+
Only state can be modified.`);d[0]="$state",te=!1,o.set(s,d,o.state.value),te=!0}})})}function ho(n,i){ve.includes(be(i.$id))||ve.push(be(i.$id)),lt({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:ve,app:n,settings:{logStoreChanges:{label:"Notify about new/deleted stores",type:"boolean",defaultValue:!0}}},e=>{const o=typeof e.now=="function"?e.now.bind(e):Date.now;i.$onAction(({after:d,onError:c,name:p,args:m})=>{const v=ht++;e.addTimelineEvent({layerId:K,event:{time:o(),title:"🛫 "+p,subtitle:"start",data:{store:j(i.$id),action:j(p),args:m},groupId:v}}),d(t=>{Z=void 0,e.addTimelineEvent({layerId:K,event:{time:o(),title:"🛬 "+p,subtitle:"end",data:{store:j(i.$id),action:j(p),args:m,result:t},groupId:v}})}),c(t=>{Z=void 0,e.addTimelineEvent({layerId:K,event:{time:o(),logType:"error",title:"💥 "+p,subtitle:"end",data:{store:j(i.$id),action:j(p),args:m,error:t},groupId:v}})})},!0),i._customProperties.forEach(d=>{r.watch(()=>r.unref(i[d]),(c,p)=>{e.notifyComponentUpdate(),e.sendInspectorState(M),te&&e.addTimelineEvent({layerId:K,event:{time:o(),title:"Change",subtitle:d,data:{newValue:c,oldValue:p},groupId:Z}})},{deep:!0})}),i.$subscribe(({events:d,type:c},p)=>{if(e.notifyComponentUpdate(),e.sendInspectorState(M),!te)return;const m={time:o(),title:po(c),data:mo({store:j(i.$id)},fo(d)),groupId:Z};c===G.patchFunction?m.subtitle="⤵️":c===G.patchObject?m.subtitle="🧩":d&&!Array.isArray(d)&&(m.subtitle=d.type),d&&(m.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:d}}),e.addTimelineEvent({layerId:K,event:m})},{detached:!0,flush:"sync"});const a=i._hotUpdate;i._hotUpdate=r.markRaw(d=>{a(d),e.addTimelineEvent({layerId:K,event:{time:o(),title:"🔥 "+i.$id,subtitle:"HMR update",data:{store:j(i.$id),info:j("HMR update")}}}),e.notifyComponentUpdate(),e.sendInspectorTree(M),e.sendInspectorState(M)});const{$dispose:s}=i;i.$dispose=()=>{s(),e.notifyComponentUpdate(),e.sendInspectorTree(M),e.sendInspectorState(M),e.getSettings().logStoreChanges&&B(`Disposed "${i.$id}" store 🗑`)},e.notifyComponentUpdate(),e.sendInspectorTree(M),e.sendInspectorState(M),e.getSettings().logStoreChanges&&B(`"${i.$id}" store installed 🆕`)})}let ht=0,Z;function gt(n,i,e){const o=i.reduce((a,s)=>(a[s]=r.toRaw(n)[s],a),{});for(const a in o)n[a]=function(){const s=ht,d=e?new Proxy(n,{get(...p){return Z=s,Reflect.get(...p)},set(...p){return Z=s,Reflect.set(...p)}}):n;Z=s;const c=o[a].apply(d,arguments);return Z=void 0,c}}function go({app:n,store:i,options:e}){if(i.$id.startsWith("__hot:"))return;i._isOptionsAPI=!!e.state,gt(i,Object.keys(e.actions),i._isOptionsAPI);const o=i._hotUpdate;r.toRaw(i)._hotUpdate=function(a){o.apply(this,arguments),gt(i,Object.keys(a._hmrPayload.actions),!!i._isOptionsAPI)},ho(n,i)}function vo(){const n=r.effectScope(!0),i=n.run(()=>r.ref({}));let e=[],o=[];const a=r.markRaw({install(s){se(a),a._a=s,s.provide(it,a),s.config.globalProperties.$pinia=a,ce&&_o(s,a),o.forEach(d=>e.push(d)),o=[]},use(s){return!this._a&&!rt?o.push(s):e.push(s),this},_p:e,_a:null,_e:n,_s:new Map,state:i});return ce&&typeof Proxy<"u"&&a.use(go),a}function vt(n,i){for(const e in i){const o=i[e];if(!(e in n))continue;const a=n[e];Q(a)&&Q(o)&&!r.isRef(o)&&!r.isReactive(o)?n[e]=vt(a,o):n[e]=o}return n}const bt=()=>{};function yt(n,i,e,o=bt){n.push(i);const a=()=>{const s=n.indexOf(i);s>-1&&(n.splice(s,1),o())};return!e&&r.getCurrentScope()&&r.onScopeDispose(a),a}function ne(n,...i){n.slice().forEach(e=>{e(...i)})}const bo=n=>n();function Le(n,i){n instanceof Map&&i instanceof Map&&i.forEach((e,o)=>n.set(o,e)),n instanceof Set&&i instanceof Set&&i.forEach(n.add,n);for(const e in i){if(!i.hasOwnProperty(e))continue;const o=i[e],a=n[e];Q(a)&&Q(o)&&n.hasOwnProperty(e)&&!r.isRef(o)&&!r.isReactive(o)?n[e]=Le(a,o):n[e]=o}return n}const yo=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function wo(n){return!Q(n)||!n.hasOwnProperty(yo)}const{assign:D}=Object;function wt(n){return!!(r.isRef(n)&&n.effect)}function xt(n,i,e,o){const{state:a,actions:s,getters:d}=i,c=e.state.value[n];let p;function m(){!c&&(process.env.NODE_ENV==="production"||!o)&&(e.state.value[n]=a?a():{});const v=process.env.NODE_ENV!=="production"&&o?r.toRefs(r.ref(a?a():{}).value):r.toRefs(e.state.value[n]);return D(v,s,Object.keys(d||{}).reduce((t,l)=>(process.env.NODE_ENV!=="production"&&l in v&&console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${l}" in store "${n}".`),t[l]=r.markRaw(r.computed(()=>{se(e);const u=e._s.get(n);return d[l].call(u,u)})),t),{}))}return p=Be(n,m,i,e,o,!0),p}function Be(n,i,e={},o,a,s){let d;const c=D({actions:{}},e);if(process.env.NODE_ENV!=="production"&&!o._e.active)throw new Error("Pinia destroyed");const p={deep:!0};process.env.NODE_ENV!=="production"&&!rt&&(p.onTrigger=b=>{m?u=b:m==!1&&!C._hotUpdating&&(Array.isArray(u)?u.push(b):console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let m,v,t=[],l=[],u;const f=o.state.value[n];!s&&!f&&(process.env.NODE_ENV==="production"||!a)&&(o.state.value[n]={});const h=r.ref({});let g;function _(b){let y;m=v=!1,process.env.NODE_ENV!=="production"&&(u=[]),typeof b=="function"?(b(o.state.value[n]),y={type:G.patchFunction,storeId:n,events:u}):(Le(o.state.value[n],b),y={type:G.patchObject,payload:b,storeId:n,events:u});const S=g=Symbol();r.nextTick().then(()=>{g===S&&(m=!0)}),v=!0,ne(t,y,o.state.value[n])}const w=s?function(){const{state:y}=e,S=y?y():{};this.$patch(k=>{D(k,S)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${n}" is built using the setup syntax and does not implement $reset().`)}:bt;function A(){d.stop(),t=[],l=[],o._s.delete(n)}function O(b,y){return function(){se(o);const S=Array.from(arguments),k=[],V=[];function L(N){k.push(N)}function F(N){V.push(N)}ne(l,{args:S,name:b,store:C,after:L,onError:F});let H;try{H=y.apply(this&&this.$id===n?this:C,S)}catch(N){throw ne(V,N),N}return H instanceof Promise?H.then(N=>(ne(k,N),N)).catch(N=>(ne(V,N),Promise.reject(N))):(ne(k,H),H)}}const x=r.markRaw({actions:{},getters:{},state:[],hotState:h}),I={_p:o,$id:n,$onAction:yt.bind(null,l),$patch:_,$reset:w,$subscribe(b,y={}){const S=yt(t,b,y.detached,()=>k()),k=d.run(()=>r.watch(()=>o.state.value[n],V=>{(y.flush==="sync"?v:m)&&b({storeId:n,type:G.direct,events:u},V)},D({},p,y)));return S},$dispose:A},C=r.reactive(process.env.NODE_ENV!=="production"||ce?D({_hmrPayload:x,_customProperties:r.markRaw(new Set)},I):I);o._s.set(n,C);const T=(o._a&&o._a.runWithContext||bo)(()=>o._e.run(()=>(d=r.effectScope()).run(i)));for(const b in T){const y=T[b];if(r.isRef(y)&&!wt(y)||r.isReactive(y))process.env.NODE_ENV!=="production"&&a?me(h.value,b,r.toRef(T,b)):s||(f&&wo(y)&&(r.isRef(y)?y.value=f[b]:Le(y,f[b])),o.state.value[n][b]=y),process.env.NODE_ENV!=="production"&&x.state.push(b);else if(typeof y=="function"){const S=process.env.NODE_ENV!=="production"&&a?y:O(b,y);T[b]=S,process.env.NODE_ENV!=="production"&&(x.actions[b]=y),c.actions[b]=y}else process.env.NODE_ENV!=="production"&&wt(y)&&(x.getters[b]=s?e.getters[b]:y,_e&&(T._getters||(T._getters=r.markRaw([]))).push(b))}if(D(C,T),D(r.toRaw(C),T),Object.defineProperty(C,"$state",{get:()=>process.env.NODE_ENV!=="production"&&a?h.value:o.state.value[n],set:b=>{if(process.env.NODE_ENV!=="production"&&a)throw new Error("cannot set hotState");_(y=>{D(y,b)})}}),process.env.NODE_ENV!=="production"&&(C._hotUpdate=r.markRaw(b=>{C._hotUpdating=!0,b._hmrPayload.state.forEach(y=>{if(y in C.$state){const S=b.$state[y],k=C.$state[y];typeof S=="object"&&Q(S)&&Q(k)?vt(S,k):b.$state[y]=k}me(C,y,r.toRef(b.$state,y))}),Object.keys(C.$state).forEach(y=>{y in b.$state||ke(C,y)}),m=!1,v=!1,o.state.value[n]=r.toRef(b._hmrPayload,"hotState"),v=!0,r.nextTick().then(()=>{m=!0});for(const y in b._hmrPayload.actions){const S=b[y];me(C,y,O(y,S))}for(const y in b._hmrPayload.getters){const S=b._hmrPayload.getters[y],k=s?r.computed(()=>(se(o),S.call(C,C))):S;me(C,y,k)}Object.keys(C._hmrPayload.getters).forEach(y=>{y in b._hmrPayload.getters||ke(C,y)}),Object.keys(C._hmrPayload.actions).forEach(y=>{y in b._hmrPayload.actions||ke(C,y)}),C._hmrPayload=b._hmrPayload,C._getters=b._getters,C._hotUpdating=!1})),ce){const b={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(y=>{Object.defineProperty(C,y,D({value:C[y]},b))})}return o._p.forEach(b=>{if(ce){const y=d.run(()=>b({store:C,app:o._a,pinia:o,options:c}));Object.keys(y||{}).forEach(S=>C._customProperties.add(S)),D(C,y)}else D(C,d.run(()=>b({store:C,app:o._a,pinia:o,options:c})))}),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 "${
|
|
15
|
+
Found in store "${C.$id}".`),f&&s&&e.hydrate&&e.hydrate(C.$state,f),m=!0,v=!0,C}function Ne(n,i,e){let o,a;const s=typeof i=="function";if(typeof n=="string")o=n,a=s?e:i;else if(a=n,o=n.id,process.env.NODE_ENV!=="production"&&typeof o!="string")throw new Error('[🍍]: "defineStore()" must be passed a store id as its first argument.');function d(c,p){const m=r.hasInjectionContext();if(c=(process.env.NODE_ENV==="test"&&ie&&ie._testing?null:c)||(m?r.inject(it,null):null),c&&se(c),process.env.NODE_ENV!=="production"&&!ie)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.`);c=ie,c._s.has(o)||(s?Pe(o,i,a,c):xt(o,a,c),process.env.NODE_ENV!=="production"&&(d._pinia=c));const g=c._s.get(o);if(process.env.NODE_ENV!=="production"&&p){const t="__hot:"+o,l=s?Pe(t,i,a,c,!0):xt(t,M({},a),c,!0);p._hotUpdate(l),delete c.state.value[t],c._s.delete(t)}if(process.env.NODE_ENV!=="production"&&_e){const t=r.getCurrentInstance();if(t&&t.proxy&&!p){const l=t.proxy,u="_pStores"in l?l._pStores:l._pStores={};u[o]=g}}return g}return d.$id=o,d}const ye=Be("language",()=>{const n=r.ref("auto"),i=r.ref("en"),e=r.ref({src:[],target:[]}),o=r.computed(()=>e.value.src[n.value]),a=r.computed(()=>e.value.target[i.value]);function s(p,m){n.value=p==null?void 0:p.src,i.value=p==null?void 0:p.target,e.value=m}function d(){if(!e.value.src[i.value]||!e.value.target[n.value])return;const p=n.value;n.value=i.value,i.value=p}function c(p){return e.value.src[p]||e.value.target[p]}return{languages:e,src:n,target:i,srcLabel:o,targetLabel:a,init:s,swap:d,getLabel:c}}),xo={key:0,class:"flex"},Eo={__name:"Selects",setup(n){const i=ye();function e(){i.swap()}return(o,a)=>r.unref(i).languages?(r.openBlock(),r.createElementBlock("div",xo,[r.createVNode(nt,{modelValue:r.unref(i).src,"onUpdate:modelValue":a[0]||(a[0]=s=>r.unref(i).src=s),languages:r.unref(i).languages.src,class:"grow"},null,8,["modelValue","languages"]),r.createVNode(Wn,{isBidirect:r.unref(i).src!=="auto",class:"grow-0 mx-3",onSwap:e},null,8,["isBidirect"]),r.createVNode(nt,{modelValue:r.unref(i).target,"onUpdate:modelValue":a[1]||(a[1]=s=>r.unref(i).target=s),languages:r.unref(i).languages.target,class:"grow"},null,8,["modelValue","languages"])])):r.createCommentVNode("",!0)}},So={INPUT_MAX_LENGTH:5e3,INPUT_DEBOUNCE:500},we=(n,i)=>{const e=n.__vccOpts||n;for(const[o,a]of i)e[o]=a;return e},To={},Ao={class:"mr-2 loading loading-dots loading-xs"};function ko(n,i){return r.openBlock(),r.createElementBlock("span",Ao)}const Oo=we(To,[["render",ko]]),Io="/assets/icons/volume.svg",$o="/assets/icons/volume-stop.svg";function Co(n,{volume:i=1,playbackRate:e=1,soundEnabled:o=!0,interrupt:a=!1,autoplay:s=!1,onload:d,...c}={}){const p=r.ref(null),m=r.ref(!1),g=r.ref(null),t=r.ref(null);function l(){var _;typeof d=="function"&&d.call(this),g.value=(g.value||((_=t.value)==null?void 0:_.duration())||0)*1e3,s===!0&&(m.value=!0)}return r.onMounted(async()=>{const _=await Promise.resolve().then(()=>aa);p.value=_.default.Howl,t.value=new p.value({src:r.unref(n),volume:r.unref(i),rate:r.unref(e),onload:l,...c})}),r.watch(()=>[n],()=>{p.value&&p.value&&t&&t.value&&(t.value=new p.value({src:r.unref(n),volume:r.unref(i),rate:r.unref(e),onload:l,...c}))}),r.watch(()=>[r.unref(i),r.unref(e)],()=>{t.value&&(t.value.volume(r.unref(i)),t.value.rate(r.unref(e)))}),{play:_=>{typeof _>"u"&&(_={}),!(!t.value||!o&&!_.forceSoundEnabled)&&(a&&t.value.stop(),_.playbackRate&&t.value.rate(_.playbackRate),t.value.play(_.id),t.value.once("end",()=>{t.value&&t.value&&!t.value.playing()&&(m.value=!1)}),m.value=!0)},sound:t,isPlaying:m,duration:g,pause:_=>{t.value&&(t.value.pause(typeof _=="number"?_:void 0),m.value=!1)},stop:_=>{t.value&&(t.value.stop(typeof _=="number"?_:void 0),m.value=!1)}}}const Vo={key:0,src:Io,alt:"Play"},No={key:1,src:$o,alt:"Stop"},Po={__name:"SpeakBtn",props:{url:{type:String,default:""}},setup(n){const i=n,{play:e,stop:o,isPlaying:a}=Co(i.url),s=r.ref(!1);r.watch(()=>a.value,c=>{s.value=c});function d(){if(a.value){o();return}e()}return(c,p)=>(r.openBlock(),r.createElementBlock("button",{class:"btn btn-xs btn-ghost btn-circle",onClick:r.withModifiers(d,["prevent"])},[r.unref(a)?(r.openBlock(),r.createElementBlock("img",No)):(r.openBlock(),r.createElementBlock("img",Vo))]))}},Bo="/assets/icons/cancel.svg",Ro={},Do={class:"btn btn-xs btn-circle btn-ghost"},Lo=[r.createElementVNode("img",{src:Bo,alt:"Clear",class:"w-4"},null,-1)];function Mo(n,i){return r.openBlock(),r.createElementBlock("button",Do,Lo)}const Fo=we(Ro,[["render",Mo]]),jo="/assets/icons/favorite-filled.svg",Ho="/assets/icons/favorite.svg",Go={class:"btn btn-xs btn-circle btn-ghost"},Uo={key:0,src:jo,alt:"Clear",class:"w-4"},zo={key:1,src:Ho,alt:"Clear",class:"w-4"},Wo={__name:"FavoriteBtn",props:{isFilled:Boolean},setup(n){const i=n;return(e,o)=>(r.openBlock(),r.createElementBlock("button",Go,[i.isFilled?(r.openBlock(),r.createElementBlock("img",Uo)):(r.openBlock(),r.createElementBlock("img",zo))]))}},qo={class:"flex flex-row rounded-t-lg bg-white border border-b-0 px-1 pr-1 pt-1 gap-1 items-center"},Xo={class:"text-sm text-gray-600"},Yo={key:0,class:"italic"},Qo=r.createElementVNode("div",{class:"flex-grow"},null,-1),Et={__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(n,{emit:i}){const e=n,o=i;return(a,s)=>(r.openBlock(),r.createElementBlock("div",qo,[e.tts?(r.openBlock(),r.createBlock(Po,{key:0,url:e.tts},null,8,["url"])):r.createCommentVNode("",!0),r.createElementVNode("div",Xo,[r.createTextVNode(r.toDisplayString(n.srcLabel)+" ",1),n.phonetic?(r.openBlock(),r.createElementBlock("span",Yo,"- ["+r.toDisplayString(e.phonetic)+"]",1)):r.createCommentVNode("",!0)]),Qo,e.loading?(r.openBlock(),r.createBlock(Oo,{key:1})):r.createCommentVNode("",!0),e.src&&e.isClearBtn?(r.openBlock(),r.createBlock(Fo,{key:2,onClick:s[0]||(s[0]=d=>o("clear"))})):r.createCommentVNode("",!0),e.src&&e.isFavoriteBtn?(r.openBlock(),r.createBlock(Wo,{key:3,isFilled:e.isFavorite,onClick:s[1]||(s[1]=d=>o("favorite"))},null,8,["isFilled"])):r.createCommentVNode("",!0)]))}},J=Be("translation",()=>{const n=r.ref(null),i=r.ref(null),e=r.ref({src:null,target:null}),o=r.ref(null),a=r.ref([]),s=r.ref([]),d=r.ref([]),c=r.ref([]),p=r.ref({src:null,target:null}),m=ye(),g=r.computed(()=>m.getLabel(n.value)),t=r.computed(()=>m.getLabel(i.value));function l(f){n.value=f.src,i.value=f.target,e.value=f.phonetic,o.value=f.result,a.value=f.dictionary,s.value=f.definitions,d.value=f.synonyms,c.value=f.examples,p.value=f.tts}function u(){n.value=null,i.value=null,e.value={src:null,target:null},o.value=null,a.value=[],s.value=[],d.value=[],c.value=[],p.value={src:null,target:null}}return{src:n,srcLabel:g,target:i,targetLabel:t,phonetic:e,result:o,dictionary:a,definitions:s,synonyms:d,examples:c,tts:p,init:l,reset:u}});function Zo(n){return r.getCurrentScope()?(r.onScopeDispose(n),!0):!1}function xe(n){return typeof n=="function"?n():r.unref(n)}const Ko=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const St=()=>{};function Jo(n,i){function e(...o){return new Promise((a,s)=>{Promise.resolve(n(()=>i.apply(this,o),{fn:i,thisArg:this,args:o})).then(a).catch(s)})}return e}function er(n,i={}){let e,o,a=St;const s=c=>{clearTimeout(c),a(),a=St};return c=>{const p=xe(n),m=xe(i.maxWait);return e&&s(e),p<=0||m!==void 0&&m<=0?(o&&(s(o),o=null),Promise.resolve(c())):new Promise((g,t)=>{a=i.rejectOnCancel?t:g,m&&!o&&(o=setTimeout(()=>{e&&s(e),o=null,g(c())},m)),e=setTimeout(()=>{o&&s(o),o=null,g(c())},p)})}}function tr(n,i=200,e={}){return Jo(er(i,e),n)}function Tt(n){var i;const e=xe(n);return(i=e==null?void 0:e.$el)!=null?i:e}const nr=Ko?window:void 0;function or(){const n=r.ref(!1),i=r.getCurrentInstance();return i&&r.onMounted(()=>{n.value=!0},i),n}function rr(n){const i=or();return r.computed(()=>(i.value,!!n()))}function ar(n,i,e={}){const{window:o=nr,...a}=e;let s;const d=rr(()=>o&&"ResizeObserver"in o),c=()=>{s&&(s.disconnect(),s=void 0)},p=r.computed(()=>Array.isArray(n)?n.map(t=>Tt(t)):[Tt(n)]),m=r.watch(p,t=>{if(c(),d.value&&o){s=new ResizeObserver(i);for(const l of t)l&&s.observe(l,a)}},{immediate:!0,flush:"post"}),g=()=>{c(),m()};return Zo(g),{isSupported:d,stop:g}}function At(n){var i;const e=r.ref(n==null?void 0:n.element),o=r.ref(n==null?void 0:n.input),a=(i=n==null?void 0:n.styleProp)!=null?i:"height",s=r.ref(1);function d(){var c;if(!e.value)return;let p="";e.value.style[a]="1px",s.value=(c=e.value)==null?void 0:c.scrollHeight,n!=null&&n.styleTarget?xe(n.styleTarget).style[a]=`${s.value}px`:p=`${s.value}px`,e.value.style[a]=p}return r.watch([o,e],()=>r.nextTick(d),{immediate:!0}),r.watch(s,()=>{var c;return(c=n==null?void 0:n.onResize)==null?void 0:c.call(n)}),ar(e,()=>d()),n!=null&&n.watch&&r.watch(n.watch,d,{immediate:!0,deep:!0}),{textarea:e,input:o,triggerResize:d}}const lr=we({__name:"TranslationInput",props:{text:{type:String,default:""}},emits:["change","clear"],setup(n,{emit:i}){const e=J(),o=n,a=r.ref(o.text),s=r.computed(()=>e.src),d=r.computed(()=>e.srcLabel),c=r.computed(()=>{var f;return(f=e.phonetic)==null?void 0:f.src}),p=r.computed(()=>{var f;return(f=e.tts)==null?void 0:f.src}),{textarea:m}=At({input:a,styleProp:"minHeight"}),g=i,t=tr(()=>{g("change",a.value)},So.INPUT_DEBOUNCE);function l(){if(!a.value){u();return}t()}function u(){g("clear"),a.value="",m.value.focus()}return r.watch(()=>o.text,f=>{a.value=f}),(f,h)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(Et,{src:s.value,srcLabel:d.value,tts:p.value,phonetic:c.value,isClearBtn:!0,onClear:u},null,8,["src","srcLabel","tts","phonetic"]),r.withDirectives(r.createElementVNode("textarea",{ref_key:"textarea",ref:m,"onUpdate:modelValue":h[0]||(h[0]=v=>a.value=v),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",autofocus:"",rows:"2",onInput:l},null,544),[[r.vModelText,a.value,void 0,{trim:!0}]])],64))}},[["__scopeId","data-v-ef4399dd"]]),ir="/assets/icons/google-translate.svg",kt=Be("loader",()=>({loading:r.ref(!1)})),sr=n=>(r.pushScopeId("data-v-cbd6addc"),n=n(),r.popScopeId(),n),cr={class:"flex flex-col"},ur=sr(()=>r.createElementVNode("div",{class:"w-full flex align-item-center justify-end"},[r.createElementVNode("span",{class:"text-sm"},"Powered by Google Translate"),r.createElementVNode("img",{src:ir,alt:"Google",class:"h-5 ml-2"})],-1)),dr=we({__name:"TranslationResult",props:{isFavoriteFeatureEnabled:Boolean},setup(n){const i=J(),e=r.ref(!1),o=r.computed(()=>i.result),a=r.computed(()=>i.target),s=r.computed(()=>i.targetLabel),d=r.computed(()=>{var l;return(l=i.phonetic)==null?void 0:l.target}),c=r.computed(()=>{var l;return(l=i.tts)==null?void 0:l.target}),p=n,m=kt(),{textarea:g,input:t}=At({input:o,styleProp:"minHeight"});return(l,u)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(Et,{loading:r.unref(m).loading,src:a.value,srcLabel:s.value,tts:c.value,isFavoriteBtn:p.isFavoriteFeatureEnabled,isFavorite:e.value,phonetic:d.value,onFavorite:u[0]||(u[0]=f=>e.value=!e.value)},null,8,["loading","src","srcLabel","tts","isFavoriteBtn","isFavorite","phonetic"]),r.createElementVNode("div",cr,[r.withDirectives(r.createElementVNode("textarea",{ref_key:"textarea",ref:g,"onUpdate:modelValue":u[1]||(u[1]=f=>r.isRef(t)?t.value=f: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",readonly:"",rows:"2",spellcheck:"false"},null,512),[[r.vModelText,r.unref(t)]]),ur])],64))}},[["__scopeId","data-v-cbd6addc"]]),fr={class:"btn btn-sm btn-circle btn-ghost"},Ee={__name:"ToggleBtn",props:{isExpanded:Boolean},setup(n){const i=n;return(e,o)=>(r.openBlock(),r.createElementBlock("button",fr,[i.isExpanded?(r.openBlock(),r.createBlock(r.unref(Hn),{key:0,class:"w-7 text-gray-400"})):(r.openBlock(),r.createBlock(r.unref(Fn),{key:1,class:"w-7 text-gray-400"}))]))}},pr={class:"card border bg-white rounded-lg"},mr={class:"card-body px-4 py-2 gap-0"},_r={class:"flex justify-between items-center"},hr=r.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Translations",-1),gr={class:"capitalize text-base font-normal text-textSecondary mb-1"},vr={class:"list-none list-inside"},br=["onClick"],yr={class:"text-base font-normal text-gray-800 leading-4"},wr={__name:"Dictionary",emits:["translate"],setup(n,{emit:i}){const e=r.ref(!0),o=J(),a=ye(),s=r.computed(()=>o.dictionary),d=i,c=()=>{e.value=!e.value},p=m=>{const g=o.src,t=o.target;a.src=t,a.target=g,d("translate",m)};return(m,g)=>(r.openBlock(),r.createElementBlock("div",pr,[r.createElementVNode("div",mr,[r.createElementVNode("div",_r,[hr,r.createVNode(Ee,{isExpanded:e.value,onClick:c},null,8,["isExpanded"])]),r.createElementVNode("div",{class:r.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",e.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[r.createElementVNode("ul",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,(t,l)=>(r.openBlock(),r.createElementBlock("li",{key:`${t.pos}-${l}`,class:"mb-2"},[r.createElementVNode("h5",gr,r.toDisplayString(t.pos),1),r.createElementVNode("ul",vr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.items,(u,f)=>(r.openBlock(),r.createElementBlock("li",{key:`${u.word}-${f}`},[r.createElementVNode("span",{class:"p-3 m-0.5 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded-lg",onClick:h=>p(u.word)},r.toDisplayString(u.word),9,br),r.createElementVNode("small",yr," - "+r.toDisplayString(u.reverse_translation.join(", ")),1)]))),128))])]))),128))])],2)])]))}},xr={class:"card border bg-white rounded-lg"},Er={class:"card-body px-4 py-2 gap-0"},Sr={class:"flex justify-between items-center"},Tr=r.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Definitions",-1),Ar={class:"capitalize text-base font-normal text-textSecondary mb-1"},kr={class:"text-base text-textCustom list-decimal list-outside ml-5"},Or=r.createElementVNode("br",null,null,-1),Ir={key:0,class:"italic"},$r={__name:"Definition",setup(n){const i=r.ref(!0),e=J(),o=r.computed(()=>e.definitions),a=()=>{i.value=!i.value};return(s,d)=>(r.openBlock(),r.createElementBlock("div",xr,[r.createElementVNode("div",Er,[r.createElementVNode("div",Sr,[Tr,r.createVNode(Ee,{isExpanded:i.value,onClick:a},null,8,["isExpanded"])]),r.createElementVNode("div",{class:r.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",i.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[r.createElementVNode("ul",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(c,p)=>(r.openBlock(),r.createElementBlock("li",{key:`${c.pos}-${p}`,class:"mb-2"},[r.createElementVNode("h5",Ar,r.toDisplayString(c.pos),1),r.createElementVNode("ul",kr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.items,(m,g)=>(r.openBlock(),r.createElementBlock("li",{key:`${m.gloss}-${g}`,class:"mb-1"},[r.createElementVNode("span",null,r.toDisplayString(m.gloss),1),Or,m.example?(r.openBlock(),r.createElementBlock("small",Ir,'"'+r.toDisplayString(m.example)+'"',1)):r.createCommentVNode("",!0)]))),128))])]))),128))])],2)])]))}},Cr={class:"card border bg-white rounded-lg"},Vr={class:"card-body px-4 py-2 gap-0"},Nr={class:"flex justify-between items-center"},Pr=r.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Examples",-1),Br={class:"text-textCustom list-decimal list-outside ml-7 mt-2"},Rr=["innerHTML"],Dr={__name:"Example",setup(n){const i=r.ref(!0),e=J(),o=r.computed(()=>e.examples),a=()=>{i.value=!i.value};return(s,d)=>(r.openBlock(),r.createElementBlock("div",Cr,[r.createElementVNode("div",Vr,[r.createElementVNode("div",Nr,[Pr,r.createVNode(Ee,{isExpanded:i.value,onClick:a},null,8,["isExpanded"])]),r.createElementVNode("div",{class:r.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",i.value?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"])},[r.createElementVNode("ul",Br,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(c,p)=>(r.openBlock(),r.createElementBlock("li",{key:`${c.definition_id}-${p}`,innerHTML:c},null,8,Rr))),128))])],2)])]))}},Lr={class:"card border bg-white rounded-lg"},Mr={class:"card-body px-4 py-2 gap-0"},Fr={class:"flex justify-between items-center"},jr=r.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Synonyms",-1),Hr={class:"capitalize text-base font-normal text-textSecondary mb-1"},Gr={class:"list-none list-inside"},Ur={class:"flex flex-wrap"},zr=["onClick"],Wr={__name:"Synonyms",emits:["translate"],setup(n,{emit:i}){const e=r.ref(!0),o=J(),a=r.computed(()=>o.synonyms),s=i,d=()=>{e.value=!e.value},c=p=>{s("translate",p)};return(p,m)=>(r.openBlock(),r.createElementBlock("div",Lr,[r.createElementVNode("div",Mr,[r.createElementVNode("div",Fr,[jr,r.createVNode(Ee,{isExpanded:e.value,onClick:d},null,8,["isExpanded"])]),r.createElementVNode("div",{class:r.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",e.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[r.createElementVNode("ul",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,(g,t)=>(r.openBlock(),r.createElementBlock("li",{key:`${g.pos}-${t}`,class:"mb-2"},[r.createElementVNode("h5",Hr,r.toDisplayString(g.pos),1),r.createElementVNode("ul",Gr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g.items,(l,u)=>(r.openBlock(),r.createElementBlock("li",{key:`${l.word}-${u}`,class:"mb-2"},[r.createElementVNode("div",Ur,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.synonym,(f,h)=>(r.openBlock(),r.createElementBlock("span",{key:`${f}-${h}`,class:"p-3 m-0.5 ml-0 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded-lg",onClick:v=>c(f)},r.toDisplayString(f),9,zr))),128))])]))),128))])]))),128))])],2)])]))}},qr={class:"bg-white min-h-screen flex flex-col"},Xr={class:"py-2 px-5 shadow-lg"},Yr={class:"px-5 flex-grow"},Qr={class:"flex flex-col lg:flex-row lg:gap-2"},Zr={class:"w-full lg:w-[calc(50%-1rem)] my-2"},Kr=r.createElementVNode("div",{class:"w-6 h-4 mx-auto hidden lg:block"},null,-1),Jr={class:"w-full lg:w-[calc(50%-1rem)] my-2"},ea={class:"grid grid-cols-1 lg:grid-cols-3 gap-4"},ta={key:0,class:"w-full my-4"},na=r.createElementVNode("div",{class:"mt-auto py-5 px-5"},[r.createElementVNode("span",{class:"block text-center text-gray-700"}," The site is not affiliated with Google Translate "),r.createElementVNode("span",{class:"block text-center text-gray-700"},"Since 2011")],-1),oa={__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(n,{emit:i}){var l;const e=vo(),o=J(e),a=ye(e),s=kt(e),d=n,c=i,p=r.ref((l=d.translation)==null?void 0:l.text);r.watch(()=>d.translation,u=>{s.loading=!1,o.init(u)},{immediate:!0}),r.watch([()=>d.opt,()=>d.languages],([u,f])=>{a.init(u,f)}),r.watch([()=>a.src,()=>a.target],([u,f])=>{c("opt",{src:u,target:f}),p.value&&t(p.value)}),r.onMounted(()=>{a.init(d.opt,d.languages)});function m(){p.value="",o.reset()}function g(u){u&&t(u)}function t(u){p.value=u,s.loading=!0,c("translate",{src:a.src,target:a.target,text:u})}return(u,f)=>(r.openBlock(),r.createElementBlock("div",qr,[r.createElementVNode("div",Xr,[r.createVNode(Mt,{onReader:f[0]||(f[0]=h=>c("reader")),onSettings:f[1]||(f[1]=h=>c("settings")),onFullScreen:f[2]||(f[2]=h=>c("fullscreen"))})]),r.createElementVNode("div",Yr,[r.createVNode(Eo,{class:"my-4"}),r.createElementVNode("div",Qr,[r.createElementVNode("div",Zr,[r.createVNode(lr,{text:p.value,onChange:g,onClear:m},null,8,["text"])]),Kr,r.createElementVNode("div",Jr,[r.createVNode(dr,{isFavoriteFeatureEnabled:n.isFavoriteFeatureEnabled},null,8,["isFavoriteFeatureEnabled"])])]),r.createElementVNode("div",ea,[r.unref(o).dictionary.length?(r.openBlock(),r.createBlock(wr,{key:0,onTranslate:t})):r.createCommentVNode("",!0),r.unref(o).definitions.length?(r.openBlock(),r.createBlock($r,{key:1})):r.createCommentVNode("",!0),r.unref(o).synonyms.length?(r.openBlock(),r.createBlock(Wr,{key:2,onTranslate:t})):r.createCommentVNode("",!0)]),r.unref(o).examples.length?(r.openBlock(),r.createElementBlock("div",ta,[r.createVNode(Dr)])):r.createCommentVNode("",!0)]),na]))}};var ue=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ra(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Re={};/*!
|
|
17
|
+
This will fail in production.`);c=ie,c._s.has(o)||(s?Be(o,i,a,c):xt(o,a,c),process.env.NODE_ENV!=="production"&&(d._pinia=c));const v=c._s.get(o);if(process.env.NODE_ENV!=="production"&&p){const t="__hot:"+o,l=s?Be(t,i,a,c,!0):xt(t,D({},a),c,!0);p._hotUpdate(l),delete c.state.value[t],c._s.delete(t)}if(process.env.NODE_ENV!=="production"&&_e){const t=r.getCurrentInstance();if(t&&t.proxy&&!p){const l=t.proxy,u="_pStores"in l?l._pStores:l._pStores={};u[o]=v}}return v}return d.$id=o,d}const ye=Ne("language",()=>{const n=r.ref("auto"),i=r.ref("en"),e=r.ref({src:[],target:[]}),o=r.computed(()=>e.value.src[n.value]),a=r.computed(()=>e.value.target[i.value]);function s(p,m){n.value=p==null?void 0:p.src,i.value=p==null?void 0:p.target,e.value=m}function d(){if(!e.value.src[i.value]||!e.value.target[n.value])return;const p=n.value;n.value=i.value,i.value=p}function c(p){return e.value.src[p]||e.value.target[p]}return{languages:e,src:n,target:i,srcLabel:o,targetLabel:a,init:s,swap:d,getLabel:c}}),xo={key:0,class:"flex"},Co={__name:"Selects",setup(n){const i=ye();function e(){i.swap()}return(o,a)=>r.unref(i).languages?(r.openBlock(),r.createElementBlock("div",xo,[r.createVNode(nt,{modelValue:r.unref(i).src,"onUpdate:modelValue":a[0]||(a[0]=s=>r.unref(i).src=s),languages:r.unref(i).languages.src,class:"grow"},null,8,["modelValue","languages"]),r.createVNode(Zn,{isBidirect:r.unref(i).src!=="auto",class:"grow-0 mx-3",onSwap:e},null,8,["isBidirect"]),r.createVNode(nt,{modelValue:r.unref(i).target,"onUpdate:modelValue":a[1]||(a[1]=s=>r.unref(i).target=s),languages:r.unref(i).languages.target,class:"grow"},null,8,["modelValue","languages"])])):r.createCommentVNode("",!0)}},Eo={INPUT_MAX_LENGTH:5e3,INPUT_DEBOUNCE:500},we=(n,i)=>{const e=n.__vccOpts||n;for(const[o,a]of i)e[o]=a;return e},So={},To={class:"mr-2 loading loading-dots loading-xs"};function Ao(n,i){return r.openBlock(),r.createElementBlock("span",To)}const ko=we(So,[["render",Ao]]),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",Io="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";function Vo(n,{volume:i=1,playbackRate:e=1,soundEnabled:o=!0,interrupt:a=!1,autoplay:s=!1,onload:d,...c}={}){const p=r.ref(null),m=r.ref(!1),v=r.ref(null),t=r.ref(null);function l(){var _;typeof d=="function"&&d.call(this),v.value=(v.value||((_=t.value)==null?void 0:_.duration())||0)*1e3,s===!0&&(m.value=!0)}return r.onMounted(async()=>{const _=await Promise.resolve().then(()=>aa);p.value=_.default.Howl,t.value=new p.value({src:r.unref(n),volume:r.unref(i),rate:r.unref(e),onload:l,...c})}),r.watch(()=>[n],()=>{p.value&&p.value&&t&&t.value&&(t.value=new p.value({src:r.unref(n),volume:r.unref(i),rate:r.unref(e),onload:l,...c}))}),r.watch(()=>[r.unref(i),r.unref(e)],()=>{t.value&&(t.value.volume(r.unref(i)),t.value.rate(r.unref(e)))}),{play:_=>{typeof _>"u"&&(_={}),!(!t.value||!o&&!_.forceSoundEnabled)&&(a&&t.value.stop(),_.playbackRate&&t.value.rate(_.playbackRate),t.value.play(_.id),t.value.once("end",()=>{t.value&&t.value&&!t.value.playing()&&(m.value=!1)}),m.value=!0)},sound:t,isPlaying:m,duration:v,pause:_=>{t.value&&(t.value.pause(typeof _=="number"?_:void 0),m.value=!1)},stop:_=>{t.value&&(t.value.stop(typeof _=="number"?_:void 0),m.value=!1)}}}const $o={key:0,src:Oo,alt:"Play"},Lo={key:1,src:Io,alt:"Stop"},Bo={__name:"SpeakBtn",props:{url:{type:String,default:""}},setup(n){const i=n,{play:e,stop:o,isPlaying:a}=Vo(i.url),s=r.ref(!1);r.watch(()=>a.value,c=>{s.value=c});function d(){if(a.value){o();return}e()}return(c,p)=>(r.openBlock(),r.createElementBlock("button",{class:"btn btn-xs btn-ghost btn-circle",onClick:r.withModifiers(d,["prevent"])},[r.unref(a)?(r.openBlock(),r.createElementBlock("img",Lo)):(r.openBlock(),r.createElementBlock("img",$o))]))}},No="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",Po={},Mo={class:"btn btn-xs btn-circle btn-ghost"},Ro=[r.createElementVNode("img",{src:No,alt:"Clear",class:"w-4"},null,-1)];function Do(n,i){return r.openBlock(),r.createElementBlock("button",Mo,Ro)}const Fo=we(Po,[["render",Do]]),Ho="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",jo="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",Go={class:"btn btn-xs btn-circle btn-ghost"},Uo={key:0,src:Ho,alt:"Clear",class:"w-4"},zo={key:1,src:jo,alt:"Clear",class:"w-4"},Zo={__name:"FavoriteBtn",props:{isFilled:Boolean},setup(n){const i=n;return(e,o)=>(r.openBlock(),r.createElementBlock("button",Go,[i.isFilled?(r.openBlock(),r.createElementBlock("img",Uo)):(r.openBlock(),r.createElementBlock("img",zo))]))}},Wo={class:"flex flex-row rounded-t-lg bg-white border border-b-0 px-1 pr-1 pt-1 gap-1 items-center"},qo={class:"text-sm text-gray-600"},Xo={key:0,class:"italic"},Yo=r.createElementVNode("div",{class:"flex-grow"},null,-1),Ct={__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(n,{emit:i}){const e=n,o=i;return(a,s)=>(r.openBlock(),r.createElementBlock("div",Wo,[e.tts?(r.openBlock(),r.createBlock(Bo,{key:0,url:e.tts},null,8,["url"])):r.createCommentVNode("",!0),r.createElementVNode("div",qo,[r.createTextVNode(r.toDisplayString(n.srcLabel)+" ",1),n.phonetic?(r.openBlock(),r.createElementBlock("span",Xo,"- ["+r.toDisplayString(e.phonetic)+"]",1)):r.createCommentVNode("",!0)]),Yo,e.loading?(r.openBlock(),r.createBlock(ko,{key:1})):r.createCommentVNode("",!0),e.src&&e.isClearBtn?(r.openBlock(),r.createBlock(Fo,{key:2,onClick:s[0]||(s[0]=d=>o("clear"))})):r.createCommentVNode("",!0),e.src&&e.isFavoriteBtn?(r.openBlock(),r.createBlock(Zo,{key:3,isFilled:e.isFavorite,onClick:s[1]||(s[1]=d=>o("favorite"))},null,8,["isFilled"])):r.createCommentVNode("",!0)]))}},J=Ne("translation",()=>{const n=r.ref(null),i=r.ref(null),e=r.ref({src:null,target:null}),o=r.ref(null),a=r.ref([]),s=r.ref([]),d=r.ref([]),c=r.ref([]),p=r.ref({src:null,target:null}),m=ye(),v=r.computed(()=>m.getLabel(n.value)),t=r.computed(()=>m.getLabel(i.value));function l(f){n.value=f.src,i.value=f.target,e.value=f.phonetic,o.value=f.result,a.value=f.dictionary,s.value=f.definitions,d.value=f.synonyms,c.value=f.examples,p.value=f.tts}function u(){n.value=null,i.value=null,e.value={src:null,target:null},o.value=null,a.value=[],s.value=[],d.value=[],c.value=[],p.value={src:null,target:null}}return{src:n,srcLabel:v,target:i,targetLabel:t,phonetic:e,result:o,dictionary:a,definitions:s,synonyms:d,examples:c,tts:p,init:l,reset:u}});function Qo(n){return r.getCurrentScope()?(r.onScopeDispose(n),!0):!1}function xe(n){return typeof n=="function"?n():r.unref(n)}const Ko=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Et=()=>{};function Jo(n,i){function e(...o){return new Promise((a,s)=>{Promise.resolve(n(()=>i.apply(this,o),{fn:i,thisArg:this,args:o})).then(a).catch(s)})}return e}function er(n,i={}){let e,o,a=Et;const s=c=>{clearTimeout(c),a(),a=Et};return c=>{const p=xe(n),m=xe(i.maxWait);return e&&s(e),p<=0||m!==void 0&&m<=0?(o&&(s(o),o=null),Promise.resolve(c())):new Promise((v,t)=>{a=i.rejectOnCancel?t:v,m&&!o&&(o=setTimeout(()=>{e&&s(e),o=null,v(c())},m)),e=setTimeout(()=>{o&&s(o),o=null,v(c())},p)})}}function tr(n,i=200,e={}){return Jo(er(i,e),n)}function St(n){var i;const e=xe(n);return(i=e==null?void 0:e.$el)!=null?i:e}const nr=Ko?window:void 0;function or(){const n=r.ref(!1),i=r.getCurrentInstance();return i&&r.onMounted(()=>{n.value=!0},i),n}function rr(n){const i=or();return r.computed(()=>(i.value,!!n()))}function ar(n,i,e={}){const{window:o=nr,...a}=e;let s;const d=rr(()=>o&&"ResizeObserver"in o),c=()=>{s&&(s.disconnect(),s=void 0)},p=r.computed(()=>Array.isArray(n)?n.map(t=>St(t)):[St(n)]),m=r.watch(p,t=>{if(c(),d.value&&o){s=new ResizeObserver(i);for(const l of t)l&&s.observe(l,a)}},{immediate:!0,flush:"post"}),v=()=>{c(),m()};return Qo(v),{isSupported:d,stop:v}}function Tt(n){var i;const e=r.ref(n==null?void 0:n.element),o=r.ref(n==null?void 0:n.input),a=(i=n==null?void 0:n.styleProp)!=null?i:"height",s=r.ref(1);function d(){var c;if(!e.value)return;let p="";e.value.style[a]="1px",s.value=(c=e.value)==null?void 0:c.scrollHeight,n!=null&&n.styleTarget?xe(n.styleTarget).style[a]=`${s.value}px`:p=`${s.value}px`,e.value.style[a]=p}return r.watch([o,e],()=>r.nextTick(d),{immediate:!0}),r.watch(s,()=>{var c;return(c=n==null?void 0:n.onResize)==null?void 0:c.call(n)}),ar(e,()=>d()),n!=null&&n.watch&&r.watch(n.watch,d,{immediate:!0,deep:!0}),{textarea:e,input:o,triggerResize:d}}const lr=we({__name:"TranslationInput",props:{text:{type:String,default:""}},emits:["change","clear"],setup(n,{emit:i}){const e=J(),o=n,a=r.ref(o.text),s=r.computed(()=>e.src),d=r.computed(()=>e.srcLabel),c=r.computed(()=>{var f;return(f=e.phonetic)==null?void 0:f.src}),p=r.computed(()=>{var f;return(f=e.tts)==null?void 0:f.src}),{textarea:m}=Tt({input:a,styleProp:"minHeight"}),v=i,t=tr(()=>{v("change",a.value)},Eo.INPUT_DEBOUNCE);function l(){if(!a.value){u();return}t()}function u(){v("clear"),a.value="",m.value.focus()}return r.watch(()=>o.text,f=>{a.value=f}),(f,h)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(Ct,{src:s.value,srcLabel:d.value,tts:p.value,phonetic:c.value,isClearBtn:!0,onClear:u},null,8,["src","srcLabel","tts","phonetic"]),r.withDirectives(r.createElementVNode("textarea",{ref_key:"textarea",ref:m,"onUpdate:modelValue":h[0]||(h[0]=g=>a.value=g),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",autofocus:"",rows:"2",onInput:l,onFocus:h[1]||(h[1]=g=>g.target.select())},null,544),[[r.vModelText,a.value,void 0,{trim:!0}]])],64))}},[["__scopeId","data-v-5ce52ee5"]]),ir="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",At=Ne("loader",()=>({loading:r.ref(!1)})),sr=n=>(r.pushScopeId("data-v-5a9dbf88"),n=n(),r.popScopeId(),n),cr={class:"flex flex-col"},ur=sr(()=>r.createElementVNode("div",{class:"w-full flex align-item-center justify-end"},[r.createElementVNode("span",{class:"text-sm"},"Powered by Google Translate"),r.createElementVNode("img",{src:ir,alt:"Google",class:"h-5 ml-2"})],-1)),dr=we({__name:"TranslationResult",props:{isFavoriteFeatureEnabled:Boolean},setup(n){const i=J(),e=r.ref(!1),o=r.computed(()=>i.result),a=r.computed(()=>i.target),s=r.computed(()=>i.targetLabel),d=r.computed(()=>{var l;return(l=i.phonetic)==null?void 0:l.target}),c=r.computed(()=>{var l;return(l=i.tts)==null?void 0:l.target}),p=n,m=At(),{textarea:v,input:t}=Tt({input:o,styleProp:"minHeight"});return(l,u)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(Ct,{loading:r.unref(m).loading,src:a.value,srcLabel:s.value,tts:c.value,isFavoriteBtn:p.isFavoriteFeatureEnabled,isFavorite:e.value,phonetic:d.value,onFavorite:u[0]||(u[0]=f=>e.value=!e.value)},null,8,["loading","src","srcLabel","tts","isFavoriteBtn","isFavorite","phonetic"]),r.createElementVNode("div",cr,[r.withDirectives(r.createElementVNode("textarea",{ref_key:"textarea",ref:v,"onUpdate:modelValue":u[1]||(u[1]=f=>r.isRef(t)?t.value=f: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",readonly:"",rows:"2",spellcheck:"false"},null,512),[[r.vModelText,r.unref(t)]]),ur])],64))}},[["__scopeId","data-v-5a9dbf88"]]),fr={class:"btn btn-sm btn-circle btn-ghost"},Ce={__name:"ToggleBtn",props:{isExpanded:Boolean},setup(n){const i=n;return(e,o)=>(r.openBlock(),r.createElementBlock("button",fr,[i.isExpanded?(r.openBlock(),r.createBlock(r.unref(jn),{key:0,class:"w-7 text-gray-400"})):(r.openBlock(),r.createBlock(r.unref(Fn),{key:1,class:"w-7 text-gray-400"}))]))}},pr={class:"card border bg-white rounded-lg"},mr={class:"card-body px-4 py-2 gap-0"},_r={class:"flex justify-between items-center"},hr=r.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Translations",-1),gr={class:"capitalize text-base font-normal text-textSecondary mb-1"},vr={class:"list-none list-inside"},br=["onClick"],yr={class:"text-base font-normal text-gray-800 leading-4"},wr={__name:"Dictionary",emits:["translate"],setup(n,{emit:i}){const e=r.ref(!0),o=J(),a=ye(),s=r.computed(()=>o.dictionary),d=i,c=()=>{e.value=!e.value},p=m=>{d("translate",m,o.target,o.src),a.src=o.target,a.target=o.src};return(m,v)=>(r.openBlock(),r.createElementBlock("div",pr,[r.createElementVNode("div",mr,[r.createElementVNode("div",_r,[hr,r.createVNode(Ce,{isExpanded:e.value,onClick:c},null,8,["isExpanded"])]),r.createElementVNode("div",{class:r.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",e.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[r.createElementVNode("ul",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,(t,l)=>(r.openBlock(),r.createElementBlock("li",{key:`${t.pos}-${l}`,class:"mb-2"},[r.createElementVNode("h5",gr,r.toDisplayString(t.pos),1),r.createElementVNode("ul",vr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.items,(u,f)=>(r.openBlock(),r.createElementBlock("li",{key:`${u.word}-${f}`},[r.createElementVNode("span",{class:"p-3 m-0.5 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded-lg",onClick:h=>p(u.word)},r.toDisplayString(u.word),9,br),r.createElementVNode("small",yr," - "+r.toDisplayString(u.reverse_translation.join(", ")),1)]))),128))])]))),128))])],2)])]))}},xr={class:"card border bg-white rounded-lg"},Cr={class:"card-body px-4 py-2 gap-0"},Er={class:"flex justify-between items-center"},Sr=r.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Definitions",-1),Tr={class:"capitalize text-base font-normal text-textSecondary mb-1"},Ar={class:"text-base text-textCustom list-decimal list-outside ml-5"},kr=r.createElementVNode("br",null,null,-1),Or={key:0,class:"italic"},Ir={__name:"Definition",setup(n){const i=r.ref(!0),e=J(),o=r.computed(()=>e.definitions),a=()=>{i.value=!i.value};return(s,d)=>(r.openBlock(),r.createElementBlock("div",xr,[r.createElementVNode("div",Cr,[r.createElementVNode("div",Er,[Sr,r.createVNode(Ce,{isExpanded:i.value,onClick:a},null,8,["isExpanded"])]),r.createElementVNode("div",{class:r.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",i.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[r.createElementVNode("ul",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(c,p)=>(r.openBlock(),r.createElementBlock("li",{key:`${c.pos}-${p}`,class:"mb-2"},[r.createElementVNode("h5",Tr,r.toDisplayString(c.pos),1),r.createElementVNode("ul",Ar,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.items,(m,v)=>(r.openBlock(),r.createElementBlock("li",{key:`${m.gloss}-${v}`,class:"mb-1"},[r.createElementVNode("span",null,r.toDisplayString(m.gloss),1),kr,m.example?(r.openBlock(),r.createElementBlock("small",Or,'"'+r.toDisplayString(m.example)+'"',1)):r.createCommentVNode("",!0)]))),128))])]))),128))])],2)])]))}},Vr={class:"card border bg-white rounded-lg"},$r={class:"card-body px-4 py-2 gap-0"},Lr={class:"flex justify-between items-center"},Br=r.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Examples",-1),Nr={class:"text-textCustom list-decimal list-outside ml-7 mt-2"},Pr=["innerHTML"],Mr={__name:"Example",setup(n){const i=r.ref(!0),e=J(),o=r.computed(()=>e.examples),a=()=>{i.value=!i.value};return(s,d)=>(r.openBlock(),r.createElementBlock("div",Vr,[r.createElementVNode("div",$r,[r.createElementVNode("div",Lr,[Br,r.createVNode(Ce,{isExpanded:i.value,onClick:a},null,8,["isExpanded"])]),r.createElementVNode("div",{class:r.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",i.value?"max-h-[1000px] opacity-100":"max-h-0 opacity-0"])},[r.createElementVNode("ul",Nr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,(c,p)=>(r.openBlock(),r.createElementBlock("li",{key:`${c.definition_id}-${p}`,innerHTML:c},null,8,Pr))),128))])],2)])]))}},Rr={class:"card border bg-white rounded-lg"},Dr={class:"card-body px-4 py-2 gap-0"},Fr={class:"flex justify-between items-center"},Hr=r.createElementVNode("h2",{class:"card-title text-base font-bold leading-6 text-textCustom"},"Synonyms",-1),jr={class:"capitalize text-base font-normal text-textSecondary mb-1"},Gr={class:"list-none list-inside"},Ur={class:"flex flex-wrap"},zr=["onClick"],Zr={__name:"Synonyms",emits:["translate"],setup(n,{emit:i}){const e=r.ref(!0),o=J(),a=r.computed(()=>o.synonyms),s=i,d=()=>{e.value=!e.value},c=p=>{s("translate",p)};return(p,m)=>(r.openBlock(),r.createElementBlock("div",Rr,[r.createElementVNode("div",Dr,[r.createElementVNode("div",Fr,[Hr,r.createVNode(Ce,{isExpanded:e.value,onClick:d},null,8,["isExpanded"])]),r.createElementVNode("div",{class:r.normalizeClass(["overflow-hidden transition-all duration-300 ease-in-out",e.value?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"])},[r.createElementVNode("ul",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,(v,t)=>(r.openBlock(),r.createElementBlock("li",{key:`${v.pos}-${t}`,class:"mb-2"},[r.createElementVNode("h5",jr,r.toDisplayString(v.pos),1),r.createElementVNode("ul",Gr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(v.items,(l,u)=>(r.openBlock(),r.createElementBlock("li",{key:`${l.word}-${u}`,class:"mb-2"},[r.createElementVNode("div",Ur,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.synonym,(f,h)=>(r.openBlock(),r.createElementBlock("span",{key:`${f}-${h}`,class:"p-3 m-0.5 ml-0 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded-lg",onClick:g=>c(f)},r.toDisplayString(f),9,zr))),128))])]))),128))])]))),128))])],2)])]))}},Wr={class:"bg-white min-h-screen flex flex-col"},qr={class:"py-2 px-5 shadow-lg"},Xr={class:"px-5 flex-grow"},Yr={class:"flex flex-col lg:flex-row lg:gap-2"},Qr={class:"w-full lg:w-[calc(50%-1rem)] my-2"},Kr=r.createElementVNode("div",{class:"w-6 h-4 mx-auto hidden lg:block"},null,-1),Jr={class:"w-full lg:w-[calc(50%-1rem)] my-2"},ea={class:"grid grid-cols-1 lg:grid-cols-3 gap-4"},ta={key:0,class:"w-full my-4"},na=r.createElementVNode("div",{class:"mt-auto py-5 px-5"},[r.createElementVNode("span",{class:"block text-center text-gray-700"}," The site is not affiliated with Google Translate "),r.createElementVNode("span",{class:"block text-center text-gray-700"},"Since 2011")],-1),oa={__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(n,{emit:i}){const e=vo(),o=J(e),a=ye(e),s=At(e),d=n,c=i,p=r.ref("");r.watch(()=>d.translation,l=>{s.loading=!1,p.value=l.text,o.init(l)},{immediate:!0}),r.watch([()=>d.opt,()=>d.languages],([l,u])=>{a.init(l,u),t(p.value)}),r.watch([()=>a.src,()=>a.target],([l,u])=>{c("opt",{src:l,target:u}),p.value&&t(p.value)}),r.onMounted(()=>{a.init(d.opt,d.languages)});function m(){p.value="",o.reset()}function v(l){l&&t(l)}function t(l,u=a.src,f=a.target){p.value=l,s.loading=!0,c("translate",{src:u,target:f,text:l})}return(l,u)=>(r.openBlock(),r.createElementBlock("div",Wr,[r.createElementVNode("div",qr,[r.createVNode(Dt,{onReader:u[0]||(u[0]=f=>c("reader")),onSettings:u[1]||(u[1]=f=>c("settings")),onFullScreen:u[2]||(u[2]=f=>c("fullscreen"))})]),r.createElementVNode("div",Xr,[r.createVNode(Co,{class:"my-4"}),r.createElementVNode("div",Yr,[r.createElementVNode("div",Qr,[r.createVNode(lr,{text:p.value,onChange:v,onClear:m},null,8,["text"])]),Kr,r.createElementVNode("div",Jr,[r.createVNode(dr,{isFavoriteFeatureEnabled:n.isFavoriteFeatureEnabled},null,8,["isFavoriteFeatureEnabled"])])]),r.createElementVNode("div",ea,[r.unref(o).dictionary.length?(r.openBlock(),r.createBlock(wr,{key:0,onTranslate:t})):r.createCommentVNode("",!0),r.unref(o).definitions.length?(r.openBlock(),r.createBlock(Ir,{key:1})):r.createCommentVNode("",!0),r.unref(o).synonyms.length?(r.openBlock(),r.createBlock(Zr,{key:2,onTranslate:t})):r.createCommentVNode("",!0)]),r.unref(o).examples.length?(r.openBlock(),r.createElementBlock("div",ta,[r.createVNode(Mr)])):r.createCommentVNode("",!0)]),na]))}};var ue=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ra(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Pe={};/*!
|
|
18
18
|
* howler.js v2.2.4
|
|
19
19
|
* howlerjs.com
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ This will fail in production.`);c=ie,c._s.has(o)||(s?Pe(o,i,a,c):xt(o,a,c),proce
|
|
|
22
22
|
* goldfirestudios.com
|
|
23
23
|
*
|
|
24
24
|
* MIT License
|
|
25
|
-
*/(function(n){(function(){var i=function(){this.init()};i.prototype={init:function(){var t=this||e;return t._counter=1e3,t._html5AudioPool=[],t.html5PoolSize=10,t._codecs={},t._howls=[],t._muted=!1,t._volume=1,t._canPlayEvent="canplaythrough",t._navigator=typeof window<"u"&&window.navigator?window.navigator:null,t.masterGain=null,t.noAudio=!1,t.usingWebAudio=!0,t.autoSuspend=!0,t.ctx=null,t.autoUnlock=!0,t._setup(),t},volume:function(t){var l=this||e;if(t=parseFloat(t),l.ctx||g(),typeof t<"u"&&t>=0&&t<=1){if(l._volume=t,l._muted)return l;l.usingWebAudio&&l.masterGain.gain.setValueAtTime(t,e.ctx.currentTime);for(var u=0;u<l._howls.length;u++)if(!l._howls[u]._webAudio)for(var f=l._howls[u]._getSoundIds(),h=0;h<f.length;h++){var v=l._howls[u]._soundById(f[h]);v&&v._node&&(v._node.volume=v._volume*t)}return l}return l._volume},mute:function(t){var l=this||e;l.ctx||g(),l._muted=t,l.usingWebAudio&&l.masterGain.gain.setValueAtTime(t?0:l._volume,e.ctx.currentTime);for(var u=0;u<l._howls.length;u++)if(!l._howls[u]._webAudio)for(var f=l._howls[u]._getSoundIds(),h=0;h<f.length;h++){var v=l._howls[u]._soundById(f[h]);v&&v._node&&(v._node.muted=t?!0:v._muted)}return l},stop:function(){for(var t=this||e,l=0;l<t._howls.length;l++)t._howls[l].stop();return t},unload:function(){for(var t=this||e,l=t._howls.length-1;l>=0;l--)t._howls[l].unload();return t.usingWebAudio&&t.ctx&&typeof t.ctx.close<"u"&&(t.ctx.close(),t.ctx=null,g()),t},codecs:function(t){return(this||e)._codecs[t.replace(/^x-/,"")]},_setup:function(){var t=this||e;if(t.state=t.ctx&&t.ctx.state||"suspended",t._autoSuspend(),!t.usingWebAudio)if(typeof Audio<"u")try{var l=new Audio;typeof l.oncanplaythrough>"u"&&(t._canPlayEvent="canplay")}catch{t.noAudio=!0}else t.noAudio=!0;try{var l=new Audio;l.muted&&(t.noAudio=!0)}catch{}return t.noAudio||t._setupCodecs(),t},_setupCodecs:function(){var t=this||e,l=null;try{l=typeof Audio<"u"?new Audio:null}catch{return t}if(!l||typeof l.canPlayType!="function")return t;var u=l.canPlayType("audio/mpeg;").replace(/^no$/,""),f=t._navigator?t._navigator.userAgent:"",h=f.match(/OPR\/(\d+)/g),v=h&&parseInt(h[0].split("/")[1],10)<33,_=f.indexOf("Safari")!==-1&&f.indexOf("Chrome")===-1,w=f.match(/Version\/(.*?) /),k=_&&w&&parseInt(w[1],10)<15;return t._codecs={mp3:!!(!v&&(u||l.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!u,opus:!!l.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!l.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!l.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(l.canPlayType('audio/wav; codecs="1"')||l.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!l.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!l.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(l.canPlayType("audio/x-m4a;")||l.canPlayType("audio/m4a;")||l.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(l.canPlayType("audio/x-m4b;")||l.canPlayType("audio/m4b;")||l.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(l.canPlayType("audio/x-mp4;")||l.canPlayType("audio/mp4;")||l.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!k&&l.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!k&&l.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!l.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(l.canPlayType("audio/x-flac;")||l.canPlayType("audio/flac;")).replace(/^no$/,"")},t},_unlockAudio:function(){var t=this||e;if(!(t._audioUnlocked||!t.ctx)){t._audioUnlocked=!1,t.autoUnlock=!1,!t._mobileUnloaded&&t.ctx.sampleRate!==44100&&(t._mobileUnloaded=!0,t.unload()),t._scratchBuffer=t.ctx.createBuffer(1,1,22050);var l=function(u){for(;t._html5AudioPool.length<t.html5PoolSize;)try{var f=new Audio;f._unlocked=!0,t._releaseHtml5Audio(f)}catch{t.noAudio=!0;break}for(var h=0;h<t._howls.length;h++)if(!t._howls[h]._webAudio)for(var v=t._howls[h]._getSoundIds(),_=0;_<v.length;_++){var w=t._howls[h]._soundById(v[_]);w&&w._node&&!w._node._unlocked&&(w._node._unlocked=!0,w._node.load())}t._autoResume();var k=t.ctx.createBufferSource();k.buffer=t._scratchBuffer,k.connect(t.ctx.destination),typeof k.start>"u"?k.noteOn(0):k.start(0),typeof t.ctx.resume=="function"&&t.ctx.resume(),k.onended=function(){k.disconnect(0),t._audioUnlocked=!0,document.removeEventListener("touchstart",l,!0),document.removeEventListener("touchend",l,!0),document.removeEventListener("click",l,!0),document.removeEventListener("keydown",l,!0);for(var I=0;I<t._howls.length;I++)t._howls[I]._emit("unlock")}};return document.addEventListener("touchstart",l,!0),document.addEventListener("touchend",l,!0),document.addEventListener("click",l,!0),document.addEventListener("keydown",l,!0),t}},_obtainHtml5Audio:function(){var t=this||e;if(t._html5AudioPool.length)return t._html5AudioPool.pop();var l=new Audio().play();return l&&typeof Promise<"u"&&(l instanceof Promise||typeof l.then=="function")&&l.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(t){var l=this||e;return t._unlocked&&l._html5AudioPool.push(t),l},_autoSuspend:function(){var t=this;if(!(!t.autoSuspend||!t.ctx||typeof t.ctx.suspend>"u"||!e.usingWebAudio)){for(var l=0;l<t._howls.length;l++)if(t._howls[l]._webAudio){for(var u=0;u<t._howls[l]._sounds.length;u++)if(!t._howls[l]._sounds[u]._paused)return t}return t._suspendTimer&&clearTimeout(t._suspendTimer),t._suspendTimer=setTimeout(function(){if(t.autoSuspend){t._suspendTimer=null,t.state="suspending";var f=function(){t.state="suspended",t._resumeAfterSuspend&&(delete t._resumeAfterSuspend,t._autoResume())};t.ctx.suspend().then(f,f)}},3e4),t}},_autoResume:function(){var t=this;if(!(!t.ctx||typeof t.ctx.resume>"u"||!e.usingWebAudio))return t.state==="running"&&t.ctx.state!=="interrupted"&&t._suspendTimer?(clearTimeout(t._suspendTimer),t._suspendTimer=null):t.state==="suspended"||t.state==="running"&&t.ctx.state==="interrupted"?(t.ctx.resume().then(function(){t.state="running";for(var l=0;l<t._howls.length;l++)t._howls[l]._emit("resume")}),t._suspendTimer&&(clearTimeout(t._suspendTimer),t._suspendTimer=null)):t.state==="suspending"&&(t._resumeAfterSuspend=!0),t}};var e=new i,o=function(t){var l=this;if(!t.src||t.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}l.init(t)};o.prototype={init:function(t){var l=this;return e.ctx||g(),l._autoplay=t.autoplay||!1,l._format=typeof t.format!="string"?t.format:[t.format],l._html5=t.html5||!1,l._muted=t.mute||!1,l._loop=t.loop||!1,l._pool=t.pool||5,l._preload=typeof t.preload=="boolean"||t.preload==="metadata"?t.preload:!0,l._rate=t.rate||1,l._sprite=t.sprite||{},l._src=typeof t.src!="string"?t.src:[t.src],l._volume=t.volume!==void 0?t.volume:1,l._xhr={method:t.xhr&&t.xhr.method?t.xhr.method:"GET",headers:t.xhr&&t.xhr.headers?t.xhr.headers:null,withCredentials:t.xhr&&t.xhr.withCredentials?t.xhr.withCredentials:!1},l._duration=0,l._state="unloaded",l._sounds=[],l._endTimers={},l._queue=[],l._playLock=!1,l._onend=t.onend?[{fn:t.onend}]:[],l._onfade=t.onfade?[{fn:t.onfade}]:[],l._onload=t.onload?[{fn:t.onload}]:[],l._onloaderror=t.onloaderror?[{fn:t.onloaderror}]:[],l._onplayerror=t.onplayerror?[{fn:t.onplayerror}]:[],l._onpause=t.onpause?[{fn:t.onpause}]:[],l._onplay=t.onplay?[{fn:t.onplay}]:[],l._onstop=t.onstop?[{fn:t.onstop}]:[],l._onmute=t.onmute?[{fn:t.onmute}]:[],l._onvolume=t.onvolume?[{fn:t.onvolume}]:[],l._onrate=t.onrate?[{fn:t.onrate}]:[],l._onseek=t.onseek?[{fn:t.onseek}]:[],l._onunlock=t.onunlock?[{fn:t.onunlock}]:[],l._onresume=[],l._webAudio=e.usingWebAudio&&!l._html5,typeof e.ctx<"u"&&e.ctx&&e.autoUnlock&&e._unlockAudio(),e._howls.push(l),l._autoplay&&l._queue.push({event:"play",action:function(){l.play()}}),l._preload&&l._preload!=="none"&&l.load(),l},load:function(){var t=this,l=null;if(e.noAudio){t._emit("loaderror",null,"No audio support.");return}typeof t._src=="string"&&(t._src=[t._src]);for(var u=0;u<t._src.length;u++){var f,h;if(t._format&&t._format[u])f=t._format[u];else{if(h=t._src[u],typeof h!="string"){t._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}f=/^data:audio\/([^;,]+);/i.exec(h),f||(f=/\.([^.]+)$/.exec(h.split("?",1)[0])),f&&(f=f[1].toLowerCase())}if(f||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),f&&e.codecs(f)){l=t._src[u];break}}if(!l){t._emit("loaderror",null,"No codec support for selected audio sources.");return}return t._src=l,t._state="loading",window.location.protocol==="https:"&&l.slice(0,5)==="http:"&&(t._html5=!0,t._webAudio=!1),new a(t),t._webAudio&&d(t),t},play:function(t,l){var u=this,f=null;if(typeof t=="number")f=t,t=null;else{if(typeof t=="string"&&u._state==="loaded"&&!u._sprite[t])return null;if(typeof t>"u"&&(t="__default",!u._playLock)){for(var h=0,v=0;v<u._sounds.length;v++)u._sounds[v]._paused&&!u._sounds[v]._ended&&(h++,f=u._sounds[v]._id);h===1?t=null:f=null}}var _=f?u._soundById(f):u._inactiveSound();if(!_)return null;if(f&&!t&&(t=_._sprite||"__default"),u._state!=="loaded"){_._sprite=t,_._ended=!1;var w=_._id;return u._queue.push({event:"play",action:function(){u.play(w)}}),w}if(f&&!_._paused)return l||u._loadQueue("play"),_._id;u._webAudio&&e._autoResume();var k=Math.max(0,_._seek>0?_._seek:u._sprite[t][0]/1e3),I=Math.max(0,(u._sprite[t][0]+u._sprite[t][1])/1e3-k),x=I*1e3/Math.abs(_._rate),$=u._sprite[t][0]/1e3,E=(u._sprite[t][0]+u._sprite[t][1])/1e3;_._sprite=t,_._ended=!1;var S=function(){_._paused=!1,_._seek=k,_._start=$,_._stop=E,_._loop=!!(_._loop||u._sprite[t][2])};if(k>=E){u._ended(_);return}var A=_._node;if(u._webAudio){var b=function(){u._playLock=!1,S(),u._refreshBuffer(_);var C=_._muted||u._muted?0:_._volume;A.gain.setValueAtTime(C,e.ctx.currentTime),_._playStart=e.ctx.currentTime,typeof A.bufferSource.start>"u"?_._loop?A.bufferSource.noteGrainOn(0,k,86400):A.bufferSource.noteGrainOn(0,k,I):_._loop?A.bufferSource.start(0,k,86400):A.bufferSource.start(0,k,I),x!==1/0&&(u._endTimers[_._id]=setTimeout(u._ended.bind(u,_),x)),l||setTimeout(function(){u._emit("play",_._id),u._loadQueue()},0)};e.state==="running"&&e.ctx.state!=="interrupted"?b():(u._playLock=!0,u.once("resume",b),u._clearTimer(_._id))}else{var y=function(){A.currentTime=k,A.muted=_._muted||u._muted||e._muted||A.muted,A.volume=_._volume*e.volume(),A.playbackRate=_._rate;try{var C=A.play();if(C&&typeof Promise<"u"&&(C instanceof Promise||typeof C.then=="function")?(u._playLock=!0,S(),C.then(function(){u._playLock=!1,A._unlocked=!0,l?u._loadQueue():u._emit("play",_._id)}).catch(function(){u._playLock=!1,u._emit("playerror",_._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),_._ended=!0,_._paused=!0})):l||(u._playLock=!1,S(),u._emit("play",_._id)),A.playbackRate=_._rate,A.paused){u._emit("playerror",_._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}t!=="__default"||_._loop?u._endTimers[_._id]=setTimeout(u._ended.bind(u,_),x):(u._endTimers[_._id]=function(){u._ended(_),A.removeEventListener("ended",u._endTimers[_._id],!1)},A.addEventListener("ended",u._endTimers[_._id],!1))}catch(N){u._emit("playerror",_._id,N)}};A.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(A.src=u._src,A.load());var T=window&&window.ejecta||!A.readyState&&e._navigator.isCocoonJS;if(A.readyState>=3||T)y();else{u._playLock=!0,u._state="loading";var O=function(){u._state="loaded",y(),A.removeEventListener(e._canPlayEvent,O,!1)};A.addEventListener(e._canPlayEvent,O,!1),u._clearTimer(_._id)}}return _._id},pause:function(t){var l=this;if(l._state!=="loaded"||l._playLock)return l._queue.push({event:"pause",action:function(){l.pause(t)}}),l;for(var u=l._getSoundIds(t),f=0;f<u.length;f++){l._clearTimer(u[f]);var h=l._soundById(u[f]);if(h&&!h._paused&&(h._seek=l.seek(u[f]),h._rateSeek=0,h._paused=!0,l._stopFade(u[f]),h._node))if(l._webAudio){if(!h._node.bufferSource)continue;typeof h._node.bufferSource.stop>"u"?h._node.bufferSource.noteOff(0):h._node.bufferSource.stop(0),l._cleanBuffer(h._node)}else(!isNaN(h._node.duration)||h._node.duration===1/0)&&h._node.pause();arguments[1]||l._emit("pause",h?h._id:null)}return l},stop:function(t,l){var u=this;if(u._state!=="loaded"||u._playLock)return u._queue.push({event:"stop",action:function(){u.stop(t)}}),u;for(var f=u._getSoundIds(t),h=0;h<f.length;h++){u._clearTimer(f[h]);var v=u._soundById(f[h]);v&&(v._seek=v._start||0,v._rateSeek=0,v._paused=!0,v._ended=!0,u._stopFade(f[h]),v._node&&(u._webAudio?v._node.bufferSource&&(typeof v._node.bufferSource.stop>"u"?v._node.bufferSource.noteOff(0):v._node.bufferSource.stop(0),u._cleanBuffer(v._node)):(!isNaN(v._node.duration)||v._node.duration===1/0)&&(v._node.currentTime=v._start||0,v._node.pause(),v._node.duration===1/0&&u._clearSound(v._node))),l||u._emit("stop",v._id))}return u},mute:function(t,l){var u=this;if(u._state!=="loaded"||u._playLock)return u._queue.push({event:"mute",action:function(){u.mute(t,l)}}),u;if(typeof l>"u")if(typeof t=="boolean")u._muted=t;else return u._muted;for(var f=u._getSoundIds(l),h=0;h<f.length;h++){var v=u._soundById(f[h]);v&&(v._muted=t,v._interval&&u._stopFade(v._id),u._webAudio&&v._node?v._node.gain.setValueAtTime(t?0:v._volume,e.ctx.currentTime):v._node&&(v._node.muted=e._muted?!0:t),u._emit("mute",v._id))}return u},volume:function(){var t=this,l=arguments,u,f;if(l.length===0)return t._volume;if(l.length===1||l.length===2&&typeof l[1]>"u"){var h=t._getSoundIds(),v=h.indexOf(l[0]);v>=0?f=parseInt(l[0],10):u=parseFloat(l[0])}else l.length>=2&&(u=parseFloat(l[0]),f=parseInt(l[1],10));var _;if(typeof u<"u"&&u>=0&&u<=1){if(t._state!=="loaded"||t._playLock)return t._queue.push({event:"volume",action:function(){t.volume.apply(t,l)}}),t;typeof f>"u"&&(t._volume=u),f=t._getSoundIds(f);for(var w=0;w<f.length;w++)_=t._soundById(f[w]),_&&(_._volume=u,l[2]||t._stopFade(f[w]),t._webAudio&&_._node&&!_._muted?_._node.gain.setValueAtTime(u,e.ctx.currentTime):_._node&&!_._muted&&(_._node.volume=u*e.volume()),t._emit("volume",_._id))}else return _=f?t._soundById(f):t._sounds[0],_?_._volume:0;return t},fade:function(t,l,u,f){var h=this;if(h._state!=="loaded"||h._playLock)return h._queue.push({event:"fade",action:function(){h.fade(t,l,u,f)}}),h;t=Math.min(Math.max(0,parseFloat(t)),1),l=Math.min(Math.max(0,parseFloat(l)),1),u=parseFloat(u),h.volume(t,f);for(var v=h._getSoundIds(f),_=0;_<v.length;_++){var w=h._soundById(v[_]);if(w){if(f||h._stopFade(v[_]),h._webAudio&&!w._muted){var k=e.ctx.currentTime,I=k+u/1e3;w._volume=t,w._node.gain.setValueAtTime(t,k),w._node.gain.linearRampToValueAtTime(l,I)}h._startFadeInterval(w,t,l,u,v[_],typeof f>"u")}}return h},_startFadeInterval:function(t,l,u,f,h,v){var _=this,w=l,k=u-l,I=Math.abs(k/.01),x=Math.max(4,I>0?f/I:f),$=Date.now();t._fadeTo=u,t._interval=setInterval(function(){var E=(Date.now()-$)/f;$=Date.now(),w+=k*E,w=Math.round(w*100)/100,k<0?w=Math.max(u,w):w=Math.min(u,w),_._webAudio?t._volume=w:_.volume(w,t._id,!0),v&&(_._volume=w),(u<l&&w<=u||u>l&&w>=u)&&(clearInterval(t._interval),t._interval=null,t._fadeTo=null,_.volume(u,t._id),_._emit("fade",t._id))},x)},_stopFade:function(t){var l=this,u=l._soundById(t);return u&&u._interval&&(l._webAudio&&u._node.gain.cancelScheduledValues(e.ctx.currentTime),clearInterval(u._interval),u._interval=null,l.volume(u._fadeTo,t),u._fadeTo=null,l._emit("fade",t)),l},loop:function(){var t=this,l=arguments,u,f,h;if(l.length===0)return t._loop;if(l.length===1)if(typeof l[0]=="boolean")u=l[0],t._loop=u;else return h=t._soundById(parseInt(l[0],10)),h?h._loop:!1;else l.length===2&&(u=l[0],f=parseInt(l[1],10));for(var v=t._getSoundIds(f),_=0;_<v.length;_++)h=t._soundById(v[_]),h&&(h._loop=u,t._webAudio&&h._node&&h._node.bufferSource&&(h._node.bufferSource.loop=u,u&&(h._node.bufferSource.loopStart=h._start||0,h._node.bufferSource.loopEnd=h._stop,t.playing(v[_])&&(t.pause(v[_],!0),t.play(v[_],!0)))));return t},rate:function(){var t=this,l=arguments,u,f;if(l.length===0)f=t._sounds[0]._id;else if(l.length===1){var h=t._getSoundIds(),v=h.indexOf(l[0]);v>=0?f=parseInt(l[0],10):u=parseFloat(l[0])}else l.length===2&&(u=parseFloat(l[0]),f=parseInt(l[1],10));var _;if(typeof u=="number"){if(t._state!=="loaded"||t._playLock)return t._queue.push({event:"rate",action:function(){t.rate.apply(t,l)}}),t;typeof f>"u"&&(t._rate=u),f=t._getSoundIds(f);for(var w=0;w<f.length;w++)if(_=t._soundById(f[w]),_){t.playing(f[w])&&(_._rateSeek=t.seek(f[w]),_._playStart=t._webAudio?e.ctx.currentTime:_._playStart),_._rate=u,t._webAudio&&_._node&&_._node.bufferSource?_._node.bufferSource.playbackRate.setValueAtTime(u,e.ctx.currentTime):_._node&&(_._node.playbackRate=u);var k=t.seek(f[w]),I=(t._sprite[_._sprite][0]+t._sprite[_._sprite][1])/1e3-k,x=I*1e3/Math.abs(_._rate);(t._endTimers[f[w]]||!_._paused)&&(t._clearTimer(f[w]),t._endTimers[f[w]]=setTimeout(t._ended.bind(t,_),x)),t._emit("rate",_._id)}}else return _=t._soundById(f),_?_._rate:t._rate;return t},seek:function(){var t=this,l=arguments,u,f;if(l.length===0)t._sounds.length&&(f=t._sounds[0]._id);else if(l.length===1){var h=t._getSoundIds(),v=h.indexOf(l[0]);v>=0?f=parseInt(l[0],10):t._sounds.length&&(f=t._sounds[0]._id,u=parseFloat(l[0]))}else l.length===2&&(u=parseFloat(l[0]),f=parseInt(l[1],10));if(typeof f>"u")return 0;if(typeof u=="number"&&(t._state!=="loaded"||t._playLock))return t._queue.push({event:"seek",action:function(){t.seek.apply(t,l)}}),t;var _=t._soundById(f);if(_)if(typeof u=="number"&&u>=0){var w=t.playing(f);w&&t.pause(f,!0),_._seek=u,_._ended=!1,t._clearTimer(f),!t._webAudio&&_._node&&!isNaN(_._node.duration)&&(_._node.currentTime=u);var k=function(){w&&t.play(f,!0),t._emit("seek",f)};if(w&&!t._webAudio){var I=function(){t._playLock?setTimeout(I,0):k()};setTimeout(I,0)}else k()}else if(t._webAudio){var x=t.playing(f)?e.ctx.currentTime-_._playStart:0,$=_._rateSeek?_._rateSeek-_._seek:0;return _._seek+($+x*Math.abs(_._rate))}else return _._node.currentTime;return t},playing:function(t){var l=this;if(typeof t=="number"){var u=l._soundById(t);return u?!u._paused:!1}for(var f=0;f<l._sounds.length;f++)if(!l._sounds[f]._paused)return!0;return!1},duration:function(t){var l=this,u=l._duration,f=l._soundById(t);return f&&(u=l._sprite[f._sprite][1]/1e3),u},state:function(){return this._state},unload:function(){for(var t=this,l=t._sounds,u=0;u<l.length;u++)l[u]._paused||t.stop(l[u]._id),t._webAudio||(t._clearSound(l[u]._node),l[u]._node.removeEventListener("error",l[u]._errorFn,!1),l[u]._node.removeEventListener(e._canPlayEvent,l[u]._loadFn,!1),l[u]._node.removeEventListener("ended",l[u]._endFn,!1),e._releaseHtml5Audio(l[u]._node)),delete l[u]._node,t._clearTimer(l[u]._id);var f=e._howls.indexOf(t);f>=0&&e._howls.splice(f,1);var h=!0;for(u=0;u<e._howls.length;u++)if(e._howls[u]._src===t._src||t._src.indexOf(e._howls[u]._src)>=0){h=!1;break}return s&&h&&delete s[t._src],e.noAudio=!1,t._state="unloaded",t._sounds=[],t=null,null},on:function(t,l,u,f){var h=this,v=h["_on"+t];return typeof l=="function"&&v.push(f?{id:u,fn:l,once:f}:{id:u,fn:l}),h},off:function(t,l,u){var f=this,h=f["_on"+t],v=0;if(typeof l=="number"&&(u=l,l=null),l||u)for(v=0;v<h.length;v++){var _=u===h[v].id;if(l===h[v].fn&&_||!l&&_){h.splice(v,1);break}}else if(t)f["_on"+t]=[];else{var w=Object.keys(f);for(v=0;v<w.length;v++)w[v].indexOf("_on")===0&&Array.isArray(f[w[v]])&&(f[w[v]]=[])}return f},once:function(t,l,u){var f=this;return f.on(t,l,u,1),f},_emit:function(t,l,u){for(var f=this,h=f["_on"+t],v=h.length-1;v>=0;v--)(!h[v].id||h[v].id===l||t==="load")&&(setTimeout((function(_){_.call(this,l,u)}).bind(f,h[v].fn),0),h[v].once&&f.off(t,h[v].fn,h[v].id));return f._loadQueue(t),f},_loadQueue:function(t){var l=this;if(l._queue.length>0){var u=l._queue[0];u.event===t&&(l._queue.shift(),l._loadQueue()),t||u.action()}return l},_ended:function(t){var l=this,u=t._sprite;if(!l._webAudio&&t._node&&!t._node.paused&&!t._node.ended&&t._node.currentTime<t._stop)return setTimeout(l._ended.bind(l,t),100),l;var f=!!(t._loop||l._sprite[u][2]);if(l._emit("end",t._id),!l._webAudio&&f&&l.stop(t._id,!0).play(t._id),l._webAudio&&f){l._emit("play",t._id),t._seek=t._start||0,t._rateSeek=0,t._playStart=e.ctx.currentTime;var h=(t._stop-t._start)*1e3/Math.abs(t._rate);l._endTimers[t._id]=setTimeout(l._ended.bind(l,t),h)}return l._webAudio&&!f&&(t._paused=!0,t._ended=!0,t._seek=t._start||0,t._rateSeek=0,l._clearTimer(t._id),l._cleanBuffer(t._node),e._autoSuspend()),!l._webAudio&&!f&&l.stop(t._id,!0),l},_clearTimer:function(t){var l=this;if(l._endTimers[t]){if(typeof l._endTimers[t]!="function")clearTimeout(l._endTimers[t]);else{var u=l._soundById(t);u&&u._node&&u._node.removeEventListener("ended",l._endTimers[t],!1)}delete l._endTimers[t]}return l},_soundById:function(t){for(var l=this,u=0;u<l._sounds.length;u++)if(t===l._sounds[u]._id)return l._sounds[u];return null},_inactiveSound:function(){var t=this;t._drain();for(var l=0;l<t._sounds.length;l++)if(t._sounds[l]._ended)return t._sounds[l].reset();return new a(t)},_drain:function(){var t=this,l=t._pool,u=0,f=0;if(!(t._sounds.length<l)){for(f=0;f<t._sounds.length;f++)t._sounds[f]._ended&&u++;for(f=t._sounds.length-1;f>=0;f--){if(u<=l)return;t._sounds[f]._ended&&(t._webAudio&&t._sounds[f]._node&&t._sounds[f]._node.disconnect(0),t._sounds.splice(f,1),u--)}}},_getSoundIds:function(t){var l=this;if(typeof t>"u"){for(var u=[],f=0;f<l._sounds.length;f++)u.push(l._sounds[f]._id);return u}else return[t]},_refreshBuffer:function(t){var l=this;return t._node.bufferSource=e.ctx.createBufferSource(),t._node.bufferSource.buffer=s[l._src],t._panner?t._node.bufferSource.connect(t._panner):t._node.bufferSource.connect(t._node),t._node.bufferSource.loop=t._loop,t._loop&&(t._node.bufferSource.loopStart=t._start||0,t._node.bufferSource.loopEnd=t._stop||0),t._node.bufferSource.playbackRate.setValueAtTime(t._rate,e.ctx.currentTime),l},_cleanBuffer:function(t){var l=this,u=e._navigator&&e._navigator.vendor.indexOf("Apple")>=0;if(!t.bufferSource)return l;if(e._scratchBuffer&&t.bufferSource&&(t.bufferSource.onended=null,t.bufferSource.disconnect(0),u))try{t.bufferSource.buffer=e._scratchBuffer}catch{}return t.bufferSource=null,l},_clearSound:function(t){var l=/MSIE |Trident\//.test(e._navigator&&e._navigator.userAgent);l||(t.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var a=function(t){this._parent=t,this.init()};a.prototype={init:function(){var t=this,l=t._parent;return t._muted=l._muted,t._loop=l._loop,t._volume=l._volume,t._rate=l._rate,t._seek=0,t._paused=!0,t._ended=!0,t._sprite="__default",t._id=++e._counter,l._sounds.push(t),t.create(),t},create:function(){var t=this,l=t._parent,u=e._muted||t._muted||t._parent._muted?0:t._volume;return l._webAudio?(t._node=typeof e.ctx.createGain>"u"?e.ctx.createGainNode():e.ctx.createGain(),t._node.gain.setValueAtTime(u,e.ctx.currentTime),t._node.paused=!0,t._node.connect(e.masterGain)):e.noAudio||(t._node=e._obtainHtml5Audio(),t._errorFn=t._errorListener.bind(t),t._node.addEventListener("error",t._errorFn,!1),t._loadFn=t._loadListener.bind(t),t._node.addEventListener(e._canPlayEvent,t._loadFn,!1),t._endFn=t._endListener.bind(t),t._node.addEventListener("ended",t._endFn,!1),t._node.src=l._src,t._node.preload=l._preload===!0?"auto":l._preload,t._node.volume=u*e.volume(),t._node.load()),t},reset:function(){var t=this,l=t._parent;return t._muted=l._muted,t._loop=l._loop,t._volume=l._volume,t._rate=l._rate,t._seek=0,t._rateSeek=0,t._paused=!0,t._ended=!0,t._sprite="__default",t._id=++e._counter,t},_errorListener:function(){var t=this;t._parent._emit("loaderror",t._id,t._node.error?t._node.error.code:0),t._node.removeEventListener("error",t._errorFn,!1)},_loadListener:function(){var t=this,l=t._parent;l._duration=Math.ceil(t._node.duration*10)/10,Object.keys(l._sprite).length===0&&(l._sprite={__default:[0,l._duration*1e3]}),l._state!=="loaded"&&(l._state="loaded",l._emit("load"),l._loadQueue()),t._node.removeEventListener(e._canPlayEvent,t._loadFn,!1)},_endListener:function(){var t=this,l=t._parent;l._duration===1/0&&(l._duration=Math.ceil(t._node.duration*10)/10,l._sprite.__default[1]===1/0&&(l._sprite.__default[1]=l._duration*1e3),l._ended(t)),t._node.removeEventListener("ended",t._endFn,!1)}};var s={},d=function(t){var l=t._src;if(s[l]){t._duration=s[l].duration,m(t);return}if(/^data:[^;]+;base64,/.test(l)){for(var u=atob(l.split(",")[1]),f=new Uint8Array(u.length),h=0;h<u.length;++h)f[h]=u.charCodeAt(h);p(f.buffer,t)}else{var v=new XMLHttpRequest;v.open(t._xhr.method,l,!0),v.withCredentials=t._xhr.withCredentials,v.responseType="arraybuffer",t._xhr.headers&&Object.keys(t._xhr.headers).forEach(function(_){v.setRequestHeader(_,t._xhr.headers[_])}),v.onload=function(){var _=(v.status+"")[0];if(_!=="0"&&_!=="2"&&_!=="3"){t._emit("loaderror",null,"Failed loading audio file with status: "+v.status+".");return}p(v.response,t)},v.onerror=function(){t._webAudio&&(t._html5=!0,t._webAudio=!1,t._sounds=[],delete s[l],t.load())},c(v)}},c=function(t){try{t.send()}catch{t.onerror()}},p=function(t,l){var u=function(){l._emit("loaderror",null,"Decoding audio data failed.")},f=function(h){h&&l._sounds.length>0?(s[l._src]=h,m(l,h)):u()};typeof Promise<"u"&&e.ctx.decodeAudioData.length===1?e.ctx.decodeAudioData(t).then(f).catch(u):e.ctx.decodeAudioData(t,f,u)},m=function(t,l){l&&!t._duration&&(t._duration=l.duration),Object.keys(t._sprite).length===0&&(t._sprite={__default:[0,t._duration*1e3]}),t._state!=="loaded"&&(t._state="loaded",t._emit("load"),t._loadQueue())},g=function(){if(e.usingWebAudio){try{typeof AudioContext<"u"?e.ctx=new AudioContext:typeof webkitAudioContext<"u"?e.ctx=new webkitAudioContext:e.usingWebAudio=!1}catch{e.usingWebAudio=!1}e.ctx||(e.usingWebAudio=!1);var t=/iP(hone|od|ad)/.test(e._navigator&&e._navigator.platform),l=e._navigator&&e._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),u=l?parseInt(l[1],10):null;if(t&&u&&u<9){var f=/safari/.test(e._navigator&&e._navigator.userAgent.toLowerCase());e._navigator&&!f&&(e.usingWebAudio=!1)}e.usingWebAudio&&(e.masterGain=typeof e.ctx.createGain>"u"?e.ctx.createGainNode():e.ctx.createGain(),e.masterGain.gain.setValueAtTime(e._muted?0:e._volume,e.ctx.currentTime),e.masterGain.connect(e.ctx.destination)),e._setup()}};n.Howler=e,n.Howl=o,typeof ue<"u"?(ue.HowlerGlobal=i,ue.Howler=e,ue.Howl=o,ue.Sound=a):typeof window<"u"&&(window.HowlerGlobal=i,window.Howler=e,window.Howl=o,window.Sound=a)})();/*!
|
|
25
|
+
*/(function(n){(function(){var i=function(){this.init()};i.prototype={init:function(){var t=this||e;return t._counter=1e3,t._html5AudioPool=[],t.html5PoolSize=10,t._codecs={},t._howls=[],t._muted=!1,t._volume=1,t._canPlayEvent="canplaythrough",t._navigator=typeof window<"u"&&window.navigator?window.navigator:null,t.masterGain=null,t.noAudio=!1,t.usingWebAudio=!0,t.autoSuspend=!0,t.ctx=null,t.autoUnlock=!0,t._setup(),t},volume:function(t){var l=this||e;if(t=parseFloat(t),l.ctx||v(),typeof t<"u"&&t>=0&&t<=1){if(l._volume=t,l._muted)return l;l.usingWebAudio&&l.masterGain.gain.setValueAtTime(t,e.ctx.currentTime);for(var u=0;u<l._howls.length;u++)if(!l._howls[u]._webAudio)for(var f=l._howls[u]._getSoundIds(),h=0;h<f.length;h++){var g=l._howls[u]._soundById(f[h]);g&&g._node&&(g._node.volume=g._volume*t)}return l}return l._volume},mute:function(t){var l=this||e;l.ctx||v(),l._muted=t,l.usingWebAudio&&l.masterGain.gain.setValueAtTime(t?0:l._volume,e.ctx.currentTime);for(var u=0;u<l._howls.length;u++)if(!l._howls[u]._webAudio)for(var f=l._howls[u]._getSoundIds(),h=0;h<f.length;h++){var g=l._howls[u]._soundById(f[h]);g&&g._node&&(g._node.muted=t?!0:g._muted)}return l},stop:function(){for(var t=this||e,l=0;l<t._howls.length;l++)t._howls[l].stop();return t},unload:function(){for(var t=this||e,l=t._howls.length-1;l>=0;l--)t._howls[l].unload();return t.usingWebAudio&&t.ctx&&typeof t.ctx.close<"u"&&(t.ctx.close(),t.ctx=null,v()),t},codecs:function(t){return(this||e)._codecs[t.replace(/^x-/,"")]},_setup:function(){var t=this||e;if(t.state=t.ctx&&t.ctx.state||"suspended",t._autoSuspend(),!t.usingWebAudio)if(typeof Audio<"u")try{var l=new Audio;typeof l.oncanplaythrough>"u"&&(t._canPlayEvent="canplay")}catch{t.noAudio=!0}else t.noAudio=!0;try{var l=new Audio;l.muted&&(t.noAudio=!0)}catch{}return t.noAudio||t._setupCodecs(),t},_setupCodecs:function(){var t=this||e,l=null;try{l=typeof Audio<"u"?new Audio:null}catch{return t}if(!l||typeof l.canPlayType!="function")return t;var u=l.canPlayType("audio/mpeg;").replace(/^no$/,""),f=t._navigator?t._navigator.userAgent:"",h=f.match(/OPR\/(\d+)/g),g=h&&parseInt(h[0].split("/")[1],10)<33,_=f.indexOf("Safari")!==-1&&f.indexOf("Chrome")===-1,w=f.match(/Version\/(.*?) /),A=_&&w&&parseInt(w[1],10)<15;return t._codecs={mp3:!!(!g&&(u||l.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!u,opus:!!l.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!l.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!l.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(l.canPlayType('audio/wav; codecs="1"')||l.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!l.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!l.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(l.canPlayType("audio/x-m4a;")||l.canPlayType("audio/m4a;")||l.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(l.canPlayType("audio/x-m4b;")||l.canPlayType("audio/m4b;")||l.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(l.canPlayType("audio/x-mp4;")||l.canPlayType("audio/mp4;")||l.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!A&&l.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!A&&l.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!l.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(l.canPlayType("audio/x-flac;")||l.canPlayType("audio/flac;")).replace(/^no$/,"")},t},_unlockAudio:function(){var t=this||e;if(!(t._audioUnlocked||!t.ctx)){t._audioUnlocked=!1,t.autoUnlock=!1,!t._mobileUnloaded&&t.ctx.sampleRate!==44100&&(t._mobileUnloaded=!0,t.unload()),t._scratchBuffer=t.ctx.createBuffer(1,1,22050);var l=function(u){for(;t._html5AudioPool.length<t.html5PoolSize;)try{var f=new Audio;f._unlocked=!0,t._releaseHtml5Audio(f)}catch{t.noAudio=!0;break}for(var h=0;h<t._howls.length;h++)if(!t._howls[h]._webAudio)for(var g=t._howls[h]._getSoundIds(),_=0;_<g.length;_++){var w=t._howls[h]._soundById(g[_]);w&&w._node&&!w._node._unlocked&&(w._node._unlocked=!0,w._node.load())}t._autoResume();var A=t.ctx.createBufferSource();A.buffer=t._scratchBuffer,A.connect(t.ctx.destination),typeof A.start>"u"?A.noteOn(0):A.start(0),typeof t.ctx.resume=="function"&&t.ctx.resume(),A.onended=function(){A.disconnect(0),t._audioUnlocked=!0,document.removeEventListener("touchstart",l,!0),document.removeEventListener("touchend",l,!0),document.removeEventListener("click",l,!0),document.removeEventListener("keydown",l,!0);for(var O=0;O<t._howls.length;O++)t._howls[O]._emit("unlock")}};return document.addEventListener("touchstart",l,!0),document.addEventListener("touchend",l,!0),document.addEventListener("click",l,!0),document.addEventListener("keydown",l,!0),t}},_obtainHtml5Audio:function(){var t=this||e;if(t._html5AudioPool.length)return t._html5AudioPool.pop();var l=new Audio().play();return l&&typeof Promise<"u"&&(l instanceof Promise||typeof l.then=="function")&&l.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(t){var l=this||e;return t._unlocked&&l._html5AudioPool.push(t),l},_autoSuspend:function(){var t=this;if(!(!t.autoSuspend||!t.ctx||typeof t.ctx.suspend>"u"||!e.usingWebAudio)){for(var l=0;l<t._howls.length;l++)if(t._howls[l]._webAudio){for(var u=0;u<t._howls[l]._sounds.length;u++)if(!t._howls[l]._sounds[u]._paused)return t}return t._suspendTimer&&clearTimeout(t._suspendTimer),t._suspendTimer=setTimeout(function(){if(t.autoSuspend){t._suspendTimer=null,t.state="suspending";var f=function(){t.state="suspended",t._resumeAfterSuspend&&(delete t._resumeAfterSuspend,t._autoResume())};t.ctx.suspend().then(f,f)}},3e4),t}},_autoResume:function(){var t=this;if(!(!t.ctx||typeof t.ctx.resume>"u"||!e.usingWebAudio))return t.state==="running"&&t.ctx.state!=="interrupted"&&t._suspendTimer?(clearTimeout(t._suspendTimer),t._suspendTimer=null):t.state==="suspended"||t.state==="running"&&t.ctx.state==="interrupted"?(t.ctx.resume().then(function(){t.state="running";for(var l=0;l<t._howls.length;l++)t._howls[l]._emit("resume")}),t._suspendTimer&&(clearTimeout(t._suspendTimer),t._suspendTimer=null)):t.state==="suspending"&&(t._resumeAfterSuspend=!0),t}};var e=new i,o=function(t){var l=this;if(!t.src||t.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}l.init(t)};o.prototype={init:function(t){var l=this;return e.ctx||v(),l._autoplay=t.autoplay||!1,l._format=typeof t.format!="string"?t.format:[t.format],l._html5=t.html5||!1,l._muted=t.mute||!1,l._loop=t.loop||!1,l._pool=t.pool||5,l._preload=typeof t.preload=="boolean"||t.preload==="metadata"?t.preload:!0,l._rate=t.rate||1,l._sprite=t.sprite||{},l._src=typeof t.src!="string"?t.src:[t.src],l._volume=t.volume!==void 0?t.volume:1,l._xhr={method:t.xhr&&t.xhr.method?t.xhr.method:"GET",headers:t.xhr&&t.xhr.headers?t.xhr.headers:null,withCredentials:t.xhr&&t.xhr.withCredentials?t.xhr.withCredentials:!1},l._duration=0,l._state="unloaded",l._sounds=[],l._endTimers={},l._queue=[],l._playLock=!1,l._onend=t.onend?[{fn:t.onend}]:[],l._onfade=t.onfade?[{fn:t.onfade}]:[],l._onload=t.onload?[{fn:t.onload}]:[],l._onloaderror=t.onloaderror?[{fn:t.onloaderror}]:[],l._onplayerror=t.onplayerror?[{fn:t.onplayerror}]:[],l._onpause=t.onpause?[{fn:t.onpause}]:[],l._onplay=t.onplay?[{fn:t.onplay}]:[],l._onstop=t.onstop?[{fn:t.onstop}]:[],l._onmute=t.onmute?[{fn:t.onmute}]:[],l._onvolume=t.onvolume?[{fn:t.onvolume}]:[],l._onrate=t.onrate?[{fn:t.onrate}]:[],l._onseek=t.onseek?[{fn:t.onseek}]:[],l._onunlock=t.onunlock?[{fn:t.onunlock}]:[],l._onresume=[],l._webAudio=e.usingWebAudio&&!l._html5,typeof e.ctx<"u"&&e.ctx&&e.autoUnlock&&e._unlockAudio(),e._howls.push(l),l._autoplay&&l._queue.push({event:"play",action:function(){l.play()}}),l._preload&&l._preload!=="none"&&l.load(),l},load:function(){var t=this,l=null;if(e.noAudio){t._emit("loaderror",null,"No audio support.");return}typeof t._src=="string"&&(t._src=[t._src]);for(var u=0;u<t._src.length;u++){var f,h;if(t._format&&t._format[u])f=t._format[u];else{if(h=t._src[u],typeof h!="string"){t._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}f=/^data:audio\/([^;,]+);/i.exec(h),f||(f=/\.([^.]+)$/.exec(h.split("?",1)[0])),f&&(f=f[1].toLowerCase())}if(f||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),f&&e.codecs(f)){l=t._src[u];break}}if(!l){t._emit("loaderror",null,"No codec support for selected audio sources.");return}return t._src=l,t._state="loading",window.location.protocol==="https:"&&l.slice(0,5)==="http:"&&(t._html5=!0,t._webAudio=!1),new a(t),t._webAudio&&d(t),t},play:function(t,l){var u=this,f=null;if(typeof t=="number")f=t,t=null;else{if(typeof t=="string"&&u._state==="loaded"&&!u._sprite[t])return null;if(typeof t>"u"&&(t="__default",!u._playLock)){for(var h=0,g=0;g<u._sounds.length;g++)u._sounds[g]._paused&&!u._sounds[g]._ended&&(h++,f=u._sounds[g]._id);h===1?t=null:f=null}}var _=f?u._soundById(f):u._inactiveSound();if(!_)return null;if(f&&!t&&(t=_._sprite||"__default"),u._state!=="loaded"){_._sprite=t,_._ended=!1;var w=_._id;return u._queue.push({event:"play",action:function(){u.play(w)}}),w}if(f&&!_._paused)return l||u._loadQueue("play"),_._id;u._webAudio&&e._autoResume();var A=Math.max(0,_._seek>0?_._seek:u._sprite[t][0]/1e3),O=Math.max(0,(u._sprite[t][0]+u._sprite[t][1])/1e3-A),x=O*1e3/Math.abs(_._rate),I=u._sprite[t][0]/1e3,C=(u._sprite[t][0]+u._sprite[t][1])/1e3;_._sprite=t,_._ended=!1;var E=function(){_._paused=!1,_._seek=A,_._start=I,_._stop=C,_._loop=!!(_._loop||u._sprite[t][2])};if(A>=C){u._ended(_);return}var T=_._node;if(u._webAudio){var b=function(){u._playLock=!1,E(),u._refreshBuffer(_);var V=_._muted||u._muted?0:_._volume;T.gain.setValueAtTime(V,e.ctx.currentTime),_._playStart=e.ctx.currentTime,typeof T.bufferSource.start>"u"?_._loop?T.bufferSource.noteGrainOn(0,A,86400):T.bufferSource.noteGrainOn(0,A,O):_._loop?T.bufferSource.start(0,A,86400):T.bufferSource.start(0,A,O),x!==1/0&&(u._endTimers[_._id]=setTimeout(u._ended.bind(u,_),x)),l||setTimeout(function(){u._emit("play",_._id),u._loadQueue()},0)};e.state==="running"&&e.ctx.state!=="interrupted"?b():(u._playLock=!0,u.once("resume",b),u._clearTimer(_._id))}else{var y=function(){T.currentTime=A,T.muted=_._muted||u._muted||e._muted||T.muted,T.volume=_._volume*e.volume(),T.playbackRate=_._rate;try{var V=T.play();if(V&&typeof Promise<"u"&&(V instanceof Promise||typeof V.then=="function")?(u._playLock=!0,E(),V.then(function(){u._playLock=!1,T._unlocked=!0,l?u._loadQueue():u._emit("play",_._id)}).catch(function(){u._playLock=!1,u._emit("playerror",_._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),_._ended=!0,_._paused=!0})):l||(u._playLock=!1,E(),u._emit("play",_._id)),T.playbackRate=_._rate,T.paused){u._emit("playerror",_._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}t!=="__default"||_._loop?u._endTimers[_._id]=setTimeout(u._ended.bind(u,_),x):(u._endTimers[_._id]=function(){u._ended(_),T.removeEventListener("ended",u._endTimers[_._id],!1)},T.addEventListener("ended",u._endTimers[_._id],!1))}catch(L){u._emit("playerror",_._id,L)}};T.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(T.src=u._src,T.load());var S=window&&window.ejecta||!T.readyState&&e._navigator.isCocoonJS;if(T.readyState>=3||S)y();else{u._playLock=!0,u._state="loading";var k=function(){u._state="loaded",y(),T.removeEventListener(e._canPlayEvent,k,!1)};T.addEventListener(e._canPlayEvent,k,!1),u._clearTimer(_._id)}}return _._id},pause:function(t){var l=this;if(l._state!=="loaded"||l._playLock)return l._queue.push({event:"pause",action:function(){l.pause(t)}}),l;for(var u=l._getSoundIds(t),f=0;f<u.length;f++){l._clearTimer(u[f]);var h=l._soundById(u[f]);if(h&&!h._paused&&(h._seek=l.seek(u[f]),h._rateSeek=0,h._paused=!0,l._stopFade(u[f]),h._node))if(l._webAudio){if(!h._node.bufferSource)continue;typeof h._node.bufferSource.stop>"u"?h._node.bufferSource.noteOff(0):h._node.bufferSource.stop(0),l._cleanBuffer(h._node)}else(!isNaN(h._node.duration)||h._node.duration===1/0)&&h._node.pause();arguments[1]||l._emit("pause",h?h._id:null)}return l},stop:function(t,l){var u=this;if(u._state!=="loaded"||u._playLock)return u._queue.push({event:"stop",action:function(){u.stop(t)}}),u;for(var f=u._getSoundIds(t),h=0;h<f.length;h++){u._clearTimer(f[h]);var g=u._soundById(f[h]);g&&(g._seek=g._start||0,g._rateSeek=0,g._paused=!0,g._ended=!0,u._stopFade(f[h]),g._node&&(u._webAudio?g._node.bufferSource&&(typeof g._node.bufferSource.stop>"u"?g._node.bufferSource.noteOff(0):g._node.bufferSource.stop(0),u._cleanBuffer(g._node)):(!isNaN(g._node.duration)||g._node.duration===1/0)&&(g._node.currentTime=g._start||0,g._node.pause(),g._node.duration===1/0&&u._clearSound(g._node))),l||u._emit("stop",g._id))}return u},mute:function(t,l){var u=this;if(u._state!=="loaded"||u._playLock)return u._queue.push({event:"mute",action:function(){u.mute(t,l)}}),u;if(typeof l>"u")if(typeof t=="boolean")u._muted=t;else return u._muted;for(var f=u._getSoundIds(l),h=0;h<f.length;h++){var g=u._soundById(f[h]);g&&(g._muted=t,g._interval&&u._stopFade(g._id),u._webAudio&&g._node?g._node.gain.setValueAtTime(t?0:g._volume,e.ctx.currentTime):g._node&&(g._node.muted=e._muted?!0:t),u._emit("mute",g._id))}return u},volume:function(){var t=this,l=arguments,u,f;if(l.length===0)return t._volume;if(l.length===1||l.length===2&&typeof l[1]>"u"){var h=t._getSoundIds(),g=h.indexOf(l[0]);g>=0?f=parseInt(l[0],10):u=parseFloat(l[0])}else l.length>=2&&(u=parseFloat(l[0]),f=parseInt(l[1],10));var _;if(typeof u<"u"&&u>=0&&u<=1){if(t._state!=="loaded"||t._playLock)return t._queue.push({event:"volume",action:function(){t.volume.apply(t,l)}}),t;typeof f>"u"&&(t._volume=u),f=t._getSoundIds(f);for(var w=0;w<f.length;w++)_=t._soundById(f[w]),_&&(_._volume=u,l[2]||t._stopFade(f[w]),t._webAudio&&_._node&&!_._muted?_._node.gain.setValueAtTime(u,e.ctx.currentTime):_._node&&!_._muted&&(_._node.volume=u*e.volume()),t._emit("volume",_._id))}else return _=f?t._soundById(f):t._sounds[0],_?_._volume:0;return t},fade:function(t,l,u,f){var h=this;if(h._state!=="loaded"||h._playLock)return h._queue.push({event:"fade",action:function(){h.fade(t,l,u,f)}}),h;t=Math.min(Math.max(0,parseFloat(t)),1),l=Math.min(Math.max(0,parseFloat(l)),1),u=parseFloat(u),h.volume(t,f);for(var g=h._getSoundIds(f),_=0;_<g.length;_++){var w=h._soundById(g[_]);if(w){if(f||h._stopFade(g[_]),h._webAudio&&!w._muted){var A=e.ctx.currentTime,O=A+u/1e3;w._volume=t,w._node.gain.setValueAtTime(t,A),w._node.gain.linearRampToValueAtTime(l,O)}h._startFadeInterval(w,t,l,u,g[_],typeof f>"u")}}return h},_startFadeInterval:function(t,l,u,f,h,g){var _=this,w=l,A=u-l,O=Math.abs(A/.01),x=Math.max(4,O>0?f/O:f),I=Date.now();t._fadeTo=u,t._interval=setInterval(function(){var C=(Date.now()-I)/f;I=Date.now(),w+=A*C,w=Math.round(w*100)/100,A<0?w=Math.max(u,w):w=Math.min(u,w),_._webAudio?t._volume=w:_.volume(w,t._id,!0),g&&(_._volume=w),(u<l&&w<=u||u>l&&w>=u)&&(clearInterval(t._interval),t._interval=null,t._fadeTo=null,_.volume(u,t._id),_._emit("fade",t._id))},x)},_stopFade:function(t){var l=this,u=l._soundById(t);return u&&u._interval&&(l._webAudio&&u._node.gain.cancelScheduledValues(e.ctx.currentTime),clearInterval(u._interval),u._interval=null,l.volume(u._fadeTo,t),u._fadeTo=null,l._emit("fade",t)),l},loop:function(){var t=this,l=arguments,u,f,h;if(l.length===0)return t._loop;if(l.length===1)if(typeof l[0]=="boolean")u=l[0],t._loop=u;else return h=t._soundById(parseInt(l[0],10)),h?h._loop:!1;else l.length===2&&(u=l[0],f=parseInt(l[1],10));for(var g=t._getSoundIds(f),_=0;_<g.length;_++)h=t._soundById(g[_]),h&&(h._loop=u,t._webAudio&&h._node&&h._node.bufferSource&&(h._node.bufferSource.loop=u,u&&(h._node.bufferSource.loopStart=h._start||0,h._node.bufferSource.loopEnd=h._stop,t.playing(g[_])&&(t.pause(g[_],!0),t.play(g[_],!0)))));return t},rate:function(){var t=this,l=arguments,u,f;if(l.length===0)f=t._sounds[0]._id;else if(l.length===1){var h=t._getSoundIds(),g=h.indexOf(l[0]);g>=0?f=parseInt(l[0],10):u=parseFloat(l[0])}else l.length===2&&(u=parseFloat(l[0]),f=parseInt(l[1],10));var _;if(typeof u=="number"){if(t._state!=="loaded"||t._playLock)return t._queue.push({event:"rate",action:function(){t.rate.apply(t,l)}}),t;typeof f>"u"&&(t._rate=u),f=t._getSoundIds(f);for(var w=0;w<f.length;w++)if(_=t._soundById(f[w]),_){t.playing(f[w])&&(_._rateSeek=t.seek(f[w]),_._playStart=t._webAudio?e.ctx.currentTime:_._playStart),_._rate=u,t._webAudio&&_._node&&_._node.bufferSource?_._node.bufferSource.playbackRate.setValueAtTime(u,e.ctx.currentTime):_._node&&(_._node.playbackRate=u);var A=t.seek(f[w]),O=(t._sprite[_._sprite][0]+t._sprite[_._sprite][1])/1e3-A,x=O*1e3/Math.abs(_._rate);(t._endTimers[f[w]]||!_._paused)&&(t._clearTimer(f[w]),t._endTimers[f[w]]=setTimeout(t._ended.bind(t,_),x)),t._emit("rate",_._id)}}else return _=t._soundById(f),_?_._rate:t._rate;return t},seek:function(){var t=this,l=arguments,u,f;if(l.length===0)t._sounds.length&&(f=t._sounds[0]._id);else if(l.length===1){var h=t._getSoundIds(),g=h.indexOf(l[0]);g>=0?f=parseInt(l[0],10):t._sounds.length&&(f=t._sounds[0]._id,u=parseFloat(l[0]))}else l.length===2&&(u=parseFloat(l[0]),f=parseInt(l[1],10));if(typeof f>"u")return 0;if(typeof u=="number"&&(t._state!=="loaded"||t._playLock))return t._queue.push({event:"seek",action:function(){t.seek.apply(t,l)}}),t;var _=t._soundById(f);if(_)if(typeof u=="number"&&u>=0){var w=t.playing(f);w&&t.pause(f,!0),_._seek=u,_._ended=!1,t._clearTimer(f),!t._webAudio&&_._node&&!isNaN(_._node.duration)&&(_._node.currentTime=u);var A=function(){w&&t.play(f,!0),t._emit("seek",f)};if(w&&!t._webAudio){var O=function(){t._playLock?setTimeout(O,0):A()};setTimeout(O,0)}else A()}else if(t._webAudio){var x=t.playing(f)?e.ctx.currentTime-_._playStart:0,I=_._rateSeek?_._rateSeek-_._seek:0;return _._seek+(I+x*Math.abs(_._rate))}else return _._node.currentTime;return t},playing:function(t){var l=this;if(typeof t=="number"){var u=l._soundById(t);return u?!u._paused:!1}for(var f=0;f<l._sounds.length;f++)if(!l._sounds[f]._paused)return!0;return!1},duration:function(t){var l=this,u=l._duration,f=l._soundById(t);return f&&(u=l._sprite[f._sprite][1]/1e3),u},state:function(){return this._state},unload:function(){for(var t=this,l=t._sounds,u=0;u<l.length;u++)l[u]._paused||t.stop(l[u]._id),t._webAudio||(t._clearSound(l[u]._node),l[u]._node.removeEventListener("error",l[u]._errorFn,!1),l[u]._node.removeEventListener(e._canPlayEvent,l[u]._loadFn,!1),l[u]._node.removeEventListener("ended",l[u]._endFn,!1),e._releaseHtml5Audio(l[u]._node)),delete l[u]._node,t._clearTimer(l[u]._id);var f=e._howls.indexOf(t);f>=0&&e._howls.splice(f,1);var h=!0;for(u=0;u<e._howls.length;u++)if(e._howls[u]._src===t._src||t._src.indexOf(e._howls[u]._src)>=0){h=!1;break}return s&&h&&delete s[t._src],e.noAudio=!1,t._state="unloaded",t._sounds=[],t=null,null},on:function(t,l,u,f){var h=this,g=h["_on"+t];return typeof l=="function"&&g.push(f?{id:u,fn:l,once:f}:{id:u,fn:l}),h},off:function(t,l,u){var f=this,h=f["_on"+t],g=0;if(typeof l=="number"&&(u=l,l=null),l||u)for(g=0;g<h.length;g++){var _=u===h[g].id;if(l===h[g].fn&&_||!l&&_){h.splice(g,1);break}}else if(t)f["_on"+t]=[];else{var w=Object.keys(f);for(g=0;g<w.length;g++)w[g].indexOf("_on")===0&&Array.isArray(f[w[g]])&&(f[w[g]]=[])}return f},once:function(t,l,u){var f=this;return f.on(t,l,u,1),f},_emit:function(t,l,u){for(var f=this,h=f["_on"+t],g=h.length-1;g>=0;g--)(!h[g].id||h[g].id===l||t==="load")&&(setTimeout((function(_){_.call(this,l,u)}).bind(f,h[g].fn),0),h[g].once&&f.off(t,h[g].fn,h[g].id));return f._loadQueue(t),f},_loadQueue:function(t){var l=this;if(l._queue.length>0){var u=l._queue[0];u.event===t&&(l._queue.shift(),l._loadQueue()),t||u.action()}return l},_ended:function(t){var l=this,u=t._sprite;if(!l._webAudio&&t._node&&!t._node.paused&&!t._node.ended&&t._node.currentTime<t._stop)return setTimeout(l._ended.bind(l,t),100),l;var f=!!(t._loop||l._sprite[u][2]);if(l._emit("end",t._id),!l._webAudio&&f&&l.stop(t._id,!0).play(t._id),l._webAudio&&f){l._emit("play",t._id),t._seek=t._start||0,t._rateSeek=0,t._playStart=e.ctx.currentTime;var h=(t._stop-t._start)*1e3/Math.abs(t._rate);l._endTimers[t._id]=setTimeout(l._ended.bind(l,t),h)}return l._webAudio&&!f&&(t._paused=!0,t._ended=!0,t._seek=t._start||0,t._rateSeek=0,l._clearTimer(t._id),l._cleanBuffer(t._node),e._autoSuspend()),!l._webAudio&&!f&&l.stop(t._id,!0),l},_clearTimer:function(t){var l=this;if(l._endTimers[t]){if(typeof l._endTimers[t]!="function")clearTimeout(l._endTimers[t]);else{var u=l._soundById(t);u&&u._node&&u._node.removeEventListener("ended",l._endTimers[t],!1)}delete l._endTimers[t]}return l},_soundById:function(t){for(var l=this,u=0;u<l._sounds.length;u++)if(t===l._sounds[u]._id)return l._sounds[u];return null},_inactiveSound:function(){var t=this;t._drain();for(var l=0;l<t._sounds.length;l++)if(t._sounds[l]._ended)return t._sounds[l].reset();return new a(t)},_drain:function(){var t=this,l=t._pool,u=0,f=0;if(!(t._sounds.length<l)){for(f=0;f<t._sounds.length;f++)t._sounds[f]._ended&&u++;for(f=t._sounds.length-1;f>=0;f--){if(u<=l)return;t._sounds[f]._ended&&(t._webAudio&&t._sounds[f]._node&&t._sounds[f]._node.disconnect(0),t._sounds.splice(f,1),u--)}}},_getSoundIds:function(t){var l=this;if(typeof t>"u"){for(var u=[],f=0;f<l._sounds.length;f++)u.push(l._sounds[f]._id);return u}else return[t]},_refreshBuffer:function(t){var l=this;return t._node.bufferSource=e.ctx.createBufferSource(),t._node.bufferSource.buffer=s[l._src],t._panner?t._node.bufferSource.connect(t._panner):t._node.bufferSource.connect(t._node),t._node.bufferSource.loop=t._loop,t._loop&&(t._node.bufferSource.loopStart=t._start||0,t._node.bufferSource.loopEnd=t._stop||0),t._node.bufferSource.playbackRate.setValueAtTime(t._rate,e.ctx.currentTime),l},_cleanBuffer:function(t){var l=this,u=e._navigator&&e._navigator.vendor.indexOf("Apple")>=0;if(!t.bufferSource)return l;if(e._scratchBuffer&&t.bufferSource&&(t.bufferSource.onended=null,t.bufferSource.disconnect(0),u))try{t.bufferSource.buffer=e._scratchBuffer}catch{}return t.bufferSource=null,l},_clearSound:function(t){var l=/MSIE |Trident\//.test(e._navigator&&e._navigator.userAgent);l||(t.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var a=function(t){this._parent=t,this.init()};a.prototype={init:function(){var t=this,l=t._parent;return t._muted=l._muted,t._loop=l._loop,t._volume=l._volume,t._rate=l._rate,t._seek=0,t._paused=!0,t._ended=!0,t._sprite="__default",t._id=++e._counter,l._sounds.push(t),t.create(),t},create:function(){var t=this,l=t._parent,u=e._muted||t._muted||t._parent._muted?0:t._volume;return l._webAudio?(t._node=typeof e.ctx.createGain>"u"?e.ctx.createGainNode():e.ctx.createGain(),t._node.gain.setValueAtTime(u,e.ctx.currentTime),t._node.paused=!0,t._node.connect(e.masterGain)):e.noAudio||(t._node=e._obtainHtml5Audio(),t._errorFn=t._errorListener.bind(t),t._node.addEventListener("error",t._errorFn,!1),t._loadFn=t._loadListener.bind(t),t._node.addEventListener(e._canPlayEvent,t._loadFn,!1),t._endFn=t._endListener.bind(t),t._node.addEventListener("ended",t._endFn,!1),t._node.src=l._src,t._node.preload=l._preload===!0?"auto":l._preload,t._node.volume=u*e.volume(),t._node.load()),t},reset:function(){var t=this,l=t._parent;return t._muted=l._muted,t._loop=l._loop,t._volume=l._volume,t._rate=l._rate,t._seek=0,t._rateSeek=0,t._paused=!0,t._ended=!0,t._sprite="__default",t._id=++e._counter,t},_errorListener:function(){var t=this;t._parent._emit("loaderror",t._id,t._node.error?t._node.error.code:0),t._node.removeEventListener("error",t._errorFn,!1)},_loadListener:function(){var t=this,l=t._parent;l._duration=Math.ceil(t._node.duration*10)/10,Object.keys(l._sprite).length===0&&(l._sprite={__default:[0,l._duration*1e3]}),l._state!=="loaded"&&(l._state="loaded",l._emit("load"),l._loadQueue()),t._node.removeEventListener(e._canPlayEvent,t._loadFn,!1)},_endListener:function(){var t=this,l=t._parent;l._duration===1/0&&(l._duration=Math.ceil(t._node.duration*10)/10,l._sprite.__default[1]===1/0&&(l._sprite.__default[1]=l._duration*1e3),l._ended(t)),t._node.removeEventListener("ended",t._endFn,!1)}};var s={},d=function(t){var l=t._src;if(s[l]){t._duration=s[l].duration,m(t);return}if(/^data:[^;]+;base64,/.test(l)){for(var u=atob(l.split(",")[1]),f=new Uint8Array(u.length),h=0;h<u.length;++h)f[h]=u.charCodeAt(h);p(f.buffer,t)}else{var g=new XMLHttpRequest;g.open(t._xhr.method,l,!0),g.withCredentials=t._xhr.withCredentials,g.responseType="arraybuffer",t._xhr.headers&&Object.keys(t._xhr.headers).forEach(function(_){g.setRequestHeader(_,t._xhr.headers[_])}),g.onload=function(){var _=(g.status+"")[0];if(_!=="0"&&_!=="2"&&_!=="3"){t._emit("loaderror",null,"Failed loading audio file with status: "+g.status+".");return}p(g.response,t)},g.onerror=function(){t._webAudio&&(t._html5=!0,t._webAudio=!1,t._sounds=[],delete s[l],t.load())},c(g)}},c=function(t){try{t.send()}catch{t.onerror()}},p=function(t,l){var u=function(){l._emit("loaderror",null,"Decoding audio data failed.")},f=function(h){h&&l._sounds.length>0?(s[l._src]=h,m(l,h)):u()};typeof Promise<"u"&&e.ctx.decodeAudioData.length===1?e.ctx.decodeAudioData(t).then(f).catch(u):e.ctx.decodeAudioData(t,f,u)},m=function(t,l){l&&!t._duration&&(t._duration=l.duration),Object.keys(t._sprite).length===0&&(t._sprite={__default:[0,t._duration*1e3]}),t._state!=="loaded"&&(t._state="loaded",t._emit("load"),t._loadQueue())},v=function(){if(e.usingWebAudio){try{typeof AudioContext<"u"?e.ctx=new AudioContext:typeof webkitAudioContext<"u"?e.ctx=new webkitAudioContext:e.usingWebAudio=!1}catch{e.usingWebAudio=!1}e.ctx||(e.usingWebAudio=!1);var t=/iP(hone|od|ad)/.test(e._navigator&&e._navigator.platform),l=e._navigator&&e._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),u=l?parseInt(l[1],10):null;if(t&&u&&u<9){var f=/safari/.test(e._navigator&&e._navigator.userAgent.toLowerCase());e._navigator&&!f&&(e.usingWebAudio=!1)}e.usingWebAudio&&(e.masterGain=typeof e.ctx.createGain>"u"?e.ctx.createGainNode():e.ctx.createGain(),e.masterGain.gain.setValueAtTime(e._muted?0:e._volume,e.ctx.currentTime),e.masterGain.connect(e.ctx.destination)),e._setup()}};n.Howler=e,n.Howl=o,typeof ue<"u"?(ue.HowlerGlobal=i,ue.Howler=e,ue.Howl=o,ue.Sound=a):typeof window<"u"&&(window.HowlerGlobal=i,window.Howler=e,window.Howl=o,window.Sound=a)})();/*!
|
|
26
26
|
* Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
|
|
27
27
|
*
|
|
28
28
|
* howler.js v2.2.4
|
|
@@ -32,4 +32,4 @@ This will fail in production.`);c=ie,c._s.has(o)||(s?Pe(o,i,a,c):xt(o,a,c),proce
|
|
|
32
32
|
* goldfirestudios.com
|
|
33
33
|
*
|
|
34
34
|
* MIT License
|
|
35
|
-
*/(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var o=this;if(!o.ctx||!o.ctx.listener)return o;for(var a=o._howls.length-1;a>=0;a--)o._howls[a].stereo(e);return o},HowlerGlobal.prototype.pos=function(e,o,a){var s=this;if(!s.ctx||!s.ctx.listener)return s;if(o=typeof o!="number"?s._pos[1]:o,a=typeof a!="number"?s._pos[2]:a,typeof e=="number")s._pos=[e,o,a],typeof s.ctx.listener.positionX<"u"?(s.ctx.listener.positionX.setTargetAtTime(s._pos[0],Howler.ctx.currentTime,.1),s.ctx.listener.positionY.setTargetAtTime(s._pos[1],Howler.ctx.currentTime,.1),s.ctx.listener.positionZ.setTargetAtTime(s._pos[2],Howler.ctx.currentTime,.1)):s.ctx.listener.setPosition(s._pos[0],s._pos[1],s._pos[2]);else return s._pos;return s},HowlerGlobal.prototype.orientation=function(e,o,a,s,d,c){var p=this;if(!p.ctx||!p.ctx.listener)return p;var m=p._orientation;if(o=typeof o!="number"?m[1]:o,a=typeof a!="number"?m[2]:a,s=typeof s!="number"?m[3]:s,d=typeof d!="number"?m[4]:d,c=typeof c!="number"?m[5]:c,typeof e=="number")p._orientation=[e,o,a,s,d,c],typeof p.ctx.listener.forwardX<"u"?(p.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),p.ctx.listener.forwardY.setTargetAtTime(o,Howler.ctx.currentTime,.1),p.ctx.listener.forwardZ.setTargetAtTime(a,Howler.ctx.currentTime,.1),p.ctx.listener.upX.setTargetAtTime(s,Howler.ctx.currentTime,.1),p.ctx.listener.upY.setTargetAtTime(d,Howler.ctx.currentTime,.1),p.ctx.listener.upZ.setTargetAtTime(c,Howler.ctx.currentTime,.1)):p.ctx.listener.setOrientation(e,o,a,s,d,c);else return m;return p},Howl.prototype.init=function(e){return function(o){var a=this;return a._orientation=o.orientation||[1,0,0],a._stereo=o.stereo||null,a._pos=o.pos||null,a._pannerAttr={coneInnerAngle:typeof o.coneInnerAngle<"u"?o.coneInnerAngle:360,coneOuterAngle:typeof o.coneOuterAngle<"u"?o.coneOuterAngle:360,coneOuterGain:typeof o.coneOuterGain<"u"?o.coneOuterGain:0,distanceModel:typeof o.distanceModel<"u"?o.distanceModel:"inverse",maxDistance:typeof o.maxDistance<"u"?o.maxDistance:1e4,panningModel:typeof o.panningModel<"u"?o.panningModel:"HRTF",refDistance:typeof o.refDistance<"u"?o.refDistance:1,rolloffFactor:typeof o.rolloffFactor<"u"?o.rolloffFactor:1},a._onstereo=o.onstereo?[{fn:o.onstereo}]:[],a._onpos=o.onpos?[{fn:o.onpos}]:[],a._onorientation=o.onorientation?[{fn:o.onorientation}]:[],e.call(this,o)}}(Howl.prototype.init),Howl.prototype.stereo=function(e,o){var a=this;if(!a._webAudio)return a;if(a._state!=="loaded")return a._queue.push({event:"stereo",action:function(){a.stereo(e,o)}}),a;var s=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof o>"u")if(typeof e=="number")a._stereo=e,a._pos=[e,0,0];else return a._stereo;for(var d=a._getSoundIds(o),c=0;c<d.length;c++){var p=a._soundById(d[c]);if(p)if(typeof e=="number")p._stereo=e,p._pos=[e,0,0],p._node&&(p._pannerAttr.panningModel="equalpower",(!p._panner||!p._panner.pan)&&i(p,s),s==="spatial"?typeof p._panner.positionX<"u"?(p._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),p._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),p._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):p._panner.setPosition(e,0,0):p._panner.pan.setValueAtTime(e,Howler.ctx.currentTime)),a._emit("stereo",p._id);else return p._stereo}return a},Howl.prototype.pos=function(e,o,a,s){var d=this;if(!d._webAudio)return d;if(d._state!=="loaded")return d._queue.push({event:"pos",action:function(){d.pos(e,o,a,s)}}),d;if(o=typeof o!="number"?0:o,a=typeof a!="number"?-.5:a,typeof s>"u")if(typeof e=="number")d._pos=[e,o,a];else return d._pos;for(var c=d._getSoundIds(s),p=0;p<c.length;p++){var m=d._soundById(c[p]);if(m)if(typeof e=="number")m._pos=[e,o,a],m._node&&((!m._panner||m._panner.pan)&&i(m,"spatial"),typeof m._panner.positionX<"u"?(m._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),m._panner.positionY.setValueAtTime(o,Howler.ctx.currentTime),m._panner.positionZ.setValueAtTime(a,Howler.ctx.currentTime)):m._panner.setPosition(e,o,a)),d._emit("pos",m._id);else return m._pos}return d},Howl.prototype.orientation=function(e,o,a,s){var d=this;if(!d._webAudio)return d;if(d._state!=="loaded")return d._queue.push({event:"orientation",action:function(){d.orientation(e,o,a,s)}}),d;if(o=typeof o!="number"?d._orientation[1]:o,a=typeof a!="number"?d._orientation[2]:a,typeof s>"u")if(typeof e=="number")d._orientation=[e,o,a];else return d._orientation;for(var c=d._getSoundIds(s),p=0;p<c.length;p++){var m=d._soundById(c[p]);if(m)if(typeof e=="number")m._orientation=[e,o,a],m._node&&(m._panner||(m._pos||(m._pos=d._pos||[0,0,-.5]),i(m,"spatial")),typeof m._panner.orientationX<"u"?(m._panner.orientationX.setValueAtTime(e,Howler.ctx.currentTime),m._panner.orientationY.setValueAtTime(o,Howler.ctx.currentTime),m._panner.orientationZ.setValueAtTime(a,Howler.ctx.currentTime)):m._panner.setOrientation(e,o,a)),d._emit("orientation",m._id);else return m._orientation}return d},Howl.prototype.pannerAttr=function(){var e=this,o=arguments,a,s,d;if(!e._webAudio)return e;if(o.length===0)return e._pannerAttr;if(o.length===1)if(typeof o[0]=="object")a=o[0],typeof s>"u"&&(a.pannerAttr||(a.pannerAttr={coneInnerAngle:a.coneInnerAngle,coneOuterAngle:a.coneOuterAngle,coneOuterGain:a.coneOuterGain,distanceModel:a.distanceModel,maxDistance:a.maxDistance,refDistance:a.refDistance,rolloffFactor:a.rolloffFactor,panningModel:a.panningModel}),e._pannerAttr={coneInnerAngle:typeof a.pannerAttr.coneInnerAngle<"u"?a.pannerAttr.coneInnerAngle:e._coneInnerAngle,coneOuterAngle:typeof a.pannerAttr.coneOuterAngle<"u"?a.pannerAttr.coneOuterAngle:e._coneOuterAngle,coneOuterGain:typeof a.pannerAttr.coneOuterGain<"u"?a.pannerAttr.coneOuterGain:e._coneOuterGain,distanceModel:typeof a.pannerAttr.distanceModel<"u"?a.pannerAttr.distanceModel:e._distanceModel,maxDistance:typeof a.pannerAttr.maxDistance<"u"?a.pannerAttr.maxDistance:e._maxDistance,refDistance:typeof a.pannerAttr.refDistance<"u"?a.pannerAttr.refDistance:e._refDistance,rolloffFactor:typeof a.pannerAttr.rolloffFactor<"u"?a.pannerAttr.rolloffFactor:e._rolloffFactor,panningModel:typeof a.pannerAttr.panningModel<"u"?a.pannerAttr.panningModel:e._panningModel});else return d=e._soundById(parseInt(o[0],10)),d?d._pannerAttr:e._pannerAttr;else o.length===2&&(a=o[0],s=parseInt(o[1],10));for(var c=e._getSoundIds(s),p=0;p<c.length;p++)if(d=e._soundById(c[p]),d){var m=d._pannerAttr;m={coneInnerAngle:typeof a.coneInnerAngle<"u"?a.coneInnerAngle:m.coneInnerAngle,coneOuterAngle:typeof a.coneOuterAngle<"u"?a.coneOuterAngle:m.coneOuterAngle,coneOuterGain:typeof a.coneOuterGain<"u"?a.coneOuterGain:m.coneOuterGain,distanceModel:typeof a.distanceModel<"u"?a.distanceModel:m.distanceModel,maxDistance:typeof a.maxDistance<"u"?a.maxDistance:m.maxDistance,refDistance:typeof a.refDistance<"u"?a.refDistance:m.refDistance,rolloffFactor:typeof a.rolloffFactor<"u"?a.rolloffFactor:m.rolloffFactor,panningModel:typeof a.panningModel<"u"?a.panningModel:m.panningModel};var
|
|
35
|
+
*/(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var o=this;if(!o.ctx||!o.ctx.listener)return o;for(var a=o._howls.length-1;a>=0;a--)o._howls[a].stereo(e);return o},HowlerGlobal.prototype.pos=function(e,o,a){var s=this;if(!s.ctx||!s.ctx.listener)return s;if(o=typeof o!="number"?s._pos[1]:o,a=typeof a!="number"?s._pos[2]:a,typeof e=="number")s._pos=[e,o,a],typeof s.ctx.listener.positionX<"u"?(s.ctx.listener.positionX.setTargetAtTime(s._pos[0],Howler.ctx.currentTime,.1),s.ctx.listener.positionY.setTargetAtTime(s._pos[1],Howler.ctx.currentTime,.1),s.ctx.listener.positionZ.setTargetAtTime(s._pos[2],Howler.ctx.currentTime,.1)):s.ctx.listener.setPosition(s._pos[0],s._pos[1],s._pos[2]);else return s._pos;return s},HowlerGlobal.prototype.orientation=function(e,o,a,s,d,c){var p=this;if(!p.ctx||!p.ctx.listener)return p;var m=p._orientation;if(o=typeof o!="number"?m[1]:o,a=typeof a!="number"?m[2]:a,s=typeof s!="number"?m[3]:s,d=typeof d!="number"?m[4]:d,c=typeof c!="number"?m[5]:c,typeof e=="number")p._orientation=[e,o,a,s,d,c],typeof p.ctx.listener.forwardX<"u"?(p.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),p.ctx.listener.forwardY.setTargetAtTime(o,Howler.ctx.currentTime,.1),p.ctx.listener.forwardZ.setTargetAtTime(a,Howler.ctx.currentTime,.1),p.ctx.listener.upX.setTargetAtTime(s,Howler.ctx.currentTime,.1),p.ctx.listener.upY.setTargetAtTime(d,Howler.ctx.currentTime,.1),p.ctx.listener.upZ.setTargetAtTime(c,Howler.ctx.currentTime,.1)):p.ctx.listener.setOrientation(e,o,a,s,d,c);else return m;return p},Howl.prototype.init=function(e){return function(o){var a=this;return a._orientation=o.orientation||[1,0,0],a._stereo=o.stereo||null,a._pos=o.pos||null,a._pannerAttr={coneInnerAngle:typeof o.coneInnerAngle<"u"?o.coneInnerAngle:360,coneOuterAngle:typeof o.coneOuterAngle<"u"?o.coneOuterAngle:360,coneOuterGain:typeof o.coneOuterGain<"u"?o.coneOuterGain:0,distanceModel:typeof o.distanceModel<"u"?o.distanceModel:"inverse",maxDistance:typeof o.maxDistance<"u"?o.maxDistance:1e4,panningModel:typeof o.panningModel<"u"?o.panningModel:"HRTF",refDistance:typeof o.refDistance<"u"?o.refDistance:1,rolloffFactor:typeof o.rolloffFactor<"u"?o.rolloffFactor:1},a._onstereo=o.onstereo?[{fn:o.onstereo}]:[],a._onpos=o.onpos?[{fn:o.onpos}]:[],a._onorientation=o.onorientation?[{fn:o.onorientation}]:[],e.call(this,o)}}(Howl.prototype.init),Howl.prototype.stereo=function(e,o){var a=this;if(!a._webAudio)return a;if(a._state!=="loaded")return a._queue.push({event:"stereo",action:function(){a.stereo(e,o)}}),a;var s=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof o>"u")if(typeof e=="number")a._stereo=e,a._pos=[e,0,0];else return a._stereo;for(var d=a._getSoundIds(o),c=0;c<d.length;c++){var p=a._soundById(d[c]);if(p)if(typeof e=="number")p._stereo=e,p._pos=[e,0,0],p._node&&(p._pannerAttr.panningModel="equalpower",(!p._panner||!p._panner.pan)&&i(p,s),s==="spatial"?typeof p._panner.positionX<"u"?(p._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),p._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),p._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):p._panner.setPosition(e,0,0):p._panner.pan.setValueAtTime(e,Howler.ctx.currentTime)),a._emit("stereo",p._id);else return p._stereo}return a},Howl.prototype.pos=function(e,o,a,s){var d=this;if(!d._webAudio)return d;if(d._state!=="loaded")return d._queue.push({event:"pos",action:function(){d.pos(e,o,a,s)}}),d;if(o=typeof o!="number"?0:o,a=typeof a!="number"?-.5:a,typeof s>"u")if(typeof e=="number")d._pos=[e,o,a];else return d._pos;for(var c=d._getSoundIds(s),p=0;p<c.length;p++){var m=d._soundById(c[p]);if(m)if(typeof e=="number")m._pos=[e,o,a],m._node&&((!m._panner||m._panner.pan)&&i(m,"spatial"),typeof m._panner.positionX<"u"?(m._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),m._panner.positionY.setValueAtTime(o,Howler.ctx.currentTime),m._panner.positionZ.setValueAtTime(a,Howler.ctx.currentTime)):m._panner.setPosition(e,o,a)),d._emit("pos",m._id);else return m._pos}return d},Howl.prototype.orientation=function(e,o,a,s){var d=this;if(!d._webAudio)return d;if(d._state!=="loaded")return d._queue.push({event:"orientation",action:function(){d.orientation(e,o,a,s)}}),d;if(o=typeof o!="number"?d._orientation[1]:o,a=typeof a!="number"?d._orientation[2]:a,typeof s>"u")if(typeof e=="number")d._orientation=[e,o,a];else return d._orientation;for(var c=d._getSoundIds(s),p=0;p<c.length;p++){var m=d._soundById(c[p]);if(m)if(typeof e=="number")m._orientation=[e,o,a],m._node&&(m._panner||(m._pos||(m._pos=d._pos||[0,0,-.5]),i(m,"spatial")),typeof m._panner.orientationX<"u"?(m._panner.orientationX.setValueAtTime(e,Howler.ctx.currentTime),m._panner.orientationY.setValueAtTime(o,Howler.ctx.currentTime),m._panner.orientationZ.setValueAtTime(a,Howler.ctx.currentTime)):m._panner.setOrientation(e,o,a)),d._emit("orientation",m._id);else return m._orientation}return d},Howl.prototype.pannerAttr=function(){var e=this,o=arguments,a,s,d;if(!e._webAudio)return e;if(o.length===0)return e._pannerAttr;if(o.length===1)if(typeof o[0]=="object")a=o[0],typeof s>"u"&&(a.pannerAttr||(a.pannerAttr={coneInnerAngle:a.coneInnerAngle,coneOuterAngle:a.coneOuterAngle,coneOuterGain:a.coneOuterGain,distanceModel:a.distanceModel,maxDistance:a.maxDistance,refDistance:a.refDistance,rolloffFactor:a.rolloffFactor,panningModel:a.panningModel}),e._pannerAttr={coneInnerAngle:typeof a.pannerAttr.coneInnerAngle<"u"?a.pannerAttr.coneInnerAngle:e._coneInnerAngle,coneOuterAngle:typeof a.pannerAttr.coneOuterAngle<"u"?a.pannerAttr.coneOuterAngle:e._coneOuterAngle,coneOuterGain:typeof a.pannerAttr.coneOuterGain<"u"?a.pannerAttr.coneOuterGain:e._coneOuterGain,distanceModel:typeof a.pannerAttr.distanceModel<"u"?a.pannerAttr.distanceModel:e._distanceModel,maxDistance:typeof a.pannerAttr.maxDistance<"u"?a.pannerAttr.maxDistance:e._maxDistance,refDistance:typeof a.pannerAttr.refDistance<"u"?a.pannerAttr.refDistance:e._refDistance,rolloffFactor:typeof a.pannerAttr.rolloffFactor<"u"?a.pannerAttr.rolloffFactor:e._rolloffFactor,panningModel:typeof a.pannerAttr.panningModel<"u"?a.pannerAttr.panningModel:e._panningModel});else return d=e._soundById(parseInt(o[0],10)),d?d._pannerAttr:e._pannerAttr;else o.length===2&&(a=o[0],s=parseInt(o[1],10));for(var c=e._getSoundIds(s),p=0;p<c.length;p++)if(d=e._soundById(c[p]),d){var m=d._pannerAttr;m={coneInnerAngle:typeof a.coneInnerAngle<"u"?a.coneInnerAngle:m.coneInnerAngle,coneOuterAngle:typeof a.coneOuterAngle<"u"?a.coneOuterAngle:m.coneOuterAngle,coneOuterGain:typeof a.coneOuterGain<"u"?a.coneOuterGain:m.coneOuterGain,distanceModel:typeof a.distanceModel<"u"?a.distanceModel:m.distanceModel,maxDistance:typeof a.maxDistance<"u"?a.maxDistance:m.maxDistance,refDistance:typeof a.refDistance<"u"?a.refDistance:m.refDistance,rolloffFactor:typeof a.rolloffFactor<"u"?a.rolloffFactor:m.rolloffFactor,panningModel:typeof a.panningModel<"u"?a.panningModel:m.panningModel};var v=d._panner;v||(d._pos||(d._pos=e._pos||[0,0,-.5]),i(d,"spatial"),v=d._panner),v.coneInnerAngle=m.coneInnerAngle,v.coneOuterAngle=m.coneOuterAngle,v.coneOuterGain=m.coneOuterGain,v.distanceModel=m.distanceModel,v.maxDistance=m.maxDistance,v.refDistance=m.refDistance,v.rolloffFactor=m.rolloffFactor,v.panningModel=m.panningModel}return e},Sound.prototype.init=function(e){return function(){var o=this,a=o._parent;o._orientation=a._orientation,o._stereo=a._stereo,o._pos=a._pos,o._pannerAttr=a._pannerAttr,e.call(this),o._stereo?a.stereo(o._stereo):o._pos&&a.pos(o._pos[0],o._pos[1],o._pos[2],o._id)}}(Sound.prototype.init),Sound.prototype.reset=function(e){return function(){var o=this,a=o._parent;return o._orientation=a._orientation,o._stereo=a._stereo,o._pos=a._pos,o._pannerAttr=a._pannerAttr,o._stereo?a.stereo(o._stereo):o._pos?a.pos(o._pos[0],o._pos[1],o._pos[2],o._id):o._panner&&(o._panner.disconnect(0),o._panner=void 0,a._refreshBuffer(o)),e.call(this)}}(Sound.prototype.reset);var i=function(e,o){o=o||"spatial",o==="spatial"?(e._panner=Howler.ctx.createPanner(),e._panner.coneInnerAngle=e._pannerAttr.coneInnerAngle,e._panner.coneOuterAngle=e._pannerAttr.coneOuterAngle,e._panner.coneOuterGain=e._pannerAttr.coneOuterGain,e._panner.distanceModel=e._pannerAttr.distanceModel,e._panner.maxDistance=e._pannerAttr.maxDistance,e._panner.refDistance=e._pannerAttr.refDistance,e._panner.rolloffFactor=e._pannerAttr.rolloffFactor,e._panner.panningModel=e._pannerAttr.panningModel,typeof e._panner.positionX<"u"?(e._panner.positionX.setValueAtTime(e._pos[0],Howler.ctx.currentTime),e._panner.positionY.setValueAtTime(e._pos[1],Howler.ctx.currentTime),e._panner.positionZ.setValueAtTime(e._pos[2],Howler.ctx.currentTime)):e._panner.setPosition(e._pos[0],e._pos[1],e._pos[2]),typeof e._panner.orientationX<"u"?(e._panner.orientationX.setValueAtTime(e._orientation[0],Howler.ctx.currentTime),e._panner.orientationY.setValueAtTime(e._orientation[1],Howler.ctx.currentTime),e._panner.orientationZ.setValueAtTime(e._orientation[2],Howler.ctx.currentTime)):e._panner.setOrientation(e._orientation[0],e._orientation[1],e._orientation[2])):(e._panner=Howler.ctx.createStereoPanner(),e._panner.pan.setValueAtTime(e._stereo,Howler.ctx.currentTime)),e._panner.connect(e._node),e._paused||e._parent.pause(e._id,!0).play(e._id,!0)}})()})(Pe);const aa=kt({__proto__:null,default:ra(Pe)},[Pe]);W.default=oa,Object.defineProperties(W,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|