@hkonda/loco-translate 1.1.8 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-Dnjf5Md_.js +67 -0
- package/dist/assets/index-DplHMcYp.css +1 -0
- package/dist/index.html +2 -2
- package/dist-server/routes/textnodes.d.ts.map +1 -1
- package/dist-server/routes/textnodes.js +4 -26
- package/dist-server/routes/textnodes.js.map +1 -1
- package/dist-server/routes/translations.d.ts.map +1 -1
- package/dist-server/routes/translations.js +120 -5
- package/dist-server/routes/translations.js.map +1 -1
- package/dist-server/utils/translation-coverage.d.ts +4 -0
- package/dist-server/utils/translation-coverage.d.ts.map +1 -0
- package/dist-server/utils/translation-coverage.js +39 -0
- package/dist-server/utils/translation-coverage.js.map +1 -0
- package/package.json +1 -1
- package/public/loco.js +1 -1
- package/public/loco.min.js +1 -1
- package/versions.json +1 -1
- package/dist/assets/index-BHEVJJP6.css +0 -1
- package/dist/assets/index-CvE8Vqku.js +0 -69
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var Ff=Object.defineProperty;var jf=(e,t,n)=>t in e?Ff(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Dn=(e,t,n)=>jf(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function je(){}function Nl(e,t){for(const n in t)e[n]=t[n];return e}function xc(e){return e()}function ao(){return Object.create(null)}function rt(e){e.forEach(xc)}function Bi(e){return typeof e=="function"}function Qt(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let gl;function Pl(e,t){return e===t?!0:(gl||(gl=document.createElement("a")),gl.href=t,e===gl.href)}function Bf(e){return Object.keys(e).length===0}function Cc(e,...t){if(e==null){for(const r of t)r(void 0);return je}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function el(e,t,n){e.$$.on_destroy.push(Cc(t,n))}function br(e,t,n){return e.set(n),t}function u(e,t){e.appendChild(t)}function B(e,t,n){e.insertBefore(t,n||null)}function j(e){e.parentNode&&e.parentNode.removeChild(e)}function ft(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function b(e){return document.createElement(e)}function ge(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function F(e){return document.createTextNode(e)}function E(){return F(" ")}function Ct(){return F("")}function $(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function jt(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function jr(e){return function(t){t.target===this&&e.call(this,t)}}function a(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Ac(e){return e===""?null:+e}function Rf(e){return Array.from(e.childNodes)}function ee(e,t){t=""+t,e.data!==t&&(e.data=t)}function Pe(e,t){e.value=t??""}function gt(e,t,n,r){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function yt(e,t,n){for(let r=0;r<e.options.length;r+=1){const l=e.options[r];if(l.__value===t){l.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function tn(e){const t=e.querySelector(":checked");return t&&t.__value}function uo(e,t,n){e.classList.toggle(t,!!n)}function Of(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}class Sc{constructor(t=!1){Dn(this,"is_svg",!1);Dn(this,"e");Dn(this,"n");Dn(this,"t");Dn(this,"a");this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,r=null){this.e||(this.is_svg?this.e=ge(n.nodeName):this.e=b(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(t)),this.i(r)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let n=0;n<this.n.length;n+=1)B(this.t,this.n[n],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(j)}}function zl(e,t){return new e(t)}let tl;function $r(e){tl=e}function $l(){if(!tl)throw new Error("Function called outside component initialization");return tl}function Br(e){$l().$$.on_mount.push(e)}function Uf(e){$l().$$.after_update.push(e)}function Tc(e){$l().$$.on_destroy.push(e)}function Ri(){const e=$l();return(t,n,{cancelable:r=!1}={})=>{const l=e.$$.callbacks[t];if(l){const o=Of(t,n,{cancelable:r});return l.slice().forEach(i=>{i.call(e,o)}),!o.defaultPrevented}return!0}}function Er(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(r=>r.call(this,t))}const kr=[],Vn=[];let Sr=[];const co=[],Mc=Promise.resolve();let xi=!1;function Ec(){xi||(xi=!0,Mc.then(Ic))}function Ir(){return Ec(),Mc}function Dt(e){Sr.push(e)}const ui=new Set;let yr=0;function Ic(){if(yr!==0)return;const e=tl;do{try{for(;yr<kr.length;){const t=kr[yr];yr++,$r(t),Hf(t.$$)}}catch(t){throw kr.length=0,yr=0,t}for($r(null),kr.length=0,yr=0;Vn.length;)Vn.pop()();for(let t=0;t<Sr.length;t+=1){const n=Sr[t];ui.has(n)||(ui.add(n),n())}Sr.length=0}while(kr.length);for(;co.length;)co.pop()();xi=!1,ui.clear(),$r(e)}function Hf(e){if(e.fragment!==null){e.update(),rt(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Dt)}}function Zf(e){const t=[],n=[];Sr.forEach(r=>e.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),Sr=t}const Sl=new Set;let Xn;function Xt(){Xn={r:0,c:[],p:Xn}}function Jt(){Xn.r||rt(Xn.c),Xn=Xn.p}function at(e,t){e&&e.i&&(Sl.delete(e),e.i(t))}function ct(e,t,n,r){if(e&&e.o){if(Sl.has(e))return;Sl.add(e),Xn.c.push(()=>{Sl.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}function Fe(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function Oi(e,t){e.d(1),t.delete(e.key)}function Lc(e,t){ct(e,1,1,()=>{t.delete(e.key)})}function ol(e,t,n,r,l,o,i,s,c,f,d,h){let p=e.length,g=o.length,m=p;const _={};for(;m--;)_[e[m].key]=m;const y=[],v=new Map,w=new Map,C=[];for(m=g;m--;){const L=h(l,o,m),I=n(L);let P=i.get(I);P?C.push(()=>P.p(L,t)):(P=f(I,L),P.c()),v.set(I,y[m]=P),I in _&&w.set(I,Math.abs(m-_[I]))}const x=new Set,A=new Set;function M(L){at(L,1),L.m(s,d),i.set(L.key,L),d=L.first,g--}for(;p&&g;){const L=y[g-1],I=e[p-1],P=L.key,z=I.key;L===I?(d=L.first,p--,g--):v.has(z)?!i.has(P)||x.has(P)?M(L):A.has(z)?p--:w.get(P)>w.get(z)?(A.add(P),M(L)):(x.add(z),p--):(c(I,i),p--)}for(;p--;){const L=e[p];v.has(L.key)||c(L,i)}for(;g;)M(y[g-1]);return rt(C),y}function Dl(e,t){const n={},r={},l={$$scope:1};let o=e.length;for(;o--;){const i=e[o],s=t[o];if(s){for(const c in i)c in s||(r[c]=1);for(const c in s)l[c]||(n[c]=s[c],l[c]=1);e[o]=s}else for(const c in i)l[c]=1}for(const i in r)i in n||(n[i]=void 0);return n}function Fl(e){return typeof e=="object"&&e!==null?e:{}}function nn(e){e&&e.c()}function Kt(e,t,n){const{fragment:r,after_update:l}=e.$$;r&&r.m(t,n),Dt(()=>{const o=e.$$.on_mount.map(xc).filter(Bi);e.$$.on_destroy?e.$$.on_destroy.push(...o):rt(o),e.$$.on_mount=[]}),l.forEach(Dt)}function qt(e,t){const n=e.$$;n.fragment!==null&&(Zf(n.after_update),rt(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Wf(e,t){e.$$.dirty[0]===-1&&(kr.push(e),Ec(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function ln(e,t,n,r,l,o,i=null,s=[-1]){const c=tl;$r(e);const f=e.$$={fragment:null,ctx:[],props:o,update:je,not_equal:l,bound:ao(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(c?c.$$.context:[])),callbacks:ao(),dirty:s,skip_bound:!1,root:t.target||c.$$.root};i&&i(f.root);let d=!1;if(f.ctx=n?n(e,t.props||{},(h,p,...g)=>{const m=g.length?g[0]:p;return f.ctx&&l(f.ctx[h],f.ctx[h]=m)&&(!f.skip_bound&&f.bound[h]&&f.bound[h](m),d&&Wf(e,h)),p}):[],f.update(),d=!0,rt(f.before_update),f.fragment=r?r(f.ctx):!1,t.target){if(t.hydrate){const h=Rf(t.target);f.fragment&&f.fragment.l(h),h.forEach(j)}else f.fragment&&f.fragment.c();t.intro&&at(e.$$.fragment),Kt(e,t.target,t.anchor),Ic()}$r(c)}class on{constructor(){Dn(this,"$$");Dn(this,"$$set")}$destroy(){qt(this,1),this.$destroy=je}$on(t,n){if(!Bi(n))return je;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const l=r.indexOf(n);l!==-1&&r.splice(l,1)}}$set(t){this.$$set&&!Bf(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Yf="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Yf);let Ci=null;function Nc(e){Ci=e}function Ye(e,t={}){const n={...t.headers||{}};return Ci&&(n["X-API-Key"]=Ci),fetch(e,{...t,headers:n})}const vr=[];function Pc(e,t){return{subscribe:Ui(e,t).subscribe}}function Ui(e,t=je){let n;const r=new Set;function l(s){if(Qt(e,s)&&(e=s,n)){const c=!vr.length;for(const f of r)f[1](),vr.push(f,e);if(c){for(let f=0;f<vr.length;f+=2)vr[f][0](vr[f+1]);vr.length=0}}}function o(s){l(s(e))}function i(s,c=je){const f=[s,c];return r.add(f),r.size===1&&(n=t(l,o)||je),s(e),()=>{r.delete(f),r.size===0&&n&&(n(),n=null)}}return{set:l,update:o,subscribe:i}}function zc(e,t,n){const r=!Array.isArray(e),l=r?[e]:e;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const o=t.length<2;return Pc(n,(i,s)=>{let c=!1;const f=[];let d=0,h=je;const p=()=>{if(d)return;h();const m=t(r?f[0]:f,i,s);o?i(m):h=Bi(m)?m:je},g=l.map((m,_)=>Cc(m,y=>{f[_]=y,d&=~(1<<_),c&&p()},()=>{d|=1<<_}));return c=!0,p(),function(){rt(g),h(),c=!1}})}const cn=Ui(null);function Gf(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,l,o,i=[],s="",c=e.split("/");for(c[0]||c.shift();l=c.shift();)n=l[0],n==="*"?(i.push("wild"),s+="/(.*)"):n===":"?(r=l.indexOf("?",1),o=l.indexOf(".",1),i.push(l.substring(1,~r?r:~o?o:l.length)),s+=~r&&!~o?"(?:/([^/]+?))?":"/([^/]+?)",~o&&(s+=(~r?"?":"")+"\\"+l.substring(o))):s+="/"+l;return{keys:i,pattern:new RegExp("^"+s+"/?$","i")}}function Vf(e){let t,n,r;const l=[e[2]];var o=e[0];function i(s,c){let f={};for(let d=0;d<l.length;d+=1)f=Nl(f,l[d]);return c!==void 0&&c&4&&(f=Nl(f,Dl(l,[Fl(s[2])]))),{props:f}}return o&&(t=zl(o,i(e)),t.$on("routeEvent",e[7])),{c(){t&&nn(t.$$.fragment),n=Ct()},m(s,c){t&&Kt(t,s,c),B(s,n,c),r=!0},p(s,c){if(c&1&&o!==(o=s[0])){if(t){Xt();const f=t;ct(f.$$.fragment,1,0,()=>{qt(f,1)}),Jt()}o?(t=zl(o,i(s,c)),t.$on("routeEvent",s[7]),nn(t.$$.fragment),at(t.$$.fragment,1),Kt(t,n.parentNode,n)):t=null}else if(o){const f=c&4?Dl(l,[Fl(s[2])]):{};t.$set(f)}},i(s){r||(t&&at(t.$$.fragment,s),r=!0)},o(s){t&&ct(t.$$.fragment,s),r=!1},d(s){s&&j(n),t&&qt(t,s)}}}function Xf(e){let t,n,r;const l=[{params:e[1]},e[2]];var o=e[0];function i(s,c){let f={};for(let d=0;d<l.length;d+=1)f=Nl(f,l[d]);return c!==void 0&&c&6&&(f=Nl(f,Dl(l,[c&2&&{params:s[1]},c&4&&Fl(s[2])]))),{props:f}}return o&&(t=zl(o,i(e)),t.$on("routeEvent",e[6])),{c(){t&&nn(t.$$.fragment),n=Ct()},m(s,c){t&&Kt(t,s,c),B(s,n,c),r=!0},p(s,c){if(c&1&&o!==(o=s[0])){if(t){Xt();const f=t;ct(f.$$.fragment,1,0,()=>{qt(f,1)}),Jt()}o?(t=zl(o,i(s,c)),t.$on("routeEvent",s[6]),nn(t.$$.fragment),at(t.$$.fragment,1),Kt(t,n.parentNode,n)):t=null}else if(o){const f=c&6?Dl(l,[c&2&&{params:s[1]},c&4&&Fl(s[2])]):{};t.$set(f)}},i(s){r||(t&&at(t.$$.fragment,s),r=!0)},o(s){t&&ct(t.$$.fragment,s),r=!1},d(s){s&&j(n),t&&qt(t,s)}}}function Jf(e){let t,n,r,l;const o=[Xf,Vf],i=[];function s(c,f){return c[1]?0:1}return t=s(e),n=i[t]=o[t](e),{c(){n.c(),r=Ct()},m(c,f){i[t].m(c,f),B(c,r,f),l=!0},p(c,[f]){let d=t;t=s(c),t===d?i[t].p(c,f):(Xt(),ct(i[d],1,1,()=>{i[d]=null}),Jt(),n=i[t],n?n.p(c,f):(n=i[t]=o[t](c),n.c()),at(n,1),n.m(r.parentNode,r))},i(c){l||(at(n),l=!0)},o(c){ct(n),l=!1},d(c){c&&j(r),i[t].d(c)}}}function fo(){const e=window.location.href.indexOf("#/");let t=e>-1?window.location.href.substr(e+1):"/";const n=t.indexOf("?");let r="";return n>-1&&(r=t.substr(n+1),t=t.substr(0,n)),{location:t,querystring:r}}const Hi=Pc(null,function(t){t(fo());const n=()=>{t(fo())};return window.addEventListener("hashchange",n,!1),function(){window.removeEventListener("hashchange",n,!1)}}),Kf=zc(Hi,e=>e.location);zc(Hi,e=>e.querystring);const ho=Ui(void 0);async function xr(e){if(!e||e.length<1||e.charAt(0)!="/"&&e.indexOf("#/")!==0)throw Error("Invalid parameter location");await Ir(),history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=(e.charAt(0)=="#"?"":"#")+e}function qf(e){e?window.scrollTo(e.__svelte_spa_router_scrollX,e.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function Qf(e,t,n){let{routes:r={}}=t,{prefix:l=""}=t,{restoreScrollState:o=!1}=t;class i{constructor(A,M){if(!M||typeof M!="function"&&(typeof M!="object"||M._sveltesparouter!==!0))throw Error("Invalid component object");if(!A||typeof A=="string"&&(A.length<1||A.charAt(0)!="/"&&A.charAt(0)!="*")||typeof A=="object"&&!(A instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:L,keys:I}=Gf(A);this.path=A,typeof M=="object"&&M._sveltesparouter===!0?(this.component=M.component,this.conditions=M.conditions||[],this.userData=M.userData,this.props=M.props||{}):(this.component=()=>Promise.resolve(M),this.conditions=[],this.props={}),this._pattern=L,this._keys=I}match(A){if(l){if(typeof l=="string")if(A.startsWith(l))A=A.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const P=A.match(l);if(P&&P[0])A=A.substr(P[0].length)||"/";else return null}}const M=this._pattern.exec(A);if(M===null)return null;if(this._keys===!1)return M;const L={};let I=0;for(;I<this._keys.length;){try{L[this._keys[I]]=decodeURIComponent(M[I+1]||"")||null}catch{L[this._keys[I]]=null}I++}return L}async checkConditions(A){for(let M=0;M<this.conditions.length;M++)if(!await this.conditions[M](A))return!1;return!0}}const s=[];r instanceof Map?r.forEach((x,A)=>{s.push(new i(A,x))}):Object.keys(r).forEach(x=>{s.push(new i(x,r[x]))});let c=null,f=null,d={};const h=Ri();async function p(x,A){await Ir(),h(x,A)}let g=null,m=null;o&&(m=x=>{x.state&&(x.state.__svelte_spa_router_scrollY||x.state.__svelte_spa_router_scrollX)?g=x.state:g=null},window.addEventListener("popstate",m),Uf(()=>{qf(g)}));let _=null,y=null;const v=Hi.subscribe(async x=>{_=x;let A=0;for(;A<s.length;){const M=s[A].match(x.location);if(!M){A++;continue}const L={route:s[A].path,location:x.location,querystring:x.querystring,userData:s[A].userData,params:M&&typeof M=="object"&&Object.keys(M).length?M:null};if(!await s[A].checkConditions(L)){n(0,c=null),y=null,p("conditionsFailed",L);return}p("routeLoading",Object.assign({},L));const I=s[A].component;if(y!=I){I.loading?(n(0,c=I.loading),y=I,n(1,f=I.loadingParams),n(2,d={}),p("routeLoaded",Object.assign({},L,{component:c,name:c.name,params:f}))):(n(0,c=null),y=null);const P=await I();if(x!=_)return;n(0,c=P&&P.default||P),y=I}M&&typeof M=="object"&&Object.keys(M).length?n(1,f=M):n(1,f=null),n(2,d=s[A].props),p("routeLoaded",Object.assign({},L,{component:c,name:c.name,params:f})).then(()=>{ho.set(f)});return}n(0,c=null),y=null,ho.set(void 0)});Tc(()=>{v(),m&&window.removeEventListener("popstate",m)});function w(x){Er.call(this,e,x)}function C(x){Er.call(this,e,x)}return e.$$set=x=>{"routes"in x&&n(3,r=x.routes),"prefix"in x&&n(4,l=x.prefix),"restoreScrollState"in x&&n(5,o=x.restoreScrollState)},e.$$.update=()=>{e.$$.dirty&32&&(history.scrollRestoration=o?"manual":"auto")},[c,f,d,r,l,o,w,C]}class $f extends on{constructor(t){super(),ln(this,t,Qf,Jf,Qt,{routes:3,prefix:4,restoreScrollState:5})}}function po(e,t,n){const r=e.slice();return r[5]=t[n],r}function go(e){let t,n,r=e[5].icon+"",l,o,i,s,c,f;function d(){return e[3](e[5])}return{c(){t=b("button"),n=b("span"),l=E(),o=b("span"),o.textContent=`${e[5].label}`,i=E(),a(t,"class",s="w-full text-left px-4 py-2.5 flex items-center gap-3 text-sm transition-colors "+(e[0]===e[5].id?"bg-indigo-600 text-white":"text-gray-300 hover:bg-gray-800 hover:text-white"))},m(h,p){B(h,t,p),u(t,n),n.innerHTML=r,u(t,l),u(t,o),u(t,i),c||(f=$(t,"click",d),c=!0)},p(h,p){e=h,p&1&&s!==(s="w-full text-left px-4 py-2.5 flex items-center gap-3 text-sm transition-colors "+(e[0]===e[5].id?"bg-indigo-600 text-white":"text-gray-300 hover:bg-gray-800 hover:text-white"))&&a(t,"class",s)},d(h){h&&j(t),c=!1,f()}}}function ed(e){let t,n,r,l,o,i,s=Fe(e[1]),c=[];for(let f=0;f<s.length;f+=1)c[f]=go(po(e,s,f));return{c(){t=b("aside"),n=b("div"),n.innerHTML=`<a href="/" class="text-lg font-bold flex items-center gap-2 text-white no-underline hover:opacity-80 transition-opacity"><svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" width="28" height="28"><defs><clipPath id="sb-clip"><circle cx="100" cy="100" r="90"></circle></clipPath></defs><circle cx="100" cy="100" r="90" fill="#1a1f2e"></circle><g clip-path="url(#sb-clip)"><g transform="translate(100,108) scale(0.72) translate(-334,-198)"><ellipse cx="310" cy="318" rx="10" ry="38" fill="#2ECC88" transform="rotate(-18 310 318)"></ellipse><ellipse cx="326" cy="326" rx="9" ry="42" fill="#34D99A" transform="rotate(-6 326 326)"></ellipse><ellipse cx="342" cy="328" rx="9" ry="42" fill="#7BC74A" transform="rotate(6 342 328)"></ellipse><ellipse cx="357" cy="320" rx="9" ry="36" fill="#F07040" transform="rotate(18 357 320)"></ellipse><ellipse cx="334" cy="240" rx="62" ry="80" fill="#2ECC88"></ellipse><ellipse cx="334" cy="252" rx="36" ry="52" fill="#D4F4B0"></ellipse><path d="M275 220 Q228 190 232 265 Q248 295 280 285 Q268 255 275 220Z" fill="#3A8FE0"></path><path d="M277 225 Q238 208 240 262 Q252 285 278 277 Q268 252 277 225Z" fill="#6BB3FF" opacity="0.7"></path><path d="M393 220 Q440 190 436 265 Q420 295 388 285 Q400 255 393 220Z" fill="#3A8FE0"></path><path d="M391 225 Q430 208 428 262 Q416 285 390 277 Q400 252 391 225Z" fill="#6BB3FF" opacity="0.7"></path><ellipse cx="334" cy="172" rx="38" ry="30" fill="#2ECC88"></ellipse><circle cx="334" cy="148" r="52" fill="#2ECC88"></circle><ellipse cx="334" cy="118" rx="30" ry="18" fill="#FFB833"></ellipse><circle cx="312" cy="138" r="14" fill="white"></circle><circle cx="315" cy="140" r="9" fill="#2C2C2A"></circle><circle cx="315" cy="140" r="4" fill="#04342C"></circle><circle cx="319" cy="136" r="3.5" fill="white"></circle><circle cx="356" cy="138" r="14" fill="white"></circle><circle cx="353" cy="140" r="9" fill="#2C2C2A"></circle><circle cx="353" cy="140" r="4" fill="#04342C"></circle><circle cx="357" cy="136" r="3.5" fill="white"></circle><path d="M326 155 Q334 144 342 155 Q342 170 334 173 Q326 170 326 155Z" fill="#E8A020"></path><path d="M328 165 Q334 158 340 165 Q340 174 334 176 Q328 174 328 165Z" fill="#A06010"></path><ellipse cx="302" cy="152" rx="12" ry="8" fill="#F07040" opacity="0.8"></ellipse><ellipse cx="366" cy="152" rx="12" ry="8" fill="#F07040" opacity="0.8"></ellipse><path d="M320 100 Q316 68 308 52" stroke="#FFB833" stroke-width="6" fill="none" stroke-linecap="round"></path><path d="M334 97 Q334 64 334 46" stroke="#7BC74A" stroke-width="6" fill="none" stroke-linecap="round"></path><path d="M348 100 Q352 68 360 52" stroke="#F07040" stroke-width="6" fill="none" stroke-linecap="round"></path><circle cx="308" cy="50" r="8" fill="#FFB833"></circle><circle cx="334" cy="44" r="8" fill="#7BC74A"></circle><circle cx="360" cy="50" r="8" fill="#F07040"></circle><rect x="260" y="330" width="168" height="10" rx="5" fill="#8B5E20"></rect><path d="M310 330 L300 350 M310 330 L315 352 M310 330 L325 348" stroke="#A07030" stroke-width="4" fill="none" stroke-linecap="round"></path><path d="M360 330 L350 350 M360 330 L365 352 M360 330 L375 348" stroke="#A07030" stroke-width="4" fill="none" stroke-linecap="round"></path></g></g></svg>
|
|
2
|
+
Loco</a> <p class="text-xs text-gray-400 mt-1">Translation Manager</p>`,r=E(),l=b("nav");for(let f=0;f<c.length;f+=1)c[f].c();o=E(),i=b("div"),i.textContent="Loco v1.0",a(n,"class","p-4 border-b border-gray-700"),a(l,"class","flex-1 py-4"),a(i,"class","p-4 border-t border-gray-700 text-xs text-gray-500"),a(t,"class","w-56 bg-gray-900 text-white flex flex-col min-h-screen shrink-0")},m(f,d){B(f,t,d),u(t,n),u(t,r),u(t,l);for(let h=0;h<c.length;h+=1)c[h]&&c[h].m(l,null);u(t,o),u(t,i)},p(f,[d]){if(d&7){s=Fe(f[1]);let h;for(h=0;h<s.length;h+=1){const p=po(f,s,h);c[h]?c[h].p(p,d):(c[h]=go(p),c[h].c(),c[h].m(l,null))}for(;h<c.length;h+=1)c[h].d(1);c.length=s.length}},i:je,o:je,d(f){f&&j(t),ft(c,f)}}}function td(e,t,n){let{currentView:r="translations"}=t;const l=Ri(),o=[{id:"translations",label:"Translation Manager",icon:'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="#93c5fd" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10A15.3 15.3 0 0 1 12 2z"/></svg>'},{id:"ai-translate",label:"AI Translate",icon:'<svg viewBox="0 0 24 24" width="18" height="18" xmlns="http://www.w3.org/2000/svg"><path d="M12 2L13.5 7.5L19 9L13.5 10.5L12 16L10.5 10.5L5 9L10.5 7.5Z" fill="#FFB833"/><path d="M19 14L20 16.5L22.5 17.5L20 18.5L19 21L18 18.5L15.5 17.5L18 16.5Z" fill="#F07040"/><path d="M5 16L6 18L8 19L6 20L5 22L4 20L2 19L4 18Z" fill="#2ECC88"/></svg>'},{id:"labels",label:"Labels",icon:'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="#f59e0b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"/><line x1="7" y1="7" x2="7.01" y2="7"/></svg>'},{id:"analytics",label:"Analytics",icon:'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="#34d399" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="20" x2="18" y2="10"/><line x1="12" y1="20" x2="12" y2="4"/><line x1="6" y1="20" x2="6" y2="14"/><line x1="2" y1="20" x2="22" y2="20"/></svg>'},{id:"settings",label:"Settings",icon:'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>'}];function i(c){l("navigate",c)}const s=c=>i(c.id);return e.$$set=c=>{"currentView"in c&&n(0,r=c.currentView)},[r,o,i,s]}class nd extends on{constructor(t){super(),ln(this,t,td,ed,Qt,{currentView:0})}}function mo(e,t,n){const r=e.slice();return r[32]=t[n],r}function _o(e){let t,n,r,l,o,i,s,c,f,d=Fe(e[0]),h=[];for(let _=0;_<d.length;_+=1)h[_]=yo(mo(e,d,_));function p(_,y){return _[5]?od:_[4]?id:_[3]?ld:rd}let g=p(e),m=g(e);return{c(){t=b("div"),n=E(),r=b("div"),l=b("div"),l.innerHTML='<p class="text-xs text-gray-400 px-2 py-1 font-medium uppercase tracking-wide">Projects</p>',o=E(),i=b("div");for(let _=0;_<h.length;_+=1)h[_].c();s=E(),m.c(),a(t,"class","fixed inset-0 z-40"),a(l,"class","p-2 border-b border-gray-700"),a(i,"class","max-h-48 overflow-y-auto"),a(r,"class","absolute right-0 top-full mt-1 z-50 bg-gray-900 border border-gray-700 rounded-xl shadow-2xl w-64 overflow-hidden")},m(_,y){B(_,t,y),B(_,n,y),B(_,r,y),u(r,l),u(r,o),u(r,i);for(let v=0;v<h.length;v+=1)h[v]&&h[v].m(i,null);u(r,s),m.m(r,null),c||(f=$(t,"click",e[13]),c=!0)},p(_,y){if(y[0]&18619){d=Fe(_[0]);let v;for(v=0;v<d.length;v+=1){const w=mo(_,d,v);h[v]?h[v].p(w,y):(h[v]=yo(w),h[v].c(),h[v].m(i,null))}for(;v<h.length;v+=1)h[v].d(1);h.length=d.length}g===(g=p(_))&&m?m.p(_,y):(m.d(1),m=g(_),m&&(m.c(),m.m(r,null)))},d(_){_&&(j(t),j(n),j(r)),ft(h,_),m.d(),c=!1,f()}}}function bo(e){let t,n;return{c(){t=ge("svg"),n=ge("path"),a(n,"d","M20 6L9 17l-5-5"),a(t,"viewBox","0 0 24 24"),a(t,"width","14"),a(t,"height","14"),a(t,"fill","none"),a(t,"stroke","currentColor"),a(t,"stroke-width","2.5")},m(r,l){B(r,t,l),u(t,n)},d(r){r&&j(t)}}}function yo(e){var C;let t,n,r,l=e[32].name+"",o,i,s,c,f,d,h,p,g,m,_=e[32].id===((C=e[1])==null?void 0:C.id)&&bo();function y(){return e[19](e[32])}function v(){return e[20](e[32])}function w(){return e[21](e[32])}return{c(){var x;t=b("div"),n=b("button"),r=b("span"),o=F(l),i=E(),_&&_.c(),c=E(),f=b("button"),f.innerHTML='<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg>',d=E(),h=b("button"),h.innerHTML='<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6"></path></svg>',p=E(),a(r,"class","flex-1 truncate"),a(n,"class",s="flex-1 text-left px-2 py-2 rounded-lg text-sm transition-colors flex items-center gap-2 "+(e[32].id===((x=e[1])==null?void 0:x.id)?"bg-indigo-600 text-white":"text-gray-300 hover:bg-gray-800 hover:text-white")),a(f,"class","ml-1 p-1.5 text-gray-600 hover:text-indigo-400 opacity-0 group-hover:opacity-100 transition-all rounded"),a(f,"title","Rename project"),a(h,"class","ml-0.5 p-1.5 text-gray-600 hover:text-red-400 opacity-0 group-hover:opacity-100 transition-all rounded"),a(h,"title","Delete project"),a(t,"class","flex items-center group px-2 py-0.5")},m(x,A){B(x,t,A),u(t,n),u(n,r),u(r,o),u(n,i),_&&_.m(n,null),u(t,c),u(t,f),u(t,d),u(t,h),u(t,p),g||(m=[$(n,"click",y),$(f,"click",jt(v)),$(h,"click",jt(w))],g=!0)},p(x,A){var M,L;e=x,A[0]&1&&l!==(l=e[32].name+"")&&ee(o,l),e[32].id===((M=e[1])==null?void 0:M.id)?_||(_=bo(),_.c(),_.m(n,null)):_&&(_.d(1),_=null),A[0]&3&&s!==(s="flex-1 text-left px-2 py-2 rounded-lg text-sm transition-colors flex items-center gap-2 "+(e[32].id===((L=e[1])==null?void 0:L.id)?"bg-indigo-600 text-white":"text-gray-300 hover:bg-gray-800 hover:text-white"))&&a(n,"class",s)},d(x){x&&j(t),_&&_.d(),g=!1,rt(m)}}}function rd(e){let t,n,r,l;return{c(){t=b("div"),n=b("button"),n.innerHTML=`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>
|
|
3
|
+
New project`,a(n,"class","w-full flex items-center gap-2 px-2 py-2 text-sm text-gray-400 hover:text-white hover:bg-gray-800 rounded-lg transition-colors"),a(t,"class","border-t border-gray-700 p-2")},m(o,i){B(o,t,i),u(t,n),r||(l=$(n,"click",e[30]),r=!0)},p:je,d(o){o&&j(t),r=!1,l()}}}function ld(e){let t,n,r,l,o,i,s,c,f=e[8]?"Creating…":"Create",d,h,p,g,m,_,y=e[11]&&vo(e);return{c(){t=b("div"),n=b("p"),n.textContent="New project",r=E(),y&&y.c(),l=E(),o=b("input"),i=E(),s=b("div"),c=b("button"),d=F(f),p=E(),g=b("button"),g.textContent="Cancel",a(n,"class","text-xs text-gray-400 mb-2 font-medium"),a(o,"type","text"),a(o,"placeholder","Project name"),a(o,"class","w-full bg-gray-800 border border-gray-600 text-white text-sm px-2.5 py-1.5 rounded-lg mb-2 focus:outline-none focus:border-indigo-500"),c.disabled=h=e[8]||!e[6].trim(),a(c,"class","flex-1 bg-indigo-600 hover:bg-indigo-700 text-white text-xs py-1.5 rounded-lg transition-colors disabled:opacity-50"),a(g,"class","flex-1 bg-gray-700 hover:bg-gray-600 text-gray-200 text-xs py-1.5 rounded-lg transition-colors"),a(s,"class","flex gap-2"),a(t,"class","border-t border-gray-700 p-3")},m(v,w){B(v,t,w),u(t,n),u(t,r),y&&y.m(t,null),u(t,l),u(t,o),Pe(o,e[6]),u(t,i),u(t,s),u(s,c),u(c,d),u(s,p),u(s,g),m||(_=[$(o,"input",e[27]),$(o,"keydown",e[28]),$(c,"click",e[15]),$(g,"click",e[29])],m=!0)},p(v,w){v[11]?y?y.p(v,w):(y=vo(v),y.c(),y.m(t,l)):y&&(y.d(1),y=null),w[0]&64&&o.value!==v[6]&&Pe(o,v[6]),w[0]&256&&f!==(f=v[8]?"Creating…":"Create")&&ee(d,f),w[0]&320&&h!==(h=v[8]||!v[6].trim())&&(c.disabled=h)},d(v){v&&j(t),y&&y.d(),m=!1,rt(_)}}}function id(e){let t,n,r,l,o=e[4].name+"",i,s,c,f,d,h,p=e[9]?"Deleting…":"Delete",g,m,_,y,v,w=e[11]&&wo(e);return{c(){t=b("div"),n=b("p"),r=F("Delete "),l=b("strong"),i=F(o),s=F("? This will remove all its data."),c=E(),w&&w.c(),f=E(),d=b("div"),h=b("button"),g=F(p),m=E(),_=b("button"),_.textContent="Cancel",a(n,"class","text-xs text-red-300 mb-2"),h.disabled=e[9],a(h,"class","flex-1 bg-red-600 hover:bg-red-700 text-white text-xs py-1.5 rounded-lg transition-colors disabled:opacity-50"),a(_,"class","flex-1 bg-gray-700 hover:bg-gray-600 text-gray-200 text-xs py-1.5 rounded-lg transition-colors"),a(d,"class","flex gap-2"),a(t,"class","border-t border-gray-700 p-3 bg-red-950/30")},m(C,x){B(C,t,x),u(t,n),u(n,r),u(n,l),u(l,i),u(n,s),u(t,c),w&&w.m(t,null),u(t,f),u(t,d),u(d,h),u(h,g),u(d,m),u(d,_),y||(v=[$(h,"click",e[25]),$(_,"click",e[26])],y=!0)},p(C,x){x[0]&16&&o!==(o=C[4].name+"")&&ee(i,o),C[11]?w?w.p(C,x):(w=wo(C),w.c(),w.m(t,f)):w&&(w.d(1),w=null),x[0]&512&&p!==(p=C[9]?"Deleting…":"Delete")&&ee(g,p),x[0]&512&&(h.disabled=C[9])},d(C){C&&j(t),w&&w.d(),y=!1,rt(v)}}}function od(e){let t,n,r,l,o=e[5].name+"",i,s,c,f,d,h,p,g=e[10]?"Saving…":"Save",m,_,y,v,w,C,x=e[11]&&ko(e);return{c(){t=b("div"),n=b("p"),r=F("Rename "),l=b("strong"),i=F(o),s=E(),x&&x.c(),c=E(),f=b("input"),d=E(),h=b("div"),p=b("button"),m=F(g),y=E(),v=b("button"),v.textContent="Cancel",a(l,"class","text-white"),a(n,"class","text-xs text-gray-400 mb-2 font-medium"),a(f,"type","text"),a(f,"placeholder","New name"),a(f,"class","w-full bg-gray-800 border border-gray-600 text-white text-sm px-2.5 py-1.5 rounded-lg mb-2 focus:outline-none focus:border-indigo-500"),p.disabled=_=e[10]||!e[7].trim(),a(p,"class","flex-1 bg-indigo-600 hover:bg-indigo-700 text-white text-xs py-1.5 rounded-lg transition-colors disabled:opacity-50"),a(v,"class","flex-1 bg-gray-700 hover:bg-gray-600 text-gray-200 text-xs py-1.5 rounded-lg transition-colors"),a(h,"class","flex gap-2"),a(t,"class","border-t border-gray-700 p-3")},m(A,M){B(A,t,M),u(t,n),u(n,r),u(n,l),u(l,i),u(t,s),x&&x.m(t,null),u(t,c),u(t,f),Pe(f,e[7]),u(t,d),u(t,h),u(h,p),u(p,m),u(h,y),u(h,v),w||(C=[$(f,"input",e[22]),$(f,"keydown",e[23]),$(p,"click",e[16]),$(v,"click",e[24])],w=!0)},p(A,M){M[0]&32&&o!==(o=A[5].name+"")&&ee(i,o),A[11]?x?x.p(A,M):(x=ko(A),x.c(),x.m(t,c)):x&&(x.d(1),x=null),M[0]&128&&f.value!==A[7]&&Pe(f,A[7]),M[0]&1024&&g!==(g=A[10]?"Saving…":"Save")&&ee(m,g),M[0]&1152&&_!==(_=A[10]||!A[7].trim())&&(p.disabled=_)},d(A){A&&j(t),x&&x.d(),w=!1,rt(C)}}}function vo(e){let t,n;return{c(){t=b("p"),n=F(e[11]),a(t,"class","text-xs text-red-400 mb-1")},m(r,l){B(r,t,l),u(t,n)},p(r,l){l[0]&2048&&ee(n,r[11])},d(r){r&&j(t)}}}function wo(e){let t,n;return{c(){t=b("p"),n=F(e[11]),a(t,"class","text-xs text-red-400 mb-1")},m(r,l){B(r,t,l),u(t,n)},p(r,l){l[0]&2048&&ee(n,r[11])},d(r){r&&j(t)}}}function ko(e){let t,n;return{c(){t=b("p"),n=F(e[11]),a(t,"class","text-xs text-red-400 mb-1")},m(r,l){B(r,t,l),u(t,n)},p(r,l){l[0]&2048&&ee(n,r[11])},d(r){r&&j(t)}}}function sd(e){var y;let t,n,r,l,o,i,s=(((y=e[1])==null?void 0:y.name)??"Select project")+"",c,f,d,h,p,g,m,_=e[2]&&_o(e);return{c(){t=b("div"),n=b("button"),r=ge("svg"),l=ge("path"),o=E(),i=b("span"),c=F(s),f=E(),d=ge("svg"),h=ge("path"),p=E(),_&&_.c(),a(l,"d","M3 7h18M3 12h18M3 17h18"),a(r,"viewBox","0 0 24 24"),a(r,"width","14"),a(r,"height","14"),a(r,"fill","none"),a(r,"stroke","currentColor"),a(r,"stroke-width","2"),a(r,"stroke-linecap","round"),a(r,"stroke-linejoin","round"),a(i,"class","max-w-[120px] truncate"),a(h,"d","M6 9l6 6 6-6"),a(d,"viewBox","0 0 24 24"),a(d,"width","12"),a(d,"height","12"),a(d,"fill","none"),a(d,"stroke","currentColor"),a(d,"stroke-width","2"),a(d,"stroke-linecap","round"),a(d,"stroke-linejoin","round"),a(d,"class","opacity-60"),a(n,"class","flex items-center gap-2 bg-gray-800 hover:bg-gray-700 text-white text-sm px-3 py-1.5 rounded-lg transition-colors border border-gray-600"),a(n,"title","Switch project"),a(t,"class","relative")},m(v,w){B(v,t,w),u(t,n),u(n,r),u(r,l),u(n,o),u(n,i),u(i,c),u(n,f),u(n,d),u(d,h),u(t,p),_&&_.m(t,null),g||(m=[$(window,"keydown",e[18]),$(n,"click",e[12])],g=!0)},p(v,w){var C;w[0]&2&&s!==(s=(((C=v[1])==null?void 0:C.name)??"Select project")+"")&&ee(c,s),v[2]?_?_.p(v,w):(_=_o(v),_.c(),_.m(t,null)):_&&(_.d(1),_=null)},i:je,o:je,d(v){v&&j(t),_&&_.d(),g=!1,rt(m)}}}function ad(e,t,n){let{projects:r=[]}=t,{currentProject:l=null}=t,o=!1,i=!1,s=null,c=null,f="",d="",h=!1,p=!1,g=!1,m="";const _=Ri();function y(){n(2,o=!o),o||(n(3,i=!1),n(4,s=null),n(5,c=null),n(11,m=""))}function v(){n(2,o=!1),n(3,i=!1),n(4,s=null),n(5,c=null),n(11,m="")}function w(Y){if(Y.id===(l==null?void 0:l.id)){v();return}_("switch",Y),v()}async function C(){if(f.trim()){n(8,h=!0),n(11,m="");try{const Y=await fetch("../api/projects",{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":l==null?void 0:l.api_key},body:JSON.stringify({name:f.trim()})});if(!Y.ok){const H=await Y.json();throw new Error(H.message||"Failed")}const ie=await Y.json();n(6,f=""),n(3,i=!1),_("created",ie)}catch(Y){n(11,m=Y.message)}finally{n(8,h=!1)}}}async function x(){if(!(!d.trim()||!c)){n(10,g=!0),n(11,m="");try{const Y=await fetch("../api/project",{method:"PATCH",headers:{"Content-Type":"application/json","X-API-Key":c.api_key},body:JSON.stringify({name:d.trim()})});if(!Y.ok){const H=await Y.json();throw new Error(H.message||"Failed")}const ie=await Y.json();_("renamed",ie),n(5,c=null)}catch(Y){n(11,m=Y.message)}finally{n(10,g=!1)}}}async function A(Y){n(9,p=!0),n(11,m="");try{const ie=await fetch(`../api/projects/${Y.id}`,{method:"DELETE",headers:{"X-API-Key":l==null?void 0:l.api_key}});if(!ie.ok){const H=await ie.json();throw new Error(H.message||"Failed")}n(4,s=null),_("deleted",Y)}catch(ie){n(11,m=ie.message)}finally{n(9,p=!1)}}function M(Y){Y.key==="Escape"&&v()}const L=Y=>w(Y),I=Y=>{n(5,c=Y),n(7,d=Y.name),n(4,s=null),n(3,i=!1),n(11,m="")},P=Y=>{n(4,s=Y),n(5,c=null),n(3,i=!1),n(11,m="")};function z(){d=this.value,n(7,d)}const R=Y=>Y.key==="Enter"&&x(),T=()=>{n(5,c=null),n(11,m="")},N=()=>A(s),k=()=>{n(4,s=null),n(11,m="")};function D(){f=this.value,n(6,f)}const G=Y=>Y.key==="Enter"&&C(),W=()=>{n(3,i=!1),n(11,m="")},Q=()=>{n(3,i=!0),n(4,s=null),n(11,m="")};return e.$$set=Y=>{"projects"in Y&&n(0,r=Y.projects),"currentProject"in Y&&n(1,l=Y.currentProject)},[r,l,o,i,s,c,f,d,h,p,g,m,y,v,w,C,x,A,M,L,I,P,z,R,T,N,k,D,G,W,Q]}class ud extends on{constructor(t){super(),ln(this,t,ad,sd,Qt,{projects:0,currentProject:1},null,[-1,-1])}}function xo(e,t,n){const r=e.slice();return r[22]=t[n],r}function Co(e){let t,n,r,l=e[3]===1?"":"s",o;return{c(){t=b("span"),n=F(e[3]),r=F(" slot"),o=F(l),a(t,"class","pve-badge svelte-19itaxc")},m(i,s){B(i,t,s),u(t,n),u(t,r),u(t,o)},p(i,s){s&8&&ee(n,i[3]),s&8&&l!==(l=i[3]===1?"":"s")&&ee(o,l)},d(i){i&&j(t)}}}function cd(e){let t,n,r=e[22].originalText+"",l,o,i,s,c,f,d,h,p;function g(){return e[13](e[22])}return{c(){t=b("span"),n=b("span"),l=F(r),o=E(),i=b("button"),s=F("×"),f=E(),a(n,"class","pve-chip-label svelte-19itaxc"),a(i,"class","pve-chip-remove svelte-19itaxc"),a(i,"type","button"),a(i,"title",c="Remove "+e[22].kind+" slot — restores original text"),a(t,"class",d="pve-chip pve-chip--"+e[22].kind+" svelte-19itaxc")},m(m,_){B(m,t,_),u(t,n),u(n,l),u(t,o),u(t,i),u(i,s),u(t,f),h||(p=$(i,"click",g),h=!0)},p(m,_){e=m,_&1&&r!==(r=e[22].originalText+"")&&ee(l,r),_&1&&c!==(c="Remove "+e[22].kind+" slot — restores original text")&&a(i,"title",c),_&1&&d!==(d="pve-chip pve-chip--"+e[22].kind+" svelte-19itaxc")&&a(t,"class",d)},d(m){m&&j(t),h=!1,p()}}}function fd(e){let t,n=e[22].text+"",r,l,o;function i(){return e[12](e[22])}return{c(){var s;t=b("span"),r=F(n),a(t,"class","pve-text-seg svelte-19itaxc"),uo(t,"pve-text-seg--active",((s=e[1])==null?void 0:s.segId)===e[22].id)},m(s,c){B(s,t,c),u(t,r),l||(o=$(t,"mouseup",i),l=!0)},p(s,c){var f;e=s,c&1&&n!==(n=e[22].text+"")&&ee(r,n),c&3&&uo(t,"pve-text-seg--active",((f=e[1])==null?void 0:f.segId)===e[22].id)},d(s){s&&j(t),l=!1,o()}}}function Ao(e,t){let n,r;function l(s,c){return s[22].kind==="plain"?fd:cd}let o=l(t),i=o(t);return{key:e,first:null,c(){n=Ct(),i.c(),r=Ct(),this.first=n},m(s,c){B(s,n,c),i.m(s,c),B(s,r,c)},p(s,c){t=s,o===(o=l(t))&&i?i.p(t,c):(i.d(1),i=o(t),i&&(i.c(),i.m(r.parentNode,r)))},d(s){s&&(j(n),j(r)),i.d(s)}}}function So(e){let t,n,r,l,o=e[1].selectedText+"",i,s,c,f,d,h,p,g,m,_,y,v,w,C;return{c(){t=b("div"),n=b("span"),r=F("Selected: "),l=b("code"),i=F(o),s=E(),c=b("div"),f=b("button"),f.textContent="Text",d=E(),h=b("button"),h.textContent="Number",p=E(),g=b("button"),g.textContent="Decimal",m=E(),_=b("button"),_.textContent="Date",y=E(),v=b("button"),v.textContent="Cancel",a(l,"class","pve-sel-code svelte-19itaxc"),a(n,"class","pve-sel-preview svelte-19itaxc"),a(f,"type","button"),a(f,"class","pve-btn pve-btn-text svelte-19itaxc"),a(h,"type","button"),a(h,"class","pve-btn pve-btn-number svelte-19itaxc"),a(g,"type","button"),a(g,"class","pve-btn pve-btn-decimal svelte-19itaxc"),a(_,"type","button"),a(_,"class","pve-btn pve-btn-date svelte-19itaxc"),a(v,"type","button"),a(v,"class","pve-btn pve-btn-ghost svelte-19itaxc"),a(c,"class","pve-action-bar-btns svelte-19itaxc"),a(t,"class","pve-action-bar svelte-19itaxc")},m(x,A){B(x,t,A),u(t,n),u(n,r),u(n,l),u(l,i),u(t,s),u(t,c),u(c,f),u(c,d),u(c,h),u(c,p),u(c,g),u(c,m),u(c,_),u(c,y),u(c,v),w||(C=[$(f,"click",e[14]),$(h,"click",e[15]),$(g,"click",e[16]),$(_,"click",e[17]),$(v,"click",e[7])],w=!0)},p(x,A){A&2&&o!==(o=x[1].selectedText+"")&&ee(i,o)},d(x){x&&j(t),w=!1,rt(C)}}}function dd(e){let t,n,r,l,o,i,s=[],c=new Map,f,d,h,p,g,m,_,y,v,w,C,x,A=e[3]>0&&Co(e),M=Fe(e[0]);const L=P=>P[22].id;for(let P=0;P<M.length;P+=1){let z=xo(e,M,P),R=L(z);c.set(R,s[P]=Ao(R,z))}let I=e[1]&&So(e);return{c(){t=b("div"),n=b("div"),r=b("span"),r.textContent="Phrase Slot Editor",l=E(),A&&A.c(),o=E(),i=b("div");for(let P=0;P<s.length;P+=1)s[P].c();f=E(),I&&I.c(),d=E(),h=b("div"),p=b("span"),p.textContent="Resulting key",g=E(),m=b("code"),_=F(e[2]),y=E(),v=b("div"),w=b("button"),w.textContent="Save",a(r,"class","pve-title svelte-19itaxc"),a(n,"class","pve-header svelte-19itaxc"),a(i,"class","pve-canvas svelte-19itaxc"),a(p,"class","pve-preview-label svelte-19itaxc"),a(m,"class","pve-preview-code svelte-19itaxc"),a(h,"class","pve-preview svelte-19itaxc"),a(w,"type","button"),a(w,"class","pve-btn pve-btn-primary svelte-19itaxc"),a(v,"class","pve-footer svelte-19itaxc"),a(t,"class","pve svelte-19itaxc")},m(P,z){B(P,t,z),u(t,n),u(n,r),u(n,l),A&&A.m(n,null),u(t,o),u(t,i);for(let R=0;R<s.length;R+=1)s[R]&&s[R].m(i,null);u(t,f),I&&I.m(t,null),u(t,d),u(t,h),u(h,p),u(h,g),u(h,m),u(m,_),u(t,y),u(t,v),u(v,w),C||(x=$(w,"click",e[8]),C=!0)},p(P,[z]){P[3]>0?A?A.p(P,z):(A=Co(P),A.c(),A.m(n,null)):A&&(A.d(1),A=null),z&83&&(M=Fe(P[0]),s=ol(s,z,L,1,P,M,c,i,Oi,Ao,null,xo)),P[1]?I?I.p(P,z):(I=So(P),I.c(),I.m(t,d)):I&&(I.d(1),I=null),z&4&&ee(_,P[2])},i:je,o:je,d(P){P&&j(t),A&&A.d();for(let z=0;z<s.length;z+=1)s[z].d();I&&I.d(),C=!1,x()}}}const hd=/(\{\{(?:text|number|decimal|date):\d+\}\})/g,pd=/^\{\{(text|number|decimal|date):(\d+)\}\}$/;function To(e){return e.map(t=>t.text).join("")}function Mo(e){const t={text:0,number:0,decimal:0,date:0};return e.map(n=>{if(n.kind==="plain")return n;const r=t[n.kind]++;return{...n,slotIndex:r,text:`{{${n.kind}:${r}}}`}})}function gd(e,t,n){let r,l,o=0;function i(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"id-"+Date.now().toString(36)+"-"+ ++o}let{phraseKey:s=""}=t,{varSlots:c=[]}=t,{onSave:f=()=>{}}=t;function d(I){const P={};for(const R of c){const T=R.type||"text";P[`${T}:${R.index}`]=R.originalText}return I.split(hd).filter(R=>R!=="").map(R=>{const T=R.match(pd);if(T){const N=T[1],k=parseInt(T[2],10);return{kind:N,id:i(),slotIndex:k,originalText:P[`${N}:${k}`]??R,text:R}}return{kind:"plain",id:i(),text:R}})}let h=d(s),p=null;function g(I){if(I.kind!=="plain")return;const P=window.getSelection(),z=P?P.toString():"";if(!z){n(1,p=null);return}const R=I.text.indexOf(z);if(R===-1){n(1,p=null);return}n(1,p={segId:I.id,start:R,end:R+z.length,selectedText:z})}function m(I){if(!p)return;const{segId:P,start:z,end:R,selectedText:T}=p,N=h.findIndex(G=>G.id===P);if(N===-1){n(1,p=null);return}const k=h[N],D=[];z>0&&D.push({kind:"plain",id:i(),text:k.text.slice(0,z)}),D.push({kind:I,id:i(),slotIndex:0,originalText:T,text:`{{${I}:0}}`}),R<k.text.length&&D.push({kind:"plain",id:i(),text:k.text.slice(R)}),n(0,h=Mo([...h.slice(0,N),...D,...h.slice(N+1)])),n(1,p=null)}function _(I){const P=h.map(z=>z.id===I&&z.kind!=="plain"?{kind:"plain",id:i(),text:z.originalText}:z);n(0,h=Mo(P))}function y(){var I;n(1,p=null),(I=window.getSelection())==null||I.removeAllRanges()}function v(){const I=To(h),P=h.filter(z=>z.kind!=="plain").map(z=>({type:z.kind,index:z.slotIndex,originalText:z.originalText}));f(I,P)}const w=I=>g(I),C=I=>_(I.id),x=()=>m("text"),A=()=>m("number"),M=()=>m("decimal"),L=()=>m("date");return e.$$set=I=>{"phraseKey"in I&&n(9,s=I.phraseKey),"varSlots"in I&&n(10,c=I.varSlots),"onSave"in I&&n(11,f=I.onSave)},e.$$.update=()=>{e.$$.dirty&1&&n(3,r=h.filter(I=>I.kind!=="plain").length),e.$$.dirty&1&&n(2,l=To(h))},[h,p,l,r,g,m,_,y,v,s,c,f,w,C,x,A,M,L]}class md extends on{constructor(t){super(),ln(this,t,gd,dd,Qt,{phraseKey:9,varSlots:10,onSave:11})}}function Eo(e,t,n){const r=e.slice();return r[16]=t[n],r[17]=t,r[18]=n,r}function Io(e){let t,n;return{c(){t=b("span"),n=F(e[1]),a(t,"class","ml-2 inline-block rounded bg-gray-100 px-1.5 py-0.5 text-[10px] text-gray-600")},m(r,l){B(r,t,l),u(t,n)},p(r,l){l&2&&ee(n,r[1])},d(r){r&&j(t)}}}function Lo(e){let t,n,r=e[16].label+"",l,o,i,s,c,f,d;function h(){e[12].call(i,e[16])}return{c(){t=b("div"),n=b("label"),l=F(r),o=E(),i=b("input"),s=E(),c=b("p"),c.textContent=`${e[16].hint}`,a(n,"class","block text-xs font-medium text-gray-700"),a(n,"for",`aria-${e[16].name}`),a(i,"id",`aria-${e[16].name}`),a(i,"type","text"),a(i,"placeholder",e[16].placeholder),a(i,"class","mt-1 w-full rounded border border-gray-300 px-2 py-1.5 text-sm focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500"),a(c,"class","mt-0.5 text-[11px] text-gray-400")},m(p,g){B(p,t,g),u(t,n),u(n,l),u(t,o),u(t,i),Pe(i,e[2][e[16].name]),u(t,s),u(t,c),f||(d=$(i,"input",h),f=!0)},p(p,g){e=p,g&68&&i.value!==e[2][e[16].name]&&Pe(i,e[2][e[16].name])},d(p){p&&j(t),f=!1,d()}}}function No(e){let t,n;return{c(){t=b("div"),n=F(e[5]),a(t,"class","rounded border border-amber-200 bg-amber-50 px-3 py-2 text-[11px] text-amber-800")},m(r,l){B(r,t,l),u(t,n)},p(r,l){l&32&&ee(n,r[5])},d(r){r&&j(t)}}}function Po(e){let t,n;return{c(){t=b("div"),n=F(e[4]),a(t,"class","rounded border border-red-200 bg-red-50 px-3 py-2 text-[11px] text-red-800")},m(r,l){B(r,t,l),u(t,n)},p(r,l){l&16&&ee(n,r[4])},d(r){r&&j(t)}}}function _d(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,m,_,y,v,w,C,x,A,M,L,I=e[1]&&Io(e),P=Fe(e[6]),z=[];for(let N=0;N<P.length;N+=1)z[N]=Lo(Eo(e,P,N));let R=e[5]&&No(e),T=e[4]&&Po(e);return{c(){t=b("div"),n=b("div"),r=b("span"),r.textContent="Phrase:",l=E(),o=b("span"),i=F(e[0]),s=E(),I&&I.c(),c=E(),f=b("div");for(let N=0;N<z.length;N+=1)z[N].c();d=E(),h=b("label"),p=b("input"),g=E(),m=b("span"),m.innerHTML='<span class="font-medium">aria-hidden="true"</span> — hide from assistive tech (decorative)',_=E(),R&&R.c(),y=E(),T&&T.c(),v=E(),w=b("div"),C=b("button"),C.textContent="Clear all",x=E(),A=b("button"),A.textContent="Save ARIA",a(r,"class","font-medium text-gray-700"),a(o,"class","font-mono break-all"),a(n,"class","text-xs text-gray-500"),a(p,"type","checkbox"),a(p,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(h,"class","flex items-center gap-2 text-sm text-gray-700"),a(f,"class","space-y-3"),a(C,"type","button"),a(C,"class","text-xs text-gray-400 hover:text-red-500"),a(A,"type","button"),a(A,"class","rounded bg-indigo-600 px-4 py-1.5 text-sm font-medium text-white hover:bg-indigo-700"),a(w,"class","flex items-center justify-between pt-1"),a(t,"class","space-y-4")},m(N,k){B(N,t,k),u(t,n),u(n,r),u(n,l),u(n,o),u(o,i),u(n,s),I&&I.m(n,null),u(t,c),u(t,f);for(let D=0;D<z.length;D+=1)z[D]&&z[D].m(f,null);u(f,d),u(f,h),u(h,p),p.checked=e[3],u(h,g),u(h,m),u(t,_),R&&R.m(t,null),u(t,y),T&&T.m(t,null),u(t,v),u(t,w),u(w,C),u(w,x),u(w,A),M||(L=[$(p,"change",e[13]),$(C,"click",e[8]),$(A,"click",e[7])],M=!0)},p(N,[k]){if(k&1&&ee(i,N[0]),N[1]?I?I.p(N,k):(I=Io(N),I.c(),I.m(n,null)):I&&(I.d(1),I=null),k&68){P=Fe(N[6]);let D;for(D=0;D<P.length;D+=1){const G=Eo(N,P,D);z[D]?z[D].p(G,k):(z[D]=Lo(G),z[D].c(),z[D].m(f,d))}for(;D<z.length;D+=1)z[D].d(1);z.length=P.length}k&8&&(p.checked=N[3]),N[5]?R?R.p(N,k):(R=No(N),R.c(),R.m(t,y)):R&&(R.d(1),R=null),N[4]?T?T.p(N,k):(T=Po(N),T.c(),T.m(t,v)):T&&(T.d(1),T=null)},i:je,o:je,d(N){N&&j(t),I&&I.d(),ft(z,N),R&&R.d(),T&&T.d(),M=!1,rt(L)}}}function bd(e,t,n){let r,l,o,{phraseKey:i=""}=t,{context:s=""}=t,{attributes:c={}}=t,{onSave:f=()=>{}}=t;const d=[{name:"aria-label",label:"aria-label",hint:"Accessible name read by screen readers",type:"text",placeholder:"e.g. Close dialog"},{name:"aria-labelledby",label:"aria-labelledby",hint:"ID(s) of element(s) that label this one",type:"text",placeholder:"e.g. heading-id"},{name:"aria-describedby",label:"aria-describedby",hint:"ID(s) of element(s) describing this one",type:"text",placeholder:"e.g. help-text-id"},{name:"role",label:"role",hint:"ARIA role",type:"text",placeholder:"e.g. button, navigation, alert"},{name:"alt",label:"alt",hint:"Alternative text (for images)",type:"text",placeholder:"e.g. Company logo"},{name:"title",label:"title",hint:"Tooltip / advisory text (lowest name priority)",type:"text",placeholder:"e.g. More info"}];function h(){const C={};for(const x of d)C[x.name]=c&&typeof c[x.name]=="string"?c[x.name]:"";return C}let p=h(),g=!!(c&&c["aria-hidden"]==="true");function m(){const C={};for(const x of d){const A=(p[x.name]||"").trim();A&&(C[x.name]=A)}return g&&(C["aria-hidden"]="true"),C}function _(){f(m())}function y(){const C={};for(const x of d)C[x.name]="";n(2,p=C),n(3,g=!1)}function v(C){p[C.name]=this.value,n(2,p)}function w(){g=this.checked,n(3,g)}return e.$$set=C=>{"phraseKey"in C&&n(0,i=C.phraseKey),"context"in C&&n(1,s=C.context),"attributes"in C&&n(9,c=C.attributes),"onSave"in C&&n(10,f=C.onSave)},e.$$.update=()=>{e.$$.dirty&4&&n(11,r=[p["aria-labelledby"]?"aria-labelledby":null,p["aria-label"]?"aria-label":null,p.alt?"alt":null,p.title?"title":null].filter(Boolean)),e.$$.dirty&2048&&n(5,l=r.length>1?`Multiple name sources set — screen readers will use "${r[0]}" and ignore the rest.`:""),e.$$.dirty&2056&&n(4,o=g&&r.length>0?'aria-hidden="true" removes this element from the accessibility tree, so the name above will not be announced.':"")},[i,s,p,g,o,l,d,_,y,c,f,r,v,w]}class yd extends on{constructor(t){super(),ln(this,t,bd,_d,Qt,{phraseKey:0,context:1,attributes:9,onSave:10})}}function zo(e,t,n){const r=e.slice();return r[34]=t[n],r[35]=t,r[36]=n,r}function Do(e,t,n){const r=e.slice();return r[37]=t[n],r}function Fo(e,t,n){const r=e.slice();return r[37]=t[n],r}function jo(e){let t,n,r,l,o;return{c(){t=b("div"),n=b("button"),r=F("AI Translate"),a(n,"class","px-2.5 py-1 text-[11px] rounded border border-indigo-200 text-indigo-700 bg-white hover:bg-indigo-50 disabled:opacity-50 disabled:cursor-not-allowed"),a(n,"title","Open AI translate options"),n.disabled=e[3],a(t,"class","px-3 py-2 border-b border-gray-100 bg-white flex items-center justify-end")},m(i,s){B(i,t,s),u(t,n),u(n,r),l||(o=$(n,"click",jt(e[24])),l=!0)},p(i,s){s[0]&8&&(n.disabled=i[3])},d(i){i&&j(t),l=!1,o()}}}function Bo(e){let t,n,r,l,o,i=e[0].key+"",s,c,f,d;function h(m,_){return m[1]?wd:vd}let p=h(e),g=p(e);return{c(){t=b("div"),n=b("div"),r=b("span"),r.textContent="Master",l=E(),o=b("span"),s=F(i),f=E(),d=b("div"),g.c(),a(r,"class","shrink-0 text-[10px] font-semibold text-indigo-400 uppercase tracking-wider"),a(o,"class","text-sm text-indigo-800 truncate min-w-0"),a(o,"title",c=e[0].key),a(n,"class","min-w-0 flex items-center gap-2"),a(d,"class","min-w-0"),a(t,"class","bg-indigo-50/60 border-b border-indigo-100 px-3 py-2 grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)] gap-3 items-center")},m(m,_){B(m,t,_),u(t,n),u(n,r),u(n,l),u(n,o),u(o,s),u(t,f),u(t,d),g.m(d,null)},p(m,_){_[0]&1&&i!==(i=m[0].key+"")&&ee(s,i),_[0]&1&&c!==(c=m[0].key)&&a(o,"title",c),p===(p=h(m))&&g?g.p(m,_):(g.d(1),g=p(m),g&&(g.c(),g.m(d,null)))},d(m){m&&j(t),g.d()}}}function vd(e){let t,n=(e[0].master_value||"(not translated)")+"",r,l,o;return{c(){t=b("div"),r=F(n),a(t,"class",l="text-sm "+(e[0].master_value?"text-indigo-900 font-medium":"text-gray-300")+" truncate"),a(t,"title",o=e[0].master_value||"(not translated)")},m(i,s){B(i,t,s),u(t,r)},p(i,s){s[0]&1&&n!==(n=(i[0].master_value||"(not translated)")+"")&&ee(r,n),s[0]&1&&l!==(l="text-sm "+(i[0].master_value?"text-indigo-900 font-medium":"text-gray-300")+" truncate")&&a(t,"class",l),s[0]&1&&o!==(o=i[0].master_value||"(not translated)")&&a(t,"title",o)},d(i){i&&j(t)}}}function wd(e){let t,n,r,l;return{c(){t=b("input"),a(t,"class","w-full px-2 py-1.5 border border-indigo-200 rounded text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 bg-white"),t.value=n=e[0].master_value||"",a(t,"placeholder","Fallback translation (no context)…")},m(o,i){B(o,t,i),r||(l=[$(t,"input",e[25]),$(t,"change",e[15])],r=!0)},p(o,i){i[0]&1&&n!==(n=o[0].master_value||"")&&t.value!==n&&(t.value=n)},d(o){o&&j(t),r=!1,rt(l)}}}function Ro(e){let t,n,r,l,o,i;function s(){return e[26](e[34])}return{c(){t=b("button"),n=F("ARIA"),a(t,"class",r="px-1.5 py-0.5 text-[10px] font-semibold rounded transition-colors "+(e[6](e[34])?"text-amber-700 bg-amber-100 hover:bg-amber-200":"text-gray-300 bg-gray-100 hover:bg-gray-200 hover:text-gray-500")),a(t,"title",l=e[6](e[34])?"Edit ARIA accessibility attributes":"Add ARIA accessibility attributes")},m(c,f){B(c,t,f),u(t,n),o||(i=$(t,"click",jt(s)),o=!0)},p(c,f){e=c,f[0]&65&&r!==(r="px-1.5 py-0.5 text-[10px] font-semibold rounded transition-colors "+(e[6](e[34])?"text-amber-700 bg-amber-100 hover:bg-amber-200":"text-gray-300 bg-gray-100 hover:bg-gray-200 hover:text-gray-500"))&&a(t,"class",r),f[0]&65&&l!==(l=e[6](e[34])?"Edit ARIA accessibility attributes":"Add ARIA accessibility attributes")&&a(t,"title",l)},d(c){c&&j(t),o=!1,i()}}}function Oo(e){let t,n=Fe(e[34].labels),r=[];for(let l=0;l<n.length;l+=1)r[l]=Uo(Fo(e,n,l));return{c(){t=b("div");for(let l=0;l<r.length;l+=1)r[l].c();a(t,"class","flex flex-wrap gap-1 mt-0.5")},m(l,o){B(l,t,o);for(let i=0;i<r.length;i+=1)r[i]&&r[i].m(t,null)},p(l,o){if(o[0]&1){n=Fe(l[34].labels);let i;for(i=0;i<n.length;i+=1){const s=Fo(l,n,i);r[i]?r[i].p(s,o):(r[i]=Uo(s),r[i].c(),r[i].m(t,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(l){l&&j(t),ft(r,l)}}}function Uo(e){let t,n=e[37].name+"",r;return{c(){t=b("span"),r=F(n),a(t,"class","inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium text-white"),gt(t,"background-color",e[37].color)},m(l,o){B(l,t,o),u(t,r)},p(l,o){o[0]&1&&n!==(n=l[37].name+"")&&ee(r,n),o[0]&1&>(t,"background-color",l[37].color)},d(l){l&&j(t)}}}function kd(e){let t,n=(e[34].value||"(not translated)")+"",r,l,o;return{c(){t=b("div"),r=F(n),a(t,"class",l="text-sm "+(e[34].value?"text-green-700 font-medium":"text-gray-300")+" truncate"),a(t,"title",o=e[34].value||"(not translated)")},m(i,s){B(i,t,s),u(t,r)},p(i,s){s[0]&1&&n!==(n=(i[34].value||"(not translated)")+"")&&ee(r,n),s[0]&1&&l!==(l="text-sm "+(i[34].value?"text-green-700 font-medium":"text-gray-300")+" truncate")&&a(t,"class",l),s[0]&1&&o!==(o=i[34].value||"(not translated)")&&a(t,"title",o)},d(i){i&&j(t)}}}function xd(e){let t,n,r,l,o;function i(...c){return e[27](e[34],e[35],e[36],...c)}function s(){return e[28](e[34])}return{c(){t=b("input"),a(t,"class",n="w-full px-2 py-1.5 border border-gray-200 rounded text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 "+(e[34].value?"":"bg-amber-50")),t.value=r=e[34].value||"",a(t,"placeholder","Enter translation…")},m(c,f){B(c,t,f),l||(o=[$(t,"input",i),$(t,"change",s),$(t,"click",jt(e[23]))],l=!0)},p(c,f){e=c,f[0]&1&&n!==(n="w-full px-2 py-1.5 border border-gray-200 rounded text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 "+(e[34].value?"":"bg-amber-50"))&&a(t,"class",n),f[0]&1&&r!==(r=e[34].value||"")&&t.value!==r&&(t.value=r)},d(c){c&&j(t),l=!1,rt(o)}}}function Ho(e){let t,n,r;function l(){return e[29](e[34])}return{c(){t=b("button"),t.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" class="w-3.5 h-3.5" viewBox="0 0 20 20" fill="currentColor"><path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"></path></svg>',a(t,"class","p-1 text-gray-300 hover:text-indigo-500 transition-colors rounded"),a(t,"title","Edit vars")},m(o,i){B(o,t,i),n||(r=$(t,"click",jt(l)),n=!0)},p(o,i){e=o},d(o){o&&j(t),n=!1,r()}}}function Zo(e){let t,n,r;function l(){return e[30](e[34])}return{c(){t=b("button"),t.textContent="Details",a(t,"class","px-2.5 py-1 border border-gray-200 rounded text-xs text-gray-600 hover:bg-gray-100 hover:border-gray-300 transition-colors")},m(o,i){B(o,t,i),n||(r=$(t,"click",jt(l)),n=!0)},p(o,i){e=o},d(o){o&&j(t),n=!1,r()}}}function Wo(e){let t,n,r,l,o;function i(){return e[31](e[34])}let s=e[14]===e[34].key_id&&Yo(e);return{c(){t=b("div"),n=b("button"),n.textContent="+ Label",r=E(),s&&s.c(),a(n,"class","px-2 py-1 text-[10px] border border-dashed border-gray-300 rounded text-gray-400 hover:text-indigo-500 hover:border-indigo-300 transition-colors"),a(t,"class","relative")},m(c,f){B(c,t,f),u(t,n),u(t,r),s&&s.m(t,null),l||(o=$(n,"click",jt(i)),l=!0)},p(c,f){e=c,e[14]===e[34].key_id?s?s.p(e,f):(s=Yo(e),s.c(),s.m(t,null)):s&&(s.d(1),s=null)},d(c){c&&j(t),s&&s.d(),l=!1,o()}}}function Yo(e){let t,n,r,l,o,i,s=Fe(e[13]),c=[];for(let d=0;d<s.length;d+=1)c[d]=Vo(Do(e,s,d));let f=e[13].length===0&&Xo();return{c(){t=b("div"),n=E(),r=b("div");for(let d=0;d<c.length;d+=1)c[d].c();l=E(),f&&f.c(),a(t,"class","fixed inset-0 z-40"),a(t,"role","presentation"),a(r,"class","absolute right-0 bottom-full mb-1 w-44 bg-white border border-gray-200 rounded-md shadow-lg z-50 max-h-48 overflow-y-auto")},m(d,h){B(d,t,h),B(d,n,h),B(d,r,h);for(let p=0;p<c.length;p+=1)c[p]&&c[p].m(r,null);u(r,l),f&&f.m(r,null),o||(i=$(t,"click",e[32]),o=!0)},p(d,h){if(h[0]&270337){s=Fe(d[13]);let p;for(p=0;p<s.length;p+=1){const g=Do(d,s,p);c[p]?c[p].p(g,h):(c[p]=Vo(g),c[p].c(),c[p].m(r,l))}for(;p<c.length;p+=1)c[p].d(1);c.length=s.length}d[13].length===0?f||(f=Xo(),f.c(),f.m(r,null)):f&&(f.d(1),f=null)},d(d){d&&(j(t),j(n),j(r)),ft(c,d),f&&f.d(),o=!1,i()}}}function Go(e){let t,n;return{c(){t=ge("svg"),n=ge("path"),a(n,"fill-rule","evenodd"),a(n,"d","M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"),a(n,"clip-rule","evenodd"),a(t,"class","w-3.5 h-3.5 text-indigo-600"),a(t,"viewBox","0 0 20 20"),a(t,"fill","currentColor")},m(r,l){B(r,t,l),u(t,n)},d(r){r&&j(t)}}}function Vo(e){let t,n,r,l,o=e[37].name+"",i,s,c=e[34].labels&&e[34].labels.some(h),f,d;function h(...m){return e[22](e[37],...m)}let p=c&&Go();function g(){return e[33](e[34],e[37])}return{c(){t=b("button"),n=b("span"),r=E(),l=b("span"),i=F(o),s=E(),p&&p.c(),a(n,"class","w-3 h-3 rounded-full shrink-0"),gt(n,"background-color",e[37].color),a(l,"class","flex-1"),a(t,"class","w-full text-left px-3 py-1.5 text-sm hover:bg-gray-50 flex items-center gap-2")},m(m,_){B(m,t,_),u(t,n),u(t,r),u(t,l),u(l,i),u(t,s),p&&p.m(t,null),f||(d=$(t,"click",g),f=!0)},p(m,_){e=m,_[0]&8192&>(n,"background-color",e[37].color),_[0]&8192&&o!==(o=e[37].name+"")&&ee(i,o),_[0]&8193&&(c=e[34].labels&&e[34].labels.some(h)),c?p||(p=Go(),p.c(),p.m(t,null)):p&&(p.d(1),p=null)},d(m){m&&j(t),p&&p.d(),f=!1,d()}}}function Xo(e){let t;return{c(){t=b("p"),t.textContent="No labels yet. Create one in Labels page.",a(t,"class","px-3 py-2 text-xs text-gray-400")},m(n,r){B(n,t,r)},d(n){n&&j(t)}}}function Jo(e,t){let n,r,l,o,i,s=(t[34].context||"Word (no context)")+"",c,f,d,h,p,g,m,_,y,v,w,C=t[5]&&Ro(t),x=t[34].labels&&t[34].labels.length>0&&Oo(t);function A(R,T){return R[1]?xd:kd}let M=A(t),L=M(t),I=t[8]&&Ho(t),P=t[10]&&Zo(t),z=t[12]&&Wo(t);return{key:e,first:null,c(){n=b("div"),r=b("div"),C&&C.c(),l=E(),o=b("div"),i=b("div"),c=F(s),d=E(),x&&x.c(),h=E(),p=b("div"),L.c(),g=E(),m=b("div"),I&&I.c(),_=E(),P&&P.c(),y=E(),z&&z.c(),v=E(),a(i,"class","text-sm text-gray-700 truncate"),a(i,"title",f=t[34].context||"Word (no context)"),a(o,"class","min-w-0"),a(p,"class","min-w-0"),a(m,"class","flex items-center gap-1.5 shrink-0"),a(n,"class",w=(t[36]>0?"border-t border-gray-100":"")+" px-3 py-2 grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto] gap-3 items-center hover:bg-gray-50/60 transition-colors"),this.first=n},m(R,T){B(R,n,T),u(n,r),C&&C.m(r,null),u(n,l),u(n,o),u(o,i),u(i,c),u(o,d),x&&x.m(o,null),u(n,h),u(n,p),L.m(p,null),u(n,g),u(n,m),I&&I.m(m,null),u(m,_),P&&P.m(m,null),u(m,y),z&&z.m(m,null),u(n,v)},p(R,T){t=R,t[5]?C?C.p(t,T):(C=Ro(t),C.c(),C.m(r,null)):C&&(C.d(1),C=null),T[0]&1&&s!==(s=(t[34].context||"Word (no context)")+"")&&ee(c,s),T[0]&1&&f!==(f=t[34].context||"Word (no context)")&&a(i,"title",f),t[34].labels&&t[34].labels.length>0?x?x.p(t,T):(x=Oo(t),x.c(),x.m(o,null)):x&&(x.d(1),x=null),M===(M=A(t))&&L?L.p(t,T):(L.d(1),L=M(t),L&&(L.c(),L.m(p,null))),t[8]?I?I.p(t,T):(I=Ho(t),I.c(),I.m(m,_)):I&&(I.d(1),I=null),t[10]?P?P.p(t,T):(P=Zo(t),P.c(),P.m(m,y)):P&&(P.d(1),P=null),t[12]?z?z.p(t,T):(z=Wo(t),z.c(),z.m(m,null)):z&&(z.d(1),z=null),T[0]&1&&w!==(w=(t[36]>0?"border-t border-gray-100":"")+" px-3 py-2 grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto] gap-3 items-center hover:bg-gray-50/60 transition-colors")&&a(n,"class",w)},d(R){R&&j(n),C&&C.d(),x&&x.d(),L.d(),I&&I.d(),P&&P.d(),z&&z.d()}}}function Cd(e){let t,n,r=e[0].contexts&&e[0].contexts.some(Ko),l,o=[],i=new Map,s=e[2]&&jo(e),c=r&&Bo(e),f=Fe(e[0].contexts);const d=h=>h[34].key_id;for(let h=0;h<f.length;h+=1){let p=zo(e,f,h),g=d(p);i.set(g,o[h]=Jo(g,p))}return{c(){t=b("div"),s&&s.c(),n=E(),c&&c.c(),l=E();for(let h=0;h<o.length;h+=1)o[h].c();a(t,"class","rounded-lg border border-gray-200 bg-white overflow-hidden")},m(h,p){B(h,t,p),s&&s.m(t,null),u(t,n),c&&c.m(t,null),u(t,l);for(let g=0;g<o.length;g+=1)o[g]&&o[g].m(t,null)},p(h,p){h[2]?s?s.p(h,p):(s=jo(h),s.c(),s.m(t,n)):s&&(s.d(1),s=null),p[0]&1&&(r=h[0].contexts&&h[0].contexts.some(Ko)),r?c?c.p(h,p):(c=Bo(h),c.c(),c.m(t,l)):c&&(c.d(1),c=null),p[0]&491491&&(f=Fe(h[0].contexts),o=ol(o,p,d,1,h,f,i,t,Oi,Jo,null,zo))},i:je,o:je,d(h){h&&j(t),s&&s.d(),c&&c.d();for(let p=0;p<o.length;p+=1)o[p].d()}}}const Ko=e=>!!e.context;function Ad(e,t,n){let{group:r}=t,{editable:l=!1}=t,{showAiAction:o=!1}=t,{aiBusy:i=!1}=t,{onAiAction:s=null}=t,{showAria:c=!1}=t,{rowHasAria:f=()=>!1}=t,{onAriaAction:d=null}=t,{showVarEdit:h=!1}=t,{onVarEdit:p=null}=t,{showDetails:g=!1}=t,{onDetails:m=null}=t,{showLabels:_=!1}=t,{allLabels:y=[]}=t,{onToggleLabel:v=null}=t,{onSaveMasterValue:w=null}=t,{onSaveValue:C=null}=t,x=null;function A(){w&&w(r)}function M(H){C&&C(H,r)}function L(H){n(14,x=x===H?null:H)}function I(H,Z){v&&(v(H.key_id,Z,H.labels||[]),n(14,x=null))}const P=(H,Z)=>Z.id===H.id;function z(H){Er.call(this,e,H)}const R=()=>s&&s(r),T=H=>n(0,r.master_value=H.target.value,r),N=H=>d&&d(H),k=(H,Z,re,K)=>n(0,Z[re].value=K.target.value,r),D=H=>M(H),G=H=>p&&p(H),W=H=>m&&m(H),Q=H=>L(H.key_id),Y=()=>n(14,x=null),ie=(H,Z)=>I(H,Z.id);return e.$$set=H=>{"group"in H&&n(0,r=H.group),"editable"in H&&n(1,l=H.editable),"showAiAction"in H&&n(2,o=H.showAiAction),"aiBusy"in H&&n(3,i=H.aiBusy),"onAiAction"in H&&n(4,s=H.onAiAction),"showAria"in H&&n(5,c=H.showAria),"rowHasAria"in H&&n(6,f=H.rowHasAria),"onAriaAction"in H&&n(7,d=H.onAriaAction),"showVarEdit"in H&&n(8,h=H.showVarEdit),"onVarEdit"in H&&n(9,p=H.onVarEdit),"showDetails"in H&&n(10,g=H.showDetails),"onDetails"in H&&n(11,m=H.onDetails),"showLabels"in H&&n(12,_=H.showLabels),"allLabels"in H&&n(13,y=H.allLabels),"onToggleLabel"in H&&n(19,v=H.onToggleLabel),"onSaveMasterValue"in H&&n(20,w=H.onSaveMasterValue),"onSaveValue"in H&&n(21,C=H.onSaveValue)},[r,l,o,i,s,c,f,d,h,p,g,m,_,y,x,A,M,L,I,v,w,C,P,z,R,T,N,k,D,G,W,Q,Y,ie]}class Dc extends on{constructor(t){super(),ln(this,t,Ad,Cd,Qt,{group:0,editable:1,showAiAction:2,aiBusy:3,onAiAction:4,showAria:5,rowHasAria:6,onAriaAction:7,showVarEdit:8,onVarEdit:9,showDetails:10,onDetails:11,showLabels:12,allLabels:13,onToggleLabel:19,onSaveMasterValue:20,onSaveValue:21},null,[-1,-1])}}function qo(e,t,n){const r=e.slice();return r[9]=t[n],r}function Qo(e,t,n){const r=e.slice();return r[9]=t[n],r}function $o(e){let t,n=Fe(e[3]),r=[];for(let l=0;l<n.length;l+=1)r[l]=ls(Qo(e,n,l));return{c(){t=b("div");for(let l=0;l<r.length;l+=1)r[l].c();a(t,"class","mb-4 space-y-3")},m(l,o){B(l,t,o);for(let i=0;i<r.length;i+=1)r[i]&&r[i].m(t,null)},p(l,o){if(o&25){n=Fe(l[3]);let i;for(i=0;i<n.length;i+=1){const s=Qo(l,n,i);r[i]?r[i].p(s,o):(r[i]=ls(s),r[i].c(),r[i].m(t,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(l){l&&j(t),ft(r,l)}}}function es(e){let t,n,r;function l(){return e[6](e[9])}return{c(){t=b("button"),t.textContent="Cancel",a(t,"class","px-3 py-1 text-xs text-red-600 border border-red-300 rounded hover:bg-red-50")},m(o,i){B(o,t,i),n||(r=$(t,"click",l),n=!0)},p(o,i){e=o},d(o){o&&j(t),n=!1,r()}}}function ts(e){let t,n=(e[9].currentItem.source||`#${e[9].currentItem.index}`)+"",r;return{c(){t=F("Processing: "),r=F(n)},m(l,o){B(l,t,o),B(l,r,o)},p(l,o){o&8&&n!==(n=(l[9].currentItem.source||`#${l[9].currentItem.index}`)+"")&&ee(r,n)},d(l){l&&(j(t),j(r))}}}function Sd(e){let t;return{c(){t=F("—")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function Td(e){let t,n=us(e[9].estimatedTimeRemaining)+"",r;return{c(){t=F("ETA: "),r=F(n)},m(l,o){B(l,t,o),B(l,r,o)},p(l,o){o&8&&n!==(n=us(l[9].estimatedTimeRemaining)+"")&&ee(r,n)},d(l){l&&(j(t),j(r))}}}function ns(e){let t,n=e[9].processingRate.toFixed(1)+"",r,l;return{c(){t=F("("),r=F(n),l=F("/s)")},m(o,i){B(o,t,i),B(o,r,i),B(o,l,i)},p(o,i){i&8&&n!==(n=o[9].processingRate.toFixed(1)+"")&&ee(r,n)},d(o){o&&(j(t),j(r),j(l))}}}function rs(e){let t,n=e[9].failed+"",r,l;return{c(){t=b("p"),r=F(n),l=F(" failed"),a(t,"class","text-xs text-yellow-700 mt-1")},m(o,i){B(o,t,i),u(t,r),u(t,l)},p(o,i){i&8&&n!==(n=o[9].failed+"")&&ee(r,n)},d(o){o&&j(t)}}}function ls(e){let t,n,r,l,o=e[4](e[9].status)+"",i,s,c=(e[9].promptName||"Translation Job")+"",f,d,h=e[9].langCode+"",p,g,m,_,y,v,w,C,x,A=e[9].completed+e[9].failed+"",M,L,I=e[9].total+"",P,z,R,T,N,k,D,G,W,Q=e[0]&&es(e),Y=e[9].currentItem&&ts(e);function ie(X,pe){return X[9].estimatedTimeRemaining?Td:Sd}let H=ie(e),Z=H(e),re=e[9].processingRate&&ns(e),K=e[9].failed>0&&rs(e);return{c(){t=b("div"),n=b("div"),r=b("div"),l=b("span"),i=E(),s=b("span"),f=F(c),d=F(" — "),p=F(h),g=E(),Q&&Q.c(),m=E(),_=b("div"),y=b("div"),w=E(),C=b("div"),x=b("span"),M=F(A),L=F(" / "),P=F(I),z=F(" items"),R=E(),T=b("span"),Y&&Y.c(),N=E(),k=b("span"),Z.c(),D=E(),re&&re.c(),G=E(),K&&K.c(),W=E(),a(l,"class","inline-flex items-center"),a(s,"class","text-sm font-medium text-blue-800"),a(r,"class","flex items-center gap-2"),a(n,"class","flex items-center justify-between mb-2"),a(y,"class",v="h-full rounded-full transition-all duration-300 "+(e[9].failed>0?"bg-gradient-to-r from-blue-500 to-yellow-500":"bg-blue-500")),gt(y,"width",(e[9].total>0?(e[9].completed+e[9].failed)/e[9].total*100:0)+"%"),a(_,"class","w-full bg-blue-100 rounded-full h-3 overflow-hidden"),a(C,"class","flex items-center justify-between mt-2 text-xs text-blue-700"),a(t,"class","p-4 bg-blue-50 border border-blue-200 rounded-lg")},m(X,pe){B(X,t,pe),u(t,n),u(n,r),u(r,l),l.innerHTML=o,u(r,i),u(r,s),u(s,f),u(s,d),u(s,p),u(n,g),Q&&Q.m(n,null),u(t,m),u(t,_),u(_,y),u(t,w),u(t,C),u(C,x),u(x,M),u(x,L),u(x,P),u(x,z),u(C,R),u(C,T),Y&&Y.m(T,null),u(C,N),u(C,k),Z.m(k,null),u(k,D),re&&re.m(k,null),u(t,G),K&&K.m(t,null),u(t,W)},p(X,pe){pe&8&&o!==(o=X[4](X[9].status)+"")&&(l.innerHTML=o),pe&8&&c!==(c=(X[9].promptName||"Translation Job")+"")&&ee(f,c),pe&8&&h!==(h=X[9].langCode+"")&&ee(p,h),X[0]?Q?Q.p(X,pe):(Q=es(X),Q.c(),Q.m(n,null)):Q&&(Q.d(1),Q=null),pe&8&&v!==(v="h-full rounded-full transition-all duration-300 "+(X[9].failed>0?"bg-gradient-to-r from-blue-500 to-yellow-500":"bg-blue-500"))&&a(y,"class",v),pe&8&>(y,"width",(X[9].total>0?(X[9].completed+X[9].failed)/X[9].total*100:0)+"%"),pe&8&&A!==(A=X[9].completed+X[9].failed+"")&&ee(M,A),pe&8&&I!==(I=X[9].total+"")&&ee(P,I),X[9].currentItem?Y?Y.p(X,pe):(Y=ts(X),Y.c(),Y.m(T,null)):Y&&(Y.d(1),Y=null),H===(H=ie(X))&&Z?Z.p(X,pe):(Z.d(1),Z=H(X),Z&&(Z.c(),Z.m(k,D))),X[9].processingRate?re?re.p(X,pe):(re=ns(X),re.c(),re.m(k,null)):re&&(re.d(1),re=null),X[9].failed>0?K?K.p(X,pe):(K=rs(X),K.c(),K.m(t,W)):K&&(K.d(1),K=null)},d(X){X&&j(t),Q&&Q.d(),Y&&Y.d(),Z.d(),re&&re.d(),K&&K.d()}}}function is(e){let t,n=Fe(e[2]),r=[];for(let l=0;l<n.length;l+=1)r[l]=ss(qo(e,n,l));return{c(){t=b("div");for(let l=0;l<r.length;l+=1)r[l].c();a(t,"class","mb-4 space-y-2")},m(l,o){B(l,t,o);for(let i=0;i<r.length;i+=1)r[i]&&r[i].m(t,null)},p(l,o){if(o&22){n=Fe(l[2]);let i;for(i=0;i<n.length;i+=1){const s=qo(l,n,i);r[i]?r[i].p(s,o):(r[i]=ss(s),r[i].c(),r[i].m(t,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(l){l&&j(t),ft(r,l)}}}function os(e){let t,n,r;function l(){return e[7](e[9])}return{c(){t=b("button"),t.textContent="×",a(t,"class","w-6 h-6 flex items-center justify-center text-gray-400 hover:text-gray-700 hover:bg-gray-200 rounded text-base"),a(t,"title","Dismiss")},m(o,i){B(o,t,i),n||(r=$(t,"click",jt(l)),n=!0)},p(o,i){e=o},d(o){o&&j(t),n=!1,r()}}}function ss(e){let t,n,r,l=e[4](e[9].status)+"",o,i,s=e[9].status+"",c,f,d,h,p=(e[9].promptName||"Job")+"",g,m,_=e[9].langCode+"",y,v,w,C,x=e[9].completed+"",A,M,L=e[9].total+"",I,P,z,R,T=e[1]&&os(e);return{c(){t=b("div"),n=b("div"),r=b("span"),o=E(),i=b("span"),c=F(s),d=E(),h=b("span"),g=F(p),m=F(" — "),y=F(_),v=E(),w=b("div"),C=b("span"),A=F(x),M=F("/"),I=F(L),P=F(" translated"),z=E(),T&&T.c(),R=E(),a(r,"class","inline-flex items-center"),a(i,"class",f="font-medium "+as(e[9].status)),a(h,"class","text-gray-500"),a(n,"class","flex items-center gap-2"),a(C,"class","text-gray-400"),a(w,"class","flex items-center gap-3"),a(t,"class","p-3 bg-gray-50 border border-gray-200 rounded-lg flex items-center justify-between text-sm")},m(N,k){B(N,t,k),u(t,n),u(n,r),r.innerHTML=l,u(n,o),u(n,i),u(i,c),u(n,d),u(n,h),u(h,g),u(h,m),u(h,y),u(t,v),u(t,w),u(w,C),u(C,A),u(C,M),u(C,I),u(C,P),u(w,z),T&&T.m(w,null),u(t,R)},p(N,k){k&4&&l!==(l=N[4](N[9].status)+"")&&(r.innerHTML=l),k&4&&s!==(s=N[9].status+"")&&ee(c,s),k&4&&f!==(f="font-medium "+as(N[9].status))&&a(i,"class",f),k&4&&p!==(p=(N[9].promptName||"Job")+"")&&ee(g,p),k&4&&_!==(_=N[9].langCode+"")&&ee(y,_),k&4&&x!==(x=N[9].completed+"")&&ee(A,x),k&4&&L!==(L=N[9].total+"")&&ee(I,L),N[1]?T?T.p(N,k):(T=os(N),T.c(),T.m(w,null)):T&&(T.d(1),T=null)},d(N){N&&j(t),T&&T.d()}}}function Md(e){let t,n,r=e[3].length>0&&$o(e),l=e[2].length>0&&is(e);return{c(){r&&r.c(),t=E(),l&&l.c(),n=Ct()},m(o,i){r&&r.m(o,i),B(o,t,i),l&&l.m(o,i),B(o,n,i)},p(o,[i]){o[3].length>0?r?r.p(o,i):(r=$o(o),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null),o[2].length>0?l?l.p(o,i):(l=is(o),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},i:je,o:je,d(o){o&&(j(t),j(n)),r&&r.d(o),l&&l.d(o)}}}function as(e){switch(e){case"running":return"text-blue-600";case"completed":return"text-green-600";case"failed":return"text-red-600";case"cancelled":case"cancelling":return"text-yellow-600";default:return"text-gray-500"}}function us(e){return!e||e<0?"—":e<60?`${Math.ceil(e)}s`:`${Math.floor(e/60)}m ${Math.ceil(e%60)}s`}function Ed(e,t,n){let r,l,{jobs:o=[]}=t,{onCancel:i=null}=t,{onDismiss:s=null}=t;const c={pending:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#6366f1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',running:'<svg class="animate-spin" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#3A8FE0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>',completed:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#2ECC88" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',failed:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',cancelled:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>',cancelling:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>'};function f(p){return c[p]??'<span class="text-gray-400">—</span>'}const d=p=>i(p.id),h=p=>s(p.id);return e.$$set=p=>{"jobs"in p&&n(5,o=p.jobs),"onCancel"in p&&n(0,i=p.onCancel),"onDismiss"in p&&n(1,s=p.onDismiss)},e.$$.update=()=>{e.$$.dirty&32&&n(3,r=o.filter(p=>p.status==="running"||p.status==="pending")),e.$$.dirty&32&&n(2,l=o.filter(p=>p.status==="completed"||p.status==="failed"||p.status==="cancelled").slice(0,1))},[i,s,l,r,f,o,d,h]}class Fc extends on{constructor(t){super(),ln(this,t,Ed,Md,Qt,{jobs:5,onCancel:0,onDismiss:1})}}var ml=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Id(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _l(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var jc={exports:{}};/*!
|
|
4
|
+
|
|
5
|
+
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
|
|
6
|
+
<http://stuartk.com/jszip>
|
|
7
|
+
|
|
8
|
+
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
|
|
9
|
+
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
|
|
10
|
+
|
|
11
|
+
JSZip uses the library pako released under the MIT license :
|
|
12
|
+
https://github.com/nodeca/pako/blob/main/LICENSE
|
|
13
|
+
*/(function(e,t){(function(n){e.exports=n()})(function(){return function n(r,l,o){function i(f,d){if(!l[f]){if(!r[f]){var h=typeof _l=="function"&&_l;if(!d&&h)return h(f,!0);if(s)return s(f,!0);var p=new Error("Cannot find module '"+f+"'");throw p.code="MODULE_NOT_FOUND",p}var g=l[f]={exports:{}};r[f][0].call(g.exports,function(m){var _=r[f][1][m];return i(_||m)},g,g.exports,n,r,l,o)}return l[f].exports}for(var s=typeof _l=="function"&&_l,c=0;c<o.length;c++)i(o[c]);return i}({1:[function(n,r,l){var o=n("./utils"),i=n("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";l.encode=function(c){for(var f,d,h,p,g,m,_,y=[],v=0,w=c.length,C=w,x=o.getTypeOf(c)!=="string";v<c.length;)C=w-v,h=x?(f=c[v++],d=v<w?c[v++]:0,v<w?c[v++]:0):(f=c.charCodeAt(v++),d=v<w?c.charCodeAt(v++):0,v<w?c.charCodeAt(v++):0),p=f>>2,g=(3&f)<<4|d>>4,m=1<C?(15&d)<<2|h>>6:64,_=2<C?63&h:64,y.push(s.charAt(p)+s.charAt(g)+s.charAt(m)+s.charAt(_));return y.join("")},l.decode=function(c){var f,d,h,p,g,m,_=0,y=0,v="data:";if(c.substr(0,v.length)===v)throw new Error("Invalid base64 input, it looks like a data url.");var w,C=3*(c=c.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(c.charAt(c.length-1)===s.charAt(64)&&C--,c.charAt(c.length-2)===s.charAt(64)&&C--,C%1!=0)throw new Error("Invalid base64 input, bad content length.");for(w=i.uint8array?new Uint8Array(0|C):new Array(0|C);_<c.length;)f=s.indexOf(c.charAt(_++))<<2|(p=s.indexOf(c.charAt(_++)))>>4,d=(15&p)<<4|(g=s.indexOf(c.charAt(_++)))>>2,h=(3&g)<<6|(m=s.indexOf(c.charAt(_++))),w[y++]=f,g!==64&&(w[y++]=d),m!==64&&(w[y++]=h);return w}},{"./support":30,"./utils":32}],2:[function(n,r,l){var o=n("./external"),i=n("./stream/DataWorker"),s=n("./stream/Crc32Probe"),c=n("./stream/DataLengthProbe");function f(d,h,p,g,m){this.compressedSize=d,this.uncompressedSize=h,this.crc32=p,this.compression=g,this.compressedContent=m}f.prototype={getContentWorker:function(){var d=new i(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),h=this;return d.on("end",function(){if(this.streamInfo.data_length!==h.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new i(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},f.createWorkerFrom=function(d,h,p){return d.pipe(new s).pipe(new c("uncompressedSize")).pipe(h.compressWorker(p)).pipe(new c("compressedSize")).withStreamInfo("compression",h)},r.exports=f},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,l){var o=n("./stream/GenericWorker");l.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},l.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,l){var o=n("./utils"),i=function(){for(var s,c=[],f=0;f<256;f++){s=f;for(var d=0;d<8;d++)s=1&s?3988292384^s>>>1:s>>>1;c[f]=s}return c}();r.exports=function(s,c){return s!==void 0&&s.length?o.getTypeOf(s)!=="string"?function(f,d,h,p){var g=i,m=p+h;f^=-1;for(var _=p;_<m;_++)f=f>>>8^g[255&(f^d[_])];return-1^f}(0|c,s,s.length,0):function(f,d,h,p){var g=i,m=p+h;f^=-1;for(var _=p;_<m;_++)f=f>>>8^g[255&(f^d.charCodeAt(_))];return-1^f}(0|c,s,s.length,0):0}},{"./utils":32}],5:[function(n,r,l){l.base64=!1,l.binary=!1,l.dir=!1,l.createFolders=!0,l.date=null,l.compression=null,l.compressionOptions=null,l.comment=null,l.unixPermissions=null,l.dosPermissions=null},{}],6:[function(n,r,l){var o=null;o=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:o}},{lie:37}],7:[function(n,r,l){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=n("pako"),s=n("./utils"),c=n("./stream/GenericWorker"),f=o?"uint8array":"array";function d(h,p){c.call(this,"FlateWorker/"+h),this._pako=null,this._pakoAction=h,this._pakoOptions=p,this.meta={}}l.magic="\b\0",s.inherits(d,c),d.prototype.processChunk=function(h){this.meta=h.meta,this._pako===null&&this._createPako(),this._pako.push(s.transformTo(f,h.data),!1)},d.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var h=this;this._pako.onData=function(p){h.push({data:p,meta:h.meta})}},l.compressWorker=function(h){return new d("Deflate",h)},l.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,l){function o(g,m){var _,y="";for(_=0;_<m;_++)y+=String.fromCharCode(255&g),g>>>=8;return y}function i(g,m,_,y,v,w){var C,x,A=g.file,M=g.compression,L=w!==f.utf8encode,I=s.transformTo("string",w(A.name)),P=s.transformTo("string",f.utf8encode(A.name)),z=A.comment,R=s.transformTo("string",w(z)),T=s.transformTo("string",f.utf8encode(z)),N=P.length!==A.name.length,k=T.length!==z.length,D="",G="",W="",Q=A.dir,Y=A.date,ie={crc32:0,compressedSize:0,uncompressedSize:0};m&&!_||(ie.crc32=g.crc32,ie.compressedSize=g.compressedSize,ie.uncompressedSize=g.uncompressedSize);var H=0;m&&(H|=8),L||!N&&!k||(H|=2048);var Z=0,re=0;Q&&(Z|=16),v==="UNIX"?(re=798,Z|=function(X,pe){var we=X;return X||(we=pe?16893:33204),(65535&we)<<16}(A.unixPermissions,Q)):(re=20,Z|=function(X){return 63&(X||0)}(A.dosPermissions)),C=Y.getUTCHours(),C<<=6,C|=Y.getUTCMinutes(),C<<=5,C|=Y.getUTCSeconds()/2,x=Y.getUTCFullYear()-1980,x<<=4,x|=Y.getUTCMonth()+1,x<<=5,x|=Y.getUTCDate(),N&&(G=o(1,1)+o(d(I),4)+P,D+="up"+o(G.length,2)+G),k&&(W=o(1,1)+o(d(R),4)+T,D+="uc"+o(W.length,2)+W);var K="";return K+=`
|
|
14
|
+
\0`,K+=o(H,2),K+=M.magic,K+=o(C,2),K+=o(x,2),K+=o(ie.crc32,4),K+=o(ie.compressedSize,4),K+=o(ie.uncompressedSize,4),K+=o(I.length,2),K+=o(D.length,2),{fileRecord:h.LOCAL_FILE_HEADER+K+I+D,dirRecord:h.CENTRAL_FILE_HEADER+o(re,2)+K+o(R.length,2)+"\0\0\0\0"+o(Z,4)+o(y,4)+I+D+R}}var s=n("../utils"),c=n("../stream/GenericWorker"),f=n("../utf8"),d=n("../crc32"),h=n("../signature");function p(g,m,_,y){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=m,this.zipPlatform=_,this.encodeFileName=y,this.streamFiles=g,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(p,c),p.prototype.push=function(g){var m=g.meta.percent||0,_=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(g):(this.bytesWritten+=g.data.length,c.prototype.push.call(this,{data:g.data,meta:{currentFile:this.currentFile,percent:_?(m+100*(_-y-1))/_:100}}))},p.prototype.openedSource=function(g){this.currentSourceOffset=this.bytesWritten,this.currentFile=g.file.name;var m=this.streamFiles&&!g.file.dir;if(m){var _=i(g,m,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:_.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(g){this.accumulate=!1;var m=this.streamFiles&&!g.file.dir,_=i(g,m,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(_.dirRecord),m)this.push({data:function(y){return h.DATA_DESCRIPTOR+o(y.crc32,4)+o(y.compressedSize,4)+o(y.uncompressedSize,4)}(g),meta:{percent:100}});else for(this.push({data:_.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var g=this.bytesWritten,m=0;m<this.dirRecords.length;m++)this.push({data:this.dirRecords[m],meta:{percent:100}});var _=this.bytesWritten-g,y=function(v,w,C,x,A){var M=s.transformTo("string",A(x));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+o(v,2)+o(v,2)+o(w,4)+o(C,4)+o(M.length,2)+M}(this.dirRecords.length,_,g,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(g){this._sources.push(g);var m=this;return g.on("data",function(_){m.processChunk(_)}),g.on("end",function(){m.closedSource(m.previous.streamInfo),m._sources.length?m.prepareNextSource():m.end()}),g.on("error",function(_){m.error(_)}),this},p.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(g){var m=this._sources;if(!c.prototype.error.call(this,g))return!1;for(var _=0;_<m.length;_++)try{m[_].error(g)}catch{}return!0},p.prototype.lock=function(){c.prototype.lock.call(this);for(var g=this._sources,m=0;m<g.length;m++)g[m].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,l){var o=n("../compressions"),i=n("./ZipFileWorker");l.generateWorker=function(s,c,f){var d=new i(c.streamFiles,f,c.platform,c.encodeFileName),h=0;try{s.forEach(function(p,g){h++;var m=function(w,C){var x=w||C,A=o[x];if(!A)throw new Error(x+" is not a valid compression method !");return A}(g.options.compression,c.compression),_=g.options.compressionOptions||c.compressionOptions||{},y=g.dir,v=g.date;g._compressWorker(m,_).withStreamInfo("file",{name:p,dir:y,date:v,comment:g.comment||"",unixPermissions:g.unixPermissions,dosPermissions:g.dosPermissions}).pipe(d)}),d.entriesCount=h}catch(p){d.error(p)}return d}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,l){function o(){if(!(this instanceof o))return new o;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var i=new o;for(var s in this)typeof this[s]!="function"&&(i[s]=this[s]);return i}}(o.prototype=n("./object")).loadAsync=n("./load"),o.support=n("./support"),o.defaults=n("./defaults"),o.version="3.10.1",o.loadAsync=function(i,s){return new o().loadAsync(i,s)},o.external=n("./external"),r.exports=o},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,l){var o=n("./utils"),i=n("./external"),s=n("./utf8"),c=n("./zipEntries"),f=n("./stream/Crc32Probe"),d=n("./nodejsUtils");function h(p){return new i.Promise(function(g,m){var _=p.decompressed.getContentWorker().pipe(new f);_.on("error",function(y){m(y)}).on("end",function(){_.streamInfo.crc32!==p.decompressed.crc32?m(new Error("Corrupted zip : CRC32 mismatch")):g()}).resume()})}r.exports=function(p,g){var m=this;return g=o.extend(g||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),d.isNode&&d.isStream(p)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):o.prepareContent("the loaded zip file",p,!0,g.optimizedBinaryString,g.base64).then(function(_){var y=new c(g);return y.load(_),y}).then(function(_){var y=[i.Promise.resolve(_)],v=_.files;if(g.checkCRC32)for(var w=0;w<v.length;w++)y.push(h(v[w]));return i.Promise.all(y)}).then(function(_){for(var y=_.shift(),v=y.files,w=0;w<v.length;w++){var C=v[w],x=C.fileNameStr,A=o.resolve(C.fileNameStr);m.file(A,C.decompressed,{binary:!0,optimizedBinaryString:!0,date:C.date,dir:C.dir,comment:C.fileCommentStr.length?C.fileCommentStr:null,unixPermissions:C.unixPermissions,dosPermissions:C.dosPermissions,createFolders:g.createFolders}),C.dir||(m.file(A).unsafeOriginalName=x)}return y.zipComment.length&&(m.comment=y.zipComment),m})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,l){var o=n("../utils"),i=n("../stream/GenericWorker");function s(c,f){i.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(f)}o.inherits(s,i),s.prototype._bindStream=function(c){var f=this;(this._stream=c).pause(),c.on("data",function(d){f.push({data:d,meta:{percent:0}})}).on("error",function(d){f.isPaused?this.generatedError=d:f.error(d)}).on("end",function(){f.isPaused?f._upstreamEnded=!0:f.end()})},s.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,l){var o=n("readable-stream").Readable;function i(s,c,f){o.call(this,c),this._helper=s;var d=this;s.on("data",function(h,p){d.push(h)||d._helper.pause(),f&&f(p)}).on("error",function(h){d.emit("error",h)}).on("end",function(){d.push(null)})}n("../utils").inherits(i,o),i.prototype._read=function(){this._helper.resume()},r.exports=i},{"../utils":32,"readable-stream":16}],14:[function(n,r,l){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(o,i){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(o,i);if(typeof o=="number")throw new Error('The "data" argument must not be a number');return new Buffer(o,i)},allocBuffer:function(o){if(Buffer.alloc)return Buffer.alloc(o);var i=new Buffer(o);return i.fill(0),i},isBuffer:function(o){return Buffer.isBuffer(o)},isStream:function(o){return o&&typeof o.on=="function"&&typeof o.pause=="function"&&typeof o.resume=="function"}}},{}],15:[function(n,r,l){function o(A,M,L){var I,P=s.getTypeOf(M),z=s.extend(L||{},d);z.date=z.date||new Date,z.compression!==null&&(z.compression=z.compression.toUpperCase()),typeof z.unixPermissions=="string"&&(z.unixPermissions=parseInt(z.unixPermissions,8)),z.unixPermissions&&16384&z.unixPermissions&&(z.dir=!0),z.dosPermissions&&16&z.dosPermissions&&(z.dir=!0),z.dir&&(A=v(A)),z.createFolders&&(I=y(A))&&w.call(this,I,!0);var R=P==="string"&&z.binary===!1&&z.base64===!1;L&&L.binary!==void 0||(z.binary=!R),(M instanceof h&&M.uncompressedSize===0||z.dir||!M||M.length===0)&&(z.base64=!1,z.binary=!0,M="",z.compression="STORE",P="string");var T=null;T=M instanceof h||M instanceof c?M:m.isNode&&m.isStream(M)?new _(A,M):s.prepareContent(A,M,z.binary,z.optimizedBinaryString,z.base64);var N=new p(A,T,z);this.files[A]=N}var i=n("./utf8"),s=n("./utils"),c=n("./stream/GenericWorker"),f=n("./stream/StreamHelper"),d=n("./defaults"),h=n("./compressedObject"),p=n("./zipObject"),g=n("./generate"),m=n("./nodejsUtils"),_=n("./nodejs/NodejsStreamInputAdapter"),y=function(A){A.slice(-1)==="/"&&(A=A.substring(0,A.length-1));var M=A.lastIndexOf("/");return 0<M?A.substring(0,M):""},v=function(A){return A.slice(-1)!=="/"&&(A+="/"),A},w=function(A,M){return M=M!==void 0?M:d.createFolders,A=v(A),this.files[A]||o.call(this,A,null,{dir:!0,createFolders:M}),this.files[A]};function C(A){return Object.prototype.toString.call(A)==="[object RegExp]"}var x={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(A){var M,L,I;for(M in this.files)I=this.files[M],(L=M.slice(this.root.length,M.length))&&M.slice(0,this.root.length)===this.root&&A(L,I)},filter:function(A){var M=[];return this.forEach(function(L,I){A(L,I)&&M.push(I)}),M},file:function(A,M,L){if(arguments.length!==1)return A=this.root+A,o.call(this,A,M,L),this;if(C(A)){var I=A;return this.filter(function(z,R){return!R.dir&&I.test(z)})}var P=this.files[this.root+A];return P&&!P.dir?P:null},folder:function(A){if(!A)return this;if(C(A))return this.filter(function(P,z){return z.dir&&A.test(P)});var M=this.root+A,L=w.call(this,M),I=this.clone();return I.root=L.name,I},remove:function(A){A=this.root+A;var M=this.files[A];if(M||(A.slice(-1)!=="/"&&(A+="/"),M=this.files[A]),M&&!M.dir)delete this.files[A];else for(var L=this.filter(function(P,z){return z.name.slice(0,A.length)===A}),I=0;I<L.length;I++)delete this.files[L[I].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(A){var M,L={};try{if((L=s.extend(A||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=L.type.toLowerCase(),L.compression=L.compression.toUpperCase(),L.type==="binarystring"&&(L.type="string"),!L.type)throw new Error("No output type specified.");s.checkSupport(L.type),L.platform!=="darwin"&&L.platform!=="freebsd"&&L.platform!=="linux"&&L.platform!=="sunos"||(L.platform="UNIX"),L.platform==="win32"&&(L.platform="DOS");var I=L.comment||this.comment||"";M=g.generateWorker(this,L,I)}catch(P){(M=new c("error")).error(P)}return new f(M,L.type||"string",L.mimeType)},generateAsync:function(A,M){return this.generateInternalStream(A).accumulate(M)},generateNodeStream:function(A,M){return(A=A||{}).type||(A.type="nodebuffer"),this.generateInternalStream(A).toNodejsStream(M)}};r.exports=x},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,l){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,l){var o=n("./DataReader");function i(s){o.call(this,s);for(var c=0;c<this.data.length;c++)s[c]=255&s[c]}n("../utils").inherits(i,o),i.prototype.byteAt=function(s){return this.data[this.zero+s]},i.prototype.lastIndexOfSignature=function(s){for(var c=s.charCodeAt(0),f=s.charCodeAt(1),d=s.charCodeAt(2),h=s.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===c&&this.data[p+1]===f&&this.data[p+2]===d&&this.data[p+3]===h)return p-this.zero;return-1},i.prototype.readAndCheckSignature=function(s){var c=s.charCodeAt(0),f=s.charCodeAt(1),d=s.charCodeAt(2),h=s.charCodeAt(3),p=this.readData(4);return c===p[0]&&f===p[1]&&d===p[2]&&h===p[3]},i.prototype.readData=function(s){if(this.checkOffset(s),s===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,c},r.exports=i},{"../utils":32,"./DataReader":18}],18:[function(n,r,l){var o=n("../utils");function i(s){this.data=s,this.length=s.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(s){this.checkIndex(this.index+s)},checkIndex:function(s){if(this.length<this.zero+s||s<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+s+"). Corrupted zip ?")},setIndex:function(s){this.checkIndex(s),this.index=s},skip:function(s){this.setIndex(this.index+s)},byteAt:function(){},readInt:function(s){var c,f=0;for(this.checkOffset(s),c=this.index+s-1;c>=this.index;c--)f=(f<<8)+this.byteAt(c);return this.index+=s,f},readString:function(s){return o.transformTo("string",this.readData(s))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var s=this.readInt(4);return new Date(Date.UTC(1980+(s>>25&127),(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(31&s)<<1))}},r.exports=i},{"../utils":32}],19:[function(n,r,l){var o=n("./Uint8ArrayReader");function i(s){o.call(this,s)}n("../utils").inherits(i,o),i.prototype.readData=function(s){this.checkOffset(s);var c=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,c},r.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,l){var o=n("./DataReader");function i(s){o.call(this,s)}n("../utils").inherits(i,o),i.prototype.byteAt=function(s){return this.data.charCodeAt(this.zero+s)},i.prototype.lastIndexOfSignature=function(s){return this.data.lastIndexOf(s)-this.zero},i.prototype.readAndCheckSignature=function(s){return s===this.readData(4)},i.prototype.readData=function(s){this.checkOffset(s);var c=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,c},r.exports=i},{"../utils":32,"./DataReader":18}],21:[function(n,r,l){var o=n("./ArrayReader");function i(s){o.call(this,s)}n("../utils").inherits(i,o),i.prototype.readData=function(s){if(this.checkOffset(s),s===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+s);return this.index+=s,c},r.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,l){var o=n("../utils"),i=n("../support"),s=n("./ArrayReader"),c=n("./StringReader"),f=n("./NodeBufferReader"),d=n("./Uint8ArrayReader");r.exports=function(h){var p=o.getTypeOf(h);return o.checkSupport(p),p!=="string"||i.uint8array?p==="nodebuffer"?new f(h):i.uint8array?new d(o.transformTo("uint8array",h)):new s(o.transformTo("array",h)):new c(h)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,l){l.LOCAL_FILE_HEADER="PK",l.CENTRAL_FILE_HEADER="PK",l.CENTRAL_DIRECTORY_END="PK",l.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",l.ZIP64_CENTRAL_DIRECTORY_END="PK",l.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,l){var o=n("./GenericWorker"),i=n("../utils");function s(c){o.call(this,"ConvertWorker to "+c),this.destType=c}i.inherits(s,o),s.prototype.processChunk=function(c){this.push({data:i.transformTo(this.destType,c.data),meta:c.meta})},r.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,l){var o=n("./GenericWorker"),i=n("../crc32");function s(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(s,o),s.prototype.processChunk=function(c){this.streamInfo.crc32=i(c.data,this.streamInfo.crc32||0),this.push(c)},r.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,l){var o=n("../utils"),i=n("./GenericWorker");function s(c){i.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}o.inherits(s,i),s.prototype.processChunk=function(c){if(c){var f=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=f+c.data.length}i.prototype.processChunk.call(this,c)},r.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,l){var o=n("../utils"),i=n("./GenericWorker");function s(c){i.call(this,"DataWorker");var f=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(d){f.dataIsReady=!0,f.data=d,f.max=d&&d.length||0,f.type=o.getTypeOf(d),f.isPaused||f._tickAndRepeat()},function(d){f.error(d)})}o.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,f=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,f);break;case"uint8array":c=this.data.subarray(this.index,f);break;case"array":case"nodebuffer":c=this.data.slice(this.index,f)}return this.index=f,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,l){function o(i){this.name=i||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,s){return this._listeners[i].push(s),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,s){if(this._listeners[i])for(var c=0;c<this._listeners[i].length;c++)this._listeners[i][c].call(this,s)},pipe:function(i){return i.registerPrevious(this)},registerPrevious:function(i){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=i.streamInfo,this.mergeStreamInfo(),this.previous=i;var s=this;return i.on("data",function(c){s.processChunk(c)}),i.on("end",function(){s.end()}),i.on("error",function(c){s.error(c)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var i=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),i=!0),this.previous&&this.previous.resume(),!i},flush:function(){},processChunk:function(i){this.push(i)},withStreamInfo:function(i,s){return this.extraStreamInfo[i]=s,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var i in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,i)&&(this.streamInfo[i]=this.extraStreamInfo[i])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var i="Worker "+this.name;return this.previous?this.previous+" -> "+i:i}},r.exports=o},{}],29:[function(n,r,l){var o=n("../utils"),i=n("./ConvertWorker"),s=n("./GenericWorker"),c=n("../base64"),f=n("../support"),d=n("../external"),h=null;if(f.nodestream)try{h=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(m,_){return new d.Promise(function(y,v){var w=[],C=m._internalType,x=m._outputType,A=m._mimeType;m.on("data",function(M,L){w.push(M),_&&_(L)}).on("error",function(M){w=[],v(M)}).on("end",function(){try{var M=function(L,I,P){switch(L){case"blob":return o.newBlob(o.transformTo("arraybuffer",I),P);case"base64":return c.encode(I);default:return o.transformTo(L,I)}}(x,function(L,I){var P,z=0,R=null,T=0;for(P=0;P<I.length;P++)T+=I[P].length;switch(L){case"string":return I.join("");case"array":return Array.prototype.concat.apply([],I);case"uint8array":for(R=new Uint8Array(T),P=0;P<I.length;P++)R.set(I[P],z),z+=I[P].length;return R;case"nodebuffer":return Buffer.concat(I);default:throw new Error("concat : unsupported type '"+L+"'")}}(C,w),A);y(M)}catch(L){v(L)}w=[]}).resume()})}function g(m,_,y){var v=_;switch(_){case"blob":case"arraybuffer":v="uint8array";break;case"base64":v="string"}try{this._internalType=v,this._outputType=_,this._mimeType=y,o.checkSupport(v),this._worker=m.pipe(new i(v)),m.lock()}catch(w){this._worker=new s("error"),this._worker.error(w)}}g.prototype={accumulate:function(m){return p(this,m)},on:function(m,_){var y=this;return m==="data"?this._worker.on(m,function(v){_.call(y,v.data,v.meta)}):this._worker.on(m,function(){o.delay(_,arguments,y)}),this},resume:function(){return o.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(m){if(o.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new h(this,{objectMode:this._outputType!=="nodebuffer"},m)}},r.exports=g},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,l){if(l.base64=!0,l.array=!0,l.string=!0,l.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",l.nodebuffer=typeof Buffer<"u",l.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")l.blob=!1;else{var o=new ArrayBuffer(0);try{l.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(o),l.blob=i.getBlob("application/zip").size===0}catch{l.blob=!1}}}try{l.nodestream=!!n("readable-stream").Readable}catch{l.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,l){for(var o=n("./utils"),i=n("./support"),s=n("./nodejsUtils"),c=n("./stream/GenericWorker"),f=new Array(256),d=0;d<256;d++)f[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;f[254]=f[254]=1;function h(){c.call(this,"utf-8 decode"),this.leftOver=null}function p(){c.call(this,"utf-8 encode")}l.utf8encode=function(g){return i.nodebuffer?s.newBufferFrom(g,"utf-8"):function(m){var _,y,v,w,C,x=m.length,A=0;for(w=0;w<x;w++)(64512&(y=m.charCodeAt(w)))==55296&&w+1<x&&(64512&(v=m.charCodeAt(w+1)))==56320&&(y=65536+(y-55296<<10)+(v-56320),w++),A+=y<128?1:y<2048?2:y<65536?3:4;for(_=i.uint8array?new Uint8Array(A):new Array(A),w=C=0;C<A;w++)(64512&(y=m.charCodeAt(w)))==55296&&w+1<x&&(64512&(v=m.charCodeAt(w+1)))==56320&&(y=65536+(y-55296<<10)+(v-56320),w++),y<128?_[C++]=y:(y<2048?_[C++]=192|y>>>6:(y<65536?_[C++]=224|y>>>12:(_[C++]=240|y>>>18,_[C++]=128|y>>>12&63),_[C++]=128|y>>>6&63),_[C++]=128|63&y);return _}(g)},l.utf8decode=function(g){return i.nodebuffer?o.transformTo("nodebuffer",g).toString("utf-8"):function(m){var _,y,v,w,C=m.length,x=new Array(2*C);for(_=y=0;_<C;)if((v=m[_++])<128)x[y++]=v;else if(4<(w=f[v]))x[y++]=65533,_+=w-1;else{for(v&=w===2?31:w===3?15:7;1<w&&_<C;)v=v<<6|63&m[_++],w--;1<w?x[y++]=65533:v<65536?x[y++]=v:(v-=65536,x[y++]=55296|v>>10&1023,x[y++]=56320|1023&v)}return x.length!==y&&(x.subarray?x=x.subarray(0,y):x.length=y),o.applyFromCharCode(x)}(g=o.transformTo(i.uint8array?"uint8array":"array",g))},o.inherits(h,c),h.prototype.processChunk=function(g){var m=o.transformTo(i.uint8array?"uint8array":"array",g.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var _=m;(m=new Uint8Array(_.length+this.leftOver.length)).set(this.leftOver,0),m.set(_,this.leftOver.length)}else m=this.leftOver.concat(m);this.leftOver=null}var y=function(w,C){var x;for((C=C||w.length)>w.length&&(C=w.length),x=C-1;0<=x&&(192&w[x])==128;)x--;return x<0||x===0?C:x+f[w[x]]>C?x:C}(m),v=m;y!==m.length&&(i.uint8array?(v=m.subarray(0,y),this.leftOver=m.subarray(y,m.length)):(v=m.slice(0,y),this.leftOver=m.slice(y,m.length))),this.push({data:l.utf8decode(v),meta:g.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:l.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},l.Utf8DecodeWorker=h,o.inherits(p,c),p.prototype.processChunk=function(g){this.push({data:l.utf8encode(g.data),meta:g.meta})},l.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,l){var o=n("./support"),i=n("./base64"),s=n("./nodejsUtils"),c=n("./external");function f(_){return _}function d(_,y){for(var v=0;v<_.length;++v)y[v]=255&_.charCodeAt(v);return y}n("setimmediate"),l.newBlob=function(_,y){l.checkSupport("blob");try{return new Blob([_],{type:y})}catch{try{var v=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return v.append(_),v.getBlob(y)}catch{throw new Error("Bug : can't construct the Blob.")}}};var h={stringifyByChunk:function(_,y,v){var w=[],C=0,x=_.length;if(x<=v)return String.fromCharCode.apply(null,_);for(;C<x;)y==="array"||y==="nodebuffer"?w.push(String.fromCharCode.apply(null,_.slice(C,Math.min(C+v,x)))):w.push(String.fromCharCode.apply(null,_.subarray(C,Math.min(C+v,x)))),C+=v;return w.join("")},stringifyByChar:function(_){for(var y="",v=0;v<_.length;v++)y+=String.fromCharCode(_[v]);return y},applyCanBeUsed:{uint8array:function(){try{return o.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return o.nodebuffer&&String.fromCharCode.apply(null,s.allocBuffer(1)).length===1}catch{return!1}}()}};function p(_){var y=65536,v=l.getTypeOf(_),w=!0;if(v==="uint8array"?w=h.applyCanBeUsed.uint8array:v==="nodebuffer"&&(w=h.applyCanBeUsed.nodebuffer),w)for(;1<y;)try{return h.stringifyByChunk(_,v,y)}catch{y=Math.floor(y/2)}return h.stringifyByChar(_)}function g(_,y){for(var v=0;v<_.length;v++)y[v]=_[v];return y}l.applyFromCharCode=p;var m={};m.string={string:f,array:function(_){return d(_,new Array(_.length))},arraybuffer:function(_){return m.string.uint8array(_).buffer},uint8array:function(_){return d(_,new Uint8Array(_.length))},nodebuffer:function(_){return d(_,s.allocBuffer(_.length))}},m.array={string:p,array:f,arraybuffer:function(_){return new Uint8Array(_).buffer},uint8array:function(_){return new Uint8Array(_)},nodebuffer:function(_){return s.newBufferFrom(_)}},m.arraybuffer={string:function(_){return p(new Uint8Array(_))},array:function(_){return g(new Uint8Array(_),new Array(_.byteLength))},arraybuffer:f,uint8array:function(_){return new Uint8Array(_)},nodebuffer:function(_){return s.newBufferFrom(new Uint8Array(_))}},m.uint8array={string:p,array:function(_){return g(_,new Array(_.length))},arraybuffer:function(_){return _.buffer},uint8array:f,nodebuffer:function(_){return s.newBufferFrom(_)}},m.nodebuffer={string:p,array:function(_){return g(_,new Array(_.length))},arraybuffer:function(_){return m.nodebuffer.uint8array(_).buffer},uint8array:function(_){return g(_,new Uint8Array(_.length))},nodebuffer:f},l.transformTo=function(_,y){if(y=y||"",!_)return y;l.checkSupport(_);var v=l.getTypeOf(y);return m[v][_](y)},l.resolve=function(_){for(var y=_.split("/"),v=[],w=0;w<y.length;w++){var C=y[w];C==="."||C===""&&w!==0&&w!==y.length-1||(C===".."?v.pop():v.push(C))}return v.join("/")},l.getTypeOf=function(_){return typeof _=="string"?"string":Object.prototype.toString.call(_)==="[object Array]"?"array":o.nodebuffer&&s.isBuffer(_)?"nodebuffer":o.uint8array&&_ instanceof Uint8Array?"uint8array":o.arraybuffer&&_ instanceof ArrayBuffer?"arraybuffer":void 0},l.checkSupport=function(_){if(!o[_.toLowerCase()])throw new Error(_+" is not supported by this platform")},l.MAX_VALUE_16BITS=65535,l.MAX_VALUE_32BITS=-1,l.pretty=function(_){var y,v,w="";for(v=0;v<(_||"").length;v++)w+="\\x"+((y=_.charCodeAt(v))<16?"0":"")+y.toString(16).toUpperCase();return w},l.delay=function(_,y,v){setImmediate(function(){_.apply(v||null,y||[])})},l.inherits=function(_,y){function v(){}v.prototype=y.prototype,_.prototype=new v},l.extend=function(){var _,y,v={};for(_=0;_<arguments.length;_++)for(y in arguments[_])Object.prototype.hasOwnProperty.call(arguments[_],y)&&v[y]===void 0&&(v[y]=arguments[_][y]);return v},l.prepareContent=function(_,y,v,w,C){return c.Promise.resolve(y).then(function(x){return o.blob&&(x instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(x))!==-1)&&typeof FileReader<"u"?new c.Promise(function(A,M){var L=new FileReader;L.onload=function(I){A(I.target.result)},L.onerror=function(I){M(I.target.error)},L.readAsArrayBuffer(x)}):x}).then(function(x){var A=l.getTypeOf(x);return A?(A==="arraybuffer"?x=l.transformTo("uint8array",x):A==="string"&&(C?x=i.decode(x):v&&w!==!0&&(x=function(M){return d(M,o.uint8array?new Uint8Array(M.length):new Array(M.length))}(x))),x):c.Promise.reject(new Error("Can't read the data of '"+_+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,l){var o=n("./reader/readerFor"),i=n("./utils"),s=n("./signature"),c=n("./zipEntry"),f=n("./support");function d(h){this.files=[],this.loadOptions=h}d.prototype={checkSignature:function(h){if(!this.reader.readAndCheckSignature(h)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(p)+", expected "+i.pretty(h)+")")}},isSignature:function(h,p){var g=this.reader.index;this.reader.setIndex(h);var m=this.reader.readString(4)===p;return this.reader.setIndex(g),m},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var h=this.reader.readData(this.zipCommentLength),p=f.uint8array?"uint8array":"array",g=i.transformTo(p,h);this.zipComment=this.loadOptions.decodeFileName(g)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var h,p,g,m=this.zip64EndOfCentralSize-44;0<m;)h=this.reader.readInt(2),p=this.reader.readInt(4),g=this.reader.readData(p),this.zip64ExtensibleData[h]={id:h,length:p,value:g}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var h,p;for(h=0;h<this.files.length;h++)p=this.files[h],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var h;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(h=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(h);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var h=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(h<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(h);var p=h;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(h=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(h),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var g=this.centralDirOffset+this.centralDirSize;this.zip64&&(g+=20,g+=12+this.zip64EndOfCentralSize);var m=p-g;if(0<m)this.isSignature(p,s.CENTRAL_FILE_HEADER)||(this.reader.zero=m);else if(m<0)throw new Error("Corrupted zip: missing "+Math.abs(m)+" bytes.")},prepareReader:function(h){this.reader=o(h)},load:function(h){this.prepareReader(h),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,l){var o=n("./reader/readerFor"),i=n("./utils"),s=n("./compressedObject"),c=n("./crc32"),f=n("./utf8"),d=n("./compressions"),h=n("./support");function p(g,m){this.options=g,this.loadOptions=m}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(g){var m,_;if(g.skip(22),this.fileNameLength=g.readInt(2),_=g.readInt(2),this.fileName=g.readData(this.fileNameLength),g.skip(_),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((m=function(y){for(var v in d)if(Object.prototype.hasOwnProperty.call(d,v)&&d[v].magic===y)return d[v];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,m,g.readData(this.compressedSize))},readCentralPart:function(g){this.versionMadeBy=g.readInt(2),g.skip(2),this.bitFlag=g.readInt(2),this.compressionMethod=g.readString(2),this.date=g.readDate(),this.crc32=g.readInt(4),this.compressedSize=g.readInt(4),this.uncompressedSize=g.readInt(4);var m=g.readInt(2);if(this.extraFieldsLength=g.readInt(2),this.fileCommentLength=g.readInt(2),this.diskNumberStart=g.readInt(2),this.internalFileAttributes=g.readInt(2),this.externalFileAttributes=g.readInt(4),this.localHeaderOffset=g.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");g.skip(m),this.readExtraFields(g),this.parseZIP64ExtraField(g),this.fileComment=g.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var g=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),g==0&&(this.dosPermissions=63&this.externalFileAttributes),g==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var g=o(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=g.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=g.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=g.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=g.readInt(4))}},readExtraFields:function(g){var m,_,y,v=g.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});g.index+4<v;)m=g.readInt(2),_=g.readInt(2),y=g.readData(_),this.extraFields[m]={id:m,length:_,value:y};g.setIndex(v)},handleUTF8:function(){var g=h.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=f.utf8decode(this.fileName),this.fileCommentStr=f.utf8decode(this.fileComment);else{var m=this.findExtraFieldUnicodePath();if(m!==null)this.fileNameStr=m;else{var _=i.transformTo(g,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(_)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var v=i.transformTo(g,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(v)}}},findExtraFieldUnicodePath:function(){var g=this.extraFields[28789];if(g){var m=o(g.value);return m.readInt(1)!==1||c(this.fileName)!==m.readInt(4)?null:f.utf8decode(m.readData(g.length-5))}return null},findExtraFieldUnicodeComment:function(){var g=this.extraFields[25461];if(g){var m=o(g.value);return m.readInt(1)!==1||c(this.fileComment)!==m.readInt(4)?null:f.utf8decode(m.readData(g.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,l){function o(m,_,y){this.name=m,this.dir=y.dir,this.date=y.date,this.comment=y.comment,this.unixPermissions=y.unixPermissions,this.dosPermissions=y.dosPermissions,this._data=_,this._dataBinary=y.binary,this.options={compression:y.compression,compressionOptions:y.compressionOptions}}var i=n("./stream/StreamHelper"),s=n("./stream/DataWorker"),c=n("./utf8"),f=n("./compressedObject"),d=n("./stream/GenericWorker");o.prototype={internalStream:function(m){var _=null,y="string";try{if(!m)throw new Error("No output type specified.");var v=(y=m.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),_=this._decompressWorker();var w=!this._dataBinary;w&&!v&&(_=_.pipe(new c.Utf8EncodeWorker)),!w&&v&&(_=_.pipe(new c.Utf8DecodeWorker))}catch(C){(_=new d("error")).error(C)}return new i(_,y,"")},async:function(m,_){return this.internalStream(m).accumulate(_)},nodeStream:function(m,_){return this.internalStream(m||"nodebuffer").toNodejsStream(_)},_compressWorker:function(m,_){if(this._data instanceof f&&this._data.compression.magic===m.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new c.Utf8EncodeWorker)),f.createWorkerFrom(y,m,_)},_decompressWorker:function(){return this._data instanceof f?this._data.getContentWorker():this._data instanceof d?this._data:new s(this._data)}};for(var h=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},g=0;g<h.length;g++)o.prototype[h[g]]=p;r.exports=o},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,l){(function(o){var i,s,c=o.MutationObserver||o.WebKitMutationObserver;if(c){var f=0,d=new c(m),h=o.document.createTextNode("");d.observe(h,{characterData:!0}),i=function(){h.data=f=++f%2}}else if(o.setImmediate||o.MessageChannel===void 0)i="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var _=o.document.createElement("script");_.onreadystatechange=function(){m(),_.onreadystatechange=null,_.parentNode.removeChild(_),_=null},o.document.documentElement.appendChild(_)}:function(){setTimeout(m,0)};else{var p=new o.MessageChannel;p.port1.onmessage=m,i=function(){p.port2.postMessage(0)}}var g=[];function m(){var _,y;s=!0;for(var v=g.length;v;){for(y=g,g=[],_=-1;++_<v;)y[_]();v=g.length}s=!1}r.exports=function(_){g.push(_)!==1||s||i()}}).call(this,typeof ml<"u"?ml:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,l){var o=n("immediate");function i(){}var s={},c=["REJECTED"],f=["FULFILLED"],d=["PENDING"];function h(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,v!==i&&_(this,v)}function p(v,w,C){this.promise=v,typeof w=="function"&&(this.onFulfilled=w,this.callFulfilled=this.otherCallFulfilled),typeof C=="function"&&(this.onRejected=C,this.callRejected=this.otherCallRejected)}function g(v,w,C){o(function(){var x;try{x=w(C)}catch(A){return s.reject(v,A)}x===v?s.reject(v,new TypeError("Cannot resolve promise with itself")):s.resolve(v,x)})}function m(v){var w=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof w=="function")return function(){w.apply(v,arguments)}}function _(v,w){var C=!1;function x(L){C||(C=!0,s.reject(v,L))}function A(L){C||(C=!0,s.resolve(v,L))}var M=y(function(){w(A,x)});M.status==="error"&&x(M.value)}function y(v,w){var C={};try{C.value=v(w),C.status="success"}catch(x){C.status="error",C.value=x}return C}(r.exports=h).prototype.finally=function(v){if(typeof v!="function")return this;var w=this.constructor;return this.then(function(C){return w.resolve(v()).then(function(){return C})},function(C){return w.resolve(v()).then(function(){throw C})})},h.prototype.catch=function(v){return this.then(null,v)},h.prototype.then=function(v,w){if(typeof v!="function"&&this.state===f||typeof w!="function"&&this.state===c)return this;var C=new this.constructor(i);return this.state!==d?g(C,this.state===f?v:w,this.outcome):this.queue.push(new p(C,v,w)),C},p.prototype.callFulfilled=function(v){s.resolve(this.promise,v)},p.prototype.otherCallFulfilled=function(v){g(this.promise,this.onFulfilled,v)},p.prototype.callRejected=function(v){s.reject(this.promise,v)},p.prototype.otherCallRejected=function(v){g(this.promise,this.onRejected,v)},s.resolve=function(v,w){var C=y(m,w);if(C.status==="error")return s.reject(v,C.value);var x=C.value;if(x)_(v,x);else{v.state=f,v.outcome=w;for(var A=-1,M=v.queue.length;++A<M;)v.queue[A].callFulfilled(w)}return v},s.reject=function(v,w){v.state=c,v.outcome=w;for(var C=-1,x=v.queue.length;++C<x;)v.queue[C].callRejected(w);return v},h.resolve=function(v){return v instanceof this?v:s.resolve(new this(i),v)},h.reject=function(v){var w=new this(i);return s.reject(w,v)},h.all=function(v){var w=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=v.length,x=!1;if(!C)return this.resolve([]);for(var A=new Array(C),M=0,L=-1,I=new this(i);++L<C;)P(v[L],L);return I;function P(z,R){w.resolve(z).then(function(T){A[R]=T,++M!==C||x||(x=!0,s.resolve(I,A))},function(T){x||(x=!0,s.reject(I,T))})}},h.race=function(v){var w=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=v.length,x=!1;if(!C)return this.resolve([]);for(var A=-1,M=new this(i);++A<C;)L=v[A],w.resolve(L).then(function(I){x||(x=!0,s.resolve(M,I))},function(I){x||(x=!0,s.reject(M,I))});var L;return M}},{immediate:36}],38:[function(n,r,l){var o={};(0,n("./lib/utils/common").assign)(o,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=o},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,l){var o=n("./zlib/deflate"),i=n("./utils/common"),s=n("./utils/strings"),c=n("./zlib/messages"),f=n("./zlib/zstream"),d=Object.prototype.toString,h=0,p=-1,g=0,m=8;function _(v){if(!(this instanceof _))return new _(v);this.options=i.assign({level:p,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:g,to:""},v||{});var w=this.options;w.raw&&0<w.windowBits?w.windowBits=-w.windowBits:w.gzip&&0<w.windowBits&&w.windowBits<16&&(w.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var C=o.deflateInit2(this.strm,w.level,w.method,w.windowBits,w.memLevel,w.strategy);if(C!==h)throw new Error(c[C]);if(w.header&&o.deflateSetHeader(this.strm,w.header),w.dictionary){var x;if(x=typeof w.dictionary=="string"?s.string2buf(w.dictionary):d.call(w.dictionary)==="[object ArrayBuffer]"?new Uint8Array(w.dictionary):w.dictionary,(C=o.deflateSetDictionary(this.strm,x))!==h)throw new Error(c[C]);this._dict_set=!0}}function y(v,w){var C=new _(w);if(C.push(v,!0),C.err)throw C.msg||c[C.err];return C.result}_.prototype.push=function(v,w){var C,x,A=this.strm,M=this.options.chunkSize;if(this.ended)return!1;x=w===~~w?w:w===!0?4:0,typeof v=="string"?A.input=s.string2buf(v):d.call(v)==="[object ArrayBuffer]"?A.input=new Uint8Array(v):A.input=v,A.next_in=0,A.avail_in=A.input.length;do{if(A.avail_out===0&&(A.output=new i.Buf8(M),A.next_out=0,A.avail_out=M),(C=o.deflate(A,x))!==1&&C!==h)return this.onEnd(C),!(this.ended=!0);A.avail_out!==0&&(A.avail_in!==0||x!==4&&x!==2)||(this.options.to==="string"?this.onData(s.buf2binstring(i.shrinkBuf(A.output,A.next_out))):this.onData(i.shrinkBuf(A.output,A.next_out)))}while((0<A.avail_in||A.avail_out===0)&&C!==1);return x===4?(C=o.deflateEnd(this.strm),this.onEnd(C),this.ended=!0,C===h):x!==2||(this.onEnd(h),!(A.avail_out=0))},_.prototype.onData=function(v){this.chunks.push(v)},_.prototype.onEnd=function(v){v===h&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=v,this.msg=this.strm.msg},l.Deflate=_,l.deflate=y,l.deflateRaw=function(v,w){return(w=w||{}).raw=!0,y(v,w)},l.gzip=function(v,w){return(w=w||{}).gzip=!0,y(v,w)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,l){var o=n("./zlib/inflate"),i=n("./utils/common"),s=n("./utils/strings"),c=n("./zlib/constants"),f=n("./zlib/messages"),d=n("./zlib/zstream"),h=n("./zlib/gzheader"),p=Object.prototype.toString;function g(_){if(!(this instanceof g))return new g(_);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},_||{});var y=this.options;y.raw&&0<=y.windowBits&&y.windowBits<16&&(y.windowBits=-y.windowBits,y.windowBits===0&&(y.windowBits=-15)),!(0<=y.windowBits&&y.windowBits<16)||_&&_.windowBits||(y.windowBits+=32),15<y.windowBits&&y.windowBits<48&&!(15&y.windowBits)&&(y.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var v=o.inflateInit2(this.strm,y.windowBits);if(v!==c.Z_OK)throw new Error(f[v]);this.header=new h,o.inflateGetHeader(this.strm,this.header)}function m(_,y){var v=new g(y);if(v.push(_,!0),v.err)throw v.msg||f[v.err];return v.result}g.prototype.push=function(_,y){var v,w,C,x,A,M,L=this.strm,I=this.options.chunkSize,P=this.options.dictionary,z=!1;if(this.ended)return!1;w=y===~~y?y:y===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof _=="string"?L.input=s.binstring2buf(_):p.call(_)==="[object ArrayBuffer]"?L.input=new Uint8Array(_):L.input=_,L.next_in=0,L.avail_in=L.input.length;do{if(L.avail_out===0&&(L.output=new i.Buf8(I),L.next_out=0,L.avail_out=I),(v=o.inflate(L,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&P&&(M=typeof P=="string"?s.string2buf(P):p.call(P)==="[object ArrayBuffer]"?new Uint8Array(P):P,v=o.inflateSetDictionary(this.strm,M)),v===c.Z_BUF_ERROR&&z===!0&&(v=c.Z_OK,z=!1),v!==c.Z_STREAM_END&&v!==c.Z_OK)return this.onEnd(v),!(this.ended=!0);L.next_out&&(L.avail_out!==0&&v!==c.Z_STREAM_END&&(L.avail_in!==0||w!==c.Z_FINISH&&w!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(C=s.utf8border(L.output,L.next_out),x=L.next_out-C,A=s.buf2string(L.output,C),L.next_out=x,L.avail_out=I-x,x&&i.arraySet(L.output,L.output,C,x,0),this.onData(A)):this.onData(i.shrinkBuf(L.output,L.next_out)))),L.avail_in===0&&L.avail_out===0&&(z=!0)}while((0<L.avail_in||L.avail_out===0)&&v!==c.Z_STREAM_END);return v===c.Z_STREAM_END&&(w=c.Z_FINISH),w===c.Z_FINISH?(v=o.inflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===c.Z_OK):w!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(L.avail_out=0))},g.prototype.onData=function(_){this.chunks.push(_)},g.prototype.onEnd=function(_){_===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg},l.Inflate=g,l.inflate=m,l.inflateRaw=function(_,y){return(y=y||{}).raw=!0,m(_,y)},l.ungzip=m},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,l){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";l.assign=function(c){for(var f=Array.prototype.slice.call(arguments,1);f.length;){var d=f.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var h in d)d.hasOwnProperty(h)&&(c[h]=d[h])}}return c},l.shrinkBuf=function(c,f){return c.length===f?c:c.subarray?c.subarray(0,f):(c.length=f,c)};var i={arraySet:function(c,f,d,h,p){if(f.subarray&&c.subarray)c.set(f.subarray(d,d+h),p);else for(var g=0;g<h;g++)c[p+g]=f[d+g]},flattenChunks:function(c){var f,d,h,p,g,m;for(f=h=0,d=c.length;f<d;f++)h+=c[f].length;for(m=new Uint8Array(h),f=p=0,d=c.length;f<d;f++)g=c[f],m.set(g,p),p+=g.length;return m}},s={arraySet:function(c,f,d,h,p){for(var g=0;g<h;g++)c[p+g]=f[d+g]},flattenChunks:function(c){return[].concat.apply([],c)}};l.setTyped=function(c){c?(l.Buf8=Uint8Array,l.Buf16=Uint16Array,l.Buf32=Int32Array,l.assign(l,i)):(l.Buf8=Array,l.Buf16=Array,l.Buf32=Array,l.assign(l,s))},l.setTyped(o)},{}],42:[function(n,r,l){var o=n("./common"),i=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{s=!1}for(var c=new o.Buf8(256),f=0;f<256;f++)c[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;function d(h,p){if(p<65537&&(h.subarray&&s||!h.subarray&&i))return String.fromCharCode.apply(null,o.shrinkBuf(h,p));for(var g="",m=0;m<p;m++)g+=String.fromCharCode(h[m]);return g}c[254]=c[254]=1,l.string2buf=function(h){var p,g,m,_,y,v=h.length,w=0;for(_=0;_<v;_++)(64512&(g=h.charCodeAt(_)))==55296&&_+1<v&&(64512&(m=h.charCodeAt(_+1)))==56320&&(g=65536+(g-55296<<10)+(m-56320),_++),w+=g<128?1:g<2048?2:g<65536?3:4;for(p=new o.Buf8(w),_=y=0;y<w;_++)(64512&(g=h.charCodeAt(_)))==55296&&_+1<v&&(64512&(m=h.charCodeAt(_+1)))==56320&&(g=65536+(g-55296<<10)+(m-56320),_++),g<128?p[y++]=g:(g<2048?p[y++]=192|g>>>6:(g<65536?p[y++]=224|g>>>12:(p[y++]=240|g>>>18,p[y++]=128|g>>>12&63),p[y++]=128|g>>>6&63),p[y++]=128|63&g);return p},l.buf2binstring=function(h){return d(h,h.length)},l.binstring2buf=function(h){for(var p=new o.Buf8(h.length),g=0,m=p.length;g<m;g++)p[g]=h.charCodeAt(g);return p},l.buf2string=function(h,p){var g,m,_,y,v=p||h.length,w=new Array(2*v);for(g=m=0;g<v;)if((_=h[g++])<128)w[m++]=_;else if(4<(y=c[_]))w[m++]=65533,g+=y-1;else{for(_&=y===2?31:y===3?15:7;1<y&&g<v;)_=_<<6|63&h[g++],y--;1<y?w[m++]=65533:_<65536?w[m++]=_:(_-=65536,w[m++]=55296|_>>10&1023,w[m++]=56320|1023&_)}return d(w,m)},l.utf8border=function(h,p){var g;for((p=p||h.length)>h.length&&(p=h.length),g=p-1;0<=g&&(192&h[g])==128;)g--;return g<0||g===0?p:g+c[h[g]]>p?g:p}},{"./common":41}],43:[function(n,r,l){r.exports=function(o,i,s,c){for(var f=65535&o|0,d=o>>>16&65535|0,h=0;s!==0;){for(s-=h=2e3<s?2e3:s;d=d+(f=f+i[c++]|0)|0,--h;);f%=65521,d%=65521}return f|d<<16|0}},{}],44:[function(n,r,l){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,l){var o=function(){for(var i,s=[],c=0;c<256;c++){i=c;for(var f=0;f<8;f++)i=1&i?3988292384^i>>>1:i>>>1;s[c]=i}return s}();r.exports=function(i,s,c,f){var d=o,h=f+c;i^=-1;for(var p=f;p<h;p++)i=i>>>8^d[255&(i^s[p])];return-1^i}},{}],46:[function(n,r,l){var o,i=n("../utils/common"),s=n("./trees"),c=n("./adler32"),f=n("./crc32"),d=n("./messages"),h=0,p=4,g=0,m=-2,_=-1,y=4,v=2,w=8,C=9,x=286,A=30,M=19,L=2*x+1,I=15,P=3,z=258,R=z+P+1,T=42,N=113,k=1,D=2,G=3,W=4;function Q(S,te){return S.msg=d[te],te}function Y(S){return(S<<1)-(4<S?9:0)}function ie(S){for(var te=S.length;0<=--te;)S[te]=0}function H(S){var te=S.state,J=te.pending;J>S.avail_out&&(J=S.avail_out),J!==0&&(i.arraySet(S.output,te.pending_buf,te.pending_out,J,S.next_out),S.next_out+=J,te.pending_out+=J,S.total_out+=J,S.avail_out-=J,te.pending-=J,te.pending===0&&(te.pending_out=0))}function Z(S,te){s._tr_flush_block(S,0<=S.block_start?S.block_start:-1,S.strstart-S.block_start,te),S.block_start=S.strstart,H(S.strm)}function re(S,te){S.pending_buf[S.pending++]=te}function K(S,te){S.pending_buf[S.pending++]=te>>>8&255,S.pending_buf[S.pending++]=255&te}function X(S,te){var J,U,O=S.max_chain_length,V=S.strstart,ae=S.prev_length,ce=S.nice_match,q=S.strstart>S.w_size-R?S.strstart-(S.w_size-R):0,he=S.window,_e=S.w_mask,de=S.prev,Te=S.strstart+z,ze=he[V+ae-1],ve=he[V+ae];S.prev_length>=S.good_match&&(O>>=2),ce>S.lookahead&&(ce=S.lookahead);do if(he[(J=te)+ae]===ve&&he[J+ae-1]===ze&&he[J]===he[V]&&he[++J]===he[V+1]){V+=2,J++;do;while(he[++V]===he[++J]&&he[++V]===he[++J]&&he[++V]===he[++J]&&he[++V]===he[++J]&&he[++V]===he[++J]&&he[++V]===he[++J]&&he[++V]===he[++J]&&he[++V]===he[++J]&&V<Te);if(U=z-(Te-V),V=Te-z,ae<U){if(S.match_start=te,ce<=(ae=U))break;ze=he[V+ae-1],ve=he[V+ae]}}while((te=de[te&_e])>q&&--O!=0);return ae<=S.lookahead?ae:S.lookahead}function pe(S){var te,J,U,O,V,ae,ce,q,he,_e,de=S.w_size;do{if(O=S.window_size-S.lookahead-S.strstart,S.strstart>=de+(de-R)){for(i.arraySet(S.window,S.window,de,de,0),S.match_start-=de,S.strstart-=de,S.block_start-=de,te=J=S.hash_size;U=S.head[--te],S.head[te]=de<=U?U-de:0,--J;);for(te=J=de;U=S.prev[--te],S.prev[te]=de<=U?U-de:0,--J;);O+=de}if(S.strm.avail_in===0)break;if(ae=S.strm,ce=S.window,q=S.strstart+S.lookahead,he=O,_e=void 0,_e=ae.avail_in,he<_e&&(_e=he),J=_e===0?0:(ae.avail_in-=_e,i.arraySet(ce,ae.input,ae.next_in,_e,q),ae.state.wrap===1?ae.adler=c(ae.adler,ce,_e,q):ae.state.wrap===2&&(ae.adler=f(ae.adler,ce,_e,q)),ae.next_in+=_e,ae.total_in+=_e,_e),S.lookahead+=J,S.lookahead+S.insert>=P)for(V=S.strstart-S.insert,S.ins_h=S.window[V],S.ins_h=(S.ins_h<<S.hash_shift^S.window[V+1])&S.hash_mask;S.insert&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[V+P-1])&S.hash_mask,S.prev[V&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=V,V++,S.insert--,!(S.lookahead+S.insert<P)););}while(S.lookahead<R&&S.strm.avail_in!==0)}function we(S,te){for(var J,U;;){if(S.lookahead<R){if(pe(S),S.lookahead<R&&te===h)return k;if(S.lookahead===0)break}if(J=0,S.lookahead>=P&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+P-1])&S.hash_mask,J=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),J!==0&&S.strstart-J<=S.w_size-R&&(S.match_length=X(S,J)),S.match_length>=P)if(U=s._tr_tally(S,S.strstart-S.match_start,S.match_length-P),S.lookahead-=S.match_length,S.match_length<=S.max_lazy_match&&S.lookahead>=P){for(S.match_length--;S.strstart++,S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+P-1])&S.hash_mask,J=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart,--S.match_length!=0;);S.strstart++}else S.strstart+=S.match_length,S.match_length=0,S.ins_h=S.window[S.strstart],S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+1])&S.hash_mask;else U=s._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++;if(U&&(Z(S,!1),S.strm.avail_out===0))return k}return S.insert=S.strstart<P-1?S.strstart:P-1,te===p?(Z(S,!0),S.strm.avail_out===0?G:W):S.last_lit&&(Z(S,!1),S.strm.avail_out===0)?k:D}function Ee(S,te){for(var J,U,O;;){if(S.lookahead<R){if(pe(S),S.lookahead<R&&te===h)return k;if(S.lookahead===0)break}if(J=0,S.lookahead>=P&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+P-1])&S.hash_mask,J=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),S.prev_length=S.match_length,S.prev_match=S.match_start,S.match_length=P-1,J!==0&&S.prev_length<S.max_lazy_match&&S.strstart-J<=S.w_size-R&&(S.match_length=X(S,J),S.match_length<=5&&(S.strategy===1||S.match_length===P&&4096<S.strstart-S.match_start)&&(S.match_length=P-1)),S.prev_length>=P&&S.match_length<=S.prev_length){for(O=S.strstart+S.lookahead-P,U=s._tr_tally(S,S.strstart-1-S.prev_match,S.prev_length-P),S.lookahead-=S.prev_length-1,S.prev_length-=2;++S.strstart<=O&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+P-1])&S.hash_mask,J=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),--S.prev_length!=0;);if(S.match_available=0,S.match_length=P-1,S.strstart++,U&&(Z(S,!1),S.strm.avail_out===0))return k}else if(S.match_available){if((U=s._tr_tally(S,0,S.window[S.strstart-1]))&&Z(S,!1),S.strstart++,S.lookahead--,S.strm.avail_out===0)return k}else S.match_available=1,S.strstart++,S.lookahead--}return S.match_available&&(U=s._tr_tally(S,0,S.window[S.strstart-1]),S.match_available=0),S.insert=S.strstart<P-1?S.strstart:P-1,te===p?(Z(S,!0),S.strm.avail_out===0?G:W):S.last_lit&&(Z(S,!1),S.strm.avail_out===0)?k:D}function le(S,te,J,U,O){this.good_length=S,this.max_lazy=te,this.nice_length=J,this.max_chain=U,this.func=O}function ke(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=w,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*L),this.dyn_dtree=new i.Buf16(2*(2*A+1)),this.bl_tree=new i.Buf16(2*(2*M+1)),ie(this.dyn_ltree),ie(this.dyn_dtree),ie(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(I+1),this.heap=new i.Buf16(2*x+1),ie(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*x+1),ie(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ue(S){var te;return S&&S.state?(S.total_in=S.total_out=0,S.data_type=v,(te=S.state).pending=0,te.pending_out=0,te.wrap<0&&(te.wrap=-te.wrap),te.status=te.wrap?T:N,S.adler=te.wrap===2?0:1,te.last_flush=h,s._tr_init(te),g):Q(S,m)}function ne(S){var te=ue(S);return te===g&&function(J){J.window_size=2*J.w_size,ie(J.head),J.max_lazy_match=o[J.level].max_lazy,J.good_match=o[J.level].good_length,J.nice_match=o[J.level].nice_length,J.max_chain_length=o[J.level].max_chain,J.strstart=0,J.block_start=0,J.lookahead=0,J.insert=0,J.match_length=J.prev_length=P-1,J.match_available=0,J.ins_h=0}(S.state),te}function Ce(S,te,J,U,O,V){if(!S)return m;var ae=1;if(te===_&&(te=6),U<0?(ae=0,U=-U):15<U&&(ae=2,U-=16),O<1||C<O||J!==w||U<8||15<U||te<0||9<te||V<0||y<V)return Q(S,m);U===8&&(U=9);var ce=new ke;return(S.state=ce).strm=S,ce.wrap=ae,ce.gzhead=null,ce.w_bits=U,ce.w_size=1<<ce.w_bits,ce.w_mask=ce.w_size-1,ce.hash_bits=O+7,ce.hash_size=1<<ce.hash_bits,ce.hash_mask=ce.hash_size-1,ce.hash_shift=~~((ce.hash_bits+P-1)/P),ce.window=new i.Buf8(2*ce.w_size),ce.head=new i.Buf16(ce.hash_size),ce.prev=new i.Buf16(ce.w_size),ce.lit_bufsize=1<<O+6,ce.pending_buf_size=4*ce.lit_bufsize,ce.pending_buf=new i.Buf8(ce.pending_buf_size),ce.d_buf=1*ce.lit_bufsize,ce.l_buf=3*ce.lit_bufsize,ce.level=te,ce.strategy=V,ce.method=J,ne(S)}o=[new le(0,0,0,0,function(S,te){var J=65535;for(J>S.pending_buf_size-5&&(J=S.pending_buf_size-5);;){if(S.lookahead<=1){if(pe(S),S.lookahead===0&&te===h)return k;if(S.lookahead===0)break}S.strstart+=S.lookahead,S.lookahead=0;var U=S.block_start+J;if((S.strstart===0||S.strstart>=U)&&(S.lookahead=S.strstart-U,S.strstart=U,Z(S,!1),S.strm.avail_out===0)||S.strstart-S.block_start>=S.w_size-R&&(Z(S,!1),S.strm.avail_out===0))return k}return S.insert=0,te===p?(Z(S,!0),S.strm.avail_out===0?G:W):(S.strstart>S.block_start&&(Z(S,!1),S.strm.avail_out),k)}),new le(4,4,8,4,we),new le(4,5,16,8,we),new le(4,6,32,32,we),new le(4,4,16,16,Ee),new le(8,16,32,32,Ee),new le(8,16,128,128,Ee),new le(8,32,128,256,Ee),new le(32,128,258,1024,Ee),new le(32,258,258,4096,Ee)],l.deflateInit=function(S,te){return Ce(S,te,w,15,8,0)},l.deflateInit2=Ce,l.deflateReset=ne,l.deflateResetKeep=ue,l.deflateSetHeader=function(S,te){return S&&S.state?S.state.wrap!==2?m:(S.state.gzhead=te,g):m},l.deflate=function(S,te){var J,U,O,V;if(!S||!S.state||5<te||te<0)return S?Q(S,m):m;if(U=S.state,!S.output||!S.input&&S.avail_in!==0||U.status===666&&te!==p)return Q(S,S.avail_out===0?-5:m);if(U.strm=S,J=U.last_flush,U.last_flush=te,U.status===T)if(U.wrap===2)S.adler=0,re(U,31),re(U,139),re(U,8),U.gzhead?(re(U,(U.gzhead.text?1:0)+(U.gzhead.hcrc?2:0)+(U.gzhead.extra?4:0)+(U.gzhead.name?8:0)+(U.gzhead.comment?16:0)),re(U,255&U.gzhead.time),re(U,U.gzhead.time>>8&255),re(U,U.gzhead.time>>16&255),re(U,U.gzhead.time>>24&255),re(U,U.level===9?2:2<=U.strategy||U.level<2?4:0),re(U,255&U.gzhead.os),U.gzhead.extra&&U.gzhead.extra.length&&(re(U,255&U.gzhead.extra.length),re(U,U.gzhead.extra.length>>8&255)),U.gzhead.hcrc&&(S.adler=f(S.adler,U.pending_buf,U.pending,0)),U.gzindex=0,U.status=69):(re(U,0),re(U,0),re(U,0),re(U,0),re(U,0),re(U,U.level===9?2:2<=U.strategy||U.level<2?4:0),re(U,3),U.status=N);else{var ae=w+(U.w_bits-8<<4)<<8;ae|=(2<=U.strategy||U.level<2?0:U.level<6?1:U.level===6?2:3)<<6,U.strstart!==0&&(ae|=32),ae+=31-ae%31,U.status=N,K(U,ae),U.strstart!==0&&(K(U,S.adler>>>16),K(U,65535&S.adler)),S.adler=1}if(U.status===69)if(U.gzhead.extra){for(O=U.pending;U.gzindex<(65535&U.gzhead.extra.length)&&(U.pending!==U.pending_buf_size||(U.gzhead.hcrc&&U.pending>O&&(S.adler=f(S.adler,U.pending_buf,U.pending-O,O)),H(S),O=U.pending,U.pending!==U.pending_buf_size));)re(U,255&U.gzhead.extra[U.gzindex]),U.gzindex++;U.gzhead.hcrc&&U.pending>O&&(S.adler=f(S.adler,U.pending_buf,U.pending-O,O)),U.gzindex===U.gzhead.extra.length&&(U.gzindex=0,U.status=73)}else U.status=73;if(U.status===73)if(U.gzhead.name){O=U.pending;do{if(U.pending===U.pending_buf_size&&(U.gzhead.hcrc&&U.pending>O&&(S.adler=f(S.adler,U.pending_buf,U.pending-O,O)),H(S),O=U.pending,U.pending===U.pending_buf_size)){V=1;break}V=U.gzindex<U.gzhead.name.length?255&U.gzhead.name.charCodeAt(U.gzindex++):0,re(U,V)}while(V!==0);U.gzhead.hcrc&&U.pending>O&&(S.adler=f(S.adler,U.pending_buf,U.pending-O,O)),V===0&&(U.gzindex=0,U.status=91)}else U.status=91;if(U.status===91)if(U.gzhead.comment){O=U.pending;do{if(U.pending===U.pending_buf_size&&(U.gzhead.hcrc&&U.pending>O&&(S.adler=f(S.adler,U.pending_buf,U.pending-O,O)),H(S),O=U.pending,U.pending===U.pending_buf_size)){V=1;break}V=U.gzindex<U.gzhead.comment.length?255&U.gzhead.comment.charCodeAt(U.gzindex++):0,re(U,V)}while(V!==0);U.gzhead.hcrc&&U.pending>O&&(S.adler=f(S.adler,U.pending_buf,U.pending-O,O)),V===0&&(U.status=103)}else U.status=103;if(U.status===103&&(U.gzhead.hcrc?(U.pending+2>U.pending_buf_size&&H(S),U.pending+2<=U.pending_buf_size&&(re(U,255&S.adler),re(U,S.adler>>8&255),S.adler=0,U.status=N)):U.status=N),U.pending!==0){if(H(S),S.avail_out===0)return U.last_flush=-1,g}else if(S.avail_in===0&&Y(te)<=Y(J)&&te!==p)return Q(S,-5);if(U.status===666&&S.avail_in!==0)return Q(S,-5);if(S.avail_in!==0||U.lookahead!==0||te!==h&&U.status!==666){var ce=U.strategy===2?function(q,he){for(var _e;;){if(q.lookahead===0&&(pe(q),q.lookahead===0)){if(he===h)return k;break}if(q.match_length=0,_e=s._tr_tally(q,0,q.window[q.strstart]),q.lookahead--,q.strstart++,_e&&(Z(q,!1),q.strm.avail_out===0))return k}return q.insert=0,he===p?(Z(q,!0),q.strm.avail_out===0?G:W):q.last_lit&&(Z(q,!1),q.strm.avail_out===0)?k:D}(U,te):U.strategy===3?function(q,he){for(var _e,de,Te,ze,ve=q.window;;){if(q.lookahead<=z){if(pe(q),q.lookahead<=z&&he===h)return k;if(q.lookahead===0)break}if(q.match_length=0,q.lookahead>=P&&0<q.strstart&&(de=ve[Te=q.strstart-1])===ve[++Te]&&de===ve[++Te]&&de===ve[++Te]){ze=q.strstart+z;do;while(de===ve[++Te]&&de===ve[++Te]&&de===ve[++Te]&&de===ve[++Te]&&de===ve[++Te]&&de===ve[++Te]&&de===ve[++Te]&&de===ve[++Te]&&Te<ze);q.match_length=z-(ze-Te),q.match_length>q.lookahead&&(q.match_length=q.lookahead)}if(q.match_length>=P?(_e=s._tr_tally(q,1,q.match_length-P),q.lookahead-=q.match_length,q.strstart+=q.match_length,q.match_length=0):(_e=s._tr_tally(q,0,q.window[q.strstart]),q.lookahead--,q.strstart++),_e&&(Z(q,!1),q.strm.avail_out===0))return k}return q.insert=0,he===p?(Z(q,!0),q.strm.avail_out===0?G:W):q.last_lit&&(Z(q,!1),q.strm.avail_out===0)?k:D}(U,te):o[U.level].func(U,te);if(ce!==G&&ce!==W||(U.status=666),ce===k||ce===G)return S.avail_out===0&&(U.last_flush=-1),g;if(ce===D&&(te===1?s._tr_align(U):te!==5&&(s._tr_stored_block(U,0,0,!1),te===3&&(ie(U.head),U.lookahead===0&&(U.strstart=0,U.block_start=0,U.insert=0))),H(S),S.avail_out===0))return U.last_flush=-1,g}return te!==p?g:U.wrap<=0?1:(U.wrap===2?(re(U,255&S.adler),re(U,S.adler>>8&255),re(U,S.adler>>16&255),re(U,S.adler>>24&255),re(U,255&S.total_in),re(U,S.total_in>>8&255),re(U,S.total_in>>16&255),re(U,S.total_in>>24&255)):(K(U,S.adler>>>16),K(U,65535&S.adler)),H(S),0<U.wrap&&(U.wrap=-U.wrap),U.pending!==0?g:1)},l.deflateEnd=function(S){var te;return S&&S.state?(te=S.state.status)!==T&&te!==69&&te!==73&&te!==91&&te!==103&&te!==N&&te!==666?Q(S,m):(S.state=null,te===N?Q(S,-3):g):m},l.deflateSetDictionary=function(S,te){var J,U,O,V,ae,ce,q,he,_e=te.length;if(!S||!S.state||(V=(J=S.state).wrap)===2||V===1&&J.status!==T||J.lookahead)return m;for(V===1&&(S.adler=c(S.adler,te,_e,0)),J.wrap=0,_e>=J.w_size&&(V===0&&(ie(J.head),J.strstart=0,J.block_start=0,J.insert=0),he=new i.Buf8(J.w_size),i.arraySet(he,te,_e-J.w_size,J.w_size,0),te=he,_e=J.w_size),ae=S.avail_in,ce=S.next_in,q=S.input,S.avail_in=_e,S.next_in=0,S.input=te,pe(J);J.lookahead>=P;){for(U=J.strstart,O=J.lookahead-(P-1);J.ins_h=(J.ins_h<<J.hash_shift^J.window[U+P-1])&J.hash_mask,J.prev[U&J.w_mask]=J.head[J.ins_h],J.head[J.ins_h]=U,U++,--O;);J.strstart=U,J.lookahead=P-1,pe(J)}return J.strstart+=J.lookahead,J.block_start=J.strstart,J.insert=J.lookahead,J.lookahead=0,J.match_length=J.prev_length=P-1,J.match_available=0,S.next_in=ce,S.input=q,S.avail_in=ae,J.wrap=V,g},l.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,l){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,r,l){r.exports=function(o,i){var s,c,f,d,h,p,g,m,_,y,v,w,C,x,A,M,L,I,P,z,R,T,N,k,D;s=o.state,c=o.next_in,k=o.input,f=c+(o.avail_in-5),d=o.next_out,D=o.output,h=d-(i-o.avail_out),p=d+(o.avail_out-257),g=s.dmax,m=s.wsize,_=s.whave,y=s.wnext,v=s.window,w=s.hold,C=s.bits,x=s.lencode,A=s.distcode,M=(1<<s.lenbits)-1,L=(1<<s.distbits)-1;e:do{C<15&&(w+=k[c++]<<C,C+=8,w+=k[c++]<<C,C+=8),I=x[w&M];t:for(;;){if(w>>>=P=I>>>24,C-=P,(P=I>>>16&255)===0)D[d++]=65535&I;else{if(!(16&P)){if(!(64&P)){I=x[(65535&I)+(w&(1<<P)-1)];continue t}if(32&P){s.mode=12;break e}o.msg="invalid literal/length code",s.mode=30;break e}z=65535&I,(P&=15)&&(C<P&&(w+=k[c++]<<C,C+=8),z+=w&(1<<P)-1,w>>>=P,C-=P),C<15&&(w+=k[c++]<<C,C+=8,w+=k[c++]<<C,C+=8),I=A[w&L];n:for(;;){if(w>>>=P=I>>>24,C-=P,!(16&(P=I>>>16&255))){if(!(64&P)){I=A[(65535&I)+(w&(1<<P)-1)];continue n}o.msg="invalid distance code",s.mode=30;break e}if(R=65535&I,C<(P&=15)&&(w+=k[c++]<<C,(C+=8)<P&&(w+=k[c++]<<C,C+=8)),g<(R+=w&(1<<P)-1)){o.msg="invalid distance too far back",s.mode=30;break e}if(w>>>=P,C-=P,(P=d-h)<R){if(_<(P=R-P)&&s.sane){o.msg="invalid distance too far back",s.mode=30;break e}if(N=v,(T=0)===y){if(T+=m-P,P<z){for(z-=P;D[d++]=v[T++],--P;);T=d-R,N=D}}else if(y<P){if(T+=m+y-P,(P-=y)<z){for(z-=P;D[d++]=v[T++],--P;);if(T=0,y<z){for(z-=P=y;D[d++]=v[T++],--P;);T=d-R,N=D}}}else if(T+=y-P,P<z){for(z-=P;D[d++]=v[T++],--P;);T=d-R,N=D}for(;2<z;)D[d++]=N[T++],D[d++]=N[T++],D[d++]=N[T++],z-=3;z&&(D[d++]=N[T++],1<z&&(D[d++]=N[T++]))}else{for(T=d-R;D[d++]=D[T++],D[d++]=D[T++],D[d++]=D[T++],2<(z-=3););z&&(D[d++]=D[T++],1<z&&(D[d++]=D[T++]))}break}}break}}while(c<f&&d<p);c-=z=C>>3,w&=(1<<(C-=z<<3))-1,o.next_in=c,o.next_out=d,o.avail_in=c<f?f-c+5:5-(c-f),o.avail_out=d<p?p-d+257:257-(d-p),s.hold=w,s.bits=C}},{}],49:[function(n,r,l){var o=n("../utils/common"),i=n("./adler32"),s=n("./crc32"),c=n("./inffast"),f=n("./inftrees"),d=1,h=2,p=0,g=-2,m=1,_=852,y=592;function v(T){return(T>>>24&255)+(T>>>8&65280)+((65280&T)<<8)+((255&T)<<24)}function w(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function C(T){var N;return T&&T.state?(N=T.state,T.total_in=T.total_out=N.total=0,T.msg="",N.wrap&&(T.adler=1&N.wrap),N.mode=m,N.last=0,N.havedict=0,N.dmax=32768,N.head=null,N.hold=0,N.bits=0,N.lencode=N.lendyn=new o.Buf32(_),N.distcode=N.distdyn=new o.Buf32(y),N.sane=1,N.back=-1,p):g}function x(T){var N;return T&&T.state?((N=T.state).wsize=0,N.whave=0,N.wnext=0,C(T)):g}function A(T,N){var k,D;return T&&T.state?(D=T.state,N<0?(k=0,N=-N):(k=1+(N>>4),N<48&&(N&=15)),N&&(N<8||15<N)?g:(D.window!==null&&D.wbits!==N&&(D.window=null),D.wrap=k,D.wbits=N,x(T))):g}function M(T,N){var k,D;return T?(D=new w,(T.state=D).window=null,(k=A(T,N))!==p&&(T.state=null),k):g}var L,I,P=!0;function z(T){if(P){var N;for(L=new o.Buf32(512),I=new o.Buf32(32),N=0;N<144;)T.lens[N++]=8;for(;N<256;)T.lens[N++]=9;for(;N<280;)T.lens[N++]=7;for(;N<288;)T.lens[N++]=8;for(f(d,T.lens,0,288,L,0,T.work,{bits:9}),N=0;N<32;)T.lens[N++]=5;f(h,T.lens,0,32,I,0,T.work,{bits:5}),P=!1}T.lencode=L,T.lenbits=9,T.distcode=I,T.distbits=5}function R(T,N,k,D){var G,W=T.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new o.Buf8(W.wsize)),D>=W.wsize?(o.arraySet(W.window,N,k-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(D<(G=W.wsize-W.wnext)&&(G=D),o.arraySet(W.window,N,k-D,G,W.wnext),(D-=G)?(o.arraySet(W.window,N,k-D,D,0),W.wnext=D,W.whave=W.wsize):(W.wnext+=G,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=G))),0}l.inflateReset=x,l.inflateReset2=A,l.inflateResetKeep=C,l.inflateInit=function(T){return M(T,15)},l.inflateInit2=M,l.inflate=function(T,N){var k,D,G,W,Q,Y,ie,H,Z,re,K,X,pe,we,Ee,le,ke,ue,ne,Ce,S,te,J,U,O=0,V=new o.Buf8(4),ae=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!T||!T.state||!T.output||!T.input&&T.avail_in!==0)return g;(k=T.state).mode===12&&(k.mode=13),Q=T.next_out,G=T.output,ie=T.avail_out,W=T.next_in,D=T.input,Y=T.avail_in,H=k.hold,Z=k.bits,re=Y,K=ie,te=p;e:for(;;)switch(k.mode){case m:if(k.wrap===0){k.mode=13;break}for(;Z<16;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}if(2&k.wrap&&H===35615){V[k.check=0]=255&H,V[1]=H>>>8&255,k.check=s(k.check,V,2,0),Z=H=0,k.mode=2;break}if(k.flags=0,k.head&&(k.head.done=!1),!(1&k.wrap)||(((255&H)<<8)+(H>>8))%31){T.msg="incorrect header check",k.mode=30;break}if((15&H)!=8){T.msg="unknown compression method",k.mode=30;break}if(Z-=4,S=8+(15&(H>>>=4)),k.wbits===0)k.wbits=S;else if(S>k.wbits){T.msg="invalid window size",k.mode=30;break}k.dmax=1<<S,T.adler=k.check=1,k.mode=512&H?10:12,Z=H=0;break;case 2:for(;Z<16;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}if(k.flags=H,(255&k.flags)!=8){T.msg="unknown compression method",k.mode=30;break}if(57344&k.flags){T.msg="unknown header flags set",k.mode=30;break}k.head&&(k.head.text=H>>8&1),512&k.flags&&(V[0]=255&H,V[1]=H>>>8&255,k.check=s(k.check,V,2,0)),Z=H=0,k.mode=3;case 3:for(;Z<32;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}k.head&&(k.head.time=H),512&k.flags&&(V[0]=255&H,V[1]=H>>>8&255,V[2]=H>>>16&255,V[3]=H>>>24&255,k.check=s(k.check,V,4,0)),Z=H=0,k.mode=4;case 4:for(;Z<16;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}k.head&&(k.head.xflags=255&H,k.head.os=H>>8),512&k.flags&&(V[0]=255&H,V[1]=H>>>8&255,k.check=s(k.check,V,2,0)),Z=H=0,k.mode=5;case 5:if(1024&k.flags){for(;Z<16;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}k.length=H,k.head&&(k.head.extra_len=H),512&k.flags&&(V[0]=255&H,V[1]=H>>>8&255,k.check=s(k.check,V,2,0)),Z=H=0}else k.head&&(k.head.extra=null);k.mode=6;case 6:if(1024&k.flags&&(Y<(X=k.length)&&(X=Y),X&&(k.head&&(S=k.head.extra_len-k.length,k.head.extra||(k.head.extra=new Array(k.head.extra_len)),o.arraySet(k.head.extra,D,W,X,S)),512&k.flags&&(k.check=s(k.check,D,X,W)),Y-=X,W+=X,k.length-=X),k.length))break e;k.length=0,k.mode=7;case 7:if(2048&k.flags){if(Y===0)break e;for(X=0;S=D[W+X++],k.head&&S&&k.length<65536&&(k.head.name+=String.fromCharCode(S)),S&&X<Y;);if(512&k.flags&&(k.check=s(k.check,D,X,W)),Y-=X,W+=X,S)break e}else k.head&&(k.head.name=null);k.length=0,k.mode=8;case 8:if(4096&k.flags){if(Y===0)break e;for(X=0;S=D[W+X++],k.head&&S&&k.length<65536&&(k.head.comment+=String.fromCharCode(S)),S&&X<Y;);if(512&k.flags&&(k.check=s(k.check,D,X,W)),Y-=X,W+=X,S)break e}else k.head&&(k.head.comment=null);k.mode=9;case 9:if(512&k.flags){for(;Z<16;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}if(H!==(65535&k.check)){T.msg="header crc mismatch",k.mode=30;break}Z=H=0}k.head&&(k.head.hcrc=k.flags>>9&1,k.head.done=!0),T.adler=k.check=0,k.mode=12;break;case 10:for(;Z<32;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}T.adler=k.check=v(H),Z=H=0,k.mode=11;case 11:if(k.havedict===0)return T.next_out=Q,T.avail_out=ie,T.next_in=W,T.avail_in=Y,k.hold=H,k.bits=Z,2;T.adler=k.check=1,k.mode=12;case 12:if(N===5||N===6)break e;case 13:if(k.last){H>>>=7&Z,Z-=7&Z,k.mode=27;break}for(;Z<3;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}switch(k.last=1&H,Z-=1,3&(H>>>=1)){case 0:k.mode=14;break;case 1:if(z(k),k.mode=20,N!==6)break;H>>>=2,Z-=2;break e;case 2:k.mode=17;break;case 3:T.msg="invalid block type",k.mode=30}H>>>=2,Z-=2;break;case 14:for(H>>>=7&Z,Z-=7&Z;Z<32;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}if((65535&H)!=(H>>>16^65535)){T.msg="invalid stored block lengths",k.mode=30;break}if(k.length=65535&H,Z=H=0,k.mode=15,N===6)break e;case 15:k.mode=16;case 16:if(X=k.length){if(Y<X&&(X=Y),ie<X&&(X=ie),X===0)break e;o.arraySet(G,D,W,X,Q),Y-=X,W+=X,ie-=X,Q+=X,k.length-=X;break}k.mode=12;break;case 17:for(;Z<14;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}if(k.nlen=257+(31&H),H>>>=5,Z-=5,k.ndist=1+(31&H),H>>>=5,Z-=5,k.ncode=4+(15&H),H>>>=4,Z-=4,286<k.nlen||30<k.ndist){T.msg="too many length or distance symbols",k.mode=30;break}k.have=0,k.mode=18;case 18:for(;k.have<k.ncode;){for(;Z<3;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}k.lens[ae[k.have++]]=7&H,H>>>=3,Z-=3}for(;k.have<19;)k.lens[ae[k.have++]]=0;if(k.lencode=k.lendyn,k.lenbits=7,J={bits:k.lenbits},te=f(0,k.lens,0,19,k.lencode,0,k.work,J),k.lenbits=J.bits,te){T.msg="invalid code lengths set",k.mode=30;break}k.have=0,k.mode=19;case 19:for(;k.have<k.nlen+k.ndist;){for(;le=(O=k.lencode[H&(1<<k.lenbits)-1])>>>16&255,ke=65535&O,!((Ee=O>>>24)<=Z);){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}if(ke<16)H>>>=Ee,Z-=Ee,k.lens[k.have++]=ke;else{if(ke===16){for(U=Ee+2;Z<U;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}if(H>>>=Ee,Z-=Ee,k.have===0){T.msg="invalid bit length repeat",k.mode=30;break}S=k.lens[k.have-1],X=3+(3&H),H>>>=2,Z-=2}else if(ke===17){for(U=Ee+3;Z<U;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}Z-=Ee,S=0,X=3+(7&(H>>>=Ee)),H>>>=3,Z-=3}else{for(U=Ee+7;Z<U;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}Z-=Ee,S=0,X=11+(127&(H>>>=Ee)),H>>>=7,Z-=7}if(k.have+X>k.nlen+k.ndist){T.msg="invalid bit length repeat",k.mode=30;break}for(;X--;)k.lens[k.have++]=S}}if(k.mode===30)break;if(k.lens[256]===0){T.msg="invalid code -- missing end-of-block",k.mode=30;break}if(k.lenbits=9,J={bits:k.lenbits},te=f(d,k.lens,0,k.nlen,k.lencode,0,k.work,J),k.lenbits=J.bits,te){T.msg="invalid literal/lengths set",k.mode=30;break}if(k.distbits=6,k.distcode=k.distdyn,J={bits:k.distbits},te=f(h,k.lens,k.nlen,k.ndist,k.distcode,0,k.work,J),k.distbits=J.bits,te){T.msg="invalid distances set",k.mode=30;break}if(k.mode=20,N===6)break e;case 20:k.mode=21;case 21:if(6<=Y&&258<=ie){T.next_out=Q,T.avail_out=ie,T.next_in=W,T.avail_in=Y,k.hold=H,k.bits=Z,c(T,K),Q=T.next_out,G=T.output,ie=T.avail_out,W=T.next_in,D=T.input,Y=T.avail_in,H=k.hold,Z=k.bits,k.mode===12&&(k.back=-1);break}for(k.back=0;le=(O=k.lencode[H&(1<<k.lenbits)-1])>>>16&255,ke=65535&O,!((Ee=O>>>24)<=Z);){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}if(le&&!(240&le)){for(ue=Ee,ne=le,Ce=ke;le=(O=k.lencode[Ce+((H&(1<<ue+ne)-1)>>ue)])>>>16&255,ke=65535&O,!(ue+(Ee=O>>>24)<=Z);){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}H>>>=ue,Z-=ue,k.back+=ue}if(H>>>=Ee,Z-=Ee,k.back+=Ee,k.length=ke,le===0){k.mode=26;break}if(32&le){k.back=-1,k.mode=12;break}if(64&le){T.msg="invalid literal/length code",k.mode=30;break}k.extra=15&le,k.mode=22;case 22:if(k.extra){for(U=k.extra;Z<U;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}k.length+=H&(1<<k.extra)-1,H>>>=k.extra,Z-=k.extra,k.back+=k.extra}k.was=k.length,k.mode=23;case 23:for(;le=(O=k.distcode[H&(1<<k.distbits)-1])>>>16&255,ke=65535&O,!((Ee=O>>>24)<=Z);){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}if(!(240&le)){for(ue=Ee,ne=le,Ce=ke;le=(O=k.distcode[Ce+((H&(1<<ue+ne)-1)>>ue)])>>>16&255,ke=65535&O,!(ue+(Ee=O>>>24)<=Z);){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}H>>>=ue,Z-=ue,k.back+=ue}if(H>>>=Ee,Z-=Ee,k.back+=Ee,64&le){T.msg="invalid distance code",k.mode=30;break}k.offset=ke,k.extra=15&le,k.mode=24;case 24:if(k.extra){for(U=k.extra;Z<U;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}k.offset+=H&(1<<k.extra)-1,H>>>=k.extra,Z-=k.extra,k.back+=k.extra}if(k.offset>k.dmax){T.msg="invalid distance too far back",k.mode=30;break}k.mode=25;case 25:if(ie===0)break e;if(X=K-ie,k.offset>X){if((X=k.offset-X)>k.whave&&k.sane){T.msg="invalid distance too far back",k.mode=30;break}pe=X>k.wnext?(X-=k.wnext,k.wsize-X):k.wnext-X,X>k.length&&(X=k.length),we=k.window}else we=G,pe=Q-k.offset,X=k.length;for(ie<X&&(X=ie),ie-=X,k.length-=X;G[Q++]=we[pe++],--X;);k.length===0&&(k.mode=21);break;case 26:if(ie===0)break e;G[Q++]=k.length,ie--,k.mode=21;break;case 27:if(k.wrap){for(;Z<32;){if(Y===0)break e;Y--,H|=D[W++]<<Z,Z+=8}if(K-=ie,T.total_out+=K,k.total+=K,K&&(T.adler=k.check=k.flags?s(k.check,G,K,Q-K):i(k.check,G,K,Q-K)),K=ie,(k.flags?H:v(H))!==k.check){T.msg="incorrect data check",k.mode=30;break}Z=H=0}k.mode=28;case 28:if(k.wrap&&k.flags){for(;Z<32;){if(Y===0)break e;Y--,H+=D[W++]<<Z,Z+=8}if(H!==(4294967295&k.total)){T.msg="incorrect length check",k.mode=30;break}Z=H=0}k.mode=29;case 29:te=1;break e;case 30:te=-3;break e;case 31:return-4;case 32:default:return g}return T.next_out=Q,T.avail_out=ie,T.next_in=W,T.avail_in=Y,k.hold=H,k.bits=Z,(k.wsize||K!==T.avail_out&&k.mode<30&&(k.mode<27||N!==4))&&R(T,T.output,T.next_out,K-T.avail_out)?(k.mode=31,-4):(re-=T.avail_in,K-=T.avail_out,T.total_in+=re,T.total_out+=K,k.total+=K,k.wrap&&K&&(T.adler=k.check=k.flags?s(k.check,G,K,T.next_out-K):i(k.check,G,K,T.next_out-K)),T.data_type=k.bits+(k.last?64:0)+(k.mode===12?128:0)+(k.mode===20||k.mode===15?256:0),(re==0&&K===0||N===4)&&te===p&&(te=-5),te)},l.inflateEnd=function(T){if(!T||!T.state)return g;var N=T.state;return N.window&&(N.window=null),T.state=null,p},l.inflateGetHeader=function(T,N){var k;return T&&T.state&&2&(k=T.state).wrap?((k.head=N).done=!1,p):g},l.inflateSetDictionary=function(T,N){var k,D=N.length;return T&&T.state?(k=T.state).wrap!==0&&k.mode!==11?g:k.mode===11&&i(1,N,D,0)!==k.check?-3:R(T,N,D,D)?(k.mode=31,-4):(k.havedict=1,p):g},l.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,l){var o=n("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],f=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(d,h,p,g,m,_,y,v){var w,C,x,A,M,L,I,P,z,R=v.bits,T=0,N=0,k=0,D=0,G=0,W=0,Q=0,Y=0,ie=0,H=0,Z=null,re=0,K=new o.Buf16(16),X=new o.Buf16(16),pe=null,we=0;for(T=0;T<=15;T++)K[T]=0;for(N=0;N<g;N++)K[h[p+N]]++;for(G=R,D=15;1<=D&&K[D]===0;D--);if(D<G&&(G=D),D===0)return m[_++]=20971520,m[_++]=20971520,v.bits=1,0;for(k=1;k<D&&K[k]===0;k++);for(G<k&&(G=k),T=Y=1;T<=15;T++)if(Y<<=1,(Y-=K[T])<0)return-1;if(0<Y&&(d===0||D!==1))return-1;for(X[1]=0,T=1;T<15;T++)X[T+1]=X[T]+K[T];for(N=0;N<g;N++)h[p+N]!==0&&(y[X[h[p+N]]++]=N);if(L=d===0?(Z=pe=y,19):d===1?(Z=i,re-=257,pe=s,we-=257,256):(Z=c,pe=f,-1),T=k,M=_,Q=N=H=0,x=-1,A=(ie=1<<(W=G))-1,d===1&&852<ie||d===2&&592<ie)return 1;for(;;){for(I=T-Q,z=y[N]<L?(P=0,y[N]):y[N]>L?(P=pe[we+y[N]],Z[re+y[N]]):(P=96,0),w=1<<T-Q,k=C=1<<W;m[M+(H>>Q)+(C-=w)]=I<<24|P<<16|z|0,C!==0;);for(w=1<<T-1;H&w;)w>>=1;if(w!==0?(H&=w-1,H+=w):H=0,N++,--K[T]==0){if(T===D)break;T=h[p+y[N]]}if(G<T&&(H&A)!==x){for(Q===0&&(Q=G),M+=k,Y=1<<(W=T-Q);W+Q<D&&!((Y-=K[W+Q])<=0);)W++,Y<<=1;if(ie+=1<<W,d===1&&852<ie||d===2&&592<ie)return 1;m[x=H&A]=G<<24|W<<16|M-_|0}}return H!==0&&(m[M+H]=T-Q<<24|64<<16|0),v.bits=G,0}},{"../utils/common":41}],51:[function(n,r,l){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(n,r,l){var o=n("../utils/common"),i=0,s=1;function c(O){for(var V=O.length;0<=--V;)O[V]=0}var f=0,d=29,h=256,p=h+1+d,g=30,m=19,_=2*p+1,y=15,v=16,w=7,C=256,x=16,A=17,M=18,L=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],I=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],R=new Array(2*(p+2));c(R);var T=new Array(2*g);c(T);var N=new Array(512);c(N);var k=new Array(256);c(k);var D=new Array(d);c(D);var G,W,Q,Y=new Array(g);function ie(O,V,ae,ce,q){this.static_tree=O,this.extra_bits=V,this.extra_base=ae,this.elems=ce,this.max_length=q,this.has_stree=O&&O.length}function H(O,V){this.dyn_tree=O,this.max_code=0,this.stat_desc=V}function Z(O){return O<256?N[O]:N[256+(O>>>7)]}function re(O,V){O.pending_buf[O.pending++]=255&V,O.pending_buf[O.pending++]=V>>>8&255}function K(O,V,ae){O.bi_valid>v-ae?(O.bi_buf|=V<<O.bi_valid&65535,re(O,O.bi_buf),O.bi_buf=V>>v-O.bi_valid,O.bi_valid+=ae-v):(O.bi_buf|=V<<O.bi_valid&65535,O.bi_valid+=ae)}function X(O,V,ae){K(O,ae[2*V],ae[2*V+1])}function pe(O,V){for(var ae=0;ae|=1&O,O>>>=1,ae<<=1,0<--V;);return ae>>>1}function we(O,V,ae){var ce,q,he=new Array(y+1),_e=0;for(ce=1;ce<=y;ce++)he[ce]=_e=_e+ae[ce-1]<<1;for(q=0;q<=V;q++){var de=O[2*q+1];de!==0&&(O[2*q]=pe(he[de]++,de))}}function Ee(O){var V;for(V=0;V<p;V++)O.dyn_ltree[2*V]=0;for(V=0;V<g;V++)O.dyn_dtree[2*V]=0;for(V=0;V<m;V++)O.bl_tree[2*V]=0;O.dyn_ltree[2*C]=1,O.opt_len=O.static_len=0,O.last_lit=O.matches=0}function le(O){8<O.bi_valid?re(O,O.bi_buf):0<O.bi_valid&&(O.pending_buf[O.pending++]=O.bi_buf),O.bi_buf=0,O.bi_valid=0}function ke(O,V,ae,ce){var q=2*V,he=2*ae;return O[q]<O[he]||O[q]===O[he]&&ce[V]<=ce[ae]}function ue(O,V,ae){for(var ce=O.heap[ae],q=ae<<1;q<=O.heap_len&&(q<O.heap_len&&ke(V,O.heap[q+1],O.heap[q],O.depth)&&q++,!ke(V,ce,O.heap[q],O.depth));)O.heap[ae]=O.heap[q],ae=q,q<<=1;O.heap[ae]=ce}function ne(O,V,ae){var ce,q,he,_e,de=0;if(O.last_lit!==0)for(;ce=O.pending_buf[O.d_buf+2*de]<<8|O.pending_buf[O.d_buf+2*de+1],q=O.pending_buf[O.l_buf+de],de++,ce===0?X(O,q,V):(X(O,(he=k[q])+h+1,V),(_e=L[he])!==0&&K(O,q-=D[he],_e),X(O,he=Z(--ce),ae),(_e=I[he])!==0&&K(O,ce-=Y[he],_e)),de<O.last_lit;);X(O,C,V)}function Ce(O,V){var ae,ce,q,he=V.dyn_tree,_e=V.stat_desc.static_tree,de=V.stat_desc.has_stree,Te=V.stat_desc.elems,ze=-1;for(O.heap_len=0,O.heap_max=_,ae=0;ae<Te;ae++)he[2*ae]!==0?(O.heap[++O.heap_len]=ze=ae,O.depth[ae]=0):he[2*ae+1]=0;for(;O.heap_len<2;)he[2*(q=O.heap[++O.heap_len]=ze<2?++ze:0)]=1,O.depth[q]=0,O.opt_len--,de&&(O.static_len-=_e[2*q+1]);for(V.max_code=ze,ae=O.heap_len>>1;1<=ae;ae--)ue(O,he,ae);for(q=Te;ae=O.heap[1],O.heap[1]=O.heap[O.heap_len--],ue(O,he,1),ce=O.heap[1],O.heap[--O.heap_max]=ae,O.heap[--O.heap_max]=ce,he[2*q]=he[2*ae]+he[2*ce],O.depth[q]=(O.depth[ae]>=O.depth[ce]?O.depth[ae]:O.depth[ce])+1,he[2*ae+1]=he[2*ce+1]=q,O.heap[1]=q++,ue(O,he,1),2<=O.heap_len;);O.heap[--O.heap_max]=O.heap[1],function(ve,Ae){var De,Be,We,oe,se,Ne,Me=Ae.dyn_tree,Re=Ae.max_code,be=Ae.stat_desc.static_tree,Ue=Ae.stat_desc.has_stree,it=Ae.stat_desc.extra_bits,Je=Ae.stat_desc.extra_base,Ie=Ae.stat_desc.max_length,Ge=0;for(oe=0;oe<=y;oe++)ve.bl_count[oe]=0;for(Me[2*ve.heap[ve.heap_max]+1]=0,De=ve.heap_max+1;De<_;De++)Ie<(oe=Me[2*Me[2*(Be=ve.heap[De])+1]+1]+1)&&(oe=Ie,Ge++),Me[2*Be+1]=oe,Re<Be||(ve.bl_count[oe]++,se=0,Je<=Be&&(se=it[Be-Je]),Ne=Me[2*Be],ve.opt_len+=Ne*(oe+se),Ue&&(ve.static_len+=Ne*(be[2*Be+1]+se)));if(Ge!==0){do{for(oe=Ie-1;ve.bl_count[oe]===0;)oe--;ve.bl_count[oe]--,ve.bl_count[oe+1]+=2,ve.bl_count[Ie]--,Ge-=2}while(0<Ge);for(oe=Ie;oe!==0;oe--)for(Be=ve.bl_count[oe];Be!==0;)Re<(We=ve.heap[--De])||(Me[2*We+1]!==oe&&(ve.opt_len+=(oe-Me[2*We+1])*Me[2*We],Me[2*We+1]=oe),Be--)}}(O,V),we(he,ze,O.bl_count)}function S(O,V,ae){var ce,q,he=-1,_e=V[1],de=0,Te=7,ze=4;for(_e===0&&(Te=138,ze=3),V[2*(ae+1)+1]=65535,ce=0;ce<=ae;ce++)q=_e,_e=V[2*(ce+1)+1],++de<Te&&q===_e||(de<ze?O.bl_tree[2*q]+=de:q!==0?(q!==he&&O.bl_tree[2*q]++,O.bl_tree[2*x]++):de<=10?O.bl_tree[2*A]++:O.bl_tree[2*M]++,he=q,ze=(de=0)===_e?(Te=138,3):q===_e?(Te=6,3):(Te=7,4))}function te(O,V,ae){var ce,q,he=-1,_e=V[1],de=0,Te=7,ze=4;for(_e===0&&(Te=138,ze=3),ce=0;ce<=ae;ce++)if(q=_e,_e=V[2*(ce+1)+1],!(++de<Te&&q===_e)){if(de<ze)for(;X(O,q,O.bl_tree),--de!=0;);else q!==0?(q!==he&&(X(O,q,O.bl_tree),de--),X(O,x,O.bl_tree),K(O,de-3,2)):de<=10?(X(O,A,O.bl_tree),K(O,de-3,3)):(X(O,M,O.bl_tree),K(O,de-11,7));he=q,ze=(de=0)===_e?(Te=138,3):q===_e?(Te=6,3):(Te=7,4)}}c(Y);var J=!1;function U(O,V,ae,ce){K(O,(f<<1)+(ce?1:0),3),function(q,he,_e,de){le(q),re(q,_e),re(q,~_e),o.arraySet(q.pending_buf,q.window,he,_e,q.pending),q.pending+=_e}(O,V,ae)}l._tr_init=function(O){J||(function(){var V,ae,ce,q,he,_e=new Array(y+1);for(q=ce=0;q<d-1;q++)for(D[q]=ce,V=0;V<1<<L[q];V++)k[ce++]=q;for(k[ce-1]=q,q=he=0;q<16;q++)for(Y[q]=he,V=0;V<1<<I[q];V++)N[he++]=q;for(he>>=7;q<g;q++)for(Y[q]=he<<7,V=0;V<1<<I[q]-7;V++)N[256+he++]=q;for(ae=0;ae<=y;ae++)_e[ae]=0;for(V=0;V<=143;)R[2*V+1]=8,V++,_e[8]++;for(;V<=255;)R[2*V+1]=9,V++,_e[9]++;for(;V<=279;)R[2*V+1]=7,V++,_e[7]++;for(;V<=287;)R[2*V+1]=8,V++,_e[8]++;for(we(R,p+1,_e),V=0;V<g;V++)T[2*V+1]=5,T[2*V]=pe(V,5);G=new ie(R,L,h+1,p,y),W=new ie(T,I,0,g,y),Q=new ie(new Array(0),P,0,m,w)}(),J=!0),O.l_desc=new H(O.dyn_ltree,G),O.d_desc=new H(O.dyn_dtree,W),O.bl_desc=new H(O.bl_tree,Q),O.bi_buf=0,O.bi_valid=0,Ee(O)},l._tr_stored_block=U,l._tr_flush_block=function(O,V,ae,ce){var q,he,_e=0;0<O.level?(O.strm.data_type===2&&(O.strm.data_type=function(de){var Te,ze=4093624447;for(Te=0;Te<=31;Te++,ze>>>=1)if(1&ze&&de.dyn_ltree[2*Te]!==0)return i;if(de.dyn_ltree[18]!==0||de.dyn_ltree[20]!==0||de.dyn_ltree[26]!==0)return s;for(Te=32;Te<h;Te++)if(de.dyn_ltree[2*Te]!==0)return s;return i}(O)),Ce(O,O.l_desc),Ce(O,O.d_desc),_e=function(de){var Te;for(S(de,de.dyn_ltree,de.l_desc.max_code),S(de,de.dyn_dtree,de.d_desc.max_code),Ce(de,de.bl_desc),Te=m-1;3<=Te&&de.bl_tree[2*z[Te]+1]===0;Te--);return de.opt_len+=3*(Te+1)+5+5+4,Te}(O),q=O.opt_len+3+7>>>3,(he=O.static_len+3+7>>>3)<=q&&(q=he)):q=he=ae+5,ae+4<=q&&V!==-1?U(O,V,ae,ce):O.strategy===4||he===q?(K(O,2+(ce?1:0),3),ne(O,R,T)):(K(O,4+(ce?1:0),3),function(de,Te,ze,ve){var Ae;for(K(de,Te-257,5),K(de,ze-1,5),K(de,ve-4,4),Ae=0;Ae<ve;Ae++)K(de,de.bl_tree[2*z[Ae]+1],3);te(de,de.dyn_ltree,Te-1),te(de,de.dyn_dtree,ze-1)}(O,O.l_desc.max_code+1,O.d_desc.max_code+1,_e+1),ne(O,O.dyn_ltree,O.dyn_dtree)),Ee(O),ce&&le(O)},l._tr_tally=function(O,V,ae){return O.pending_buf[O.d_buf+2*O.last_lit]=V>>>8&255,O.pending_buf[O.d_buf+2*O.last_lit+1]=255&V,O.pending_buf[O.l_buf+O.last_lit]=255&ae,O.last_lit++,V===0?O.dyn_ltree[2*ae]++:(O.matches++,V--,O.dyn_ltree[2*(k[ae]+h+1)]++,O.dyn_dtree[2*Z(V)]++),O.last_lit===O.lit_bufsize-1},l._tr_align=function(O){K(O,2,3),X(O,C,R),function(V){V.bi_valid===16?(re(V,V.bi_buf),V.bi_buf=0,V.bi_valid=0):8<=V.bi_valid&&(V.pending_buf[V.pending++]=255&V.bi_buf,V.bi_buf>>=8,V.bi_valid-=8)}(O)}},{"../utils/common":41}],53:[function(n,r,l){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,l){(function(o){(function(i,s){if(!i.setImmediate){var c,f,d,h,p=1,g={},m=!1,_=i.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(i);y=y&&y.setTimeout?y:i,c={}.toString.call(i.process)==="[object process]"?function(x){process.nextTick(function(){w(x)})}:function(){if(i.postMessage&&!i.importScripts){var x=!0,A=i.onmessage;return i.onmessage=function(){x=!1},i.postMessage("","*"),i.onmessage=A,x}}()?(h="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",C,!1):i.attachEvent("onmessage",C),function(x){i.postMessage(h+x,"*")}):i.MessageChannel?((d=new MessageChannel).port1.onmessage=function(x){w(x.data)},function(x){d.port2.postMessage(x)}):_&&"onreadystatechange"in _.createElement("script")?(f=_.documentElement,function(x){var A=_.createElement("script");A.onreadystatechange=function(){w(x),A.onreadystatechange=null,f.removeChild(A),A=null},f.appendChild(A)}):function(x){setTimeout(w,0,x)},y.setImmediate=function(x){typeof x!="function"&&(x=new Function(""+x));for(var A=new Array(arguments.length-1),M=0;M<A.length;M++)A[M]=arguments[M+1];var L={callback:x,args:A};return g[p]=L,c(p),p++},y.clearImmediate=v}function v(x){delete g[x]}function w(x){if(m)setTimeout(w,0,x);else{var A=g[x];if(A){m=!0;try{(function(M){var L=M.callback,I=M.args;switch(I.length){case 0:L();break;case 1:L(I[0]);break;case 2:L(I[0],I[1]);break;case 3:L(I[0],I[1],I[2]);break;default:L.apply(s,I)}})(A)}finally{v(x),m=!1}}}}function C(x){x.source===i&&typeof x.data=="string"&&x.data.indexOf(h)===0&&w(+x.data.slice(h.length))}})(typeof self>"u"?o===void 0?this:o:self)}).call(this,typeof ml<"u"?ml:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(jc);var Ld=jc.exports;const Nd=Id(Ld);function cs(e,t,n){const r=e.slice();return r[150]=t[n],r}function fs(e,t,n){const r=e.slice();return r[153]=t[n],r}function ds(e,t,n){const r=e.slice();return r[156]=t[n],r}function hs(e,t,n){const r=e.slice();return r[156]=t[n],r}function ps(e,t,n){const r=e.slice();return r[161]=t[n],r}function gs(e,t,n){const r=e.slice();return r[156]=t[n],r}function ms(e,t,n){const r=e.slice();return r[166]=t[n],r}function _s(e,t,n){const r=e.slice();return r[169]=t[n],r}function bs(e){let t,n,r,l,o,i,s;return{c(){t=b("div"),n=b("div"),r=ge("svg"),l=ge("polyline"),o=E(),i=b("p"),s=F(e[19]),a(l,"points","20 6 9 17 4 12"),a(r,"class","w-5 h-5 text-green-600 flex-shrink-0"),a(r,"viewBox","0 0 24 24"),a(r,"fill","none"),a(r,"stroke","currentColor"),a(r,"stroke-width","2"),a(r,"stroke-linecap","round"),a(r,"stroke-linejoin","round"),a(i,"class","text-sm font-medium text-green-800"),a(n,"class","bg-green-50 border border-green-200 rounded-lg shadow-lg px-4 py-3 flex items-center gap-3 animate-in fade-in slide-in-from-bottom-2 duration-300"),a(t,"class","fixed bottom-4 right-4 z-50 max-w-sm")},m(c,f){B(c,t,f),u(t,n),u(n,r),u(r,l),u(n,o),u(n,i),u(i,s)},p(c,f){f[0]&524288&&ee(s,c[19])},d(c){c&&j(t)}}}function ys(e){let t,n,r=e[79][e[169]].icon+"",l,o=e[79][e[169]].label+"",i,s,c,f=(e[9][e[169]]||0)+"",d,h,p,g,m,_;function y(){return e[83](e[169])}return{c(){t=b("button"),n=b("span"),l=E(),i=F(o),s=E(),c=b("span"),d=F(f),p=E(),a(n,"class","inline-flex"),a(c,"class",h="ml-1 px-1.5 py-0.5 rounded-full text-xs "+(e[0]===e[169]?"bg-indigo-100 text-indigo-700":"bg-gray-100 text-gray-600")),a(t,"class",g="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px flex items-center gap-1.5 "+(e[0]===e[169]?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))},m(v,w){B(v,t,w),u(t,n),n.innerHTML=r,u(t,l),u(t,i),u(t,s),u(t,c),u(c,d),u(t,p),m||(_=$(t,"click",y),m=!0)},p(v,w){e=v,w[0]&512&&f!==(f=(e[9][e[169]]||0)+"")&&ee(d,f),w[0]&1&&h!==(h="ml-1 px-1.5 py-0.5 rounded-full text-xs "+(e[0]===e[169]?"bg-indigo-100 text-indigo-700":"bg-gray-100 text-gray-600"))&&a(c,"class",h),w[0]&1&&g!==(g="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px flex items-center gap-1.5 "+(e[0]===e[169]?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))&&a(t,"class",g)},d(v){v&&j(t),m=!1,_()}}}function vs(e){let t,n,r,l=e[34]?'<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="animate-spin" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>':'<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>',o,i=e[34]?"Exporting…":"Export JSON ▾",s,c,f,d,h,p,g,m=e[37]&&ws(e),_=e[36]&&ks(e);return{c(){t=b("div"),n=b("button"),r=new Sc(!1),o=E(),s=F(i),c=E(),m&&m.c(),f=E(),_&&_.c(),d=E(),h=b("button"),h.textContent="Import",r.a=o,a(n,"class","px-3 py-1.5 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5"),n.disabled=e[34],a(t,"class","relative"),a(h,"class","px-3 py-1.5 border border-gray-300 rounded-md text-sm hover:bg-gray-50")},m(y,v){B(y,t,v),u(t,n),r.m(l,n),u(n,o),u(n,s),u(t,c),m&&m.m(t,null),B(y,f,v),_&&_.m(y,v),B(y,d,v),B(y,h,v),p||(g=[$(n,"click",e[84]),$(h,"click",e[86])],p=!0)},p(y,v){v[1]&8&&l!==(l=y[34]?'<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="animate-spin" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>':'<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>')&&r.p(l),v[1]&8&&i!==(i=y[34]?"Exporting…":"Export JSON ▾")&&ee(s,i),v[1]&8&&(n.disabled=y[34]),y[37]?m?m.p(y,v):(m=ws(y),m.c(),m.m(t,null)):m&&(m.d(1),m=null),y[36]?_?_.p(y,v):(_=ks(y),_.c(),_.m(d.parentNode,d)):_&&(_.d(1),_=null)},d(y){y&&(j(t),j(f),j(d),j(h)),m&&m.d(),_&&_.d(y),p=!1,rt(g)}}}function ws(e){let t,n,r,l,o,i,s,c;return{c(){t=b("div"),n=E(),r=b("div"),l=b("button"),l.textContent="All languages (single file)",o=E(),i=b("button"),i.textContent="One file per language",a(t,"class","fixed inset-0 z-40"),a(t,"role","presentation"),a(l,"class","w-full text-left px-4 py-2.5 text-sm hover:bg-gray-50 rounded-t-md"),a(i,"class","w-full text-left px-4 py-2.5 text-sm hover:bg-gray-50 rounded-b-md border-t border-gray-100"),a(r,"class","absolute right-0 mt-1 w-56 bg-white border border-gray-200 rounded-md shadow-lg z-50")},m(f,d){B(f,t,d),B(f,n,d),B(f,r,d),u(r,l),u(r,o),u(r,i),s||(c=[$(t,"click",e[85]),$(l,"click",e[53]),$(i,"click",e[54])],s=!0)},p:je,d(f){f&&(j(t),j(n),j(r)),s=!1,rt(c)}}}function ks(e){let t,n,r;return{c(){t=b("span"),n=F(e[36]),a(t,"class",r="text-xs "+(e[36].includes("!")?"text-green-600":"text-red-600"))},m(l,o){B(l,t,o),u(t,n)},p(l,o){o[1]&32&&ee(n,l[36]),o[1]&32&&r!==(r="text-xs "+(l[36].includes("!")?"text-green-600":"text-red-600"))&&a(t,"class",r)},d(l){l&&j(t)}}}function xs(e){let t,n,r;return{c(){t=b("button"),t.textContent="+ Add",a(t,"class","px-3 py-1.5 border border-gray-300 rounded-md text-sm hover:bg-gray-50")},m(l,o){B(l,t,o),n||(r=$(t,"click",e[87]),n=!0)},p:je,d(l){l&&j(t),n=!1,r()}}}function Cs(e){let t,n,r,l=(e[35]||"Exporting translations...")+"",o,i,s,c,f,d,h,p,g;return{c(){t=b("div"),n=b("div"),r=b("span"),o=F(l),i=E(),s=b("span"),c=F(e[48]),f=F("%"),d=E(),h=b("div"),p=b("div"),a(n,"class","flex items-center justify-between text-xs font-medium text-gray-600"),a(p,"class","h-full bg-indigo-600 transition-all duration-200"),a(p,"style",g=`width: ${e[48]}%`),a(h,"class","mt-2 h-2 overflow-hidden rounded-full bg-indigo-100"),a(t,"class","mb-4 rounded-lg border border-indigo-200 bg-white px-3 py-3")},m(m,_){B(m,t,_),u(t,n),u(n,r),u(r,o),u(n,i),u(n,s),u(s,c),u(s,f),u(t,d),u(t,h),u(h,p)},p(m,_){_[1]&16&&l!==(l=(m[35]||"Exporting translations...")+"")&&ee(o,l),_[1]&131072&&ee(c,m[48]),_[1]&131072&&g!==(g=`width: ${m[48]}%`)&&a(p,"style",g)},d(m){m&&j(t)}}}function As(e){let t,n=(e[166].name||e[166].code||e[166])+"",r,l;return{c(){t=b("option"),r=F(n),t.__value=l=e[166].code||e[166],Pe(t,t.__value)},m(o,i){B(o,t,i),u(t,r)},p(o,i){i[0]&128&&n!==(n=(o[166].name||o[166].code||o[166])+"")&&ee(r,n),i[0]&128&&l!==(l=o[166].code||o[166])&&(t.__value=l,Pe(t,t.__value))},d(o){o&&j(t)}}}function Ss(e){let t,n=e[156].name+"",r,l;return{c(){t=b("option"),r=F(n),t.__value=l=e[156].id,Pe(t,t.__value)},m(o,i){B(o,t,i),u(t,r)},p(o,i){i[0]&32768&&n!==(n=o[156].name+"")&&ee(r,n),i[0]&32768&&l!==(l=o[156].id)&&(t.__value=l,Pe(t,t.__value))},d(o){o&&j(t)}}}function Ts(e){let t,n,r,l,o,i,s,c,f,d,h,p;return{c(){t=b("div"),n=b("input"),r=E(),l=b("input"),o=E(),i=b("input"),s=E(),c=b("button"),f=F("Save"),a(n,"placeholder","Key (original text)"),a(n,"class","flex-[2] px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(l,"placeholder","Context (optional)"),a(l,"class","flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(i,"placeholder","Translated value (optional)"),a(i,"class","flex-[2] px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(c,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),c.disabled=d=!e[27].trim(),a(t,"class","flex gap-2 mb-4")},m(g,m){B(g,t,m),u(t,n),Pe(n,e[27]),u(t,r),u(t,l),Pe(l,e[28]),u(t,o),u(t,i),Pe(i,e[29]),u(t,s),u(t,c),u(c,f),h||(p=[$(n,"input",e[96]),$(l,"input",e[97]),$(i,"input",e[98]),$(c,"click",e[77])],h=!0)},p(g,m){m[0]&134217728&&n.value!==g[27]&&Pe(n,g[27]),m[0]&268435456&&l.value!==g[28]&&Pe(l,g[28]),m[0]&536870912&&i.value!==g[29]&&Pe(i,g[29]),m[0]&134217728&&d!==(d=!g[27].trim())&&(c.disabled=d)},d(g){g&&j(t),h=!1,rt(p)}}}function Ms(e){let t,n,r,l,o,i;return{c(){t=b("div"),n=b("textarea"),r=E(),l=b("button"),l.textContent="Import",a(n,"rows","4"),a(n,"placeholder",'{"Hello": "你好", "Goodbye": "再见"}'),a(n,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm font-mono focus:outline-none focus:ring-2 focus:ring-indigo-500 resize-y"),a(l,"class","mt-2 px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700"),a(t,"class","mb-4")},m(s,c){B(s,t,c),u(t,n),Pe(n,e[30]),u(t,r),u(t,l),o||(i=[$(n,"input",e[99]),$(l,"click",e[78])],o=!0)},p(s,c){c[0]&1073741824&&Pe(n,s[30])},d(s){s&&j(t),o=!1,rt(i)}}}function Es(e){let t,n,r,l,o,i,s;function c(y,v){return y[22]?zd:Pd}let f=c(e),d=f(e),h=Fe(e[79][e[0]].actions),p=[];for(let y=0;y<h.length;y+=1)p[y]=Is(ps(e,h,y));let g=e[15].length>0&&Ls(e),m=e[0]==="trash"&&Fs(e),_=(e[22]||e[24]>0)&&js(e);return{c(){t=b("div"),n=b("span"),d.c(),r=E();for(let y=0;y<p.length;y+=1)p[y].c();l=E(),g&&g.c(),o=E(),m&&m.c(),i=E(),_&&_.c(),s=Ct(),a(n,"class","text-sm text-indigo-700 font-medium"),a(t,"class","flex items-center gap-3 mb-3 p-3 bg-indigo-50 rounded-lg border border-indigo-200")},m(y,v){B(y,t,v),u(t,n),d.m(n,null),u(t,r);for(let w=0;w<p.length;w+=1)p[w]&&p[w].m(t,null);u(t,l),g&&g.m(t,null),u(t,o),m&&m.m(t,null),B(y,i,v),_&&_.m(y,v),B(y,s,v)},p(y,v){if(f===(f=c(y))&&d?d.p(y,v):(d.d(1),d=f(y),d&&(d.c(),d.m(n,null))),v[0]&4194305|v[2]&132096){h=Fe(y[79][y[0]].actions);let w;for(w=0;w<h.length;w+=1){const C=ps(y,h,w);p[w]?p[w].p(C,v):(p[w]=Is(C),p[w].c(),p[w].m(t,l))}for(;w<p.length;w+=1)p[w].d(1);p.length=h.length}y[15].length>0?g?g.p(y,v):(g=Ls(y),g.c(),g.m(t,o)):g&&(g.d(1),g=null),y[0]==="trash"?m?m.p(y,v):(m=Fs(y),m.c(),m.m(t,null)):m&&(m.d(1),m=null),y[22]||y[24]>0?_?_.p(y,v):(_=js(y),_.c(),_.m(s.parentNode,s)):_&&(_.d(1),_=null)},d(y){y&&(j(t),j(i),j(s)),d.d(),ft(p,y),g&&g.d(),m&&m.d(),_&&_.d(y)}}}function Pd(e){let t=e[14].size+"",n,r;return{c(){n=F(t),r=F(" selected")},m(l,o){B(l,n,o),B(l,r,o)},p(l,o){o[0]&16384&&t!==(t=l[14].size+"")&&ee(n,t)},d(l){l&&(j(n),j(r))}}}function zd(e){let t,n,r,l,o;return{c(){t=F(e[23]),n=E(),r=F(e[4]),l=F(" / "),o=F(e[5])},m(i,s){B(i,t,s),B(i,n,s),B(i,r,s),B(i,l,s),B(i,o,s)},p(i,s){s[0]&8388608&&ee(t,i[23]),s[0]&16&&ee(r,i[4]),s[0]&32&&ee(o,i[5])},d(i){i&&(j(t),j(n),j(r),j(l),j(o))}}}function Is(e){let t,n=e[161].label+"",r,l,o,i,s;function c(){return e[100](e[161])}return{c(){t=b("button"),r=F(n),l=E(),a(t,"class",o="px-3 py-1.5 text-white text-sm rounded-md "+e[161].color+" disabled:opacity-50 disabled:cursor-not-allowed"),t.disabled=e[22]},m(f,d){B(f,t,d),u(t,r),u(t,l),i||(s=$(t,"click",c),i=!0)},p(f,d){e=f,d[0]&1&&n!==(n=e[161].label+"")&&ee(r,n),d[0]&1&&o!==(o="px-3 py-1.5 text-white text-sm rounded-md "+e[161].color+" disabled:opacity-50 disabled:cursor-not-allowed")&&a(t,"class",o),d[0]&4194304&&(t.disabled=e[22])},d(f){f&&j(t),i=!1,s()}}}function Ls(e){let t,n,r,l,o,i,s=e[16]&&Ns(e);return{c(){t=b("div"),n=b("button"),r=F("Label ▾"),l=E(),s&&s.c(),a(n,"class","px-3 py-1.5 bg-amber-500 text-white text-sm rounded-md hover:bg-amber-600 disabled:opacity-50"),n.disabled=e[22],a(t,"class","relative")},m(c,f){B(c,t,f),u(t,n),u(n,r),u(t,l),s&&s.m(t,null),o||(i=$(n,"click",e[101]),o=!0)},p(c,f){f[0]&4194304&&(n.disabled=c[22]),c[16]?s?s.p(c,f):(s=Ns(c),s.c(),s.m(t,null)):s&&(s.d(1),s=null)},d(c){c&&j(t),s&&s.d(),o=!1,i()}}}function Ns(e){let t,n,r,l,o,i,s,c,f=Fe(e[15]),d=[];for(let p=0;p<f.length;p+=1)d[p]=Ps(hs(e,f,p));let h=e[13]&&zs(e);return{c(){t=b("div"),n=E(),r=b("div"),l=b("div"),l.textContent="Assign Label",o=E();for(let p=0;p<d.length;p+=1)d[p].c();i=E(),h&&h.c(),a(t,"class","fixed inset-0 z-40"),a(t,"role","presentation"),a(l,"class","px-3 py-2 text-xs text-gray-400 font-semibold uppercase border-b border-gray-100"),a(r,"class","absolute left-0 mt-1 w-52 bg-white border border-gray-200 rounded-md shadow-lg z-50 max-h-60 overflow-y-auto")},m(p,g){B(p,t,g),B(p,n,g),B(p,r,g),u(r,l),u(r,o);for(let m=0;m<d.length;m+=1)d[m]&&d[m].m(r,null);u(r,i),h&&h.m(r,null),s||(c=$(t,"click",e[102]),s=!0)},p(p,g){if(g[0]&32768|g[1]&536870912){f=Fe(p[15]);let m;for(m=0;m<f.length;m+=1){const _=hs(p,f,m);d[m]?d[m].p(_,g):(d[m]=Ps(_),d[m].c(),d[m].m(r,i))}for(;m<d.length;m+=1)d[m].d(1);d.length=f.length}p[13]?h?h.p(p,g):(h=zs(p),h.c(),h.m(r,null)):h&&(h.d(1),h=null)},d(p){p&&(j(t),j(n),j(r)),ft(d,p),h&&h.d(),s=!1,c()}}}function Ps(e){let t,n,r,l=e[156].name+"",o,i,s;function c(){return e[103](e[156])}return{c(){t=b("button"),n=b("span"),r=E(),o=F(l),a(n,"class","w-3 h-3 rounded-full shrink-0"),gt(n,"background-color",e[156].color),a(t,"class","w-full text-left px-3 py-2 text-sm hover:bg-gray-50 flex items-center gap-2")},m(f,d){B(f,t,d),u(t,n),u(t,r),u(t,o),i||(s=$(t,"click",c),i=!0)},p(f,d){e=f,d[0]&32768&>(n,"background-color",e[156].color),d[0]&32768&&l!==(l=e[156].name+"")&&ee(o,l)},d(f){f&&j(t),i=!1,s()}}}function zs(e){let t,n,r,l=Fe(e[15]),o=[];for(let i=0;i<l.length;i+=1)o[i]=Ds(ds(e,l,i));return{c(){t=b("div"),n=b("div"),n.textContent="Remove Label",r=E();for(let i=0;i<o.length;i+=1)o[i].c();a(n,"class","px-3 py-2 text-xs text-gray-400 font-semibold uppercase"),a(t,"class","border-t border-gray-100")},m(i,s){B(i,t,s),u(t,n),u(t,r);for(let c=0;c<o.length;c+=1)o[c]&&o[c].m(t,null)},p(i,s){if(s[0]&32768|s[1]&1073741824){l=Fe(i[15]);let c;for(c=0;c<l.length;c+=1){const f=ds(i,l,c);o[c]?o[c].p(f,s):(o[c]=Ds(f),o[c].c(),o[c].m(t,null))}for(;c<o.length;c+=1)o[c].d(1);o.length=l.length}},d(i){i&&j(t),ft(o,i)}}}function Ds(e){let t,n,r,l=e[156].name+"",o,i,s,c;function f(){return e[104](e[156])}return{c(){t=b("button"),n=b("span"),r=F(`
|
|
15
|
+
Remove "`),o=F(l),i=F(`"
|
|
16
|
+
`),a(n,"class","w-3 h-3 rounded-full shrink-0"),gt(n,"background-color",e[156].color),a(t,"class","w-full text-left px-3 py-2 text-sm hover:bg-red-50 text-red-600 flex items-center gap-2")},m(d,h){B(d,t,h),u(t,n),u(t,r),u(t,o),u(t,i),s||(c=$(t,"click",f),s=!0)},p(d,h){e=d,h[0]&32768&>(n,"background-color",e[156].color),h[0]&32768&&l!==(l=e[156].name+"")&&ee(o,l)},d(d){d&&j(t),s=!1,c()}}}function Fs(e){let t,n=e[22]&&e[23]==="Deleting"?"Deleting…":"Delete Permanently",r,l,o;return{c(){t=b("button"),r=F(n),a(t,"class","px-3 py-1.5 bg-red-600 text-white text-sm rounded-md hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed"),t.disabled=e[22]},m(i,s){B(i,t,s),u(t,r),l||(o=$(t,"click",e[73]),l=!0)},p(i,s){s[0]&12582912&&n!==(n=i[22]&&i[23]==="Deleting"?"Deleting…":"Delete Permanently")&&ee(r,n),s[0]&4194304&&(t.disabled=i[22])},d(i){i&&j(t),l=!1,o()}}}function js(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,m,_,y,v;function w(A,M){if(A[22])return Fd;if(A[24]>0)return Dd}let C=w(e),x=C&&C(e);return{c(){t=b("div"),n=b("div"),r=b("span"),x&&x.c(),l=E(),o=b("span"),i=F(e[49]),s=F("%"),c=E(),f=b("div"),d=b("div"),p=E(),g=b("div"),m=F(e[4]),_=F(" of "),y=F(e[5]),v=F(" processed"),a(n,"class","flex items-center justify-between text-xs font-medium text-gray-600"),a(d,"class","h-full bg-indigo-600 transition-all duration-200"),a(d,"style",h=`width: ${e[49]}%`),a(f,"class","mt-2 h-2 overflow-hidden rounded-full bg-indigo-100"),a(g,"class","mt-2 text-xs text-gray-500"),a(t,"class","mb-4 rounded-lg border border-indigo-200 bg-white px-3 py-3")},m(A,M){B(A,t,M),u(t,n),u(n,r),x&&x.m(r,null),u(n,l),u(n,o),u(o,i),u(o,s),u(t,c),u(t,f),u(f,d),u(t,p),u(t,g),u(g,m),u(g,_),u(g,y),u(g,v)},p(A,M){C===(C=w(A))&&x?x.p(A,M):(x&&x.d(1),x=C&&C(A),x&&(x.c(),x.m(r,null))),M[1]&262144&&ee(i,A[49]),M[1]&262144&&h!==(h=`width: ${A[49]}%`)&&a(d,"style",h),M[0]&16&&ee(m,A[4]),M[0]&32&&ee(y,A[5])},d(A){A&&j(t),x&&x.d()}}}function Dd(e){let t,n,r;return{c(){t=F("Finished with "),n=F(e[24]),r=F(" failure(s)")},m(l,o){B(l,t,o),B(l,n,o),B(l,r,o)},p(l,o){o[0]&16777216&&ee(n,l[24])},d(l){l&&(j(t),j(n),j(r))}}}function Fd(e){let t,n;return{c(){t=F(e[23]),n=F(" selected items...")},m(r,l){B(r,t,l),B(r,n,l)},p(r,l){l[0]&8388608&&ee(t,r[23])},d(r){r&&(j(t),j(n))}}}function Bs(e){let t,n;return t=new Fc({props:{jobs:e[44],onCancel:e[69],onDismiss:e[70]}}),{c(){nn(t.$$.fragment)},m(r,l){Kt(t,r,l),n=!0},p(r,l){const o={};l[1]&8192&&(o.jobs=r[44]),t.$set(o)},i(r){n||(at(t.$$.fragment,r),n=!0)},o(r){ct(t.$$.fragment,r),n=!1},d(r){qt(t,r)}}}function jd(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,m,_,y,v,w=[],C=new Map,x,A,M,L,I,P,z,R,T,N=Fe(e[1]);const k=G=>G[153].key;for(let G=0;G<N.length;G+=1){let W=fs(e,N,G),Q=k(W);C.set(Q,w[G]=Os(Q,W))}let D=e[50]>1&&Us(e);return{c(){t=b("div"),n=b("table"),r=b("thead"),l=b("tr"),o=b("th"),i=b("input"),s=E(),c=b("th"),c.textContent="Key",f=E(),d=b("th"),d.textContent="DomContext",h=E(),p=b("th"),g=F("Translation ("),m=F(e[8]),_=F(")"),y=E(),v=b("tbody");for(let G=0;G<w.length;G+=1)w[G].c();x=E(),A=b("div"),M=b("p"),L=F(e[3]),I=F(" key(s)"),P=E(),D&&D.c(),a(i,"type","checkbox"),i.checked=e[17],a(i,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(o,"class","w-10 px-3 py-2.5"),a(c,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),a(d,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),a(p,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),a(l,"class","bg-gray-50 border-b border-gray-200"),a(n,"class","w-full"),a(t,"class","bg-white rounded-lg border border-gray-200 overflow-hidden"),a(M,"class","text-xs text-gray-400"),a(A,"class","flex items-center justify-between mt-3")},m(G,W){B(G,t,W),u(t,n),u(n,r),u(r,l),u(l,o),u(o,i),u(l,s),u(l,c),u(l,f),u(l,d),u(l,h),u(l,p),u(p,g),u(p,m),u(p,_),u(n,y),u(n,v);for(let Q=0;Q<w.length;Q+=1)w[Q]&&w[Q].m(v,null);B(G,x,W),B(G,A,W),u(A,M),u(M,L),u(M,I),u(A,P),D&&D.m(A,null),z=!0,R||(T=$(i,"change",e[63]),R=!0)},p(G,W){(!z||W[0]&131072)&&(i.checked=G[17]),(!z||W[0]&256)&&ee(m,G[8]),W[0]&49155|W[1]&270582273|W[2]&24636&&(N=Fe(G[1]),Xt(),w=ol(w,W,k,1,G,N,C,v,Lc,Os,null,fs),Jt()),(!z||W[0]&8)&&ee(L,G[3]),G[50]>1?D?D.p(G,W):(D=Us(G),D.c(),D.m(A,null)):D&&(D.d(1),D=null)},i(G){if(!z){for(let W=0;W<N.length;W+=1)at(w[W]);z=!0}},o(G){for(let W=0;W<w.length;W+=1)ct(w[W]);z=!1},d(G){G&&(j(t),j(x),j(A));for(let W=0;W<w.length;W+=1)w[W].d();D&&D.d(),R=!1,T()}}}function Bd(e){let t;function n(o,i){return o[10]?Zd:o[0]==="pending"?Hd:o[0]==="approved"?Ud:Od}let r=n(e),l=r(e);return{c(){t=b("div"),l.c(),a(t,"class","text-center py-12 text-gray-400")},m(o,i){B(o,t,i),l.m(t,null)},p(o,i){r===(r=n(o))&&l?l.p(o,i):(l.d(1),l=r(o),l&&(l.c(),l.m(t,null)))},i:je,o:je,d(o){o&&j(t),l.d()}}}function Rd(e){let t;return{c(){t=b("div"),t.innerHTML='<svg width="40" height="40" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"><defs><style>@keyframes tspin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}#tr{animation:tspin 1.2s linear infinite;transform-origin:40px 40px}</style></defs><g id="tr"><circle cx="40" cy="40" r="34" fill="none" stroke="#e5e7eb" stroke-width="4"></circle><path d="M40 6 A34 34 0 0 1 74 40" fill="none" stroke="#2ECC88" stroke-width="4" stroke-linecap="round"></path><path d="M74 40 A34 34 0 0 1 56 70" fill="none" stroke="#3A8FE0" stroke-width="4" stroke-linecap="round"></path><path d="M56 70 A34 34 0 0 1 24 70" fill="none" stroke="#FFB833" stroke-width="4" stroke-linecap="round"></path></g></svg>',a(t,"class","flex justify-center py-8")},m(n,r){B(n,t,r)},p:je,i:je,o:je,d(n){n&&j(t)}}}function Rs(e){let t,n,r,l,o;return r=new Dc({props:{group:e[153],editable:e[0]==="approved"||e[0]==="pending",showAiAction:!0,aiBusy:e[40],onAiAction:e[67],showAria:!0,rowHasAria:e[52],onAriaAction:e[107],showVarEdit:!0,onVarEdit:e[108],showDetails:!0,onDetails:e[65],showLabels:!0,allLabels:e[15],onToggleLabel:e[59],onSaveMasterValue:e[76],onSaveValue:e[109]}}),{c(){t=b("tr"),n=b("td"),nn(r.$$.fragment),l=E(),a(n,"colspan","4"),a(n,"class","px-4 py-3"),a(t,"class","bg-gray-50 border-b border-gray-200")},m(i,s){B(i,t,s),u(t,n),Kt(r,n,null),u(t,l),o=!0},p(i,s){const c={};s[0]&2&&(c.group=i[153]),s[0]&1&&(c.editable=i[0]==="approved"||i[0]==="pending"),s[1]&512&&(c.aiBusy=i[40]),s[1]&32768&&(c.onAriaAction=i[107]),s[1]&16384&&(c.onVarEdit=i[108]),s[0]&32768&&(c.allLabels=i[15]),r.$set(c)},i(i){o||(at(r.$$.fragment,i),o=!0)},o(i){ct(r.$$.fragment,i),o=!1},d(i){i&&j(t),qt(r)}}}function Os(e,t){let n,r,l,o,i,s,c,f,d,h,p,g,m,_=t[153].key+"",y,v,w,C=t[153].total+"",x,A,M,L,I,P=t[153].total+"",z,R,T=t[153].total===1?"context":"contexts",N,k,D,G,W,Q=t[153].translatedCount+"",Y,ie,H=t[153].total+"",Z,re,K,X,pe,we,Ee,le;function ke(){return t[105](t[153])}function ue(){return t[106](t[153])}let ne=t[31]===t[153].key&&Rs(t);return{key:e,first:null,c(){n=b("tr"),r=b("td"),l=b("input"),s=E(),c=b("td"),f=b("div"),d=ge("svg"),h=ge("path"),g=E(),m=b("span"),y=F(_),v=E(),w=b("span"),x=F(C),L=E(),I=b("td"),z=F(P),R=E(),N=F(T),k=F(" — click to expand"),D=E(),G=b("td"),W=b("span"),Y=F(Q),ie=F("/"),Z=F(H),re=F(" translated"),X=E(),ne&&ne.c(),pe=Ct(),a(l,"type","checkbox"),l.checked=o=yl(t[153],t[14])==="all",l.indeterminate=i=yl(t[153],t[14])==="some",a(l,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(r,"class","px-3 py-2"),a(h,"fill-rule","evenodd"),a(h,"d","M7.293 4.293a1 1 0 011.414 0l5 5a1 1 0 010 1.414l-5 5a1 1 0 01-1.414-1.414L11.586 10 7.293 5.707a1 1 0 010-1.414z"),a(h,"clip-rule","evenodd"),a(d,"class",p="shrink-0 w-3 h-3 text-gray-400 transition-transform "+(t[31]===t[153].key?"rotate-90":"")),a(d,"viewBox","0 0 20 20"),a(d,"fill","currentColor"),a(m,"class","truncate flex-1 min-w-0"),a(w,"class","shrink-0 px-1.5 py-0.5 text-[10px] font-medium rounded-full bg-indigo-50 text-indigo-600 border border-indigo-100"),a(w,"title",A=t[153].total+" context(s)"),a(f,"class","flex items-center gap-2 min-w-0"),a(c,"class","px-3 py-2 font-mono text-sm text-gray-700 max-w-[320px]"),a(c,"title",M=t[153].key),a(I,"class","px-3 py-2 text-sm text-gray-500 whitespace-nowrap"),a(W,"class","font-semibold"),a(G,"class","px-3 py-2 text-sm text-gray-700 whitespace-nowrap"),a(n,"class",K="border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer "+(t[31]===t[153].key?"bg-indigo-50":"")),this.first=n},m(Ce,S){B(Ce,n,S),u(n,r),u(r,l),u(n,s),u(n,c),u(c,f),u(f,d),u(d,h),u(f,g),u(f,m),u(m,y),u(f,v),u(f,w),u(w,x),u(n,L),u(n,I),u(I,z),u(I,R),u(I,N),u(I,k),u(n,D),u(n,G),u(G,W),u(W,Y),u(W,ie),u(W,Z),u(G,re),B(Ce,X,S),ne&&ne.m(Ce,S),B(Ce,pe,S),we=!0,Ee||(le=[$(l,"change",ke),$(r,"click",jt(t[82])),$(n,"click",ue)],Ee=!0)},p(Ce,S){t=Ce,(!we||S[0]&16386&&o!==(o=yl(t[153],t[14])==="all"))&&(l.checked=o),(!we||S[0]&16386&&i!==(i=yl(t[153],t[14])==="some"))&&(l.indeterminate=i),(!we||S[0]&2|S[1]&1&&p!==(p="shrink-0 w-3 h-3 text-gray-400 transition-transform "+(t[31]===t[153].key?"rotate-90":"")))&&a(d,"class",p),(!we||S[0]&2)&&_!==(_=t[153].key+"")&&ee(y,_),(!we||S[0]&2)&&C!==(C=t[153].total+"")&&ee(x,C),(!we||S[0]&2&&A!==(A=t[153].total+" context(s)"))&&a(w,"title",A),(!we||S[0]&2&&M!==(M=t[153].key))&&a(c,"title",M),(!we||S[0]&2)&&P!==(P=t[153].total+"")&&ee(z,P),(!we||S[0]&2)&&T!==(T=t[153].total===1?"context":"contexts")&&ee(N,T),(!we||S[0]&2)&&Q!==(Q=t[153].translatedCount+"")&&ee(Y,Q),(!we||S[0]&2)&&H!==(H=t[153].total+"")&&ee(Z,H),(!we||S[0]&2|S[1]&1&&K!==(K="border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer "+(t[31]===t[153].key?"bg-indigo-50":"")))&&a(n,"class",K),t[31]===t[153].key?ne?(ne.p(t,S),S[0]&2|S[1]&1&&at(ne,1)):(ne=Rs(t),ne.c(),at(ne,1),ne.m(pe.parentNode,pe)):ne&&(Xt(),ct(ne,1,1,()=>{ne=null}),Jt())},i(Ce){we||(at(ne),we=!0)},o(Ce){ct(ne),we=!1},d(Ce){Ce&&(j(n),j(X),j(pe)),ne&&ne.d(Ce),Ee=!1,rt(le)}}}function Us(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,m,_,y,v,w,C,x,A,M,L,I,P,z,R,T,N;return{c(){t=b("div"),n=b("button"),r=F("«"),o=E(),i=b("button"),s=F("‹"),f=E(),d=b("span"),h=F("Page "),p=F(e[21]),g=F(" of "),m=F(e[50]),_=E(),y=b("button"),v=F("›"),C=E(),x=b("button"),A=F("»"),L=E(),I=b("select"),P=b("option"),P.textContent="25 / page",z=b("option"),z.textContent="50 / page",R=b("option"),R.textContent="100 / page",a(n,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),n.disabled=l=e[21]<=1,a(i,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),i.disabled=c=e[21]<=1,a(d,"class","px-3 py-1 text-xs text-gray-600"),a(y,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),y.disabled=w=e[21]>=e[50],a(x,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),x.disabled=M=e[21]>=e[50],P.__value=25,Pe(P,P.__value),z.__value=50,Pe(z,z.__value),R.__value=100,Pe(R,R.__value),a(I,"class","ml-2 px-2 py-1 text-xs border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[2]===void 0&&Dt(()=>e[114].call(I)),a(t,"class","flex items-center gap-1")},m(k,D){B(k,t,D),u(t,n),u(n,r),u(t,o),u(t,i),u(i,s),u(t,f),u(t,d),u(d,h),u(d,p),u(d,g),u(d,m),u(t,_),u(t,y),u(y,v),u(t,C),u(t,x),u(x,A),u(t,L),u(t,I),u(I,P),u(I,z),u(I,R),yt(I,e[2],!0),T||(N=[$(n,"click",e[110]),$(i,"click",e[111]),$(y,"click",e[112]),$(x,"click",e[113]),$(I,"change",e[114]),$(I,"change",e[115])],T=!0)},p(k,D){D[0]&2097152&&l!==(l=k[21]<=1)&&(n.disabled=l),D[0]&2097152&&c!==(c=k[21]<=1)&&(i.disabled=c),D[0]&2097152&&ee(p,k[21]),D[1]&524288&&ee(m,k[50]),D[0]&2097152|D[1]&524288&&w!==(w=k[21]>=k[50])&&(y.disabled=w),D[0]&2097152|D[1]&524288&&M!==(M=k[21]>=k[50])&&(x.disabled=M),D[0]&4&&yt(I,k[2])},d(k){k&&j(t),T=!1,rt(N)}}}function Od(e){let t;return{c(){t=b("p"),t.textContent="Trash is empty."},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function Ud(e){let t,n,r;return{c(){t=b("p"),t.textContent="No approved phrases yet.",n=E(),r=b("p"),r.textContent="Move phrases from Pending to start serving translations.",a(r,"class","text-sm mt-1")},m(l,o){B(l,t,o),B(l,n,o),B(l,r,o)},p:je,d(l){l&&(j(t),j(n),j(r))}}}function Hd(e){let t,n,r;return{c(){t=b("p"),t.textContent="No pending phrases.",n=E(),r=b("p"),r.textContent="Add the CDN script to a page to auto-discover text.",a(r,"class","text-sm mt-1")},m(l,o){B(l,t,o),B(l,n,o),B(l,r,o)},p:je,d(l){l&&(j(t),j(n),j(r))}}}function Zd(e){let t,n,r,l;return{c(){t=b("p"),n=F('No results for "'),r=F(e[10]),l=F('"')},m(o,i){B(o,t,i),u(t,n),u(t,r),u(t,l)},p(o,i){i[0]&1024&&ee(r,o[10])},d(o){o&&j(t)}}}function Hs(e){let t,n,r,l,o,i,s,c,f,d,h,p,g=e[42].key+"",m,_,y,v,w,C,x,A,M,L,I,P,z,R,T,N,k,D=e[40]?"Starting...":"Start Translation",G,W,Q,Y,ie=e[38].length===0&&Zs(),H=Fe(e[38]),Z=[];for(let re=0;re<H.length;re+=1)Z[re]=Ws(cs(e,H,re));return{c(){t=b("div"),n=b("div"),r=b("div"),l=b("h3"),l.textContent="AI Translate Group",o=E(),i=b("button"),i.textContent="×",s=E(),c=b("div"),f=b("div"),d=b("p"),d.textContent="Key",h=E(),p=b("p"),m=F(g),_=E(),y=b("div"),v=b("label"),v.textContent="Prompt",w=E(),C=b("select"),ie&&ie.c(),x=Ct();for(let re=0;re<Z.length;re+=1)Z[re].c();A=E(),M=b("label"),L=b("input"),I=F(`
|
|
17
|
+
Translate all contexts + master (unchecked = master only)`),P=E(),z=b("div"),R=b("button"),T=F("Cancel"),N=E(),k=b("button"),G=F(D),a(l,"class","text-sm font-semibold text-gray-800"),a(i,"class","text-gray-400 hover:text-gray-700 text-lg leading-none"),a(r,"class","px-5 py-4 border-b border-gray-100 flex items-center justify-between"),a(d,"class","text-xs text-gray-500 mb-1"),a(p,"class","text-sm text-gray-800 font-mono break-words"),a(v,"for","tm-ai-group-prompt"),a(v,"class","block text-xs text-gray-500 font-medium mb-1"),a(C,"id","tm-ai-group-prompt"),a(C,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[39]===void 0&&Dt(()=>e[116].call(C)),a(L,"type","checkbox"),a(L,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(M,"class","flex items-center gap-2 text-sm text-gray-700 cursor-pointer"),a(c,"class","px-5 py-4 space-y-3"),a(R,"class","px-3 py-1.5 text-sm border border-gray-300 rounded-md hover:bg-gray-50"),R.disabled=e[40],a(k,"class","px-3 py-1.5 text-sm bg-indigo-600 text-white rounded-md hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed"),k.disabled=W=!e[39]||e[40],a(z,"class","px-5 py-4 border-t border-gray-100 flex justify-end gap-2"),a(n,"class","w-full max-w-md rounded-xl bg-white shadow-2xl border border-gray-200"),a(t,"class","fixed inset-0 z-50 flex items-center justify-center p-4"),gt(t,"background","rgba(0,0,0,0.45)")},m(re,K){B(re,t,K),u(t,n),u(n,r),u(r,l),u(r,o),u(r,i),u(n,s),u(n,c),u(c,f),u(f,d),u(f,h),u(f,p),u(p,m),u(c,_),u(c,y),u(y,v),u(y,w),u(y,C),ie&&ie.m(C,null),u(C,x);for(let X=0;X<Z.length;X+=1)Z[X]&&Z[X].m(C,null);yt(C,e[39],!0),u(c,A),u(c,M),u(M,L),L.checked=e[43],u(M,I),u(n,P),u(n,z),u(z,R),u(R,T),u(z,N),u(z,k),u(k,G),Q||(Y=[$(i,"click",e[68]),$(C,"change",e[116]),$(L,"change",e[117]),$(R,"click",e[68]),$(k,"click",e[71]),$(t,"click",jr(e[68]))],Q=!0)},p(re,K){if(K[1]&2048&&g!==(g=re[42].key+"")&&ee(m,g),re[38].length===0?ie||(ie=Zs(),ie.c(),ie.m(C,x)):ie&&(ie.d(1),ie=null),K[1]&128){H=Fe(re[38]);let X;for(X=0;X<H.length;X+=1){const pe=cs(re,H,X);Z[X]?Z[X].p(pe,K):(Z[X]=Ws(pe),Z[X].c(),Z[X].m(C,null))}for(;X<Z.length;X+=1)Z[X].d(1);Z.length=H.length}K[1]&384&&yt(C,re[39]),K[1]&4096&&(L.checked=re[43]),K[1]&512&&(R.disabled=re[40]),K[1]&512&&D!==(D=re[40]?"Starting...":"Start Translation")&&ee(G,D),K[1]&896&&W!==(W=!re[39]||re[40])&&(k.disabled=W)},d(re){re&&j(t),ie&&ie.d(),ft(Z,re),Q=!1,rt(Y)}}}function Zs(e){let t;return{c(){t=b("option"),t.textContent="No prompts available",t.__value="",Pe(t,t.__value)},m(n,r){B(n,t,r)},d(n){n&&j(t)}}}function Ws(e){let t,n=e[150].name+"",r,l,o=e[150].version+"",i,s,c;return{c(){t=b("option"),r=F(n),l=F(" (v"),i=F(o),s=F(")"),t.__value=c=e[150].id,Pe(t,t.__value)},m(f,d){B(f,t,d),u(t,r),u(t,l),u(t,i),u(t,s)},p(f,d){d[1]&128&&n!==(n=f[150].name+"")&&ee(r,n),d[1]&128&&o!==(o=f[150].version+"")&&ee(i,o),d[1]&128&&c!==(c=f[150].id)&&(t.__value=c,Pe(t,t.__value))},d(f){f&&j(t)}}}function Ys(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,m=e[32].key+"",_,y,v,w,C,x,A=(e[32].context||"Word (no context)")+"",M,L,I,P,z,R,T,N=e[52](e[32])?"ARIA":"TEXT",k,D,G,W,Q,Y,ie,H,Z,re,K,X,pe=(e[32].status||"pending")+"",we,Ee,le,ke,ue,ne,Ce=(e[32].created_at||"—")+"",S,te,J,U,O,V,ae,ce;function q(ve,Ae){return ve[32].url?Yd:Wd}let he=q(e),_e=he(e);function de(ve,Ae){return ve[32].url&&ve[33][ve[32].url]?Xd:ve[32].url&&ve[33][ve[32].url]===null?Vd:Gd}let Te=de(e),ze=Te(e);return{c(){t=b("div"),n=b("div"),r=b("div"),l=b("h2"),l.textContent="Phrase Details",o=E(),i=b("button"),i.textContent="×",s=E(),c=b("div"),f=b("div"),d=b("div"),h=b("p"),h.textContent="Key",p=E(),g=b("p"),_=F(m),y=E(),v=b("div"),w=b("p"),w.textContent="Dom Context",C=E(),x=b("p"),M=F(A),L=E(),I=b("div"),P=b("p"),P.textContent="Type",z=E(),R=b("div"),T=b("span"),k=F(N),G=E(),W=b("div"),Q=b("p"),Q.textContent="Source URL",Y=E(),_e.c(),ie=E(),H=b("div"),Z=b("p"),Z.textContent="Status",re=E(),K=b("div"),X=b("span"),we=F(pe),Ee=E(),le=b("div"),ke=b("p"),ke.textContent="Discovered",ue=E(),ne=b("p"),S=F(Ce),te=E(),J=b("div"),U=b("p"),U.textContent="Screenshot",O=E(),V=b("div"),ze.c(),a(l,"class","text-sm font-semibold text-gray-800"),a(i,"class","text-gray-400 hover:text-gray-700 text-xl leading-none"),a(r,"class","flex items-center justify-between px-6 pt-5 pb-3 border-b border-gray-100 sticky top-0 bg-white"),a(h,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),a(g,"class","mt-1 text-base text-gray-900 break-words"),a(w,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),a(x,"class","mt-1 text-base text-gray-900 break-words"),a(P,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),a(T,"class",D="inline-flex items-center px-2 py-0.5 rounded-md text-xs font-semibold "+(e[52](e[32])?"text-amber-700 bg-amber-100":"text-gray-600 bg-gray-100")),a(R,"class","mt-1"),a(Q,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),a(Z,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),a(X,"class","inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold bg-amber-100 text-amber-800"),a(K,"class","mt-1"),a(ke,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),a(ne,"class","mt-1 text-sm text-gray-700"),a(f,"class","space-y-4"),a(U,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide mb-2"),a(V,"class","w-full h-[160px] rounded-xl border border-gray-200 bg-gray-50 flex items-center justify-center overflow-hidden"),a(J,"class","md:pt-1"),a(c,"class","px-6 py-5 grid grid-cols-1 md:grid-cols-[minmax(0,1fr)_280px] gap-6 text-sm"),a(n,"class","bg-white rounded-xl shadow-2xl w-full max-w-5xl max-h-[90vh] overflow-y-auto"),a(t,"class","fixed inset-0 z-50 flex items-center justify-center p-4"),gt(t,"background","rgba(0,0,0,0.45)")},m(ve,Ae){B(ve,t,Ae),u(t,n),u(n,r),u(r,l),u(r,o),u(r,i),u(n,s),u(n,c),u(c,f),u(f,d),u(d,h),u(d,p),u(d,g),u(g,_),u(f,y),u(f,v),u(v,w),u(v,C),u(v,x),u(x,M),u(f,L),u(f,I),u(I,P),u(I,z),u(I,R),u(R,T),u(T,k),u(f,G),u(f,W),u(W,Q),u(W,Y),_e.m(W,null),u(f,ie),u(f,H),u(H,Z),u(H,re),u(H,K),u(K,X),u(X,we),u(f,Ee),u(f,le),u(le,ke),u(le,ue),u(le,ne),u(ne,S),u(c,te),u(c,J),u(J,U),u(J,O),u(J,V),ze.m(V,null),ae||(ce=[$(i,"click",e[118]),$(t,"click",jr(e[119]))],ae=!0)},p(ve,Ae){Ae[1]&2&&m!==(m=ve[32].key+"")&&ee(_,m),Ae[1]&2&&A!==(A=(ve[32].context||"Word (no context)")+"")&&ee(M,A),Ae[1]&2&&N!==(N=ve[52](ve[32])?"ARIA":"TEXT")&&ee(k,N),Ae[1]&2&&D!==(D="inline-flex items-center px-2 py-0.5 rounded-md text-xs font-semibold "+(ve[52](ve[32])?"text-amber-700 bg-amber-100":"text-gray-600 bg-gray-100"))&&a(T,"class",D),he===(he=q(ve))&&_e?_e.p(ve,Ae):(_e.d(1),_e=he(ve),_e&&(_e.c(),_e.m(W,null))),Ae[1]&2&&pe!==(pe=(ve[32].status||"pending")+"")&&ee(we,pe),Ae[1]&2&&Ce!==(Ce=(ve[32].created_at||"—")+"")&&ee(S,Ce),Te===(Te=de(ve))&&ze?ze.p(ve,Ae):(ze.d(1),ze=Te(ve),ze&&(ze.c(),ze.m(V,null)))},d(ve){ve&&j(t),_e.d(),ze.d(),ae=!1,rt(ce)}}}function Wd(e){let t;return{c(){t=b("p"),t.textContent="—",a(t,"class","mt-1 text-sm text-gray-400")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function Yd(e){let t,n=e[32].url+"",r,l;return{c(){t=b("a"),r=F(n),a(t,"href",l=e[32].url),a(t,"target","_blank"),a(t,"rel","noopener noreferrer"),a(t,"class","mt-1 inline-block text-sm text-blue-700 underline break-all")},m(o,i){B(o,t,i),u(t,r)},p(o,i){i[1]&2&&n!==(n=o[32].url+"")&&ee(r,n),i[1]&2&&l!==(l=o[32].url)&&a(t,"href",l)},d(o){o&&j(t)}}}function Gd(e){let t;return{c(){t=b("span"),t.textContent="Page screenshot",a(t,"class","text-sm text-gray-400")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function Vd(e){let t;return{c(){t=b("span"),t.textContent="Loading screenshot...",a(t,"class","text-sm text-gray-400")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function Xd(e){let t,n;return{c(){t=b("img"),Pl(t.src,n="data:image/jpeg;base64,"+e[33][e[32].url])||a(t,"src",n),a(t,"alt","Page screenshot"),a(t,"class","max-w-full max-h-full w-auto h-auto object-contain")},m(r,l){B(r,t,l)},p(r,l){l[1]&6&&!Pl(t.src,n="data:image/jpeg;base64,"+r[33][r[32].url])&&a(t,"src",n)},d(r){r&&j(t)}}}function Gs(e){let t,n,r,l,o,i,s,c,f,d,h,p;return f=new md({props:{phraseKey:e[45].key,varSlots:e[121](),onSave:e[74]}}),{c(){t=b("div"),n=b("div"),r=b("div"),l=b("h2"),l.textContent="Edit Phrase Slots",o=E(),i=b("button"),i.textContent="×",s=E(),c=b("div"),nn(f.$$.fragment),a(l,"class","text-sm font-semibold text-gray-800"),a(i,"class","text-gray-400 hover:text-gray-700 text-xl leading-none"),a(r,"class","flex items-center justify-between px-6 pt-5 pb-3 border-b border-gray-100"),a(c,"class","px-6 py-5"),a(n,"class","bg-white rounded-xl shadow-2xl w-full max-w-xl"),a(t,"class","fixed inset-0 z-50 flex items-center justify-center p-4"),gt(t,"background","rgba(0,0,0,0.45)")},m(g,m){B(g,t,m),u(t,n),u(n,r),u(r,l),u(r,o),u(r,i),u(n,s),u(n,c),Kt(f,c,null),d=!0,h||(p=[$(i,"click",e[120]),$(t,"click",jr(e[122]))],h=!0)},p(g,m){const _={};m[1]&16384&&(_.phraseKey=g[45].key),m[1]&16384&&(_.varSlots=g[121]()),f.$set(_)},i(g){d||(at(f.$$.fragment,g),d=!0)},o(g){ct(f.$$.fragment,g),d=!1},d(g){g&&j(t),qt(f),h=!1,rt(p)}}}function Vs(e){let t,n,r,l,o,i,s,c,f,d,h,p;return f=new yd({props:{phraseKey:e[46].key,context:e[46].context||"",attributes:e[47][e[46].key+"\0"+(e[46].context||"")]||{},onSave:e[56]}}),{c(){t=b("div"),n=b("div"),r=b("div"),l=b("h2"),l.textContent="Accessibility (ARIA)",o=E(),i=b("button"),i.textContent="×",s=E(),c=b("div"),nn(f.$$.fragment),a(l,"class","text-sm font-semibold text-gray-800"),a(i,"class","text-gray-400 hover:text-gray-700 text-xl leading-none"),a(r,"class","flex items-center justify-between px-6 pt-5 pb-3 border-b border-gray-100 sticky top-0 bg-white"),a(c,"class","px-6 py-5"),a(n,"class","bg-white rounded-xl shadow-2xl w-full max-w-xl max-h-[90vh] overflow-y-auto"),a(t,"class","fixed inset-0 z-50 flex items-center justify-center p-4"),gt(t,"background","rgba(0,0,0,0.45)")},m(g,m){B(g,t,m),u(t,n),u(n,r),u(r,l),u(r,o),u(r,i),u(n,s),u(n,c),Kt(f,c,null),d=!0,h||(p=[$(i,"click",e[123]),$(t,"click",jr(e[124]))],h=!0)},p(g,m){const _={};m[1]&32768&&(_.phraseKey=g[46].key),m[1]&32768&&(_.context=g[46].context||""),m[1]&98304&&(_.attributes=g[47][g[46].key+"\0"+(g[46].context||"")]||{}),f.$set(_)},i(g){d||(at(f.$$.fragment,g),d=!0)},o(g){ct(f.$$.fragment,g),d=!1},d(g){g&&j(t),qt(f),h=!1,rt(p)}}}function Jd(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,m,_,y,v,w,C,x,A,M,L,I,P,z,R,T,N,k,D,G,W,Q,Y,ie,H,Z,re,K,X,pe,we,Ee,le,ke,ue,ne=e[20]&&bs(e),Ce=Fe(["pending","approved","trash"]),S=[];for(let oe=0;oe<3;oe+=1)S[oe]=ys(_s(e,Ce,oe));let te=e[0]==="approved"&&vs(e),J=(e[0]==="pending"||e[0]==="approved")&&xs(e),U=(e[34]||e[6]>0)&&Cs(e),O=Fe(e[7]),V=[];for(let oe=0;oe<O.length;oe+=1)V[oe]=As(ms(e,O,oe));let ae=Fe(e[15]),ce=[];for(let oe=0;oe<ae.length;oe+=1)ce[oe]=Ss(gs(e,ae,oe));let q=e[25]&&Ts(e),he=e[26]&&Ms(e),_e=(e[14].size>0||e[22])&&Es(e),de=e[44].length>0&&Bs(e);const Te=[Rd,Bd,jd],ze=[];function ve(oe,se){return oe[18]?0:oe[1].length===0?1:2}Z=ve(e),re=ze[Z]=Te[Z](e);let Ae=e[41]&&e[42]&&Hs(e),De=e[32]&&Ys(e),Be=e[45]&&Gs(e),We=e[46]&&Vs(e);return{c(){t=b("div"),ne&&ne.c(),n=E(),r=b("div"),l=b("div");for(let oe=0;oe<3;oe+=1)S[oe].c();o=E(),i=b("div"),te&&te.c(),s=E(),J&&J.c(),c=E(),U&&U.c(),f=E(),d=b("div"),h=b("select");for(let oe=0;oe<V.length;oe+=1)V[oe].c();p=E(),g=b("div"),m=b("select"),_=b("option"),_.textContent="All fields",y=b("option"),y.textContent="Key",v=b("option"),v.textContent="Context",w=b("option"),w.textContent="Translation",C=E(),x=b("div"),A=b("input"),L=E(),I=b("span"),I.innerHTML='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',P=E(),z=b("select"),R=b("option"),R.textContent="All",T=b("option"),T.textContent="Translated",N=b("option"),N.textContent="Not Translated",k=E(),D=b("select"),G=b("option"),G.textContent="All Labels";for(let oe=0;oe<ce.length;oe+=1)ce[oe].c();W=E(),q&&q.c(),Q=E(),he&&he.c(),Y=E(),_e&&_e.c(),ie=E(),de&&de.c(),H=E(),re.c(),K=E(),Ae&&Ae.c(),X=E(),De&&De.c(),pe=E(),Be&&Be.c(),we=E(),We&&We.c(),Ee=Ct(),a(l,"class","flex items-center gap-1"),a(i,"class","flex items-center gap-2 -mb-px pb-2"),a(r,"class","flex items-center justify-between mb-4 border-b border-gray-200"),a(h,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[8]===void 0&&Dt(()=>e[88].call(h)),_.__value="all",Pe(_,_.__value),y.__value="key",Pe(y,y.__value),v.__value="context",Pe(v,v.__value),w.__value="translation",Pe(w,w.__value),a(m,"class","px-2 py-2 border border-r-0 border-gray-300 rounded-l-md text-xs text-gray-500 bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 min-w-[90px]"),e[11]===void 0&&Dt(()=>e[89].call(m)),a(A,"type","text"),a(A,"placeholder",M=e[11]==="key"?"Search by key…":e[11]==="context"?"Search by context…":e[11]==="translation"?"Search by translated value…":"Search keys, context, translations…"),a(A,"class","w-full pl-8 pr-3 py-2 border border-gray-300 rounded-r-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(I,"class","absolute left-2.5 top-2.5 text-gray-400"),a(x,"class","flex-1 relative"),a(g,"class","flex-1 flex gap-0"),R.__value="all",Pe(R,R.__value),T.__value="yes",Pe(T,T.__value),N.__value="no",Pe(N,N.__value),a(z,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[12]===void 0&&Dt(()=>e[92].call(z)),G.__value="",Pe(G,G.__value),a(D,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[13]===void 0&&Dt(()=>e[94].call(D)),a(d,"class","flex flex-wrap items-center gap-3 mb-4")},m(oe,se){B(oe,t,se),ne&&ne.m(t,null),u(t,n),u(t,r),u(r,l);for(let Ne=0;Ne<3;Ne+=1)S[Ne]&&S[Ne].m(l,null);u(r,o),u(r,i),te&&te.m(i,null),u(i,s),J&&J.m(i,null),u(t,c),U&&U.m(t,null),u(t,f),u(t,d),u(d,h);for(let Ne=0;Ne<V.length;Ne+=1)V[Ne]&&V[Ne].m(h,null);yt(h,e[8],!0),u(d,p),u(d,g),u(g,m),u(m,_),u(m,y),u(m,v),u(m,w),yt(m,e[11],!0),u(g,C),u(g,x),u(x,A),Pe(A,e[10]),u(x,L),u(x,I),u(d,P),u(d,z),u(z,R),u(z,T),u(z,N),yt(z,e[12],!0),u(d,k),u(d,D),u(D,G);for(let Ne=0;Ne<ce.length;Ne+=1)ce[Ne]&&ce[Ne].m(D,null);yt(D,e[13],!0),u(t,W),q&&q.m(t,null),u(t,Q),he&&he.m(t,null),u(t,Y),_e&&_e.m(t,null),u(t,ie),de&&de.m(t,null),u(t,H),ze[Z].m(t,null),B(oe,K,se),Ae&&Ae.m(oe,se),B(oe,X,se),De&&De.m(oe,se),B(oe,pe,se),Be&&Be.m(oe,se),B(oe,we,se),We&&We.m(oe,se),B(oe,Ee,se),le=!0,ke||(ue=[$(h,"change",e[88]),$(h,"change",e[58]),$(m,"change",e[89]),$(m,"change",e[90]),$(A,"input",e[91]),$(A,"input",e[62]),$(z,"change",e[92]),$(z,"change",e[93]),$(D,"change",e[94]),$(D,"change",e[95])],ke=!0)},p(oe,se){if(oe[20]?ne?ne.p(oe,se):(ne=bs(oe),ne.c(),ne.m(t,n)):ne&&(ne.d(1),ne=null),se[0]&513|se[1]&67108864|se[2]&131072){Ce=Fe(["pending","approved","trash"]);let Me;for(Me=0;Me<3;Me+=1){const Re=_s(oe,Ce,Me);S[Me]?S[Me].p(Re,se):(S[Me]=ys(Re),S[Me].c(),S[Me].m(l,null))}for(;Me<3;Me+=1)S[Me].d(1)}if(oe[0]==="approved"?te?te.p(oe,se):(te=vs(oe),te.c(),te.m(i,s)):te&&(te.d(1),te=null),oe[0]==="pending"||oe[0]==="approved"?J?J.p(oe,se):(J=xs(oe),J.c(),J.m(i,null)):J&&(J.d(1),J=null),oe[34]||oe[6]>0?U?U.p(oe,se):(U=Cs(oe),U.c(),U.m(t,f)):U&&(U.d(1),U=null),se[0]&128){O=Fe(oe[7]);let Me;for(Me=0;Me<O.length;Me+=1){const Re=ms(oe,O,Me);V[Me]?V[Me].p(Re,se):(V[Me]=As(Re),V[Me].c(),V[Me].m(h,null))}for(;Me<V.length;Me+=1)V[Me].d(1);V.length=O.length}if(se[0]&384&&yt(h,oe[8]),se[0]&2048&&yt(m,oe[11]),(!le||se[0]&2048&&M!==(M=oe[11]==="key"?"Search by key…":oe[11]==="context"?"Search by context…":oe[11]==="translation"?"Search by translated value…":"Search keys, context, translations…"))&&a(A,"placeholder",M),se[0]&1024&&A.value!==oe[10]&&Pe(A,oe[10]),se[0]&4096&&yt(z,oe[12]),se[0]&32768){ae=Fe(oe[15]);let Me;for(Me=0;Me<ae.length;Me+=1){const Re=gs(oe,ae,Me);ce[Me]?ce[Me].p(Re,se):(ce[Me]=Ss(Re),ce[Me].c(),ce[Me].m(D,null))}for(;Me<ce.length;Me+=1)ce[Me].d(1);ce.length=ae.length}se[0]&40960&&yt(D,oe[13]),oe[25]?q?q.p(oe,se):(q=Ts(oe),q.c(),q.m(t,Q)):q&&(q.d(1),q=null),oe[26]?he?he.p(oe,se):(he=Ms(oe),he.c(),he.m(t,Y)):he&&(he.d(1),he=null),oe[14].size>0||oe[22]?_e?_e.p(oe,se):(_e=Es(oe),_e.c(),_e.m(t,ie)):_e&&(_e.d(1),_e=null),oe[44].length>0?de?(de.p(oe,se),se[1]&8192&&at(de,1)):(de=Bs(oe),de.c(),at(de,1),de.m(t,H)):de&&(Xt(),ct(de,1,1,()=>{de=null}),Jt());let Ne=Z;Z=ve(oe),Z===Ne?ze[Z].p(oe,se):(Xt(),ct(ze[Ne],1,1,()=>{ze[Ne]=null}),Jt(),re=ze[Z],re?re.p(oe,se):(re=ze[Z]=Te[Z](oe),re.c()),at(re,1),re.m(t,null)),oe[41]&&oe[42]?Ae?Ae.p(oe,se):(Ae=Hs(oe),Ae.c(),Ae.m(X.parentNode,X)):Ae&&(Ae.d(1),Ae=null),oe[32]?De?De.p(oe,se):(De=Ys(oe),De.c(),De.m(pe.parentNode,pe)):De&&(De.d(1),De=null),oe[45]?Be?(Be.p(oe,se),se[1]&16384&&at(Be,1)):(Be=Gs(oe),Be.c(),at(Be,1),Be.m(we.parentNode,we)):Be&&(Xt(),ct(Be,1,1,()=>{Be=null}),Jt()),oe[46]?We?(We.p(oe,se),se[1]&32768&&at(We,1)):(We=Vs(oe),We.c(),at(We,1),We.m(Ee.parentNode,Ee)):We&&(Xt(),ct(We,1,1,()=>{We=null}),Jt())},i(oe){le||(at(de),at(re),at(Be),at(We),le=!0)},o(oe){ct(de),ct(re),ct(Be),ct(We),le=!1},d(oe){oe&&(j(t),j(K),j(X),j(pe),j(we),j(Ee)),ne&&ne.d(),ft(S,oe),te&&te.d(),J&&J.d(),U&&U.d(),ft(V,oe),ft(ce,oe),q&&q.d(),he&&he.d(),_e&&_e.d(),de&&de.d(),ze[Z].d(),Ae&&Ae.d(oe),De&&De.d(oe),Be&&Be.d(oe),We&&We.d(oe),ke=!1,rt(ue)}}}const bl=50;function Kd(e){return e.key+"\0"+(e.context||"")}function Xs(e,t){const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}function yl(e,t){const n=e.contexts.map(l=>l.key_id),r=n.filter(l=>t.has(l)).length;return r===0?"none":r===n.length?"all":"some"}function qd(e,t){const n=e.contexts||[];if(t==="word")return e.master_key_id?[e.master_key_id]:n.length===0?[]:[n[0].key_id];const r=new Set(n.map(l=>l.key_id));return e.master_key_id&&r.add(e.master_key_id),[...r]}function Qd(e,t,n){let r,l,o,i,s;el(e,cn,fe=>n(130,s=fe));let{params:c={}}=t;const f=["pending","approved","trash"],d=[25,50,100];let p=[{code:"zh-Hans",name:"Chinese (Simplified)"},{code:"zh-Hant",name:"Chinese (Traditional)"},{code:"es",name:"Spanish"},{code:"fr",name:"French"},{code:"de",name:"German"},{code:"ja",name:"Japanese"},{code:"ko",name:"Korean"},{code:"pt",name:"Portuguese"}];function g(fe){const Se=new URLSearchParams(fe||"");return{page:Math.max(1,parseInt(Se.get("page"),10)||1),pageSize:d.includes(parseInt(Se.get("pageSize"),10))?parseInt(Se.get("pageSize"),10):50,lang:Se.get("lang")||null,search:Se.get("search")||"",filter:["all","yes","no"].includes(Se.get("filter"))?Se.get("filter"):"all",label:Se.get("label")||""}}let m="zh-Hans",_=f.includes(c.tab)?c.tab:"pending",y=[],v={pending:0,approved:0,trash:0},w="",C="all",x="all",A="",M=new Set,L=!1,I=[],P=!1,z=!1,R=!1,T="",N=!1,k;function D(fe){n(19,T=fe),n(20,N=!0),k&&clearTimeout(k),k=setTimeout(()=>{n(20,N=!1)},3500)}let G=1,W=50,Q=0;function Y(){const fe=new URLSearchParams;G>1&&fe.set("page",G),W!==50&&fe.set("pageSize",W),m&&fe.set("lang",m),w.trim()&&fe.set("search",w.trim()),x!=="all"&&fe.set("filter",x),A&&fe.set("label",A);const Se=fe.toString(),lt=`/translations/${f.includes(c.tab)?c.tab:_}${Se?"?"+Se:""}`;window.location.replace("#"+lt)}let ie=!1,H="",Z=0,re=0,K=0,X=!1,pe=!1,we="",Ee="",le="",ke="",ue=null,ne=null,Ce={},S=!1,te=0,J="",U="",O=!1,V=[],ae="",ce=!1,q=!1,he=null,_e=!1,de=[],Te=null,ze=null,ve=null,Ae={};function De(fe){const Se=Ae[Kd(fe)];return Se&&Object.keys(Se).length>0}function Be(){n(6,te=0),n(35,J="")}async function We(){n(34,S=!0),n(6,te=10),n(35,J="Preparing export..."),n(36,U=""),n(37,O=!1);try{n(6,te=25),n(35,J="Fetching translations...");const fe=await Ye("../api/export");if(!fe.ok)throw new Error("Export failed");const Se=await fe.json();if(Se.error)throw new Error(Se.error);n(6,te=70),n(35,J="Building JSON file...");const Ve=new Blob([JSON.stringify(Se,null,2)],{type:"application/json"});n(6,te=90),n(35,J="Starting download..."),Xs(Ve,"loco-translations.json"),n(6,te=100),n(35,J="Download complete"),n(36,U="Downloaded!"),setTimeout(()=>n(36,U=""),2e3)}catch(fe){n(36,U=fe.message||"Export failed"),setTimeout(()=>n(36,U=""),3e3)}finally{setTimeout(()=>{n(34,S=!1),Be()},400)}}async function oe(){n(34,S=!0),n(6,te=10),n(35,J="Preparing export..."),n(36,U=""),n(37,O=!1);try{n(6,te=20),n(35,J="Fetching translations...");const fe=await Ye("../api/export");if(!fe.ok)throw new Error("Export failed");const Se=await fe.json();if(Se.error)throw new Error(Se.error);const Ve=Se.languages||[];if(Ve.length===0)throw new Error("No translations to export");const lt=new Nd;for(let At=0;At<Ve.length;At++){const xt=Ve[At],pl={languages:[xt],languageNames:Se.languageNames,translations:{[xt]:Se.translations[xt]},timestamp:Se.timestamp};lt.file(`${xt}.json`,JSON.stringify(pl,null,2)),n(6,te=Math.max(te,Math.min(70,30+Math.round((At+1)/Ve.length*40)))),n(35,J=`Packaging ${At+1}/${Ve.length} languages...`)}n(35,J="Compressing ZIP...");const kt=await lt.generateAsync({type:"blob"},At=>{const xt=Math.min(98,70+Math.round((At.percent||0)*.28));xt>te&&n(6,te=xt)});n(6,te=100),n(35,J="Download complete"),Xs(kt,"loco-translations.zip"),n(36,U=`Downloaded ZIP with ${Ve.length} language(s)!`),setTimeout(()=>n(36,U=""),2e3)}catch(fe){n(36,U=fe.message||"Export failed"),setTimeout(()=>n(36,U=""),3e3)}finally{setTimeout(()=>{n(34,S=!1),Be()},400)}}async function se(fe){if(!fe||Ce[fe]!==void 0)return;n(33,Ce[fe]=null,Ce);const Ve=await(await Ye(`../api/screenshots?url=${encodeURIComponent(fe)}`)).json();n(33,Ce[fe]=Ve.screenshot||!1,Ce),n(33,Ce)}Br(()=>{const fe=window.location.hash||"",Se=fe.indexOf("?"),Ve=Se>=0?fe.slice(Se+1):"",lt=g(Ve);n(21,G=lt.page),n(2,W=lt.pageSize),n(10,w=lt.search),n(12,x=lt.filter),n(13,A=lt.label);try{const kt=JSON.parse(s.settings||"{}");kt.languages&&kt.languages.length&&n(7,p=kt.languages)}catch{}return lt.lang?n(8,m=lt.lang):p.length&&n(8,m=p[0].code||p[0]),n(81,L=!0),Y(),Me(),Ge(),Ne(),()=>{k&&clearTimeout(k),ut()}});async function Ne(){try{const fe=await Ye("../api/prompts");if(!fe.ok)return;const Se=await fe.json();n(38,V=Se||[]),n(39,ae=V.length?V[0].id:"")}catch{n(38,V=[]),n(39,ae="")}}async function Me(){n(18,R=!0),await Promise.all([Re(),be(),Ue()]),n(18,R=!1)}async function Re(){const fe=new URLSearchParams({lang:m,status:_,group:"key",page:G,limit:W});fe.set("coverage","master"),w.trim()&&(fe.set("search",w.trim()),C!=="all"&&fe.set("search_field",C)),x!=="all"&&fe.set("translated",x),A&&fe.set("label",A);const Ve=await(await Ye(`../api/translations/all?${fe}`)).json();n(1,y=Ve.groups||[]),n(3,Q=Ve.total),n(14,M=new Set),n(17,z=!1),n(31,ue=null)}async function be(){const fe=await Ye("../api/translations/counts");n(9,v=await fe.json())}async function Ue(){try{const fe=await Ye("../api/aria/all");if(!fe.ok)return;const Se=await fe.json(),Ve={};for(const lt of Se)Ve[lt.key+"\0"+(lt.context||"")]=lt.attributes||{};n(47,Ae=Ve)}catch(fe){console.warn("[loco] Failed to load ARIA rules:",fe)}}async function it(fe){const Se=ve;if(Se){n(46,ve=null);try{const Ve=await Ye("../api/aria",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:Se.key,context:Se.context||"",attributes:fe})});if(!Ve.ok)throw new Error(`Save failed (HTTP ${Ve.status})`);const lt=Se.key+"\0"+(Se.context||"");if(fe&&Object.keys(fe).length>0)n(47,Ae={...Ae,[lt]:fe});else{const kt={...Ae};delete kt[lt],n(47,Ae=kt)}D("ARIA rules saved")}catch(Ve){console.warn("[loco] Failed to save ARIA rule:",Ve),D("Failed to save ARIA rules")}}}function Je(fe){xr(`/translations/${fe}`)}function Ie(){n(21,G=1),Y(),Me()}async function Ge(){const fe=await Ye("../api/labels");fe.ok&&n(15,I=await fe.json())}async function xe(fe,Se,Ve){Ve.some(kt=>kt.id===Se)?await Ye(`../api/labels/${Se}/unassign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({textnodeIds:[fe]})}):await Ye(`../api/labels/${Se}/assign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({textnodeIds:[fe]})}),await Re()}async function qe(fe){M.size!==0&&(await Ye(`../api/labels/${fe}/assign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({textnodeIds:[...M]})}),n(16,P=!1),await Re(),await Ge())}async function $e(fe){M.size!==0&&(await Ye(`../api/labels/${fe}/unassign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({textnodeIds:[...M]})}),n(16,P=!1),await Re(),await Ge())}let bt;function $t(){clearTimeout(bt),bt=setTimeout(()=>{n(21,G=1),Y(),Re()},300)}function Nt(){z?(n(14,M=new Set),n(17,z=!1)):(n(14,M=new Set(r.map(fe=>fe.key_id))),n(17,z=!0))}function Bt(fe){const Se=fe.contexts.map(lt=>lt.key_id);Se.every(lt=>M.has(lt))?Se.forEach(lt=>M.delete(lt)):Se.forEach(lt=>M.add(lt)),n(14,M=new Set(M)),n(17,z=M.size===r.length&&r.length>0)}async function Rt(fe){n(32,ne=fe),fe!=null&&fe.url&&await se(fe.url)}function Ot(fe){const Se=ue===fe.key;n(31,ue=Se?null:fe.key)}function ye(fe){ce||(n(42,he=fe),n(43,_e=!1),n(41,q=!0))}function He(){n(41,q=!1),n(42,he=null),n(43,_e=!1)}async function Ke(fe,Se,Ve=ae){if(ce)return;if(!Ve&&(await Ne(),!ae))return D("No prompt template found. Create one in AI Translate first."),!1;const lt=qd(fe,Se);if(lt.length===0)return D("No phrases available to translate in this group."),!1;n(40,ce=!0);try{const kt=await Ye("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:lt,lang:m,prompt_id:Ve,include_screenshots:!1,mode:Se})}),At=await kt.json().catch(()=>({}));if(!kt.ok||At.error)throw new Error(At.error||`Failed to queue AI job (HTTP ${kt.status})`);return mt(),vt(),!0}catch(kt){return D(kt.message||"Failed to queue AI translation job."),!1}finally{n(40,ce=!1)}}async function st(){try{const Se=await(await Ye("../api/ai-jobs")).json();n(44,de=Se.jobs||[])}catch{}}async function vt(){await Promise.allSettled([Re(),st()])}function mt(){Te||(Te=setInterval(async()=>{await st(),de.some(Se=>Se.status==="running"||Se.status==="pending")||(ut(),await Me())},2e3))}function ut(){Te&&(clearInterval(Te),Te=null)}async function _t(fe){await Ye(`../api/ai-jobs/${encodeURIComponent(fe)}`,{method:"DELETE"}),await st()}function nt(fe){n(44,de=de.filter(Se=>Se.id!==fe))}async function Ze(){if(!he)return;if(!ae){D("Select a prompt template first.");return}await Ke(he,_e?"context":"word",ae)&&(He(),D("Translation job queued — watch progress below!"))}const Oe={pending:"Moving to Pending",approved:"Approving",trash:"Trashing"};async function Qe(fe){if(M.size===0||ie)return;const Se=[...M];n(22,ie=!0),n(23,H=Oe[fe]||"Moving"),n(4,Z=0),n(5,re=Se.length),n(24,K=0),await Ir();try{for(let Ve=0;Ve<Se.length;Ve+=bl){const lt=Se.slice(Ve,Ve+bl);try{(await Ye("../api/textnodes/status",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:lt,status:fe})})).ok||n(24,K+=lt.length)}catch{n(24,K+=lt.length)}n(4,Z=Math.min(Ve+lt.length,Se.length))}await Me(),D(K===0?`${Se.length} item(s) ${H.toLowerCase()} successfully`:`${K} of ${Se.length} item(s) failed`)}finally{n(22,ie=!1),K===0&&(n(4,Z=0),n(5,re=0))}}async function Tt(){if(M.size===0||ie||!confirm(`Permanently delete ${M.size} item(s)? This cannot be undone.`))return;const fe=[...M];n(22,ie=!0),n(23,H="Deleting"),n(4,Z=0),n(5,re=fe.length),n(24,K=0),await Ir();try{for(let Se=0;Se<fe.length;Se+=bl){const Ve=fe.slice(Se,Se+bl);try{(await Ye("../api/textnodes/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:Ve})})).ok||n(24,K+=Ve.length)}catch{n(24,K+=Ve.length)}n(4,Z=Math.min(Se+Ve.length,fe.length))}await Me(),D(K===0?`${fe.length} item(s) deleted permanently`:`${K} of ${fe.length} item(s) failed to delete`)}finally{n(22,ie=!1),K===0&&(n(4,Z=0),n(5,re=0))}}async function ot(fe,Se){const Ve=ze;if(Ve){n(45,ze=null);try{const lt=await Ye(`../api/phrases/${Ve.key_id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:fe,varSlots:Se})});if(!lt.ok){const kt=await lt.json().catch(()=>({}));throw new Error(kt.error||`Save failed (HTTP ${lt.status})`)}await Promise.all([Re(),be()]),D("Phrase updated")}catch(lt){console.warn("[loco] Failed to save var edits:",lt),D("Failed to update phrase")}}}async function wn(fe){try{await Ye("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:m,translations:[{key:fe.key,context:fe.context||"",value:fe.value||""}]})}),D("Translation saved")}catch(Se){console.error("Failed to save translation:",Se),D("Failed to save translation")}}async function In(fe){const Se=fe.master_value||"";try{await Ye("../api/textnodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:fe.key,context:"",status:"approved"})}),await Ye("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:m,translations:[{key:fe.key,context:"",value:Se}]})}),D("Master translation saved")}catch(Ve){console.error("Failed to save master translation:",Ve),D("Failed to save master translation")}}async function Rn(){if(we.trim())try{await Ye("../api/textnodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:we.trim(),context:Ee.trim(),status:_})}),le.trim()&&await Ye("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:m,translations:[{key:we.trim(),context:Ee.trim(),value:le.trim()}]})}),n(27,we=""),n(28,Ee=""),n(29,le=""),n(25,X=!1),D("Translation added"),await Me()}catch(fe){console.error("Failed to add translation:",fe),D("Failed to add translation")}}async function ir(){let fe;try{fe=JSON.parse(ke)}catch{D("Invalid JSON");return}try{await Ye("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:m,translations:fe})}),n(30,ke=""),n(26,pe=!1),D(`Imported ${fe.length||Object.keys(fe).length} translation(s)`),await Me()}catch(Se){console.error("Failed to import translations:",Se),D("Failed to import translations")}}const Pt={pending:{label:"Pending",icon:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="#d97706" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',actions:[{label:"Approve Selected",status:"approved",color:"bg-green-600 hover:bg-green-700"},{label:"Trash Selected",status:"trash",color:"bg-red-600 hover:bg-red-700"}]},approved:{label:"Approved",icon:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="#16a34a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',actions:[{label:"Move to Pending",status:"pending",color:"bg-yellow-600 hover:bg-yellow-700"},{label:"Trash Selected",status:"trash",color:"bg-red-600 hover:bg-red-700"}]},trash:{label:"Trash",icon:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="#dc2626" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>',actions:[{label:"Restore to Pending",status:"pending",color:"bg-blue-600 hover:bg-blue-700"},{label:"Move to Approved",status:"approved",color:"bg-green-600 hover:bg-green-700"}]}};function _n(fe){Er.call(this,e,fe)}const Ln=fe=>Je(fe),or=()=>n(37,O=!O),sn=()=>n(37,O=!1),sr=()=>{n(26,pe=!pe),n(25,X=!1)},Nn=()=>{n(25,X=!X),n(26,pe=!1)};function ar(){m=tn(this),n(8,m),n(7,p)}function On(){C=tn(this),n(11,C),n(81,L),n(80,c),n(0,_)}const ur=()=>{w.trim()&&(n(21,G=1),Y(),Re())};function Mt(){w=this.value,n(10,w),n(81,L),n(80,c),n(0,_)}function Pn(){x=tn(this),n(12,x),n(81,L),n(80,c),n(0,_)}const cr=()=>{n(21,G=1),Y(),Re()};function zn(){A=tn(this),n(13,A),n(15,I)}const fr=()=>{n(21,G=1),Y(),Re()};function me(){we=this.value,n(27,we)}function Xe(){Ee=this.value,n(28,Ee)}function et(){le=this.value,n(29,le)}function It(){ke=this.value,n(30,ke)}const wt=fe=>Qe(fe.status),hn=()=>n(16,P=!P),Un=()=>n(16,P=!1),Ut=fe=>qe(fe.id),an=fe=>$e(fe.id),dr=fe=>Bt(fe),Or=fe=>Ot(fe),ul=fe=>{n(46,ve=fe)},kn=fe=>{n(45,ze=fe)},xn=fe=>wn(fe),hr=()=>{n(21,G=1),Y(),Re()},cl=()=>{n(21,G--,G),Y(),Re()},pr=()=>{n(21,G++,G),Y(),Re()},gr=()=>{n(21,G=l),Y(),Re()};function Ur(){W=tn(this),n(2,W)}const fl=()=>{n(21,G=1),Y(),Re()};function Hr(){ae=tn(this),n(39,ae),n(38,V)}function Hn(){_e=this.checked,n(43,_e)}const Zn=()=>n(32,ne=null),Wn=()=>n(32,ne=null),Zr=()=>n(45,ze=null),dl=()=>{try{return JSON.parse(ze.var_slots||"[]")}catch{return[]}},hl=()=>n(45,ze=null),mr=()=>n(46,ve=null),un=()=>n(46,ve=null);return e.$$set=fe=>{"params"in fe&&n(80,c=fe.params)},e.$$.update=()=>{if(e.$$.dirty[0]&1|e.$$.dirty[2]&786432&&L){const fe=f.includes(c.tab)?c.tab:"pending";fe!==_&&(n(0,_=fe),n(10,w=""),n(11,C="all"),n(12,x="all"),n(21,G=1),Y(),Me())}e.$$.dirty[0]&2&&(r=y.flatMap(fe=>fe.contexts||[])),e.$$.dirty[0]&12&&n(50,l=Math.max(1,Math.ceil(Q/W))),e.$$.dirty[0]&48&&n(49,o=re>0?Math.round(Z/re*100):0),e.$$.dirty[0]&64&&n(48,i=Math.max(0,Math.min(100,Math.round(te||0))))},[_,y,W,Q,Z,re,te,p,m,v,w,C,x,A,M,I,P,z,R,T,N,G,ie,H,K,X,pe,we,Ee,le,ke,ue,ne,Ce,S,J,U,O,V,ae,ce,q,he,_e,de,ze,ve,Ae,i,o,l,Y,De,We,oe,Re,it,Je,Ie,xe,qe,$e,$t,Nt,Bt,Rt,Ot,ye,He,_t,nt,Ze,Qe,Tt,ot,wn,In,Rn,ir,Pt,c,L,_n,Ln,or,sn,sr,Nn,ar,On,ur,Mt,Pn,cr,zn,fr,me,Xe,et,It,wt,hn,Un,Ut,an,dr,Or,ul,kn,xn,hr,cl,pr,gr,Ur,fl,Hr,Hn,Zn,Wn,Zr,dl,hl,mr,un]}class Js extends on{constructor(t){super(),ln(this,t,Qd,Jd,Qt,{params:80},null,[-1,-1,-1,-1,-1,-1])}}const $d="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgdmlld0JveD0iMCAwIDEyMCAxMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHRpdGxlPkFJIFRyYW5zbGF0aW5nPC90aXRsZT4KICA8ZGVmcz4KICAgIDxzdHlsZT4KICAgICAgQGtleWZyYW1lcyB0ZXh0RmFkZSB7IDAlLDIwJXtvcGFjaXR5OjF9IDQwJSw2MCV7b3BhY2l0eTowfSA4MCUsMTAwJXtvcGFjaXR5OjF9IH0KICAgICAgQGtleWZyYW1lcyB0ZXh0QXBwZWFyIHsgMCUsNDAle29wYWNpdHk6MH0gNjAlLDEwMCV7b3BhY2l0eToxfSB9CiAgICAgIEBrZXlmcmFtZXMgc3BhcmtTcGluIHsgMCV7dHJhbnNmb3JtOnJvdGF0ZSgwZGVnKX0gMTAwJXt0cmFuc2Zvcm06cm90YXRlKDM2MGRlZyl9IH0KICAgICAgQGtleWZyYW1lcyBzcGFya1B1bHNlIHsgMCUsMTAwJXtvcGFjaXR5OjAuMztyOjJ9IDUwJXtvcGFjaXR5OjE7cjozLjV9IH0KICAgICAgI3NyYy10ZXh0IHsgYW5pbWF0aW9uOiB0ZXh0RmFkZSAzcyBlYXNlLWluLW91dCBpbmZpbml0ZTsgfQogICAgICAjdGd0LXRleHQgeyBhbmltYXRpb246IHRleHRBcHBlYXIgM3MgZWFzZS1pbi1vdXQgaW5maW5pdGU7IH0KICAgICAgI3NwYXJrLXJpbmcgeyBhbmltYXRpb246IHNwYXJrU3BpbiAzcyBsaW5lYXIgaW5maW5pdGU7IHRyYW5zZm9ybS1vcmlnaW46IDYwcHggNjBweDsgfQogICAgICAuc3AgeyBhbmltYXRpb246IHNwYXJrUHVsc2UgMS41cyBlYXNlLWluLW91dCBpbmZpbml0ZTsgfQogICAgICAuc3AyIHsgYW5pbWF0aW9uOiBzcGFya1B1bHNlIDEuNXMgZWFzZS1pbi1vdXQgMC4zcyBpbmZpbml0ZTsgfQogICAgICAuc3AzIHsgYW5pbWF0aW9uOiBzcGFya1B1bHNlIDEuNXMgZWFzZS1pbi1vdXQgMC42cyBpbmZpbml0ZTsgfQogICAgICAuc3A0IHsgYW5pbWF0aW9uOiBzcGFya1B1bHNlIDEuNXMgZWFzZS1pbi1vdXQgMC45cyBpbmZpbml0ZTsgfQogICAgPC9zdHlsZT4KICA8L2RlZnM+CgogIDwhLS0gYmFja2dyb3VuZCBjaXJjbGUgLS0+CiAgPGNpcmNsZSBjeD0iNjAiIGN5PSI2MCIgcj0iNTAiIGZpbGw9IiMxYTFmMmUiLz4KCiAgPCEtLSByb3RhdGluZyBzcGFya2xlIHJpbmcgLS0+CiAgPGcgaWQ9InNwYXJrLXJpbmciPgogICAgPGNpcmNsZSBjbGFzcz0ic3AiIGN4PSI2MCIgY3k9IjE0IiByPSIyLjUiIGZpbGw9IiNGRkI4MzMiLz4KICAgIDxjaXJjbGUgY2xhc3M9InNwMiIgY3g9IjEwNiIgY3k9IjYwIiByPSIyLjUiIGZpbGw9IiMyRUNDODgiLz4KICAgIDxjaXJjbGUgY2xhc3M9InNwMyIgY3g9IjYwIiBjeT0iMTA2IiByPSIyLjUiIGZpbGw9IiMzQThGRTAiLz4KICAgIDxjaXJjbGUgY2xhc3M9InNwNCIgY3g9IjE0IiBjeT0iNjAiIHI9IjIuNSIgZmlsbD0iI0YwNzA0MCIvPgogIDwvZz4KCiAgPCEtLSBzb3VyY2UgdGV4dCBmYWRpbmcgb3V0IC0tPgogIDxnIGlkPSJzcmMtdGV4dCI+CiAgICA8dGV4dCB4PSI2MCIgeT0iNTUiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZvbnQtZmFtaWx5PSJzeXN0ZW0tdWksc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgZm9udC13ZWlnaHQ9IjYwMCIgZmlsbD0iI0U2RjFGQiI+SGVsbG88L3RleHQ+CiAgPC9nPgoKICA8IS0tIHRhcmdldCB0ZXh0IGZhZGluZyBpbiAtLT4KICA8ZyBpZD0idGd0LXRleHQiPgogICAgPHRleHQgeD0iNjAiIHk9Ijc1IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmb250LWZhbWlseT0ic3lzdGVtLXVpLHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGZvbnQtd2VpZ2h0PSI2MDAiIGZpbGw9IiMyRUNDODgiPkJvbmpvdXI8L3RleHQ+CiAgPC9nPgo8L3N2Zz4K",e0="data:image/svg+xml,%3csvg%20width='120'%20height='120'%20viewBox='0%200%20120%20120'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eScanning%20page%3c/title%3e%3cdefs%3e%3cstyle%3e%20@keyframes%20scanLine%20{%200%25%20{%20transform:%20translateY(-30px);%20opacity:%200;%20}%2010%25%20{%20opacity:%201;%20}%2090%25%20{%20opacity:%201;%20}%20100%25%20{%20transform:%20translateY(30px);%20opacity:%200;%20}%20}%20@keyframes%20textHighlight%20{%200%25,30%25%20{%20fill:%20%23555;%20}%2050%25%20{%20fill:%20%232ECC88;%20}%2070%25,100%25%20{%20fill:%20%23555;%20}%20}%20@keyframes%20docPulse%20{%200%25,100%25%20{%20transform:%20scale(1);%20}%2050%25%20{%20transform:%20scale(1.02);%20}%20}%20%23scan-line%20{%20animation:%20scanLine%202s%20ease-in-out%20infinite;%20}%20%23doc%20{%20animation:%20docPulse%202s%20ease-in-out%20infinite;%20transform-origin:%2060px%2060px;%20}%20.txt1%20{%20animation:%20textHighlight%202s%20ease-in-out%20infinite;%20}%20.txt2%20{%20animation:%20textHighlight%202s%20ease-in-out%200.3s%20infinite;%20}%20.txt3%20{%20animation:%20textHighlight%202s%20ease-in-out%200.6s%20infinite;%20}%20.txt4%20{%20animation:%20textHighlight%202s%20ease-in-out%200.9s%20infinite;%20}%20%3c/style%3e%3c/defs%3e%3c!--%20page%20document%20--%3e%3cg%20id='doc'%3e%3crect%20x='30'%20y='20'%20width='60'%20height='80'%20rx='4'%20fill='%23f8f8f8'%20stroke='%23ddd'%20stroke-width='1.5'/%3e%3c!--%20text%20lines%20--%3e%3crect%20class='txt1'%20x='38'%20y='32'%20width='44'%20height='4'%20rx='2'%20fill='%23555'/%3e%3crect%20class='txt2'%20x='38'%20y='42'%20width='36'%20height='4'%20rx='2'%20fill='%23555'/%3e%3crect%20class='txt3'%20x='38'%20y='52'%20width='40'%20height='4'%20rx='2'%20fill='%23555'/%3e%3crect%20class='txt4'%20x='38'%20y='62'%20width='30'%20height='4'%20rx='2'%20fill='%23555'/%3e%3crect%20x='38'%20y='72'%20width='38'%20height='4'%20rx='2'%20fill='%23ddd'/%3e%3crect%20x='38'%20y='82'%20width='28'%20height='4'%20rx='2'%20fill='%23ddd'/%3e%3c/g%3e%3c!--%20scanning%20beam%20--%3e%3crect%20id='scan-line'%20x='28'%20y='58'%20width='64'%20height='3'%20rx='1.5'%20fill='%232ECC88'%20opacity='0.7'/%3e%3c/svg%3e";function Ks(e,t,n){const r=e.slice();return r[130]=t[n],r}function qs(e,t,n){const r=e.slice();return r[122]=t[n],r}function Qs(e,t,n){const r=e.slice();return r[119]=t[n],r}function $s(e,t,n){const r=e.slice();return r[122]=t[n],r}function ea(e,t,n){const r=e.slice();return r[125]=t[n],r}function ta(e,t,n){const r=e.slice();return r[133]=t[n],r}function na(e){let t,n,r=e[133].icon+"",l,o=e[133].label+"",i,s,c,f,d;function h(){return e[66](e[133])}return{c(){t=b("button"),n=b("span"),l=E(),i=F(o),s=E(),a(n,"class","inline-flex items-center"),a(t,"class",c="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px "+(e[22]===e[133].id?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))},m(p,g){B(p,t,g),u(t,n),n.innerHTML=r,u(t,l),u(t,i),u(t,s),f||(d=$(t,"click",h),f=!0)},p(p,g){e=p,g[0]&4194304&&c!==(c="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px "+(e[22]===e[133].id?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))&&a(t,"class",c)},d(p){p&&j(t),f=!1,d()}}}function t0(e){let t,n,r=e[14].length+"",l,o,i,s,c,f,d,h;function p(_,y){return _[14].length===0?o0:i0}let g=p(e),m=g(e);return{c(){t=b("div"),n=b("p"),l=F(r),o=F(" job(s) in history"),i=E(),s=b("button"),s.textContent="Refresh",c=E(),m.c(),f=Ct(),a(n,"class","text-sm text-gray-500"),a(s,"class","px-3 py-1.5 text-xs border border-gray-300 rounded hover:bg-gray-50"),a(t,"class","flex items-center justify-between mb-4")},m(_,y){B(_,t,y),u(t,n),u(n,l),u(n,o),u(t,i),u(t,s),B(_,c,y),m.m(_,y),B(_,f,y),d||(h=$(s,"click",e[37]),d=!0)},p(_,y){y[0]&16384&&r!==(r=_[14].length+"")&&ee(l,r),g===(g=p(_))&&m?m.p(_,y):(m.d(1),m=g(_),m&&(m.c(),m.m(f.parentNode,f)))},i:je,o:je,d(_){_&&(j(t),j(c),j(f)),m.d(_),d=!1,h()}}}function n0(e){let t,n,r=e[5].length+"",l,o,i,s,c,f,d,h,p,g=e[8]&&la(e);function m(v,w){return v[5].length===0&&!v[8]?c0:u0}let _=m(e),y=_(e);return{c(){t=b("div"),n=b("p"),l=F(r),o=F(" prompt template(s)"),i=E(),s=b("button"),s.textContent="+ New Prompt",c=E(),g&&g.c(),f=E(),y.c(),d=Ct(),a(n,"class","text-sm text-gray-500"),a(s,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700"),a(t,"class","flex items-center justify-between mb-4")},m(v,w){B(v,t,w),u(t,n),u(n,l),u(n,o),u(t,i),u(t,s),B(v,c,w),g&&g.m(v,w),B(v,f,w),y.m(v,w),B(v,d,w),h||(p=$(s,"click",e[39]),h=!0)},p(v,w){w[0]&32&&r!==(r=v[5].length+"")&&ee(l,r),v[8]?g?g.p(v,w):(g=la(v),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null),_===(_=m(v))&&y?y.p(v,w):(y.d(1),y=_(v),y&&(y.c(),y.m(d.parentNode,d)))},i:je,o:je,d(v){v&&(j(t),j(c),j(f),j(d)),g&&g.d(v),y.d(v),h=!1,p()}}}function r0(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,m,_,y,v,w,C,x,A,M,L,I,P,z,R,T,N,k=e[34]>0?`Translate (${e[34]} selected)`:"Translate",D,G,W,Q,Y,ie,H,Z,re,K,X,pe,we,Ee,le,ke,ue,ne,Ce,S,te,J,U,O,V,ae;t=new Fc({props:{jobs:e[13],onCancel:e[61],onDismiss:e[62]}});let ce=Fe(e[15]),q=[];for(let se=0;se<ce.length;se+=1)q[se]=aa(ea(e,ce,se));let he=e[5].length===0&&ua(),_e=Fe(e[5]),de=[];for(let se=0;se<_e.length;se+=1)de[se]=ca($s(e,_e,se));function Te(se,Ne){return se[19]?d0:f0}let ze=Te(e),ve=ze(e),Ae=e[29]&&fa(e),De=e[27]&&pa(e);const Be=[w0,v0,y0],We=[];function oe(se,Ne){return se[24]?0:se[1].length===0?1:2}return te=oe(e),J=We[te]=Be[te](e),{c(){nn(t.$$.fragment),n=E(),r=b("div"),l=b("div"),o=b("label"),o.textContent="Language",i=E(),s=b("select");for(let se=0;se<q.length;se+=1)q[se].c();c=E(),f=b("div"),d=b("label"),d.textContent="Prompt Template",h=E(),p=b("select"),he&&he.c(),g=Ct();for(let se=0;se<de.length;se+=1)de[se].c();m=E(),_=b("div"),y=b("div"),y.textContent=" ",v=E(),w=b("label"),C=b("input"),x=F(`
|
|
18
|
+
Include screenshots`),A=E(),M=b("div"),L=E(),I=b("div"),P=b("div"),P.textContent=" ",z=E(),R=b("div"),T=b("button"),ve.c(),N=E(),D=F(k),W=E(),Ae&&Ae.c(),Q=E(),De&&De.c(),Y=E(),ie=b("div"),H=b("div"),Z=b("input"),re=E(),K=b("span"),K.innerHTML='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#888" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',X=E(),pe=b("select"),we=b("option"),we.textContent="All",Ee=b("option"),Ee.textContent="Translated",le=b("option"),le.textContent="Not Translated",ke=E(),ue=b("span"),ne=F(e[4]),Ce=F(" approved keys"),S=E(),J.c(),U=Ct(),a(o,"for","ai-translate-language"),a(o,"class","text-xs text-gray-500 font-medium"),a(s,"id","ai-translate-language"),a(s,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[0]===void 0&&Dt(()=>e[67].call(s)),a(l,"class","flex flex-col gap-1"),a(d,"for","ai-translate-prompt"),a(d,"class","text-xs text-gray-500 font-medium"),a(p,"id","ai-translate-prompt"),a(p,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[6]===void 0&&Dt(()=>e[69].call(p)),a(f,"class","flex flex-col gap-1"),a(y,"class","text-xs text-gray-500 font-medium"),a(y,"aria-hidden","true"),a(C,"type","checkbox"),a(C,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(w,"class","flex items-center gap-2 text-sm text-gray-600 cursor-pointer"),a(_,"class","flex flex-col gap-1 justify-end"),a(M,"class","flex-1"),a(P,"class","text-xs text-gray-500 font-medium"),a(P,"aria-hidden","true"),a(T,"class","px-4 py-2 bg-green-600 text-white text-sm rounded-md hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"),T.disabled=G=e[28]||e[19],a(R,"class","flex items-center gap-2"),a(I,"class","flex flex-col gap-1 justify-end"),a(r,"class","flex flex-wrap items-center gap-3 mb-4 p-4 bg-white border border-gray-200 rounded-lg"),a(Z,"type","text"),a(Z,"placeholder","Search approved keys…"),a(Z,"class","w-full pl-8 pr-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(K,"class","absolute left-2.5 top-2.5 text-gray-400 flex items-center"),a(H,"class","flex-1 relative"),we.__value="all",Pe(we,we.__value),Ee.__value="translated",Pe(Ee,Ee.__value),le.__value="untranslated",Pe(le,le.__value),pe.disabled=e[24],a(pe,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[21]===void 0&&Dt(()=>e[76].call(pe)),a(ue,"class","text-xs text-gray-400"),a(ie,"class","flex items-center gap-3 mb-3")},m(se,Ne){Kt(t,se,Ne),B(se,n,Ne),B(se,r,Ne),u(r,l),u(l,o),u(l,i),u(l,s);for(let Me=0;Me<q.length;Me+=1)q[Me]&&q[Me].m(s,null);yt(s,e[0],!0),u(r,c),u(r,f),u(f,d),u(f,h),u(f,p),he&&he.m(p,null),u(p,g);for(let Me=0;Me<de.length;Me+=1)de[Me]&&de[Me].m(p,null);yt(p,e[6],!0),u(r,m),u(r,_),u(_,y),u(_,v),u(_,w),u(w,C),C.checked=e[18],u(w,x),u(r,A),u(r,M),u(r,L),u(r,I),u(I,P),u(I,z),u(I,R),u(R,T),ve.m(T,null),u(T,N),u(T,D),B(se,W,Ne),Ae&&Ae.m(se,Ne),B(se,Q,Ne),De&&De.m(se,Ne),B(se,Y,Ne),B(se,ie,Ne),u(ie,H),u(H,Z),Pe(Z,e[20]),u(H,re),u(H,K),u(ie,X),u(ie,pe),u(pe,we),u(pe,Ee),u(pe,le),yt(pe,e[21],!0),u(ie,ke),u(ie,ue),u(ue,ne),u(ue,Ce),B(se,S,Ne),We[te].m(se,Ne),B(se,U,Ne),O=!0,V||(ae=[$(s,"change",e[67]),$(s,"change",e[68]),$(p,"change",e[69]),$(C,"change",e[70]),$(T,"click",e[71]),$(Z,"input",e[75]),$(Z,"input",e[46]),$(pe,"change",e[76]),$(pe,"change",e[77])],V=!0)},p(se,Ne){const Me={};if(Ne[0]&8192&&(Me.jobs=se[13]),t.$set(Me),Ne[0]&32768){ce=Fe(se[15]);let be;for(be=0;be<ce.length;be+=1){const Ue=ea(se,ce,be);q[be]?q[be].p(Ue,Ne):(q[be]=aa(Ue),q[be].c(),q[be].m(s,null))}for(;be<q.length;be+=1)q[be].d(1);q.length=ce.length}if(Ne[0]&32769&&yt(s,se[0]),se[5].length===0?he||(he=ua(),he.c(),he.m(p,g)):he&&(he.d(1),he=null),Ne[0]&32){_e=Fe(se[5]);let be;for(be=0;be<_e.length;be+=1){const Ue=$s(se,_e,be);de[be]?de[be].p(Ue,Ne):(de[be]=ca(Ue),de[be].c(),de[be].m(p,null))}for(;be<de.length;be+=1)de[be].d(1);de.length=_e.length}Ne[0]&96&&yt(p,se[6]),Ne[0]&262144&&(C.checked=se[18]),ze!==(ze=Te(se))&&(ve.d(1),ve=ze(se),ve&&(ve.c(),ve.m(T,N))),(!O||Ne[1]&8)&&k!==(k=se[34]>0?`Translate (${se[34]} selected)`:"Translate")&&ee(D,k),(!O||Ne[0]&268959744&&G!==(G=se[28]||se[19]))&&(T.disabled=G),se[29]?Ae?Ae.p(se,Ne):(Ae=fa(se),Ae.c(),Ae.m(Q.parentNode,Q)):Ae&&(Ae.d(1),Ae=null),se[27]?De?De.p(se,Ne):(De=pa(se),De.c(),De.m(Y.parentNode,Y)):De&&(De.d(1),De=null),Ne[0]&1048576&&Z.value!==se[20]&&Pe(Z,se[20]),(!O||Ne[0]&16777216)&&(pe.disabled=se[24]),Ne[0]&2097152&&yt(pe,se[21]),(!O||Ne[0]&16)&&ee(ne,se[4]);let Re=te;te=oe(se),te===Re?We[te].p(se,Ne):(Xt(),ct(We[Re],1,1,()=>{We[Re]=null}),Jt(),J=We[te],J?J.p(se,Ne):(J=We[te]=Be[te](se),J.c()),at(J,1),J.m(U.parentNode,U))},i(se){O||(at(t.$$.fragment,se),at(J),O=!0)},o(se){ct(t.$$.fragment,se),ct(J),O=!1},d(se){se&&(j(n),j(r),j(W),j(Q),j(Y),j(ie),j(S),j(U)),qt(t,se),ft(q,se),he&&he.d(),ft(de,se),ve.d(),Ae&&Ae.d(se),De&&De.d(se),We[te].d(se),V=!1,rt(ae)}}}function l0(e){let t;return{c(){t=b("div"),t.innerHTML=`<img src="${$d}" alt="Loading" class="w-16 h-16"/> <span>Loading...</span>`,a(t,"class","flex flex-col items-center justify-center gap-2 py-10 text-sm text-gray-500")},m(n,r){B(n,t,r)},p:je,i:je,o:je,d(n){n&&j(t)}}}function i0(e){let t,n,r,l,o,i=Fe(e[14]),s=[];for(let c=0;c<i.length;c+=1)s[c]=ra(Ks(e,i,c));return{c(){t=b("div"),n=b("table"),r=b("thead"),r.innerHTML='<tr class="bg-gray-50 border-b border-gray-200"><th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Status</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Job ID</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Prompt</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Language</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Progress</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Started</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Finished</th></tr>',l=E(),o=b("tbody");for(let c=0;c<s.length;c+=1)s[c].c();a(n,"class","w-full"),a(t,"class","bg-white rounded-lg border border-gray-200 overflow-hidden")},m(c,f){B(c,t,f),u(t,n),u(n,r),u(n,l),u(n,o);for(let d=0;d<s.length;d+=1)s[d]&&s[d].m(o,null)},p(c,f){if(f[0]&16384|f[2]&2){i=Fe(c[14]);let d;for(d=0;d<i.length;d+=1){const h=Ks(c,i,d);s[d]?s[d].p(h,f):(s[d]=ra(h),s[d].c(),s[d].m(o,null))}for(;d<s.length;d+=1)s[d].d(1);s.length=i.length}},d(c){c&&j(t),ft(s,c)}}}function o0(e){let t;return{c(){t=b("div"),t.innerHTML="<p>No translation jobs yet.</p>",a(t,"class","text-center py-12 text-gray-400")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function ra(e){let t,n,r,l,o=e[63](e[130].status)+"",i,s=e[130].status+"",c,f,d,h,p=e[130].job_id+"",g,m,_,y=(e[130].prompt_name||"—")+"",v,w,C,x=e[130].lang+"",A,M,L,I=e[130].completed+"",P,z,R=e[130].total+"",T,N,k=e[130].failed+"",D,G,W,Q,Y=Fn(e[130].created_at)+"",ie,H,Z,re=Fn(e[130].finished_at)+"",K,X;return{c(){t=b("tr"),n=b("td"),r=b("span"),l=new Sc(!1),i=E(),c=F(s),d=E(),h=b("td"),g=F(p),m=E(),_=b("td"),v=F(y),w=E(),C=b("td"),A=F(x),M=E(),L=b("td"),P=F(I),z=F("/"),T=F(R),N=F(" ("),D=F(k),G=F(" failed)"),W=E(),Q=b("td"),ie=F(Y),H=E(),Z=b("td"),K=F(re),X=E(),l.a=i,a(r,"class",f=va(e[130].status)+" text-sm font-medium inline-flex items-center gap-1"),a(n,"class","px-3 py-2"),a(h,"class","px-3 py-2 text-xs font-mono text-gray-500"),a(_,"class","px-3 py-2 text-sm text-gray-700"),a(C,"class","px-3 py-2 text-sm text-gray-600"),a(L,"class","px-3 py-2 text-sm text-gray-600"),a(Q,"class","px-3 py-2 text-xs text-gray-400"),a(Z,"class","px-3 py-2 text-xs text-gray-400"),a(t,"class","border-b border-gray-100 hover:bg-gray-50")},m(pe,we){B(pe,t,we),u(t,n),u(n,r),l.m(o,r),u(r,i),u(r,c),u(t,d),u(t,h),u(h,g),u(t,m),u(t,_),u(_,v),u(t,w),u(t,C),u(C,A),u(t,M),u(t,L),u(L,P),u(L,z),u(L,T),u(L,N),u(L,D),u(L,G),u(t,W),u(t,Q),u(Q,ie),u(t,H),u(t,Z),u(Z,K),u(t,X)},p(pe,we){we[0]&16384&&o!==(o=pe[63](pe[130].status)+"")&&l.p(o),we[0]&16384&&s!==(s=pe[130].status+"")&&ee(c,s),we[0]&16384&&f!==(f=va(pe[130].status)+" text-sm font-medium inline-flex items-center gap-1")&&a(r,"class",f),we[0]&16384&&p!==(p=pe[130].job_id+"")&&ee(g,p),we[0]&16384&&y!==(y=(pe[130].prompt_name||"—")+"")&&ee(v,y),we[0]&16384&&x!==(x=pe[130].lang+"")&&ee(A,x),we[0]&16384&&I!==(I=pe[130].completed+"")&&ee(P,I),we[0]&16384&&R!==(R=pe[130].total+"")&&ee(T,R),we[0]&16384&&k!==(k=pe[130].failed+"")&&ee(D,k),we[0]&16384&&Y!==(Y=Fn(pe[130].created_at)+"")&&ee(ie,Y),we[0]&16384&&re!==(re=Fn(pe[130].finished_at)+"")&&ee(K,re)},d(pe){pe&&j(t)}}}function la(e){let t,n,r=e[7]?`Edit: ${e[7].name}`:"New Prompt Template",l,o,i,s,c,f,d,h,p,g,m,_,y,v,w,C,x,A,M,L,I,P,z,R,T,N,k;function D(Q,Y){return Q[9]?a0:s0}let G=D(e),W=G(e);return{c(){t=b("div"),n=b("h3"),l=F(r),o=E(),i=b("div"),s=b("div"),c=b("label"),c.textContent="Name",f=E(),d=b("input"),h=E(),p=b("div"),g=b("label"),m=F("Prompt "),_=b("span"),_.textContent="(use {{TARGET_LANGUAGE}}, {{CONTEXT}}, {{TEXT}} placeholders)",y=E(),v=b("textarea"),w=E(),C=b("div"),x=b("label"),x.textContent="System Message",A=E(),M=b("textarea"),L=E(),I=b("div"),P=b("button"),W.c(),z=E(),R=b("button"),T=F("Cancel"),a(n,"class","text-sm font-semibold text-gray-700 mb-3"),a(c,"for","prompt-name"),a(c,"class","block text-xs text-gray-500 font-medium mb-1"),a(d,"id","prompt-name"),a(d,"placeholder","e.g. Medical Translation, Marketing Copy…"),a(d,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(_,"class","text-gray-400"),a(g,"for","prompt-template"),a(g,"class","block text-xs text-gray-500 font-medium mb-1"),a(v,"id","prompt-template"),a(v,"rows","8"),a(v,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm font-mono focus:outline-none focus:ring-2 focus:ring-indigo-500 resize-y"),a(x,"for","prompt-system-message"),a(x,"class","block text-xs text-gray-500 font-medium mb-1"),a(M,"id","prompt-system-message"),a(M,"rows","2"),a(M,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm font-mono focus:outline-none focus:ring-2 focus:ring-indigo-500 resize-y"),a(P,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-60 disabled:cursor-not-allowed inline-flex items-center gap-2"),P.disabled=e[9],a(R,"class","px-4 py-2 border border-gray-300 text-sm rounded-md hover:bg-gray-50"),R.disabled=e[9],a(I,"class","flex gap-2"),a(i,"class","space-y-3"),a(t,"class","mb-6 p-5 bg-white border border-indigo-200 rounded-lg shadow-sm")},m(Q,Y){B(Q,t,Y),u(t,n),u(n,l),u(t,o),u(t,i),u(i,s),u(s,c),u(s,f),u(s,d),Pe(d,e[10]),u(i,h),u(i,p),u(p,g),u(g,m),u(g,_),u(p,y),u(p,v),Pe(v,e[11]),u(i,w),u(i,C),u(C,x),u(C,A),u(C,M),Pe(M,e[12]),u(i,L),u(i,I),u(I,P),W.m(P,null),u(I,z),u(I,R),u(R,T),N||(k=[$(d,"input",e[88]),$(v,"input",e[89]),$(M,"input",e[90]),$(P,"click",e[41]),$(R,"click",e[91])],N=!0)},p(Q,Y){Y[0]&128&&r!==(r=Q[7]?`Edit: ${Q[7].name}`:"New Prompt Template")&&ee(l,r),Y[0]&1024&&d.value!==Q[10]&&Pe(d,Q[10]),Y[0]&2048&&Pe(v,Q[11]),Y[0]&4096&&Pe(M,Q[12]),G===(G=D(Q))&&W?W.p(Q,Y):(W.d(1),W=G(Q),W&&(W.c(),W.m(P,null))),Y[0]&512&&(P.disabled=Q[9]),Y[0]&512&&(R.disabled=Q[9])},d(Q){Q&&j(t),W.d(),N=!1,rt(k)}}}function s0(e){let t=e[7]?"Update":"Create",n;return{c(){n=F(t)},m(r,l){B(r,n,l)},p(r,l){l[0]&128&&t!==(t=r[7]?"Update":"Create")&&ee(n,t)},d(r){r&&j(n)}}}function a0(e){let t,n,r,l=e[7]?"Updating...":"Creating...",o;return{c(){t=ge("svg"),n=ge("path"),r=E(),o=F(l),a(n,"d","M21 12a9 9 0 1 1-6.219-8.56"),a(t,"class","animate-spin"),a(t,"width","14"),a(t,"height","14"),a(t,"viewBox","0 0 24 24"),a(t,"fill","none"),a(t,"stroke","currentColor"),a(t,"stroke-width","2"),a(t,"stroke-linecap","round"),a(t,"stroke-linejoin","round")},m(i,s){B(i,t,s),u(t,n),B(i,r,s),B(i,o,s)},p(i,s){s[0]&128&&l!==(l=i[7]?"Updating...":"Creating...")&&ee(o,l)},d(i){i&&(j(t),j(r),j(o))}}}function u0(e){let t,n=Fe(e[5]),r=[];for(let l=0;l<n.length;l+=1)r[l]=sa(qs(e,n,l));return{c(){t=b("div");for(let l=0;l<r.length;l+=1)r[l].c();a(t,"class","space-y-3")},m(l,o){B(l,t,o);for(let i=0;i<r.length;i+=1)r[i]&&r[i].m(t,null)},p(l,o){if(o[0]&32|o[1]&2560){n=Fe(l[5]);let i;for(i=0;i<n.length;i+=1){const s=qs(l,n,i);r[i]?r[i].p(s,o):(r[i]=sa(s),r[i].c(),r[i].m(t,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(l){l&&j(t),ft(r,l)}}}function c0(e){let t;return{c(){t=b("div"),t.innerHTML='<p>No prompt templates yet.</p> <p class="text-sm mt-1">Create one to start generating AI translations.</p>',a(t,"class","text-center py-12 text-gray-400")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function ia(e){let t,n=Fn(e[122].updated_at)+"",r;return{c(){t=F("· Updated "),r=F(n)},m(l,o){B(l,t,o),B(l,r,o)},p(l,o){o[0]&32&&n!==(n=Fn(l[122].updated_at)+"")&&ee(r,n)},d(l){l&&(j(t),j(r))}}}function oa(e){let t,n,r,l=e[122].system_message.substring(0,150)+"",o,i=e[122].system_message.length>150?"…":"",s;return{c(){t=b("p"),n=b("b"),n.textContent="System:",r=E(),o=F(l),s=F(i),a(t,"class","mt-1 text-xs text-gray-400")},m(c,f){B(c,t,f),u(t,n),u(t,r),u(t,o),u(t,s)},p(c,f){f[0]&32&&l!==(l=c[122].system_message.substring(0,150)+"")&&ee(o,l),f[0]&32&&i!==(i=c[122].system_message.length>150?"…":"")&&ee(s,i)},d(c){c&&j(t)}}}function sa(e){let t,n,r,l,o,i=e[122].name+"",s,c,f,d,h=e[122].version+"",p,g,m,_,y=Fn(e[122].created_at)+"",v,w,C,x,A=e[122].prompt.substring(0,300)+"",M,L=e[122].prompt.length>300?"…":"",I,P,z,R,T,N,k,D,G,W,Q=e[122].updated_at&&e[122].updated_at!==e[122].created_at&&ia(e),Y=e[122].system_message&&oa(e);function ie(){return e[92](e[122])}function H(){return e[93](e[122])}return{c(){t=b("div"),n=b("div"),r=b("div"),l=b("div"),o=b("h4"),s=F(i),c=E(),f=b("span"),d=F("v"),p=F(h),g=E(),m=b("p"),_=F("Created "),v=F(y),w=E(),Q&&Q.c(),C=E(),x=b("pre"),M=F(A),I=F(L),P=E(),Y&&Y.c(),z=E(),R=b("div"),T=b("button"),T.textContent="Edit",N=E(),k=b("button"),k.textContent="Delete",D=E(),a(o,"class","font-medium text-gray-800"),a(f,"class","px-2 py-0.5 bg-gray-100 text-gray-500 text-xs rounded-full"),a(l,"class","flex items-center gap-2"),a(m,"class","text-xs text-gray-400 mt-1"),a(x,"class","mt-2 text-xs text-gray-500 bg-gray-50 p-2 rounded max-h-24 overflow-auto whitespace-pre-wrap"),a(r,"class","flex-1"),a(T,"class","px-3 py-1.5 text-xs border border-gray-300 rounded hover:bg-gray-50"),a(k,"class","px-3 py-1.5 text-xs text-red-600 border border-red-200 rounded hover:bg-red-50"),a(R,"class","flex items-center gap-2 ml-4 shrink-0"),a(n,"class","flex items-start justify-between"),a(t,"class","p-4 bg-white border border-gray-200 rounded-lg hover:border-indigo-200 transition-colors")},m(Z,re){B(Z,t,re),u(t,n),u(n,r),u(r,l),u(l,o),u(o,s),u(l,c),u(l,f),u(f,d),u(f,p),u(r,g),u(r,m),u(m,_),u(m,v),u(m,w),Q&&Q.m(m,null),u(r,C),u(r,x),u(x,M),u(x,I),u(r,P),Y&&Y.m(r,null),u(n,z),u(n,R),u(R,T),u(R,N),u(R,k),u(t,D),G||(W=[$(T,"click",ie),$(k,"click",H)],G=!0)},p(Z,re){e=Z,re[0]&32&&i!==(i=e[122].name+"")&&ee(s,i),re[0]&32&&h!==(h=e[122].version+"")&&ee(p,h),re[0]&32&&y!==(y=Fn(e[122].created_at)+"")&&ee(v,y),e[122].updated_at&&e[122].updated_at!==e[122].created_at?Q?Q.p(e,re):(Q=ia(e),Q.c(),Q.m(m,null)):Q&&(Q.d(1),Q=null),re[0]&32&&A!==(A=e[122].prompt.substring(0,300)+"")&&ee(M,A),re[0]&32&&L!==(L=e[122].prompt.length>300?"…":"")&&ee(I,L),e[122].system_message?Y?Y.p(e,re):(Y=oa(e),Y.c(),Y.m(r,null)):Y&&(Y.d(1),Y=null)},d(Z){Z&&j(t),Q&&Q.d(),Y&&Y.d(),G=!1,rt(W)}}}function aa(e){let t,n=(e[125].name||e[125].code||e[125])+"",r,l;return{c(){t=b("option"),r=F(n),t.__value=l=e[125].code||e[125],Pe(t,t.__value)},m(o,i){B(o,t,i),u(t,r)},p(o,i){i[0]&32768&&n!==(n=(o[125].name||o[125].code||o[125])+"")&&ee(r,n),i[0]&32768&&l!==(l=o[125].code||o[125])&&(t.__value=l,Pe(t,t.__value))},d(o){o&&j(t)}}}function ua(e){let t;return{c(){t=b("option"),t.textContent="— No prompts. Create one first. —",t.__value="",Pe(t,t.__value)},m(n,r){B(n,t,r)},d(n){n&&j(t)}}}function ca(e){let t,n=e[122].name+"",r,l,o=e[122].version+"",i,s,c;return{c(){t=b("option"),r=F(n),l=F(" (v"),i=F(o),s=F(")"),t.__value=c=e[122].id,Pe(t,t.__value)},m(f,d){B(f,t,d),u(t,r),u(t,l),u(t,i),u(t,s)},p(f,d){d[0]&32&&n!==(n=f[122].name+"")&&ee(r,n),d[0]&32&&o!==(o=f[122].version+"")&&ee(i,o),d[0]&32&&c!==(c=f[122].id)&&(t.__value=c,Pe(t,t.__value))},d(f){f&&j(t)}}}function f0(e){let t,n,r,l;return{c(){t=ge("svg"),n=ge("circle"),r=ge("line"),l=ge("path"),a(n,"cx","12"),a(n,"cy","12"),a(n,"r","10"),a(r,"x1","2"),a(r,"y1","12"),a(r,"x2","22"),a(r,"y2","12"),a(l,"d","M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10A15.3 15.3 0 0 1 12 2z"),a(t,"width","14"),a(t,"height","14"),a(t,"viewBox","0 0 24 24"),a(t,"fill","none"),a(t,"stroke","currentColor"),a(t,"stroke-width","2"),a(t,"stroke-linecap","round"),a(t,"stroke-linejoin","round")},m(o,i){B(o,t,i),u(t,n),u(t,r),u(t,l)},d(o){o&&j(t)}}}function d0(e){let t,n;return{c(){t=ge("svg"),n=ge("path"),a(n,"d","M21 12a9 9 0 1 1-6.219-8.56"),a(t,"class","animate-spin"),a(t,"width","14"),a(t,"height","14"),a(t,"viewBox","0 0 24 24"),a(t,"fill","none"),a(t,"stroke","currentColor"),a(t,"stroke-width","2"),a(t,"stroke-linecap","round")},m(r,l){B(r,t,l),u(t,n)},d(r){r&&j(t)}}}function fa(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,m,_,y,v,w,C,x,A,M,L,I,P,z,R=e[19]||e[28]?"Starting...":"Start Translation",T,N,k,D,G=e[30]!=="group"&&da(e);function W(K,X){return K[31]?p0:h0}let Q=W(e),Y=Q(e);function ie(K,X){return K[33]?b0:(C==null&&(C=!!(K[53]()==="context"&&K[55]())),C?_0:(x==null&&(x=K[54]()!=null),x?m0:g0))}let H=ie(e),Z=H(e),re=e[32]&&ha(e);return{c(){t=b("div"),n=b("div"),r=b("div"),l=b("h3"),l.textContent=`${e[58]()}`,o=E(),i=b("button"),i.textContent="×",s=E(),c=b("div"),G&&G.c(),f=E(),d=b("p"),d.textContent=`${e[59]()}`,h=E(),p=b("label"),g=b("input"),m=F(`
|
|
19
|
+
Include contexts`),_=E(),y=b("p"),Y.c(),v=E(),w=b("p"),Z.c(),A=E(),re&&re.c(),M=E(),L=b("div"),I=b("button"),I.textContent="Cancel",P=E(),z=b("button"),T=F(R),a(l,"class","text-sm font-semibold text-gray-800"),a(i,"class","text-gray-400 hover:text-gray-700 text-lg leading-none"),a(r,"class","px-5 py-4 border-b border-gray-100 flex items-center justify-between"),a(d,"class","text-sm text-gray-700 break-words"),a(g,"type","checkbox"),a(g,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(p,"class","flex items-center gap-2 text-sm text-gray-700 cursor-pointer"),a(y,"class","text-xs text-gray-500"),a(w,"class","text-sm text-gray-700 font-medium"),a(c,"class","px-5 py-4 space-y-3"),a(I,"class","px-3 py-1.5 text-sm border border-gray-300 rounded-md hover:bg-gray-50"),a(z,"class","px-3 py-1.5 text-sm bg-indigo-600 text-white rounded-md hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed"),z.disabled=N=e[19]||e[28]||e[54]()==null||e[54]()===0,a(L,"class","px-5 py-4 border-t border-gray-100 flex justify-end gap-2"),a(n,"class","w-full max-w-md rounded-xl bg-white shadow-2xl border border-gray-200"),a(t,"class","fixed inset-0 z-50 flex items-center justify-center p-4"),gt(t,"background","rgba(0,0,0,0.45)")},m(K,X){B(K,t,X),u(t,n),u(n,r),u(r,l),u(r,o),u(r,i),u(n,s),u(n,c),G&&G.m(c,null),u(c,f),u(c,d),u(c,h),u(c,p),u(p,g),g.checked=e[31],u(p,m),u(c,_),u(c,y),Y.m(y,null),u(c,v),u(c,w),Z.m(w,null),u(c,A),re&&re.m(c,null),u(n,M),u(n,L),u(L,I),u(L,P),u(L,z),u(z,T),k||(D=[$(i,"click",e[51]),$(g,"change",e[74]),$(g,"change",e[57]),$(I,"click",e[51]),$(z,"click",e[60]),$(t,"click",jr(e[51]))],k=!0)},p(K,X){K[30]!=="group"?G?G.p(K,X):(G=da(K),G.c(),G.m(c,f)):G&&(G.d(1),G=null),X[1]&1&&(g.checked=K[31]),Q!==(Q=W(K))&&(Y.d(1),Y=Q(K),Y&&(Y.c(),Y.m(y,null))),H===(H=ie(K))&&Z?Z.p(K,X):(Z.d(1),Z=H(K),Z&&(Z.c(),Z.m(w,null))),K[32]?re?re.p(K,X):(re=ha(K),re.c(),re.m(c,null)):re&&(re.d(1),re=null),X[0]&268959744&&R!==(R=K[19]||K[28]?"Starting...":"Start Translation")&&ee(T,R),X[0]&268959744&&N!==(N=K[19]||K[28]||K[54]()==null||K[54]()===0)&&(z.disabled=N)},d(K){K&&j(t),G&&G.d(),Y.d(),Z.d(),re&&re.d(),k=!1,rt(D)}}}function da(e){let t,n,r,l,o,i,s,c,f,d,h,p,g;return{c(){t=b("div"),n=b("button"),r=F("All Untranslated"),o=E(),i=b("button"),s=F("Selected ("),c=F(e[34]),f=F(")"),a(n,"type","button"),a(n,"class",l="px-2.5 py-1 text-xs rounded-md "+(e[30]==="all"?"bg-white border border-gray-200 text-gray-900":"text-gray-600 hover:text-gray-900")),a(i,"type","button"),a(i,"class",d="px-2.5 py-1 text-xs rounded-md "+(e[30]==="selected"?"bg-white border border-gray-200 text-gray-900":"text-gray-600 hover:text-gray-900")+" disabled:opacity-50 disabled:cursor-not-allowed"),i.disabled=h=e[34]===0,a(t,"class","inline-flex rounded-md border border-gray-200 bg-gray-50 p-1")},m(m,_){B(m,t,_),u(t,n),u(n,r),u(t,o),u(t,i),u(i,s),u(i,c),u(i,f),p||(g=[$(n,"click",e[72]),$(i,"click",e[73])],p=!0)},p(m,_){_[0]&1073741824&&l!==(l="px-2.5 py-1 text-xs rounded-md "+(m[30]==="all"?"bg-white border border-gray-200 text-gray-900":"text-gray-600 hover:text-gray-900"))&&a(n,"class",l),_[1]&8&&ee(c,m[34]),_[0]&1073741824&&d!==(d="px-2.5 py-1 text-xs rounded-md "+(m[30]==="selected"?"bg-white border border-gray-200 text-gray-900":"text-gray-600 hover:text-gray-900")+" disabled:opacity-50 disabled:cursor-not-allowed")&&a(i,"class",d),_[1]&8&&h!==(h=m[34]===0)&&(i.disabled=h)},d(m){m&&j(t),p=!1,rt(g)}}}function h0(e){let t;return{c(){t=F("Will translate master only (one approved key fallback each).")},m(n,r){B(n,t,r)},d(n){n&&j(t)}}}function p0(e){let t;return{c(){t=F("Will translate master + context pairs.")},m(n,r){B(n,t,r)},d(n){n&&j(t)}}}function g0(e){let t;return{c(){t=F("Loading count...")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function m0(e){let t=e[54]()+"",n,r,l=e[56]()+"",o,i;return{c(){n=F(t),r=E(),o=F(l),i=F(" to queue")},m(s,c){B(s,n,c),B(s,r,c),B(s,o,c),B(s,i,c)},p:je,d(s){s&&(j(n),j(r),j(o),j(i))}}}function _0(e){let t=e[55]().master+"",n,r,l=e[55]().context+"",o,i,s=e[55]().total+"",c,f;return{c(){n=F(t),r=F(" master + "),o=F(l),i=F(" context = "),c=F(s),f=F(" total to queue")},m(d,h){B(d,n,h),B(d,r,h),B(d,o,h),B(d,i,h),B(d,c,h),B(d,f,h)},p:je,d(d){d&&(j(n),j(r),j(o),j(i),j(c),j(f))}}}function b0(e){let t;return{c(){t=F("Loading count...")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function ha(e){let t,n;return{c(){t=b("p"),n=F(e[32]),a(t,"class","text-sm text-red-600")},m(r,l){B(r,t,l),u(t,n)},p(r,l){l[1]&2&&ee(n,r[32])},d(r){r&&j(t)}}}function pa(e){let t,n,r,l,o,i,s;return{c(){t=b("div"),n=b("div"),r=ge("svg"),l=ge("polyline"),o=E(),i=b("p"),s=F(e[26]),a(l,"points","20 6 9 17 4 12"),a(r,"class","w-5 h-5 text-green-600 flex-shrink-0"),a(r,"viewBox","0 0 24 24"),a(r,"fill","none"),a(r,"stroke","currentColor"),a(r,"stroke-width","2"),a(r,"stroke-linecap","round"),a(r,"stroke-linejoin","round"),a(i,"class","text-sm font-medium text-green-800"),a(n,"class","bg-green-50 border border-green-200 rounded-lg shadow-lg px-4 py-3 flex items-center gap-3 animate-in fade-in slide-in-from-bottom-2 duration-300"),a(t,"class","fixed bottom-4 right-4 z-50 max-w-sm")},m(c,f){B(c,t,f),u(t,n),u(n,r),u(r,l),u(n,o),u(n,i),u(i,s)},p(c,f){f[0]&67108864&&ee(s,c[26])},d(c){c&&j(t)}}}function y0(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,m,_,y,v,w=[],C=new Map,x,A,M,L,I,P,z,R,T,N=Fe(e[1]);const k=G=>G[119].key;for(let G=0;G<N.length;G+=1){let W=Qs(e,N,G),Q=k(W);C.set(Q,w[G]=ma(Q,W))}let D=e[35]>1&&_a(e);return{c(){t=b("div"),n=b("table"),r=b("thead"),l=b("tr"),o=b("th"),i=b("input"),s=E(),c=b("th"),c.textContent="Key",f=E(),d=b("th"),d.textContent="Contexts",h=E(),p=b("th"),g=F("Translation ("),m=F(e[0]),_=F(")"),y=E(),v=b("tbody");for(let G=0;G<w.length;G+=1)w[G].c();x=E(),A=b("div"),M=b("p"),L=F(e[4]),I=F(" key(s)"),P=E(),D&&D.c(),a(i,"type","checkbox"),i.checked=e[16],a(i,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(o,"class","w-10 px-3 py-2.5"),a(c,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),a(d,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),a(p,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),a(l,"class","bg-gray-50 border-b border-gray-200"),a(n,"class","w-full"),a(t,"class","bg-white rounded-lg border border-gray-200 overflow-hidden"),a(M,"class","text-xs text-gray-400"),a(A,"class","flex items-center justify-between mt-3")},m(G,W){B(G,t,W),u(t,n),u(n,r),u(r,l),u(l,o),u(o,i),u(l,s),u(l,c),u(l,f),u(l,d),u(l,h),u(l,p),u(p,g),u(p,m),u(p,_),u(n,y),u(n,v);for(let Q=0;Q<w.length;Q+=1)w[Q]&&w[Q].m(v,null);B(G,x,W),B(G,A,W),u(A,M),u(M,L),u(M,I),u(A,P),D&&D.m(A,null),z=!0,R||(T=$(i,"change",e[44]),R=!0)},p(G,W){(!z||W[0]&65536)&&(i.checked=G[16]),(!z||W[0]&1)&&ee(m,G[0]),W[0]&269090886|W[1]&741376&&(N=Fe(G[1]),Xt(),w=ol(w,W,k,1,G,N,C,v,Lc,ma,null,Qs),Jt()),(!z||W[0]&16)&&ee(L,G[4]),G[35]>1?D?D.p(G,W):(D=_a(G),D.c(),D.m(A,null)):D&&(D.d(1),D=null)},i(G){if(!z){for(let W=0;W<N.length;W+=1)at(w[W]);z=!0}},o(G){for(let W=0;W<w.length;W+=1)ct(w[W]);z=!1},d(G){G&&(j(t),j(x),j(A));for(let W=0;W<w.length;W+=1)w[W].d();D&&D.d(),R=!1,T()}}}function v0(e){let t;return{c(){t=b("div"),t.innerHTML='<p>No approved items to generate translations for.</p> <p class="text-sm mt-1">Move items from Pending to Approved in the Translation Manager first.</p>',a(t,"class","text-center py-12 text-gray-400")},m(n,r){B(n,t,r)},p:je,i:je,o:je,d(n){n&&j(t)}}}function w0(e){let t;return{c(){t=b("div"),t.innerHTML=`<div class="flex flex-col items-center justify-center gap-2 text-sm text-gray-500"><img src="${e0}" alt="Loading approved keys" class="w-16 h-16"/> <span>Loading approved keys...</span></div>`,a(t,"class","bg-white rounded-lg border border-gray-200 py-12")},m(n,r){B(n,t,r)},p:je,i:je,o:je,d(n){n&&j(t)}}}function ga(e){let t,n,r,l,o;return r=new Dc({props:{group:e[119],editable:!0,showAiAction:!0,aiBusy:!e[6]||e[19]||e[28],onAiAction:e[81],onSaveMasterValue:e[48],onSaveValue:e[47]}}),{c(){t=b("tr"),n=b("td"),nn(r.$$.fragment),l=E(),a(n,"colspan","4"),a(n,"class","px-4 py-3"),a(t,"class","bg-gray-50 border-b border-gray-200")},m(i,s){B(i,t,s),u(t,n),Kt(r,n,null),u(t,l),o=!0},p(i,s){const c={};s[0]&2&&(c.group=i[119]),s[0]&268959808&&(c.aiBusy=!i[6]||i[19]||i[28]),r.$set(c)},i(i){o||(at(r.$$.fragment,i),o=!0)},o(i){ct(r.$$.fragment,i),o=!1},d(i){i&&j(t),qt(r)}}}function ma(e,t){let n,r,l,o,i,s,c,f,d,h,p,g,m=t[119].key+"",_,y,v,w=t[119].total+"",C,x,A,M,L,I=t[119].total+"",P,z,R=t[119].total===1?"context":"contexts",T,N,k,D,G=t[119].translatedCount+"",W,Q,Y=t[119].total+"",ie,H,Z,re,K,X,pe,we;function Ee(...ne){return t[78](t[119],...ne)}function le(...ne){return t[79](t[119],...ne)}function ke(){return t[80](t[119])}let ue=t[17]===t[119].key&&ga(t);return{key:e,first:null,c(){var ne;n=b("tr"),r=b("td"),l=b("input"),i=E(),s=b("td"),c=b("div"),f=ge("svg"),d=ge("path"),p=E(),g=b("span"),_=F(m),y=E(),v=b("span"),C=F(w),M=E(),L=b("td"),P=F(I),z=E(),T=F(R),N=E(),k=b("td"),D=b("span"),W=F(G),Q=F("/"),ie=F(Y),H=F(" translated"),re=E(),ue&&ue.c(),K=Ct(),a(l,"type","checkbox"),l.checked=o=!!((ne=t[119])!=null&&ne.key)&&t[2].includes(t[119].key),a(l,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(r,"class","px-3 py-2"),a(d,"fill-rule","evenodd"),a(d,"d","M7.293 4.293a1 1 0 011.414 0l5 5a1 1 0 010 1.414l-5 5a1 1 0 01-1.414-1.414L11.586 10 7.293 5.707a1 1 0 010-1.414z"),a(d,"clip-rule","evenodd"),a(f,"class",h="shrink-0 w-3 h-3 text-gray-400 transition-transform "+(t[17]===t[119].key?"rotate-90":"")),a(f,"viewBox","0 0 20 20"),a(f,"fill","currentColor"),a(g,"class","truncate flex-1 min-w-0"),a(v,"class","shrink-0 px-1.5 py-0.5 text-[10px] font-medium rounded-full bg-indigo-50 text-indigo-600 border border-indigo-100"),a(v,"title",x=t[119].total+" context(s)"),a(c,"class","flex items-center gap-2 min-w-0"),a(s,"class","px-3 py-2 font-mono text-sm text-gray-700 max-w-[320px]"),a(s,"title",A=t[119].key),a(L,"class","px-3 py-2 text-sm text-gray-500 whitespace-nowrap"),a(D,"class","font-semibold"),a(k,"class","px-3 py-2 text-sm text-gray-700 whitespace-nowrap"),a(n,"class",Z="border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer "+(t[17]===t[119].key?"bg-indigo-50":"")),this.first=n},m(ne,Ce){B(ne,n,Ce),u(n,r),u(r,l),u(n,i),u(n,s),u(s,c),u(c,f),u(f,d),u(c,p),u(c,g),u(g,_),u(c,y),u(c,v),u(v,C),u(n,M),u(n,L),u(L,P),u(L,z),u(L,T),u(n,N),u(n,k),u(k,D),u(D,W),u(D,Q),u(D,ie),u(k,H),B(ne,re,Ce),ue&&ue.m(ne,Ce),B(ne,K,Ce),X=!0,pe||(we=[$(l,"click",jt(Ee)),$(l,"change",jt(le)),$(r,"click",jt(t[65])),$(n,"click",ke)],pe=!0)},p(ne,Ce){var S;t=ne,(!X||Ce[0]&6&&o!==(o=!!((S=t[119])!=null&&S.key)&&t[2].includes(t[119].key)))&&(l.checked=o),(!X||Ce[0]&131074&&h!==(h="shrink-0 w-3 h-3 text-gray-400 transition-transform "+(t[17]===t[119].key?"rotate-90":"")))&&a(f,"class",h),(!X||Ce[0]&2)&&m!==(m=t[119].key+"")&&ee(_,m),(!X||Ce[0]&2)&&w!==(w=t[119].total+"")&&ee(C,w),(!X||Ce[0]&2&&x!==(x=t[119].total+" context(s)"))&&a(v,"title",x),(!X||Ce[0]&2&&A!==(A=t[119].key))&&a(s,"title",A),(!X||Ce[0]&2)&&I!==(I=t[119].total+"")&&ee(P,I),(!X||Ce[0]&2)&&R!==(R=t[119].total===1?"context":"contexts")&&ee(T,R),(!X||Ce[0]&2)&&G!==(G=t[119].translatedCount+"")&&ee(W,G),(!X||Ce[0]&2)&&Y!==(Y=t[119].total+"")&&ee(ie,Y),(!X||Ce[0]&131074&&Z!==(Z="border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer "+(t[17]===t[119].key?"bg-indigo-50":"")))&&a(n,"class",Z),t[17]===t[119].key?ue?(ue.p(t,Ce),Ce[0]&131074&&at(ue,1)):(ue=ga(t),ue.c(),at(ue,1),ue.m(K.parentNode,K)):ue&&(Xt(),ct(ue,1,1,()=>{ue=null}),Jt())},i(ne){X||(at(ue),X=!0)},o(ne){ct(ue),X=!1},d(ne){ne&&(j(n),j(re),j(K)),ue&&ue.d(ne),pe=!1,rt(we)}}}function _a(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,m,_,y,v,w,C,x,A,M,L,I,P,z,R,T,N;return{c(){t=b("div"),n=b("button"),r=F("«"),o=E(),i=b("button"),s=F("‹"),f=E(),d=b("span"),h=F("Page "),p=F(e[25]),g=F(" of "),m=F(e[35]),_=E(),y=b("button"),v=F("›"),C=E(),x=b("button"),A=F("»"),L=E(),I=b("select"),P=b("option"),P.textContent="25 / page",z=b("option"),z.textContent="50 / page",R=b("option"),R.textContent="100 / page",a(n,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),n.disabled=l=e[25]<=1,a(i,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),i.disabled=c=e[25]<=1,a(d,"class","px-3 py-1 text-xs text-gray-600"),a(y,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),y.disabled=w=e[25]>=e[35],a(x,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),x.disabled=M=e[25]>=e[35],P.__value=25,Pe(P,P.__value),z.__value=50,Pe(z,z.__value),R.__value=100,Pe(R,R.__value),a(I,"class","ml-2 px-2 py-1 text-xs border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[3]===void 0&&Dt(()=>e[86].call(I)),a(t,"class","flex items-center gap-1")},m(k,D){B(k,t,D),u(t,n),u(n,r),u(t,o),u(t,i),u(i,s),u(t,f),u(t,d),u(d,h),u(d,p),u(d,g),u(d,m),u(t,_),u(t,y),u(y,v),u(t,C),u(t,x),u(x,A),u(t,L),u(t,I),u(I,P),u(I,z),u(I,R),yt(I,e[3],!0),T||(N=[$(n,"click",e[82]),$(i,"click",e[83]),$(y,"click",e[84]),$(x,"click",e[85]),$(I,"change",e[86]),$(I,"change",e[87])],T=!0)},p(k,D){D[0]&33554432&&l!==(l=k[25]<=1)&&(n.disabled=l),D[0]&33554432&&c!==(c=k[25]<=1)&&(i.disabled=c),D[0]&33554432&&ee(p,k[25]),D[1]&16&&ee(m,k[35]),D[0]&33554432|D[1]&16&&w!==(w=k[25]>=k[35])&&(y.disabled=w),D[0]&33554432|D[1]&16&&M!==(M=k[25]>=k[35])&&(x.disabled=M),D[0]&8&&yt(I,k[3])},d(k){k&&j(t),T=!1,rt(N)}}}function k0(e){let t,n,r,l,o,i,s,c,f=Fe([{id:"generate",label:"Generate Translations",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 2L13.5 7.5L19 9L13.5 10.5L12 16L10.5 10.5L5 9L10.5 7.5Z" fill="#FFB833"/><path d="M19 14L20 16.5L22.5 17.5L20 18.5L19 21L18 18.5L15.5 17.5L18 16.5Z" fill="#F07040"/></svg>'},{id:"prompts",label:"Prompt Templates",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>'},{id:"log",label:"Job Log",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>'}]),d=[];for(let m=0;m<3;m+=1)d[m]=na(ta(e,f,m));const h=[l0,r0,n0,t0],p=[];function g(m,_){return m[23]?0:m[22]==="generate"?1:m[22]==="prompts"?2:m[22]==="log"?3:-1}return~(l=g(e))&&(o=p[l]=h[l](e)),{c(){t=b("div"),n=b("div");for(let m=0;m<3;m+=1)d[m].c();r=E(),o&&o.c(),a(n,"class","flex items-center gap-1 mb-4 border-b border-gray-200")},m(m,_){B(m,t,_),u(t,n);for(let y=0;y<3;y+=1)d[y]&&d[y].m(n,null);u(t,r),~l&&p[l].m(t,null),i=!0,s||(c=$(window,"keydown",e[52]),s=!0)},p(m,_){if(_[0]&4194304|_[1]&128){f=Fe([{id:"generate",label:"Generate Translations",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 2L13.5 7.5L19 9L13.5 10.5L12 16L10.5 10.5L5 9L10.5 7.5Z" fill="#FFB833"/><path d="M19 14L20 16.5L22.5 17.5L20 18.5L19 21L18 18.5L15.5 17.5L18 16.5Z" fill="#F07040"/></svg>'},{id:"prompts",label:"Prompt Templates",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>'},{id:"log",label:"Job Log",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>'}]);let v;for(v=0;v<3;v+=1){const w=ta(m,f,v);d[v]?d[v].p(w,_):(d[v]=na(w),d[v].c(),d[v].m(n,null))}for(;v<3;v+=1)d[v].d(1)}let y=l;l=g(m),l===y?~l&&p[l].p(m,_):(o&&(Xt(),ct(p[y],1,1,()=>{p[y]=null}),Jt()),~l?(o=p[l],o?o.p(m,_):(o=p[l]=h[l](m),o.c()),at(o,1),o.m(t,null)):o=null)},i(m){i||(at(o),i=!0)},o(m){ct(o),i=!1},d(m){m&&j(t),ft(d,m),~l&&p[l].d(),s=!1,c()}}}const x0="You are a professional translator. Provide only the translation without any explanations or additional text.";function ba(e){return e==null||e===""?null:String(e)}function ya(e,t){const n=(e==null?void 0:e.contexts)||[];return t==="word"?n.length>0?[n[0]]:[]:n}function ci(e,t){var r;if(!e)return[];if(t==="word"){if(e.master_key_id)return[e.master_key_id];const l=(r=ya(e,t)[0])==null?void 0:r.key_id;return l?[l]:[]}const n=new Set(ya(e,t).map(l=>l.key_id));return e.master_key_id&&n.add(e.master_key_id),[...n]}function Fn(e){return e?new Date(e).toLocaleString():"—"}function va(e){switch(e){case"running":return"text-blue-600";case"completed":return"text-green-600";case"failed":return"text-red-600";case"cancelled":case"cancelling":return"text-yellow-600";default:return"text-gray-500"}}function C0(e,t,n){let r,l,o,i;el(e,cn,me=>n(101,i=me));let s=[],c="",f=null,d=!1,h=!1,p="",g="",m="",_=[],y=[],v=null,w="zh-Hans",C=[],x=[],A=[],M=!1,L=null,I=!1,P=!1,z="",R,T="all",N="generate",k=!1,D=!1,G=1,W=50,Q=0,Y="",ie=!1,H;const Z=`Translate the following text to {{TARGET_LANGUAGE}}.
|
|
20
|
+
|
|
21
|
+
Instructions:
|
|
22
|
+
- Ensure translations sound natural and contextually appropriate.
|
|
23
|
+
- Preserve formatting, punctuation, and any placeholder tokens.
|
|
24
|
+
- If a direct translation doesn't exist, use a descriptive equivalent.
|
|
25
|
+
- The context below is a breadcrumb trail: relevance decreases from right to left. Prioritize the rightmost (nearest) context elements for disambiguation.
|
|
26
|
+
- Return ONLY the translation, no explanations.
|
|
27
|
+
|
|
28
|
+
Context: "{{CONTEXT}}"
|
|
29
|
+
Text to translate: "{{TEXT}}"`;Br(async()=>{var me;try{const Xe=JSON.parse(i.settings||"{}");(me=Xe.languages)!=null&&me.length&&n(15,C=Xe.languages)}catch{}C.length||n(15,C=[{code:"zh-Hans",name:"Chinese (Simplified)"},{code:"zh-Hant",name:"Chinese (Traditional)"},{code:"es",name:"Spanish"},{code:"fr",name:"French"},{code:"de",name:"German"},{code:"ja",name:"Japanese"},{code:"ko",name:"Korean"},{code:"pt",name:"Portuguese"}]),C.length&&n(0,w=C[0].code||C[0]),await Promise.all([X(),pe(),we(),Ee()]),re()}),Tc(()=>{K(),H&&clearTimeout(H)});function re(){v=setInterval(async()=>{await we(),_.some(me=>me.status==="running"||me.status==="pending")&&await pe({showSpinner:!1})},2e3)}function K(){v&&clearInterval(v)}async function X(){const me=await Ye("../api/prompts");n(5,s=await me.json()),s.length&&!c&&n(6,c=s[0].id)}async function pe(me={}){const{showSpinner:Xe=!0}=me;Xe&&n(24,D=!0);const et=new URLSearchParams({lang:w,status:"approved",page:G,limit:W});et.set("group","key"),et.set("coverage","master"),z.trim()&&et.set("search",z.trim()),T==="translated"?et.set("translated","yes"):T==="untranslated"&&et.set("translated","no");try{const wt=await(await Ye(`../api/translations/all?${et}`)).json();n(1,x=(wt.groups||[]).map(Ut=>({...Ut,master_key_id:ba(Ut.master_key_id),contexts:(Ut.contexts||[]).map(an=>({...an,key_id:ba(an.key_id)}))}))),n(4,Q=wt.total);const hn=new Set(x.map(Ut=>Ut.key).filter(Boolean));n(2,A=A.filter(Ut=>hn.has(Ut))),x.some(Ut=>Ut.key===L)||n(17,L=null)}finally{Xe&&n(24,D=!1)}}async function we(){const Xe=await(await Ye("../api/ai-jobs")).json();n(13,_=Xe.jobs||[])}async function Ee(){const me=await Ye("../api/ai-jobs/log");n(14,y=await me.json())}async function le(me){if(!(!me||me===N||k)){n(23,k=!0),n(22,N=me);try{me==="generate"?await Promise.all([we(),Re(),pe()]):me==="prompts"?await X():me==="log"&&await Ee()}finally{n(23,k=!1)}}}function ke(){n(7,f=null),n(10,p=""),n(11,g=Z),n(12,m=x0),n(8,d=!0)}function ue(me){n(7,f=me),n(10,p=me.name),n(11,g=me.prompt),n(12,m=me.system_message),n(8,d=!0)}async function ne(){if(!(!p.trim()||!g.trim())){n(9,h=!0);try{await Ye("../api/prompts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:(f==null?void 0:f.id)||null,name:p.trim(),prompt:g,system_message:m})}),n(8,d=!1),n(7,f=null),await X()}finally{n(9,h=!1)}}}async function Ce(me){confirm("Delete this prompt template?")&&(await Ye(`../api/prompts/${encodeURIComponent(me)}`,{method:"DELETE"}),c===me&&n(6,c=""),await X())}function S(){return x.map(me=>me.key).filter(Boolean)}function te(me){const Xe=r;if(me==="context"){const et=new Set;for(const It of Xe){for(const wt of It.contexts||[])wt.key_id&&et.add(wt.key_id);It.master_key_id&&et.add(It.master_key_id)}return[...et]}return Xe.map(et=>ci(et,"word")[0]).filter(Boolean)}function J(me,Xe){if(me!=null&&me.key){if(!Xe){n(2,A=A.filter(et=>et!==me.key));return}A.includes(me.key)||n(2,A=[...A,me.key])}}function U(me){n(17,L=L===me.key?null:me.key)}function O(me){const Xe=S();if(!me){n(2,A=[]);return}n(2,A=[...Xe])}function V(me){var Xe;O(!!((Xe=me==null?void 0:me.target)!=null&&Xe.checked))}function ae(me,Xe){var et;J(me,!!((et=Xe==null?void 0:Xe.target)!=null&&et.checked))}function ce(){clearTimeout(R),R=setTimeout(()=>{n(25,G=1),pe()},300)}function q(me){const Xe=me.contexts||[],et=Xe.filter(wt=>wt.value!=null&&wt.value!=="").length,It=me.master_value!=null&&me.master_value!=="";me.translatedCount=It?Xe.length:et,n(1,x=[...x])}async function he(me,Xe){await Ye("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:w,translations:[{key:me.key,context:me.context||"",value:me.value||""}]})}),q(Xe)}async function _e(me){const Xe=me.master_value||"";await Ye("../api/textnodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:me.key,context:"",status:"approved"})}),await Ye("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:w,translations:[{key:me.key,context:"",value:Xe}]})}),q(me)}let de=!1,Te=null,ze=null,ve=!1,Ae="selected",De=null,Be=!0,We="",oe=null,se=!1;async function Ne(me){const et=await(await Ye(`../api/translations/coverage-counts?lang=${encodeURIComponent(w)}&status=approved`)).json();return me==="context"?et.untranslatedRowsDirect||0:et.untranslatedKeysMaster||0}async function Me(){if(Ae==="all"){n(33,se=!0);try{oe=await Ne(xe())}catch{oe=null}finally{n(33,se=!1)}}}async function Re(){try{const[me,Xe]=await Promise.all([Ne("word"),Ne("context")]);Te=me,ze=Xe}catch{Te=null,ze=null}}async function be(me){n(28,de=!0);try{const et=await(await Ye(`../api/textnodes/untranslated-ids?lang=${encodeURIComponent(w)}&mode=${me}`)).json();if(!et.ids||et.ids.length===0)return{ok:!1,error:"No items to queue."};const wt=await(await Ye("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:et.ids,lang:w,prompt_id:c,include_screenshots:I,mode:me})})).json();return wt.error?{ok:!1,error:wt.error}:{ok:!0}}finally{n(28,de=!1)}}function Ue(me){n(30,Ae=me),n(32,We=""),oe=null,me==="all"&&Me()}function it(me="auto",Xe=null){const et=me==="auto"?A.length>0?"selected":"all":me;n(30,Ae=et),De=Xe,n(31,Be=!0),oe=null,n(32,We=""),n(29,ve=!0),et==="all"&&Me()}function Je(){Ie()}function Ie(){n(29,ve=!1),n(32,We=""),De=null}function Ge(me){ve&&me.key==="Escape"&&(me.preventDefault(),Ie())}function xe(){return Be?"context":"word"}function qe(){const me=xe();return Ae==="all"?oe??(me==="context"?ze:Te):Ae==="group"?De?ci(De,me).length:0:te(me).length}function $e(){if(xe()==="word"){const Xe=qe()||0;return{master:Xe,context:0,total:Xe}}if(Ae==="group"&&De){const Xe=(De.contexts||[]).length,et=De.master_key_id?1:0;return{master:et,context:Xe,total:et+Xe}}if(Ae==="selected"){const Xe=r,et=Xe.reduce((wt,hn)=>wt+(hn.contexts||[]).length,0),It=Xe.filter(wt=>wt.master_key_id).length;return{master:It,context:et,total:It+et}}return null}function bt(){return xe()==="context"?"master + context pairs":"approved keys"}function $t(){Ae==="all"&&Me()}function Nt(){return Ae==="group"?"AI Translate Group":"AI Translate"}function Bt(){return Ae==="group"&&De?De.key:Ae==="selected"?`${l} selected key(s).`:"Queue translations for all untranslated approved items in current mode."}async function Rt(){await Promise.allSettled([we(),Ee(),Re(),pe({showSpinner:!1})])}async function Ot(){if(!c){n(32,We="Select a prompt template first.");return}const me=xe();if(!qe()){n(32,We="No items to queue.");return}n(19,P=!0),n(32,We="");try{let et;if(Ae==="all")et=await be(me);else{const It=Ae==="group"?ci(De,me):te(me),wt=await Ye("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:It,lang:w,prompt_id:c,include_screenshots:I,mode:me})}),hn=await wt.json();!wt.ok||hn.error?et={ok:!1,error:hn.error||`Failed to queue job (HTTP ${wt.status})`}:(Ae==="selected"&&n(2,A=[]),n(17,L=null),et={ok:!0})}if(et!=null&&et.ok){Ie(),n(26,Y="Translation job queued successfully!"),n(27,ie=!0),H&&clearTimeout(H),H=setTimeout(()=>{n(27,ie=!1)},3500),Rt();return}et!=null&&et.error&&n(32,We=et.error)}finally{n(19,P=!1)}}async function ye(me){await Ye(`../api/ai-jobs/${encodeURIComponent(me)}`,{method:"DELETE"}),await we()}function He(me){n(13,_=_.filter(Xe=>Xe.id!==me))}const Ke={pending:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#6366f1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',running:'<svg class="animate-spin" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#3A8FE0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>',completed:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#2ECC88" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',failed:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',cancelled:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>',cancelling:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>'};function st(me){return Ke[me]??'<span class="text-gray-400">—</span>'}function vt(me){Er.call(this,e,me)}const mt=me=>le(me.id);function ut(){w=tn(this),n(0,w),n(15,C)}const _t=()=>{n(25,G=1),pe()};function nt(){c=tn(this),n(6,c),n(5,s)}function Ze(){I=this.checked,n(18,I)}const Oe=()=>it("auto"),Qe=()=>Ue("all"),Tt=()=>Ue("selected");function ot(){Be=this.checked,n(31,Be)}function wn(){z=this.value,n(20,z)}function In(){T=tn(this),n(21,T)}const Rn=()=>{n(25,G=1),pe()},ir=(me,Xe)=>ae(me,Xe),Pt=(me,Xe)=>ae(me,Xe),_n=me=>U(me),Ln=me=>it("group",me),or=()=>{n(25,G=1),pe()},sn=()=>{n(25,G--,G),pe()},sr=()=>{n(25,G++,G),pe()},Nn=()=>{n(25,G=o),pe()};function ar(){W=tn(this),n(3,W)}const On=()=>{n(25,G=1),pe()};function ur(){p=this.value,n(10,p)}function Mt(){g=this.value,n(11,g)}function Pn(){m=this.value,n(12,m)}const cr=()=>{n(8,d=!1),n(7,f=null)},zn=me=>ue(me),fr=me=>Ce(me.id);return e.$$.update=()=>{if(e.$$.dirty[0]&6&&n(64,r=x.filter(me=>A.includes(me.key))),e.$$.dirty[2]&4&&n(34,l=r.length),e.$$.dirty[0]&24&&n(35,o=Math.max(1,Math.ceil(Q/W))),e.$$.dirty[0]&1&&w&&Re(),e.$$.dirty[0]&4){const me=S();n(16,M=me.length>0&&me.every(Xe=>A.includes(Xe)))}},[w,x,A,W,Q,s,c,f,d,h,p,g,m,_,y,C,M,L,I,P,z,T,N,k,D,G,Y,ie,de,ve,Ae,Be,We,se,l,o,pe,Ee,le,ke,ue,ne,Ce,U,V,ae,ce,he,_e,Ue,it,Je,Ge,xe,qe,$e,bt,$t,Nt,Bt,Ot,ye,He,st,r,vt,mt,ut,_t,nt,Ze,Oe,Qe,Tt,ot,wn,In,Rn,ir,Pt,_n,Ln,or,sn,sr,Nn,ar,On,ur,Mt,Pn,cr,zn,fr]}class A0 extends on{constructor(t){super(),ln(this,t,C0,k0,Qt,{},null,[-1,-1,-1,-1,-1])}}function wa(e,t,n){const r=e.slice();return r[71]=t[n],r[72]=t,r[73]=n,r}function ka(e,t,n){const r=e.slice();return r[74]=t[n],r}function xa(e,t,n){const r=e.slice();return r[74]=t[n],r}function Ca(e,t,n){const r=e.slice();return r[79]=t[n],r}function Aa(e,t,n){const r=e.slice();return r[82]=t[n],r}function S0(e){let t,n,r;return{c(){t=b("input"),a(t,"id","bluehive-api-key"),a(t,"type","password"),a(t,"class","w-full px-3 py-2 pr-10 border border-gray-300 rounded-md text-sm font-mono focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"),a(t,"placeholder","sk_...")},m(l,o){B(l,t,o),Pe(t,e[4]),n||(r=$(t,"input",e[50]),n=!0)},p(l,o){o[0]&16&&t.value!==l[4]&&Pe(t,l[4])},d(l){l&&j(t),n=!1,r()}}}function T0(e){let t,n,r;return{c(){t=b("input"),a(t,"id","bluehive-api-key"),a(t,"type","text"),a(t,"class","w-full px-3 py-2 pr-10 border border-gray-300 rounded-md text-sm font-mono focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"),a(t,"placeholder","sk_...")},m(l,o){B(l,t,o),Pe(t,e[4]),n||(r=$(t,"input",e[49]),n=!0)},p(l,o){o[0]&16&&t.value!==l[4]&&Pe(t,l[4])},d(l){l&&j(t),n=!1,r()}}}function Sa(e){let t,n,r,l=e[82].name+"",o,i,s,c,f=e[82].code+"",d,h,p,g,m,_,y;function v(){return e[53](e[82])}return{c(){t=b("div"),n=b("div"),r=b("span"),o=F(l),i=E(),s=b("span"),c=F("("),d=F(f),h=F(")"),p=E(),g=b("button"),g.textContent="✕",m=E(),a(r,"class","text-gray-700"),a(s,"class","text-gray-400 text-xs"),a(n,"class","flex items-center gap-2"),a(g,"class","text-gray-400 hover:text-red-500 text-xs px-2 py-1 rounded hover:bg-red-50"),a(g,"title","Remove language"),a(t,"class","flex items-center justify-between px-3 py-2 rounded-md hover:bg-gray-50 text-sm")},m(w,C){B(w,t,C),u(t,n),u(n,r),u(r,o),u(n,i),u(n,s),u(s,c),u(s,d),u(s,h),u(t,p),u(t,g),u(t,m),_||(y=$(g,"click",v),_=!0)},p(w,C){e=w,C[0]&128&&l!==(l=e[82].name+"")&&ee(o,l),C[0]&128&&f!==(f=e[82].code+"")&&ee(d,f)},d(w){w&&j(t),_=!1,y()}}}function Ta(e){let t;return{c(){t=b("p"),t.textContent="No languages configured. Add one below.",a(t,"class","text-sm text-gray-400 mb-3")},m(n,r){B(n,t,r)},d(n){n&&j(t)}}}function M0(e){let t,n,r,l,o;return{c(){t=ge("svg"),n=ge("path"),r=ge("polyline"),l=ge("polyline"),o=F(`
|
|
30
|
+
Create Backup`),a(n,"d","M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"),a(r,"points","17 21 17 13 7 13 7 21"),a(l,"points","7 3 7 8 15 8"),a(t,"width","14"),a(t,"height","14"),a(t,"viewBox","0 0 24 24"),a(t,"fill","none"),a(t,"stroke","currentColor"),a(t,"stroke-width","2"),a(t,"stroke-linecap","round"),a(t,"stroke-linejoin","round")},m(i,s){B(i,t,s),u(t,n),u(t,r),u(t,l),B(i,o,s)},d(i){i&&(j(t),j(o))}}}function E0(e){let t,n,r;return{c(){t=ge("svg"),n=ge("path"),r=F(`
|
|
31
|
+
Creating…`),a(n,"d","M12 2v4m0 12v4m-7.07-3.93l2.83-2.83m8.48-8.48l2.83-2.83M2 12h4m12 0h4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83"),a(t,"class","animate-spin"),a(t,"width","14"),a(t,"height","14"),a(t,"viewBox","0 0 24 24"),a(t,"fill","none"),a(t,"stroke","currentColor"),a(t,"stroke-width","2")},m(l,o){B(l,t,o),u(t,n),B(l,r,o)},d(l){l&&(j(t),j(r))}}}function Ma(e){let t,n,r;return{c(){t=b("button"),t.textContent="Load existing backups",a(t,"class","text-xs text-indigo-600 hover:text-indigo-800 hover:underline")},m(l,o){B(l,t,o),n||(r=$(t,"click",e[43]),n=!0)},p:je,d(l){l&&j(t),n=!1,r()}}}function I0(e){let t,n=Fe(e[18]),r=[];for(let l=0;l<n.length;l+=1)r[l]=Ea(Ca(e,n,l));return{c(){t=b("div");for(let l=0;l<r.length;l+=1)r[l].c();a(t,"class","border border-gray-200 rounded-md divide-y divide-gray-100 max-h-64 overflow-y-auto")},m(l,o){B(l,t,o);for(let i=0;i<r.length;i+=1)r[i]&&r[i].m(t,null)},p(l,o){if(o[0]&2359296|o[1]&16384){n=Fe(l[18]);let i;for(i=0;i<n.length;i+=1){const s=Ca(l,n,i);r[i]?r[i].p(s,o):(r[i]=Ea(s),r[i].c(),r[i].m(t,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(l){l&&j(t),ft(r,l)}}}function L0(e){let t;return{c(){t=b("div"),t.innerHTML='<svg class="animate-spin" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#6366f1" stroke-width="2"><circle cx="12" cy="12" r="10" opacity="0.25"></circle><path d="M12 2a10 10 0 019.5 7" stroke-linecap="round"></path></svg>',a(t,"class","flex justify-center py-4")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function Ea(e){let t,n,r,l=e[79].filename+"",o,i,s,c=Oa(e[79].created)+"",f,d,h=Ra(e[79].size)+"",p,g,m,_,y,v,w,C,x,A,M;function L(){return e[56](e[79])}return{c(){t=b("div"),n=b("div"),r=b("div"),o=F(l),i=E(),s=b("div"),f=F(c),d=F(" · "),p=F(h),g=E(),m=b("div"),_=b("button"),y=ge("svg"),v=ge("polyline"),w=ge("path"),x=E(),a(r,"class","text-gray-700 font-mono text-xs truncate"),a(s,"class","text-gray-400 text-xs mt-0.5"),a(n,"class","flex-1 min-w-0"),a(v,"points","3 6 5 6 21 6"),a(w,"d","M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"),a(y,"width","14"),a(y,"height","14"),a(y,"viewBox","0 0 24 24"),a(y,"fill","none"),a(y,"stroke","currentColor"),a(y,"stroke-width","2"),a(y,"stroke-linecap","round"),a(y,"stroke-linejoin","round"),a(_,"class","px-2 py-1 text-xs rounded border border-gray-200 text-gray-400 hover:text-red-500 hover:border-red-300 hover:bg-red-50 disabled:opacity-50"),_.disabled=C=e[21]===e[79].filename,a(_,"title","Delete this backup"),a(m,"class","flex items-center gap-1.5 ml-3 shrink-0"),a(t,"class","flex items-center justify-between px-3 py-2.5 hover:bg-gray-50 text-sm")},m(I,P){B(I,t,P),u(t,n),u(n,r),u(r,o),u(n,i),u(n,s),u(s,f),u(s,d),u(s,p),u(t,g),u(t,m),u(m,_),u(_,y),u(y,v),u(y,w),u(t,x),A||(M=$(_,"click",L),A=!0)},p(I,P){e=I,P[0]&262144&&l!==(l=e[79].filename+"")&&ee(o,l),P[0]&262144&&c!==(c=Oa(e[79].created)+"")&&ee(f,c),P[0]&262144&&h!==(h=Ra(e[79].size)+"")&&ee(p,h),P[0]&2359296&&C!==(C=e[21]===e[79].filename)&&(_.disabled=C)},d(I){I&&j(t),A=!1,M()}}}function Ia(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,m,_,y,v,w,C=e[13]>0&&La(e),x=Fe(e[27]),A=[];for(let M=0;M<x.length;M+=1)A[M]=Da(wa(e,x,M));return{c(){t=b("div"),n=b("div"),r=b("h4"),r.textContent="Context Depth",l=E(),o=b("p"),o.textContent=`How many ancestor levels to walk when building the context breadcrumb.
|
|
32
|
+
Unlimited walks to the document root; a limit keeps context focused on nearby elements.`,i=E(),s=b("div"),c=b("button"),f=F("∞ Unlimited"),h=E(),p=b("button"),g=F("Limit depth"),_=E(),C&&C.c(),y=E();for(let M=0;M<A.length;M+=1)A[M].c();a(r,"class","text-sm font-medium text-gray-700 mb-1"),a(o,"class","text-xs text-gray-400 mb-3"),a(c,"class",d="px-3 py-1.5 rounded-l-md text-xs font-medium border transition-colors "+(e[13]===0?"bg-indigo-600 text-white border-indigo-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50")),a(p,"class",m="px-3 py-1.5 rounded-r-md text-xs font-medium border border-l-0 transition-colors "+(e[13]>0?"bg-indigo-600 text-white border-indigo-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50")),a(s,"class","flex items-center gap-2 mb-2"),a(t,"class","mt-4 space-y-6 border-t border-gray-100 pt-4")},m(M,L){B(M,t,L),u(t,n),u(n,r),u(n,l),u(n,o),u(n,i),u(n,s),u(s,c),u(c,f),u(s,h),u(s,p),u(p,g),u(n,_),C&&C.m(n,null),u(t,y);for(let I=0;I<A.length;I+=1)A[I]&&A[I].m(t,null);v||(w=[$(c,"click",e[58]),$(p,"click",e[59])],v=!0)},p(M,L){if(L[0]&8192&&d!==(d="px-3 py-1.5 rounded-l-md text-xs font-medium border transition-colors "+(M[13]===0?"bg-indigo-600 text-white border-indigo-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50"))&&a(c,"class",d),L[0]&8192&&m!==(m="px-3 py-1.5 rounded-r-md text-xs font-medium border border-l-0 transition-colors "+(M[13]>0?"bg-indigo-600 text-white border-indigo-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50"))&&a(p,"class",m),M[13]>0?C?C.p(M,L):(C=La(M),C.c(),C.m(n,null)):C&&(C.d(1),C=null),L[0]&201332736|L[1]&240){x=Fe(M[27]);let I;for(I=0;I<x.length;I+=1){const P=wa(M,x,I);A[I]?A[I].p(P,L):(A[I]=Da(P),A[I].c(),A[I].m(t,null))}for(;I<A.length;I+=1)A[I].d(1);A.length=x.length}},d(M){M&&j(t),C&&C.d(),ft(A,M),v=!1,rt(w)}}}function La(e){let t,n,r,l,o,i,s,c,f,d,h,p;return{c(){t=b("div"),n=b("button"),r=F("−"),o=E(),i=b("input"),s=E(),c=b("button"),c.textContent="+",f=E(),d=b("span"),d.textContent="ancestor levels",a(n,"class","w-7 h-7 flex items-center justify-center rounded bg-white border border-gray-300 text-gray-600 hover:bg-gray-100 font-bold text-sm disabled:opacity-30"),n.disabled=l=e[13]<=1,a(i,"type","number"),a(i,"min","1"),a(i,"max","99"),a(i,"class","w-14 text-center text-sm font-mono border border-gray-300 rounded-md py-1 bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300"),a(c,"class","w-7 h-7 flex items-center justify-center rounded bg-white border border-gray-300 text-gray-600 hover:bg-gray-100 font-bold text-sm"),a(d,"class","text-xs text-gray-500 ml-2"),a(t,"class","flex items-center gap-2 mt-2 p-3 bg-gray-50 rounded-lg border border-gray-200")},m(g,m){B(g,t,m),u(t,n),u(n,r),u(t,o),u(t,i),Pe(i,e[13]),u(t,s),u(t,c),u(t,f),u(t,d),h||(p=[$(n,"click",e[60]),$(i,"input",e[61]),$(i,"change",e[34]),$(c,"click",e[62])],h=!0)},p(g,m){m[0]&8192&&l!==(l=g[13]<=1)&&(n.disabled=l),m[0]&8192&&Ac(i.value)!==g[13]&&Pe(i,g[13])},d(g){g&&j(t),h=!1,rt(p)}}}function Na(e){let t,n=e[74]+"",r,l,o;function i(){return e[63](e[71],e[74])}return{c(){t=b("button"),r=F(n),a(t,"class","px-2 py-1 rounded border text-xs transition-colors "+(e[38](e[71].key,e[74])?"bg-indigo-50 border-indigo-300 text-indigo-700":"bg-gray-100 border-gray-200 text-gray-400 line-through")),a(t,"title",e[38](e[71].key,e[74])?"Click to disable":"Click to enable")},m(s,c){B(s,t,c),u(t,r),l||(o=$(t,"click",i),l=!0)},p(s,c){e=s},d(s){s&&j(t),l=!1,o()}}}function Pa(e){let t,n=Fe(e[11][e[71].key].custom),r=[];for(let l=0;l<n.length;l+=1)r[l]=za(ka(e,n,l));return{c(){t=b("div");for(let l=0;l<r.length;l+=1)r[l].c();a(t,"class","flex flex-wrap gap-1.5 mb-2")},m(l,o){B(l,t,o);for(let i=0;i<r.length;i+=1)r[i]&&r[i].m(t,null)},p(l,o){if(o[0]&134219776|o[1]&64){n=Fe(l[11][l[71].key].custom);let i;for(i=0;i<n.length;i+=1){const s=ka(l,n,i);r[i]?r[i].p(s,o):(r[i]=za(s),r[i].c(),r[i].m(t,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(l){l&&j(t),ft(r,l)}}}function za(e){let t,n=e[74]+"",r,l,o,i,s,c;function f(){return e[64](e[71],e[74])}return{c(){t=b("span"),r=F(n),l=E(),o=b("button"),o.textContent="✕",i=E(),a(o,"class","hover:text-red-500"),a(t,"class","inline-flex items-center gap-1 px-2 py-1 rounded border border-green-300 bg-green-50 text-green-700 text-xs")},m(d,h){B(d,t,h),u(t,r),u(t,l),u(t,o),u(t,i),s||(c=$(o,"click",f),s=!0)},p(d,h){e=d,h[0]&2048&&n!==(n=e[74]+"")&&ee(r,n)},d(d){d&&j(t),s=!1,c()}}}function Da(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,m,_,y,v,w=Fe(e[26][e[71].key]),C=[];for(let I=0;I<w.length;I+=1)C[I]=Na(xa(e,w,I));let x=e[11][e[71].key].custom.length>0&&Pa(e);function A(){e[65].call(d,e[71])}function M(...I){return e[66](e[71],...I)}function L(){return e[67](e[71])}return{c(){var I;t=b("div"),n=b("h4"),n.textContent=`${e[71].title}`,r=E(),l=b("p"),l.textContent=`${e[71].desc}`,o=E(),i=b("div");for(let P=0;P<C.length;P+=1)C[P].c();s=E(),x&&x.c(),c=E(),f=b("div"),d=b("input"),h=E(),p=b("button"),g=F("Add"),_=E(),a(n,"class","text-sm font-medium text-gray-700 mb-1"),a(l,"class","text-xs text-gray-400 mb-2"),a(i,"class","flex flex-wrap gap-1.5 mb-2"),a(d,"class","flex-1 px-2 py-1.5 border border-gray-300 rounded-md text-xs focus:outline-none focus:ring-1 focus:ring-indigo-500"),a(d,"placeholder",e[71].placeholder),a(p,"class","px-3 py-1.5 bg-indigo-600 text-white text-xs rounded-md hover:bg-indigo-700 disabled:opacity-50"),p.disabled=m=!((I=e[12][e[71].key])!=null&&I.trim()),a(f,"class","flex gap-2")},m(I,P){B(I,t,P),u(t,n),u(t,r),u(t,l),u(t,o),u(t,i);for(let z=0;z<C.length;z+=1)C[z]&&C[z].m(i,null);u(t,s),x&&x.m(t,null),u(t,c),u(t,f),u(f,d),Pe(d,e[12][e[71].key]),u(f,h),u(f,p),u(p,g),u(t,_),y||(v=[$(d,"input",A),$(d,"keydown",M),$(p,"click",L)],y=!0)},p(I,P){var z;if(e=I,P[0]&201326592|P[1]&144){w=Fe(e[26][e[71].key]);let R;for(R=0;R<w.length;R+=1){const T=xa(e,w,R);C[R]?C[R].p(T,P):(C[R]=Na(T),C[R].c(),C[R].m(i,null))}for(;R<C.length;R+=1)C[R].d(1);C.length=w.length}e[11][e[71].key].custom.length>0?x?x.p(e,P):(x=Pa(e),x.c(),x.m(t,c)):x&&(x.d(1),x=null),P[0]&134221824&&d.value!==e[12][e[71].key]&&Pe(d,e[12][e[71].key]),P[0]&4096&&m!==(m=!((z=e[12][e[71].key])!=null&&z.trim()))&&(p.disabled=m)},d(I){I&&j(t),ft(C,I),x&&x.d(),y=!1,rt(v)}}}function Fa(e){let t,n;function r(i,s){if(i[24]==="clearing")return P0;if(i[24]==="success")return N0}let l=r(e),o=l&&l(e);return{c(){t=b("div"),n=b("div"),o&&o.c(),a(n,"class","bg-white rounded-2xl shadow-2xl px-10 py-8 flex flex-col items-center gap-4 min-w-[220px]"),a(t,"class","fixed inset-0 z-50 flex items-center justify-center bg-black/40"),a(t,"data-testid","clear-modal")},m(i,s){B(i,t,s),u(t,n),o&&o.m(n,null)},p(i,s){l!==(l=r(i))&&(o&&o.d(1),o=l&&l(i),o&&(o.c(),o.m(n,null)))},d(i){i&&j(t),o&&o.d()}}}function N0(e){let t,n,r,l,o,i,s,c,f,d,h,p;return{c(){t=ge("svg"),n=ge("defs"),r=ge("style"),l=F(`#loco-clear-ok-circle { animation: loco-circle-grow 0.5s cubic-bezier(.34,1.56,.64,1) both; transform-origin: 40px 40px; }
|
|
33
|
+
#loco-clear-checkmark { stroke-dasharray: 30; animation: loco-check-draw 0.4s ease 0.4s both; }
|
|
34
|
+
.loco-clear-spark1 { animation: loco-sparkle 0.6s ease 0.7s both; transform-origin: center; }
|
|
35
|
+
.loco-clear-spark2 { animation: loco-sparkle 0.6s ease 0.85s both; transform-origin: center; }
|
|
36
|
+
.loco-clear-spark3 { animation: loco-sparkle 0.6s ease 1.0s both; transform-origin: center; }
|
|
37
|
+
.loco-clear-spark4 { animation: loco-sparkle 0.6s ease 0.75s both; transform-origin: center; }
|
|
38
|
+
`),o=ge("circle"),i=ge("path"),s=ge("circle"),c=ge("circle"),f=ge("circle"),d=ge("circle"),h=E(),p=b("p"),p.textContent="Pending cleared!",a(o,"id","loco-clear-ok-circle"),a(o,"cx","40"),a(o,"cy","40"),a(o,"r","30"),a(o,"fill","#2ECC88"),a(i,"id","loco-clear-checkmark"),a(i,"d","M25 40 L35 50 L55 30"),a(i,"fill","none"),a(i,"stroke","white"),a(i,"stroke-width","5"),a(i,"stroke-linecap","round"),a(i,"stroke-linejoin","round"),a(s,"class","loco-clear-spark1"),a(s,"cx","12"),a(s,"cy","15"),a(s,"r","3"),a(s,"fill","#FFB833"),a(c,"class","loco-clear-spark2"),a(c,"cx","68"),a(c,"cy","18"),a(c,"r","2.5"),a(c,"fill","#3A8FE0"),a(f,"class","loco-clear-spark3"),a(f,"cx","65"),a(f,"cy","65"),a(f,"r","2"),a(f,"fill","#F07040"),a(d,"class","loco-clear-spark4"),a(d,"cx","15"),a(d,"cy","62"),a(d,"r","2.5"),a(d,"fill","#7BC74A"),a(t,"width","80"),a(t,"height","80"),a(t,"viewBox","0 0 80 80"),a(t,"xmlns","http://www.w3.org/2000/svg"),a(p,"class","text-sm font-medium text-gray-700")},m(g,m){B(g,t,m),u(t,n),u(n,r),u(r,l),u(t,o),u(t,i),u(t,s),u(t,c),u(t,f),u(t,d),B(g,h,m),B(g,p,m)},d(g){g&&(j(t),j(h),j(p))}}}function P0(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,m,_,y,v,w,C,x,A,M,L,I,P;return{c(){t=ge("svg"),n=ge("defs"),r=ge("style"),l=F(`#loco-clear-ring { animation: loco-spin 1.2s linear infinite; transform-origin: 40px 40px; }
|
|
39
|
+
#loco-clear-parrot { animation: loco-pulse 2s ease-in-out infinite; transform-origin: 40px 40px; }
|
|
40
|
+
`),o=ge("g"),i=ge("circle"),s=ge("path"),c=ge("path"),f=ge("path"),d=ge("g"),h=ge("circle"),p=ge("circle"),g=ge("circle"),m=ge("circle"),_=ge("circle"),y=ge("circle"),v=ge("path"),w=ge("line"),C=ge("line"),x=ge("line"),A=ge("circle"),M=ge("circle"),L=ge("circle"),I=E(),P=b("p"),P.textContent="Clearing pending…",a(i,"cx","40"),a(i,"cy","40"),a(i,"r","34"),a(i,"fill","none"),a(i,"stroke","#2a3040"),a(i,"stroke-width","4"),a(s,"d","M40 6 A34 34 0 0 1 74 40"),a(s,"fill","none"),a(s,"stroke","#2ECC88"),a(s,"stroke-width","4"),a(s,"stroke-linecap","round"),a(c,"d","M74 40 A34 34 0 0 1 56 70"),a(c,"fill","none"),a(c,"stroke","#3A8FE0"),a(c,"stroke-width","4"),a(c,"stroke-linecap","round"),a(f,"d","M56 70 A34 34 0 0 1 24 70"),a(f,"fill","none"),a(f,"stroke","#FFB833"),a(f,"stroke-width","4"),a(f,"stroke-linecap","round"),a(o,"id","loco-clear-ring"),a(h,"cx","40"),a(h,"cy","40"),a(h,"r","16"),a(h,"fill","#1a1f2e"),a(p,"cx","40"),a(p,"cy","38"),a(p,"r","10"),a(p,"fill","#2ECC88"),a(g,"cx","37"),a(g,"cy","37"),a(g,"r","2.5"),a(g,"fill","white"),a(m,"cx","37.5"),a(m,"cy","37.5"),a(m,"r","1.5"),a(m,"fill","#2C2C2A"),a(_,"cx","43"),a(_,"cy","37"),a(_,"r","2.5"),a(_,"fill","white"),a(y,"cx","42.5"),a(y,"cy","37.5"),a(y,"r","1.5"),a(y,"fill","#2C2C2A"),a(v,"d","M38 41 Q40 39 42 41 Q42 44 40 45 Q38 44 38 41Z"),a(v,"fill","#E8A020"),a(w,"x1","38"),a(w,"y1","30"),a(w,"x2","36"),a(w,"y2","26"),a(w,"stroke","#FFB833"),a(w,"stroke-width","1.5"),a(w,"stroke-linecap","round"),a(C,"x1","40"),a(C,"y1","29"),a(C,"x2","40"),a(C,"y2","24"),a(C,"stroke","#7BC74A"),a(C,"stroke-width","1.5"),a(C,"stroke-linecap","round"),a(x,"x1","42"),a(x,"y1","30"),a(x,"x2","44"),a(x,"y2","26"),a(x,"stroke","#F07040"),a(x,"stroke-width","1.5"),a(x,"stroke-linecap","round"),a(A,"cx","36"),a(A,"cy","25.5"),a(A,"r","1.5"),a(A,"fill","#FFB833"),a(M,"cx","40"),a(M,"cy","23.5"),a(M,"r","1.5"),a(M,"fill","#7BC74A"),a(L,"cx","44"),a(L,"cy","25.5"),a(L,"r","1.5"),a(L,"fill","#F07040"),a(d,"id","loco-clear-parrot"),a(t,"width","80"),a(t,"height","80"),a(t,"viewBox","0 0 80 80"),a(t,"xmlns","http://www.w3.org/2000/svg"),a(P,"class","text-sm font-medium text-gray-700")},m(z,R){B(z,t,R),u(t,n),u(n,r),u(r,l),u(t,o),u(o,i),u(o,s),u(o,c),u(o,f),u(t,d),u(d,h),u(d,p),u(d,g),u(d,m),u(d,_),u(d,y),u(d,v),u(d,w),u(d,C),u(d,x),u(d,A),u(d,M),u(d,L),B(z,I,R),B(z,P,R)},d(z){z&&(j(t),j(I),j(P))}}}function ja(e){let t,n;function r(i,s){if(i[23]==="resetting")return D0;if(i[23]==="success")return z0}let l=r(e),o=l&&l(e);return{c(){t=b("div"),n=b("div"),o&&o.c(),a(n,"class","bg-white rounded-2xl shadow-2xl px-10 py-8 flex flex-col items-center gap-4 min-w-[220px]"),a(t,"class","fixed inset-0 z-50 flex items-center justify-center bg-black/40"),a(t,"data-testid","reset-modal")},m(i,s){B(i,t,s),u(t,n),o&&o.m(n,null)},p(i,s){l!==(l=r(i))&&(o&&o.d(1),o=l&&l(i),o&&(o.c(),o.m(n,null)))},d(i){i&&j(t),o&&o.d()}}}function z0(e){let t,n,r,l,o,i,s,c,f,d,h,p;return{c(){t=ge("svg"),n=ge("defs"),r=ge("style"),l=F(`#loco-reset-ok-circle { animation: loco-circle-grow 0.5s cubic-bezier(.34,1.56,.64,1) both; transform-origin: 40px 40px; }
|
|
41
|
+
#loco-reset-checkmark { stroke-dasharray: 30; animation: loco-check-draw 0.4s ease 0.4s both; }
|
|
42
|
+
.loco-reset-spark1 { animation: loco-sparkle 0.6s ease 0.7s both; transform-origin: center; }
|
|
43
|
+
.loco-reset-spark2 { animation: loco-sparkle 0.6s ease 0.85s both; transform-origin: center; }
|
|
44
|
+
.loco-reset-spark3 { animation: loco-sparkle 0.6s ease 1.0s both; transform-origin: center; }
|
|
45
|
+
.loco-reset-spark4 { animation: loco-sparkle 0.6s ease 0.75s both; transform-origin: center; }
|
|
46
|
+
`),o=ge("circle"),i=ge("path"),s=ge("circle"),c=ge("circle"),f=ge("circle"),d=ge("circle"),h=E(),p=b("p"),p.textContent="Database reset!",a(o,"id","loco-reset-ok-circle"),a(o,"cx","40"),a(o,"cy","40"),a(o,"r","30"),a(o,"fill","#2ECC88"),a(i,"id","loco-reset-checkmark"),a(i,"d","M25 40 L35 50 L55 30"),a(i,"fill","none"),a(i,"stroke","white"),a(i,"stroke-width","5"),a(i,"stroke-linecap","round"),a(i,"stroke-linejoin","round"),a(s,"class","loco-reset-spark1"),a(s,"cx","12"),a(s,"cy","15"),a(s,"r","3"),a(s,"fill","#FFB833"),a(c,"class","loco-reset-spark2"),a(c,"cx","68"),a(c,"cy","18"),a(c,"r","2.5"),a(c,"fill","#3A8FE0"),a(f,"class","loco-reset-spark3"),a(f,"cx","65"),a(f,"cy","65"),a(f,"r","2"),a(f,"fill","#F07040"),a(d,"class","loco-reset-spark4"),a(d,"cx","15"),a(d,"cy","62"),a(d,"r","2.5"),a(d,"fill","#7BC74A"),a(t,"width","80"),a(t,"height","80"),a(t,"viewBox","0 0 80 80"),a(t,"xmlns","http://www.w3.org/2000/svg"),a(p,"class","text-sm font-medium text-gray-700")},m(g,m){B(g,t,m),u(t,n),u(n,r),u(r,l),u(t,o),u(t,i),u(t,s),u(t,c),u(t,f),u(t,d),B(g,h,m),B(g,p,m)},d(g){g&&(j(t),j(h),j(p))}}}function D0(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,m,_,y,v,w,C,x,A,M,L,I,P;return{c(){t=ge("svg"),n=ge("defs"),r=ge("style"),l=F(`#loco-reset-ring { animation: loco-spin 1.2s linear infinite; transform-origin: 40px 40px; }
|
|
47
|
+
#loco-reset-parrot { animation: loco-pulse 2s ease-in-out infinite; transform-origin: 40px 40px; }
|
|
48
|
+
`),o=ge("g"),i=ge("circle"),s=ge("path"),c=ge("path"),f=ge("path"),d=ge("g"),h=ge("circle"),p=ge("circle"),g=ge("circle"),m=ge("circle"),_=ge("circle"),y=ge("circle"),v=ge("path"),w=ge("line"),C=ge("line"),x=ge("line"),A=ge("circle"),M=ge("circle"),L=ge("circle"),I=E(),P=b("p"),P.textContent="Resetting database…",a(i,"cx","40"),a(i,"cy","40"),a(i,"r","34"),a(i,"fill","none"),a(i,"stroke","#2a3040"),a(i,"stroke-width","4"),a(s,"d","M40 6 A34 34 0 0 1 74 40"),a(s,"fill","none"),a(s,"stroke","#ef4444"),a(s,"stroke-width","4"),a(s,"stroke-linecap","round"),a(c,"d","M74 40 A34 34 0 0 1 56 70"),a(c,"fill","none"),a(c,"stroke","#f97316"),a(c,"stroke-width","4"),a(c,"stroke-linecap","round"),a(f,"d","M56 70 A34 34 0 0 1 24 70"),a(f,"fill","none"),a(f,"stroke","#eab308"),a(f,"stroke-width","4"),a(f,"stroke-linecap","round"),a(o,"id","loco-reset-ring"),a(h,"cx","40"),a(h,"cy","40"),a(h,"r","16"),a(h,"fill","#1a1f2e"),a(p,"cx","40"),a(p,"cy","38"),a(p,"r","10"),a(p,"fill","#2ECC88"),a(g,"cx","37"),a(g,"cy","37"),a(g,"r","2.5"),a(g,"fill","white"),a(m,"cx","37.5"),a(m,"cy","37.5"),a(m,"r","1.5"),a(m,"fill","#2C2C2A"),a(_,"cx","43"),a(_,"cy","37"),a(_,"r","2.5"),a(_,"fill","white"),a(y,"cx","42.5"),a(y,"cy","37.5"),a(y,"r","1.5"),a(y,"fill","#2C2C2A"),a(v,"d","M38 41 Q40 39 42 41 Q42 44 40 45 Q38 44 38 41Z"),a(v,"fill","#E8A020"),a(w,"x1","38"),a(w,"y1","30"),a(w,"x2","36"),a(w,"y2","26"),a(w,"stroke","#FFB833"),a(w,"stroke-width","1.5"),a(w,"stroke-linecap","round"),a(C,"x1","40"),a(C,"y1","29"),a(C,"x2","40"),a(C,"y2","24"),a(C,"stroke","#7BC74A"),a(C,"stroke-width","1.5"),a(C,"stroke-linecap","round"),a(x,"x1","42"),a(x,"y1","30"),a(x,"x2","44"),a(x,"y2","26"),a(x,"stroke","#F07040"),a(x,"stroke-width","1.5"),a(x,"stroke-linecap","round"),a(A,"cx","36"),a(A,"cy","25.5"),a(A,"r","1.5"),a(A,"fill","#FFB833"),a(M,"cx","40"),a(M,"cy","23.5"),a(M,"r","1.5"),a(M,"fill","#7BC74A"),a(L,"cx","44"),a(L,"cy","25.5"),a(L,"r","1.5"),a(L,"fill","#F07040"),a(d,"id","loco-reset-parrot"),a(t,"width","80"),a(t,"height","80"),a(t,"viewBox","0 0 80 80"),a(t,"xmlns","http://www.w3.org/2000/svg"),a(P,"class","text-sm font-medium text-gray-700")},m(z,R){B(z,t,R),u(t,n),u(n,r),u(r,l),u(t,o),u(o,i),u(o,s),u(o,c),u(o,f),u(t,d),u(d,h),u(d,p),u(d,g),u(d,m),u(d,_),u(d,y),u(d,v),u(d,w),u(d,C),u(d,x),u(d,A),u(d,M),u(d,L),B(z,I,R),B(z,P,R)},d(z){z&&(j(t),j(I),j(P))}}}function Ba(e){let t,n;function r(i,s){if(i[22]==="backing-up")return j0;if(i[22]==="success")return F0}let l=r(e),o=l&&l(e);return{c(){t=b("div"),n=b("div"),o&&o.c(),a(n,"class","bg-white rounded-2xl shadow-2xl px-10 py-8 flex flex-col items-center gap-4 min-w-[220px]"),a(t,"class","fixed inset-0 z-50 flex items-center justify-center bg-black/40"),a(t,"data-testid","backup-modal")},m(i,s){B(i,t,s),u(t,n),o&&o.m(n,null)},p(i,s){l!==(l=r(i))&&(o&&o.d(1),o=l&&l(i),o&&(o.c(),o.m(n,null)))},d(i){i&&j(t),o&&o.d()}}}function F0(e){let t,n,r,l,o,i,s,c,f,d,h,p;return{c(){t=ge("svg"),n=ge("defs"),r=ge("style"),l=F(`@keyframes loco-circle-grow { 0% { transform: scale(0); opacity: 0; } 50% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
|
|
49
|
+
@keyframes loco-check-draw { 0% { stroke-dashoffset: 30; } 100% { stroke-dashoffset: 0; } }
|
|
50
|
+
@keyframes loco-sparkle { 0%, 100% { opacity: 0; transform: scale(0); } 50% { opacity: 1; transform: scale(1); } }
|
|
51
|
+
#loco-success-circle { animation: loco-circle-grow 0.5s cubic-bezier(.34,1.56,.64,1) both; transform-origin: 40px 40px; }
|
|
52
|
+
#loco-checkmark { stroke-dasharray: 30; animation: loco-check-draw 0.4s ease 0.4s both; }
|
|
53
|
+
.loco-spark1 { animation: loco-sparkle 0.6s ease 0.7s both; transform-origin: center; }
|
|
54
|
+
.loco-spark2 { animation: loco-sparkle 0.6s ease 0.85s both; transform-origin: center; }
|
|
55
|
+
.loco-spark3 { animation: loco-sparkle 0.6s ease 1.0s both; transform-origin: center; }
|
|
56
|
+
.loco-spark4 { animation: loco-sparkle 0.6s ease 0.75s both; transform-origin: center; }
|
|
57
|
+
`),o=ge("circle"),i=ge("path"),s=ge("circle"),c=ge("circle"),f=ge("circle"),d=ge("circle"),h=E(),p=b("p"),p.textContent="Backup created!",a(o,"id","loco-success-circle"),a(o,"cx","40"),a(o,"cy","40"),a(o,"r","30"),a(o,"fill","#2ECC88"),a(i,"id","loco-checkmark"),a(i,"d","M25 40 L35 50 L55 30"),a(i,"fill","none"),a(i,"stroke","white"),a(i,"stroke-width","5"),a(i,"stroke-linecap","round"),a(i,"stroke-linejoin","round"),a(s,"class","loco-spark1"),a(s,"cx","12"),a(s,"cy","15"),a(s,"r","3"),a(s,"fill","#FFB833"),a(c,"class","loco-spark2"),a(c,"cx","68"),a(c,"cy","18"),a(c,"r","2.5"),a(c,"fill","#3A8FE0"),a(f,"class","loco-spark3"),a(f,"cx","65"),a(f,"cy","65"),a(f,"r","2"),a(f,"fill","#F07040"),a(d,"class","loco-spark4"),a(d,"cx","15"),a(d,"cy","62"),a(d,"r","2.5"),a(d,"fill","#7BC74A"),a(t,"width","80"),a(t,"height","80"),a(t,"viewBox","0 0 80 80"),a(t,"xmlns","http://www.w3.org/2000/svg"),a(p,"class","text-sm font-medium text-gray-700")},m(g,m){B(g,t,m),u(t,n),u(n,r),u(r,l),u(t,o),u(t,i),u(t,s),u(t,c),u(t,f),u(t,d),B(g,h,m),B(g,p,m)},d(g){g&&(j(t),j(h),j(p))}}}function j0(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,m,_,y,v,w,C,x,A,M,L,I,P;return{c(){t=ge("svg"),n=ge("defs"),r=ge("style"),l=F(`@keyframes loco-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
|
|
58
|
+
@keyframes loco-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.7; transform: scale(0.92); } }
|
|
59
|
+
#loco-spinner-ring { animation: loco-spin 1.2s linear infinite; transform-origin: 40px 40px; }
|
|
60
|
+
#loco-center-parrot { animation: loco-pulse 2s ease-in-out infinite; transform-origin: 40px 40px; }
|
|
61
|
+
`),o=ge("g"),i=ge("circle"),s=ge("path"),c=ge("path"),f=ge("path"),d=ge("g"),h=ge("circle"),p=ge("circle"),g=ge("circle"),m=ge("circle"),_=ge("circle"),y=ge("circle"),v=ge("path"),w=ge("line"),C=ge("line"),x=ge("line"),A=ge("circle"),M=ge("circle"),L=ge("circle"),I=E(),P=b("p"),P.textContent="Creating backup…",a(i,"cx","40"),a(i,"cy","40"),a(i,"r","34"),a(i,"fill","none"),a(i,"stroke","#2a3040"),a(i,"stroke-width","4"),a(s,"d","M40 6 A34 34 0 0 1 74 40"),a(s,"fill","none"),a(s,"stroke","#2ECC88"),a(s,"stroke-width","4"),a(s,"stroke-linecap","round"),a(c,"d","M74 40 A34 34 0 0 1 56 70"),a(c,"fill","none"),a(c,"stroke","#3A8FE0"),a(c,"stroke-width","4"),a(c,"stroke-linecap","round"),a(f,"d","M56 70 A34 34 0 0 1 24 70"),a(f,"fill","none"),a(f,"stroke","#FFB833"),a(f,"stroke-width","4"),a(f,"stroke-linecap","round"),a(o,"id","loco-spinner-ring"),a(h,"cx","40"),a(h,"cy","40"),a(h,"r","16"),a(h,"fill","#1a1f2e"),a(p,"cx","40"),a(p,"cy","38"),a(p,"r","10"),a(p,"fill","#2ECC88"),a(g,"cx","37"),a(g,"cy","37"),a(g,"r","2.5"),a(g,"fill","white"),a(m,"cx","37.5"),a(m,"cy","37.5"),a(m,"r","1.5"),a(m,"fill","#2C2C2A"),a(_,"cx","43"),a(_,"cy","37"),a(_,"r","2.5"),a(_,"fill","white"),a(y,"cx","42.5"),a(y,"cy","37.5"),a(y,"r","1.5"),a(y,"fill","#2C2C2A"),a(v,"d","M38 41 Q40 39 42 41 Q42 44 40 45 Q38 44 38 41Z"),a(v,"fill","#E8A020"),a(w,"x1","38"),a(w,"y1","30"),a(w,"x2","36"),a(w,"y2","26"),a(w,"stroke","#FFB833"),a(w,"stroke-width","1.5"),a(w,"stroke-linecap","round"),a(C,"x1","40"),a(C,"y1","29"),a(C,"x2","40"),a(C,"y2","24"),a(C,"stroke","#7BC74A"),a(C,"stroke-width","1.5"),a(C,"stroke-linecap","round"),a(x,"x1","42"),a(x,"y1","30"),a(x,"x2","44"),a(x,"y2","26"),a(x,"stroke","#F07040"),a(x,"stroke-width","1.5"),a(x,"stroke-linecap","round"),a(A,"cx","36"),a(A,"cy","25.5"),a(A,"r","1.5"),a(A,"fill","#FFB833"),a(M,"cx","40"),a(M,"cy","23.5"),a(M,"r","1.5"),a(M,"fill","#7BC74A"),a(L,"cx","44"),a(L,"cy","25.5"),a(L,"r","1.5"),a(L,"fill","#F07040"),a(d,"id","loco-center-parrot"),a(t,"width","80"),a(t,"height","80"),a(t,"viewBox","0 0 80 80"),a(t,"xmlns","http://www.w3.org/2000/svg"),a(P,"class","text-sm font-medium text-gray-700")},m(z,R){B(z,t,R),u(t,n),u(n,r),u(r,l),u(t,o),u(o,i),u(o,s),u(o,c),u(o,f),u(t,d),u(d,h),u(d,p),u(d,g),u(d,m),u(d,_),u(d,y),u(d,v),u(d,w),u(d,C),u(d,x),u(d,A),u(d,M),u(d,L),B(z,I,R),B(z,P,R)},d(z){z&&(j(t),j(I),j(P))}}}function B0(e){let t,n,r,l,o,i,s,c,f,d,h=e[2]?"Saving…":"Save",p,g,m,_,y,v,w,C,x=e[25].api_key+"",A,M,L,I=e[1]==="key"?"Copied":"Copy",P,z,R,T=e[3]?"Regenerating…":"Regenerate API Key",N,k,D,G,W,Q,Y,ie,H,Z,re,K=e[6]?"🙈":"👁️",X,pe,we,Ee=e[5]?"Saving…":"Save",le,ke,ue,ne,Ce,S,te,J,U=e[1]==="snippet"?"Copied":"Copy Snippet",O,V,ae,ce,q,he,_e,de,Te,ze,ve,Ae,De,Be,We,oe,se,Ne,Me,Re,be,Ue,it,Je,Ie,Ge,xe,qe,$e,bt,$t,Nt,Bt,Rt,Ot,ye=e[14]?"Enabled":"Disabled",He,Ke,st,vt,mt,ut,_t,nt,Ze,Oe,Qe,Tt,ot,wn,In=e[15]?"Enabled":"Disabled",Rn,ir,Pt,_n,Ln,or,sn,sr,Nn,ar,On,ur,Mt,Pn,cr,zn,fr,me,Xe=e[16]?"Clearing…":"Clear All Pending",et,It,wt,hn,Un,Ut,an,dr=e[17]?"Resetting…":"Reset Entire Database",Or,ul,kn,xn,hr,cl,pr,gr=e[10]?"▲":"▼",Ur,fl,Hr,Hn,Zn,Wn,Zr,dl;function hl(Le,tt){return Le[6]?T0:S0}let mr=hl(e),un=mr(e),fe=Fe(e[7]),Se=[];for(let Le=0;Le<fe.length;Le+=1)Se[Le]=Sa(Aa(e,fe,Le));let Ve=e[7].length===0&&Ta();function lt(Le,tt){return Le[20]?E0:M0}let kt=lt(e),At=kt(e),xt=!e[18].length&&!e[19]&&Ma(e);function pl(Le,tt){if(Le[19])return L0;if(Le[18].length>0)return I0}let _r=pl(e),Ht=_r&&_r(e),Zt=e[10]&&Ia(e),Wt=e[24]&&Fa(e),Yt=e[23]&&ja(e),Gt=e[22]&&Ba(e);return{c(){t=b("div"),n=b("h2"),n.textContent="Settings",r=E(),l=b("div"),o=b("label"),o.textContent="Project Name",i=E(),s=b("div"),c=b("input"),f=E(),d=b("button"),p=F(h),m=E(),_=b("div"),y=b("div"),y.textContent="API Key",v=E(),w=b("div"),C=b("code"),A=F(x),M=E(),L=b("button"),P=F(I),z=E(),R=b("button"),N=F(T),k=E(),D=b("div"),G=b("label"),G.textContent="BlueHive API Key",W=E(),Q=b("p"),Q.innerHTML='Required for AI-powered translations. Get your key from <a href="https://app.ozwell.ai" target="_blank" class="text-indigo-600 hover:underline">app.ozwell.ai</a>',Y=E(),ie=b("div"),H=b("div"),un.c(),Z=E(),re=b("button"),X=F(K),pe=E(),we=b("button"),le=F(Ee),ke=E(),ue=b("div"),ne=b("div"),ne.textContent="CDN Script Snippet",Ce=E(),S=b("pre"),S.textContent=`${e[28]()}`,te=E(),J=b("button"),O=F(U),V=E(),ae=b("div"),ce=b("div"),ce.textContent="Target Languages",q=E(),he=b("div");for(let Le=0;Le<Se.length;Le+=1)Se[Le].c();_e=E(),Ve&&Ve.c(),de=E(),Te=b("div"),ze=b("div"),ve=b("label"),ve.textContent="Language Code",Ae=E(),De=b("input"),Be=E(),We=b("div"),oe=b("label"),oe.textContent="Language Name",se=E(),Ne=b("input"),Me=E(),Re=b("button"),be=F("Add"),it=E(),Je=b("div"),Ie=b("div"),Ie.textContent="DOM Context",Ge=E(),xe=b("p"),xe.textContent="When enabled, the Loco client builds context breadcrumbs (headings, labels, sections) for each phrase. This helps distinguish identical text in different parts of the page. Disable to simplify phrase collection and improve performance on large pages.",qe=E(),$e=b("label"),bt=b("button"),$t=b("span"),Rt=E(),Ot=b("span"),He=F(ye),Ke=E(),st=b("div"),vt=b("div"),vt.textContent="Page Screenshots",mt=E(),ut=b("p"),ut.textContent="When enabled, the Loco client will capture a page screenshot and send it to the dashboard for context during translation.",_t=E(),nt=b("label"),Ze=b("button"),Oe=b("span"),ot=E(),wn=b("span"),Rn=F(In),ir=E(),Pt=b("div"),_n=b("div"),Ln=b("div"),Ln.textContent="Backups",or=E(),sn=b("button"),At.c(),sr=E(),Nn=b("p"),Nn.innerHTML='Create point-in-time snapshots of your database. To restore, stop the server and replace <code class="bg-gray-100 px-1 rounded">server/data/loco.db</code> with a backup file.',ar=E(),xt&&xt.c(),On=E(),Ht&&Ht.c(),ur=E(),Mt=b("div"),Pn=b("div"),Pn.textContent="Danger Zone",cr=E(),zn=b("p"),zn.textContent="Delete all pending text nodes from the database. Approved and trashed items are not affected.",fr=E(),me=b("button"),et=F(Xe),It=E(),wt=b("hr"),hn=E(),Un=b("p"),Un.textContent="Delete ALL text nodes, translations, and screenshots. The project and its settings will be kept.",Ut=E(),an=b("button"),Or=F(dr),ul=E(),kn=b("div"),xn=b("button"),hr=b("span"),hr.textContent="Crawler Configuration",cl=E(),pr=b("span"),Ur=F(gr),fl=E(),Zt&&Zt.c(),Hr=E(),Wt&&Wt.c(),Hn=E(),Yt&&Yt.c(),Zn=E(),Gt&&Gt.c(),Wn=Ct(),a(n,"class","text-xl font-semibold text-gray-800 mb-6"),a(o,"for","project-name"),a(o,"class","block text-sm font-medium text-gray-600 mb-2"),a(c,"id","project-name"),a(c,"class","flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"),a(c,"placeholder","Project name"),a(d,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),d.disabled=g=e[2]||e[0]===e[25].name,a(s,"class","flex gap-2"),a(l,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(y,"class","block text-sm font-medium text-gray-600 mb-2"),a(C,"class","flex-1 px-3 py-2 bg-gray-50 border border-gray-200 rounded-md text-sm font-mono text-gray-700 select-all"),a(L,"class","px-3 py-2 border border-gray-300 rounded-md text-sm hover:bg-gray-50"),a(w,"class","flex gap-2 items-center"),a(R,"class","mt-3 px-3 py-1.5 border border-red-300 text-red-600 text-xs rounded-md hover:bg-red-50 disabled:opacity-50"),R.disabled=e[3],a(_,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(G,"for","bluehive-api-key"),a(G,"class","block text-sm font-medium text-gray-600 mb-2"),a(Q,"class","text-xs text-gray-400 mb-2"),a(re,"class","absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 text-xs"),a(re,"type","button"),a(H,"class","relative flex-1"),a(we,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),we.disabled=e[5],a(ie,"class","flex gap-2"),a(D,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(ne,"class","block text-sm font-medium text-gray-600 mb-2"),a(S,"class","px-3 py-2 bg-gray-50 border border-gray-200 rounded-md text-xs font-mono text-gray-700 overflow-x-auto whitespace-pre-wrap"),a(J,"class","mt-2 px-3 py-1.5 border border-gray-300 rounded-md text-sm hover:bg-gray-50"),a(ue,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(ce,"class","block text-sm font-medium text-gray-600 mb-3"),a(he,"class","space-y-1 mb-4"),a(ve,"for","new-language-code"),a(ve,"class","block text-xs text-gray-500 mb-1"),a(De,"id","new-language-code"),a(De,"placeholder","e.g. zh-Hans"),a(De,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(ze,"class","flex-1"),a(oe,"for","new-language-name"),a(oe,"class","block text-xs text-gray-500 mb-1"),a(Ne,"id","new-language-name"),a(Ne,"placeholder","e.g. Chinese (Simplified)"),a(Ne,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(We,"class","flex-1"),a(Re,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),Re.disabled=Ue=!e[8].trim()||!e[9].trim(),a(Te,"class","flex gap-2 items-end"),a(ae,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(Ie,"class","block text-sm font-medium text-gray-700 mb-2"),a(xe,"class","text-xs text-gray-500 mb-3"),a($t,"class",Nt="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(e[14]?"translate-x-6":"translate-x-1")),a(bt,"class",Bt="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(e[14]?"bg-indigo-600":"bg-gray-300")),a(bt,"role","switch"),a(bt,"aria-checked",e[14]),a(Ot,"class","text-sm text-gray-700"),a($e,"class","flex items-center gap-3 cursor-pointer"),a(Je,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(vt,"class","block text-sm font-medium text-gray-700 mb-2"),a(ut,"class","text-xs text-gray-500 mb-3"),a(Oe,"class",Qe="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(e[15]?"translate-x-6":"translate-x-1")),a(Ze,"class",Tt="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(e[15]?"bg-indigo-600":"bg-gray-300")),a(Ze,"role","switch"),a(Ze,"aria-checked",e[15]),a(wn,"class","text-sm text-gray-700"),a(nt,"class","flex items-center gap-3 cursor-pointer"),a(st,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(Ln,"class","text-sm font-medium text-gray-700"),a(sn,"class","px-3 py-1.5 bg-indigo-600 text-white text-xs rounded-md hover:bg-indigo-700 disabled:opacity-50 flex items-center gap-1.5"),sn.disabled=e[20],a(_n,"class","flex items-center justify-between mb-3"),a(Nn,"class","text-xs text-gray-400 mb-3"),a(Pt,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(Pn,"class","block text-sm font-medium text-red-600 mb-2"),a(zn,"class","text-xs text-gray-500 mb-3"),a(me,"class","px-4 py-2 bg-red-600 text-white text-sm rounded-md hover:bg-red-700 disabled:opacity-50"),me.disabled=e[16],a(wt,"class","my-4 border-red-100"),a(Un,"class","text-xs text-gray-500 mb-3"),a(an,"class","px-4 py-2 bg-red-700 text-white text-sm rounded-md hover:bg-red-800 disabled:opacity-50"),an.disabled=e[17],a(Mt,"class","bg-white rounded-lg border border-red-200 p-5 mb-4"),a(hr,"class","text-sm font-medium text-gray-600"),a(pr,"class","text-gray-400 text-xs"),a(xn,"class","flex items-center justify-between w-full text-left"),a(kn,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(t,"class","max-w-2xl")},m(Le,tt){B(Le,t,tt),u(t,n),u(t,r),u(t,l),u(l,o),u(l,i),u(l,s),u(s,c),Pe(c,e[0]),u(s,f),u(s,d),u(d,p),u(t,m),u(t,_),u(_,y),u(_,v),u(_,w),u(w,C),u(C,A),u(w,M),u(w,L),u(L,P),u(_,z),u(_,R),u(R,N),u(t,k),u(t,D),u(D,G),u(D,W),u(D,Q),u(D,Y),u(D,ie),u(ie,H),un.m(H,null),u(H,Z),u(H,re),u(re,X),u(ie,pe),u(ie,we),u(we,le),u(t,ke),u(t,ue),u(ue,ne),u(ue,Ce),u(ue,S),u(ue,te),u(ue,J),u(J,O),u(t,V),u(t,ae),u(ae,ce),u(ae,q),u(ae,he);for(let Lt=0;Lt<Se.length;Lt+=1)Se[Lt]&&Se[Lt].m(he,null);u(ae,_e),Ve&&Ve.m(ae,null),u(ae,de),u(ae,Te),u(Te,ze),u(ze,ve),u(ze,Ae),u(ze,De),Pe(De,e[8]),u(Te,Be),u(Te,We),u(We,oe),u(We,se),u(We,Ne),Pe(Ne,e[9]),u(Te,Me),u(Te,Re),u(Re,be),u(t,it),u(t,Je),u(Je,Ie),u(Je,Ge),u(Je,xe),u(Je,qe),u(Je,$e),u($e,bt),u(bt,$t),u($e,Rt),u($e,Ot),u(Ot,He),u(t,Ke),u(t,st),u(st,vt),u(st,mt),u(st,ut),u(st,_t),u(st,nt),u(nt,Ze),u(Ze,Oe),u(nt,ot),u(nt,wn),u(wn,Rn),u(t,ir),u(t,Pt),u(Pt,_n),u(_n,Ln),u(_n,or),u(_n,sn),At.m(sn,null),u(Pt,sr),u(Pt,Nn),u(Pt,ar),xt&&xt.m(Pt,null),u(Pt,On),Ht&&Ht.m(Pt,null),u(t,ur),u(t,Mt),u(Mt,Pn),u(Mt,cr),u(Mt,zn),u(Mt,fr),u(Mt,me),u(me,et),u(Mt,It),u(Mt,wt),u(Mt,hn),u(Mt,Un),u(Mt,Ut),u(Mt,an),u(an,Or),u(t,ul),u(t,kn),u(kn,xn),u(xn,hr),u(xn,cl),u(xn,pr),u(pr,Ur),u(kn,fl),Zt&&Zt.m(kn,null),B(Le,Hr,tt),Wt&&Wt.m(Le,tt),B(Le,Hn,tt),Yt&&Yt.m(Le,tt),B(Le,Zn,tt),Gt&&Gt.m(Le,tt),B(Le,Wn,tt),Zr||(dl=[$(c,"input",e[47]),$(d,"click",e[30]),$(L,"click",e[48]),$(R,"click",e[31]),$(re,"click",e[51]),$(we,"click",e[29]),$(J,"click",e[52]),$(De,"input",e[54]),$(Ne,"input",e[55]),$(Re,"click",e[32]),$(bt,"click",e[40]),$(Ze,"click",e[39]),$(sn,"click",e[44]),$(me,"click",e[41]),$(an,"click",e[42]),$(xn,"click",e[57])],Zr=!0)},p(Le,tt){if(tt[0]&1&&c.value!==Le[0]&&Pe(c,Le[0]),tt[0]&4&&h!==(h=Le[2]?"Saving…":"Save")&&ee(p,h),tt[0]&33554437&&g!==(g=Le[2]||Le[0]===Le[25].name)&&(d.disabled=g),tt[0]&33554432&&x!==(x=Le[25].api_key+"")&&ee(A,x),tt[0]&2&&I!==(I=Le[1]==="key"?"Copied":"Copy")&&ee(P,I),tt[0]&8&&T!==(T=Le[3]?"Regenerating…":"Regenerate API Key")&&ee(N,T),tt[0]&8&&(R.disabled=Le[3]),mr===(mr=hl(Le))&&un?un.p(Le,tt):(un.d(1),un=mr(Le),un&&(un.c(),un.m(H,Z))),tt[0]&64&&K!==(K=Le[6]?"🙈":"👁️")&&ee(X,K),tt[0]&32&&Ee!==(Ee=Le[5]?"Saving…":"Save")&&ee(le,Ee),tt[0]&32&&(we.disabled=Le[5]),tt[0]&2&&U!==(U=Le[1]==="snippet"?"Copied":"Copy Snippet")&&ee(O,U),tt[0]&128|tt[1]&4){fe=Fe(Le[7]);let Lt;for(Lt=0;Lt<fe.length;Lt+=1){const so=Aa(Le,fe,Lt);Se[Lt]?Se[Lt].p(so,tt):(Se[Lt]=Sa(so),Se[Lt].c(),Se[Lt].m(he,null))}for(;Lt<Se.length;Lt+=1)Se[Lt].d(1);Se.length=fe.length}Le[7].length===0?Ve||(Ve=Ta(),Ve.c(),Ve.m(ae,de)):Ve&&(Ve.d(1),Ve=null),tt[0]&256&&De.value!==Le[8]&&Pe(De,Le[8]),tt[0]&512&&Ne.value!==Le[9]&&Pe(Ne,Le[9]),tt[0]&768&&Ue!==(Ue=!Le[8].trim()||!Le[9].trim())&&(Re.disabled=Ue),tt[0]&16384&&Nt!==(Nt="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(Le[14]?"translate-x-6":"translate-x-1"))&&a($t,"class",Nt),tt[0]&16384&&Bt!==(Bt="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(Le[14]?"bg-indigo-600":"bg-gray-300"))&&a(bt,"class",Bt),tt[0]&16384&&a(bt,"aria-checked",Le[14]),tt[0]&16384&&ye!==(ye=Le[14]?"Enabled":"Disabled")&&ee(He,ye),tt[0]&32768&&Qe!==(Qe="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(Le[15]?"translate-x-6":"translate-x-1"))&&a(Oe,"class",Qe),tt[0]&32768&&Tt!==(Tt="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(Le[15]?"bg-indigo-600":"bg-gray-300"))&&a(Ze,"class",Tt),tt[0]&32768&&a(Ze,"aria-checked",Le[15]),tt[0]&32768&&In!==(In=Le[15]?"Enabled":"Disabled")&&ee(Rn,In),kt!==(kt=lt(Le))&&(At.d(1),At=kt(Le),At&&(At.c(),At.m(sn,null))),tt[0]&1048576&&(sn.disabled=Le[20]),!Le[18].length&&!Le[19]?xt?xt.p(Le,tt):(xt=Ma(Le),xt.c(),xt.m(Pt,On)):xt&&(xt.d(1),xt=null),_r===(_r=pl(Le))&&Ht?Ht.p(Le,tt):(Ht&&Ht.d(1),Ht=_r&&_r(Le),Ht&&(Ht.c(),Ht.m(Pt,null))),tt[0]&65536&&Xe!==(Xe=Le[16]?"Clearing…":"Clear All Pending")&&ee(et,Xe),tt[0]&65536&&(me.disabled=Le[16]),tt[0]&131072&&dr!==(dr=Le[17]?"Resetting…":"Reset Entire Database")&&ee(Or,dr),tt[0]&131072&&(an.disabled=Le[17]),tt[0]&1024&&gr!==(gr=Le[10]?"▲":"▼")&&ee(Ur,gr),Le[10]?Zt?Zt.p(Le,tt):(Zt=Ia(Le),Zt.c(),Zt.m(kn,null)):Zt&&(Zt.d(1),Zt=null),Le[24]?Wt?Wt.p(Le,tt):(Wt=Fa(Le),Wt.c(),Wt.m(Hn.parentNode,Hn)):Wt&&(Wt.d(1),Wt=null),Le[23]?Yt?Yt.p(Le,tt):(Yt=ja(Le),Yt.c(),Yt.m(Zn.parentNode,Zn)):Yt&&(Yt.d(1),Yt=null),Le[22]?Gt?Gt.p(Le,tt):(Gt=Ba(Le),Gt.c(),Gt.m(Wn.parentNode,Wn)):Gt&&(Gt.d(1),Gt=null)},i:je,o:je,d(Le){Le&&(j(t),j(Hr),j(Hn),j(Zn),j(Wn)),un.d(),ft(Se,Le),Ve&&Ve.d(),At.d(),xt&&xt.d(),Ht&&Ht.d(),Zt&&Zt.d(),Wt&&Wt.d(Le),Yt&&Yt.d(Le),Gt&&Gt.d(Le),Zr=!1,rt(dl)}}}function Ra(e){return e<1024?e+" B":e<1024*1024?(e/1024).toFixed(1)+" KB":(e/(1024*1024)).toFixed(1)+" MB"}function Oa(e){return new Date(e).toLocaleString()}function R0(e,t,n){let r;el(e,cn,be=>n(25,r=be));const l=[{code:"zh-Hans",name:"Chinese (Simplified)"},{code:"zh-Hant",name:"Chinese (Traditional)"},{code:"es",name:"Spanish"},{code:"fr",name:"French"},{code:"de",name:"German"},{code:"ja",name:"Japanese"},{code:"ko",name:"Korean"},{code:"pt",name:"Portuguese"}],o={blockedTags:["SCRIPT","STYLE","NOSCRIPT","IFRAME","CODE","SVG","AUDIO","VIDEO","LINK"],inlineTags:["VAR","STRONG","EM","B","I","SPAN","A","ABBR","MARK","SMALL","SUB","SUP","U","S","TIME"],domContextSelectors:["h1","h2","h3","h4","h5","h6","label","legend","caption","figcaption","nav","header","footer","main","section","article","form",".portlet-header",".admin-card",".wc_win_title",".miewin_title_bar",".ui-dialog-title",".ui-dialog-titlebar",".wc_tab_title"]},i=[{key:"blockedTags",title:"Blocked Tags",desc:"HTML tags to skip during text extraction.",placeholder:"e.g. CANVAS"},{key:"inlineTags",title:"Inline Tags",desc:"Tags treated as inline content in mixed-content extraction.",placeholder:"e.g. CITE"},{key:"domContextSelectors",title:"DOM Context Selectors",desc:"CSS selectors used to build context breadcrumbs for each phrase.",placeholder:"e.g. .my-header"}];let s="",c="",f=!1,d=!1,h={},p="",g=!1,m=!1,_=[],y="",v="",w=!1,C={blockedTags:{disabled:[],custom:[]},inlineTags:{disabled:[],custom:[]},domContextSelectors:{disabled:[],custom:[]}},x={blockedTags:"",inlineTags:"",domContextSelectors:""},A=0,M=!0,L=!0,I=!1,P=!1,z=[],R=!1,T=!1,N=null,k=!1,D=!1,G=!1;Br(()=>{n(0,s=r.name||"");try{h=JSON.parse(r.settings||"{}")}catch{h={}}n(7,_=h.languages||l.map(be=>({...be}))),n(4,p=h.bluehiveApiKey||""),n(11,C={blockedTags:{disabled:[],custom:[],...h.blockedTags||{}},inlineTags:{disabled:[],custom:[],...h.inlineTags||{}},domContextSelectors:{disabled:[],custom:[],...h.domContextSelectors||{}}}),n(13,A=typeof h.contextDepth=="number"?h.contextDepth:0),n(14,M=h.domContextEnabled!==!1),n(15,L=h.screenshotsEnabled!==!1)});function W(){const be=window.location.pathname.replace(/\/dashboard\/?$/,""),Ue=window.location.origin+be;return`<script src="${Ue}/cdn/loco.js"><\/script>
|
|
62
|
+
<script>Loco.init({ apiUrl: '${Ue}', apiKey: '${r.api_key}' });<\/script>`}async function Q(){n(5,g=!0),h.bluehiveApiKey=p.trim();const be=await Ye("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})});br(cn,r=await be.json(),r),n(5,g=!1)}async function Y(){n(2,f=!0);const be=await Ye("../api/project",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s})});br(cn,r=await be.json(),r),n(2,f=!1)}async function ie(){if(!confirm("Are you sure? This will invalidate the current API key. All pages using the old key will stop receiving translations."))return;n(3,d=!0);const be=await Ye("../api/project/regenerate-key",{method:"POST"});br(cn,r=await be.json(),r),r&&r.api_key&&Nc(r.api_key),n(3,d=!1)}async function H(){h.languages=_;const be=await Ye("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})});br(cn,r=await be.json(),r)}function Z(){const be=y.trim(),Ue=v.trim();!be||!Ue||_.some(it=>it.code===be)||(n(7,_=[..._,{code:be,name:Ue}]),n(8,y=""),n(9,v=""),H())}function re(be){n(7,_=_.filter(Ue=>Ue.code!==be)),H()}async function K(){h.blockedTags=C.blockedTags,h.inlineTags=C.inlineTags,h.domContextSelectors=C.domContextSelectors,h.contextDepth=A;const be=await Ye("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})});br(cn,r=await be.json(),r)}function X(be,Ue){const it=C[be].disabled,Je=it.indexOf(Ue);Je>=0?it.splice(Je,1):it.push(Ue),n(11,C),K()}function pe(be){const Ue=x[be].trim();!Ue||C[be].custom.includes(Ue)||(n(11,C[be].custom=[...C[be].custom,Ue],C),n(12,x[be]="",x),n(12,x),K())}function we(be,Ue){n(11,C[be].custom=C[be].custom.filter(it=>it!==Ue),C),n(11,C),K()}function Ee(be,Ue){return!C[be].disabled.includes(Ue)}async function le(){n(15,L=!L),h.screenshotsEnabled=L,await Ye("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})})}async function ke(){n(14,M=!M),h.domContextEnabled=M;const be=await Ye("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})});br(cn,r=await be.json(),r)}async function ue(){if(confirm("Delete ALL pending text nodes? This cannot be undone.")){n(16,I=!0),n(24,G="clearing");try{await Ye("../api/textnodes/clear-pending",{method:"POST"}),n(24,G="success"),await new Promise(be=>setTimeout(be,1500))}catch{}n(24,G=!1),n(16,I=!1)}}async function ne(){if(confirm("This will permanently delete ALL text nodes, translations, and screenshots. This cannot be undone. Are you sure?")){n(17,P=!0),n(23,D="resetting");try{await Ye("../api/project/reset-database",{method:"POST"}),n(23,D="success"),await new Promise(be=>setTimeout(be,1500))}catch{}n(23,D=!1),n(17,P=!1)}}async function Ce(){n(19,R=!0);try{const be=await Ye("../api/backups");n(18,z=await be.json())}catch{n(18,z=[])}n(19,R=!1)}async function S(){n(20,T=!0),n(22,k="backing-up");try{await Ye("../api/backups",{method:"POST"}),await Ce(),n(22,k="success"),await new Promise(be=>setTimeout(be,1500))}catch{}n(22,k=!1),n(20,T=!1)}async function te(be){if(confirm(`Delete backup "${be}"? This cannot be undone.`)){n(21,N=be);try{await Ye(`../api/backups/${encodeURIComponent(be)}`,{method:"DELETE"}),await Ce()}catch{}n(21,N=null)}}async function J(be,Ue){await navigator.clipboard.writeText(be),n(1,c=Ue),setTimeout(()=>{n(1,c="")},2e3)}function U(){s=this.value,n(0,s)}const O=()=>J(r.api_key,"key");function V(){p=this.value,n(4,p)}function ae(){p=this.value,n(4,p)}const ce=()=>n(6,m=!m),q=()=>J(W(),"snippet"),he=be=>re(be.code);function _e(){y=this.value,n(8,y)}function de(){v=this.value,n(9,v)}const Te=be=>te(be.filename),ze=()=>n(10,w=!w),ve=()=>{n(13,A=0),K()},Ae=()=>{A===0&&(n(13,A=5),K())},De=()=>{n(13,A=Math.max(1,A-1)),K()};function Be(){A=Ac(this.value),n(13,A)}const We=()=>{n(13,A=A+1),K()},oe=(be,Ue)=>X(be.key,Ue),se=(be,Ue)=>we(be.key,Ue);function Ne(be){x[be.key]=this.value,n(12,x)}return[s,c,f,d,p,g,m,_,y,v,w,C,x,A,M,L,I,P,z,R,T,N,k,D,G,r,o,i,W,Q,Y,ie,Z,re,K,X,pe,we,Ee,le,ke,ue,ne,Ce,S,te,J,U,O,V,ae,ce,q,he,_e,de,Te,ze,ve,Ae,De,Be,We,oe,se,Ne,(be,Ue)=>{Ue.key==="Enter"&&pe(be.key)},be=>pe(be.key)]}class O0 extends on{constructor(t){super(),ln(this,t,R0,B0,Qt,{},null,[-1,-1,-1])}}function Tl(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function U0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Zi(e){let t,n,r;e.length!==2?(t=Tl,n=(s,c)=>Tl(e(s),c),r=(s,c)=>e(s)-c):(t=e===Tl||e===U0?e:H0,n=e,r=e);function l(s,c,f=0,d=s.length){if(f<d){if(t(c,c)!==0)return d;do{const h=f+d>>>1;n(s[h],c)<0?f=h+1:d=h}while(f<d)}return f}function o(s,c,f=0,d=s.length){if(f<d){if(t(c,c)!==0)return d;do{const h=f+d>>>1;n(s[h],c)<=0?f=h+1:d=h}while(f<d)}return f}function i(s,c,f=0,d=s.length){const h=l(s,c,f,d-1);return h>f&&r(s[h-1],c)>-r(s[h],c)?h-1:h}return{left:l,center:i,right:o}}function H0(){return 0}function Z0(e){return e===null?NaN:+e}const W0=Zi(Tl),Y0=W0.right;Zi(Z0).center;function G0(e,t){let n,r;if(t===void 0)for(const l of e)l!=null&&(n===void 0?l>=l&&(n=r=l):(n>l&&(n=l),r<l&&(r=l)));else{let l=-1;for(let o of e)(o=t(o,++l,e))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Ua extends Map{constructor(t,n=J0){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,l]of t)this.set(r,l)}get(t){return super.get(Ha(this,t))}has(t){return super.has(Ha(this,t))}set(t,n){return super.set(V0(this,t),n)}delete(t){return super.delete(X0(this,t))}}function Ha({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function V0({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function X0({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function J0(e){return e!==null&&typeof e=="object"?e.valueOf():e}const K0=Math.sqrt(50),q0=Math.sqrt(10),Q0=Math.sqrt(2);function jl(e,t,n){const r=(t-e)/Math.max(0,n),l=Math.floor(Math.log10(r)),o=r/Math.pow(10,l),i=o>=K0?10:o>=q0?5:o>=Q0?2:1;let s,c,f;return l<0?(f=Math.pow(10,-l)/i,s=Math.round(e*f),c=Math.round(t*f),s/f<e&&++s,c/f>t&&--c,f=-f):(f=Math.pow(10,l)*i,s=Math.round(e/f),c=Math.round(t/f),s*f<e&&++s,c*f>t&&--c),c<s&&.5<=n&&n<2?jl(e,t,n*2):[s,c,f]}function $0(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[l,o,i]=r?jl(t,e,n):jl(e,t,n);if(!(o>=l))return[];const s=o-l+1,c=new Array(s);if(r)if(i<0)for(let f=0;f<s;++f)c[f]=(o-f)/-i;else for(let f=0;f<s;++f)c[f]=(o-f)*i;else if(i<0)for(let f=0;f<s;++f)c[f]=(l+f)/-i;else for(let f=0;f<s;++f)c[f]=(l+f)*i;return c}function Ai(e,t,n){return t=+t,e=+e,n=+n,jl(e,t,n)[2]}function Si(e,t,n){t=+t,e=+e,n=+n;const r=t<e,l=r?Ai(t,e,n):Ai(e,t,n);return(r?-1:1)*(l<0?1/-l:l)}function vl(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let l of e)(l=t(l,++r,e))!=null&&(n<l||n===void 0&&l>=l)&&(n=l)}return n}function eh(e,t,n){e=+e,t=+t,n=(l=arguments.length)<2?(t=e,e=0,1):l<3?1:+n;for(var r=-1,l=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(l);++r<l;)o[r]=e+r*n;return o}function th(e){return e}var fi=1,di=2,Ti=3,Xr=4,Za=1e-6;function nh(e){return"translate("+e+",0)"}function rh(e){return"translate(0,"+e+")"}function lh(e){return t=>+e(t)}function ih(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function oh(){return!this.__axis}function Bc(e,t){var n=[],r=null,l=null,o=6,i=6,s=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,f=e===fi||e===Xr?-1:1,d=e===Xr||e===di?"x":"y",h=e===fi||e===Ti?nh:rh;function p(g){var m=r??(t.ticks?t.ticks.apply(t,n):t.domain()),_=l??(t.tickFormat?t.tickFormat.apply(t,n):th),y=Math.max(o,0)+s,v=t.range(),w=+v[0]+c,C=+v[v.length-1]+c,x=(t.bandwidth?ih:lh)(t.copy(),c),A=g.selection?g.selection():g,M=A.selectAll(".domain").data([null]),L=A.selectAll(".tick").data(m,t).order(),I=L.exit(),P=L.enter().append("g").attr("class","tick"),z=L.select("line"),R=L.select("text");M=M.merge(M.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),L=L.merge(P),z=z.merge(P.append("line").attr("stroke","currentColor").attr(d+"2",f*o)),R=R.merge(P.append("text").attr("fill","currentColor").attr(d,f*y).attr("dy",e===fi?"0em":e===Ti?"0.71em":"0.32em")),g!==A&&(M=M.transition(g),L=L.transition(g),z=z.transition(g),R=R.transition(g),I=I.transition(g).attr("opacity",Za).attr("transform",function(T){return isFinite(T=x(T))?h(T+c):this.getAttribute("transform")}),P.attr("opacity",Za).attr("transform",function(T){var N=this.parentNode.__axis;return h((N&&isFinite(N=N(T))?N:x(T))+c)})),I.remove(),M.attr("d",e===Xr||e===di?i?"M"+f*i+","+w+"H"+c+"V"+C+"H"+f*i:"M"+c+","+w+"V"+C:i?"M"+w+","+f*i+"V"+c+"H"+C+"V"+f*i:"M"+w+","+c+"H"+C),L.attr("opacity",1).attr("transform",function(T){return h(x(T)+c)}),z.attr(d+"2",f*o),R.attr(d,f*y).text(_),A.filter(oh).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===di?"start":e===Xr?"end":"middle"),A.each(function(){this.__axis=x})}return p.scale=function(g){return arguments.length?(t=g,p):t},p.ticks=function(){return n=Array.from(arguments),p},p.tickArguments=function(g){return arguments.length?(n=g==null?[]:Array.from(g),p):n.slice()},p.tickValues=function(g){return arguments.length?(r=g==null?null:Array.from(g),p):r&&r.slice()},p.tickFormat=function(g){return arguments.length?(l=g,p):l},p.tickSize=function(g){return arguments.length?(o=i=+g,p):o},p.tickSizeInner=function(g){return arguments.length?(o=+g,p):o},p.tickSizeOuter=function(g){return arguments.length?(i=+g,p):i},p.tickPadding=function(g){return arguments.length?(s=+g,p):s},p.offset=function(g){return arguments.length?(c=+g,p):c},p}function Wa(e){return Bc(Ti,e)}function Ya(e){return Bc(Xr,e)}var sh={value:()=>{}};function Rc(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ml(n)}function Ml(e){this._=e}function ah(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",l=n.indexOf(".");if(l>=0&&(r=n.slice(l+1),n=n.slice(0,l)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ml.prototype=Rc.prototype={constructor:Ml,on:function(e,t){var n=this._,r=ah(e+"",n),l,o=-1,i=r.length;if(arguments.length<2){for(;++o<i;)if((l=(e=r[o]).type)&&(l=uh(n[l],e.name)))return l;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<i;)if(l=(e=r[o]).type)n[l]=Ga(n[l],e.name,t);else if(t==null)for(l in n)n[l]=Ga(n[l],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ml(e)},call:function(e,t){if((l=arguments.length-2)>0)for(var n=new Array(l),r=0,l,o;r<l;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,l=o.length;r<l;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],l=0,o=r.length;l<o;++l)r[l].value.apply(t,n)}};function uh(e,t){for(var n=0,r=e.length,l;n<r;++n)if((l=e[n]).name===t)return l.value}function Ga(e,t,n){for(var r=0,l=e.length;r<l;++r)if(e[r].name===t){e[r]=sh,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Mi="http://www.w3.org/1999/xhtml";const Va={svg:"http://www.w3.org/2000/svg",xhtml:Mi,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ei(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Va.hasOwnProperty(t)?{space:Va[t],local:e}:e}function ch(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Mi&&t.documentElement.namespaceURI===Mi?t.createElement(e):t.createElementNS(n,e)}}function fh(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Oc(e){var t=ei(e);return(t.local?fh:ch)(t)}function dh(){}function Wi(e){return e==null?dh:function(){return this.querySelector(e)}}function hh(e){typeof e!="function"&&(e=Wi(e));for(var t=this._groups,n=t.length,r=new Array(n),l=0;l<n;++l)for(var o=t[l],i=o.length,s=r[l]=new Array(i),c,f,d=0;d<i;++d)(c=o[d])&&(f=e.call(c,c.__data__,d,o))&&("__data__"in c&&(f.__data__=c.__data__),s[d]=f);return new rn(r,this._parents)}function ph(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function gh(){return[]}function Uc(e){return e==null?gh:function(){return this.querySelectorAll(e)}}function mh(e){return function(){return ph(e.apply(this,arguments))}}function _h(e){typeof e=="function"?e=mh(e):e=Uc(e);for(var t=this._groups,n=t.length,r=[],l=[],o=0;o<n;++o)for(var i=t[o],s=i.length,c,f=0;f<s;++f)(c=i[f])&&(r.push(e.call(c,c.__data__,f,i)),l.push(c));return new rn(r,l)}function Hc(e){return function(){return this.matches(e)}}function Zc(e){return function(t){return t.matches(e)}}var bh=Array.prototype.find;function yh(e){return function(){return bh.call(this.children,e)}}function vh(){return this.firstElementChild}function wh(e){return this.select(e==null?vh:yh(typeof e=="function"?e:Zc(e)))}var kh=Array.prototype.filter;function xh(){return Array.from(this.children)}function Ch(e){return function(){return kh.call(this.children,e)}}function Ah(e){return this.selectAll(e==null?xh:Ch(typeof e=="function"?e:Zc(e)))}function Sh(e){typeof e!="function"&&(e=Hc(e));for(var t=this._groups,n=t.length,r=new Array(n),l=0;l<n;++l)for(var o=t[l],i=o.length,s=r[l]=[],c,f=0;f<i;++f)(c=o[f])&&e.call(c,c.__data__,f,o)&&s.push(c);return new rn(r,this._parents)}function Wc(e){return new Array(e.length)}function Th(){return new rn(this._enter||this._groups.map(Wc),this._parents)}function Bl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Bl.prototype={constructor:Bl,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Mh(e){return function(){return e}}function Eh(e,t,n,r,l,o){for(var i=0,s,c=t.length,f=o.length;i<f;++i)(s=t[i])?(s.__data__=o[i],r[i]=s):n[i]=new Bl(e,o[i]);for(;i<c;++i)(s=t[i])&&(l[i]=s)}function Ih(e,t,n,r,l,o,i){var s,c,f=new Map,d=t.length,h=o.length,p=new Array(d),g;for(s=0;s<d;++s)(c=t[s])&&(p[s]=g=i.call(c,c.__data__,s,t)+"",f.has(g)?l[s]=c:f.set(g,c));for(s=0;s<h;++s)g=i.call(e,o[s],s,o)+"",(c=f.get(g))?(r[s]=c,c.__data__=o[s],f.delete(g)):n[s]=new Bl(e,o[s]);for(s=0;s<d;++s)(c=t[s])&&f.get(p[s])===c&&(l[s]=c)}function Lh(e){return e.__data__}function Nh(e,t){if(!arguments.length)return Array.from(this,Lh);var n=t?Ih:Eh,r=this._parents,l=this._groups;typeof e!="function"&&(e=Mh(e));for(var o=l.length,i=new Array(o),s=new Array(o),c=new Array(o),f=0;f<o;++f){var d=r[f],h=l[f],p=h.length,g=Ph(e.call(d,d&&d.__data__,f,r)),m=g.length,_=s[f]=new Array(m),y=i[f]=new Array(m),v=c[f]=new Array(p);n(d,h,_,y,v,g,t);for(var w=0,C=0,x,A;w<m;++w)if(x=_[w]){for(w>=C&&(C=w+1);!(A=y[C])&&++C<m;);x._next=A||null}}return i=new rn(i,r),i._enter=s,i._exit=c,i}function Ph(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function zh(){return new rn(this._exit||this._groups.map(Wc),this._parents)}function Dh(e,t,n){var r=this.enter(),l=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(l=t(l),l&&(l=l.selection())),n==null?o.remove():n(o),r&&l?r.merge(l).order():l}function Fh(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,l=n.length,o=r.length,i=Math.min(l,o),s=new Array(l),c=0;c<i;++c)for(var f=n[c],d=r[c],h=f.length,p=s[c]=new Array(h),g,m=0;m<h;++m)(g=f[m]||d[m])&&(p[m]=g);for(;c<l;++c)s[c]=n[c];return new rn(s,this._parents)}function jh(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],l=r.length-1,o=r[l],i;--l>=0;)(i=r[l])&&(o&&i.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(i,o),o=i);return this}function Bh(e){e||(e=Rh);function t(h,p){return h&&p?e(h.__data__,p.__data__):!h-!p}for(var n=this._groups,r=n.length,l=new Array(r),o=0;o<r;++o){for(var i=n[o],s=i.length,c=l[o]=new Array(s),f,d=0;d<s;++d)(f=i[d])&&(c[d]=f);c.sort(t)}return new rn(l,this._parents).order()}function Rh(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Oh(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Uh(){return Array.from(this)}function Hh(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],l=0,o=r.length;l<o;++l){var i=r[l];if(i)return i}return null}function Zh(){let e=0;for(const t of this)++e;return e}function Wh(){return!this.node()}function Yh(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var l=t[n],o=0,i=l.length,s;o<i;++o)(s=l[o])&&e.call(s,s.__data__,o,l);return this}function Gh(e){return function(){this.removeAttribute(e)}}function Vh(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Xh(e,t){return function(){this.setAttribute(e,t)}}function Jh(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Kh(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function qh(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Qh(e,t){var n=ei(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Vh:Gh:typeof t=="function"?n.local?qh:Kh:n.local?Jh:Xh)(n,t))}function Yc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function $h(e){return function(){this.style.removeProperty(e)}}function ep(e,t,n){return function(){this.style.setProperty(e,t,n)}}function tp(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function np(e,t,n){return arguments.length>1?this.each((t==null?$h:typeof t=="function"?tp:ep)(e,t,n??"")):Lr(this.node(),e)}function Lr(e,t){return e.style.getPropertyValue(t)||Yc(e).getComputedStyle(e,null).getPropertyValue(t)}function rp(e){return function(){delete this[e]}}function lp(e,t){return function(){this[e]=t}}function ip(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function op(e,t){return arguments.length>1?this.each((t==null?rp:typeof t=="function"?ip:lp)(e,t)):this.node()[e]}function Gc(e){return e.trim().split(/^|\s+/)}function Yi(e){return e.classList||new Vc(e)}function Vc(e){this._node=e,this._names=Gc(e.getAttribute("class")||"")}Vc.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Xc(e,t){for(var n=Yi(e),r=-1,l=t.length;++r<l;)n.add(t[r])}function Jc(e,t){for(var n=Yi(e),r=-1,l=t.length;++r<l;)n.remove(t[r])}function sp(e){return function(){Xc(this,e)}}function ap(e){return function(){Jc(this,e)}}function up(e,t){return function(){(t.apply(this,arguments)?Xc:Jc)(this,e)}}function cp(e,t){var n=Gc(e+"");if(arguments.length<2){for(var r=Yi(this.node()),l=-1,o=n.length;++l<o;)if(!r.contains(n[l]))return!1;return!0}return this.each((typeof t=="function"?up:t?sp:ap)(n,t))}function fp(){this.textContent=""}function dp(e){return function(){this.textContent=e}}function hp(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function pp(e){return arguments.length?this.each(e==null?fp:(typeof e=="function"?hp:dp)(e)):this.node().textContent}function gp(){this.innerHTML=""}function mp(e){return function(){this.innerHTML=e}}function _p(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function bp(e){return arguments.length?this.each(e==null?gp:(typeof e=="function"?_p:mp)(e)):this.node().innerHTML}function yp(){this.nextSibling&&this.parentNode.appendChild(this)}function vp(){return this.each(yp)}function wp(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function kp(){return this.each(wp)}function xp(e){var t=typeof e=="function"?e:Oc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Cp(){return null}function Ap(e,t){var n=typeof e=="function"?e:Oc(e),r=t==null?Cp:typeof t=="function"?t:Wi(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Sp(){var e=this.parentNode;e&&e.removeChild(this)}function Tp(){return this.each(Sp)}function Mp(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ep(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ip(e){return this.select(e?Ep:Mp)}function Lp(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Np(e){return function(t){e.call(this,t,this.__data__)}}function Pp(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function zp(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,l=t.length,o;n<l;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function Dp(e,t,n){return function(){var r=this.__on,l,o=Np(t);if(r){for(var i=0,s=r.length;i<s;++i)if((l=r[i]).type===e.type&&l.name===e.name){this.removeEventListener(l.type,l.listener,l.options),this.addEventListener(l.type,l.listener=o,l.options=n),l.value=t;return}}this.addEventListener(e.type,o,n),l={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(l):this.__on=[l]}}function Fp(e,t,n){var r=Pp(e+""),l,o=r.length,i;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,f=s.length,d;c<f;++c)for(l=0,d=s[c];l<o;++l)if((i=r[l]).type===d.type&&i.name===d.name)return d.value}return}for(s=t?Dp:zp,l=0;l<o;++l)this.each(s(r[l],t,n));return this}function Kc(e,t,n){var r=Yc(e),l=r.CustomEvent;typeof l=="function"?l=new l(t,n):(l=r.document.createEvent("Event"),n?(l.initEvent(t,n.bubbles,n.cancelable),l.detail=n.detail):l.initEvent(t,!1,!1)),e.dispatchEvent(l)}function jp(e,t){return function(){return Kc(this,e,t)}}function Bp(e,t){return function(){return Kc(this,e,t.apply(this,arguments))}}function Rp(e,t){return this.each((typeof t=="function"?Bp:jp)(e,t))}function*Op(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],l=0,o=r.length,i;l<o;++l)(i=r[l])&&(yield i)}var qc=[null];function rn(e,t){this._groups=e,this._parents=t}function sl(){return new rn([[document.documentElement]],qc)}function Up(){return this}rn.prototype=sl.prototype={constructor:rn,select:hh,selectAll:_h,selectChild:wh,selectChildren:Ah,filter:Sh,data:Nh,enter:Th,exit:zh,join:Dh,merge:Fh,selection:Up,order:jh,sort:Bh,call:Oh,nodes:Uh,node:Hh,size:Zh,empty:Wh,each:Yh,attr:Qh,style:np,property:op,classed:cp,text:pp,html:bp,raise:vp,lower:kp,append:xp,insert:Ap,remove:Tp,clone:Ip,datum:Lp,on:Fp,dispatch:Rp,[Symbol.iterator]:Op};function en(e){return typeof e=="string"?new rn([[document.querySelector(e)]],[document.documentElement]):new rn([[e]],qc)}function ti(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Gi(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Rr(){}var $n=.7,Nr=1/$n,Tr="\\s*([+-]?\\d+)\\s*",nl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",yn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Hp=/^#([0-9a-f]{3,8})$/,Zp=new RegExp(`^rgb\\(${Tr},${Tr},${Tr}\\)$`),Wp=new RegExp(`^rgb\\(${yn},${yn},${yn}\\)$`),Yp=new RegExp(`^rgba\\(${Tr},${Tr},${Tr},${nl}\\)$`),Gp=new RegExp(`^rgba\\(${yn},${yn},${yn},${nl}\\)$`),Vp=new RegExp(`^hsl\\(${nl},${yn},${yn}\\)$`),Xp=new RegExp(`^hsla\\(${nl},${yn},${yn},${nl}\\)$`),Xa={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ti(Rr,er,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ja,formatHex:Ja,formatHex8:Jp,formatHsl:Kp,formatRgb:Ka,toString:Ka});function Ja(){return this.rgb().formatHex()}function Jp(){return this.rgb().formatHex8()}function Kp(){return $c(this).formatHsl()}function Ka(){return this.rgb().formatRgb()}function er(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Hp.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?qa(t):n===3?new Ft(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?wl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?wl(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Zp.exec(e))?new Ft(t[1],t[2],t[3],1):(t=Wp.exec(e))?new Ft(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Yp.exec(e))?wl(t[1],t[2],t[3],t[4]):(t=Gp.exec(e))?wl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Vp.exec(e))?eu(t[1],t[2]/100,t[3]/100,1):(t=Xp.exec(e))?eu(t[1],t[2]/100,t[3]/100,t[4]):Xa.hasOwnProperty(e)?qa(Xa[e]):e==="transparent"?new Ft(NaN,NaN,NaN,0):null}function qa(e){return new Ft(e>>16&255,e>>8&255,e&255,1)}function wl(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ft(e,t,n,r)}function Qc(e){return e instanceof Rr||(e=er(e)),e?(e=e.rgb(),new Ft(e.r,e.g,e.b,e.opacity)):new Ft}function Ei(e,t,n,r){return arguments.length===1?Qc(e):new Ft(e,t,n,r??1)}function Ft(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ti(Ft,Ei,Gi(Rr,{brighter(e){return e=e==null?Nr:Math.pow(Nr,e),new Ft(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$n:Math.pow($n,e),new Ft(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ft(qn(this.r),qn(this.g),qn(this.b),Rl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Qa,formatHex:Qa,formatHex8:qp,formatRgb:$a,toString:$a}));function Qa(){return`#${Jn(this.r)}${Jn(this.g)}${Jn(this.b)}`}function qp(){return`#${Jn(this.r)}${Jn(this.g)}${Jn(this.b)}${Jn((isNaN(this.opacity)?1:this.opacity)*255)}`}function $a(){const e=Rl(this.opacity);return`${e===1?"rgb(":"rgba("}${qn(this.r)}, ${qn(this.g)}, ${qn(this.b)}${e===1?")":`, ${e})`}`}function Rl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Jn(e){return e=qn(e),(e<16?"0":"")+e.toString(16)}function eu(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new gn(e,t,n,r)}function $c(e){if(e instanceof gn)return new gn(e.h,e.s,e.l,e.opacity);if(e instanceof Rr||(e=er(e)),!e)return new gn;if(e instanceof gn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,l=Math.min(t,n,r),o=Math.max(t,n,r),i=NaN,s=o-l,c=(o+l)/2;return s?(t===o?i=(n-r)/s+(n<r)*6:n===o?i=(r-t)/s+2:i=(t-n)/s+4,s/=c<.5?o+l:2-o-l,i*=60):s=c>0&&c<1?0:i,new gn(i,s,c,e.opacity)}function Qp(e,t,n,r){return arguments.length===1?$c(e):new gn(e,t,n,r??1)}function gn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ti(gn,Qp,Gi(Rr,{brighter(e){return e=e==null?Nr:Math.pow(Nr,e),new gn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$n:Math.pow($n,e),new gn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,l=2*n-r;return new Ft(hi(e>=240?e-240:e+120,l,r),hi(e,l,r),hi(e<120?e+240:e-120,l,r),this.opacity)},clamp(){return new gn(tu(this.h),kl(this.s),kl(this.l),Rl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Rl(this.opacity);return`${e===1?"hsl(":"hsla("}${tu(this.h)}, ${kl(this.s)*100}%, ${kl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function tu(e){return e=(e||0)%360,e<0?e+360:e}function kl(e){return Math.max(0,Math.min(1,e||0))}function hi(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const $p=Math.PI/180,e1=180/Math.PI;var ef=-.14861,Vi=1.78277,Xi=-.29227,ni=-.90649,rl=1.97294,nu=rl*ni,ru=rl*Vi,lu=Vi*Xi-ni*ef;function t1(e){if(e instanceof Qn)return new Qn(e.h,e.s,e.l,e.opacity);e instanceof Ft||(e=Qc(e));var t=e.r/255,n=e.g/255,r=e.b/255,l=(lu*r+nu*t-ru*n)/(lu+nu-ru),o=r-l,i=(rl*(n-l)-Xi*o)/ni,s=Math.sqrt(i*i+o*o)/(rl*l*(1-l)),c=s?Math.atan2(i,o)*e1-120:NaN;return new Qn(c<0?c+360:c,s,l,e.opacity)}function Bn(e,t,n,r){return arguments.length===1?t1(e):new Qn(e,t,n,r??1)}function Qn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ti(Qn,Bn,Gi(Rr,{brighter(e){return e=e==null?Nr:Math.pow(Nr,e),new Qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$n:Math.pow($n,e),new Qn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*$p,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),l=Math.sin(e);return new Ft(255*(t+n*(ef*r+Vi*l)),255*(t+n*(Xi*r+ni*l)),255*(t+n*(rl*r)),this.opacity)}}));const ri=e=>()=>e;function tf(e,t){return function(n){return e+n*t}}function n1(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function r1(e,t){var n=t-e;return n?tf(e,n>180||n<-180?n-360*Math.round(n/360):n):ri(isNaN(e)?t:e)}function l1(e){return(e=+e)==1?Mr:function(t,n){return n-t?n1(t,n,e):ri(isNaN(t)?n:t)}}function Mr(e,t){var n=t-e;return n?tf(e,n):ri(isNaN(e)?t:e)}const Ol=function e(t){var n=l1(t);function r(l,o){var i=n((l=Ei(l)).r,(o=Ei(o)).r),s=n(l.g,o.g),c=n(l.b,o.b),f=Mr(l.opacity,o.opacity);return function(d){return l.r=i(d),l.g=s(d),l.b=c(d),l.opacity=f(d),l+""}}return r.gamma=e,r}(1);function i1(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),l;return function(o){for(l=0;l<n;++l)r[l]=e[l]*(1-o)+t[l]*o;return r}}function o1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function s1(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,l=new Array(r),o=new Array(n),i;for(i=0;i<r;++i)l[i]=li(e[i],t[i]);for(;i<n;++i)o[i]=t[i];return function(s){for(i=0;i<r;++i)o[i]=l[i](s);return o}}function a1(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function pn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function u1(e,t){var n={},r={},l;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(l in t)l in e?n[l]=li(e[l],t[l]):r[l]=t[l];return function(o){for(l in n)r[l]=n[l](o);return r}}var Ii=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pi=new RegExp(Ii.source,"g");function c1(e){return function(){return e}}function f1(e){return function(t){return e(t)+""}}function nf(e,t){var n=Ii.lastIndex=pi.lastIndex=0,r,l,o,i=-1,s=[],c=[];for(e=e+"",t=t+"";(r=Ii.exec(e))&&(l=pi.exec(t));)(o=l.index)>n&&(o=t.slice(n,o),s[i]?s[i]+=o:s[++i]=o),(r=r[0])===(l=l[0])?s[i]?s[i]+=l:s[++i]=l:(s[++i]=null,c.push({i,x:pn(r,l)})),n=pi.lastIndex;return n<t.length&&(o=t.slice(n),s[i]?s[i]+=o:s[++i]=o),s.length<2?c[0]?f1(c[0].x):c1(t):(t=c.length,function(f){for(var d=0,h;d<t;++d)s[(h=c[d]).i]=h.x(f);return s.join("")})}function li(e,t){var n=typeof t,r;return t==null||n==="boolean"?ri(t):(n==="number"?pn:n==="string"?(r=er(t))?(t=r,Ol):nf:t instanceof er?Ol:t instanceof Date?a1:o1(t)?i1:Array.isArray(t)?s1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?u1:pn)(e,t)}function rf(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var iu=180/Math.PI,Li={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function lf(e,t,n,r,l,o){var i,s,c;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,i=-i),{translateX:l,translateY:o,rotate:Math.atan2(t,e)*iu,skewX:Math.atan(c)*iu,scaleX:i,scaleY:s}}var xl;function d1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Li:lf(t.a,t.b,t.c,t.d,t.e,t.f)}function h1(e){return e==null||(xl||(xl=document.createElementNS("http://www.w3.org/2000/svg","g")),xl.setAttribute("transform",e),!(e=xl.transform.baseVal.consolidate()))?Li:(e=e.matrix,lf(e.a,e.b,e.c,e.d,e.e,e.f))}function of(e,t,n,r){function l(f){return f.length?f.pop()+" ":""}function o(f,d,h,p,g,m){if(f!==h||d!==p){var _=g.push("translate(",null,t,null,n);m.push({i:_-4,x:pn(f,h)},{i:_-2,x:pn(d,p)})}else(h||p)&&g.push("translate("+h+t+p+n)}function i(f,d,h,p){f!==d?(f-d>180?d+=360:d-f>180&&(f+=360),p.push({i:h.push(l(h)+"rotate(",null,r)-2,x:pn(f,d)})):d&&h.push(l(h)+"rotate("+d+r)}function s(f,d,h,p){f!==d?p.push({i:h.push(l(h)+"skewX(",null,r)-2,x:pn(f,d)}):d&&h.push(l(h)+"skewX("+d+r)}function c(f,d,h,p,g,m){if(f!==h||d!==p){var _=g.push(l(g)+"scale(",null,",",null,")");m.push({i:_-4,x:pn(f,h)},{i:_-2,x:pn(d,p)})}else(h!==1||p!==1)&&g.push(l(g)+"scale("+h+","+p+")")}return function(f,d){var h=[],p=[];return f=e(f),d=e(d),o(f.translateX,f.translateY,d.translateX,d.translateY,h,p),i(f.rotate,d.rotate,h,p),s(f.skewX,d.skewX,h,p),c(f.scaleX,f.scaleY,d.scaleX,d.scaleY,h,p),f=d=null,function(g){for(var m=-1,_=p.length,y;++m<_;)h[(y=p[m]).i]=y.x(g);return h.join("")}}}var p1=of(d1,"px, ","px)","deg)"),g1=of(h1,", ",")",")");function sf(e){return function t(n){n=+n;function r(l,o){var i=e((l=Bn(l)).h,(o=Bn(o)).h),s=Mr(l.s,o.s),c=Mr(l.l,o.l),f=Mr(l.opacity,o.opacity);return function(d){return l.h=i(d),l.s=s(d),l.l=c(Math.pow(d,n)),l.opacity=f(d),l+""}}return r.gamma=t,r}(1)}sf(r1);var af=sf(Mr),Pr=0,Jr=0,Wr=0,uf=1e3,Ul,Kr,Hl=0,tr=0,ii=0,ll=typeof performance=="object"&&performance.now?performance:Date,cf=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ji(){return tr||(cf(m1),tr=ll.now()+ii)}function m1(){tr=0}function Zl(){this._call=this._time=this._next=null}Zl.prototype=ff.prototype={constructor:Zl,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ji():+n)+(t==null?0:+t),!this._next&&Kr!==this&&(Kr?Kr._next=this:Ul=this,Kr=this),this._call=e,this._time=n,Ni()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ni())}};function ff(e,t,n){var r=new Zl;return r.restart(e,t,n),r}function _1(){Ji(),++Pr;for(var e=Ul,t;e;)(t=tr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Pr}function ou(){tr=(Hl=ll.now())+ii,Pr=Jr=0;try{_1()}finally{Pr=0,y1(),tr=0}}function b1(){var e=ll.now(),t=e-Hl;t>uf&&(ii-=t,Hl=e)}function y1(){for(var e,t=Ul,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ul=n);Kr=e,Ni(r)}function Ni(e){if(!Pr){Jr&&(Jr=clearTimeout(Jr));var t=e-tr;t>24?(e<1/0&&(Jr=setTimeout(ou,e-ll.now()-ii)),Wr&&(Wr=clearInterval(Wr))):(Wr||(Hl=ll.now(),Wr=setInterval(b1,uf)),Pr=1,cf(ou))}}function su(e,t,n){var r=new Zl;return t=t==null?0:+t,r.restart(l=>{r.stop(),e(l+t)},t,n),r}var v1=Rc("start","end","cancel","interrupt"),w1=[],df=0,au=1,Pi=2,El=3,uu=4,zi=5,Il=6;function oi(e,t,n,r,l,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;k1(e,n,{name:t,index:r,group:l,on:v1,tween:w1,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:df})}function Ki(e,t){var n=mn(e,t);if(n.state>df)throw new Error("too late; already scheduled");return n}function vn(e,t){var n=mn(e,t);if(n.state>El)throw new Error("too late; already running");return n}function mn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function k1(e,t,n){var r=e.__transition,l;r[t]=n,n.timer=ff(o,0,n.time);function o(f){n.state=au,n.timer.restart(i,n.delay,n.time),n.delay<=f&&i(f-n.delay)}function i(f){var d,h,p,g;if(n.state!==au)return c();for(d in r)if(g=r[d],g.name===n.name){if(g.state===El)return su(i);g.state===uu?(g.state=Il,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[d]):+d<t&&(g.state=Il,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[d])}if(su(function(){n.state===El&&(n.state=uu,n.timer.restart(s,n.delay,n.time),s(f))}),n.state=Pi,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Pi){for(n.state=El,l=new Array(p=n.tween.length),d=0,h=-1;d<p;++d)(g=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(l[++h]=g);l.length=h+1}}function s(f){for(var d=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=zi,1),h=-1,p=l.length;++h<p;)l[h].call(e,d);n.state===zi&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Il,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function x1(e,t){var n=e.__transition,r,l,o=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((r=n[i]).name!==t){o=!1;continue}l=r.state>Pi&&r.state<zi,r.state=Il,r.timer.stop(),r.on.call(l?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}o&&delete e.__transition}}function C1(e){return this.each(function(){x1(this,e)})}function A1(e,t){var n,r;return function(){var l=vn(this,e),o=l.tween;if(o!==n){r=n=o;for(var i=0,s=r.length;i<s;++i)if(r[i].name===t){r=r.slice(),r.splice(i,1);break}}l.tween=r}}function S1(e,t,n){var r,l;if(typeof n!="function")throw new Error;return function(){var o=vn(this,e),i=o.tween;if(i!==r){l=(r=i).slice();for(var s={name:t,value:n},c=0,f=l.length;c<f;++c)if(l[c].name===t){l[c]=s;break}c===f&&l.push(s)}o.tween=l}}function T1(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=mn(this.node(),n).tween,l=0,o=r.length,i;l<o;++l)if((i=r[l]).name===e)return i.value;return null}return this.each((t==null?A1:S1)(n,e,t))}function qi(e,t,n){var r=e._id;return e.each(function(){var l=vn(this,r);(l.value||(l.value={}))[t]=n.apply(this,arguments)}),function(l){return mn(l,r).value[t]}}function hf(e,t){var n;return(typeof t=="number"?pn:t instanceof er?Ol:(n=er(t))?(t=n,Ol):nf)(e,t)}function M1(e){return function(){this.removeAttribute(e)}}function E1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function I1(e,t,n){var r,l=n+"",o;return function(){var i=this.getAttribute(e);return i===l?null:i===r?o:o=t(r=i,n)}}function L1(e,t,n){var r,l=n+"",o;return function(){var i=this.getAttributeNS(e.space,e.local);return i===l?null:i===r?o:o=t(r=i,n)}}function N1(e,t,n){var r,l,o;return function(){var i,s=n(this),c;return s==null?void this.removeAttribute(e):(i=this.getAttribute(e),c=s+"",i===c?null:i===r&&c===l?o:(l=c,o=t(r=i,s)))}}function P1(e,t,n){var r,l,o;return function(){var i,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),c=s+"",i===c?null:i===r&&c===l?o:(l=c,o=t(r=i,s)))}}function z1(e,t){var n=ei(e),r=n==="transform"?g1:hf;return this.attrTween(e,typeof t=="function"?(n.local?P1:N1)(n,r,qi(this,"attr."+e,t)):t==null?(n.local?E1:M1)(n):(n.local?L1:I1)(n,r,t))}function D1(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function F1(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function j1(e,t){var n,r;function l(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&F1(e,o)),n}return l._value=t,l}function B1(e,t){var n,r;function l(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&D1(e,o)),n}return l._value=t,l}function R1(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=ei(e);return this.tween(n,(r.local?j1:B1)(r,t))}function O1(e,t){return function(){Ki(this,e).delay=+t.apply(this,arguments)}}function U1(e,t){return t=+t,function(){Ki(this,e).delay=t}}function H1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?O1:U1)(t,e)):mn(this.node(),t).delay}function Z1(e,t){return function(){vn(this,e).duration=+t.apply(this,arguments)}}function W1(e,t){return t=+t,function(){vn(this,e).duration=t}}function Y1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Z1:W1)(t,e)):mn(this.node(),t).duration}function G1(e,t){if(typeof t!="function")throw new Error;return function(){vn(this,e).ease=t}}function V1(e){var t=this._id;return arguments.length?this.each(G1(t,e)):mn(this.node(),t).ease}function X1(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;vn(this,e).ease=n}}function J1(e){if(typeof e!="function")throw new Error;return this.each(X1(this._id,e))}function K1(e){typeof e!="function"&&(e=Hc(e));for(var t=this._groups,n=t.length,r=new Array(n),l=0;l<n;++l)for(var o=t[l],i=o.length,s=r[l]=[],c,f=0;f<i;++f)(c=o[f])&&e.call(c,c.__data__,f,o)&&s.push(c);return new Tn(r,this._parents,this._name,this._id)}function q1(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,l=n.length,o=Math.min(r,l),i=new Array(r),s=0;s<o;++s)for(var c=t[s],f=n[s],d=c.length,h=i[s]=new Array(d),p,g=0;g<d;++g)(p=c[g]||f[g])&&(h[g]=p);for(;s<r;++s)i[s]=t[s];return new Tn(i,this._parents,this._name,this._id)}function Q1(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function $1(e,t,n){var r,l,o=Q1(t)?Ki:vn;return function(){var i=o(this,e),s=i.on;s!==r&&(l=(r=s).copy()).on(t,n),i.on=l}}function eg(e,t){var n=this._id;return arguments.length<2?mn(this.node(),n).on.on(e):this.each($1(n,e,t))}function tg(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function ng(){return this.on("end.remove",tg(this._id))}function rg(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wi(e));for(var r=this._groups,l=r.length,o=new Array(l),i=0;i<l;++i)for(var s=r[i],c=s.length,f=o[i]=new Array(c),d,h,p=0;p<c;++p)(d=s[p])&&(h=e.call(d,d.__data__,p,s))&&("__data__"in d&&(h.__data__=d.__data__),f[p]=h,oi(f[p],t,n,p,f,mn(d,n)));return new Tn(o,this._parents,t,n)}function lg(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Uc(e));for(var r=this._groups,l=r.length,o=[],i=[],s=0;s<l;++s)for(var c=r[s],f=c.length,d,h=0;h<f;++h)if(d=c[h]){for(var p=e.call(d,d.__data__,h,c),g,m=mn(d,n),_=0,y=p.length;_<y;++_)(g=p[_])&&oi(g,t,n,_,p,m);o.push(p),i.push(d)}return new Tn(o,i,t,n)}var ig=sl.prototype.constructor;function og(){return new ig(this._groups,this._parents)}function sg(e,t){var n,r,l;return function(){var o=Lr(this,e),i=(this.style.removeProperty(e),Lr(this,e));return o===i?null:o===n&&i===r?l:l=t(n=o,r=i)}}function pf(e){return function(){this.style.removeProperty(e)}}function ag(e,t,n){var r,l=n+"",o;return function(){var i=Lr(this,e);return i===l?null:i===r?o:o=t(r=i,n)}}function ug(e,t,n){var r,l,o;return function(){var i=Lr(this,e),s=n(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),Lr(this,e))),i===c?null:i===r&&c===l?o:(l=c,o=t(r=i,s))}}function cg(e,t){var n,r,l,o="style."+t,i="end."+o,s;return function(){var c=vn(this,e),f=c.on,d=c.value[o]==null?s||(s=pf(t)):void 0;(f!==n||l!==d)&&(r=(n=f).copy()).on(i,l=d),c.on=r}}function fg(e,t,n){var r=(e+="")=="transform"?p1:hf;return t==null?this.styleTween(e,sg(e,r)).on("end.style."+e,pf(e)):typeof t=="function"?this.styleTween(e,ug(e,r,qi(this,"style."+e,t))).each(cg(this._id,e)):this.styleTween(e,ag(e,r,t),n).on("end.style."+e,null)}function dg(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function hg(e,t,n){var r,l;function o(){var i=t.apply(this,arguments);return i!==l&&(r=(l=i)&&dg(e,i,n)),r}return o._value=t,o}function pg(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,hg(e,t,n??""))}function gg(e){return function(){this.textContent=e}}function mg(e){return function(){var t=e(this);this.textContent=t??""}}function _g(e){return this.tween("text",typeof e=="function"?mg(qi(this,"text",e)):gg(e==null?"":e+""))}function bg(e){return function(t){this.textContent=e.call(this,t)}}function yg(e){var t,n;function r(){var l=e.apply(this,arguments);return l!==n&&(t=(n=l)&&bg(l)),t}return r._value=e,r}function vg(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,yg(e))}function wg(){for(var e=this._name,t=this._id,n=gf(),r=this._groups,l=r.length,o=0;o<l;++o)for(var i=r[o],s=i.length,c,f=0;f<s;++f)if(c=i[f]){var d=mn(c,t);oi(c,e,n,f,i,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Tn(r,this._parents,e,n)}function kg(){var e,t,n=this,r=n._id,l=n.size();return new Promise(function(o,i){var s={value:i},c={value:function(){--l===0&&o()}};n.each(function(){var f=vn(this,r),d=f.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),f.on=t}),l===0&&o()})}var xg=0;function Tn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function gf(){return++xg}var Cn=sl.prototype;Tn.prototype={constructor:Tn,select:rg,selectAll:lg,selectChild:Cn.selectChild,selectChildren:Cn.selectChildren,filter:K1,merge:q1,selection:og,transition:wg,call:Cn.call,nodes:Cn.nodes,node:Cn.node,size:Cn.size,empty:Cn.empty,each:Cn.each,on:eg,attr:z1,attrTween:R1,style:fg,styleTween:pg,text:_g,textTween:vg,remove:ng,tween:T1,delay:H1,duration:Y1,ease:V1,easeVarying:J1,end:kg,[Symbol.iterator]:Cn[Symbol.iterator]};function Cg(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ag={time:null,delay:0,duration:250,ease:Cg};function Sg(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Tg(e){var t,n;e instanceof Tn?(t=e._id,e=e._name):(t=gf(),(n=Ag).time=Ji(),e=e==null?null:e+"");for(var r=this._groups,l=r.length,o=0;o<l;++o)for(var i=r[o],s=i.length,c,f=0;f<s;++f)(c=i[f])&&oi(c,e,t,f,i,n||Sg(c,t));return new Tn(r,this._parents,e,t)}sl.prototype.interrupt=C1;sl.prototype.transition=Tg;const Di=Math.PI,Fi=2*Di,Gn=1e-6,Mg=Fi-Gn;function mf(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Eg(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return mf;const n=10**t;return function(r){this._+=r[0];for(let l=1,o=r.length;l<o;++l)this._+=Math.round(arguments[l]*n)/n+r[l]}}class Ig{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?mf:Eg(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,l){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+l}`}bezierCurveTo(t,n,r,l,o,i){this._append`C${+t},${+n},${+r},${+l},${this._x1=+o},${this._y1=+i}`}arcTo(t,n,r,l,o){if(t=+t,n=+n,r=+r,l=+l,o=+o,o<0)throw new Error(`negative radius: ${o}`);let i=this._x1,s=this._y1,c=r-t,f=l-n,d=i-t,h=s-n,p=d*d+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(p>Gn)if(!(Math.abs(h*c-f*d)>Gn)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-i,m=l-s,_=c*c+f*f,y=g*g+m*m,v=Math.sqrt(_),w=Math.sqrt(p),C=o*Math.tan((Di-Math.acos((_+p-y)/(2*v*w)))/2),x=C/w,A=C/v;Math.abs(x-1)>Gn&&this._append`L${t+x*d},${n+x*h}`,this._append`A${o},${o},0,0,${+(h*g>d*m)},${this._x1=t+A*c},${this._y1=n+A*f}`}}arc(t,n,r,l,o,i){if(t=+t,n=+n,r=+r,i=!!i,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(l),c=r*Math.sin(l),f=t+s,d=n+c,h=1^i,p=i?l-o:o-l;this._x1===null?this._append`M${f},${d}`:(Math.abs(this._x1-f)>Gn||Math.abs(this._y1-d)>Gn)&&this._append`L${f},${d}`,r&&(p<0&&(p=p%Fi+Fi),p>Mg?this._append`A${r},${r},0,1,${h},${t-s},${n-c}A${r},${r},0,1,${h},${this._x1=f},${this._y1=d}`:p>Gn&&this._append`A${r},${r},0,${+(p>=Di)},${h},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,l){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+l}h${-r}Z`}toString(){return this._}}function Lg(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Wl(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function zr(e){return e=Wl(Math.abs(e)),e?e[1]:NaN}function Ng(e,t){return function(n,r){for(var l=n.length,o=[],i=0,s=e[0],c=0;l>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),o.push(n.substring(l-=s,l+s)),!((c+=s+1)>r));)s=e[i=(i+1)%e.length];return o.reverse().join(t)}}function Pg(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var zg=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Yl(e){if(!(t=zg.exec(e)))throw new Error("invalid format: "+e);var t;return new Qi({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Yl.prototype=Qi.prototype;function Qi(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Qi.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Dg(e){e:for(var t=e.length,n=1,r=-1,l;n<t;++n)switch(e[n]){case".":r=l=n;break;case"0":r===0&&(r=n),l=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(l+1):e}var Gl;function Fg(e,t){var n=Wl(e,t);if(!n)return Gl=void 0,e.toPrecision(t);var r=n[0],l=n[1],o=l-(Gl=Math.max(-8,Math.min(8,Math.floor(l/3)))*3)+1,i=r.length;return o===i?r:o>i?r+new Array(o-i+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Wl(e,Math.max(0,t+o-1))[0]}function cu(e,t){var n=Wl(e,t);if(!n)return e+"";var r=n[0],l=n[1];return l<0?"0."+new Array(-l).join("0")+r:r.length>l+1?r.slice(0,l+1)+"."+r.slice(l+1):r+new Array(l-r.length+2).join("0")}const fu={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Lg,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>cu(e*100,t),r:cu,s:Fg,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function du(e){return e}var hu=Array.prototype.map,pu=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function jg(e){var t=e.grouping===void 0||e.thousands===void 0?du:Ng(hu.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",l=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?du:Pg(hu.call(e.numerals,String)),i=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function f(h,p){h=Yl(h);var g=h.fill,m=h.align,_=h.sign,y=h.symbol,v=h.zero,w=h.width,C=h.comma,x=h.precision,A=h.trim,M=h.type;M==="n"?(C=!0,M="g"):fu[M]||(x===void 0&&(x=12),A=!0,M="g"),(v||g==="0"&&m==="=")&&(v=!0,g="0",m="=");var L=(p&&p.prefix!==void 0?p.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(M)?"0"+M.toLowerCase():""),I=(y==="$"?r:/[%p]/.test(M)?i:"")+(p&&p.suffix!==void 0?p.suffix:""),P=fu[M],z=/[defgprs%]/.test(M);x=x===void 0?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function R(T){var N=L,k=I,D,G,W;if(M==="c")k=P(T)+k,T="";else{T=+T;var Q=T<0||1/T<0;if(T=isNaN(T)?c:P(Math.abs(T),x),A&&(T=Dg(T)),Q&&+T==0&&_!=="+"&&(Q=!1),N=(Q?_==="("?_:s:_==="-"||_==="("?"":_)+N,k=(M==="s"&&!isNaN(T)&&Gl!==void 0?pu[8+Gl/3]:"")+k+(Q&&_==="("?")":""),z){for(D=-1,G=T.length;++D<G;)if(W=T.charCodeAt(D),48>W||W>57){k=(W===46?l+T.slice(D+1):T.slice(D))+k,T=T.slice(0,D);break}}}C&&!v&&(T=t(T,1/0));var Y=N.length+T.length+k.length,ie=Y<w?new Array(w-Y+1).join(g):"";switch(C&&v&&(T=t(ie+T,ie.length?w-k.length:1/0),ie=""),m){case"<":T=N+T+k+ie;break;case"=":T=N+ie+T+k;break;case"^":T=ie.slice(0,Y=ie.length>>1)+N+T+k+ie.slice(Y);break;default:T=ie+N+T+k;break}return o(T)}return R.toString=function(){return h+""},R}function d(h,p){var g=Math.max(-8,Math.min(8,Math.floor(zr(p)/3)))*3,m=Math.pow(10,-g),_=f((h=Yl(h),h.type="f",h),{suffix:pu[8+g/3]});return function(y){return _(m*y)}}return{format:f,formatPrefix:d}}var Cl,Vl,_f;Bg({thousands:",",grouping:[3],currency:["$",""]});function Bg(e){return Cl=jg(e),Vl=Cl.format,_f=Cl.formatPrefix,Cl}function Rg(e){return Math.max(0,-zr(Math.abs(e)))}function Og(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(zr(t)/3)))*3-zr(Math.abs(e)))}function Ug(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,zr(t)-zr(e))+1}function si(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Hg(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const gu=Symbol("implicit");function bf(){var e=new Ua,t=[],n=[],r=gu;function l(o){let i=e.get(o);if(i===void 0){if(r!==gu)return r;e.set(o,i=t.push(o)-1)}return n[i%n.length]}return l.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Ua;for(const i of o)e.has(i)||e.set(i,t.push(i)-1);return l},l.range=function(o){return arguments.length?(n=Array.from(o),l):n.slice()},l.unknown=function(o){return arguments.length?(r=o,l):r},l.copy=function(){return bf(t,n).unknown(r)},si.apply(l,arguments),l}function yf(){var e=bf().unknown(void 0),t=e.domain,n=e.range,r=0,l=1,o,i,s=!1,c=0,f=0,d=.5;delete e.unknown;function h(){var p=t().length,g=l<r,m=g?l:r,_=g?r:l;o=(_-m)/Math.max(1,p-c+f*2),s&&(o=Math.floor(o)),m+=(_-m-o*(p-c))*d,i=o*(1-c),s&&(m=Math.round(m),i=Math.round(i));var y=eh(p).map(function(v){return m+o*v});return n(g?y.reverse():y)}return e.domain=function(p){return arguments.length?(t(p),h()):t()},e.range=function(p){return arguments.length?([r,l]=p,r=+r,l=+l,h()):[r,l]},e.rangeRound=function(p){return[r,l]=p,r=+r,l=+l,s=!0,h()},e.bandwidth=function(){return i},e.step=function(){return o},e.round=function(p){return arguments.length?(s=!!p,h()):s},e.padding=function(p){return arguments.length?(c=Math.min(1,f=+p),h()):c},e.paddingInner=function(p){return arguments.length?(c=Math.min(1,p),h()):c},e.paddingOuter=function(p){return arguments.length?(f=+p,h()):f},e.align=function(p){return arguments.length?(d=Math.max(0,Math.min(1,p)),h()):d},e.copy=function(){return yf(t(),[r,l]).round(s).paddingInner(c).paddingOuter(f).align(d)},si.apply(h(),arguments)}function Zg(e){return function(){return e}}function Wg(e){return+e}var mu=[0,1];function jn(e){return e}function ji(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Zg(isNaN(t)?NaN:.5)}function Yg(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Gg(e,t,n){var r=e[0],l=e[1],o=t[0],i=t[1];return l<r?(r=ji(l,r),o=n(i,o)):(r=ji(r,l),o=n(o,i)),function(s){return o(r(s))}}function Vg(e,t,n){var r=Math.min(e.length,t.length)-1,l=new Array(r),o=new Array(r),i=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<r;)l[i]=ji(e[i],e[i+1]),o[i]=n(t[i],t[i+1]);return function(s){var c=Y0(e,s,1,r)-1;return o[c](l[c](s))}}function vf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Xg(){var e=mu,t=mu,n=li,r,l,o,i=jn,s,c,f;function d(){var p=Math.min(e.length,t.length);return i!==jn&&(i=Yg(e[0],e[p-1])),s=p>2?Vg:Gg,c=f=null,h}function h(p){return p==null||isNaN(p=+p)?o:(c||(c=s(e.map(r),t,n)))(r(i(p)))}return h.invert=function(p){return i(l((f||(f=s(t,e.map(r),pn)))(p)))},h.domain=function(p){return arguments.length?(e=Array.from(p,Wg),d()):e.slice()},h.range=function(p){return arguments.length?(t=Array.from(p),d()):t.slice()},h.rangeRound=function(p){return t=Array.from(p),n=rf,d()},h.clamp=function(p){return arguments.length?(i=p?!0:jn,d()):i!==jn},h.interpolate=function(p){return arguments.length?(n=p,d()):n},h.unknown=function(p){return arguments.length?(o=p,h):o},function(p,g){return r=p,l=g,d()}}function wf(){return Xg()(jn,jn)}function Jg(e,t,n,r){var l=Si(e,t,n),o;switch(r=Yl(r??",f"),r.type){case"s":{var i=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=Og(l,i))&&(r.precision=o),_f(r,i)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Ug(l,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Rg(l))&&(r.precision=o-(r.type==="%")*2);break}}return Vl(r)}function kf(e){var t=e.domain;return e.ticks=function(n){var r=t();return $0(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var l=t();return Jg(l[0],l[l.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),l=0,o=r.length-1,i=r[l],s=r[o],c,f,d=10;for(s<i&&(f=i,i=s,s=f,f=l,l=o,o=f);d-- >0;){if(f=Ai(i,s,n),f===c)return r[l]=i,r[o]=s,t(r);if(f>0)i=Math.floor(i/f)*f,s=Math.ceil(s/f)*f;else if(f<0)i=Math.ceil(i*f)/f,s=Math.floor(s*f)/f;else break;c=f}return e},e}function qr(){var e=wf();return e.copy=function(){return vf(e,qr())},si.apply(e,arguments),kf(e)}function Kg(e,t){e=e.slice();var n=0,r=e.length-1,l=e[n],o=e[r],i;return o<l&&(i=n,n=r,r=i,i=l,l=o,o=i),e[n]=t.floor(l),e[r]=t.ceil(o),e}const gi=new Date,mi=new Date;function St(e,t,n,r){function l(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return l.floor=o=>(e(o=new Date(+o)),o),l.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),l.round=o=>{const i=l(o),s=l.ceil(o);return o-i<s-o?i:s},l.offset=(o,i)=>(t(o=new Date(+o),i==null?1:Math.floor(i)),o),l.range=(o,i,s)=>{const c=[];if(o=l.ceil(o),s=s==null?1:Math.floor(s),!(o<i)||!(s>0))return c;let f;do c.push(f=new Date(+o)),t(o,s),e(o);while(f<o&&o<i);return c},l.filter=o=>St(i=>{if(i>=i)for(;e(i),!o(i);)i.setTime(i-1)},(i,s)=>{if(i>=i)if(s<0)for(;++s<=0;)for(;t(i,-1),!o(i););else for(;--s>=0;)for(;t(i,1),!o(i););}),n&&(l.count=(o,i)=>(gi.setTime(+o),mi.setTime(+i),e(gi),e(mi),Math.floor(n(gi,mi))),l.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?l.filter(r?i=>r(i)%o===0:i=>l.count(0,i)%o===0):l)),l}const Xl=St(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Xl.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?St(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Xl);Xl.range;const An=1e3,dn=An*60,Sn=dn*60,Mn=Sn*24,$i=Mn*7,_u=Mn*30,_i=Mn*365,Cr=St(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*An)},(e,t)=>(t-e)/An,e=>e.getUTCSeconds());Cr.range;const eo=St(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*An)},(e,t)=>{e.setTime(+e+t*dn)},(e,t)=>(t-e)/dn,e=>e.getMinutes());eo.range;const qg=St(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*dn)},(e,t)=>(t-e)/dn,e=>e.getUTCMinutes());qg.range;const to=St(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*An-e.getMinutes()*dn)},(e,t)=>{e.setTime(+e+t*Sn)},(e,t)=>(t-e)/Sn,e=>e.getHours());to.range;const Qg=St(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Sn)},(e,t)=>(t-e)/Sn,e=>e.getUTCHours());Qg.range;const al=St(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*dn)/Mn,e=>e.getDate()-1);al.range;const no=St(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Mn,e=>e.getUTCDate()-1);no.range;const $g=St(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Mn,e=>Math.floor(e/Mn));$g.range;function rr(e){return St(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*dn)/$i)}const ai=rr(0),Jl=rr(1),em=rr(2),tm=rr(3),Dr=rr(4),nm=rr(5),rm=rr(6);ai.range;Jl.range;em.range;tm.range;Dr.range;nm.range;rm.range;function lr(e){return St(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/$i)}const xf=lr(0),Kl=lr(1),lm=lr(2),im=lr(3),Fr=lr(4),om=lr(5),sm=lr(6);xf.range;Kl.range;lm.range;im.range;Fr.range;om.range;sm.range;const ro=St(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());ro.range;const am=St(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());am.range;const En=St(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());En.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:St(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});En.range;const nr=St(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());nr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:St(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});nr.range;function um(e,t,n,r,l,o){const i=[[Cr,1,An],[Cr,5,5*An],[Cr,15,15*An],[Cr,30,30*An],[o,1,dn],[o,5,5*dn],[o,15,15*dn],[o,30,30*dn],[l,1,Sn],[l,3,3*Sn],[l,6,6*Sn],[l,12,12*Sn],[r,1,Mn],[r,2,2*Mn],[n,1,$i],[t,1,_u],[t,3,3*_u],[e,1,_i]];function s(f,d,h){const p=d<f;p&&([f,d]=[d,f]);const g=h&&typeof h.range=="function"?h:c(f,d,h),m=g?g.range(f,+d+1):[];return p?m.reverse():m}function c(f,d,h){const p=Math.abs(d-f)/h,g=Zi(([,,y])=>y).right(i,p);if(g===i.length)return e.every(Si(f/_i,d/_i,h));if(g===0)return Xl.every(Math.max(Si(f,d,h),1));const[m,_]=i[p/i[g-1][2]<i[g][2]/p?g-1:g];return m.every(_)}return[s,c]}const[cm,fm]=um(En,ro,ai,al,to,eo);function bi(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function yi(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Yr(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function dm(e){var t=e.dateTime,n=e.date,r=e.time,l=e.periods,o=e.days,i=e.shortDays,s=e.months,c=e.shortMonths,f=Gr(l),d=Vr(l),h=Gr(o),p=Vr(o),g=Gr(i),m=Vr(i),_=Gr(s),y=Vr(s),v=Gr(c),w=Vr(c),C={a:W,A:Q,b:Y,B:ie,c:null,d:xu,e:xu,f:Dm,g:Ym,G:Vm,H:Nm,I:Pm,j:zm,L:Cf,m:Fm,M:jm,p:H,q:Z,Q:Su,s:Tu,S:Bm,u:Rm,U:Om,V:Um,w:Hm,W:Zm,x:null,X:null,y:Wm,Y:Gm,Z:Xm,"%":Au},x={a:re,A:K,b:X,B:pe,c:null,d:Cu,e:Cu,f:Qm,g:a2,G:c2,H:Jm,I:Km,j:qm,L:Sf,m:$m,M:e2,p:we,q:Ee,Q:Su,s:Tu,S:t2,u:n2,U:r2,V:l2,w:i2,W:o2,x:null,X:null,y:s2,Y:u2,Z:f2,"%":Au},A={a:z,A:R,b:T,B:N,c:k,d:wu,e:wu,f:Mm,g:vu,G:yu,H:ku,I:ku,j:Cm,L:Tm,m:xm,M:Am,p:P,q:km,Q:Im,s:Lm,S:Sm,u:_m,U:bm,V:ym,w:mm,W:vm,x:D,X:G,y:vu,Y:yu,Z:wm,"%":Em};C.x=M(n,C),C.X=M(r,C),C.c=M(t,C),x.x=M(n,x),x.X=M(r,x),x.c=M(t,x);function M(le,ke){return function(ue){var ne=[],Ce=-1,S=0,te=le.length,J,U,O;for(ue instanceof Date||(ue=new Date(+ue));++Ce<te;)le.charCodeAt(Ce)===37&&(ne.push(le.slice(S,Ce)),(U=bu[J=le.charAt(++Ce)])!=null?J=le.charAt(++Ce):U=J==="e"?" ":"0",(O=ke[J])&&(J=O(ue,U)),ne.push(J),S=Ce+1);return ne.push(le.slice(S,Ce)),ne.join("")}}function L(le,ke){return function(ue){var ne=Yr(1900,void 0,1),Ce=I(ne,le,ue+="",0),S,te;if(Ce!=ue.length)return null;if("Q"in ne)return new Date(ne.Q);if("s"in ne)return new Date(ne.s*1e3+("L"in ne?ne.L:0));if(ke&&!("Z"in ne)&&(ne.Z=0),"p"in ne&&(ne.H=ne.H%12+ne.p*12),ne.m===void 0&&(ne.m="q"in ne?ne.q:0),"V"in ne){if(ne.V<1||ne.V>53)return null;"w"in ne||(ne.w=1),"Z"in ne?(S=yi(Yr(ne.y,0,1)),te=S.getUTCDay(),S=te>4||te===0?Kl.ceil(S):Kl(S),S=no.offset(S,(ne.V-1)*7),ne.y=S.getUTCFullYear(),ne.m=S.getUTCMonth(),ne.d=S.getUTCDate()+(ne.w+6)%7):(S=bi(Yr(ne.y,0,1)),te=S.getDay(),S=te>4||te===0?Jl.ceil(S):Jl(S),S=al.offset(S,(ne.V-1)*7),ne.y=S.getFullYear(),ne.m=S.getMonth(),ne.d=S.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),te="Z"in ne?yi(Yr(ne.y,0,1)).getUTCDay():bi(Yr(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(te+5)%7:ne.w+ne.U*7-(te+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,yi(ne)):bi(ne)}}function I(le,ke,ue,ne){for(var Ce=0,S=ke.length,te=ue.length,J,U;Ce<S;){if(ne>=te)return-1;if(J=ke.charCodeAt(Ce++),J===37){if(J=ke.charAt(Ce++),U=A[J in bu?ke.charAt(Ce++):J],!U||(ne=U(le,ue,ne))<0)return-1}else if(J!=ue.charCodeAt(ne++))return-1}return ne}function P(le,ke,ue){var ne=f.exec(ke.slice(ue));return ne?(le.p=d.get(ne[0].toLowerCase()),ue+ne[0].length):-1}function z(le,ke,ue){var ne=g.exec(ke.slice(ue));return ne?(le.w=m.get(ne[0].toLowerCase()),ue+ne[0].length):-1}function R(le,ke,ue){var ne=h.exec(ke.slice(ue));return ne?(le.w=p.get(ne[0].toLowerCase()),ue+ne[0].length):-1}function T(le,ke,ue){var ne=v.exec(ke.slice(ue));return ne?(le.m=w.get(ne[0].toLowerCase()),ue+ne[0].length):-1}function N(le,ke,ue){var ne=_.exec(ke.slice(ue));return ne?(le.m=y.get(ne[0].toLowerCase()),ue+ne[0].length):-1}function k(le,ke,ue){return I(le,t,ke,ue)}function D(le,ke,ue){return I(le,n,ke,ue)}function G(le,ke,ue){return I(le,r,ke,ue)}function W(le){return i[le.getDay()]}function Q(le){return o[le.getDay()]}function Y(le){return c[le.getMonth()]}function ie(le){return s[le.getMonth()]}function H(le){return l[+(le.getHours()>=12)]}function Z(le){return 1+~~(le.getMonth()/3)}function re(le){return i[le.getUTCDay()]}function K(le){return o[le.getUTCDay()]}function X(le){return c[le.getUTCMonth()]}function pe(le){return s[le.getUTCMonth()]}function we(le){return l[+(le.getUTCHours()>=12)]}function Ee(le){return 1+~~(le.getUTCMonth()/3)}return{format:function(le){var ke=M(le+="",C);return ke.toString=function(){return le},ke},parse:function(le){var ke=L(le+="",!1);return ke.toString=function(){return le},ke},utcFormat:function(le){var ke=M(le+="",x);return ke.toString=function(){return le},ke},utcParse:function(le){var ke=L(le+="",!0);return ke.toString=function(){return le},ke}}}var bu={"-":"",_:" ",0:"0"},Et=/^\s*\d+/,hm=/^%/,pm=/[\\^$*+?|[\]().{}]/g;function pt(e,t,n){var r=e<0?"-":"",l=(r?-e:e)+"",o=l.length;return r+(o<n?new Array(n-o+1).join(t)+l:l)}function gm(e){return e.replace(pm,"\\$&")}function Gr(e){return new RegExp("^(?:"+e.map(gm).join("|")+")","i")}function Vr(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function mm(e,t,n){var r=Et.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function _m(e,t,n){var r=Et.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function bm(e,t,n){var r=Et.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function ym(e,t,n){var r=Et.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function vm(e,t,n){var r=Et.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function yu(e,t,n){var r=Et.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function vu(e,t,n){var r=Et.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function wm(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function km(e,t,n){var r=Et.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function xm(e,t,n){var r=Et.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function wu(e,t,n){var r=Et.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Cm(e,t,n){var r=Et.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ku(e,t,n){var r=Et.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Am(e,t,n){var r=Et.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Sm(e,t,n){var r=Et.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Tm(e,t,n){var r=Et.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Mm(e,t,n){var r=Et.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Em(e,t,n){var r=hm.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Im(e,t,n){var r=Et.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Lm(e,t,n){var r=Et.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function xu(e,t){return pt(e.getDate(),t,2)}function Nm(e,t){return pt(e.getHours(),t,2)}function Pm(e,t){return pt(e.getHours()%12||12,t,2)}function zm(e,t){return pt(1+al.count(En(e),e),t,3)}function Cf(e,t){return pt(e.getMilliseconds(),t,3)}function Dm(e,t){return Cf(e,t)+"000"}function Fm(e,t){return pt(e.getMonth()+1,t,2)}function jm(e,t){return pt(e.getMinutes(),t,2)}function Bm(e,t){return pt(e.getSeconds(),t,2)}function Rm(e){var t=e.getDay();return t===0?7:t}function Om(e,t){return pt(ai.count(En(e)-1,e),t,2)}function Af(e){var t=e.getDay();return t>=4||t===0?Dr(e):Dr.ceil(e)}function Um(e,t){return e=Af(e),pt(Dr.count(En(e),e)+(En(e).getDay()===4),t,2)}function Hm(e){return e.getDay()}function Zm(e,t){return pt(Jl.count(En(e)-1,e),t,2)}function Wm(e,t){return pt(e.getFullYear()%100,t,2)}function Ym(e,t){return e=Af(e),pt(e.getFullYear()%100,t,2)}function Gm(e,t){return pt(e.getFullYear()%1e4,t,4)}function Vm(e,t){var n=e.getDay();return e=n>=4||n===0?Dr(e):Dr.ceil(e),pt(e.getFullYear()%1e4,t,4)}function Xm(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+pt(t/60|0,"0",2)+pt(t%60,"0",2)}function Cu(e,t){return pt(e.getUTCDate(),t,2)}function Jm(e,t){return pt(e.getUTCHours(),t,2)}function Km(e,t){return pt(e.getUTCHours()%12||12,t,2)}function qm(e,t){return pt(1+no.count(nr(e),e),t,3)}function Sf(e,t){return pt(e.getUTCMilliseconds(),t,3)}function Qm(e,t){return Sf(e,t)+"000"}function $m(e,t){return pt(e.getUTCMonth()+1,t,2)}function e2(e,t){return pt(e.getUTCMinutes(),t,2)}function t2(e,t){return pt(e.getUTCSeconds(),t,2)}function n2(e){var t=e.getUTCDay();return t===0?7:t}function r2(e,t){return pt(xf.count(nr(e)-1,e),t,2)}function Tf(e){var t=e.getUTCDay();return t>=4||t===0?Fr(e):Fr.ceil(e)}function l2(e,t){return e=Tf(e),pt(Fr.count(nr(e),e)+(nr(e).getUTCDay()===4),t,2)}function i2(e){return e.getUTCDay()}function o2(e,t){return pt(Kl.count(nr(e)-1,e),t,2)}function s2(e,t){return pt(e.getUTCFullYear()%100,t,2)}function a2(e,t){return e=Tf(e),pt(e.getUTCFullYear()%100,t,2)}function u2(e,t){return pt(e.getUTCFullYear()%1e4,t,4)}function c2(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Fr(e):Fr.ceil(e),pt(e.getUTCFullYear()%1e4,t,4)}function f2(){return"+0000"}function Au(){return"%"}function Su(e){return+e}function Tu(e){return Math.floor(+e/1e3)}var wr,lo,Mf;d2({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function d2(e){return wr=dm(e),lo=wr.format,Mf=wr.parse,wr.utcFormat,wr.utcParse,wr}function h2(e){return new Date(e)}function p2(e){return e instanceof Date?+e:+new Date(+e)}function Ef(e,t,n,r,l,o,i,s,c,f){var d=wf(),h=d.invert,p=d.domain,g=f(".%L"),m=f(":%S"),_=f("%I:%M"),y=f("%I %p"),v=f("%a %d"),w=f("%b %d"),C=f("%B"),x=f("%Y");function A(M){return(c(M)<M?g:s(M)<M?m:i(M)<M?_:o(M)<M?y:r(M)<M?l(M)<M?v:w:n(M)<M?C:x)(M)}return d.invert=function(M){return new Date(h(M))},d.domain=function(M){return arguments.length?p(Array.from(M,p2)):p().map(h2)},d.ticks=function(M){var L=p();return e(L[0],L[L.length-1],M??10)},d.tickFormat=function(M,L){return L==null?A:f(L)},d.nice=function(M){var L=p();return(!M||typeof M.range!="function")&&(M=t(L[0],L[L.length-1],M??10)),M?p(Kg(L,M)):d},d.copy=function(){return vf(d,Ef(e,t,n,r,l,o,i,s,c,f))},d}function g2(){return si.apply(Ef(cm,fm,En,ro,ai,al,to,eo,Cr,lo).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function m2(){var e=0,t=1,n,r,l,o,i=jn,s=!1,c;function f(h){return h==null||isNaN(h=+h)?c:i(l===0?.5:(h=(o(h)-n)*l,s?Math.max(0,Math.min(1,h)):h))}f.domain=function(h){return arguments.length?([e,t]=h,n=o(e=+e),r=o(t=+t),l=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(h){return arguments.length?(s=!!h,f):s},f.interpolator=function(h){return arguments.length?(i=h,f):i};function d(h){return function(p){var g,m;return arguments.length?([g,m]=p,i=h(g,m),f):[i(0),i(1)]}}return f.range=d(li),f.rangeRound=d(rf),f.unknown=function(h){return arguments.length?(c=h,f):c},function(h){return o=h,n=h(e),r=h(t),l=n===r?0:1/(r-n),f}}function _2(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function If(){var e=kf(m2()(jn));return e.copy=function(){return _2(e,If())},Hg.apply(e,arguments)}af(Bn(-100,.75,.35),Bn(80,1.5,.8));var b2=af(Bn(260,.75,.35),Bn(80,1.5,.8));Bn();function ht(e){return function(){return e}}const Mu=Math.abs,zt=Math.atan2,Yn=Math.cos,y2=Math.max,vi=Math.min,bn=Math.sin,Ar=Math.sqrt,Vt=1e-12,il=Math.PI,ql=il/2,Ll=2*il;function v2(e){return e>1?0:e<-1?il:Math.acos(e)}function Eu(e){return e>=1?ql:e<=-1?-ql:Math.asin(e)}function io(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Ig(t)}function w2(e){return e.innerRadius}function k2(e){return e.outerRadius}function x2(e){return e.startAngle}function C2(e){return e.endAngle}function A2(e){return e&&e.padAngle}function S2(e,t,n,r,l,o,i,s){var c=n-e,f=r-t,d=i-l,h=s-o,p=h*c-d*f;if(!(p*p<Vt))return p=(d*(t-o)-h*(e-l))/p,[e+p*c,t+p*f]}function Al(e,t,n,r,l,o,i){var s=e-n,c=t-r,f=(i?o:-o)/Ar(s*s+c*c),d=f*c,h=-f*s,p=e+d,g=t+h,m=n+d,_=r+h,y=(p+m)/2,v=(g+_)/2,w=m-p,C=_-g,x=w*w+C*C,A=l-o,M=p*_-m*g,L=(C<0?-1:1)*Ar(y2(0,A*A*x-M*M)),I=(M*C-w*L)/x,P=(-M*w-C*L)/x,z=(M*C+w*L)/x,R=(-M*w+C*L)/x,T=I-y,N=P-v,k=z-y,D=R-v;return T*T+N*N>k*k+D*D&&(I=z,P=R),{cx:I,cy:P,x01:-d,y01:-h,x11:I*(l/A-1),y11:P*(l/A-1)}}function Iu(){var e=w2,t=k2,n=ht(0),r=null,l=x2,o=C2,i=A2,s=null,c=io(f);function f(){var d,h,p=+e.apply(this,arguments),g=+t.apply(this,arguments),m=l.apply(this,arguments)-ql,_=o.apply(this,arguments)-ql,y=Mu(_-m),v=_>m;if(s||(s=d=c()),g<p&&(h=g,g=p,p=h),!(g>Vt))s.moveTo(0,0);else if(y>Ll-Vt)s.moveTo(g*Yn(m),g*bn(m)),s.arc(0,0,g,m,_,!v),p>Vt&&(s.moveTo(p*Yn(_),p*bn(_)),s.arc(0,0,p,_,m,v));else{var w=m,C=_,x=m,A=_,M=y,L=y,I=i.apply(this,arguments)/2,P=I>Vt&&(r?+r.apply(this,arguments):Ar(p*p+g*g)),z=vi(Mu(g-p)/2,+n.apply(this,arguments)),R=z,T=z,N,k;if(P>Vt){var D=Eu(P/p*bn(I)),G=Eu(P/g*bn(I));(M-=D*2)>Vt?(D*=v?1:-1,x+=D,A-=D):(M=0,x=A=(m+_)/2),(L-=G*2)>Vt?(G*=v?1:-1,w+=G,C-=G):(L=0,w=C=(m+_)/2)}var W=g*Yn(w),Q=g*bn(w),Y=p*Yn(A),ie=p*bn(A);if(z>Vt){var H=g*Yn(C),Z=g*bn(C),re=p*Yn(x),K=p*bn(x),X;if(y<il)if(X=S2(W,Q,re,K,H,Z,Y,ie)){var pe=W-X[0],we=Q-X[1],Ee=H-X[0],le=Z-X[1],ke=1/bn(v2((pe*Ee+we*le)/(Ar(pe*pe+we*we)*Ar(Ee*Ee+le*le)))/2),ue=Ar(X[0]*X[0]+X[1]*X[1]);R=vi(z,(p-ue)/(ke-1)),T=vi(z,(g-ue)/(ke+1))}else R=T=0}L>Vt?T>Vt?(N=Al(re,K,W,Q,g,T,v),k=Al(H,Z,Y,ie,g,T,v),s.moveTo(N.cx+N.x01,N.cy+N.y01),T<z?s.arc(N.cx,N.cy,T,zt(N.y01,N.x01),zt(k.y01,k.x01),!v):(s.arc(N.cx,N.cy,T,zt(N.y01,N.x01),zt(N.y11,N.x11),!v),s.arc(0,0,g,zt(N.cy+N.y11,N.cx+N.x11),zt(k.cy+k.y11,k.cx+k.x11),!v),s.arc(k.cx,k.cy,T,zt(k.y11,k.x11),zt(k.y01,k.x01),!v))):(s.moveTo(W,Q),s.arc(0,0,g,w,C,!v)):s.moveTo(W,Q),!(p>Vt)||!(M>Vt)?s.lineTo(Y,ie):R>Vt?(N=Al(Y,ie,H,Z,p,-R,v),k=Al(W,Q,re,K,p,-R,v),s.lineTo(N.cx+N.x01,N.cy+N.y01),R<z?s.arc(N.cx,N.cy,R,zt(N.y01,N.x01),zt(k.y01,k.x01),!v):(s.arc(N.cx,N.cy,R,zt(N.y01,N.x01),zt(N.y11,N.x11),!v),s.arc(0,0,p,zt(N.cy+N.y11,N.cx+N.x11),zt(k.cy+k.y11,k.cx+k.x11),v),s.arc(k.cx,k.cy,R,zt(k.y11,k.x11),zt(k.y01,k.x01),!v))):s.arc(0,0,p,A,x,v)}if(s.closePath(),d)return s=null,d+""||null}return f.centroid=function(){var d=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,h=(+l.apply(this,arguments)+ +o.apply(this,arguments))/2-il/2;return[Yn(h)*d,bn(h)*d]},f.innerRadius=function(d){return arguments.length?(e=typeof d=="function"?d:ht(+d),f):e},f.outerRadius=function(d){return arguments.length?(t=typeof d=="function"?d:ht(+d),f):t},f.cornerRadius=function(d){return arguments.length?(n=typeof d=="function"?d:ht(+d),f):n},f.padRadius=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:ht(+d),f):r},f.startAngle=function(d){return arguments.length?(l=typeof d=="function"?d:ht(+d),f):l},f.endAngle=function(d){return arguments.length?(o=typeof d=="function"?d:ht(+d),f):o},f.padAngle=function(d){return arguments.length?(i=typeof d=="function"?d:ht(+d),f):i},f.context=function(d){return arguments.length?(s=d??null,f):s},f}function oo(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Lf(e){this._context=e}Lf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Nf(e){return new Lf(e)}function Pf(e){return e[0]}function zf(e){return e[1]}function Df(e,t){var n=ht(!0),r=null,l=Nf,o=null,i=io(s);e=typeof e=="function"?e:e===void 0?Pf:ht(e),t=typeof t=="function"?t:t===void 0?zf:ht(t);function s(c){var f,d=(c=oo(c)).length,h,p=!1,g;for(r==null&&(o=l(g=i())),f=0;f<=d;++f)!(f<d&&n(h=c[f],f,c))===p&&((p=!p)?o.lineStart():o.lineEnd()),p&&o.point(+e(h,f,c),+t(h,f,c));if(g)return o=null,g+""||null}return s.x=function(c){return arguments.length?(e=typeof c=="function"?c:ht(+c),s):e},s.y=function(c){return arguments.length?(t=typeof c=="function"?c:ht(+c),s):t},s.defined=function(c){return arguments.length?(n=typeof c=="function"?c:ht(!!c),s):n},s.curve=function(c){return arguments.length?(l=c,r!=null&&(o=l(r)),s):l},s.context=function(c){return arguments.length?(c==null?r=o=null:o=l(r=c),s):r},s}function T2(e,t,n){var r=null,l=ht(!0),o=null,i=Nf,s=null,c=io(f);e=typeof e=="function"?e:e===void 0?Pf:ht(+e),t=typeof t=="function"?t:ht(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?zf:ht(+n);function f(h){var p,g,m,_=(h=oo(h)).length,y,v=!1,w,C=new Array(_),x=new Array(_);for(o==null&&(s=i(w=c())),p=0;p<=_;++p){if(!(p<_&&l(y=h[p],p,h))===v)if(v=!v)g=p,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),m=p-1;m>=g;--m)s.point(C[m],x[m]);s.lineEnd(),s.areaEnd()}v&&(C[p]=+e(y,p,h),x[p]=+t(y,p,h),s.point(r?+r(y,p,h):C[p],n?+n(y,p,h):x[p]))}if(w)return s=null,w+""||null}function d(){return Df().defined(l).curve(i).context(o)}return f.x=function(h){return arguments.length?(e=typeof h=="function"?h:ht(+h),r=null,f):e},f.x0=function(h){return arguments.length?(e=typeof h=="function"?h:ht(+h),f):e},f.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:ht(+h),f):r},f.y=function(h){return arguments.length?(t=typeof h=="function"?h:ht(+h),n=null,f):t},f.y0=function(h){return arguments.length?(t=typeof h=="function"?h:ht(+h),f):t},f.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:ht(+h),f):n},f.lineX0=f.lineY0=function(){return d().x(e).y(t)},f.lineY1=function(){return d().x(e).y(n)},f.lineX1=function(){return d().x(r).y(t)},f.defined=function(h){return arguments.length?(l=typeof h=="function"?h:ht(!!h),f):l},f.curve=function(h){return arguments.length?(i=h,o!=null&&(s=i(o)),f):i},f.context=function(h){return arguments.length?(h==null?o=s=null:s=i(o=h),f):o},f}function M2(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function E2(e){return e}function I2(){var e=E2,t=M2,n=null,r=ht(0),l=ht(Ll),o=ht(0);function i(s){var c,f=(s=oo(s)).length,d,h,p=0,g=new Array(f),m=new Array(f),_=+r.apply(this,arguments),y=Math.min(Ll,Math.max(-Ll,l.apply(this,arguments)-_)),v,w=Math.min(Math.abs(y)/f,o.apply(this,arguments)),C=w*(y<0?-1:1),x;for(c=0;c<f;++c)(x=m[g[c]=c]=+e(s[c],c,s))>0&&(p+=x);for(t!=null?g.sort(function(A,M){return t(m[A],m[M])}):n!=null&&g.sort(function(A,M){return n(s[A],s[M])}),c=0,h=p?(y-f*C)/p:0;c<f;++c,_=v)d=g[c],x=m[d],v=_+(x>0?x*h:0)+C,m[d]={data:s[d],index:c,value:x,startAngle:_,endAngle:v,padAngle:w};return m}return i.value=function(s){return arguments.length?(e=typeof s=="function"?s:ht(+s),i):e},i.sortValues=function(s){return arguments.length?(t=s,n=null,i):t},i.sort=function(s){return arguments.length?(n=s,t=null,i):n},i.startAngle=function(s){return arguments.length?(r=typeof s=="function"?s:ht(+s),i):r},i.endAngle=function(s){return arguments.length?(l=typeof s=="function"?s:ht(+s),i):l},i.padAngle=function(s){return arguments.length?(o=typeof s=="function"?s:ht(+s),i):o},i}function Lu(e){return e<0?-1:1}function Nu(e,t,n){var r=e._x1-e._x0,l=t-e._x1,o=(e._y1-e._y0)/(r||l<0&&-0),i=(n-e._y1)/(l||r<0&&-0),s=(o*l+i*r)/(r+l);return(Lu(o)+Lu(i))*Math.min(Math.abs(o),Math.abs(i),.5*Math.abs(s))||0}function Pu(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function wi(e,t,n){var r=e._x0,l=e._y0,o=e._x1,i=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,l+s*t,o-s,i-s*n,o,i)}function Ql(e){this._context=e}Ql.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:wi(this,this._t0,Pu(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,wi(this,Pu(this,n=Nu(this,e,t)),n);break;default:wi(this,this._t0,n=Nu(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};Object.create(Ql.prototype).point=function(e,t){Ql.prototype.point.call(this,t,e)};function zu(e){return new Ql(e)}function Qr(e,t,n){this.k=e,this.x=t,this.y=n}Qr.prototype={constructor:Qr,scale:function(e){return e===1?this:new Qr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Qr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};Qr.prototype;function Du(e,t,n){const r=e.slice();return r[88]=t[n],r}function ki(e){const t=e.slice(),n=new Set(t[24].translations.map(l=>l.lang));t[86]=n;const r=t[5].filter(function(...o){return e[74](t[86],...o)});return t[87]=r,t}function Fu(e,t,n){const r=e.slice();return r[91]=t[n],r}function ju(e,t,n){const r=e.slice();return r[88]=t[n],r}function Bu(e,t,n){const r=e.slice();return r[114]=t[n],r[116]=n,r}function Ru(e,t,n){const r=e.slice();r[99]=t[n];const l=n_(r[99].url);r[100]=l;const o=r[99].phraseCount>0?Math.round(r[99].approved/r[99].phraseCount*100):0;return r[101]=o,r}function Ou(e,t,n){const r=e.slice();return r[104]=t[n],r}function Uu(e,t,n){const r=e.slice();return r[88]=t[n],r}function Hu(e,t,n){const r=e.slice();return r[109]=t[n],r}function Zu(e,t,n){const r=e.slice();return r[96]=t[n],r}function Wu(e,t,n){const r=e.slice();return r[96]=t[n],r}function Yu(e,t,n){const r=e.slice();return r[117]=t[n][0],r[118]=t[n][1],r}function Gu(e){let t,n=dt(e[4].totalPhrases)+"",r,l,o=dt(e[4].uniqueUrls)+"",i,s,c=dt(e[4].languageCount)+"",f,d;return{c(){t=b("span"),r=F(n),l=F(" phrases · "),i=F(o),s=F(" pages · "),f=F(c),d=F(" languages"),a(t,"class","text-xs text-gray-500 bg-gray-800 px-3 py-1.5 rounded-lg border border-gray-700")},m(h,p){B(h,t,p),u(t,r),u(t,l),u(t,i),u(t,s),u(t,f),u(t,d)},p(h,p){p[0]&16&&n!==(n=dt(h[4].totalPhrases)+"")&&ee(r,n),p[0]&16&&o!==(o=dt(h[4].uniqueUrls)+"")&&ee(i,o),p[0]&16&&c!==(c=dt(h[4].languageCount)+"")&&ee(f,c)},d(h){h&&j(t)}}}function L2(e){let t,n,r,l=Fe([["overview","Overview"],["pages","Pages & URLs"],["languages","Languages"]]),o=[];for(let f=0;f<3;f+=1)o[f]=Vu(Yu(e,l,f));function i(f,d){if(f[27]==="overview")return D2;if(f[27]==="pages")return z2;if(f[27]==="languages")return P2}let s=i(e),c=s&&s(e);return{c(){t=b("div");for(let f=0;f<3;f+=1)o[f].c();n=E(),c&&c.c(),r=Ct(),a(t,"class","flex gap-1 bg-gray-800 border border-gray-700 rounded-lg p-1 w-fit")},m(f,d){B(f,t,d);for(let h=0;h<3;h+=1)o[h]&&o[h].m(t,null);B(f,n,d),c&&c.m(f,d),B(f,r,d)},p(f,d){if(d[0]&134217728|d[1]&32768){l=Fe([["overview","Overview"],["pages","Pages & URLs"],["languages","Languages"]]);let h;for(h=0;h<3;h+=1){const p=Yu(f,l,h);o[h]?o[h].p(p,d):(o[h]=Vu(p),o[h].c(),o[h].m(t,null))}for(;h<3;h+=1)o[h].d(1)}s===(s=i(f))&&c?c.p(f,d):(c&&c.d(1),c=s&&s(f),c&&(c.c(),c.m(r.parentNode,r)))},d(f){f&&(j(t),j(n),j(r)),ft(o,f),c&&c.d(f)}}}function N2(e){let t;return{c(){t=b("div"),t.innerHTML=`<svg class="animate-spin w-5 h-5 mr-2" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4" stroke-dasharray="60 20"></circle></svg>
|
|
63
|
+
Loading analytics…`,a(t,"class","flex items-center justify-center py-24 text-gray-500")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function Vu(e){let t,n,r,l,o;function i(){return e[48](e[117])}return{c(){t=b("button"),n=F(e[118]),a(t,"class",r="px-4 py-1.5 rounded-md text-xs font-medium transition-colors "+(e[27]===e[117]?"bg-indigo-600 text-white":"text-gray-400 hover:text-white"))},m(s,c){B(s,t,c),u(t,n),l||(o=$(t,"click",i),l=!0)},p(s,c){e=s,c[0]&134217728&&r!==(r="px-4 py-1.5 rounded-md text-xs font-medium transition-colors "+(e[27]===e[117]?"bg-indigo-600 text-white":"text-gray-400 hover:text-white"))&&a(t,"class",r)},d(s){s&&j(t),l=!1,o()}}}function P2(e){let t,n,r,l,o,i,s,c,f,d,h,p=Fe(e[5]),g=[];for(let m=0;m<p.length;m+=1)g[m]=Xu(Bu(e,p,m));return{c(){t=b("div"),n=b("div"),r=b("h3"),r.textContent="Translations per Language",l=E(),o=b("div"),i=E(),s=b("div"),c=b("table"),f=b("thead"),f.innerHTML='<tr class="text-gray-400 uppercase text-[10px]"><th class="text-left px-4 py-2.5">Language</th> <th class="text-right px-4 py-2.5 w-28">Translated</th> <th class="text-left px-4 py-2.5">Coverage</th></tr>',d=E(),h=b("tbody");for(let m=0;m<g.length;m+=1)g[m].c();a(r,"class","text-xs font-semibold text-gray-400 uppercase mb-3"),a(o,"class","w-full"),gt(o,"min-height","200px"),a(n,"class","bg-gray-800 border border-gray-700 rounded-xl p-4 lg:col-span-2"),a(t,"class","grid grid-cols-1 lg:grid-cols-2 gap-4"),a(f,"class","border-b border-gray-700"),a(c,"class","w-full text-xs"),a(s,"class","bg-gray-800 border border-gray-700 rounded-xl overflow-hidden")},m(m,_){B(m,t,_),u(t,n),u(n,r),u(n,l),u(n,o),e[70](o),B(m,i,_),B(m,s,_),u(s,c),u(c,f),u(c,d),u(c,h);for(let y=0;y<g.length;y+=1)g[y]&&g[y].m(h,null)},p(m,_){if(_[0]&32){p=Fe(m[5]);let y;for(y=0;y<p.length;y+=1){const v=Bu(m,p,y);g[y]?g[y].p(v,_):(g[y]=Xu(v),g[y].c(),g[y].m(h,null))}for(;y<g.length;y+=1)g[y].d(1);g.length=p.length}},d(m){m&&(j(t),j(i),j(s)),e[70](null),ft(g,m)}}}function z2(e){let t,n,r,l,o,i,s,c,f,d,h,p,g=dt(e[9])+"",m,_,y,v,w,C,x=Fe(e[6]),A=[];for(let R=0;R<x.length;R+=1)A[R]=Ju(Zu(e,x,R));let M=Fe(e[7].filter(mc)),L=[];for(let R=0;R<M.length;R+=1)L[R]=Ku(Hu(e,M,R));function I(R,T){return R[11]?B2:R[8].length===0?j2:F2}let P=I(e),z=P(e);return{c(){t=b("div"),n=b("div"),r=ge("svg"),l=ge("path"),o=E(),i=b("input"),s=E(),c=b("div");for(let R=0;R<A.length;R+=1)A[R].c();f=E(),d=b("div");for(let R=0;R<L.length;R+=1)L[R].c();h=E(),p=b("span"),m=F(g),_=F(" pages"),y=E(),z.c(),v=Ct(),a(l,"fill-rule","evenodd"),a(l,"d","M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z"),a(l,"clip-rule","evenodd"),a(r,"class","absolute left-2.5 top-2 w-4 h-4 text-gray-500"),a(r,"viewBox","0 0 20 20"),a(r,"fill","currentColor"),a(i,"class","bg-gray-800 border border-gray-700 rounded-lg pl-8 pr-3 py-1.5 text-sm text-gray-200 placeholder-gray-500 focus:outline-none focus:border-indigo-500 w-56"),a(i,"placeholder","Search URLs…"),a(n,"class","relative"),a(c,"class","flex gap-1.5 flex-wrap"),a(d,"class","flex gap-1.5 flex-wrap"),a(p,"class","text-xs text-gray-500 ml-auto"),a(t,"class","flex flex-wrap items-center gap-2")},m(R,T){B(R,t,T),u(t,n),u(n,r),u(r,l),u(n,o),u(n,i),Pe(i,e[12]),u(t,s),u(t,c);for(let N=0;N<A.length;N+=1)A[N]&&A[N].m(c,null);u(t,f),u(t,d);for(let N=0;N<L.length;N+=1)L[N]&&L[N].m(d,null);u(t,h),u(t,p),u(p,m),u(p,_),B(R,y,T),z.m(R,T),B(R,v,T),w||(C=[$(i,"input",e[54]),$(i,"input",e[41])],w=!0)},p(R,T){if(T[0]&4096&&i.value!==R[12]&&Pe(i,R[12]),T[0]&16448|T[1]&2048){x=Fe(R[6]);let N;for(N=0;N<x.length;N+=1){const k=Zu(R,x,N);A[N]?A[N].p(k,T):(A[N]=Ju(k),A[N].c(),A[N].m(c,null))}for(;N<A.length;N+=1)A[N].d(1);A.length=x.length}if(T[0]&32896|T[1]&4096){M=Fe(R[7].filter(mc));let N;for(N=0;N<M.length;N+=1){const k=Hu(R,M,N);L[N]?L[N].p(k,T):(L[N]=Ku(k),L[N].c(),L[N].m(d,null))}for(;N<L.length;N+=1)L[N].d(1);L.length=M.length}T[0]&512&&g!==(g=dt(R[9])+"")&&ee(m,g),P===(P=I(R))&&z?z.p(R,T):(z.d(1),z=P(R),z&&(z.c(),z.m(v.parentNode,v)))},d(R){R&&(j(t),j(y),j(v)),ft(A,R),ft(L,R),z.d(R),w=!1,rt(C)}}}function D2(e){let t,n,r,l,o,i=fn(e[4].totalPhrases)+"",s,c,f,d=dt(e[4].phrasesWithSlots)+"",h,p,g,m,_,y,v,w=fn(e[4].approvedPhrases)+"",C,x,A,M=(e[4].totalPhrases?Math.round(e[4].approvedPhrases/e[4].totalPhrases*100):0)+"",L,I,P,z,R,T,N,k=e[4].languageCount+"",D,G,W,Q=fn(e[4].totalTranslations)+"",Y,ie,H,Z,re,K,X,pe=dt(e[4].uniqueUrls)+"",we,Ee,le,ke,ue,ne,Ce,S,te,J,U,O,V,ae,ce,q,he,_e,de=dt(e[4].pendingPhrases)+"",Te,ze,ve,Ae,De,Be,We,oe,se=dt(e[4].approvedPhrases)+"",Ne,Me,Re,be,Ue,it,Je,Ie,Ge,xe,qe,$e,bt,$t,Nt,Bt,Rt,Ot,ye,He,Ke,st,vt,mt,ut=e[4].trashPhrases>0&&oc(e),_t=Fe(e[6]),nt=[];for(let Ze=0;Ze<_t.length;Ze+=1)nt[Ze]=sc(Wu(e,_t,Ze));return{c(){t=b("div"),n=b("div"),r=b("p"),r.textContent="Total Phrases",l=E(),o=b("p"),s=F(i),c=E(),f=b("p"),h=F(d),p=F(" with var-slots"),g=E(),m=b("div"),_=b("p"),_.textContent="Approved",y=E(),v=b("p"),C=F(w),x=E(),A=b("p"),L=F(M),I=F("% coverage"),P=E(),z=b("div"),R=b("p"),R.textContent="Languages",T=E(),N=b("p"),D=F(k),G=E(),W=b("p"),Y=F(Q),ie=F(" total translations"),H=E(),Z=b("div"),re=b("p"),re.textContent="Pages Crawled",K=E(),X=b("p"),we=F(pe),Ee=E(),le=b("p"),le.textContent="unique URLs",ke=E(),ue=b("div"),ne=b("div"),Ce=b("h3"),Ce.textContent="Phrase Status",S=E(),te=b("div"),J=b("div"),U=E(),O=b("div"),V=b("div"),ae=b("span"),ce=E(),q=b("span"),q.textContent="Pending",he=E(),_e=b("span"),Te=F(de),ze=E(),ve=b("div"),Ae=b("span"),De=E(),Be=b("span"),Be.textContent="Approved",We=E(),oe=b("span"),Ne=F(se),Me=E(),ut&&ut.c(),Re=E(),be=b("div"),Ue=b("h3"),Ue.textContent="Discovery Activity (phrases per day)",it=E(),Je=b("div"),Ie=E(),Ge=b("div"),xe=b("div"),qe=b("h3"),qe.textContent="Phrases by Page Section",$e=E(),bt=b("p"),bt.innerHTML="Grouped by <code>f=</code> URL parameter. Click a bar to filter pages.",$t=E(),Nt=b("div"),Bt=E(),Rt=b("div");for(let Ze=0;Ze<nt.length;Ze+=1)nt[Ze].c();Ot=E(),ye=b("div"),He=b("h3"),He.textContent="Phrases by WebChart Instance",Ke=E(),st=b("p"),st.innerHTML=`<span class="text-emerald-400">■</span> approved
|
|
64
|
+
<span class="text-blue-400 opacity-40">■</span> total — click to filter pages`,vt=E(),mt=b("div"),a(r,"class","text-xs text-gray-400 uppercase tracking-wide"),a(o,"class","text-3xl font-bold text-white mt-1"),a(f,"class","text-xs text-gray-500 mt-1"),a(n,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(_,"class","text-xs text-gray-400 uppercase tracking-wide"),a(v,"class","text-3xl font-bold text-emerald-400 mt-1"),a(A,"class","text-xs text-gray-500 mt-1"),a(m,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(R,"class","text-xs text-gray-400 uppercase tracking-wide"),a(N,"class","text-3xl font-bold text-indigo-400 mt-1"),a(W,"class","text-xs text-gray-500 mt-1"),a(z,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(re,"class","text-xs text-gray-400 uppercase tracking-wide"),a(X,"class","text-3xl font-bold text-blue-400 mt-1"),a(le,"class","text-xs text-gray-500 mt-1"),a(Z,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(t,"class","grid grid-cols-2 lg:grid-cols-4 gap-3"),a(Ce,"class","text-xs font-semibold text-gray-400 uppercase mb-3"),a(J,"class","relative"),gt(J,"width","160px"),gt(J,"height","160px"),gt(J,"flex-shrink","0"),a(ae,"class","w-2.5 h-2.5 rounded-full bg-yellow-400 shrink-0"),a(q,"class","text-gray-400"),a(_e,"class","ml-auto font-mono text-gray-200"),a(V,"class","flex items-center gap-2 text-xs"),a(Ae,"class","w-2.5 h-2.5 rounded-full bg-emerald-500 shrink-0"),a(Be,"class","text-gray-400"),a(oe,"class","ml-auto font-mono text-gray-200"),a(ve,"class","flex items-center gap-2 text-xs"),a(O,"class","space-y-2"),a(te,"class","flex items-center gap-6"),a(ne,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(Ue,"class","text-xs font-semibold text-gray-400 uppercase mb-3"),a(Je,"class","w-full"),gt(Je,"min-height","130px"),a(be,"class","lg:col-span-2 bg-gray-800 border border-gray-700 rounded-xl p-4"),a(ue,"class","grid grid-cols-1 lg:grid-cols-3 gap-4"),a(qe,"class","text-xs font-semibold text-gray-400 uppercase mb-1"),a(bt,"class","text-xs text-gray-500 mb-3"),a(Nt,"class","w-full"),gt(Nt,"min-height","180px"),a(Rt,"class","flex flex-wrap gap-2 mt-3"),a(xe,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(He,"class","text-xs font-semibold text-gray-400 uppercase mb-1"),a(st,"class","text-xs text-gray-500 mb-3"),a(mt,"class","w-full"),gt(mt,"min-height","160px"),a(ye,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(Ge,"class","grid grid-cols-1 lg:grid-cols-2 gap-4")},m(Ze,Oe){B(Ze,t,Oe),u(t,n),u(n,r),u(n,l),u(n,o),u(o,s),u(n,c),u(n,f),u(f,h),u(f,p),u(t,g),u(t,m),u(m,_),u(m,y),u(m,v),u(v,C),u(m,x),u(m,A),u(A,L),u(A,I),u(t,P),u(t,z),u(z,R),u(z,T),u(z,N),u(N,D),u(z,G),u(z,W),u(W,Y),u(W,ie),u(t,H),u(t,Z),u(Z,re),u(Z,K),u(Z,X),u(X,we),u(Z,Ee),u(Z,le),B(Ze,ke,Oe),B(Ze,ue,Oe),u(ue,ne),u(ne,Ce),u(ne,S),u(ne,te),u(te,J),e[49](J),u(te,U),u(te,O),u(O,V),u(V,ae),u(V,ce),u(V,q),u(V,he),u(V,_e),u(_e,Te),u(O,ze),u(O,ve),u(ve,Ae),u(ve,De),u(ve,Be),u(ve,We),u(ve,oe),u(oe,Ne),u(O,Me),ut&&ut.m(O,null),u(ue,Re),u(ue,be),u(be,Ue),u(be,it),u(be,Je),e[50](Je),B(Ze,Ie,Oe),B(Ze,Ge,Oe),u(Ge,xe),u(xe,qe),u(xe,$e),u(xe,bt),u(xe,$t),u(xe,Nt),e[51](Nt),u(xe,Bt),u(xe,Rt);for(let Qe=0;Qe<nt.length;Qe+=1)nt[Qe]&&nt[Qe].m(Rt,null);u(Ge,Ot),u(Ge,ye),u(ye,He),u(ye,Ke),u(ye,st),u(ye,vt),u(ye,mt),e[53](mt)},p(Ze,Oe){if(Oe[0]&16&&i!==(i=fn(Ze[4].totalPhrases)+"")&&ee(s,i),Oe[0]&16&&d!==(d=dt(Ze[4].phrasesWithSlots)+"")&&ee(h,d),Oe[0]&16&&w!==(w=fn(Ze[4].approvedPhrases)+"")&&ee(C,w),Oe[0]&16&&M!==(M=(Ze[4].totalPhrases?Math.round(Ze[4].approvedPhrases/Ze[4].totalPhrases*100):0)+"")&&ee(L,M),Oe[0]&16&&k!==(k=Ze[4].languageCount+"")&&ee(D,k),Oe[0]&16&&Q!==(Q=fn(Ze[4].totalTranslations)+"")&&ee(Y,Q),Oe[0]&16&&pe!==(pe=dt(Ze[4].uniqueUrls)+"")&&ee(we,pe),Oe[0]&16&&de!==(de=dt(Ze[4].pendingPhrases)+"")&&ee(Te,de),Oe[0]&16&&se!==(se=dt(Ze[4].approvedPhrases)+"")&&ee(Ne,se),Ze[4].trashPhrases>0?ut?ut.p(Ze,Oe):(ut=oc(Ze),ut.c(),ut.m(O,null)):ut&&(ut.d(1),ut=null),Oe[0]&16448|Oe[1]&2048){_t=Fe(Ze[6]);let Qe;for(Qe=0;Qe<_t.length;Qe+=1){const Tt=Wu(Ze,_t,Qe);nt[Qe]?nt[Qe].p(Tt,Oe):(nt[Qe]=sc(Tt),nt[Qe].c(),nt[Qe].m(Rt,null))}for(;Qe<nt.length;Qe+=1)nt[Qe].d(1);nt.length=_t.length}},d(Ze){Ze&&(j(t),j(ke),j(ue),j(Ie),j(Ge)),e[49](null),ut&&ut.d(),e[50](null),e[51](null),ft(nt,Ze),e[53](null)}}}function Xu(e){let t,n,r=e[114].lang+"",l,o,i,s=dt(e[114].translated)+"",c,f,d,h,p,g,m,_,y=e[114].coverage+"",v,w,C;return{c(){t=b("tr"),n=b("td"),l=F(r),o=E(),i=b("td"),c=F(s),f=E(),d=b("td"),h=b("div"),p=b("div"),g=b("div"),m=E(),_=b("span"),v=F(y),w=F("%"),C=E(),a(n,"class","px-4 py-2.5 font-mono text-indigo-300"),a(i,"class","px-4 py-2.5 text-right font-mono text-gray-200"),a(g,"class","h-1.5 rounded-full transition-all"),gt(g,"width",e[114].coverage+"%"),gt(g,"background",e[114].coverage>80?"#10b981":e[114].coverage>40?"#6366f1":"#f59e0b"),a(p,"class","flex-1 bg-gray-700 rounded-full h-1.5 max-w-xs"),a(_,"class","text-gray-400 w-10 text-right"),a(h,"class","flex items-center gap-2"),a(d,"class","px-4 py-2.5"),a(t,"class","border-b border-gray-700/40")},m(x,A){B(x,t,A),u(t,n),u(n,l),u(t,o),u(t,i),u(i,c),u(t,f),u(t,d),u(d,h),u(h,p),u(p,g),u(h,m),u(h,_),u(_,v),u(_,w),u(t,C)},p(x,A){A[0]&32&&r!==(r=x[114].lang+"")&&ee(l,r),A[0]&32&&s!==(s=dt(x[114].translated)+"")&&ee(c,s),A[0]&32&>(g,"width",x[114].coverage+"%"),A[0]&32&>(g,"background",x[114].coverage>80?"#10b981":x[114].coverage>40?"#6366f1":"#f59e0b"),A[0]&32&&y!==(y=x[114].coverage+"")&&ee(v,y)},d(x){x&&j(t)}}}function Ju(e){let t,n=e[96].section+"",r,l,o,i;function s(){return e[55](e[96])}return{c(){t=b("button"),r=F(n),a(t,"class",l="text-xs px-2 py-1 rounded-full border transition-colors "+(e[14]===e[96].section?"bg-indigo-600 border-indigo-500 text-white":"border-gray-600 text-gray-400 hover:border-gray-400 hover:text-gray-200"))},m(c,f){B(c,t,f),u(t,r),o||(i=$(t,"click",s),o=!0)},p(c,f){e=c,f[0]&64&&n!==(n=e[96].section+"")&&ee(r,n),f[0]&16448&&l!==(l="text-xs px-2 py-1 rounded-full border transition-colors "+(e[14]===e[96].section?"bg-indigo-600 border-indigo-500 text-white":"border-gray-600 text-gray-400 hover:border-gray-400 hover:text-gray-200"))&&a(t,"class",l)},d(c){c&&j(t),o=!1,i()}}}function Ku(e){let t,n=e[109].instance+"",r,l,o,i;function s(){return e[56](e[109])}return{c(){t=b("button"),r=F(n),a(t,"class",l="text-xs px-2 py-1 rounded-full border transition-colors font-mono "+(e[15]===e[109].instance?"bg-blue-700 border-blue-500 text-white":"border-gray-700 text-gray-500 hover:border-gray-500 hover:text-gray-300"))},m(c,f){B(c,t,f),u(t,r),o||(i=$(t,"click",s),o=!0)},p(c,f){e=c,f[0]&128&&n!==(n=e[109].instance+"")&&ee(r,n),f[0]&32896&&l!==(l="text-xs px-2 py-1 rounded-full border transition-colors font-mono "+(e[15]===e[109].instance?"bg-blue-700 border-blue-500 text-white":"border-gray-700 text-gray-500 hover:border-gray-500 hover:text-gray-300"))&&a(t,"class",l)},d(c){c&&j(t),o=!1,i()}}}function F2(e){let t,n,r,l,o,i,s,c,f,d=e[13]+1+"",h,p,g=Math.min(e[13]+Kn,e[9])+"",m,_,y=dt(e[9])+"",v,w,C,x,A,M,L,I,P,z,R,T,N=Fe(e[8]),k=[];for(let D=0;D<N.length;D+=1)k[D]=ic(Ru(e,N,D));return{c(){t=b("div"),n=b("table"),r=b("thead"),r.innerHTML='<tr class="text-gray-400 uppercase text-[10px]"><th class="text-left px-4 py-2.5">Page</th> <th class="text-right px-3 py-2.5 w-24">Phrases</th> <th class="text-right px-3 py-2.5 w-24">Approved</th> <th class="text-right px-3 py-2.5 w-20">Coverage</th> <th class="px-3 py-2.5 w-10"></th></tr>',l=E(),o=b("tbody");for(let D=0;D<k.length;D+=1)k[D].c();i=E(),s=b("div"),c=b("span"),f=F("Showing "),h=F(d),p=F("–"),m=F(g),_=F(" of "),v=F(y),w=E(),C=b("div"),x=b("button"),A=F("← Prev"),L=E(),I=b("button"),P=F("Next →"),a(r,"class","border-b border-gray-700 bg-gray-850"),a(n,"class","w-full text-xs"),a(t,"class","bg-gray-800 border border-gray-700 rounded-xl overflow-hidden"),a(x,"class","px-3 py-1 rounded bg-gray-800 border border-gray-700 hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed text-gray-300"),x.disabled=M=e[13]===0,a(I,"class","px-3 py-1 rounded bg-gray-800 border border-gray-700 hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed text-gray-300"),I.disabled=z=e[13]+Kn>=e[9],a(C,"class","flex gap-2"),a(s,"class","flex items-center justify-between text-xs text-gray-500")},m(D,G){B(D,t,G),u(t,n),u(n,r),u(n,l),u(n,o);for(let W=0;W<k.length;W+=1)k[W]&&k[W].m(o,null);B(D,i,G),B(D,s,G),u(s,c),u(c,f),u(c,h),u(c,p),u(c,m),u(c,_),u(c,v),u(s,w),u(s,C),u(C,x),u(x,A),u(C,L),u(C,I),u(I,P),R||(T=[$(x,"click",e[44]),$(I,"click",e[45])],R=!0)},p(D,G){if(G[0]&33489199|G[1]&1012){N=Fe(D[8]);let W;for(W=0;W<N.length;W+=1){const Q=Ru(D,N,W);k[W]?k[W].p(Q,G):(k[W]=ic(Q),k[W].c(),k[W].m(o,null))}for(;W<k.length;W+=1)k[W].d(1);k.length=N.length}G[0]&8192&&d!==(d=D[13]+1+"")&&ee(h,d),G[0]&8704&&g!==(g=Math.min(D[13]+Kn,D[9])+"")&&ee(m,g),G[0]&512&&y!==(y=dt(D[9])+"")&&ee(v,y),G[0]&8192&&M!==(M=D[13]===0)&&(x.disabled=M),G[0]&8704&&z!==(z=D[13]+Kn>=D[9])&&(I.disabled=z)},d(D){D&&(j(t),j(i),j(s)),ft(k,D),R=!1,rt(T)}}}function j2(e){let t;return{c(){t=b("div"),t.textContent="No pages match your filter",a(t,"class","text-center py-10 text-gray-500 text-xs")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function B2(e){let t;return{c(){t=b("div"),t.textContent="Loading…",a(t,"class","text-center py-10 text-gray-500 text-xs")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function qu(e){let t,n,r;function l(s,c){if(s[17])return O2;if(s[0])return R2}let o=l(e),i=o&&o(e);return{c(){t=b("tr"),n=b("td"),i&&i.c(),r=E(),a(n,"colspan","5"),a(n,"class","px-4 pb-4 pt-3 border-b border-indigo-900"),a(t,"class","bg-gray-900/80")},m(s,c){B(s,t,c),u(t,n),i&&i.m(n,null),u(t,r)},p(s,c){o===(o=l(s))&&i?i.p(s,c):(i&&i.d(1),i=o&&o(s),i&&(i.c(),i.m(n,null)))},d(s){s&&j(t),i&&i.d()}}}function R2(e){let t,n,r,l=dt(e[0].totalPhrases)+"",o,i,s,c,f=dt(e[0].approved)+"",d,h,p,g,m=dt(e[0].pending)+"",_,y,v,w,C,x,A,M,L,I,P,z,R,T,N,k,D,G=e[21]?"Queued…":`Translate all pending (${dt(e[0].pending)})`,W,Q,Y,ie,H,Z,re,K,X,pe,we,Ee,le,ke,ue,ne,Ce,S,te,J,U,O,V,ae,ce,q=e[33].length+"",he,_e,de=e[0].topPhrases.length+"",Te,ze,ve=e[0].topPhrases.length===200?"(200 max)":"",Ae,De,Be,We,oe,se,Ne,Me=Fe(e[5]),Re=[];for(let xe=0;xe<Me.length;xe+=1)Re[xe]=Qu(Uu(e,Me,xe));let be=e[20].size>0&&$u(e),Ue=e[22]&&ec(e),it=Fe(e[33]),Je=[];for(let xe=0;xe<it.length;xe+=1)Je[xe]=rc(Ou(e,it,xe));let Ie=null;it.length||(Ie=tc());let Ge=e[0].topPhrases.length===200&&lc();return{c(){t=b("div"),n=b("div"),r=b("span"),o=F(l),i=F(" total"),s=E(),c=b("span"),d=F(f),h=F(" approved"),p=E(),g=b("span"),_=F(m),y=F(" pending"),v=E(),w=b("a"),C=ge("svg"),x=ge("path"),A=F(`
|
|
65
|
+
Open Page`),M=E(),L=b("div"),I=ge("svg"),P=ge("path"),z=E(),R=b("span"),R.textContent="Translate to",T=E(),N=b("select");for(let xe=0;xe<Re.length;xe+=1)Re[xe].c();k=E(),D=b("button"),W=F(G),Y=E(),be&&be.c(),ie=E(),Ue&&Ue.c(),H=E(),Z=b("div"),re=b("div"),K=b("input"),pe=E(),we=b("button"),Ee=F(".*"),ke=E(),ue=b("select"),ne=b("option"),ne.textContent="All",Ce=b("option"),Ce.textContent="Pending",S=b("option"),S.textContent="Approved",te=E(),J=b("label"),U=b("input"),V=F(`
|
|
66
|
+
All`),ae=E(),ce=b("span"),he=F(q),_e=F("/"),Te=F(de),ze=E(),Ae=F(ve),De=E(),Be=b("div");for(let xe=0;xe<Je.length;xe+=1)Je[xe].c();Ie&&Ie.c(),We=E(),Ge&&Ge.c(),oe=Ct(),a(r,"class","bg-gray-800 rounded px-2 py-1 text-[10px] font-mono text-gray-400"),a(c,"class","bg-emerald-900/50 rounded px-2 py-1 text-[10px] font-mono text-emerald-400"),a(g,"class","bg-yellow-900/50 rounded px-2 py-1 text-[10px] font-mono text-yellow-400"),a(n,"class","flex gap-2 shrink-0"),a(x,"d","M6 2H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-3M9 2h5m0 0v5m0-5L7 9"),a(x,"stroke-linecap","round"),a(x,"stroke-linejoin","round"),a(C,"viewBox","0 0 16 16"),a(C,"fill","none"),a(C,"class","w-3 h-3"),a(C,"stroke","currentColor"),a(C,"stroke-width","2"),a(w,"href",e[16]),a(w,"target","_blank"),a(w,"rel","noopener noreferrer"),a(w,"class","ml-auto flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-indigo-600 hover:bg-indigo-500 text-white text-xs font-medium shrink-0 transition-colors"),a(t,"class","flex items-center gap-3 mb-3"),a(P,"d","M12 2L13.5 7.5L19 9L13.5 10.5L12 16L10.5 10.5L5 9L10.5 7.5Z"),a(P,"fill","#FFB833"),a(I,"viewBox","0 0 24 24"),a(I,"width","14"),a(I,"height","14"),a(I,"xmlns","http://www.w3.org/2000/svg"),a(I,"class","shrink-0"),a(R,"class","text-xs text-gray-400 shrink-0"),a(N,"class","bg-gray-700 border border-gray-600 rounded px-2 py-1 text-xs text-gray-200 focus:outline-none focus:border-indigo-500"),e[18]===void 0&&Dt(()=>e[58].call(N)),a(D,"class","px-3 py-1 text-xs rounded-lg bg-yellow-600 hover:bg-yellow-500 text-white font-medium transition-colors disabled:opacity-40"),D.disabled=Q=e[21]||e[0].pending===0,a(L,"class","flex items-center gap-2 mb-3 p-2.5 bg-gray-800 rounded-lg border border-gray-700"),a(K,"class",X="w-full bg-gray-800 border rounded px-2.5 py-1.5 pr-16 text-xs text-gray-200 placeholder-gray-500 focus:outline-none "+(e[19]?"border-red-500 focus:border-red-500":"border-gray-700 focus:border-indigo-500")),a(K,"placeholder","Search phrases… (supports regex)"),a(we,"class",le="absolute right-1.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold transition-colors "+(e[2]?"bg-indigo-600 text-white":"bg-gray-700 text-gray-400 hover:bg-gray-600")),a(we,"title","Toggle regex mode"),a(re,"class","flex-1 flex items-center relative"),ne.__value="",Pe(ne,ne.__value),Ce.__value="pending",Pe(Ce,Ce.__value),S.__value="approved",Pe(S,S.__value),a(ue,"class","bg-gray-800 border border-gray-700 rounded px-2 py-1.5 text-xs text-gray-400 focus:outline-none"),e[3]===void 0&&Dt(()=>e[64].call(ue)),a(U,"type","checkbox"),U.checked=O=e[20].size>0&&e[33].length>0&&e[33].every(e[66]),a(U,"class","accent-indigo-500"),a(J,"class","flex items-center gap-1.5 text-xs text-gray-400 cursor-pointer select-none shrink-0"),a(ce,"class","text-[10px] text-gray-600 shrink-0 whitespace-nowrap"),a(Z,"class","flex items-center gap-2 mb-2"),a(Be,"class","max-h-72 overflow-y-auto space-y-0.5 pr-1")},m(xe,qe){B(xe,t,qe),u(t,n),u(n,r),u(r,o),u(r,i),u(n,s),u(n,c),u(c,d),u(c,h),u(n,p),u(n,g),u(g,_),u(g,y),u(t,v),u(t,w),u(w,C),u(C,x),u(w,A),B(xe,M,qe),B(xe,L,qe),u(L,I),u(I,P),u(L,z),u(L,R),u(L,T),u(L,N);for(let $e=0;$e<Re.length;$e+=1)Re[$e]&&Re[$e].m(N,null);yt(N,e[18],!0),u(L,k),u(L,D),u(D,W),u(L,Y),be&&be.m(L,null),u(L,ie),Ue&&Ue.m(L,null),B(xe,H,qe),B(xe,Z,qe),u(Z,re),u(re,K),Pe(K,e[1]),u(re,pe),u(re,we),u(we,Ee),u(Z,ke),u(Z,ue),u(ue,ne),u(ue,Ce),u(ue,S),yt(ue,e[3],!0),u(Z,te),u(Z,J),u(J,U),u(J,V),u(Z,ae),u(Z,ce),u(ce,he),u(ce,_e),u(ce,Te),u(ce,ze),u(ce,Ae),B(xe,De,qe),B(xe,Be,qe);for(let $e=0;$e<Je.length;$e+=1)Je[$e]&&Je[$e].m(Be,null);Ie&&Ie.m(Be,null),B(xe,We,qe),Ge&&Ge.m(xe,qe),B(xe,oe,qe),se||(Ne=[$(N,"change",e[58]),$(D,"click",e[59]),$(K,"input",e[61]),$(K,"input",e[62]),$(we,"click",e[63]),$(ue,"change",e[64]),$(ue,"change",e[65]),$(U,"change",e[38])],se=!0)},p(xe,qe){if(qe[0]&1&&l!==(l=dt(xe[0].totalPhrases)+"")&&ee(o,l),qe[0]&1&&f!==(f=dt(xe[0].approved)+"")&&ee(d,f),qe[0]&1&&m!==(m=dt(xe[0].pending)+"")&&ee(_,m),qe[0]&65536&&a(w,"href",xe[16]),qe[0]&32){Me=Fe(xe[5]);let $e;for($e=0;$e<Me.length;$e+=1){const bt=Uu(xe,Me,$e);Re[$e]?Re[$e].p(bt,qe):(Re[$e]=Qu(bt),Re[$e].c(),Re[$e].m(N,null))}for(;$e<Re.length;$e+=1)Re[$e].d(1);Re.length=Me.length}if(qe[0]&262176&&yt(N,xe[18]),qe[0]&2097153&&G!==(G=xe[21]?"Queued…":`Translate all pending (${dt(xe[0].pending)})`)&&ee(W,G),qe[0]&2097153&&Q!==(Q=xe[21]||xe[0].pending===0)&&(D.disabled=Q),xe[20].size>0?be?be.p(xe,qe):(be=$u(xe),be.c(),be.m(L,ie)):be&&(be.d(1),be=null),xe[22]?Ue?Ue.p(xe,qe):(Ue=ec(xe),Ue.c(),Ue.m(L,null)):Ue&&(Ue.d(1),Ue=null),qe[0]&524288&&X!==(X="w-full bg-gray-800 border rounded px-2.5 py-1.5 pr-16 text-xs text-gray-200 placeholder-gray-500 focus:outline-none "+(xe[19]?"border-red-500 focus:border-red-500":"border-gray-700 focus:border-indigo-500"))&&a(K,"class",X),qe[0]&2&&K.value!==xe[1]&&Pe(K,xe[1]),qe[0]&4&&le!==(le="absolute right-1.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold transition-colors "+(xe[2]?"bg-indigo-600 text-white":"bg-gray-700 text-gray-400 hover:bg-gray-600"))&&a(we,"class",le),qe[0]&8&&yt(ue,xe[3]),qe[0]&1048576|qe[1]&4&&O!==(O=xe[20].size>0&&xe[33].length>0&&xe[33].every(xe[66]))&&(U.checked=O),qe[1]&4&&q!==(q=xe[33].length+"")&&ee(he,q),qe[0]&1&&de!==(de=xe[0].topPhrases.length+"")&&ee(Te,de),qe[0]&1&&ve!==(ve=xe[0].topPhrases.length===200?"(200 max)":"")&&ee(Ae,ve),qe[0]&1310720|qe[1]&836){it=Fe(xe[33]);let $e;for($e=0;$e<it.length;$e+=1){const bt=Ou(xe,it,$e);Je[$e]?Je[$e].p(bt,qe):(Je[$e]=rc(bt),Je[$e].c(),Je[$e].m(Be,null))}for(;$e<Je.length;$e+=1)Je[$e].d(1);Je.length=it.length,!it.length&&Ie?Ie.p(xe,qe):it.length?Ie&&(Ie.d(1),Ie=null):(Ie=tc(),Ie.c(),Ie.m(Be,null))}xe[0].topPhrases.length===200?Ge||(Ge=lc(),Ge.c(),Ge.m(oe.parentNode,oe)):Ge&&(Ge.d(1),Ge=null)},d(xe){xe&&(j(t),j(M),j(L),j(H),j(Z),j(De),j(Be),j(We),j(oe)),ft(Re,xe),be&&be.d(),Ue&&Ue.d(),ft(Je,xe),Ie&&Ie.d(),Ge&&Ge.d(xe),se=!1,rt(Ne)}}}function O2(e){let t;return{c(){t=b("p"),t.textContent="Loading…",a(t,"class","text-gray-500 text-xs py-6 text-center")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function Qu(e){let t,n=e[88].lang+"",r,l;return{c(){t=b("option"),r=F(n),t.__value=l=e[88].lang,Pe(t,t.__value)},m(o,i){B(o,t,i),u(t,r)},p(o,i){i[0]&32&&n!==(n=o[88].lang+"")&&ee(r,n),i[0]&32&&l!==(l=o[88].lang)&&(t.__value=l,Pe(t,t.__value))},d(o){o&&j(t)}}}function $u(e){let t,n,r=e[20].size+"",l,o,i,s;return{c(){t=b("button"),n=F("Translate selected ("),l=F(r),o=F(")"),a(t,"class","px-3 py-1 text-xs rounded-lg bg-indigo-600 hover:bg-indigo-500 text-white font-medium transition-colors")},m(c,f){B(c,t,f),u(t,n),u(t,l),u(t,o),i||(s=$(t,"click",e[60]),i=!0)},p(c,f){f[0]&1048576&&r!==(r=c[20].size+"")&&ee(l,r)},d(c){c&&j(t),i=!1,s()}}}function ec(e){let t,n=e[22].text+"",r,l;return{c(){t=b("span"),r=F(n),a(t,"class",l="text-xs "+(e[22].ok?"text-emerald-400":"text-red-400")+" ml-1")},m(o,i){B(o,t,i),u(t,r)},p(o,i){i[0]&4194304&&n!==(n=o[22].text+"")&&ee(r,n),i[0]&4194304&&l!==(l="text-xs "+(o[22].ok?"text-emerald-400":"text-red-400")+" ml-1")&&a(t,"class",l)},d(o){o&&j(t)}}}function tc(e){let t;return{c(){t=b("p"),t.textContent="No phrases match",a(t,"class","text-gray-500 text-xs text-center py-6")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function nc(e){let t,n=e[104].context+"",r;return{c(){t=b("div"),r=F(n),a(t,"class","text-gray-500 text-[10px] mt-0.5 break-words whitespace-normal leading-snug")},m(l,o){B(l,t,o),u(t,r)},p(l,o){o[1]&4&&n!==(n=l[104].context+"")&&ee(r,n)},d(l){l&&j(t)}}}function rc(e){let t,n,r,l,o,i=e[104].status[0].toUpperCase()+"",s,c,f,d,h,p=e[104].key+"",g,m,_,y,v,w,C,x,A,M,L;function I(){return e[67](e[104])}function P(){return e[68](e[104])}let z=e[104].context&&nc(e);function R(){return e[69](e[104])}return{c(){t=b("div"),n=b("input"),l=E(),o=b("span"),s=F(i),f=E(),d=b("div"),h=b("button"),g=F(p),m=E(),z&&z.c(),_=E(),y=b("button"),v=ge("svg"),w=ge("path"),x=E(),a(n,"type","checkbox"),n.checked=r=e[20].has(e[104].id),a(n,"class","mt-0.5 accent-indigo-500 shrink-0 cursor-pointer"),a(o,"class",c="shrink-0 px-1 rounded text-[9px] font-medium mt-0.5 "+(e[104].status==="approved"?"bg-emerald-900 text-emerald-300":e[104].status==="trash"?"bg-red-900 text-red-300":"bg-yellow-900 text-yellow-300")),a(h,"class","font-mono text-gray-300 text-[11px] text-left hover:text-indigo-300 w-full break-words whitespace-normal leading-snug"),a(d,"class","flex-1 min-w-0"),a(w,"d","M8 1l1.5 4.5H14l-3.7 2.7 1.4 4.3L8 9.8l-3.7 2.7 1.4-4.3L2 5.5h4.5z"),a(v,"viewBox","0 0 16 16"),a(v,"fill","currentColor"),a(v,"class","w-3 h-3"),a(y,"class","shrink-0 p-0.5 rounded text-gray-600 hover:text-yellow-400 opacity-0 group-hover:opacity-100 transition-all"),a(y,"title",C="Queue AI translation → "+e[18]),a(t,"class",A="flex items-start gap-1.5 px-2 py-1.5 rounded group "+(e[20].has(e[104].id)?"bg-indigo-950/50":"hover:bg-gray-800/60"))},m(T,N){B(T,t,N),u(t,n),u(t,l),u(t,o),u(o,s),u(t,f),u(t,d),u(d,h),u(h,g),u(d,m),z&&z.m(d,null),u(t,_),u(t,y),u(y,v),u(v,w),u(t,x),M||(L=[$(n,"change",I),$(h,"click",P),$(y,"click",jt(R))],M=!0)},p(T,N){e=T,N[0]&1048576|N[1]&4&&r!==(r=e[20].has(e[104].id))&&(n.checked=r),N[1]&4&&i!==(i=e[104].status[0].toUpperCase()+"")&&ee(s,i),N[1]&4&&c!==(c="shrink-0 px-1 rounded text-[9px] font-medium mt-0.5 "+(e[104].status==="approved"?"bg-emerald-900 text-emerald-300":e[104].status==="trash"?"bg-red-900 text-red-300":"bg-yellow-900 text-yellow-300"))&&a(o,"class",c),N[1]&4&&p!==(p=e[104].key+"")&&ee(g,p),e[104].context?z?z.p(e,N):(z=nc(e),z.c(),z.m(d,null)):z&&(z.d(1),z=null),N[0]&262176&&C!==(C="Queue AI translation → "+e[18])&&a(y,"title",C),N[0]&1048576|N[1]&4&&A!==(A="flex items-start gap-1.5 px-2 py-1.5 rounded group "+(e[20].has(e[104].id)?"bg-indigo-950/50":"hover:bg-gray-800/60"))&&a(t,"class",A)},d(T){T&&j(t),z&&z.d(),M=!1,rt(L)}}}function lc(e){let t;return{c(){t=b("p"),t.textContent="Showing first 200 — refine with search or status filter",a(t,"class","text-[10px] text-gray-600 mt-1 text-center")},m(n,r){B(n,t,r)},d(n){n&&j(t)}}}function ic(e){let t,n,r,l,o=e[100].label+"",i,s,c,f,d,h=gc(e[99].url)+"",p,g,m,_=pc(e[99].url)+"",y,v,w,C,x=dt(e[99].phraseCount)+"",A,M,L,I=dt(e[99].approved)+"",P,z,R,T,N=e[101]+"",k,D,G,W,Q,Y,ie,H,Z,re,K,X,pe,we;function Ee(){return e[57](e[99])}let le=e[16]===e[99].url&&qu(e);return{c(){t=b("tr"),n=b("td"),r=b("div"),l=b("span"),i=F(o),c=E(),f=b("div"),d=b("div"),p=F(h),g=E(),m=b("div"),y=F(_),w=E(),C=b("td"),A=F(x),M=E(),L=b("td"),P=F(I),z=E(),R=b("td"),T=b("span"),k=F(N),D=F("%"),W=E(),Q=b("td"),Y=b("a"),ie=ge("svg"),H=ge("path"),K=E(),le&&le.c(),X=Ct(),a(l,"class",s="text-[10px] font-medium "+e[100].color+" shrink-0"),a(d,"class","text-gray-500 text-[10px] truncate"),a(m,"class","font-mono text-gray-300 truncate max-w-sm"),a(m,"title",v=e[99].url),a(f,"class","min-w-0"),a(r,"class","flex items-center gap-2 min-w-0"),a(n,"class","px-4 py-2.5"),a(C,"class","px-3 py-2.5 text-right font-mono text-gray-200"),a(L,"class","px-3 py-2.5 text-right font-mono text-emerald-400"),a(T,"class",G="px-1.5 py-0.5 rounded-full text-[10px] font-medium "+(e[101]===100?"bg-emerald-900/60 text-emerald-300":e[101]>0?"bg-indigo-900/60 text-indigo-300":"bg-gray-700 text-gray-500")),a(R,"class","px-3 py-2.5 text-right"),a(H,"d","M6 2H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-3M9 2h5m0 0v5m0-5L7 9"),a(H,"stroke-linecap","round"),a(H,"stroke-linejoin","round"),a(ie,"viewBox","0 0 16 16"),a(ie,"fill","none"),a(ie,"class","w-3.5 h-3.5"),a(ie,"stroke","currentColor"),a(ie,"stroke-width","1.5"),a(Y,"href",Z=e[99].url),a(Y,"target","_blank"),a(Y,"rel","noopener noreferrer"),a(Y,"title","Open page"),a(Y,"class","flex items-center justify-center w-6 h-6 rounded text-gray-500 hover:text-indigo-400 hover:bg-gray-600 transition-colors"),a(Q,"class","px-3 py-2.5"),a(t,"class",re="border-b border-gray-700/40 hover:bg-gray-700/60 cursor-pointer transition-colors "+(e[16]===e[99].url?"bg-indigo-950 border-indigo-800":""))},m(ke,ue){B(ke,t,ue),u(t,n),u(n,r),u(r,l),u(l,i),u(r,c),u(r,f),u(f,d),u(d,p),u(f,g),u(f,m),u(m,y),u(t,w),u(t,C),u(C,A),u(t,M),u(t,L),u(L,P),u(t,z),u(t,R),u(R,T),u(T,k),u(T,D),u(t,W),u(t,Q),u(Q,Y),u(Y,ie),u(ie,H),B(ke,K,ue),le&&le.m(ke,ue),B(ke,X,ue),pe||(we=[$(Y,"click",jt(e[47])),$(t,"click",Ee)],pe=!0)},p(ke,ue){e=ke,ue[0]&256&&o!==(o=e[100].label+"")&&ee(i,o),ue[0]&256&&s!==(s="text-[10px] font-medium "+e[100].color+" shrink-0")&&a(l,"class",s),ue[0]&256&&h!==(h=gc(e[99].url)+"")&&ee(p,h),ue[0]&256&&_!==(_=pc(e[99].url)+"")&&ee(y,_),ue[0]&256&&v!==(v=e[99].url)&&a(m,"title",v),ue[0]&256&&x!==(x=dt(e[99].phraseCount)+"")&&ee(A,x),ue[0]&256&&I!==(I=dt(e[99].approved)+"")&&ee(P,I),ue[0]&256&&N!==(N=e[101]+"")&&ee(k,N),ue[0]&256&&G!==(G="px-1.5 py-0.5 rounded-full text-[10px] font-medium "+(e[101]===100?"bg-emerald-900/60 text-emerald-300":e[101]>0?"bg-indigo-900/60 text-indigo-300":"bg-gray-700 text-gray-500"))&&a(T,"class",G),ue[0]&256&&Z!==(Z=e[99].url)&&a(Y,"href",Z),ue[0]&65792&&re!==(re="border-b border-gray-700/40 hover:bg-gray-700/60 cursor-pointer transition-colors "+(e[16]===e[99].url?"bg-indigo-950 border-indigo-800":""))&&a(t,"class",re),e[16]===e[99].url?le?le.p(e,ue):(le=qu(e),le.c(),le.m(X.parentNode,X)):le&&(le.d(1),le=null)},d(ke){ke&&(j(t),j(K),j(X)),le&&le.d(ke),pe=!1,rt(we)}}}function oc(e){let t,n,r,l,o,i,s=dt(e[4].trashPhrases)+"",c;return{c(){t=b("div"),n=b("span"),r=E(),l=b("span"),l.textContent="Trash",o=E(),i=b("span"),c=F(s),a(n,"class","w-2.5 h-2.5 rounded-full bg-red-500 shrink-0"),a(l,"class","text-gray-400"),a(i,"class","ml-auto font-mono text-gray-200"),a(t,"class","flex items-center gap-2 text-xs")},m(f,d){B(f,t,d),u(t,n),u(t,r),u(t,l),u(t,o),u(t,i),u(i,c)},p(f,d){d[0]&16&&s!==(s=dt(f[4].trashPhrases)+"")&&ee(c,s)},d(f){f&&j(t)}}}function sc(e){let t,n=e[96].section+"",r,l,o=fn(e[96].phrases)+"",i,s,c,f,d;function h(){return e[52](e[96])}return{c(){t=b("button"),r=F(n),l=F(" · "),i=F(o),s=E(),a(t,"class",c="text-xs px-2 py-1 rounded-full border transition-colors "+(e[14]===e[96].section?"bg-indigo-600 border-indigo-500 text-white":"border-gray-600 text-gray-400 hover:border-gray-400 hover:text-gray-200"))},m(p,g){B(p,t,g),u(t,r),u(t,l),u(t,i),u(t,s),f||(d=$(t,"click",h),f=!0)},p(p,g){e=p,g[0]&64&&n!==(n=e[96].section+"")&&ee(r,n),g[0]&64&&o!==(o=fn(e[96].phrases)+"")&&ee(i,o),g[0]&16448&&c!==(c="text-xs px-2 py-1 rounded-full border transition-colors "+(e[14]===e[96].section?"bg-indigo-600 border-indigo-500 text-white":"border-gray-600 text-gray-400 hover:border-gray-400 hover:text-gray-200"))&&a(t,"class",c)},d(p){p&&j(t),f=!1,d()}}}function ac(e){var C;let t,n,r,l,o,i=(((C=e[24])==null?void 0:C.status)??e[23].status).toUpperCase()+"",s,c,f,d,h,p,g,m,_;function y(x,A){if(x[25])return H2;if(x[24])return U2}let v=y(e),w=v&&v(e);return{c(){var x,A;t=b("div"),n=b("div"),r=b("div"),l=b("div"),o=b("span"),s=F(i),f=E(),d=b("h3"),d.textContent="Phrase Detail",h=E(),p=b("button"),p.innerHTML='<svg viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4"><path d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"></path></svg>',g=E(),w&&w.c(),a(o,"class",c="px-2 py-0.5 rounded text-[10px] font-semibold "+((((x=e[24])==null?void 0:x.status)??e[23].status)==="approved"?"bg-emerald-900 text-emerald-300":(((A=e[24])==null?void 0:A.status)??e[23].status)==="trash"?"bg-red-900 text-red-300":"bg-yellow-900 text-yellow-300")),a(d,"class","text-sm font-semibold text-white"),a(l,"class","flex items-center gap-2"),a(p,"class","text-gray-500 hover:text-white transition-colors p-1 rounded hover:bg-gray-700"),a(p,"aria-label","Close"),a(r,"class","flex items-center justify-between px-5 py-3.5 border-b border-gray-700 shrink-0"),a(n,"class","bg-gray-900 border border-gray-700 rounded-xl shadow-2xl w-full max-w-3xl max-h-[90vh] flex flex-col overflow-hidden"),a(t,"class","fixed inset-0 bg-black/75 z-50 flex items-center justify-center p-4"),a(t,"role","dialog"),a(t,"aria-modal","true")},m(x,A){B(x,t,A),u(t,n),u(n,r),u(r,l),u(l,o),u(o,s),u(l,f),u(l,d),u(r,h),u(r,p),u(n,g),w&&w.m(n,null),m||(_=[$(p,"click",e[71]),$(t,"click",jr(e[75]))],m=!0)},p(x,A){var M,L,I;A[0]&25165824&&i!==(i=(((M=x[24])==null?void 0:M.status)??x[23].status).toUpperCase()+"")&&ee(s,i),A[0]&25165824&&c!==(c="px-2 py-0.5 rounded text-[10px] font-semibold "+((((L=x[24])==null?void 0:L.status)??x[23].status)==="approved"?"bg-emerald-900 text-emerald-300":(((I=x[24])==null?void 0:I.status)??x[23].status)==="trash"?"bg-red-900 text-red-300":"bg-yellow-900 text-yellow-300"))&&a(o,"class",c),v===(v=y(x))&&w?w.p(x,A):(w&&w.d(1),w=v&&v(x),w&&(w.c(),w.m(n,null)))},d(x){x&&j(t),w&&w.d(),m=!1,rt(_)}}}function U2(e){let t,n,r,l,o,i,s=e[24].key+"",c,f,d,h,p,g=(e[24].context||"—")+"",m,_,y,v,w,C=e[24].status+"",x,A,M,L,I,P=(e[24].created_at||"—")+"",z,R,T,N,k,D,G,W,Q,Y,ie,H=e[21]?"Queuing…":`★ AI Translate → ${e[18]}`,Z,re,K,X,pe,we,Ee,le,ke,ue,ne,Ce,S,te=e[24].translations.length+"",J,U,O=e[24].translations.length!==1?"s":"",V,ae,ce,q,he,_e,de;function Te(Ie,Ge){return Ie[24].url?W2:Z2}let ze=Te(e),ve=ze(e),Ae=Fe(e[5]),De=[];for(let Ie=0;Ie<Ae.length;Ie+=1)De[Ie]=uc(ju(e,Ae,Ie));let Be=e[22]&&cc(e);function We(Ie,Ge){return Ie[24].url?G2:Y2}let oe=We(e),se=oe(e);function Ne(Ie,Ge){return Ie[24].translations.length<Ie[5].length?Q2:q2}let Me=Ne(e),Re=Me(e);function be(Ie,Ge){return Ie[24].translations.length===0?e_:$2}let Ue=be(e),it=Ue(e),Je=e[5].length>e[24].translations.length&&dc(ki(e));return{c(){t=b("div"),n=b("div"),r=b("div"),l=b("span"),l.textContent="Key",o=E(),i=b("span"),c=F(s),f=E(),d=b("span"),d.textContent="DomContext",h=E(),p=b("span"),m=F(g),_=E(),y=b("span"),y.textContent="Status",v=E(),w=b("span"),x=F(C),A=E(),M=b("span"),M.textContent="Discovered",L=E(),I=b("span"),z=F(P),R=E(),T=b("span"),T.textContent="Source URL",N=E(),ve.c(),k=E(),D=b("span"),D.textContent="Translate",G=E(),W=b("div"),Q=b("select");for(let Ie=0;Ie<De.length;Ie+=1)De[Ie].c();Y=E(),ie=b("button"),Z=F(H),re=E(),Be&&Be.c(),K=E(),X=b("div"),pe=b("p"),pe.textContent="Page Screenshot",we=E(),se.c(),Ee=E(),le=b("div"),ke=b("div"),ue=b("h4"),ne=F(`Translations
|
|
67
|
+
`),Ce=b("span"),S=F("("),J=F(te),U=F(" language"),V=F(O),ae=F(")"),ce=E(),Re.c(),q=E(),it.c(),he=E(),Je&&Je.c(),a(l,"class","text-gray-400 font-medium pt-0.5"),a(i,"class","font-mono text-white break-all leading-relaxed"),a(d,"class","text-gray-400 font-medium pt-0.5"),a(p,"class","text-gray-300 break-all"),a(y,"class","text-gray-400 font-medium pt-0.5"),a(w,"class","text-gray-300"),a(M,"class","text-gray-400 font-medium pt-0.5"),a(I,"class","text-gray-300"),a(T,"class","text-gray-400 font-medium pt-0.5"),a(D,"class","text-gray-400 font-medium pt-0.5"),a(Q,"class","bg-gray-800 border border-gray-600 rounded px-2 py-1 text-xs text-gray-200 focus:outline-none focus:border-indigo-500"),e[18]===void 0&&Dt(()=>e[72].call(Q)),a(ie,"class","px-3 py-1 text-xs rounded-lg bg-yellow-600 hover:bg-yellow-500 text-white font-medium transition-colors disabled:opacity-40"),ie.disabled=e[21],a(W,"class","flex items-center gap-2 flex-wrap"),a(r,"class","flex-1 p-5 grid grid-cols-[100px_1fr] gap-x-4 gap-y-3 text-sm content-start"),a(pe,"class","text-xs text-gray-400 font-medium"),a(X,"class","w-72 shrink-0 p-4 flex flex-col gap-2"),a(n,"class","flex gap-0 divide-x divide-gray-700"),a(Ce,"class","ml-1 text-gray-600 font-normal normal-case"),a(ue,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),a(ke,"class","flex items-center justify-between mb-3"),a(le,"class","border-t border-gray-700 px-5 py-4"),a(t,"class","overflow-y-auto flex-1")},m(Ie,Ge){B(Ie,t,Ge),u(t,n),u(n,r),u(r,l),u(r,o),u(r,i),u(i,c),u(r,f),u(r,d),u(r,h),u(r,p),u(p,m),u(r,_),u(r,y),u(r,v),u(r,w),u(w,x),u(r,A),u(r,M),u(r,L),u(r,I),u(I,z),u(r,R),u(r,T),u(r,N),ve.m(r,null),u(r,k),u(r,D),u(r,G),u(r,W),u(W,Q);for(let xe=0;xe<De.length;xe+=1)De[xe]&&De[xe].m(Q,null);yt(Q,e[18],!0),u(W,Y),u(W,ie),u(ie,Z),u(W,re),Be&&Be.m(W,null),u(n,K),u(n,X),u(X,pe),u(X,we),se.m(X,null),u(t,Ee),u(t,le),u(le,ke),u(ke,ue),u(ue,ne),u(ue,Ce),u(Ce,S),u(Ce,J),u(Ce,U),u(Ce,V),u(Ce,ae),u(ke,ce),Re.m(ke,null),u(le,q),it.m(le,null),u(le,he),Je&&Je.m(le,null),_e||(de=[$(Q,"change",e[72]),$(ie,"click",e[73])],_e=!0)},p(Ie,Ge){if(Ge[0]&16777216&&s!==(s=Ie[24].key+"")&&ee(c,s),Ge[0]&16777216&&g!==(g=(Ie[24].context||"—")+"")&&ee(m,g),Ge[0]&16777216&&C!==(C=Ie[24].status+"")&&ee(x,C),Ge[0]&16777216&&P!==(P=(Ie[24].created_at||"—")+"")&&ee(z,P),ze===(ze=Te(Ie))&&ve?ve.p(Ie,Ge):(ve.d(1),ve=ze(Ie),ve&&(ve.c(),ve.m(r,k))),Ge[0]&32){Ae=Fe(Ie[5]);let xe;for(xe=0;xe<Ae.length;xe+=1){const qe=ju(Ie,Ae,xe);De[xe]?De[xe].p(qe,Ge):(De[xe]=uc(qe),De[xe].c(),De[xe].m(Q,null))}for(;xe<De.length;xe+=1)De[xe].d(1);De.length=Ae.length}Ge[0]&262176&&yt(Q,Ie[18]),Ge[0]&2359296&&H!==(H=Ie[21]?"Queuing…":`★ AI Translate → ${Ie[18]}`)&&ee(Z,H),Ge[0]&2097152&&(ie.disabled=Ie[21]),Ie[22]?Be?Be.p(Ie,Ge):(Be=cc(Ie),Be.c(),Be.m(W,null)):Be&&(Be.d(1),Be=null),oe===(oe=We(Ie))&&se?se.p(Ie,Ge):(se.d(1),se=oe(Ie),se&&(se.c(),se.m(X,null))),Ge[0]&16777216&&te!==(te=Ie[24].translations.length+"")&&ee(J,te),Ge[0]&16777216&&O!==(O=Ie[24].translations.length!==1?"s":"")&&ee(V,O),Me===(Me=Ne(Ie))&&Re?Re.p(Ie,Ge):(Re.d(1),Re=Me(Ie),Re&&(Re.c(),Re.m(ke,null))),Ue===(Ue=be(Ie))&&it?it.p(Ie,Ge):(it.d(1),it=Ue(Ie),it&&(it.c(),it.m(le,he))),Ie[5].length>Ie[24].translations.length?Je?Je.p(ki(Ie),Ge):(Je=dc(ki(Ie)),Je.c(),Je.m(le,null)):Je&&(Je.d(1),Je=null)},d(Ie){Ie&&j(t),ve.d(),ft(De,Ie),Be&&Be.d(),se.d(),Re.d(),it.d(),Je&&Je.d(),_e=!1,rt(de)}}}function H2(e){let t;return{c(){t=b("div"),t.innerHTML='<svg class="animate-spin w-6 h-6 text-indigo-500" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" opacity=".25"></circle><path d="M22 12A10 10 0 0 0 12 2" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg>',a(t,"class","flex items-center justify-center py-16")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function Z2(e){let t;return{c(){t=b("span"),t.textContent="—",a(t,"class","text-gray-500")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function W2(e){let t,n=e[24].url+"",r,l;return{c(){t=b("a"),r=F(n),a(t,"href",l=e[24].url),a(t,"target","_blank"),a(t,"rel","noopener noreferrer"),a(t,"class","text-indigo-400 hover:text-indigo-300 hover:underline break-all text-xs")},m(o,i){B(o,t,i),u(t,r)},p(o,i){i[0]&16777216&&n!==(n=o[24].url+"")&&ee(r,n),i[0]&16777216&&l!==(l=o[24].url)&&a(t,"href",l)},d(o){o&&j(t)}}}function uc(e){let t,n=e[88].lang+"",r,l;return{c(){t=b("option"),r=F(n),t.__value=l=e[88].lang,Pe(t,t.__value)},m(o,i){B(o,t,i),u(t,r)},p(o,i){i[0]&32&&n!==(n=o[88].lang+"")&&ee(r,n),i[0]&32&&l!==(l=o[88].lang)&&(t.__value=l,Pe(t,t.__value))},d(o){o&&j(t)}}}function cc(e){let t,n=e[22].text+"",r,l;return{c(){t=b("span"),r=F(n),a(t,"class",l="text-xs "+(e[22].ok?"text-emerald-400":"text-red-400"))},m(o,i){B(o,t,i),u(t,r)},p(o,i){i[0]&4194304&&n!==(n=o[22].text+"")&&ee(r,n),i[0]&4194304&&l!==(l="text-xs "+(o[22].ok?"text-emerald-400":"text-red-400"))&&a(t,"class",l)},d(o){o&&j(t)}}}function Y2(e){let t;return{c(){t=b("div"),t.textContent="No URL",a(t,"class","flex-1 rounded border border-gray-700 bg-gray-800 flex items-center justify-center text-xs text-gray-500"),gt(t,"min-height","140px")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function G2(e){let t;function n(o,i){return o[26][o[24].url]===void 0?K2:o[26][o[24].url]===null?J2:o[26][o[24].url]===!1?X2:V2}let r=n(e),l=r(e);return{c(){l.c(),t=Ct()},m(o,i){l.m(o,i),B(o,t,i)},p(o,i){r===(r=n(o))&&l?l.p(o,i):(l.d(1),l=r(o),l&&(l.c(),l.m(t.parentNode,t)))},d(o){o&&j(t),l.d(o)}}}function V2(e){let t,n,r,l;return{c(){t=b("a"),n=b("img"),Pl(n.src,r="data:image/jpeg;base64,"+e[26][e[24].url])||a(n,"src",r),a(n,"alt","Page screenshot"),a(n,"class","rounded border border-gray-700 shadow-sm w-full hover:opacity-90 transition-opacity"),a(t,"href",l=e[24].url),a(t,"target","_blank"),a(t,"rel","noopener noreferrer")},m(o,i){B(o,t,i),u(t,n)},p(o,i){i[0]&83886080&&!Pl(n.src,r="data:image/jpeg;base64,"+o[26][o[24].url])&&a(n,"src",r),i[0]&16777216&&l!==(l=o[24].url)&&a(t,"href",l)},d(o){o&&j(t)}}}function X2(e){let t;return{c(){t=b("div"),t.textContent="No screenshot yet",a(t,"class","flex-1 rounded border border-gray-700 bg-gray-800 flex items-center justify-center text-xs text-gray-500"),gt(t,"min-height","140px")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function J2(e){let t;return{c(){t=b("div"),t.innerHTML='<svg class="animate-spin w-5 h-5 text-indigo-500" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" opacity=".25"></circle><path d="M22 12A10 10 0 0 0 12 2" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg>',a(t,"class","flex-1 flex items-center justify-center")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function K2(e){let t=e[34](e[24].url)+"",n,r,l;return{c(){n=F(t),r=E(),l=b("div"),l.textContent="Loading…",a(l,"class","flex-1 flex items-center justify-center text-gray-600 text-xs")},m(o,i){B(o,n,i),B(o,r,i),B(o,l,i)},p(o,i){i[0]&16777216&&t!==(t=o[34](o[24].url)+"")&&ee(n,t)},d(o){o&&(j(n),j(r),j(l))}}}function q2(e){let t;return{c(){t=b("span"),t.textContent="All languages covered",a(t,"class","text-[10px] text-emerald-500")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function Q2(e){let t,n=e[5].length-e[24].translations.length+"",r,l,o=e[5].length-e[24].translations.length!==1?"s":"",i,s;return{c(){t=b("span"),r=F(n),l=F(" language"),i=F(o),s=F(" missing"),a(t,"class","text-[10px] text-yellow-500")},m(c,f){B(c,t,f),u(t,r),u(t,l),u(t,i),u(t,s)},p(c,f){f[0]&16777248&&n!==(n=c[5].length-c[24].translations.length+"")&&ee(r,n),f[0]&16777248&&o!==(o=c[5].length-c[24].translations.length!==1?"s":"")&&ee(i,o)},d(c){c&&j(t)}}}function $2(e){let t,n=Fe(e[24].translations),r=[];for(let l=0;l<n.length;l+=1)r[l]=fc(Fu(e,n,l));return{c(){t=b("div");for(let l=0;l<r.length;l+=1)r[l].c();a(t,"class","grid grid-cols-1 sm:grid-cols-2 gap-2")},m(l,o){B(l,t,o);for(let i=0;i<r.length;i+=1)r[i]&&r[i].m(t,null)},p(l,o){if(o[0]&16777216){n=Fe(l[24].translations);let i;for(i=0;i<n.length;i+=1){const s=Fu(l,n,i);r[i]?r[i].p(s,o):(r[i]=fc(s),r[i].c(),r[i].m(t,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(l){l&&j(t),ft(r,l)}}}function e_(e){let t;return{c(){t=b("p"),t.textContent="No translations yet for this phrase.",a(t,"class","text-gray-500 text-sm text-center py-6")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function fc(e){let t,n,r=e[91].lang+"",l,o,i,s=e[91].value+"",c,f;return{c(){t=b("div"),n=b("span"),l=F(r),o=E(),i=b("span"),c=F(s),f=E(),a(n,"class","font-mono text-indigo-400 text-xs w-10 shrink-0 pt-0.5"),a(i,"class","text-gray-200 text-sm leading-relaxed break-words min-w-0"),a(t,"class","bg-gray-800 rounded-lg px-3 py-2.5 flex items-start gap-3")},m(d,h){B(d,t,h),u(t,n),u(n,l),u(t,o),u(t,i),u(i,c),u(t,f)},p(d,h){h[0]&16777216&&r!==(r=d[91].lang+"")&&ee(l,r),h[0]&16777216&&s!==(s=d[91].value+"")&&ee(c,s)},d(d){d&&j(t)}}}function dc(e){let t,n,r,l=Fe(e[87]),o=[];for(let i=0;i<l.length;i+=1)o[i]=hc(Du(e,l,i));return{c(){t=b("div"),n=b("span"),n.textContent="Missing:",r=E();for(let i=0;i<o.length;i+=1)o[i].c();a(n,"class","text-[10px] text-gray-500"),a(t,"class","mt-3 flex items-center gap-2 flex-wrap")},m(i,s){B(i,t,s),u(t,n),u(t,r);for(let c=0;c<o.length;c+=1)o[c]&&o[c].m(t,null)},p(i,s){if(s[0]&16777248){l=Fe(i[87]);let c;for(c=0;c<l.length;c+=1){const f=Du(i,l,c);o[c]?o[c].p(f,s):(o[c]=hc(f),o[c].c(),o[c].m(t,null))}for(;c<o.length;c+=1)o[c].d(1);o.length=l.length}},d(i){i&&j(t),ft(o,i)}}}function hc(e){let t,n=e[88].lang+"",r;return{c(){t=b("span"),r=F(n),a(t,"class","font-mono text-[10px] px-1.5 py-0.5 rounded bg-gray-800 text-gray-400 border border-gray-700")},m(l,o){B(l,t,o),u(t,r)},p(l,o){o[0]&16777248&&n!==(n=l[88].lang+"")&&ee(r,n)},d(l){l&&j(t)}}}function t_(e){let t,n,r,l,o,i,s,c,f=e[4]&&Gu(e);function d(m,_){return m[10]?N2:L2}let h=d(e),p=h(e),g=e[23]&&ac(e);return{c(){t=b("div"),n=b("div"),r=b("div"),l=b("div"),l.innerHTML='<h2 class="text-xl font-bold text-white">Analytics</h2> <p class="text-gray-500 text-xs mt-0.5">Translation database overview</p>',o=E(),f&&f.c(),i=E(),p.c(),s=E(),g&&g.c(),c=Ct(),a(r,"class","flex items-center justify-between"),a(n,"class","space-y-5 text-gray-200 text-sm p-6"),a(t,"class","-m-6 min-h-screen bg-gray-900")},m(m,_){B(m,t,_),u(t,n),u(n,r),u(r,l),u(r,o),f&&f.m(r,null),u(n,i),p.m(n,null),B(m,s,_),g&&g.m(m,_),B(m,c,_)},p(m,_){m[4]?f?f.p(m,_):(f=Gu(m),f.c(),f.m(r,null)):f&&(f.d(1),f=null),h===(h=d(m))&&p?p.p(m,_):(p.d(1),p=h(m),p&&(p.c(),p.m(n,null))),m[23]?g?g.p(m,_):(g=ac(m),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null)},i:je,o:je,d(m){m&&(j(t),j(s),j(c)),f&&f.d(),p.d(),g&&g.d(m)}}}const Kn=50;function dt(e){return e!=null?e.toLocaleString():"—"}function fn(e){return e==null?"—":e>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"k":String(e)}function pc(e){try{const t=new URL(e),n=t.pathname.split("/").filter(Boolean).pop()||t.pathname,r=t.searchParams,l=[n];return r.get("f")&&l.push(`f=${r.get("f")}`),r.get("s")&&l.push(`s=${r.get("s")}`),r.get("module")&&l.push(`mod=${r.get("module")}`),r.get("func")&&l.push(`func=${r.get("func")}`),l.join(" · ")}catch{return e.length>70?e.slice(0,67)+"…":e}}function gc(e){try{return new URL(e).hostname}catch{return""}}function n_(e){return e.includes("f=chart")?{label:"Chart",color:"text-indigo-400"}:e.includes("f=admin")?{label:"Admin",color:"text-yellow-400"}:e.includes("f=layout")?{label:"Layout",color:"text-emerald-400"}:e.includes("func=")?{label:"Func",color:"text-blue-400"}:{label:"Other",color:"text-purple-400"}}const mc=e=>e.phrases>=100;function r_(e,t,n){let r,l=null,o=[],i=[],s=[],c=[],f=[],d=0,h=!0,p=!1,g="",m=0,_="",y="",v=null,w=null,C=!1,x="",A="",M=!1,L=!1,I="pending",P=new Set,z=!1,R=null,T=null,N=null,k=!1,D={};function G(ye){return!ye||D[ye]!==void 0||(n(26,D[ye]=null,D),Ye(`../api/screenshots?url=${encodeURIComponent(ye)}`).then(He=>He.json()).then(He=>{n(26,D[ye]=He.screenshot||!1,D),n(26,D)}).catch(()=>{n(26,D[ye]=!1,D),n(26,D)})),""}let W="overview",Q,Y,ie,H,Z;async function re(){n(10,h=!0);const[ye,He,Ke,st,vt]=await Promise.all([Ye("../api/analytics"),Ye("../api/analytics/languages"),Ye("../api/analytics/sections"),Ye("../api/analytics/instances"),Ye("../api/analytics/activity")]);n(4,[l,o,i,s,c]=await Promise.all([ye.json(),He.json(),Ke.json(),st.json(),vt.json()]),l,n(5,o),n(6,i),n(7,s)),n(10,h=!1),await Ir(),ue()}async function K(){n(11,p=!0);const ye=new URLSearchParams({limit:Kn,offset:m});g&&ye.set("search",g),_&&ye.set("search",_==="chart"?"f=chart":_==="admin"?"f=admin":_==="layout"?"f=layout":_==="func"?"func=":g||""),y&&ye.set("search",y);const Ke=await(await Ye(`../api/analytics/urls?${ye}`)).json();n(8,f=Ke.rows),n(9,d=Ke.total),n(11,p=!1)}async function X(ye){n(16,v=ye),n(0,w=null),n(17,C=!0),n(1,A=""),n(3,I="pending"),n(2,M=!1),n(19,L=!1),n(20,P=new Set),n(22,R=null),n(23,T=null),n(24,N=null);const He=await Ye(`../api/analytics/url-detail?url=${encodeURIComponent(ye)}`);n(0,w=await He.json()),n(17,C=!1),!x&&o.length>0&&n(18,x=o[0].lang)}function pe(){n(16,v=null),n(0,w=null)}function we(ye){const He=new Set(P);He.has(ye)?He.delete(ye):He.add(ye),n(20,P=He)}function Ee(ye){const He=new Set(P);ye.target.checked?r.forEach(Ke=>He.add(Ke.id)):r.forEach(Ke=>He.delete(Ke.id)),n(20,P=He)}async function le(ye,He){if(!(!x||!ye||ye.length===0)){n(21,z=!0),n(22,R=null);try{const Ke=await Ye("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:ye,lang:x})});if(Ke.ok)n(22,R={ok:!0,text:`${He} queued for ${x}`}),n(20,P=new Set);else{const st=await Ke.json().catch(()=>({}));n(22,R={ok:!1,text:st.message||`Error ${Ke.status}`})}}catch(Ke){n(22,R={ok:!1,text:Ke.message})}finally{n(21,z=!1)}}}async function ke(ye){if((T==null?void 0:T.id)===ye.id){n(23,T=null),n(24,N=null);return}n(23,T=ye),n(24,N=null),n(25,k=!0);try{const He=await Ye(`../api/analytics/phrase-detail?id=${ye.id}`);n(24,N=await He.json())}finally{n(25,k=!1)}}function ue(){ne(),Ce(),S(),te(),J()}function ne(){if(!Y||!l)return;en(Y).selectAll("*").remove();const ye=[{label:"Pending",value:l.pendingPhrases,color:"#F59E0B"},{label:"Approved",value:l.approvedPhrases,color:"#10B981"},{label:"Trash",value:l.trashPhrases,color:"#EF4444"}].filter(Oe=>Oe.value>0),He=160,Ke=He/2,st=Ke*.6,mt=en(Y).append("svg").attr("width",He).attr("height",He).append("g").attr("transform",`translate(${Ke},${Ke})`),ut=I2().value(Oe=>Oe.value).sort(null),_t=Iu().innerRadius(st).outerRadius(Ke-3),nt=Iu().innerRadius(st).outerRadius(Ke),Ze=en(Y).append("div").attr("class","chart-tip").style("display","none");mt.selectAll("path").data(ut(ye)).join("path").attr("d",_t).attr("fill",Oe=>Oe.data.color).attr("stroke","#111827").attr("stroke-width",2).style("cursor","pointer").on("mouseover",function(Oe,Qe){en(this).transition().duration(120).attr("d",nt),Ze.style("display","block").html(`<b>${Qe.data.label}</b>: ${dt(Qe.data.value)}`)}).on("mousemove",Oe=>Ze.style("left",Oe.offsetX+10+"px").style("top",Oe.offsetY-8+"px")).on("mouseout",function(){en(this).transition().duration(120).attr("d",_t),Ze.style("display","none")}),mt.append("text").attr("text-anchor","middle").attr("dy","-0.25em").attr("fill","#f9fafb").attr("font-size",16).attr("font-weight","bold").text(fn(l.totalPhrases)),mt.append("text").attr("text-anchor","middle").attr("dy","1.1em").attr("fill","#6b7280").attr("font-size",10).text("phrases")}function Ce(){if(!Q||!o.length)return;en(Q).selectAll("*").remove();const ye={top:8,right:60,bottom:8,left:68},He=26,Ke=4,st=Q.clientWidth||400,vt=o.length*(He+Ke)+ye.top+ye.bottom,mt=st-ye.left-ye.right,_t=en(Q).append("svg").attr("width",st).attr("height",vt).append("g").attr("transform",`translate(${ye.left},${ye.top})`),nt=vl(o,Qe=>Qe.translated)||1,Ze=qr().domain([0,nt]).range([0,mt]),Oe=If(b2).domain([0,o.length-1]);o.forEach((Qe,Tt)=>{const ot=Tt*(He+Ke);_t.append("text").attr("x",-6).attr("y",ot+He/2+1).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","#a5b4fc").attr("font-size",11).attr("font-family","monospace").text(Qe.lang),_t.append("rect").attr("x",0).attr("y",ot).attr("width",mt).attr("height",He).attr("fill","#1f2937").attr("rx",4),_t.append("rect").attr("x",0).attr("y",ot).attr("width",Ze(Qe.translated)).attr("height",He).attr("fill",Oe(Tt)).attr("rx",4),_t.append("text").attr("x",mt+6).attr("y",ot+He/2+1).attr("dominant-baseline","middle").attr("fill","#9ca3af").attr("font-size",10).text(`${fn(Qe.translated)} (${Qe.coverage}%)`)})}function S(){if(!ie||!c.length)return;en(ie).selectAll("*").remove();const ye={top:10,right:16,bottom:28,left:48},He=ie.clientWidth||500,Ke=130,st=He-ye.left-ye.right,vt=Ke-ye.top-ye.bottom,mt=Mf("%Y-%m-%d"),ut=c.map(ot=>({day:mt(ot.day),count:ot.count})),nt=en(ie).append("svg").attr("width",He).attr("height",Ke).append("g").attr("transform",`translate(${ye.left},${ye.top})`),Ze=g2().domain(G0(ut,ot=>ot.day)).range([0,st]),Oe=qr().domain([0,vl(ut,ot=>ot.count)]).nice().range([vt,0]),Qe=T2().x(ot=>Ze(ot.day)).y0(vt).y1(ot=>Oe(ot.count)).curve(zu);nt.append("path").datum(ut).attr("fill","#6366f133").attr("d",Qe);const Tt=Df().x(ot=>Ze(ot.day)).y(ot=>Oe(ot.count)).curve(zu);nt.append("path").datum(ut).attr("fill","none").attr("stroke","#6366f1").attr("stroke-width",2).attr("d",Tt),nt.selectAll("circle").data(ut).join("circle").attr("cx",ot=>Ze(ot.day)).attr("cy",ot=>Oe(ot.count)).attr("r",3).attr("fill","#818cf8").attr("stroke","#1f2937").attr("stroke-width",1.5),nt.append("g").attr("transform",`translate(0,${vt})`).call(Wa(Ze).ticks(6).tickFormat(lo("%b %d"))).call(ot=>ot.select(".domain").attr("stroke","#374151")).call(ot=>ot.selectAll("text").attr("fill","#6b7280").attr("font-size",10)),nt.append("g").call(Ya(Oe).ticks(4).tickFormat(Vl(",d"))).call(ot=>ot.select(".domain").attr("stroke","#374151")).call(ot=>ot.selectAll("text").attr("fill","#6b7280").attr("font-size",10))}function te(){if(!H||!i.length)return;en(H).selectAll("*").remove();const ye={chart:"#6366f1",admin:"#f59e0b",layout:"#10b981",func:"#3b82f6",other:"#8b5cf6"},He={top:10,right:16,bottom:32,left:48},Ke=H.clientWidth||400,st=180,vt=Ke-He.left-He.right,mt=st-He.top-He.bottom,_t=en(H).append("svg").attr("width",Ke).attr("height",st).append("g").attr("transform",`translate(${He.left},${He.top})`),nt=yf().domain(i.map(Oe=>Oe.section)).range([0,vt]).padding(.3),Ze=qr().domain([0,vl(i,Oe=>Oe.phrases)]).nice().range([mt,0]);_t.append("g").call(Ya(Ze).ticks(4).tickFormat(Vl(",d"))).call(Oe=>Oe.select(".domain").attr("stroke","#374151")).call(Oe=>Oe.selectAll("text").attr("fill","#9ca3af").attr("font-size",10)),_t.selectAll(".bar").data(i).join("rect").attr("x",Oe=>nt(Oe.section)).attr("y",Oe=>Ze(Oe.phrases)).attr("width",nt.bandwidth()).attr("height",Oe=>mt-Ze(Oe.phrases)).attr("fill",Oe=>ye[Oe.section]||"#6b7280").attr("rx",3).style("cursor","pointer").on("click",(Oe,Qe)=>{n(14,_=_===Qe.section?"":Qe.section),n(13,m=0),n(27,W="pages"),K()}),_t.selectAll(".bar-label").data(i).join("text").attr("x",Oe=>nt(Oe.section)+nt.bandwidth()/2).attr("y",Oe=>Ze(Oe.phrases)-4).attr("text-anchor","middle").attr("fill","#d1d5db").attr("font-size",9).text(Oe=>fn(Oe.phrases)),_t.append("g").attr("transform",`translate(0,${mt})`).call(Wa(nt)).call(Oe=>Oe.select(".domain").attr("stroke","#374151")).call(Oe=>Oe.selectAll("text").attr("fill","#9ca3af").attr("font-size",11))}function J(){if(!Z||!s.length)return;en(Z).selectAll("*").remove();const ye=s.filter(Qe=>Qe.phrases>=100);if(!ye.length)return;const He={top:8,right:56,bottom:8,left:76},Ke=22,st=4,vt=Z.clientWidth||400,mt=ye.length*(Ke+st)+He.top+He.bottom,ut=vt-He.left-He.right,nt=en(Z).append("svg").attr("width",vt).attr("height",mt).append("g").attr("transform",`translate(${He.left},${He.top})`),Ze=vl(ye,Qe=>Qe.phrases)||1,Oe=qr().domain([0,Ze]).range([0,ut]);ye.forEach((Qe,Tt)=>{const ot=Tt*(Ke+st);nt.append("text").attr("x",-6).attr("y",ot+Ke/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","#93c5fd").attr("font-size",10).attr("font-family","monospace").text(Qe.instance),nt.append("rect").attr("x",0).attr("y",ot).attr("width",ut).attr("height",Ke).attr("fill","#1f2937").attr("rx",3),nt.append("rect").attr("x",0).attr("y",ot).attr("width",Oe(Qe.phrases)).attr("height",Ke).attr("fill","#3b82f655").attr("rx",3),nt.append("rect").attr("x",0).attr("y",ot).attr("width",Oe(Qe.approved)).attr("height",Ke).attr("fill","#10b981").attr("rx",3).style("cursor","pointer").on("click",()=>{n(15,y=y===Qe.instance?"":Qe.instance),n(12,g=y),n(13,m=0),n(27,W="pages"),K()}),nt.append("text").attr("x",ut+6).attr("y",ot+Ke/2).attr("dominant-baseline","middle").attr("fill","#9ca3af").attr("font-size",9).text(`${fn(Qe.phrases)} phrases`)})}let U;function O(){n(14,_=""),n(15,y=""),clearTimeout(U),U=setTimeout(()=>{n(13,m=0),K()},300)}function V(ye){n(14,_=_===ye?"":ye),n(12,g=""),n(15,y=""),n(13,m=0),K()}function ae(ye){n(15,y=y===ye?"":ye),n(12,g=y),n(14,_=""),n(13,m=0),K()}function ce(){n(13,m=Math.max(0,m-Kn)),K()}function q(){n(13,m+=Kn),K()}function he(ye){n(27,W=ye),ye==="pages"&&f.length===0&&K(),ye==="overview"&&Ir().then(ue)}Br(()=>{const ye=new ResizeObserver(()=>{h||ue()});return re().then(()=>{[Q,ie,H,Z].filter(Boolean).forEach(He=>ye.observe(He))}),()=>ye.disconnect()});function _e(ye){Er.call(this,e,ye)}const de=ye=>he(ye);function Te(ye){Vn[ye?"unshift":"push"](()=>{Y=ye,n(29,Y)})}function ze(ye){Vn[ye?"unshift":"push"](()=>{ie=ye,n(30,ie)})}function ve(ye){Vn[ye?"unshift":"push"](()=>{H=ye,n(31,H)})}const Ae=ye=>V(ye.section);function De(ye){Vn[ye?"unshift":"push"](()=>{Z=ye,n(32,Z)})}function Be(){g=this.value,n(12,g)}const We=ye=>V(ye.section),oe=ye=>ae(ye.instance),se=ye=>v===ye.url?pe():X(ye.url);function Ne(){x=tn(this),n(18,x),n(5,o)}const Me=()=>le(w.pendingKeyIds,"All pending"),Re=()=>le([...P],"Selected");function be(){A=this.value,n(1,A)}const Ue=()=>{n(23,T=null),n(24,N=null)},it=()=>{n(2,M=!M),n(23,T=null),n(24,N=null)};function Je(){I=tn(this),n(3,I)}const Ie=()=>{n(23,T=null),n(24,N=null)},Ge=ye=>P.has(ye.id),xe=ye=>we(ye.id),qe=ye=>ke(ye),$e=ye=>le([ye.id],`"${ye.key}"`);function bt(ye){Vn[ye?"unshift":"push"](()=>{Q=ye,n(28,Q)})}const $t=()=>{n(23,T=null),n(24,N=null)};function Nt(){x=tn(this),n(18,x),n(5,o)}const Bt=()=>le([N.id],`"${N.key}"`),Rt=(ye,He)=>!ye.has(He.lang),Ot=()=>{n(23,T=null),n(24,N=null)};return e.$$.update=()=>{e.$$.dirty[0]&15&&n(33,r=(()=>{const ye=(w==null?void 0:w.topPhrases)||[];if(!A)return ye.filter(Ke=>!I||Ke.status===I);if(M){let Ke;try{Ke=new RegExp(A,"i"),n(19,L=!1)}catch{return n(19,L=!0),[]}return ye.filter(st=>(!I||st.status===I)&&(Ke.test(st.key)||Ke.test(st.context||"")))}const He=A.toLowerCase();return ye.filter(Ke=>(!I||Ke.status===I)&&(Ke.key.toLowerCase().includes(He)||(Ke.context||"").toLowerCase().includes(He)))})())},n(19,L=!1),[w,A,M,I,l,o,i,s,f,d,h,p,g,m,_,y,v,C,x,L,P,z,R,T,N,k,D,W,Q,Y,ie,H,Z,r,G,X,pe,we,Ee,le,ke,O,V,ae,ce,q,he,_e,de,Te,ze,ve,Ae,De,Be,We,oe,se,Ne,Me,Re,be,Ue,it,Je,Ie,Ge,xe,qe,$e,bt,$t,Nt,Bt,Rt,Ot]}class l_ extends on{constructor(t){super(),ln(this,t,r_,t_,Qt,{},null,[-1,-1,-1,-1])}}function _c(e,t,n){const r=e.slice();return r[23]=t[n],r}function bc(e,t,n){const r=e.slice();return r[26]=t[n],r}function yc(e){let t,n,r,l;function o(){return e[16](e[26])}return{c(){t=b("button"),a(t,"class",n="w-6 h-6 rounded-full border-2 transition-transform hover:scale-110 "+(e[2]===e[26]?"border-gray-800 scale-110":"border-transparent")),gt(t,"background-color",e[26]),a(t,"title",e[26])},m(i,s){B(i,t,s),r||(l=$(t,"click",o),r=!0)},p(i,s){e=i,s&4&&n!==(n="w-6 h-6 rounded-full border-2 transition-transform hover:scale-110 "+(e[2]===e[26]?"border-gray-800 scale-110":"border-transparent"))&&a(t,"class",n)},d(i){i&&j(t),r=!1,l()}}}function vc(e){let t,n;return{c(){t=b("p"),n=F(e[6]),a(t,"class","text-sm text-red-600 mb-4")},m(r,l){B(r,t,l),u(t,n)},p(r,l){l&64&&ee(n,r[6])},d(r){r&&j(t)}}}function i_(e){let t,n=[],r=new Map,l=Fe(e[0]);const o=i=>i[23].id;for(let i=0;i<l.length;i+=1){let s=_c(e,l,i),c=o(s);r.set(c,n[i]=wc(c,s))}return{c(){t=b("div");for(let i=0;i<n.length;i+=1)n[i].c();a(t,"class","space-y-2")},m(i,s){B(i,t,s);for(let c=0;c<n.length;c+=1)n[c]&&n[c].m(t,null)},p(i,s){s&7737&&(l=Fe(i[0]),n=ol(n,s,o,1,i,l,r,t,Oi,wc,null,_c))},d(i){i&&j(t);for(let s=0;s<n.length;s+=1)n[s].d()}}}function o_(e){let t;return{c(){t=b("div"),t.innerHTML='<p>No labels created yet.</p> <p class="text-sm mt-1">Create your first label above to start organizing phrases.</p>',a(t,"class","text-center py-8 text-gray-400")},m(n,r){B(n,t,r)},p:je,d(n){n&&j(t)}}}function s_(e){let t,n,r,l=e[23].name+"",o,i,s,c=e[23].count+"",f,d,h=e[23].count!==1?"s":"",p,g,m,_,y,v,w;function C(){return e[20](e[23])}function x(){return e[21](e[23])}return{c(){t=b("span"),n=E(),r=b("span"),o=F(l),i=E(),s=b("span"),f=F(c),d=F(" phrase"),p=F(h),g=E(),m=b("button"),m.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 20 20" fill="currentColor"><path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"></path></svg>',_=E(),y=b("button"),y.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd"></path></svg>',a(t,"class","inline-block w-4 h-4 rounded-full shrink-0"),gt(t,"background-color",e[23].color),a(r,"class","flex-1 text-sm font-medium text-gray-700"),a(s,"class","text-xs text-gray-400"),a(m,"class","p-1 text-gray-400 hover:text-indigo-600 transition-colors"),a(m,"title","Edit"),a(y,"class","p-1 text-gray-400 hover:text-red-600 transition-colors"),a(y,"title","Delete")},m(A,M){B(A,t,M),B(A,n,M),B(A,r,M),u(r,o),B(A,i,M),B(A,s,M),u(s,f),u(s,d),u(s,p),B(A,g,M),B(A,m,M),B(A,_,M),B(A,y,M),v||(w=[$(m,"click",C),$(y,"click",x)],v=!0)},p(A,M){e=A,M&1&>(t,"background-color",e[23].color),M&1&&l!==(l=e[23].name+"")&&ee(o,l),M&1&&c!==(c=e[23].count+"")&&ee(f,c),M&1&&h!==(h=e[23].count!==1?"s":"")&&ee(p,h)},d(A){A&&(j(t),j(n),j(r),j(i),j(s),j(g),j(m),j(_),j(y)),v=!1,rt(w)}}}function a_(e){let t,n,r,l,o,i,s,c,f;return{c(){t=b("input"),n=E(),r=b("input"),l=E(),o=b("button"),o.textContent="Save",i=E(),s=b("button"),s.textContent="Cancel",a(t,"type","color"),a(t,"class","w-7 h-7 rounded border border-gray-300 cursor-pointer"),a(r,"type","text"),a(r,"maxlength","50"),a(r,"class","flex-1 px-2 py-1 border border-gray-300 rounded text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(o,"class","px-3 py-1 bg-indigo-600 text-white text-xs rounded hover:bg-indigo-700"),a(s,"class","px-3 py-1 border border-gray-300 text-xs rounded hover:bg-gray-100")},m(d,h){B(d,t,h),Pe(t,e[5]),B(d,n,h),B(d,r,h),Pe(r,e[4]),B(d,l,h),B(d,o,h),B(d,i,h),B(d,s,h),c||(f=[$(t,"input",e[17]),$(r,"input",e[18]),$(r,"keydown",e[19]),$(o,"click",e[10]),$(s,"click",e[11])],c=!0)},p(d,h){h&32&&Pe(t,d[5]),h&16&&r.value!==d[4]&&Pe(r,d[4])},d(d){d&&(j(t),j(n),j(r),j(l),j(o),j(i),j(s)),c=!1,rt(f)}}}function wc(e,t){let n,r;function l(s,c){return s[3]===s[23].id?a_:s_}let o=l(t),i=o(t);return{key:e,first:null,c(){n=b("div"),i.c(),r=E(),a(n,"class","flex items-center gap-3 p-3 rounded-lg border border-gray-200 hover:bg-gray-50 transition-colors"),this.first=n},m(s,c){B(s,n,c),i.m(n,null),u(n,r)},p(s,c){t=s,o===(o=l(t))&&i?i.p(t,c):(i.d(1),i=o(t),i&&(i.c(),i.m(n,r)))},d(s){s&&j(n),i.d()}}}function u_(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,m,_,y,v,w,C,x,A,M=Fe(e[7]),L=[];for(let T=0;T<M.length;T+=1)L[T]=yc(bc(e,M,T));let I=e[6]&&vc(e);function P(T,N){return T[0].length===0?o_:i_}let z=P(e),R=z(e);return{c(){t=b("section"),n=b("h2"),n.textContent="Labels",r=E(),l=b("p"),l.textContent="Create labels to organize and categorize your phrases. Labels work like GitHub labels — assign them to phrases and filter by them.",o=E(),i=b("div"),s=b("div"),c=b("input"),f=E(),d=b("div"),h=b("input"),p=E(),g=b("button"),m=F("Create"),y=E(),v=b("div");for(let T=0;T<L.length;T+=1)L[T].c();w=E(),I&&I.c(),C=E(),R.c(),a(n,"class","text-lg font-semibold text-gray-800 mb-4"),a(l,"class","text-sm text-gray-500 mb-6"),a(c,"type","text"),a(c,"placeholder","Label name"),a(c,"maxlength","50"),a(c,"class","flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(h,"type","color"),a(h,"class","w-9 h-9 rounded-md border border-gray-300 cursor-pointer"),a(h,"title","Pick color"),a(d,"class","relative"),a(s,"class","flex items-center gap-2 flex-1"),a(g,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),g.disabled=_=!e[1].trim(),a(i,"class","flex items-center gap-3 mb-6 p-4 bg-gray-50 rounded-lg border border-gray-200"),a(v,"class","flex flex-wrap gap-1.5 mb-6"),a(t,"class","max-w-2xl")},m(T,N){B(T,t,N),u(t,n),u(t,r),u(t,l),u(t,o),u(t,i),u(i,s),u(s,c),Pe(c,e[1]),u(s,f),u(s,d),u(d,h),Pe(h,e[2]),u(i,p),u(i,g),u(g,m),u(t,y),u(t,v);for(let k=0;k<L.length;k+=1)L[k]&&L[k].m(v,null);u(t,w),I&&I.m(t,null),u(t,C),R.m(t,null),x||(A=[$(c,"input",e[13]),$(c,"keydown",e[14]),$(h,"input",e[15]),$(g,"click",e[8])],x=!0)},p(T,[N]){if(N&2&&c.value!==T[1]&&Pe(c,T[1]),N&4&&Pe(h,T[2]),N&2&&_!==(_=!T[1].trim())&&(g.disabled=_),N&132){M=Fe(T[7]);let k;for(k=0;k<M.length;k+=1){const D=bc(T,M,k);L[k]?L[k].p(D,N):(L[k]=yc(D),L[k].c(),L[k].m(v,null))}for(;k<L.length;k+=1)L[k].d(1);L.length=M.length}T[6]?I?I.p(T,N):(I=vc(T),I.c(),I.m(t,C)):I&&(I.d(1),I=null),z===(z=P(T))&&R?R.p(T,N):(R.d(1),R=z(T),R&&(R.c(),R.m(t,null)))},i:je,o:je,d(T){T&&j(t),ft(L,T),I&&I.d(),R.d(),x=!1,rt(A)}}}function c_(e,t,n){let r=[],l="",o="#6366f1",i=null,s="",c="",f="";const d=["#ef4444","#f97316","#f59e0b","#84cc16","#22c55e","#14b8a6","#06b6d4","#3b82f6","#6366f1","#8b5cf6","#a855f7","#d946ef","#ec4899","#f43f5e","#64748b"];Br(h);async function h(){const z=await Ye("../api/labels");z.ok&&n(0,r=await z.json())}async function p(){if(!l.trim())return;n(6,f="");const z=await Ye("../api/labels",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.trim(),color:o})});if(z.ok)n(1,l=""),n(2,o="#6366f1"),await h();else{const R=await z.json().catch(()=>({}));n(6,f=R.error||"Failed to create label")}}function g(z){n(3,i=z.id),n(4,s=z.name),n(5,c=z.color)}async function m(){if(!s.trim())return;(await Ye(`../api/labels/${i}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.trim(),color:c})})).ok&&(n(3,i=null),await h())}function _(){n(3,i=null)}async function y(z){confirm("Delete this label? It will be removed from all phrases.")&&(await Ye(`../api/labels/${z}`,{method:"DELETE"}),await h())}function v(){l=this.value,n(1,l)}const w=z=>z.key==="Enter"&&p();function C(){o=this.value,n(2,o)}const x=z=>n(2,o=z);function A(){c=this.value,n(5,c)}function M(){s=this.value,n(4,s)}return[r,l,o,i,s,c,f,d,p,g,m,_,y,v,w,C,x,A,M,z=>{z.key==="Enter"&&m(),z.key==="Escape"&&_()},z=>g(z),z=>y(z.id)]}class f_ extends on{constructor(t){super(),ln(this,t,c_,u_,Qt,{})}}function kc(e){if(!e)throw Error("Parameter args is required");if(!e.component==!e.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(e.component&&(e.asyncComponent=()=>Promise.resolve(e.component)),typeof e.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(e.conditions){Array.isArray(e.conditions)||(e.conditions=[e.conditions]);for(let n=0;n<e.conditions.length;n++)if(!e.conditions[n]||typeof e.conditions[n]!="function")throw Error("Invalid parameter conditions["+n+"]")}return e.loadingComponent&&(e.asyncComponent.loading=e.loadingComponent,e.asyncComponent.loadingParams=e.loadingParams||void 0),{component:e.asyncComponent,userData:e.userData,conditions:e.conditions&&e.conditions.length?e.conditions:void 0,props:e.props&&Object.keys(e.props).length?e.props:{},_sveltesparouter:!0}}function d_(e){let t,n;return t=new $f({props:{routes:e[4]}}),t.$on("conditionsFailed",e[6]),t.$on("routeLoaded",e[7]),{c(){nn(t.$$.fragment)},m(r,l){Kt(t,r,l),n=!0},p:je,i(r){n||(at(t.$$.fragment,r),n=!0)},o(r){ct(t.$$.fragment,r),n=!1},d(r){qt(t,r)}}}function h_(e){let t;return{c(){t=b("div"),t.innerHTML='<div class="flex flex-col items-center gap-3"><svg width="60" height="60" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"><defs><style>@keyframes lspin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes lpulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:0.7;transform:scale(0.92)}}#lr{animation:lspin 1.2s linear infinite;transform-origin:40px 40px}#lp{animation:lpulse 2s ease-in-out infinite;transform-origin:40px 40px}</style></defs><g id="lr"><circle cx="40" cy="40" r="34" fill="none" stroke="#2a3040" stroke-width="4"></circle><path d="M40 6 A34 34 0 0 1 74 40" fill="none" stroke="#2ECC88" stroke-width="4" stroke-linecap="round"></path><path d="M74 40 A34 34 0 0 1 56 70" fill="none" stroke="#3A8FE0" stroke-width="4" stroke-linecap="round"></path><path d="M56 70 A34 34 0 0 1 24 70" fill="none" stroke="#FFB833" stroke-width="4" stroke-linecap="round"></path></g><g id="lp"><circle cx="40" cy="40" r="16" fill="#1a1f2e"></circle><circle cx="40" cy="38" r="10" fill="#2ECC88"></circle><circle cx="37" cy="37" r="2.5" fill="white"></circle><circle cx="37.5" cy="37.5" r="1.5" fill="#2C2C2A"></circle><circle cx="43" cy="37" r="2.5" fill="white"></circle><circle cx="42.5" cy="37.5" r="1.5" fill="#2C2C2A"></circle><path d="M38 41 Q40 39 42 41 Q42 44 40 45 Q38 44 38 41Z" fill="#E8A020"></path><line x1="38" y1="30" x2="36" y2="26" stroke="#FFB833" stroke-width="1.5" stroke-linecap="round"></line><line x1="40" y1="29" x2="40" y2="24" stroke="#7BC74A" stroke-width="1.5" stroke-linecap="round"></line><line x1="42" y1="30" x2="44" y2="26" stroke="#F07040" stroke-width="1.5" stroke-linecap="round"></line><circle cx="36" cy="25.5" r="1.5" fill="#FFB833"></circle><circle cx="40" cy="23.5" r="1.5" fill="#7BC74A"></circle><circle cx="44" cy="25.5" r="1.5" fill="#F07040"></circle></g></svg> <p class="text-gray-400 text-sm">Loading…</p></div>',a(t,"class","flex items-center justify-center h-full")},m(n,r){B(n,t,r)},p:je,i:je,o:je,d(n){n&&j(t)}}}function p_(e){let t,n,r,l,o,i,s,c,f,d,h;n=new nd({props:{currentView:e[2]}}),n.$on("navigate",e[5]),i=new ud({props:{projects:e[1],currentProject:e[3]}}),i.$on("switch",e[8]),i.$on("created",e[9]),i.$on("deleted",e[10]),i.$on("renamed",e[11]);const p=[h_,d_],g=[];function m(_,y){return _[0]?1:0}return f=m(e),d=g[f]=p[f](e),{c(){t=b("div"),nn(n.$$.fragment),r=E(),l=b("div"),o=b("header"),nn(i.$$.fragment),s=E(),c=b("main"),d.c(),a(o,"class","bg-white border-b border-gray-200 px-6 py-2 flex items-center justify-end gap-3 shrink-0"),a(c,"class","flex-1 p-6 overflow-auto"),a(l,"class","flex-1 flex flex-col overflow-hidden"),a(t,"class","flex min-h-screen bg-gray-100")},m(_,y){B(_,t,y),Kt(n,t,null),u(t,r),u(t,l),u(l,o),Kt(i,o,null),u(l,s),u(l,c),g[f].m(c,null),h=!0},p(_,[y]){const v={};y&4&&(v.currentView=_[2]),n.$set(v);const w={};y&2&&(w.projects=_[1]),y&8&&(w.currentProject=_[3]),i.$set(w);let C=f;f=m(_),f===C?g[f].p(_,y):(Xt(),ct(g[C],1,1,()=>{g[C]=null}),Jt(),d=g[f],d?d.p(_,y):(d=g[f]=p[f](_),d.c()),at(d,1),d.m(c,null))},i(_){h||(at(n.$$.fragment,_),at(i.$$.fragment,_),at(d),h=!0)},o(_){ct(n.$$.fragment,_),ct(i.$$.fragment,_),ct(d),h=!1},d(_){_&&j(t),qt(n),qt(i),g[f].d()}}}function g_(e,t,n){let r,l,o,i;el(e,cn,w=>n(3,o=w)),el(e,Kf,w=>n(13,i=w));let s=!1,c=[];const f={"/translations/:tab":kc({component:Js,conditions:[w=>{var C;return["pending","approved","trash"].includes((C=w.params)==null?void 0:C.tab)}]}),"/ai-translate":A0,"/analytics":l_,"/labels":f_,"/settings":O0,"*":kc({component:Js})};function d(w){const C=w.detail;if(C==="translations"){if(i.startsWith("/translations/"))return;xr("/translations/pending")}else xr(`/${C}`)}function h(){xr("/translations/pending")}function p(w){w.detail.route==="*"&&xr("/translations/pending")}Br(async()=>{(!window.location.hash||window.location.hash==="#"||window.location.hash==="#/")&&xr("/translations/pending");const w=await fetch("../api/projects");n(1,c=await w.json());const C=localStorage.getItem("loco_project_id");let x=c.find(A=>String(A.id)===C)||c[0];if(!x){n(0,s=!0);return}await g(x),n(0,s=!0)});async function g(w){Nc(w.api_key),localStorage.setItem("loco_project_id",String(w.id)),cn.set(w)}async function m(w){n(0,s=!1),await g(w.detail),n(0,s=!0)}async function _(w){n(1,c=[...c,w.detail]),n(0,s=!1),await g(w.detail),n(0,s=!0)}async function y(w){const C=w.detail;n(1,c=c.filter(x=>x.id!==C.id)),(o==null?void 0:o.id)===C.id&&(n(0,s=!1),await g(c[0]),n(0,s=!0))}async function v(w){const C=w.detail;n(1,c=c.map(x=>x.id===C.id?{...x,name:C.name}:x)),(o==null?void 0:o.id)===C.id&&cn.update(x=>({...x,name:C.name}))}return e.$$.update=()=>{e.$$.dirty&8192&&n(12,r=(i||"").split("/")[1]||"translations"),e.$$.dirty&4096&&n(2,l=r==="ai-translate"?"ai-translate":r==="settings"?"settings":r==="analytics"?"analytics":r==="labels"?"labels":"translations")},[s,c,l,o,f,d,h,p,m,_,y,v,r,i]}class m_ extends on{constructor(t){super(),ln(this,t,g_,p_,Qt,{})}}new m_({target:document.getElementById("app")});
|