@hkonda/loco-translate 1.1.0 → 1.1.1

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.
Files changed (46) hide show
  1. package/dist/assets/index-DizuFheF.js +67 -0
  2. package/dist/assets/index-Gi0NZUhz.css +1 -0
  3. package/dist/index.html +2 -2
  4. package/dist-server/app.d.ts.map +1 -1
  5. package/dist-server/app.js +25 -6
  6. package/dist-server/app.js.map +1 -1
  7. package/dist-server/db/schema.d.ts +117 -0
  8. package/dist-server/db/schema.d.ts.map +1 -1
  9. package/dist-server/db/schema.js +13 -0
  10. package/dist-server/db/schema.js.map +1 -1
  11. package/dist-server/db/seed.d.ts.map +1 -1
  12. package/dist-server/db/seed.js +12 -0
  13. package/dist-server/db/seed.js.map +1 -1
  14. package/dist-server/routes/ai-jobs.js +4 -4
  15. package/dist-server/routes/ai-jobs.js.map +1 -1
  16. package/dist-server/routes/analytics.js +13 -13
  17. package/dist-server/routes/analytics.js.map +1 -1
  18. package/dist-server/routes/aria.d.ts +5 -0
  19. package/dist-server/routes/aria.d.ts.map +1 -0
  20. package/dist-server/routes/aria.js +163 -0
  21. package/dist-server/routes/aria.js.map +1 -0
  22. package/dist-server/routes/chrome-extension.js +5 -5
  23. package/dist-server/routes/chrome-extension.js.map +1 -1
  24. package/dist-server/routes/export.js +3 -3
  25. package/dist-server/routes/export.js.map +1 -1
  26. package/dist-server/routes/labels.js +8 -8
  27. package/dist-server/routes/labels.js.map +1 -1
  28. package/dist-server/routes/languages.js +2 -2
  29. package/dist-server/routes/languages.js.map +1 -1
  30. package/dist-server/routes/project.d.ts.map +1 -1
  31. package/dist-server/routes/project.js +81 -21
  32. package/dist-server/routes/project.js.map +1 -1
  33. package/dist-server/routes/prompts.js +4 -4
  34. package/dist-server/routes/prompts.js.map +1 -1
  35. package/dist-server/routes/screenshots.js +2 -2
  36. package/dist-server/routes/screenshots.js.map +1 -1
  37. package/dist-server/routes/textnodes.js +8 -8
  38. package/dist-server/routes/textnodes.js.map +1 -1
  39. package/dist-server/routes/translations.js +5 -5
  40. package/dist-server/routes/translations.js.map +1 -1
  41. package/package.json +1 -1
  42. package/public/loco.js +102 -8
  43. package/public/loco.min.js +2 -2
  44. package/versions.json +1 -1
  45. package/dist/assets/index-C0cFDPIJ.css +0 -1
  46. package/dist/assets/index-S17yMx5_.js +0 -66
@@ -0,0 +1,67 @@
1
+ var df=Object.defineProperty;var hf=(e,t,n)=>t in e?df(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var kn=(e,t,n)=>hf(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function Be(){}function bi(e,t){for(const n in t)e[n]=t[n];return e}function nc(e){return e()}function so(){return Object.create(null)}function $e(e){e.forEach(nc)}function Ll(e){return typeof e=="function"}function Jt(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let ni;function yi(e,t){return e===t?!0:(ni||(ni=document.createElement("a")),ni.href=t,e===ni.href)}function pf(e){return Object.keys(e).length===0}function rc(e,...t){if(e==null){for(const r of t)r(void 0);return Be}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Or(e,t,n){e.$$.on_destroy.push(rc(t,n))}function Xn(e,t,n){return e.set(n),t}function c(e,t){e.appendChild(t)}function B(e,t,n){e.insertBefore(t,n||null)}function R(e){e.parentNode&&e.parentNode.removeChild(e)}function it(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 pe(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function j(e){return document.createTextNode(e)}function L(){return j(" ")}function bt(){return j("")}function Q(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function Bt(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function Nl(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 ic(e){return e===""?null:+e}function gf(e){return Array.from(e.childNodes)}function $(e,t){t=""+t,e.data!==t&&(e.data=t)}function Ee(e,t){e.value=t??""}function ct(e,t,n,r){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function pt(e,t,n){for(let r=0;r<e.options.length;r+=1){const i=e.options[r];if(i.__value===t){i.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function qt(e){const t=e.querySelector(":checked");return t&&t.__value}function ao(e,t,n){e.classList.toggle(t,!!n)}function mf(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}class lc{constructor(t=!1){kn(this,"is_svg",!1);kn(this,"e");kn(this,"n");kn(this,"t");kn(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=pe(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(R)}}function vi(e,t){return new e(t)}let Fr;function Dr(e){Fr=e}function ji(){if(!Fr)throw new Error("Function called outside component initialization");return Fr}function br(e){ji().$$.on_mount.push(e)}function _f(e){ji().$$.after_update.push(e)}function oc(e){ji().$$.on_destroy.push(e)}function zl(){const e=ji();return(t,n,{cancelable:r=!1}={})=>{const i=e.$$.callbacks[t];if(i){const l=mf(t,n,{cancelable:r});return i.slice().forEach(o=>{o.call(e,l)}),!l.defaultPrevented}return!0}}function lr(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(r=>r.call(this,t))}const tr=[],Ln=[];let or=[];const uo=[],sc=Promise.resolve();let gl=!1;function ac(){gl||(gl=!0,sc.then(uc))}function ur(){return ac(),sc}function Et(e){or.push(e)}const nl=new Set;let Qn=0;function uc(){if(Qn!==0)return;const e=Fr;do{try{for(;Qn<tr.length;){const t=tr[Qn];Qn++,Dr(t),bf(t.$$)}}catch(t){throw tr.length=0,Qn=0,t}for(Dr(null),tr.length=0,Qn=0;Ln.length;)Ln.pop()();for(let t=0;t<or.length;t+=1){const n=or[t];nl.has(n)||(nl.add(n),n())}or.length=0}while(tr.length);for(;uo.length;)uo.pop()();gl=!1,nl.clear(),Dr(e)}function bf(e){if(e.fragment!==null){e.update(),$e(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Et)}}function yf(e){const t=[],n=[];or.forEach(r=>e.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),or=t}const di=new Set;let Nn;function cr(){Nn={r:0,c:[],p:Nn}}function fr(){Nn.r||$e(Nn.c),Nn=Nn.p}function _t(e,t){e&&e.i&&(di.delete(e),e.i(t))}function kt(e,t,n,r){if(e&&e.o){if(di.has(e))return;di.add(e),Nn.c.push(()=>{di.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}function Le(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function Ui(e,t){e.d(1),t.delete(e.key)}function Hi(e,t,n,r,i,l,o,s,u,f,d,h){let g=e.length,p=l.length,_=g;const m={};for(;_--;)m[e[_].key]=_;const y=[],v=new Map,w=new Map,C=[];for(_=p;_--;){const z=h(i,l,_),E=n(z);let P=o.get(E);P?C.push(()=>P.p(z,t)):(P=f(E,z),P.c()),v.set(E,y[_]=P),E in m&&w.set(E,Math.abs(_-m[E]))}const x=new Set,A=new Set;function M(z){_t(z,1),z.m(s,d),o.set(z.key,z),d=z.first,p--}for(;g&&p;){const z=y[p-1],E=e[g-1],P=z.key,I=E.key;z===E?(d=z.first,g--,p--):v.has(I)?!o.has(P)||x.has(P)?M(z):A.has(I)?g--:w.get(P)>w.get(I)?(A.add(P),M(z)):(x.add(I),g--):(u(E,o),g--)}for(;g--;){const z=e[g];v.has(z.key)||u(z,o)}for(;p;)M(y[p-1]);return $e(C),y}function wi(e,t){const n={},r={},i={$$scope:1};let l=e.length;for(;l--;){const o=e[l],s=t[l];if(s){for(const u in o)u in s||(r[u]=1);for(const u in s)i[u]||(n[u]=s[u],i[u]=1);e[l]=s}else for(const u in o)i[u]=1}for(const o in r)o in n||(n[o]=void 0);return n}function ki(e){return typeof e=="object"&&e!==null?e:{}}function mn(e){e&&e.c()}function un(e,t,n){const{fragment:r,after_update:i}=e.$$;r&&r.m(t,n),Et(()=>{const l=e.$$.on_mount.map(nc).filter(Ll);e.$$.on_destroy?e.$$.on_destroy.push(...l):$e(l),e.$$.on_mount=[]}),i.forEach(Et)}function cn(e,t){const n=e.$$;n.fragment!==null&&(yf(n.after_update),$e(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function vf(e,t){e.$$.dirty[0]===-1&&(tr.push(e),ac(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function tn(e,t,n,r,i,l,o=null,s=[-1]){const u=Fr;Dr(e);const f=e.$$={fragment:null,ctx:[],props:l,update:Be,not_equal:i,bound:so(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:so(),dirty:s,skip_bound:!1,root:t.target||u.$$.root};o&&o(f.root);let d=!1;if(f.ctx=n?n(e,t.props||{},(h,g,...p)=>{const _=p.length?p[0]:g;return f.ctx&&i(f.ctx[h],f.ctx[h]=_)&&(!f.skip_bound&&f.bound[h]&&f.bound[h](_),d&&vf(e,h)),g}):[],f.update(),d=!0,$e(f.before_update),f.fragment=r?r(f.ctx):!1,t.target){if(t.hydrate){const h=gf(t.target);f.fragment&&f.fragment.l(h),h.forEach(R)}else f.fragment&&f.fragment.c();t.intro&&_t(e.$$.fragment),un(e,t.target,t.anchor),uc()}Dr(u)}class nn{constructor(){kn(this,"$$");kn(this,"$$set")}$destroy(){cn(this,1),this.$destroy=Be}$on(t,n){if(!Ll(n))return Be;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!pf(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const wf="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(wf);let ml=null;function cc(e){ml=e}function je(e,t={}){const n={...t.headers||{}};return ml&&(n["X-API-Key"]=ml),fetch(e,{...t,headers:n})}const $n=[];function fc(e,t){return{subscribe:Il(e,t).subscribe}}function Il(e,t=Be){let n;const r=new Set;function i(s){if(Jt(e,s)&&(e=s,n)){const u=!$n.length;for(const f of r)f[1](),$n.push(f,e);if(u){for(let f=0;f<$n.length;f+=2)$n[f][0]($n[f+1]);$n.length=0}}}function l(s){i(s(e))}function o(s,u=Be){const f=[s,u];return r.add(f),r.size===1&&(n=t(i,l)||Be),s(e),()=>{r.delete(f),r.size===0&&n&&(n(),n=null)}}return{set:i,update:l,subscribe:o}}function dc(e,t,n){const r=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=t.length<2;return fc(n,(o,s)=>{let u=!1;const f=[];let d=0,h=Be;const g=()=>{if(d)return;h();const _=t(r?f[0]:f,o,s);l?o(_):h=Ll(_)?_:Be},p=i.map((_,m)=>rc(_,y=>{f[m]=y,d&=~(1<<m),u&&g()},()=>{d|=1<<m}));return u=!0,g(),function(){$e(p),h(),u=!1}})}const Yt=Il(null);function kf(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,l,o=[],s="",u=e.split("/");for(u[0]||u.shift();i=u.shift();)n=i[0],n==="*"?(o.push("wild"),s+="/(.*)"):n===":"?(r=i.indexOf("?",1),l=i.indexOf(".",1),o.push(i.substring(1,~r?r:~l?l:i.length)),s+=~r&&!~l?"(?:/([^/]+?))?":"/([^/]+?)",~l&&(s+=(~r?"?":"")+"\\"+i.substring(l))):s+="/"+i;return{keys:o,pattern:new RegExp("^"+s+"/?$","i")}}function xf(e){let t,n,r;const i=[e[2]];var l=e[0];function o(s,u){let f={};for(let d=0;d<i.length;d+=1)f=bi(f,i[d]);return u!==void 0&&u&4&&(f=bi(f,wi(i,[ki(s[2])]))),{props:f}}return l&&(t=vi(l,o(e)),t.$on("routeEvent",e[7])),{c(){t&&mn(t.$$.fragment),n=bt()},m(s,u){t&&un(t,s,u),B(s,n,u),r=!0},p(s,u){if(u&1&&l!==(l=s[0])){if(t){cr();const f=t;kt(f.$$.fragment,1,0,()=>{cn(f,1)}),fr()}l?(t=vi(l,o(s,u)),t.$on("routeEvent",s[7]),mn(t.$$.fragment),_t(t.$$.fragment,1),un(t,n.parentNode,n)):t=null}else if(l){const f=u&4?wi(i,[ki(s[2])]):{};t.$set(f)}},i(s){r||(t&&_t(t.$$.fragment,s),r=!0)},o(s){t&&kt(t.$$.fragment,s),r=!1},d(s){s&&R(n),t&&cn(t,s)}}}function Cf(e){let t,n,r;const i=[{params:e[1]},e[2]];var l=e[0];function o(s,u){let f={};for(let d=0;d<i.length;d+=1)f=bi(f,i[d]);return u!==void 0&&u&6&&(f=bi(f,wi(i,[u&2&&{params:s[1]},u&4&&ki(s[2])]))),{props:f}}return l&&(t=vi(l,o(e)),t.$on("routeEvent",e[6])),{c(){t&&mn(t.$$.fragment),n=bt()},m(s,u){t&&un(t,s,u),B(s,n,u),r=!0},p(s,u){if(u&1&&l!==(l=s[0])){if(t){cr();const f=t;kt(f.$$.fragment,1,0,()=>{cn(f,1)}),fr()}l?(t=vi(l,o(s,u)),t.$on("routeEvent",s[6]),mn(t.$$.fragment),_t(t.$$.fragment,1),un(t,n.parentNode,n)):t=null}else if(l){const f=u&6?wi(i,[u&2&&{params:s[1]},u&4&&ki(s[2])]):{};t.$set(f)}},i(s){r||(t&&_t(t.$$.fragment,s),r=!0)},o(s){t&&kt(t.$$.fragment,s),r=!1},d(s){s&&R(n),t&&cn(t,s)}}}function Sf(e){let t,n,r,i;const l=[Cf,xf],o=[];function s(u,f){return u[1]?0:1}return t=s(e),n=o[t]=l[t](e),{c(){n.c(),r=bt()},m(u,f){o[t].m(u,f),B(u,r,f),i=!0},p(u,[f]){let d=t;t=s(u),t===d?o[t].p(u,f):(cr(),kt(o[d],1,1,()=>{o[d]=null}),fr(),n=o[t],n?n.p(u,f):(n=o[t]=l[t](u),n.c()),_t(n,1),n.m(r.parentNode,r))},i(u){i||(_t(n),i=!0)},o(u){kt(n),i=!1},d(u){u&&R(r),o[t].d(u)}}}function co(){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 Pl=fc(null,function(t){t(co());const n=()=>{t(co())};return window.addEventListener("hashchange",n,!1),function(){window.removeEventListener("hashchange",n,!1)}}),Af=dc(Pl,e=>e.location);dc(Pl,e=>e.querystring);const fo=Il(void 0);async function nr(e){if(!e||e.length<1||e.charAt(0)!="/"&&e.indexOf("#/")!==0)throw Error("Invalid parameter location");await ur(),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 Tf(e){e?window.scrollTo(e.__svelte_spa_router_scrollX,e.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function Mf(e,t,n){let{routes:r={}}=t,{prefix:i=""}=t,{restoreScrollState:l=!1}=t;class o{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:z,keys:E}=kf(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=z,this._keys=E}match(A){if(i){if(typeof i=="string")if(A.startsWith(i))A=A.substr(i.length)||"/";else return null;else if(i instanceof RegExp){const P=A.match(i);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 z={};let E=0;for(;E<this._keys.length;){try{z[this._keys[E]]=decodeURIComponent(M[E+1]||"")||null}catch{z[this._keys[E]]=null}E++}return z}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 o(A,x))}):Object.keys(r).forEach(x=>{s.push(new o(x,r[x]))});let u=null,f=null,d={};const h=zl();async function g(x,A){await ur(),h(x,A)}let p=null,_=null;l&&(_=x=>{x.state&&(x.state.__svelte_spa_router_scrollY||x.state.__svelte_spa_router_scrollX)?p=x.state:p=null},window.addEventListener("popstate",_),_f(()=>{Tf(p)}));let m=null,y=null;const v=Pl.subscribe(async x=>{m=x;let A=0;for(;A<s.length;){const M=s[A].match(x.location);if(!M){A++;continue}const z={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(z)){n(0,u=null),y=null,g("conditionsFailed",z);return}g("routeLoading",Object.assign({},z));const E=s[A].component;if(y!=E){E.loading?(n(0,u=E.loading),y=E,n(1,f=E.loadingParams),n(2,d={}),g("routeLoaded",Object.assign({},z,{component:u,name:u.name,params:f}))):(n(0,u=null),y=null);const P=await E();if(x!=m)return;n(0,u=P&&P.default||P),y=E}M&&typeof M=="object"&&Object.keys(M).length?n(1,f=M):n(1,f=null),n(2,d=s[A].props),g("routeLoaded",Object.assign({},z,{component:u,name:u.name,params:f})).then(()=>{fo.set(f)});return}n(0,u=null),y=null,fo.set(void 0)});oc(()=>{v(),_&&window.removeEventListener("popstate",_)});function w(x){lr.call(this,e,x)}function C(x){lr.call(this,e,x)}return e.$$set=x=>{"routes"in x&&n(3,r=x.routes),"prefix"in x&&n(4,i=x.prefix),"restoreScrollState"in x&&n(5,l=x.restoreScrollState)},e.$$.update=()=>{e.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[u,f,d,r,i,l,w,C]}class Ef extends nn{constructor(t){super(),tn(this,t,Mf,Sf,Jt,{routes:3,prefix:4,restoreScrollState:5})}}function ho(e,t,n){const r=e.slice();return r[5]=t[n],r}function po(e){let t,n,r=e[5].icon+"",i,l,o,s,u,f;function d(){return e[3](e[5])}return{c(){t=b("button"),n=b("span"),i=L(),l=b("span"),l.textContent=`${e[5].label}`,o=L(),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,g){B(h,t,g),c(t,n),n.innerHTML=r,c(t,i),c(t,l),c(t,o),u||(f=Q(t,"click",d),u=!0)},p(h,g){e=h,g&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&&R(t),u=!1,f()}}}function Lf(e){let t,n,r,i,l,o,s=Le(e[1]),u=[];for(let f=0;f<s.length;f+=1)u[f]=po(ho(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=L(),i=b("nav");for(let f=0;f<u.length;f+=1)u[f].c();l=L(),o=b("div"),o.textContent="Loco v1.0",a(n,"class","p-4 border-b border-gray-700"),a(i,"class","flex-1 py-4"),a(o,"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),c(t,n),c(t,r),c(t,i);for(let h=0;h<u.length;h+=1)u[h]&&u[h].m(i,null);c(t,l),c(t,o)},p(f,[d]){if(d&7){s=Le(f[1]);let h;for(h=0;h<s.length;h+=1){const g=ho(f,s,h);u[h]?u[h].p(g,d):(u[h]=po(g),u[h].c(),u[h].m(i,null))}for(;h<u.length;h+=1)u[h].d(1);u.length=s.length}},i:Be,o:Be,d(f){f&&R(t),it(u,f)}}}function Nf(e,t,n){let{currentView:r="translations"}=t;const i=zl(),l=[{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 o(u){i("navigate",u)}const s=u=>o(u.id);return e.$$set=u=>{"currentView"in u&&n(0,r=u.currentView)},[r,l,o,s]}class zf extends nn{constructor(t){super(),tn(this,t,Nf,Lf,Jt,{currentView:0})}}function go(e,t,n){const r=e.slice();return r[32]=t[n],r}function mo(e){let t,n,r,i,l,o,s,u,f,d=Le(e[0]),h=[];for(let m=0;m<d.length;m+=1)h[m]=bo(go(e,d,m));function g(m,y){return m[5]?Of:m[4]?Df:m[3]?Pf:If}let p=g(e),_=p(e);return{c(){t=b("div"),n=L(),r=b("div"),i=b("div"),i.innerHTML='<p class="text-xs text-gray-400 px-2 py-1 font-medium uppercase tracking-wide">Projects</p>',l=L(),o=b("div");for(let m=0;m<h.length;m+=1)h[m].c();s=L(),_.c(),a(t,"class","fixed inset-0 z-40"),a(i,"class","p-2 border-b border-gray-700"),a(o,"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(m,y){B(m,t,y),B(m,n,y),B(m,r,y),c(r,i),c(r,l),c(r,o);for(let v=0;v<h.length;v+=1)h[v]&&h[v].m(o,null);c(r,s),_.m(r,null),u||(f=Q(t,"click",e[13]),u=!0)},p(m,y){if(y[0]&18619){d=Le(m[0]);let v;for(v=0;v<d.length;v+=1){const w=go(m,d,v);h[v]?h[v].p(w,y):(h[v]=bo(w),h[v].c(),h[v].m(o,null))}for(;v<h.length;v+=1)h[v].d(1);h.length=d.length}p===(p=g(m))&&_?_.p(m,y):(_.d(1),_=p(m),_&&(_.c(),_.m(r,null)))},d(m){m&&(R(t),R(n),R(r)),it(h,m),_.d(),u=!1,f()}}}function _o(e){let t,n;return{c(){t=pe("svg"),n=pe("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,i){B(r,t,i),c(t,n)},d(r){r&&R(t)}}}function bo(e){var C;let t,n,r,i=e[32].name+"",l,o,s,u,f,d,h,g,p,_,m=e[32].id===((C=e[1])==null?void 0:C.id)&&_o();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"),l=j(i),o=L(),m&&m.c(),u=L(),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=L(),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>',g=L(),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),c(t,n),c(n,r),c(r,l),c(n,o),m&&m.m(n,null),c(t,u),c(t,f),c(t,d),c(t,h),c(t,g),p||(_=[Q(n,"click",y),Q(f,"click",Bt(v)),Q(h,"click",Bt(w))],p=!0)},p(x,A){var M,z;e=x,A[0]&1&&i!==(i=e[32].name+"")&&$(l,i),e[32].id===((M=e[1])==null?void 0:M.id)?m||(m=_o(),m.c(),m.m(n,null)):m&&(m.d(1),m=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===((z=e[1])==null?void 0:z.id)?"bg-indigo-600 text-white":"text-gray-300 hover:bg-gray-800 hover:text-white"))&&a(n,"class",s)},d(x){x&&R(t),m&&m.d(),p=!1,$e(_)}}}function If(e){let t,n,r,i;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(l,o){B(l,t,o),c(t,n),r||(i=Q(n,"click",e[30]),r=!0)},p:Be,d(l){l&&R(t),r=!1,i()}}}function Pf(e){let t,n,r,i,l,o,s,u,f=e[8]?"Creating…":"Create",d,h,g,p,_,m,y=e[11]&&yo(e);return{c(){t=b("div"),n=b("p"),n.textContent="New project",r=L(),y&&y.c(),i=L(),l=b("input"),o=L(),s=b("div"),u=b("button"),d=j(f),g=L(),p=b("button"),p.textContent="Cancel",a(n,"class","text-xs text-gray-400 mb-2 font-medium"),a(l,"type","text"),a(l,"placeholder","Project name"),a(l,"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"),u.disabled=h=e[8]||!e[6].trim(),a(u,"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(p,"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),c(t,n),c(t,r),y&&y.m(t,null),c(t,i),c(t,l),Ee(l,e[6]),c(t,o),c(t,s),c(s,u),c(u,d),c(s,g),c(s,p),_||(m=[Q(l,"input",e[27]),Q(l,"keydown",e[28]),Q(u,"click",e[15]),Q(p,"click",e[29])],_=!0)},p(v,w){v[11]?y?y.p(v,w):(y=yo(v),y.c(),y.m(t,i)):y&&(y.d(1),y=null),w[0]&64&&l.value!==v[6]&&Ee(l,v[6]),w[0]&256&&f!==(f=v[8]?"Creating…":"Create")&&$(d,f),w[0]&320&&h!==(h=v[8]||!v[6].trim())&&(u.disabled=h)},d(v){v&&R(t),y&&y.d(),_=!1,$e(m)}}}function Df(e){let t,n,r,i,l=e[4].name+"",o,s,u,f,d,h,g=e[9]?"Deleting…":"Delete",p,_,m,y,v,w=e[11]&&vo(e);return{c(){t=b("div"),n=b("p"),r=j("Delete "),i=b("strong"),o=j(l),s=j("? This will remove all its data."),u=L(),w&&w.c(),f=L(),d=b("div"),h=b("button"),p=j(g),_=L(),m=b("button"),m.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(m,"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),c(t,n),c(n,r),c(n,i),c(i,o),c(n,s),c(t,u),w&&w.m(t,null),c(t,f),c(t,d),c(d,h),c(h,p),c(d,_),c(d,m),y||(v=[Q(h,"click",e[25]),Q(m,"click",e[26])],y=!0)},p(C,x){x[0]&16&&l!==(l=C[4].name+"")&&$(o,l),C[11]?w?w.p(C,x):(w=vo(C),w.c(),w.m(t,f)):w&&(w.d(1),w=null),x[0]&512&&g!==(g=C[9]?"Deleting…":"Delete")&&$(p,g),x[0]&512&&(h.disabled=C[9])},d(C){C&&R(t),w&&w.d(),y=!1,$e(v)}}}function Of(e){let t,n,r,i,l=e[5].name+"",o,s,u,f,d,h,g,p=e[10]?"Saving…":"Save",_,m,y,v,w,C,x=e[11]&&wo(e);return{c(){t=b("div"),n=b("p"),r=j("Rename "),i=b("strong"),o=j(l),s=L(),x&&x.c(),u=L(),f=b("input"),d=L(),h=b("div"),g=b("button"),_=j(p),y=L(),v=b("button"),v.textContent="Cancel",a(i,"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"),g.disabled=m=e[10]||!e[7].trim(),a(g,"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),c(t,n),c(n,r),c(n,i),c(i,o),c(t,s),x&&x.m(t,null),c(t,u),c(t,f),Ee(f,e[7]),c(t,d),c(t,h),c(h,g),c(g,_),c(h,y),c(h,v),w||(C=[Q(f,"input",e[22]),Q(f,"keydown",e[23]),Q(g,"click",e[16]),Q(v,"click",e[24])],w=!0)},p(A,M){M[0]&32&&l!==(l=A[5].name+"")&&$(o,l),A[11]?x?x.p(A,M):(x=wo(A),x.c(),x.m(t,u)):x&&(x.d(1),x=null),M[0]&128&&f.value!==A[7]&&Ee(f,A[7]),M[0]&1024&&p!==(p=A[10]?"Saving…":"Save")&&$(_,p),M[0]&1152&&m!==(m=A[10]||!A[7].trim())&&(g.disabled=m)},d(A){A&&R(t),x&&x.d(),w=!1,$e(C)}}}function yo(e){let t,n;return{c(){t=b("p"),n=j(e[11]),a(t,"class","text-xs text-red-400 mb-1")},m(r,i){B(r,t,i),c(t,n)},p(r,i){i[0]&2048&&$(n,r[11])},d(r){r&&R(t)}}}function vo(e){let t,n;return{c(){t=b("p"),n=j(e[11]),a(t,"class","text-xs text-red-400 mb-1")},m(r,i){B(r,t,i),c(t,n)},p(r,i){i[0]&2048&&$(n,r[11])},d(r){r&&R(t)}}}function wo(e){let t,n;return{c(){t=b("p"),n=j(e[11]),a(t,"class","text-xs text-red-400 mb-1")},m(r,i){B(r,t,i),c(t,n)},p(r,i){i[0]&2048&&$(n,r[11])},d(r){r&&R(t)}}}function Ff(e){var y;let t,n,r,i,l,o,s=(((y=e[1])==null?void 0:y.name)??"Select project")+"",u,f,d,h,g,p,_,m=e[2]&&mo(e);return{c(){t=b("div"),n=b("button"),r=pe("svg"),i=pe("path"),l=L(),o=b("span"),u=j(s),f=L(),d=pe("svg"),h=pe("path"),g=L(),m&&m.c(),a(i,"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(o,"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),c(t,n),c(n,r),c(r,i),c(n,l),c(n,o),c(o,u),c(n,f),c(n,d),c(d,h),c(t,g),m&&m.m(t,null),p||(_=[Q(window,"keydown",e[18]),Q(n,"click",e[12])],p=!0)},p(v,w){var C;w[0]&2&&s!==(s=(((C=v[1])==null?void 0:C.name)??"Select project")+"")&&$(u,s),v[2]?m?m.p(v,w):(m=mo(v),m.c(),m.m(t,null)):m&&(m.d(1),m=null)},i:Be,o:Be,d(v){v&&R(t),m&&m.d(),p=!1,$e(_)}}}function Rf(e,t,n){let{projects:r=[]}=t,{currentProject:i=null}=t,l=!1,o=!1,s=null,u=null,f="",d="",h=!1,g=!1,p=!1,_="";const m=zl();function y(){n(2,l=!l),l||(n(3,o=!1),n(4,s=null),n(5,u=null),n(11,_=""))}function v(){n(2,l=!1),n(3,o=!1),n(4,s=null),n(5,u=null),n(11,_="")}function w(Y){if(Y.id===(i==null?void 0:i.id)){v();return}m("switch",Y),v()}async function C(){if(f.trim()){n(8,h=!0),n(11,_="");try{const Y=await fetch("../api/projects",{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":i==null?void 0:i.api_key},body:JSON.stringify({name:f.trim()})});if(!Y.ok){const Z=await Y.json();throw new Error(Z.message||"Failed")}const ie=await Y.json();n(6,f=""),n(3,o=!1),m("created",ie)}catch(Y){n(11,_=Y.message)}finally{n(8,h=!1)}}}async function x(){if(!(!d.trim()||!u)){n(10,p=!0),n(11,_="");try{const Y=await fetch("../api/project",{method:"PATCH",headers:{"Content-Type":"application/json","X-API-Key":u.api_key},body:JSON.stringify({name:d.trim()})});if(!Y.ok){const Z=await Y.json();throw new Error(Z.message||"Failed")}const ie=await Y.json();m("renamed",ie),n(5,u=null)}catch(Y){n(11,_=Y.message)}finally{n(10,p=!1)}}}async function A(Y){n(9,g=!0),n(11,_="");try{const ie=await fetch(`../api/projects/${Y.id}`,{method:"DELETE",headers:{"X-API-Key":i==null?void 0:i.api_key}});if(!ie.ok){const Z=await ie.json();throw new Error(Z.message||"Failed")}n(4,s=null),m("deleted",Y)}catch(ie){n(11,_=ie.message)}finally{n(9,g=!1)}}function M(Y){Y.key==="Escape"&&v()}const z=Y=>w(Y),E=Y=>{n(5,u=Y),n(7,d=Y.name),n(4,s=null),n(3,o=!1),n(11,_="")},P=Y=>{n(4,s=Y),n(5,u=null),n(3,o=!1),n(11,_="")};function I(){d=this.value,n(7,d)}const D=Y=>Y.key==="Enter"&&x(),T=()=>{n(5,u=null),n(11,_="")},N=()=>A(s),k=()=>{n(4,s=null),n(11,_="")};function F(){f=this.value,n(6,f)}const re=Y=>Y.key==="Enter"&&C(),V=()=>{n(3,o=!1),n(11,_="")},oe=()=>{n(3,o=!0),n(4,s=null),n(11,_="")};return e.$$set=Y=>{"projects"in Y&&n(0,r=Y.projects),"currentProject"in Y&&n(1,i=Y.currentProject)},[r,i,l,o,s,u,f,d,h,g,p,_,y,v,w,C,x,A,M,z,E,P,I,D,T,N,k,F,re,V,oe]}class Bf extends nn{constructor(t){super(),tn(this,t,Rf,Ff,Jt,{projects:0,currentProject:1},null,[-1,-1])}}function ko(e,t,n){const r=e.slice();return r[22]=t[n],r}function xo(e){let t,n,r,i=e[3]===1?"":"s",l;return{c(){t=b("span"),n=j(e[3]),r=j(" slot"),l=j(i),a(t,"class","pve-badge svelte-19itaxc")},m(o,s){B(o,t,s),c(t,n),c(t,r),c(t,l)},p(o,s){s&8&&$(n,o[3]),s&8&&i!==(i=o[3]===1?"":"s")&&$(l,i)},d(o){o&&R(t)}}}function jf(e){let t,n,r=e[22].originalText+"",i,l,o,s,u,f,d,h,g;function p(){return e[13](e[22])}return{c(){t=b("span"),n=b("span"),i=j(r),l=L(),o=b("button"),s=j("×"),f=L(),a(n,"class","pve-chip-label svelte-19itaxc"),a(o,"class","pve-chip-remove svelte-19itaxc"),a(o,"type","button"),a(o,"title",u="Remove "+e[22].kind+" slot — restores original text"),a(t,"class",d="pve-chip pve-chip--"+e[22].kind+" svelte-19itaxc")},m(_,m){B(_,t,m),c(t,n),c(n,i),c(t,l),c(t,o),c(o,s),c(t,f),h||(g=Q(o,"click",p),h=!0)},p(_,m){e=_,m&1&&r!==(r=e[22].originalText+"")&&$(i,r),m&1&&u!==(u="Remove "+e[22].kind+" slot — restores original text")&&a(o,"title",u),m&1&&d!==(d="pve-chip pve-chip--"+e[22].kind+" svelte-19itaxc")&&a(t,"class",d)},d(_){_&&R(t),h=!1,g()}}}function Uf(e){let t,n=e[22].text+"",r,i,l;function o(){return e[12](e[22])}return{c(){var s;t=b("span"),r=j(n),a(t,"class","pve-text-seg svelte-19itaxc"),ao(t,"pve-text-seg--active",((s=e[1])==null?void 0:s.segId)===e[22].id)},m(s,u){B(s,t,u),c(t,r),i||(l=Q(t,"mouseup",o),i=!0)},p(s,u){var f;e=s,u&1&&n!==(n=e[22].text+"")&&$(r,n),u&3&&ao(t,"pve-text-seg--active",((f=e[1])==null?void 0:f.segId)===e[22].id)},d(s){s&&R(t),i=!1,l()}}}function Co(e,t){let n,r;function i(s,u){return s[22].kind==="plain"?Uf:jf}let l=i(t),o=l(t);return{key:e,first:null,c(){n=bt(),o.c(),r=bt(),this.first=n},m(s,u){B(s,n,u),o.m(s,u),B(s,r,u)},p(s,u){t=s,l===(l=i(t))&&o?o.p(t,u):(o.d(1),o=l(t),o&&(o.c(),o.m(r.parentNode,r)))},d(s){s&&(R(n),R(r)),o.d(s)}}}function So(e){let t,n,r,i,l=e[1].selectedText+"",o,s,u,f,d,h,g,p,_,m,y,v,w,C;return{c(){t=b("div"),n=b("span"),r=j("Selected: "),i=b("code"),o=j(l),s=L(),u=b("div"),f=b("button"),f.textContent="Text",d=L(),h=b("button"),h.textContent="Number",g=L(),p=b("button"),p.textContent="Decimal",_=L(),m=b("button"),m.textContent="Date",y=L(),v=b("button"),v.textContent="Cancel",a(i,"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(p,"type","button"),a(p,"class","pve-btn pve-btn-decimal svelte-19itaxc"),a(m,"type","button"),a(m,"class","pve-btn pve-btn-date svelte-19itaxc"),a(v,"type","button"),a(v,"class","pve-btn pve-btn-ghost svelte-19itaxc"),a(u,"class","pve-action-bar-btns svelte-19itaxc"),a(t,"class","pve-action-bar svelte-19itaxc")},m(x,A){B(x,t,A),c(t,n),c(n,r),c(n,i),c(i,o),c(t,s),c(t,u),c(u,f),c(u,d),c(u,h),c(u,g),c(u,p),c(u,_),c(u,m),c(u,y),c(u,v),w||(C=[Q(f,"click",e[14]),Q(h,"click",e[15]),Q(p,"click",e[16]),Q(m,"click",e[17]),Q(v,"click",e[7])],w=!0)},p(x,A){A&2&&l!==(l=x[1].selectedText+"")&&$(o,l)},d(x){x&&R(t),w=!1,$e(C)}}}function Hf(e){let t,n,r,i,l,o,s=[],u=new Map,f,d,h,g,p,_,m,y,v,w,C,x,A=e[3]>0&&xo(e),M=Le(e[0]);const z=P=>P[22].id;for(let P=0;P<M.length;P+=1){let I=ko(e,M,P),D=z(I);u.set(D,s[P]=Co(D,I))}let E=e[1]&&So(e);return{c(){t=b("div"),n=b("div"),r=b("span"),r.textContent="Phrase Slot Editor",i=L(),A&&A.c(),l=L(),o=b("div");for(let P=0;P<s.length;P+=1)s[P].c();f=L(),E&&E.c(),d=L(),h=b("div"),g=b("span"),g.textContent="Resulting key",p=L(),_=b("code"),m=j(e[2]),y=L(),v=b("div"),w=b("button"),w.textContent="Save",a(r,"class","pve-title svelte-19itaxc"),a(n,"class","pve-header svelte-19itaxc"),a(o,"class","pve-canvas svelte-19itaxc"),a(g,"class","pve-preview-label svelte-19itaxc"),a(_,"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,I){B(P,t,I),c(t,n),c(n,r),c(n,i),A&&A.m(n,null),c(t,l),c(t,o);for(let D=0;D<s.length;D+=1)s[D]&&s[D].m(o,null);c(t,f),E&&E.m(t,null),c(t,d),c(t,h),c(h,g),c(h,p),c(h,_),c(_,m),c(t,y),c(t,v),c(v,w),C||(x=Q(w,"click",e[8]),C=!0)},p(P,[I]){P[3]>0?A?A.p(P,I):(A=xo(P),A.c(),A.m(n,null)):A&&(A.d(1),A=null),I&83&&(M=Le(P[0]),s=Hi(s,I,z,1,P,M,u,o,Ui,Co,null,ko)),P[1]?E?E.p(P,I):(E=So(P),E.c(),E.m(t,d)):E&&(E.d(1),E=null),I&4&&$(m,P[2])},i:Be,o:Be,d(P){P&&R(t),A&&A.d();for(let I=0;I<s.length;I+=1)s[I].d();E&&E.d(),C=!1,x()}}}const Wf=/(\{\{(?:text|number|decimal|date):\d+\}\})/g,Zf=/^\{\{(text|number|decimal|date):(\d+)\}\}$/;function Ao(e){return e.map(t=>t.text).join("")}function To(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 Yf(e,t,n){let r,i,l=0;function o(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"id-"+Date.now().toString(36)+"-"+ ++l}let{phraseKey:s=""}=t,{varSlots:u=[]}=t,{onSave:f=()=>{}}=t;function d(E){const P={};for(const D of u){const T=D.type||"text";P[`${T}:${D.index}`]=D.originalText}return E.split(Wf).filter(D=>D!=="").map(D=>{const T=D.match(Zf);if(T){const N=T[1],k=parseInt(T[2],10);return{kind:N,id:o(),slotIndex:k,originalText:P[`${N}:${k}`]??D,text:D}}return{kind:"plain",id:o(),text:D}})}let h=d(s),g=null;function p(E){if(E.kind!=="plain")return;const P=window.getSelection(),I=P?P.toString():"";if(!I){n(1,g=null);return}const D=E.text.indexOf(I);if(D===-1){n(1,g=null);return}n(1,g={segId:E.id,start:D,end:D+I.length,selectedText:I})}function _(E){if(!g)return;const{segId:P,start:I,end:D,selectedText:T}=g,N=h.findIndex(re=>re.id===P);if(N===-1){n(1,g=null);return}const k=h[N],F=[];I>0&&F.push({kind:"plain",id:o(),text:k.text.slice(0,I)}),F.push({kind:E,id:o(),slotIndex:0,originalText:T,text:`{{${E}:0}}`}),D<k.text.length&&F.push({kind:"plain",id:o(),text:k.text.slice(D)}),n(0,h=To([...h.slice(0,N),...F,...h.slice(N+1)])),n(1,g=null)}function m(E){const P=h.map(I=>I.id===E&&I.kind!=="plain"?{kind:"plain",id:o(),text:I.originalText}:I);n(0,h=To(P))}function y(){var E;n(1,g=null),(E=window.getSelection())==null||E.removeAllRanges()}function v(){const E=Ao(h),P=h.filter(I=>I.kind!=="plain").map(I=>({type:I.kind,index:I.slotIndex,originalText:I.originalText}));f(E,P)}const w=E=>p(E),C=E=>m(E.id),x=()=>_("text"),A=()=>_("number"),M=()=>_("decimal"),z=()=>_("date");return e.$$set=E=>{"phraseKey"in E&&n(9,s=E.phraseKey),"varSlots"in E&&n(10,u=E.varSlots),"onSave"in E&&n(11,f=E.onSave)},e.$$.update=()=>{e.$$.dirty&1&&n(3,r=h.filter(E=>E.kind!=="plain").length),e.$$.dirty&1&&n(2,i=Ao(h))},[h,g,i,r,p,_,m,y,v,s,u,f,w,C,x,A,M,z]}class Vf extends nn{constructor(t){super(),tn(this,t,Yf,Hf,Jt,{phraseKey:9,varSlots:10,onSave:11})}}function Mo(e,t,n){const r=e.slice();return r[16]=t[n],r[17]=t,r[18]=n,r}function Eo(e){let t,n;return{c(){t=b("span"),n=j(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,i){B(r,t,i),c(t,n)},p(r,i){i&2&&$(n,r[1])},d(r){r&&R(t)}}}function Lo(e){let t,n,r=e[16].label+"",i,l,o,s,u,f,d;function h(){e[12].call(o,e[16])}return{c(){t=b("div"),n=b("label"),i=j(r),l=L(),o=b("input"),s=L(),u=b("p"),u.textContent=`${e[16].hint}`,a(n,"class","block text-xs font-medium text-gray-700"),a(n,"for",`aria-${e[16].name}`),a(o,"id",`aria-${e[16].name}`),a(o,"type","text"),a(o,"placeholder",e[16].placeholder),a(o,"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(u,"class","mt-0.5 text-[11px] text-gray-400")},m(g,p){B(g,t,p),c(t,n),c(n,i),c(t,l),c(t,o),Ee(o,e[2][e[16].name]),c(t,s),c(t,u),f||(d=Q(o,"input",h),f=!0)},p(g,p){e=g,p&68&&o.value!==e[2][e[16].name]&&Ee(o,e[2][e[16].name])},d(g){g&&R(t),f=!1,d()}}}function No(e){let t,n;return{c(){t=b("div"),n=j(e[5]),a(t,"class","rounded border border-amber-200 bg-amber-50 px-3 py-2 text-[11px] text-amber-800")},m(r,i){B(r,t,i),c(t,n)},p(r,i){i&32&&$(n,r[5])},d(r){r&&R(t)}}}function zo(e){let t,n;return{c(){t=b("div"),n=j(e[4]),a(t,"class","rounded border border-red-200 bg-red-50 px-3 py-2 text-[11px] text-red-800")},m(r,i){B(r,t,i),c(t,n)},p(r,i){i&16&&$(n,r[4])},d(r){r&&R(t)}}}function qf(e){let t,n,r,i,l,o,s,u,f,d,h,g,p,_,m,y,v,w,C,x,A,M,z,E=e[1]&&Eo(e),P=Le(e[6]),I=[];for(let N=0;N<P.length;N+=1)I[N]=Lo(Mo(e,P,N));let D=e[5]&&No(e),T=e[4]&&zo(e);return{c(){t=b("div"),n=b("div"),r=b("span"),r.textContent="Phrase:",i=L(),l=b("span"),o=j(e[0]),s=L(),E&&E.c(),u=L(),f=b("div");for(let N=0;N<I.length;N+=1)I[N].c();d=L(),h=b("label"),g=b("input"),p=L(),_=b("span"),_.innerHTML='<span class="font-medium">aria-hidden=&quot;true&quot;</span> — hide from assistive tech (decorative)',m=L(),D&&D.c(),y=L(),T&&T.c(),v=L(),w=b("div"),C=b("button"),C.textContent="Clear all",x=L(),A=b("button"),A.textContent="Save ARIA",a(r,"class","font-medium text-gray-700"),a(l,"class","font-mono break-all"),a(n,"class","text-xs text-gray-500"),a(g,"type","checkbox"),a(g,"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),c(t,n),c(n,r),c(n,i),c(n,l),c(l,o),c(n,s),E&&E.m(n,null),c(t,u),c(t,f);for(let F=0;F<I.length;F+=1)I[F]&&I[F].m(f,null);c(f,d),c(f,h),c(h,g),g.checked=e[3],c(h,p),c(h,_),c(t,m),D&&D.m(t,null),c(t,y),T&&T.m(t,null),c(t,v),c(t,w),c(w,C),c(w,x),c(w,A),M||(z=[Q(g,"change",e[13]),Q(C,"click",e[8]),Q(A,"click",e[7])],M=!0)},p(N,[k]){if(k&1&&$(o,N[0]),N[1]?E?E.p(N,k):(E=Eo(N),E.c(),E.m(n,null)):E&&(E.d(1),E=null),k&68){P=Le(N[6]);let F;for(F=0;F<P.length;F+=1){const re=Mo(N,P,F);I[F]?I[F].p(re,k):(I[F]=Lo(re),I[F].c(),I[F].m(f,d))}for(;F<I.length;F+=1)I[F].d(1);I.length=P.length}k&8&&(g.checked=N[3]),N[5]?D?D.p(N,k):(D=No(N),D.c(),D.m(t,y)):D&&(D.d(1),D=null),N[4]?T?T.p(N,k):(T=zo(N),T.c(),T.m(t,v)):T&&(T.d(1),T=null)},i:Be,o:Be,d(N){N&&R(t),E&&E.d(),it(I,N),D&&D.d(),T&&T.d(),M=!1,$e(z)}}}function Kf(e,t,n){let r,i,l,{phraseKey:o=""}=t,{context:s=""}=t,{attributes:u={}}=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]=u&&typeof u[x.name]=="string"?u[x.name]:"";return C}let g=h(),p=!!(u&&u["aria-hidden"]==="true");function _(){const C={};for(const x of d){const A=(g[x.name]||"").trim();A&&(C[x.name]=A)}return p&&(C["aria-hidden"]="true"),C}function m(){f(_())}function y(){const C={};for(const x of d)C[x.name]="";n(2,g=C),n(3,p=!1)}function v(C){g[C.name]=this.value,n(2,g)}function w(){p=this.checked,n(3,p)}return e.$$set=C=>{"phraseKey"in C&&n(0,o=C.phraseKey),"context"in C&&n(1,s=C.context),"attributes"in C&&n(9,u=C.attributes),"onSave"in C&&n(10,f=C.onSave)},e.$$.update=()=>{e.$$.dirty&4&&n(11,r=[g["aria-labelledby"]?"aria-labelledby":null,g["aria-label"]?"aria-label":null,g.alt?"alt":null,g.title?"title":null].filter(Boolean)),e.$$.dirty&2048&&n(5,i=r.length>1?`Multiple name sources set — screen readers will use "${r[0]}" and ignore the rest.`:""),e.$$.dirty&2056&&n(4,l=p&&r.length>0?'aria-hidden="true" removes this element from the accessibility tree, so the name above will not be announced.':"")},[o,s,g,p,l,i,d,m,y,u,f,r,v,w]}class Jf extends nn{constructor(t){super(),tn(this,t,Kf,qf,Jt,{phraseKey:0,context:1,attributes:9,onSave:10})}}var ri=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ii(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 hc={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,i,l){function o(f,d){if(!i[f]){if(!r[f]){var h=typeof ii=="function"&&ii;if(!d&&h)return h(f,!0);if(s)return s(f,!0);var g=new Error("Cannot find module '"+f+"'");throw g.code="MODULE_NOT_FOUND",g}var p=i[f]={exports:{}};r[f][0].call(p.exports,function(_){var m=r[f][1][_];return o(m||_)},p,p.exports,n,r,i,l)}return i[f].exports}for(var s=typeof ii=="function"&&ii,u=0;u<l.length;u++)o(l[u]);return o}({1:[function(n,r,i){var l=n("./utils"),o=n("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(u){for(var f,d,h,g,p,_,m,y=[],v=0,w=u.length,C=w,x=l.getTypeOf(u)!=="string";v<u.length;)C=w-v,h=x?(f=u[v++],d=v<w?u[v++]:0,v<w?u[v++]:0):(f=u.charCodeAt(v++),d=v<w?u.charCodeAt(v++):0,v<w?u.charCodeAt(v++):0),g=f>>2,p=(3&f)<<4|d>>4,_=1<C?(15&d)<<2|h>>6:64,m=2<C?63&h:64,y.push(s.charAt(g)+s.charAt(p)+s.charAt(_)+s.charAt(m));return y.join("")},i.decode=function(u){var f,d,h,g,p,_,m=0,y=0,v="data:";if(u.substr(0,v.length)===v)throw new Error("Invalid base64 input, it looks like a data url.");var w,C=3*(u=u.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(u.charAt(u.length-1)===s.charAt(64)&&C--,u.charAt(u.length-2)===s.charAt(64)&&C--,C%1!=0)throw new Error("Invalid base64 input, bad content length.");for(w=o.uint8array?new Uint8Array(0|C):new Array(0|C);m<u.length;)f=s.indexOf(u.charAt(m++))<<2|(g=s.indexOf(u.charAt(m++)))>>4,d=(15&g)<<4|(p=s.indexOf(u.charAt(m++)))>>2,h=(3&p)<<6|(_=s.indexOf(u.charAt(m++))),w[y++]=f,p!==64&&(w[y++]=d),_!==64&&(w[y++]=h);return w}},{"./support":30,"./utils":32}],2:[function(n,r,i){var l=n("./external"),o=n("./stream/DataWorker"),s=n("./stream/Crc32Probe"),u=n("./stream/DataLengthProbe");function f(d,h,g,p,_){this.compressedSize=d,this.uncompressedSize=h,this.crc32=g,this.compression=p,this.compressedContent=_}f.prototype={getContentWorker:function(){var d=new o(l.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("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 o(l.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,g){return d.pipe(new s).pipe(new u("uncompressedSize")).pipe(h.compressWorker(g)).pipe(new u("compressedSize")).withStreamInfo("compression",h)},r.exports=f},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,i){var l=n("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new l("STORE compression")},uncompressWorker:function(){return new l("STORE decompression")}},i.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,i){var l=n("./utils"),o=function(){for(var s,u=[],f=0;f<256;f++){s=f;for(var d=0;d<8;d++)s=1&s?3988292384^s>>>1:s>>>1;u[f]=s}return u}();r.exports=function(s,u){return s!==void 0&&s.length?l.getTypeOf(s)!=="string"?function(f,d,h,g){var p=o,_=g+h;f^=-1;for(var m=g;m<_;m++)f=f>>>8^p[255&(f^d[m])];return-1^f}(0|u,s,s.length,0):function(f,d,h,g){var p=o,_=g+h;f^=-1;for(var m=g;m<_;m++)f=f>>>8^p[255&(f^d.charCodeAt(m))];return-1^f}(0|u,s,s.length,0):0}},{"./utils":32}],5:[function(n,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(n,r,i){var l=null;l=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:l}},{lie:37}],7:[function(n,r,i){var l=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=n("pako"),s=n("./utils"),u=n("./stream/GenericWorker"),f=l?"uint8array":"array";function d(h,g){u.call(this,"FlateWorker/"+h),this._pako=null,this._pakoAction=h,this._pakoOptions=g,this.meta={}}i.magic="\b\0",s.inherits(d,u),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(){u.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var h=this;this._pako.onData=function(g){h.push({data:g,meta:h.meta})}},i.compressWorker=function(h){return new d("Deflate",h)},i.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,i){function l(p,_){var m,y="";for(m=0;m<_;m++)y+=String.fromCharCode(255&p),p>>>=8;return y}function o(p,_,m,y,v,w){var C,x,A=p.file,M=p.compression,z=w!==f.utf8encode,E=s.transformTo("string",w(A.name)),P=s.transformTo("string",f.utf8encode(A.name)),I=A.comment,D=s.transformTo("string",w(I)),T=s.transformTo("string",f.utf8encode(I)),N=P.length!==A.name.length,k=T.length!==I.length,F="",re="",V="",oe=A.dir,Y=A.date,ie={crc32:0,compressedSize:0,uncompressedSize:0};_&&!m||(ie.crc32=p.crc32,ie.compressedSize=p.compressedSize,ie.uncompressedSize=p.uncompressedSize);var Z=0;_&&(Z|=8),z||!N&&!k||(Z|=2048);var H=0,ce=0;oe&&(H|=16),v==="UNIX"?(ce=798,H|=function(ee,_e){var fe=ee;return ee||(fe=_e?16893:33204),(65535&fe)<<16}(A.unixPermissions,oe)):(ce=20,H|=function(ee){return 63&(ee||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&&(re=l(1,1)+l(d(E),4)+P,F+="up"+l(re.length,2)+re),k&&(V=l(1,1)+l(d(D),4)+T,F+="uc"+l(V.length,2)+V);var se="";return se+=`
14
+ \0`,se+=l(Z,2),se+=M.magic,se+=l(C,2),se+=l(x,2),se+=l(ie.crc32,4),se+=l(ie.compressedSize,4),se+=l(ie.uncompressedSize,4),se+=l(E.length,2),se+=l(F.length,2),{fileRecord:h.LOCAL_FILE_HEADER+se+E+F,dirRecord:h.CENTRAL_FILE_HEADER+l(ce,2)+se+l(D.length,2)+"\0\0\0\0"+l(H,4)+l(y,4)+E+F+D}}var s=n("../utils"),u=n("../stream/GenericWorker"),f=n("../utf8"),d=n("../crc32"),h=n("../signature");function g(p,_,m,y){u.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=_,this.zipPlatform=m,this.encodeFileName=y,this.streamFiles=p,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(g,u),g.prototype.push=function(p){var _=p.meta.percent||0,m=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(p):(this.bytesWritten+=p.data.length,u.prototype.push.call(this,{data:p.data,meta:{currentFile:this.currentFile,percent:m?(_+100*(m-y-1))/m:100}}))},g.prototype.openedSource=function(p){this.currentSourceOffset=this.bytesWritten,this.currentFile=p.file.name;var _=this.streamFiles&&!p.file.dir;if(_){var m=o(p,_,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},g.prototype.closedSource=function(p){this.accumulate=!1;var _=this.streamFiles&&!p.file.dir,m=o(p,_,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),_)this.push({data:function(y){return h.DATA_DESCRIPTOR+l(y.crc32,4)+l(y.compressedSize,4)+l(y.uncompressedSize,4)}(p),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},g.prototype.flush=function(){for(var p=this.bytesWritten,_=0;_<this.dirRecords.length;_++)this.push({data:this.dirRecords[_],meta:{percent:100}});var m=this.bytesWritten-p,y=function(v,w,C,x,A){var M=s.transformTo("string",A(x));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+l(v,2)+l(v,2)+l(w,4)+l(C,4)+l(M.length,2)+M}(this.dirRecords.length,m,p,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},g.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},g.prototype.registerPrevious=function(p){this._sources.push(p);var _=this;return p.on("data",function(m){_.processChunk(m)}),p.on("end",function(){_.closedSource(_.previous.streamInfo),_._sources.length?_.prepareNextSource():_.end()}),p.on("error",function(m){_.error(m)}),this},g.prototype.resume=function(){return!!u.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},g.prototype.error=function(p){var _=this._sources;if(!u.prototype.error.call(this,p))return!1;for(var m=0;m<_.length;m++)try{_[m].error(p)}catch{}return!0},g.prototype.lock=function(){u.prototype.lock.call(this);for(var p=this._sources,_=0;_<p.length;_++)p[_].lock()},r.exports=g},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,i){var l=n("../compressions"),o=n("./ZipFileWorker");i.generateWorker=function(s,u,f){var d=new o(u.streamFiles,f,u.platform,u.encodeFileName),h=0;try{s.forEach(function(g,p){h++;var _=function(w,C){var x=w||C,A=l[x];if(!A)throw new Error(x+" is not a valid compression method !");return A}(p.options.compression,u.compression),m=p.options.compressionOptions||u.compressionOptions||{},y=p.dir,v=p.date;p._compressWorker(_,m).withStreamInfo("file",{name:g,dir:y,date:v,comment:p.comment||"",unixPermissions:p.unixPermissions,dosPermissions:p.dosPermissions}).pipe(d)}),d.entriesCount=h}catch(g){d.error(g)}return d}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,i){function l(){if(!(this instanceof l))return new l;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 o=new l;for(var s in this)typeof this[s]!="function"&&(o[s]=this[s]);return o}}(l.prototype=n("./object")).loadAsync=n("./load"),l.support=n("./support"),l.defaults=n("./defaults"),l.version="3.10.1",l.loadAsync=function(o,s){return new l().loadAsync(o,s)},l.external=n("./external"),r.exports=l},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,i){var l=n("./utils"),o=n("./external"),s=n("./utf8"),u=n("./zipEntries"),f=n("./stream/Crc32Probe"),d=n("./nodejsUtils");function h(g){return new o.Promise(function(p,_){var m=g.decompressed.getContentWorker().pipe(new f);m.on("error",function(y){_(y)}).on("end",function(){m.streamInfo.crc32!==g.decompressed.crc32?_(new Error("Corrupted zip : CRC32 mismatch")):p()}).resume()})}r.exports=function(g,p){var _=this;return p=l.extend(p||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),d.isNode&&d.isStream(g)?o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):l.prepareContent("the loaded zip file",g,!0,p.optimizedBinaryString,p.base64).then(function(m){var y=new u(p);return y.load(m),y}).then(function(m){var y=[o.Promise.resolve(m)],v=m.files;if(p.checkCRC32)for(var w=0;w<v.length;w++)y.push(h(v[w]));return o.Promise.all(y)}).then(function(m){for(var y=m.shift(),v=y.files,w=0;w<v.length;w++){var C=v[w],x=C.fileNameStr,A=l.resolve(C.fileNameStr);_.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:p.createFolders}),C.dir||(_.file(A).unsafeOriginalName=x)}return y.zipComment.length&&(_.comment=y.zipComment),_})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,i){var l=n("../utils"),o=n("../stream/GenericWorker");function s(u,f){o.call(this,"Nodejs stream input adapter for "+u),this._upstreamEnded=!1,this._bindStream(f)}l.inherits(s,o),s.prototype._bindStream=function(u){var f=this;(this._stream=u).pause(),u.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!!o.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,i){var l=n("readable-stream").Readable;function o(s,u,f){l.call(this,u),this._helper=s;var d=this;s.on("data",function(h,g){d.push(h)||d._helper.pause(),f&&f(g)}).on("error",function(h){d.emit("error",h)}).on("end",function(){d.push(null)})}n("../utils").inherits(o,l),o.prototype._read=function(){this._helper.resume()},r.exports=o},{"../utils":32,"readable-stream":16}],14:[function(n,r,i){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(l,o){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(l,o);if(typeof l=="number")throw new Error('The "data" argument must not be a number');return new Buffer(l,o)},allocBuffer:function(l){if(Buffer.alloc)return Buffer.alloc(l);var o=new Buffer(l);return o.fill(0),o},isBuffer:function(l){return Buffer.isBuffer(l)},isStream:function(l){return l&&typeof l.on=="function"&&typeof l.pause=="function"&&typeof l.resume=="function"}}},{}],15:[function(n,r,i){function l(A,M,z){var E,P=s.getTypeOf(M),I=s.extend(z||{},d);I.date=I.date||new Date,I.compression!==null&&(I.compression=I.compression.toUpperCase()),typeof I.unixPermissions=="string"&&(I.unixPermissions=parseInt(I.unixPermissions,8)),I.unixPermissions&&16384&I.unixPermissions&&(I.dir=!0),I.dosPermissions&&16&I.dosPermissions&&(I.dir=!0),I.dir&&(A=v(A)),I.createFolders&&(E=y(A))&&w.call(this,E,!0);var D=P==="string"&&I.binary===!1&&I.base64===!1;z&&z.binary!==void 0||(I.binary=!D),(M instanceof h&&M.uncompressedSize===0||I.dir||!M||M.length===0)&&(I.base64=!1,I.binary=!0,M="",I.compression="STORE",P="string");var T=null;T=M instanceof h||M instanceof u?M:_.isNode&&_.isStream(M)?new m(A,M):s.prepareContent(A,M,I.binary,I.optimizedBinaryString,I.base64);var N=new g(A,T,I);this.files[A]=N}var o=n("./utf8"),s=n("./utils"),u=n("./stream/GenericWorker"),f=n("./stream/StreamHelper"),d=n("./defaults"),h=n("./compressedObject"),g=n("./zipObject"),p=n("./generate"),_=n("./nodejsUtils"),m=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]||l.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,z,E;for(M in this.files)E=this.files[M],(z=M.slice(this.root.length,M.length))&&M.slice(0,this.root.length)===this.root&&A(z,E)},filter:function(A){var M=[];return this.forEach(function(z,E){A(z,E)&&M.push(E)}),M},file:function(A,M,z){if(arguments.length!==1)return A=this.root+A,l.call(this,A,M,z),this;if(C(A)){var E=A;return this.filter(function(I,D){return!D.dir&&E.test(I)})}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,I){return I.dir&&A.test(P)});var M=this.root+A,z=w.call(this,M),E=this.clone();return E.root=z.name,E},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 z=this.filter(function(P,I){return I.name.slice(0,A.length)===A}),E=0;E<z.length;E++)delete this.files[z[E].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,z={};try{if((z=s.extend(A||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:o.utf8encode})).type=z.type.toLowerCase(),z.compression=z.compression.toUpperCase(),z.type==="binarystring"&&(z.type="string"),!z.type)throw new Error("No output type specified.");s.checkSupport(z.type),z.platform!=="darwin"&&z.platform!=="freebsd"&&z.platform!=="linux"&&z.platform!=="sunos"||(z.platform="UNIX"),z.platform==="win32"&&(z.platform="DOS");var E=z.comment||this.comment||"";M=p.generateWorker(this,z,E)}catch(P){(M=new u("error")).error(P)}return new f(M,z.type||"string",z.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,i){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,i){var l=n("./DataReader");function o(s){l.call(this,s);for(var u=0;u<this.data.length;u++)s[u]=255&s[u]}n("../utils").inherits(o,l),o.prototype.byteAt=function(s){return this.data[this.zero+s]},o.prototype.lastIndexOfSignature=function(s){for(var u=s.charCodeAt(0),f=s.charCodeAt(1),d=s.charCodeAt(2),h=s.charCodeAt(3),g=this.length-4;0<=g;--g)if(this.data[g]===u&&this.data[g+1]===f&&this.data[g+2]===d&&this.data[g+3]===h)return g-this.zero;return-1},o.prototype.readAndCheckSignature=function(s){var u=s.charCodeAt(0),f=s.charCodeAt(1),d=s.charCodeAt(2),h=s.charCodeAt(3),g=this.readData(4);return u===g[0]&&f===g[1]&&d===g[2]&&h===g[3]},o.prototype.readData=function(s){if(this.checkOffset(s),s===0)return[];var u=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,u},r.exports=o},{"../utils":32,"./DataReader":18}],18:[function(n,r,i){var l=n("../utils");function o(s){this.data=s,this.length=s.length,this.index=0,this.zero=0}o.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 u,f=0;for(this.checkOffset(s),u=this.index+s-1;u>=this.index;u--)f=(f<<8)+this.byteAt(u);return this.index+=s,f},readString:function(s){return l.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=o},{"../utils":32}],19:[function(n,r,i){var l=n("./Uint8ArrayReader");function o(s){l.call(this,s)}n("../utils").inherits(o,l),o.prototype.readData=function(s){this.checkOffset(s);var u=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,u},r.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var l=n("./DataReader");function o(s){l.call(this,s)}n("../utils").inherits(o,l),o.prototype.byteAt=function(s){return this.data.charCodeAt(this.zero+s)},o.prototype.lastIndexOfSignature=function(s){return this.data.lastIndexOf(s)-this.zero},o.prototype.readAndCheckSignature=function(s){return s===this.readData(4)},o.prototype.readData=function(s){this.checkOffset(s);var u=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,u},r.exports=o},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var l=n("./ArrayReader");function o(s){l.call(this,s)}n("../utils").inherits(o,l),o.prototype.readData=function(s){if(this.checkOffset(s),s===0)return new Uint8Array(0);var u=this.data.subarray(this.zero+this.index,this.zero+this.index+s);return this.index+=s,u},r.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var l=n("../utils"),o=n("../support"),s=n("./ArrayReader"),u=n("./StringReader"),f=n("./NodeBufferReader"),d=n("./Uint8ArrayReader");r.exports=function(h){var g=l.getTypeOf(h);return l.checkSupport(g),g!=="string"||o.uint8array?g==="nodebuffer"?new f(h):o.uint8array?new d(l.transformTo("uint8array",h)):new s(l.transformTo("array",h)):new u(h)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,i){var l=n("./GenericWorker"),o=n("../utils");function s(u){l.call(this,"ConvertWorker to "+u),this.destType=u}o.inherits(s,l),s.prototype.processChunk=function(u){this.push({data:o.transformTo(this.destType,u.data),meta:u.meta})},r.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var l=n("./GenericWorker"),o=n("../crc32");function s(){l.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(s,l),s.prototype.processChunk=function(u){this.streamInfo.crc32=o(u.data,this.streamInfo.crc32||0),this.push(u)},r.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var l=n("../utils"),o=n("./GenericWorker");function s(u){o.call(this,"DataLengthProbe for "+u),this.propName=u,this.withStreamInfo(u,0)}l.inherits(s,o),s.prototype.processChunk=function(u){if(u){var f=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=f+u.data.length}o.prototype.processChunk.call(this,u)},r.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var l=n("../utils"),o=n("./GenericWorker");function s(u){o.call(this,"DataWorker");var f=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,u.then(function(d){f.dataIsReady=!0,f.data=d,f.max=d&&d.length||0,f.type=l.getTypeOf(d),f.isPaused||f._tickAndRepeat()},function(d){f.error(d)})}l.inherits(s,o),s.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,l.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(l.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var u=null,f=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":u=this.data.substring(this.index,f);break;case"uint8array":u=this.data.subarray(this.index,f);break;case"array":case"nodebuffer":u=this.data.slice(this.index,f)}return this.index=f,this.push({data:u,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function l(o){this.name=o||"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}l.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,s){return this._listeners[o].push(s),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,s){if(this._listeners[o])for(var u=0;u<this._listeners[o].length;u++)this._listeners[o][u].call(this,s)},pipe:function(o){return o.registerPrevious(this)},registerPrevious:function(o){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=o.streamInfo,this.mergeStreamInfo(),this.previous=o;var s=this;return o.on("data",function(u){s.processChunk(u)}),o.on("end",function(){s.end()}),o.on("error",function(u){s.error(u)}),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 o=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),o=!0),this.previous&&this.previous.resume(),!o},flush:function(){},processChunk:function(o){this.push(o)},withStreamInfo:function(o,s){return this.extraStreamInfo[o]=s,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var o in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,o)&&(this.streamInfo[o]=this.extraStreamInfo[o])},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 o="Worker "+this.name;return this.previous?this.previous+" -> "+o:o}},r.exports=l},{}],29:[function(n,r,i){var l=n("../utils"),o=n("./ConvertWorker"),s=n("./GenericWorker"),u=n("../base64"),f=n("../support"),d=n("../external"),h=null;if(f.nodestream)try{h=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function g(_,m){return new d.Promise(function(y,v){var w=[],C=_._internalType,x=_._outputType,A=_._mimeType;_.on("data",function(M,z){w.push(M),m&&m(z)}).on("error",function(M){w=[],v(M)}).on("end",function(){try{var M=function(z,E,P){switch(z){case"blob":return l.newBlob(l.transformTo("arraybuffer",E),P);case"base64":return u.encode(E);default:return l.transformTo(z,E)}}(x,function(z,E){var P,I=0,D=null,T=0;for(P=0;P<E.length;P++)T+=E[P].length;switch(z){case"string":return E.join("");case"array":return Array.prototype.concat.apply([],E);case"uint8array":for(D=new Uint8Array(T),P=0;P<E.length;P++)D.set(E[P],I),I+=E[P].length;return D;case"nodebuffer":return Buffer.concat(E);default:throw new Error("concat : unsupported type '"+z+"'")}}(C,w),A);y(M)}catch(z){v(z)}w=[]}).resume()})}function p(_,m,y){var v=m;switch(m){case"blob":case"arraybuffer":v="uint8array";break;case"base64":v="string"}try{this._internalType=v,this._outputType=m,this._mimeType=y,l.checkSupport(v),this._worker=_.pipe(new o(v)),_.lock()}catch(w){this._worker=new s("error"),this._worker.error(w)}}p.prototype={accumulate:function(_){return g(this,_)},on:function(_,m){var y=this;return _==="data"?this._worker.on(_,function(v){m.call(y,v.data,v.meta)}):this._worker.on(_,function(){l.delay(m,arguments,y)}),this},resume:function(){return l.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(_){if(l.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new h(this,{objectMode:this._outputType!=="nodebuffer"},_)}},r.exports=p},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,i){if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",i.nodebuffer=typeof Buffer<"u",i.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")i.blob=!1;else{var l=new ArrayBuffer(0);try{i.blob=new Blob([l],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(l),i.blob=o.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!n("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,i){for(var l=n("./utils"),o=n("./support"),s=n("./nodejsUtils"),u=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(){u.call(this,"utf-8 decode"),this.leftOver=null}function g(){u.call(this,"utf-8 encode")}i.utf8encode=function(p){return o.nodebuffer?s.newBufferFrom(p,"utf-8"):function(_){var m,y,v,w,C,x=_.length,A=0;for(w=0;w<x;w++)(64512&(y=_.charCodeAt(w)))==55296&&w+1<x&&(64512&(v=_.charCodeAt(w+1)))==56320&&(y=65536+(y-55296<<10)+(v-56320),w++),A+=y<128?1:y<2048?2:y<65536?3:4;for(m=o.uint8array?new Uint8Array(A):new Array(A),w=C=0;C<A;w++)(64512&(y=_.charCodeAt(w)))==55296&&w+1<x&&(64512&(v=_.charCodeAt(w+1)))==56320&&(y=65536+(y-55296<<10)+(v-56320),w++),y<128?m[C++]=y:(y<2048?m[C++]=192|y>>>6:(y<65536?m[C++]=224|y>>>12:(m[C++]=240|y>>>18,m[C++]=128|y>>>12&63),m[C++]=128|y>>>6&63),m[C++]=128|63&y);return m}(p)},i.utf8decode=function(p){return o.nodebuffer?l.transformTo("nodebuffer",p).toString("utf-8"):function(_){var m,y,v,w,C=_.length,x=new Array(2*C);for(m=y=0;m<C;)if((v=_[m++])<128)x[y++]=v;else if(4<(w=f[v]))x[y++]=65533,m+=w-1;else{for(v&=w===2?31:w===3?15:7;1<w&&m<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),l.applyFromCharCode(x)}(p=l.transformTo(o.uint8array?"uint8array":"array",p))},l.inherits(h,u),h.prototype.processChunk=function(p){var _=l.transformTo(o.uint8array?"uint8array":"array",p.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var m=_;(_=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),_.set(m,this.leftOver.length)}else _=this.leftOver.concat(_);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}(_),v=_;y!==_.length&&(o.uint8array?(v=_.subarray(0,y),this.leftOver=_.subarray(y,_.length)):(v=_.slice(0,y),this.leftOver=_.slice(y,_.length))),this.push({data:i.utf8decode(v),meta:p.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=h,l.inherits(g,u),g.prototype.processChunk=function(p){this.push({data:i.utf8encode(p.data),meta:p.meta})},i.Utf8EncodeWorker=g},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,i){var l=n("./support"),o=n("./base64"),s=n("./nodejsUtils"),u=n("./external");function f(m){return m}function d(m,y){for(var v=0;v<m.length;++v)y[v]=255&m.charCodeAt(v);return y}n("setimmediate"),i.newBlob=function(m,y){i.checkSupport("blob");try{return new Blob([m],{type:y})}catch{try{var v=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return v.append(m),v.getBlob(y)}catch{throw new Error("Bug : can't construct the Blob.")}}};var h={stringifyByChunk:function(m,y,v){var w=[],C=0,x=m.length;if(x<=v)return String.fromCharCode.apply(null,m);for(;C<x;)y==="array"||y==="nodebuffer"?w.push(String.fromCharCode.apply(null,m.slice(C,Math.min(C+v,x)))):w.push(String.fromCharCode.apply(null,m.subarray(C,Math.min(C+v,x)))),C+=v;return w.join("")},stringifyByChar:function(m){for(var y="",v=0;v<m.length;v++)y+=String.fromCharCode(m[v]);return y},applyCanBeUsed:{uint8array:function(){try{return l.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return l.nodebuffer&&String.fromCharCode.apply(null,s.allocBuffer(1)).length===1}catch{return!1}}()}};function g(m){var y=65536,v=i.getTypeOf(m),w=!0;if(v==="uint8array"?w=h.applyCanBeUsed.uint8array:v==="nodebuffer"&&(w=h.applyCanBeUsed.nodebuffer),w)for(;1<y;)try{return h.stringifyByChunk(m,v,y)}catch{y=Math.floor(y/2)}return h.stringifyByChar(m)}function p(m,y){for(var v=0;v<m.length;v++)y[v]=m[v];return y}i.applyFromCharCode=g;var _={};_.string={string:f,array:function(m){return d(m,new Array(m.length))},arraybuffer:function(m){return _.string.uint8array(m).buffer},uint8array:function(m){return d(m,new Uint8Array(m.length))},nodebuffer:function(m){return d(m,s.allocBuffer(m.length))}},_.array={string:g,array:f,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return s.newBufferFrom(m)}},_.arraybuffer={string:function(m){return g(new Uint8Array(m))},array:function(m){return p(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:f,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return s.newBufferFrom(new Uint8Array(m))}},_.uint8array={string:g,array:function(m){return p(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:f,nodebuffer:function(m){return s.newBufferFrom(m)}},_.nodebuffer={string:g,array:function(m){return p(m,new Array(m.length))},arraybuffer:function(m){return _.nodebuffer.uint8array(m).buffer},uint8array:function(m){return p(m,new Uint8Array(m.length))},nodebuffer:f},i.transformTo=function(m,y){if(y=y||"",!m)return y;i.checkSupport(m);var v=i.getTypeOf(y);return _[v][m](y)},i.resolve=function(m){for(var y=m.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("/")},i.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":l.nodebuffer&&s.isBuffer(m)?"nodebuffer":l.uint8array&&m instanceof Uint8Array?"uint8array":l.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(m){if(!l[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(m){var y,v,w="";for(v=0;v<(m||"").length;v++)w+="\\x"+((y=m.charCodeAt(v))<16?"0":"")+y.toString(16).toUpperCase();return w},i.delay=function(m,y,v){setImmediate(function(){m.apply(v||null,y||[])})},i.inherits=function(m,y){function v(){}v.prototype=y.prototype,m.prototype=new v},i.extend=function(){var m,y,v={};for(m=0;m<arguments.length;m++)for(y in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],y)&&v[y]===void 0&&(v[y]=arguments[m][y]);return v},i.prepareContent=function(m,y,v,w,C){return u.Promise.resolve(y).then(function(x){return l.blob&&(x instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(x))!==-1)&&typeof FileReader<"u"?new u.Promise(function(A,M){var z=new FileReader;z.onload=function(E){A(E.target.result)},z.onerror=function(E){M(E.target.error)},z.readAsArrayBuffer(x)}):x}).then(function(x){var A=i.getTypeOf(x);return A?(A==="arraybuffer"?x=i.transformTo("uint8array",x):A==="string"&&(C?x=o.decode(x):v&&w!==!0&&(x=function(M){return d(M,l.uint8array?new Uint8Array(M.length):new Array(M.length))}(x))),x):u.Promise.reject(new Error("Can't read the data of '"+m+"'. 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,i){var l=n("./reader/readerFor"),o=n("./utils"),s=n("./signature"),u=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 g=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(g)+", expected "+o.pretty(h)+")")}},isSignature:function(h,g){var p=this.reader.index;this.reader.setIndex(h);var _=this.reader.readString(4)===g;return this.reader.setIndex(p),_},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),g=f.uint8array?"uint8array":"array",p=o.transformTo(g,h);this.zipComment=this.loadOptions.decodeFileName(p)},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,g,p,_=this.zip64EndOfCentralSize-44;0<_;)h=this.reader.readInt(2),g=this.reader.readInt(4),p=this.reader.readData(g),this.zip64ExtensibleData[h]={id:h,length:g,value:p}},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,g;for(h=0;h<this.files.length;h++)g=this.files[h],this.reader.setIndex(g.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),g.readLocalPart(this.reader),g.handleUTF8(),g.processAttributes()},readCentralDir:function(){var h;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(h=new u({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 g=h;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.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 p=this.centralDirOffset+this.centralDirSize;this.zip64&&(p+=20,p+=12+this.zip64EndOfCentralSize);var _=g-p;if(0<_)this.isSignature(g,s.CENTRAL_FILE_HEADER)||(this.reader.zero=_);else if(_<0)throw new Error("Corrupted zip: missing "+Math.abs(_)+" bytes.")},prepareReader:function(h){this.reader=l(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,i){var l=n("./reader/readerFor"),o=n("./utils"),s=n("./compressedObject"),u=n("./crc32"),f=n("./utf8"),d=n("./compressions"),h=n("./support");function g(p,_){this.options=p,this.loadOptions=_}g.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(p){var _,m;if(p.skip(22),this.fileNameLength=p.readInt(2),m=p.readInt(2),this.fileName=p.readData(this.fileNameLength),p.skip(m),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((_=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 "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,_,p.readData(this.compressedSize))},readCentralPart:function(p){this.versionMadeBy=p.readInt(2),p.skip(2),this.bitFlag=p.readInt(2),this.compressionMethod=p.readString(2),this.date=p.readDate(),this.crc32=p.readInt(4),this.compressedSize=p.readInt(4),this.uncompressedSize=p.readInt(4);var _=p.readInt(2);if(this.extraFieldsLength=p.readInt(2),this.fileCommentLength=p.readInt(2),this.diskNumberStart=p.readInt(2),this.internalFileAttributes=p.readInt(2),this.externalFileAttributes=p.readInt(4),this.localHeaderOffset=p.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");p.skip(_),this.readExtraFields(p),this.parseZIP64ExtraField(p),this.fileComment=p.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var p=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),p==0&&(this.dosPermissions=63&this.externalFileAttributes),p==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var p=l(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=p.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=p.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=p.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=p.readInt(4))}},readExtraFields:function(p){var _,m,y,v=p.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});p.index+4<v;)_=p.readInt(2),m=p.readInt(2),y=p.readData(m),this.extraFields[_]={id:_,length:m,value:y};p.setIndex(v)},handleUTF8:function(){var p=h.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=f.utf8decode(this.fileName),this.fileCommentStr=f.utf8decode(this.fileComment);else{var _=this.findExtraFieldUnicodePath();if(_!==null)this.fileNameStr=_;else{var m=o.transformTo(p,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var v=o.transformTo(p,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(v)}}},findExtraFieldUnicodePath:function(){var p=this.extraFields[28789];if(p){var _=l(p.value);return _.readInt(1)!==1||u(this.fileName)!==_.readInt(4)?null:f.utf8decode(_.readData(p.length-5))}return null},findExtraFieldUnicodeComment:function(){var p=this.extraFields[25461];if(p){var _=l(p.value);return _.readInt(1)!==1||u(this.fileComment)!==_.readInt(4)?null:f.utf8decode(_.readData(p.length-5))}return null}},r.exports=g},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,i){function l(_,m,y){this.name=_,this.dir=y.dir,this.date=y.date,this.comment=y.comment,this.unixPermissions=y.unixPermissions,this.dosPermissions=y.dosPermissions,this._data=m,this._dataBinary=y.binary,this.options={compression:y.compression,compressionOptions:y.compressionOptions}}var o=n("./stream/StreamHelper"),s=n("./stream/DataWorker"),u=n("./utf8"),f=n("./compressedObject"),d=n("./stream/GenericWorker");l.prototype={internalStream:function(_){var m=null,y="string";try{if(!_)throw new Error("No output type specified.");var v=(y=_.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),m=this._decompressWorker();var w=!this._dataBinary;w&&!v&&(m=m.pipe(new u.Utf8EncodeWorker)),!w&&v&&(m=m.pipe(new u.Utf8DecodeWorker))}catch(C){(m=new d("error")).error(C)}return new o(m,y,"")},async:function(_,m){return this.internalStream(_).accumulate(m)},nodeStream:function(_,m){return this.internalStream(_||"nodebuffer").toNodejsStream(m)},_compressWorker:function(_,m){if(this._data instanceof f&&this._data.compression.magic===_.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new u.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"],g=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},p=0;p<h.length;p++)l.prototype[h[p]]=g;r.exports=l},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,i){(function(l){var o,s,u=l.MutationObserver||l.WebKitMutationObserver;if(u){var f=0,d=new u(_),h=l.document.createTextNode("");d.observe(h,{characterData:!0}),o=function(){h.data=f=++f%2}}else if(l.setImmediate||l.MessageChannel===void 0)o="document"in l&&"onreadystatechange"in l.document.createElement("script")?function(){var m=l.document.createElement("script");m.onreadystatechange=function(){_(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},l.document.documentElement.appendChild(m)}:function(){setTimeout(_,0)};else{var g=new l.MessageChannel;g.port1.onmessage=_,o=function(){g.port2.postMessage(0)}}var p=[];function _(){var m,y;s=!0;for(var v=p.length;v;){for(y=p,p=[],m=-1;++m<v;)y[m]();v=p.length}s=!1}r.exports=function(m){p.push(m)!==1||s||o()}}).call(this,typeof ri<"u"?ri:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,i){var l=n("immediate");function o(){}var s={},u=["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!==o&&m(this,v)}function g(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 p(v,w,C){l(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 _(v){var w=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof w=="function")return function(){w.apply(v,arguments)}}function m(v,w){var C=!1;function x(z){C||(C=!0,s.reject(v,z))}function A(z){C||(C=!0,s.resolve(v,z))}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===u)return this;var C=new this.constructor(o);return this.state!==d?p(C,this.state===f?v:w,this.outcome):this.queue.push(new g(C,v,w)),C},g.prototype.callFulfilled=function(v){s.resolve(this.promise,v)},g.prototype.otherCallFulfilled=function(v){p(this.promise,this.onFulfilled,v)},g.prototype.callRejected=function(v){s.reject(this.promise,v)},g.prototype.otherCallRejected=function(v){p(this.promise,this.onRejected,v)},s.resolve=function(v,w){var C=y(_,w);if(C.status==="error")return s.reject(v,C.value);var x=C.value;if(x)m(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=u,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(o),v)},h.reject=function(v){var w=new this(o);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,z=-1,E=new this(o);++z<C;)P(v[z],z);return E;function P(I,D){w.resolve(I).then(function(T){A[D]=T,++M!==C||x||(x=!0,s.resolve(E,A))},function(T){x||(x=!0,s.reject(E,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(o);++A<C;)z=v[A],w.resolve(z).then(function(E){x||(x=!0,s.resolve(M,E))},function(E){x||(x=!0,s.reject(M,E))});var z;return M}},{immediate:36}],38:[function(n,r,i){var l={};(0,n("./lib/utils/common").assign)(l,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=l},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,i){var l=n("./zlib/deflate"),o=n("./utils/common"),s=n("./utils/strings"),u=n("./zlib/messages"),f=n("./zlib/zstream"),d=Object.prototype.toString,h=0,g=-1,p=0,_=8;function m(v){if(!(this instanceof m))return new m(v);this.options=o.assign({level:g,method:_,chunkSize:16384,windowBits:15,memLevel:8,strategy:p,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=l.deflateInit2(this.strm,w.level,w.method,w.windowBits,w.memLevel,w.strategy);if(C!==h)throw new Error(u[C]);if(w.header&&l.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=l.deflateSetDictionary(this.strm,x))!==h)throw new Error(u[C]);this._dict_set=!0}}function y(v,w){var C=new m(w);if(C.push(v,!0),C.err)throw C.msg||u[C.err];return C.result}m.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 o.Buf8(M),A.next_out=0,A.avail_out=M),(C=l.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(o.shrinkBuf(A.output,A.next_out))):this.onData(o.shrinkBuf(A.output,A.next_out)))}while((0<A.avail_in||A.avail_out===0)&&C!==1);return x===4?(C=l.deflateEnd(this.strm),this.onEnd(C),this.ended=!0,C===h):x!==2||(this.onEnd(h),!(A.avail_out=0))},m.prototype.onData=function(v){this.chunks.push(v)},m.prototype.onEnd=function(v){v===h&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=v,this.msg=this.strm.msg},i.Deflate=m,i.deflate=y,i.deflateRaw=function(v,w){return(w=w||{}).raw=!0,y(v,w)},i.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,i){var l=n("./zlib/inflate"),o=n("./utils/common"),s=n("./utils/strings"),u=n("./zlib/constants"),f=n("./zlib/messages"),d=n("./zlib/zstream"),h=n("./zlib/gzheader"),g=Object.prototype.toString;function p(m){if(!(this instanceof p))return new p(m);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},m||{});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)||m&&m.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=l.inflateInit2(this.strm,y.windowBits);if(v!==u.Z_OK)throw new Error(f[v]);this.header=new h,l.inflateGetHeader(this.strm,this.header)}function _(m,y){var v=new p(y);if(v.push(m,!0),v.err)throw v.msg||f[v.err];return v.result}p.prototype.push=function(m,y){var v,w,C,x,A,M,z=this.strm,E=this.options.chunkSize,P=this.options.dictionary,I=!1;if(this.ended)return!1;w=y===~~y?y:y===!0?u.Z_FINISH:u.Z_NO_FLUSH,typeof m=="string"?z.input=s.binstring2buf(m):g.call(m)==="[object ArrayBuffer]"?z.input=new Uint8Array(m):z.input=m,z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0&&(z.output=new o.Buf8(E),z.next_out=0,z.avail_out=E),(v=l.inflate(z,u.Z_NO_FLUSH))===u.Z_NEED_DICT&&P&&(M=typeof P=="string"?s.string2buf(P):g.call(P)==="[object ArrayBuffer]"?new Uint8Array(P):P,v=l.inflateSetDictionary(this.strm,M)),v===u.Z_BUF_ERROR&&I===!0&&(v=u.Z_OK,I=!1),v!==u.Z_STREAM_END&&v!==u.Z_OK)return this.onEnd(v),!(this.ended=!0);z.next_out&&(z.avail_out!==0&&v!==u.Z_STREAM_END&&(z.avail_in!==0||w!==u.Z_FINISH&&w!==u.Z_SYNC_FLUSH)||(this.options.to==="string"?(C=s.utf8border(z.output,z.next_out),x=z.next_out-C,A=s.buf2string(z.output,C),z.next_out=x,z.avail_out=E-x,x&&o.arraySet(z.output,z.output,C,x,0),this.onData(A)):this.onData(o.shrinkBuf(z.output,z.next_out)))),z.avail_in===0&&z.avail_out===0&&(I=!0)}while((0<z.avail_in||z.avail_out===0)&&v!==u.Z_STREAM_END);return v===u.Z_STREAM_END&&(w=u.Z_FINISH),w===u.Z_FINISH?(v=l.inflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===u.Z_OK):w!==u.Z_SYNC_FLUSH||(this.onEnd(u.Z_OK),!(z.avail_out=0))},p.prototype.onData=function(m){this.chunks.push(m)},p.prototype.onEnd=function(m){m===u.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},i.Inflate=p,i.inflate=_,i.inflateRaw=function(m,y){return(y=y||{}).raw=!0,_(m,y)},i.ungzip=_},{"./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,i){var l=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";i.assign=function(u){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)&&(u[h]=d[h])}}return u},i.shrinkBuf=function(u,f){return u.length===f?u:u.subarray?u.subarray(0,f):(u.length=f,u)};var o={arraySet:function(u,f,d,h,g){if(f.subarray&&u.subarray)u.set(f.subarray(d,d+h),g);else for(var p=0;p<h;p++)u[g+p]=f[d+p]},flattenChunks:function(u){var f,d,h,g,p,_;for(f=h=0,d=u.length;f<d;f++)h+=u[f].length;for(_=new Uint8Array(h),f=g=0,d=u.length;f<d;f++)p=u[f],_.set(p,g),g+=p.length;return _}},s={arraySet:function(u,f,d,h,g){for(var p=0;p<h;p++)u[g+p]=f[d+p]},flattenChunks:function(u){return[].concat.apply([],u)}};i.setTyped=function(u){u?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,o)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,s))},i.setTyped(l)},{}],42:[function(n,r,i){var l=n("./common"),o=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch{o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{s=!1}for(var u=new l.Buf8(256),f=0;f<256;f++)u[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;function d(h,g){if(g<65537&&(h.subarray&&s||!h.subarray&&o))return String.fromCharCode.apply(null,l.shrinkBuf(h,g));for(var p="",_=0;_<g;_++)p+=String.fromCharCode(h[_]);return p}u[254]=u[254]=1,i.string2buf=function(h){var g,p,_,m,y,v=h.length,w=0;for(m=0;m<v;m++)(64512&(p=h.charCodeAt(m)))==55296&&m+1<v&&(64512&(_=h.charCodeAt(m+1)))==56320&&(p=65536+(p-55296<<10)+(_-56320),m++),w+=p<128?1:p<2048?2:p<65536?3:4;for(g=new l.Buf8(w),m=y=0;y<w;m++)(64512&(p=h.charCodeAt(m)))==55296&&m+1<v&&(64512&(_=h.charCodeAt(m+1)))==56320&&(p=65536+(p-55296<<10)+(_-56320),m++),p<128?g[y++]=p:(p<2048?g[y++]=192|p>>>6:(p<65536?g[y++]=224|p>>>12:(g[y++]=240|p>>>18,g[y++]=128|p>>>12&63),g[y++]=128|p>>>6&63),g[y++]=128|63&p);return g},i.buf2binstring=function(h){return d(h,h.length)},i.binstring2buf=function(h){for(var g=new l.Buf8(h.length),p=0,_=g.length;p<_;p++)g[p]=h.charCodeAt(p);return g},i.buf2string=function(h,g){var p,_,m,y,v=g||h.length,w=new Array(2*v);for(p=_=0;p<v;)if((m=h[p++])<128)w[_++]=m;else if(4<(y=u[m]))w[_++]=65533,p+=y-1;else{for(m&=y===2?31:y===3?15:7;1<y&&p<v;)m=m<<6|63&h[p++],y--;1<y?w[_++]=65533:m<65536?w[_++]=m:(m-=65536,w[_++]=55296|m>>10&1023,w[_++]=56320|1023&m)}return d(w,_)},i.utf8border=function(h,g){var p;for((g=g||h.length)>h.length&&(g=h.length),p=g-1;0<=p&&(192&h[p])==128;)p--;return p<0||p===0?g:p+u[h[p]]>g?p:g}},{"./common":41}],43:[function(n,r,i){r.exports=function(l,o,s,u){for(var f=65535&l|0,d=l>>>16&65535|0,h=0;s!==0;){for(s-=h=2e3<s?2e3:s;d=d+(f=f+o[u++]|0)|0,--h;);f%=65521,d%=65521}return f|d<<16|0}},{}],44:[function(n,r,i){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,i){var l=function(){for(var o,s=[],u=0;u<256;u++){o=u;for(var f=0;f<8;f++)o=1&o?3988292384^o>>>1:o>>>1;s[u]=o}return s}();r.exports=function(o,s,u,f){var d=l,h=f+u;o^=-1;for(var g=f;g<h;g++)o=o>>>8^d[255&(o^s[g])];return-1^o}},{}],46:[function(n,r,i){var l,o=n("../utils/common"),s=n("./trees"),u=n("./adler32"),f=n("./crc32"),d=n("./messages"),h=0,g=4,p=0,_=-2,m=-1,y=4,v=2,w=8,C=9,x=286,A=30,M=19,z=2*x+1,E=15,P=3,I=258,D=I+P+1,T=42,N=113,k=1,F=2,re=3,V=4;function oe(S,X){return S.msg=d[X],X}function Y(S){return(S<<1)-(4<S?9:0)}function ie(S){for(var X=S.length;0<=--X;)S[X]=0}function Z(S){var X=S.state,J=X.pending;J>S.avail_out&&(J=S.avail_out),J!==0&&(o.arraySet(S.output,X.pending_buf,X.pending_out,J,S.next_out),S.next_out+=J,X.pending_out+=J,S.total_out+=J,S.avail_out-=J,X.pending-=J,X.pending===0&&(X.pending_out=0))}function H(S,X){s._tr_flush_block(S,0<=S.block_start?S.block_start:-1,S.strstart-S.block_start,X),S.block_start=S.strstart,Z(S.strm)}function ce(S,X){S.pending_buf[S.pending++]=X}function se(S,X){S.pending_buf[S.pending++]=X>>>8&255,S.pending_buf[S.pending++]=255&X}function ee(S,X){var J,U,O=S.max_chain_length,W=S.strstart,le=S.prev_length,q=S.nice_match,K=S.strstart>S.w_size-D?S.strstart-(S.w_size-D):0,ne=S.window,ke=S.w_mask,ge=S.prev,Ce=S.strstart+I,Fe=ne[W+le-1],Me=ne[W+le];S.prev_length>=S.good_match&&(O>>=2),q>S.lookahead&&(q=S.lookahead);do if(ne[(J=X)+le]===Me&&ne[J+le-1]===Fe&&ne[J]===ne[W]&&ne[++J]===ne[W+1]){W+=2,J++;do;while(ne[++W]===ne[++J]&&ne[++W]===ne[++J]&&ne[++W]===ne[++J]&&ne[++W]===ne[++J]&&ne[++W]===ne[++J]&&ne[++W]===ne[++J]&&ne[++W]===ne[++J]&&ne[++W]===ne[++J]&&W<Ce);if(U=I-(Ce-W),W=Ce-I,le<U){if(S.match_start=X,q<=(le=U))break;Fe=ne[W+le-1],Me=ne[W+le]}}while((X=ge[X&ke])>K&&--O!=0);return le<=S.lookahead?le:S.lookahead}function _e(S){var X,J,U,O,W,le,q,K,ne,ke,ge=S.w_size;do{if(O=S.window_size-S.lookahead-S.strstart,S.strstart>=ge+(ge-D)){for(o.arraySet(S.window,S.window,ge,ge,0),S.match_start-=ge,S.strstart-=ge,S.block_start-=ge,X=J=S.hash_size;U=S.head[--X],S.head[X]=ge<=U?U-ge:0,--J;);for(X=J=ge;U=S.prev[--X],S.prev[X]=ge<=U?U-ge:0,--J;);O+=ge}if(S.strm.avail_in===0)break;if(le=S.strm,q=S.window,K=S.strstart+S.lookahead,ne=O,ke=void 0,ke=le.avail_in,ne<ke&&(ke=ne),J=ke===0?0:(le.avail_in-=ke,o.arraySet(q,le.input,le.next_in,ke,K),le.state.wrap===1?le.adler=u(le.adler,q,ke,K):le.state.wrap===2&&(le.adler=f(le.adler,q,ke,K)),le.next_in+=ke,le.total_in+=ke,ke),S.lookahead+=J,S.lookahead+S.insert>=P)for(W=S.strstart-S.insert,S.ins_h=S.window[W],S.ins_h=(S.ins_h<<S.hash_shift^S.window[W+1])&S.hash_mask;S.insert&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[W+P-1])&S.hash_mask,S.prev[W&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=W,W++,S.insert--,!(S.lookahead+S.insert<P)););}while(S.lookahead<D&&S.strm.avail_in!==0)}function fe(S,X){for(var J,U;;){if(S.lookahead<D){if(_e(S),S.lookahead<D&&X===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-D&&(S.match_length=ee(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&&(H(S,!1),S.strm.avail_out===0))return k}return S.insert=S.strstart<P-1?S.strstart:P-1,X===g?(H(S,!0),S.strm.avail_out===0?re:V):S.last_lit&&(H(S,!1),S.strm.avail_out===0)?k:F}function ye(S,X){for(var J,U,O;;){if(S.lookahead<D){if(_e(S),S.lookahead<D&&X===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-D&&(S.match_length=ee(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&&(H(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]))&&H(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,X===g?(H(S,!0),S.strm.avail_out===0?re:V):S.last_lit&&(H(S,!1),S.strm.avail_out===0)?k:F}function G(S,X,J,U,O){this.good_length=S,this.max_lazy=X,this.nice_length=J,this.max_chain=U,this.func=O}function de(){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 o.Buf16(2*z),this.dyn_dtree=new o.Buf16(2*(2*A+1)),this.bl_tree=new o.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 o.Buf16(E+1),this.heap=new o.Buf16(2*x+1),ie(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new o.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 X;return S&&S.state?(S.total_in=S.total_out=0,S.data_type=v,(X=S.state).pending=0,X.pending_out=0,X.wrap<0&&(X.wrap=-X.wrap),X.status=X.wrap?T:N,S.adler=X.wrap===2?0:1,X.last_flush=h,s._tr_init(X),p):oe(S,_)}function te(S){var X=ue(S);return X===p&&function(J){J.window_size=2*J.w_size,ie(J.head),J.max_lazy_match=l[J.level].max_lazy,J.good_match=l[J.level].good_length,J.nice_match=l[J.level].nice_length,J.max_chain_length=l[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),X}function Se(S,X,J,U,O,W){if(!S)return _;var le=1;if(X===m&&(X=6),U<0?(le=0,U=-U):15<U&&(le=2,U-=16),O<1||C<O||J!==w||U<8||15<U||X<0||9<X||W<0||y<W)return oe(S,_);U===8&&(U=9);var q=new de;return(S.state=q).strm=S,q.wrap=le,q.gzhead=null,q.w_bits=U,q.w_size=1<<q.w_bits,q.w_mask=q.w_size-1,q.hash_bits=O+7,q.hash_size=1<<q.hash_bits,q.hash_mask=q.hash_size-1,q.hash_shift=~~((q.hash_bits+P-1)/P),q.window=new o.Buf8(2*q.w_size),q.head=new o.Buf16(q.hash_size),q.prev=new o.Buf16(q.w_size),q.lit_bufsize=1<<O+6,q.pending_buf_size=4*q.lit_bufsize,q.pending_buf=new o.Buf8(q.pending_buf_size),q.d_buf=1*q.lit_bufsize,q.l_buf=3*q.lit_bufsize,q.level=X,q.strategy=W,q.method=J,te(S)}l=[new G(0,0,0,0,function(S,X){var J=65535;for(J>S.pending_buf_size-5&&(J=S.pending_buf_size-5);;){if(S.lookahead<=1){if(_e(S),S.lookahead===0&&X===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,H(S,!1),S.strm.avail_out===0)||S.strstart-S.block_start>=S.w_size-D&&(H(S,!1),S.strm.avail_out===0))return k}return S.insert=0,X===g?(H(S,!0),S.strm.avail_out===0?re:V):(S.strstart>S.block_start&&(H(S,!1),S.strm.avail_out),k)}),new G(4,4,8,4,fe),new G(4,5,16,8,fe),new G(4,6,32,32,fe),new G(4,4,16,16,ye),new G(8,16,32,32,ye),new G(8,16,128,128,ye),new G(8,32,128,256,ye),new G(32,128,258,1024,ye),new G(32,258,258,4096,ye)],i.deflateInit=function(S,X){return Se(S,X,w,15,8,0)},i.deflateInit2=Se,i.deflateReset=te,i.deflateResetKeep=ue,i.deflateSetHeader=function(S,X){return S&&S.state?S.state.wrap!==2?_:(S.state.gzhead=X,p):_},i.deflate=function(S,X){var J,U,O,W;if(!S||!S.state||5<X||X<0)return S?oe(S,_):_;if(U=S.state,!S.output||!S.input&&S.avail_in!==0||U.status===666&&X!==g)return oe(S,S.avail_out===0?-5:_);if(U.strm=S,J=U.last_flush,U.last_flush=X,U.status===T)if(U.wrap===2)S.adler=0,ce(U,31),ce(U,139),ce(U,8),U.gzhead?(ce(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)),ce(U,255&U.gzhead.time),ce(U,U.gzhead.time>>8&255),ce(U,U.gzhead.time>>16&255),ce(U,U.gzhead.time>>24&255),ce(U,U.level===9?2:2<=U.strategy||U.level<2?4:0),ce(U,255&U.gzhead.os),U.gzhead.extra&&U.gzhead.extra.length&&(ce(U,255&U.gzhead.extra.length),ce(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):(ce(U,0),ce(U,0),ce(U,0),ce(U,0),ce(U,0),ce(U,U.level===9?2:2<=U.strategy||U.level<2?4:0),ce(U,3),U.status=N);else{var le=w+(U.w_bits-8<<4)<<8;le|=(2<=U.strategy||U.level<2?0:U.level<6?1:U.level===6?2:3)<<6,U.strstart!==0&&(le|=32),le+=31-le%31,U.status=N,se(U,le),U.strstart!==0&&(se(U,S.adler>>>16),se(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)),Z(S),O=U.pending,U.pending!==U.pending_buf_size));)ce(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)),Z(S),O=U.pending,U.pending===U.pending_buf_size)){W=1;break}W=U.gzindex<U.gzhead.name.length?255&U.gzhead.name.charCodeAt(U.gzindex++):0,ce(U,W)}while(W!==0);U.gzhead.hcrc&&U.pending>O&&(S.adler=f(S.adler,U.pending_buf,U.pending-O,O)),W===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)),Z(S),O=U.pending,U.pending===U.pending_buf_size)){W=1;break}W=U.gzindex<U.gzhead.comment.length?255&U.gzhead.comment.charCodeAt(U.gzindex++):0,ce(U,W)}while(W!==0);U.gzhead.hcrc&&U.pending>O&&(S.adler=f(S.adler,U.pending_buf,U.pending-O,O)),W===0&&(U.status=103)}else U.status=103;if(U.status===103&&(U.gzhead.hcrc?(U.pending+2>U.pending_buf_size&&Z(S),U.pending+2<=U.pending_buf_size&&(ce(U,255&S.adler),ce(U,S.adler>>8&255),S.adler=0,U.status=N)):U.status=N),U.pending!==0){if(Z(S),S.avail_out===0)return U.last_flush=-1,p}else if(S.avail_in===0&&Y(X)<=Y(J)&&X!==g)return oe(S,-5);if(U.status===666&&S.avail_in!==0)return oe(S,-5);if(S.avail_in!==0||U.lookahead!==0||X!==h&&U.status!==666){var q=U.strategy===2?function(K,ne){for(var ke;;){if(K.lookahead===0&&(_e(K),K.lookahead===0)){if(ne===h)return k;break}if(K.match_length=0,ke=s._tr_tally(K,0,K.window[K.strstart]),K.lookahead--,K.strstart++,ke&&(H(K,!1),K.strm.avail_out===0))return k}return K.insert=0,ne===g?(H(K,!0),K.strm.avail_out===0?re:V):K.last_lit&&(H(K,!1),K.strm.avail_out===0)?k:F}(U,X):U.strategy===3?function(K,ne){for(var ke,ge,Ce,Fe,Me=K.window;;){if(K.lookahead<=I){if(_e(K),K.lookahead<=I&&ne===h)return k;if(K.lookahead===0)break}if(K.match_length=0,K.lookahead>=P&&0<K.strstart&&(ge=Me[Ce=K.strstart-1])===Me[++Ce]&&ge===Me[++Ce]&&ge===Me[++Ce]){Fe=K.strstart+I;do;while(ge===Me[++Ce]&&ge===Me[++Ce]&&ge===Me[++Ce]&&ge===Me[++Ce]&&ge===Me[++Ce]&&ge===Me[++Ce]&&ge===Me[++Ce]&&ge===Me[++Ce]&&Ce<Fe);K.match_length=I-(Fe-Ce),K.match_length>K.lookahead&&(K.match_length=K.lookahead)}if(K.match_length>=P?(ke=s._tr_tally(K,1,K.match_length-P),K.lookahead-=K.match_length,K.strstart+=K.match_length,K.match_length=0):(ke=s._tr_tally(K,0,K.window[K.strstart]),K.lookahead--,K.strstart++),ke&&(H(K,!1),K.strm.avail_out===0))return k}return K.insert=0,ne===g?(H(K,!0),K.strm.avail_out===0?re:V):K.last_lit&&(H(K,!1),K.strm.avail_out===0)?k:F}(U,X):l[U.level].func(U,X);if(q!==re&&q!==V||(U.status=666),q===k||q===re)return S.avail_out===0&&(U.last_flush=-1),p;if(q===F&&(X===1?s._tr_align(U):X!==5&&(s._tr_stored_block(U,0,0,!1),X===3&&(ie(U.head),U.lookahead===0&&(U.strstart=0,U.block_start=0,U.insert=0))),Z(S),S.avail_out===0))return U.last_flush=-1,p}return X!==g?p:U.wrap<=0?1:(U.wrap===2?(ce(U,255&S.adler),ce(U,S.adler>>8&255),ce(U,S.adler>>16&255),ce(U,S.adler>>24&255),ce(U,255&S.total_in),ce(U,S.total_in>>8&255),ce(U,S.total_in>>16&255),ce(U,S.total_in>>24&255)):(se(U,S.adler>>>16),se(U,65535&S.adler)),Z(S),0<U.wrap&&(U.wrap=-U.wrap),U.pending!==0?p:1)},i.deflateEnd=function(S){var X;return S&&S.state?(X=S.state.status)!==T&&X!==69&&X!==73&&X!==91&&X!==103&&X!==N&&X!==666?oe(S,_):(S.state=null,X===N?oe(S,-3):p):_},i.deflateSetDictionary=function(S,X){var J,U,O,W,le,q,K,ne,ke=X.length;if(!S||!S.state||(W=(J=S.state).wrap)===2||W===1&&J.status!==T||J.lookahead)return _;for(W===1&&(S.adler=u(S.adler,X,ke,0)),J.wrap=0,ke>=J.w_size&&(W===0&&(ie(J.head),J.strstart=0,J.block_start=0,J.insert=0),ne=new o.Buf8(J.w_size),o.arraySet(ne,X,ke-J.w_size,J.w_size,0),X=ne,ke=J.w_size),le=S.avail_in,q=S.next_in,K=S.input,S.avail_in=ke,S.next_in=0,S.input=X,_e(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,_e(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=q,S.input=K,S.avail_in=le,J.wrap=W,p},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,i){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,i){r.exports=function(l,o){var s,u,f,d,h,g,p,_,m,y,v,w,C,x,A,M,z,E,P,I,D,T,N,k,F;s=l.state,u=l.next_in,k=l.input,f=u+(l.avail_in-5),d=l.next_out,F=l.output,h=d-(o-l.avail_out),g=d+(l.avail_out-257),p=s.dmax,_=s.wsize,m=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,z=(1<<s.distbits)-1;e:do{C<15&&(w+=k[u++]<<C,C+=8,w+=k[u++]<<C,C+=8),E=x[w&M];t:for(;;){if(w>>>=P=E>>>24,C-=P,(P=E>>>16&255)===0)F[d++]=65535&E;else{if(!(16&P)){if(!(64&P)){E=x[(65535&E)+(w&(1<<P)-1)];continue t}if(32&P){s.mode=12;break e}l.msg="invalid literal/length code",s.mode=30;break e}I=65535&E,(P&=15)&&(C<P&&(w+=k[u++]<<C,C+=8),I+=w&(1<<P)-1,w>>>=P,C-=P),C<15&&(w+=k[u++]<<C,C+=8,w+=k[u++]<<C,C+=8),E=A[w&z];n:for(;;){if(w>>>=P=E>>>24,C-=P,!(16&(P=E>>>16&255))){if(!(64&P)){E=A[(65535&E)+(w&(1<<P)-1)];continue n}l.msg="invalid distance code",s.mode=30;break e}if(D=65535&E,C<(P&=15)&&(w+=k[u++]<<C,(C+=8)<P&&(w+=k[u++]<<C,C+=8)),p<(D+=w&(1<<P)-1)){l.msg="invalid distance too far back",s.mode=30;break e}if(w>>>=P,C-=P,(P=d-h)<D){if(m<(P=D-P)&&s.sane){l.msg="invalid distance too far back",s.mode=30;break e}if(N=v,(T=0)===y){if(T+=_-P,P<I){for(I-=P;F[d++]=v[T++],--P;);T=d-D,N=F}}else if(y<P){if(T+=_+y-P,(P-=y)<I){for(I-=P;F[d++]=v[T++],--P;);if(T=0,y<I){for(I-=P=y;F[d++]=v[T++],--P;);T=d-D,N=F}}}else if(T+=y-P,P<I){for(I-=P;F[d++]=v[T++],--P;);T=d-D,N=F}for(;2<I;)F[d++]=N[T++],F[d++]=N[T++],F[d++]=N[T++],I-=3;I&&(F[d++]=N[T++],1<I&&(F[d++]=N[T++]))}else{for(T=d-D;F[d++]=F[T++],F[d++]=F[T++],F[d++]=F[T++],2<(I-=3););I&&(F[d++]=F[T++],1<I&&(F[d++]=F[T++]))}break}}break}}while(u<f&&d<g);u-=I=C>>3,w&=(1<<(C-=I<<3))-1,l.next_in=u,l.next_out=d,l.avail_in=u<f?f-u+5:5-(u-f),l.avail_out=d<g?g-d+257:257-(d-g),s.hold=w,s.bits=C}},{}],49:[function(n,r,i){var l=n("../utils/common"),o=n("./adler32"),s=n("./crc32"),u=n("./inffast"),f=n("./inftrees"),d=1,h=2,g=0,p=-2,_=1,m=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 l.Buf16(320),this.work=new l.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=_,N.last=0,N.havedict=0,N.dmax=32768,N.head=null,N.hold=0,N.bits=0,N.lencode=N.lendyn=new l.Buf32(m),N.distcode=N.distdyn=new l.Buf32(y),N.sane=1,N.back=-1,g):p}function x(T){var N;return T&&T.state?((N=T.state).wsize=0,N.whave=0,N.wnext=0,C(T)):p}function A(T,N){var k,F;return T&&T.state?(F=T.state,N<0?(k=0,N=-N):(k=1+(N>>4),N<48&&(N&=15)),N&&(N<8||15<N)?p:(F.window!==null&&F.wbits!==N&&(F.window=null),F.wrap=k,F.wbits=N,x(T))):p}function M(T,N){var k,F;return T?(F=new w,(T.state=F).window=null,(k=A(T,N))!==g&&(T.state=null),k):p}var z,E,P=!0;function I(T){if(P){var N;for(z=new l.Buf32(512),E=new l.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,z,0,T.work,{bits:9}),N=0;N<32;)T.lens[N++]=5;f(h,T.lens,0,32,E,0,T.work,{bits:5}),P=!1}T.lencode=z,T.lenbits=9,T.distcode=E,T.distbits=5}function D(T,N,k,F){var re,V=T.state;return V.window===null&&(V.wsize=1<<V.wbits,V.wnext=0,V.whave=0,V.window=new l.Buf8(V.wsize)),F>=V.wsize?(l.arraySet(V.window,N,k-V.wsize,V.wsize,0),V.wnext=0,V.whave=V.wsize):(F<(re=V.wsize-V.wnext)&&(re=F),l.arraySet(V.window,N,k-F,re,V.wnext),(F-=re)?(l.arraySet(V.window,N,k-F,F,0),V.wnext=F,V.whave=V.wsize):(V.wnext+=re,V.wnext===V.wsize&&(V.wnext=0),V.whave<V.wsize&&(V.whave+=re))),0}i.inflateReset=x,i.inflateReset2=A,i.inflateResetKeep=C,i.inflateInit=function(T){return M(T,15)},i.inflateInit2=M,i.inflate=function(T,N){var k,F,re,V,oe,Y,ie,Z,H,ce,se,ee,_e,fe,ye,G,de,ue,te,Se,S,X,J,U,O=0,W=new l.Buf8(4),le=[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 p;(k=T.state).mode===12&&(k.mode=13),oe=T.next_out,re=T.output,ie=T.avail_out,V=T.next_in,F=T.input,Y=T.avail_in,Z=k.hold,H=k.bits,ce=Y,se=ie,X=g;e:for(;;)switch(k.mode){case _:if(k.wrap===0){k.mode=13;break}for(;H<16;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}if(2&k.wrap&&Z===35615){W[k.check=0]=255&Z,W[1]=Z>>>8&255,k.check=s(k.check,W,2,0),H=Z=0,k.mode=2;break}if(k.flags=0,k.head&&(k.head.done=!1),!(1&k.wrap)||(((255&Z)<<8)+(Z>>8))%31){T.msg="incorrect header check",k.mode=30;break}if((15&Z)!=8){T.msg="unknown compression method",k.mode=30;break}if(H-=4,S=8+(15&(Z>>>=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&Z?10:12,H=Z=0;break;case 2:for(;H<16;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}if(k.flags=Z,(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=Z>>8&1),512&k.flags&&(W[0]=255&Z,W[1]=Z>>>8&255,k.check=s(k.check,W,2,0)),H=Z=0,k.mode=3;case 3:for(;H<32;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}k.head&&(k.head.time=Z),512&k.flags&&(W[0]=255&Z,W[1]=Z>>>8&255,W[2]=Z>>>16&255,W[3]=Z>>>24&255,k.check=s(k.check,W,4,0)),H=Z=0,k.mode=4;case 4:for(;H<16;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}k.head&&(k.head.xflags=255&Z,k.head.os=Z>>8),512&k.flags&&(W[0]=255&Z,W[1]=Z>>>8&255,k.check=s(k.check,W,2,0)),H=Z=0,k.mode=5;case 5:if(1024&k.flags){for(;H<16;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}k.length=Z,k.head&&(k.head.extra_len=Z),512&k.flags&&(W[0]=255&Z,W[1]=Z>>>8&255,k.check=s(k.check,W,2,0)),H=Z=0}else k.head&&(k.head.extra=null);k.mode=6;case 6:if(1024&k.flags&&(Y<(ee=k.length)&&(ee=Y),ee&&(k.head&&(S=k.head.extra_len-k.length,k.head.extra||(k.head.extra=new Array(k.head.extra_len)),l.arraySet(k.head.extra,F,V,ee,S)),512&k.flags&&(k.check=s(k.check,F,ee,V)),Y-=ee,V+=ee,k.length-=ee),k.length))break e;k.length=0,k.mode=7;case 7:if(2048&k.flags){if(Y===0)break e;for(ee=0;S=F[V+ee++],k.head&&S&&k.length<65536&&(k.head.name+=String.fromCharCode(S)),S&&ee<Y;);if(512&k.flags&&(k.check=s(k.check,F,ee,V)),Y-=ee,V+=ee,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(ee=0;S=F[V+ee++],k.head&&S&&k.length<65536&&(k.head.comment+=String.fromCharCode(S)),S&&ee<Y;);if(512&k.flags&&(k.check=s(k.check,F,ee,V)),Y-=ee,V+=ee,S)break e}else k.head&&(k.head.comment=null);k.mode=9;case 9:if(512&k.flags){for(;H<16;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}if(Z!==(65535&k.check)){T.msg="header crc mismatch",k.mode=30;break}H=Z=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(;H<32;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}T.adler=k.check=v(Z),H=Z=0,k.mode=11;case 11:if(k.havedict===0)return T.next_out=oe,T.avail_out=ie,T.next_in=V,T.avail_in=Y,k.hold=Z,k.bits=H,2;T.adler=k.check=1,k.mode=12;case 12:if(N===5||N===6)break e;case 13:if(k.last){Z>>>=7&H,H-=7&H,k.mode=27;break}for(;H<3;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}switch(k.last=1&Z,H-=1,3&(Z>>>=1)){case 0:k.mode=14;break;case 1:if(I(k),k.mode=20,N!==6)break;Z>>>=2,H-=2;break e;case 2:k.mode=17;break;case 3:T.msg="invalid block type",k.mode=30}Z>>>=2,H-=2;break;case 14:for(Z>>>=7&H,H-=7&H;H<32;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}if((65535&Z)!=(Z>>>16^65535)){T.msg="invalid stored block lengths",k.mode=30;break}if(k.length=65535&Z,H=Z=0,k.mode=15,N===6)break e;case 15:k.mode=16;case 16:if(ee=k.length){if(Y<ee&&(ee=Y),ie<ee&&(ee=ie),ee===0)break e;l.arraySet(re,F,V,ee,oe),Y-=ee,V+=ee,ie-=ee,oe+=ee,k.length-=ee;break}k.mode=12;break;case 17:for(;H<14;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}if(k.nlen=257+(31&Z),Z>>>=5,H-=5,k.ndist=1+(31&Z),Z>>>=5,H-=5,k.ncode=4+(15&Z),Z>>>=4,H-=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(;H<3;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}k.lens[le[k.have++]]=7&Z,Z>>>=3,H-=3}for(;k.have<19;)k.lens[le[k.have++]]=0;if(k.lencode=k.lendyn,k.lenbits=7,J={bits:k.lenbits},X=f(0,k.lens,0,19,k.lencode,0,k.work,J),k.lenbits=J.bits,X){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(;G=(O=k.lencode[Z&(1<<k.lenbits)-1])>>>16&255,de=65535&O,!((ye=O>>>24)<=H);){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}if(de<16)Z>>>=ye,H-=ye,k.lens[k.have++]=de;else{if(de===16){for(U=ye+2;H<U;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}if(Z>>>=ye,H-=ye,k.have===0){T.msg="invalid bit length repeat",k.mode=30;break}S=k.lens[k.have-1],ee=3+(3&Z),Z>>>=2,H-=2}else if(de===17){for(U=ye+3;H<U;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}H-=ye,S=0,ee=3+(7&(Z>>>=ye)),Z>>>=3,H-=3}else{for(U=ye+7;H<U;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}H-=ye,S=0,ee=11+(127&(Z>>>=ye)),Z>>>=7,H-=7}if(k.have+ee>k.nlen+k.ndist){T.msg="invalid bit length repeat",k.mode=30;break}for(;ee--;)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},X=f(d,k.lens,0,k.nlen,k.lencode,0,k.work,J),k.lenbits=J.bits,X){T.msg="invalid literal/lengths set",k.mode=30;break}if(k.distbits=6,k.distcode=k.distdyn,J={bits:k.distbits},X=f(h,k.lens,k.nlen,k.ndist,k.distcode,0,k.work,J),k.distbits=J.bits,X){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=oe,T.avail_out=ie,T.next_in=V,T.avail_in=Y,k.hold=Z,k.bits=H,u(T,se),oe=T.next_out,re=T.output,ie=T.avail_out,V=T.next_in,F=T.input,Y=T.avail_in,Z=k.hold,H=k.bits,k.mode===12&&(k.back=-1);break}for(k.back=0;G=(O=k.lencode[Z&(1<<k.lenbits)-1])>>>16&255,de=65535&O,!((ye=O>>>24)<=H);){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}if(G&&!(240&G)){for(ue=ye,te=G,Se=de;G=(O=k.lencode[Se+((Z&(1<<ue+te)-1)>>ue)])>>>16&255,de=65535&O,!(ue+(ye=O>>>24)<=H);){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}Z>>>=ue,H-=ue,k.back+=ue}if(Z>>>=ye,H-=ye,k.back+=ye,k.length=de,G===0){k.mode=26;break}if(32&G){k.back=-1,k.mode=12;break}if(64&G){T.msg="invalid literal/length code",k.mode=30;break}k.extra=15&G,k.mode=22;case 22:if(k.extra){for(U=k.extra;H<U;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}k.length+=Z&(1<<k.extra)-1,Z>>>=k.extra,H-=k.extra,k.back+=k.extra}k.was=k.length,k.mode=23;case 23:for(;G=(O=k.distcode[Z&(1<<k.distbits)-1])>>>16&255,de=65535&O,!((ye=O>>>24)<=H);){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}if(!(240&G)){for(ue=ye,te=G,Se=de;G=(O=k.distcode[Se+((Z&(1<<ue+te)-1)>>ue)])>>>16&255,de=65535&O,!(ue+(ye=O>>>24)<=H);){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}Z>>>=ue,H-=ue,k.back+=ue}if(Z>>>=ye,H-=ye,k.back+=ye,64&G){T.msg="invalid distance code",k.mode=30;break}k.offset=de,k.extra=15&G,k.mode=24;case 24:if(k.extra){for(U=k.extra;H<U;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}k.offset+=Z&(1<<k.extra)-1,Z>>>=k.extra,H-=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(ee=se-ie,k.offset>ee){if((ee=k.offset-ee)>k.whave&&k.sane){T.msg="invalid distance too far back",k.mode=30;break}_e=ee>k.wnext?(ee-=k.wnext,k.wsize-ee):k.wnext-ee,ee>k.length&&(ee=k.length),fe=k.window}else fe=re,_e=oe-k.offset,ee=k.length;for(ie<ee&&(ee=ie),ie-=ee,k.length-=ee;re[oe++]=fe[_e++],--ee;);k.length===0&&(k.mode=21);break;case 26:if(ie===0)break e;re[oe++]=k.length,ie--,k.mode=21;break;case 27:if(k.wrap){for(;H<32;){if(Y===0)break e;Y--,Z|=F[V++]<<H,H+=8}if(se-=ie,T.total_out+=se,k.total+=se,se&&(T.adler=k.check=k.flags?s(k.check,re,se,oe-se):o(k.check,re,se,oe-se)),se=ie,(k.flags?Z:v(Z))!==k.check){T.msg="incorrect data check",k.mode=30;break}H=Z=0}k.mode=28;case 28:if(k.wrap&&k.flags){for(;H<32;){if(Y===0)break e;Y--,Z+=F[V++]<<H,H+=8}if(Z!==(4294967295&k.total)){T.msg="incorrect length check",k.mode=30;break}H=Z=0}k.mode=29;case 29:X=1;break e;case 30:X=-3;break e;case 31:return-4;case 32:default:return p}return T.next_out=oe,T.avail_out=ie,T.next_in=V,T.avail_in=Y,k.hold=Z,k.bits=H,(k.wsize||se!==T.avail_out&&k.mode<30&&(k.mode<27||N!==4))&&D(T,T.output,T.next_out,se-T.avail_out)?(k.mode=31,-4):(ce-=T.avail_in,se-=T.avail_out,T.total_in+=ce,T.total_out+=se,k.total+=se,k.wrap&&se&&(T.adler=k.check=k.flags?s(k.check,re,se,T.next_out-se):o(k.check,re,se,T.next_out-se)),T.data_type=k.bits+(k.last?64:0)+(k.mode===12?128:0)+(k.mode===20||k.mode===15?256:0),(ce==0&&se===0||N===4)&&X===g&&(X=-5),X)},i.inflateEnd=function(T){if(!T||!T.state)return p;var N=T.state;return N.window&&(N.window=null),T.state=null,g},i.inflateGetHeader=function(T,N){var k;return T&&T.state&&2&(k=T.state).wrap?((k.head=N).done=!1,g):p},i.inflateSetDictionary=function(T,N){var k,F=N.length;return T&&T.state?(k=T.state).wrap!==0&&k.mode!==11?p:k.mode===11&&o(1,N,F,0)!==k.check?-3:D(T,N,F,F)?(k.mode=31,-4):(k.havedict=1,g):p},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,i){var l=n("../utils/common"),o=[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],u=[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,g,p,_,m,y,v){var w,C,x,A,M,z,E,P,I,D=v.bits,T=0,N=0,k=0,F=0,re=0,V=0,oe=0,Y=0,ie=0,Z=0,H=null,ce=0,se=new l.Buf16(16),ee=new l.Buf16(16),_e=null,fe=0;for(T=0;T<=15;T++)se[T]=0;for(N=0;N<p;N++)se[h[g+N]]++;for(re=D,F=15;1<=F&&se[F]===0;F--);if(F<re&&(re=F),F===0)return _[m++]=20971520,_[m++]=20971520,v.bits=1,0;for(k=1;k<F&&se[k]===0;k++);for(re<k&&(re=k),T=Y=1;T<=15;T++)if(Y<<=1,(Y-=se[T])<0)return-1;if(0<Y&&(d===0||F!==1))return-1;for(ee[1]=0,T=1;T<15;T++)ee[T+1]=ee[T]+se[T];for(N=0;N<p;N++)h[g+N]!==0&&(y[ee[h[g+N]]++]=N);if(z=d===0?(H=_e=y,19):d===1?(H=o,ce-=257,_e=s,fe-=257,256):(H=u,_e=f,-1),T=k,M=m,oe=N=Z=0,x=-1,A=(ie=1<<(V=re))-1,d===1&&852<ie||d===2&&592<ie)return 1;for(;;){for(E=T-oe,I=y[N]<z?(P=0,y[N]):y[N]>z?(P=_e[fe+y[N]],H[ce+y[N]]):(P=96,0),w=1<<T-oe,k=C=1<<V;_[M+(Z>>oe)+(C-=w)]=E<<24|P<<16|I|0,C!==0;);for(w=1<<T-1;Z&w;)w>>=1;if(w!==0?(Z&=w-1,Z+=w):Z=0,N++,--se[T]==0){if(T===F)break;T=h[g+y[N]]}if(re<T&&(Z&A)!==x){for(oe===0&&(oe=re),M+=k,Y=1<<(V=T-oe);V+oe<F&&!((Y-=se[V+oe])<=0);)V++,Y<<=1;if(ie+=1<<V,d===1&&852<ie||d===2&&592<ie)return 1;_[x=Z&A]=re<<24|V<<16|M-m|0}}return Z!==0&&(_[M+Z]=T-oe<<24|64<<16|0),v.bits=re,0}},{"../utils/common":41}],51:[function(n,r,i){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,i){var l=n("../utils/common"),o=0,s=1;function u(O){for(var W=O.length;0<=--W;)O[W]=0}var f=0,d=29,h=256,g=h+1+d,p=30,_=19,m=2*g+1,y=15,v=16,w=7,C=256,x=16,A=17,M=18,z=[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],E=[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],I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],D=new Array(2*(g+2));u(D);var T=new Array(2*p);u(T);var N=new Array(512);u(N);var k=new Array(256);u(k);var F=new Array(d);u(F);var re,V,oe,Y=new Array(p);function ie(O,W,le,q,K){this.static_tree=O,this.extra_bits=W,this.extra_base=le,this.elems=q,this.max_length=K,this.has_stree=O&&O.length}function Z(O,W){this.dyn_tree=O,this.max_code=0,this.stat_desc=W}function H(O){return O<256?N[O]:N[256+(O>>>7)]}function ce(O,W){O.pending_buf[O.pending++]=255&W,O.pending_buf[O.pending++]=W>>>8&255}function se(O,W,le){O.bi_valid>v-le?(O.bi_buf|=W<<O.bi_valid&65535,ce(O,O.bi_buf),O.bi_buf=W>>v-O.bi_valid,O.bi_valid+=le-v):(O.bi_buf|=W<<O.bi_valid&65535,O.bi_valid+=le)}function ee(O,W,le){se(O,le[2*W],le[2*W+1])}function _e(O,W){for(var le=0;le|=1&O,O>>>=1,le<<=1,0<--W;);return le>>>1}function fe(O,W,le){var q,K,ne=new Array(y+1),ke=0;for(q=1;q<=y;q++)ne[q]=ke=ke+le[q-1]<<1;for(K=0;K<=W;K++){var ge=O[2*K+1];ge!==0&&(O[2*K]=_e(ne[ge]++,ge))}}function ye(O){var W;for(W=0;W<g;W++)O.dyn_ltree[2*W]=0;for(W=0;W<p;W++)O.dyn_dtree[2*W]=0;for(W=0;W<_;W++)O.bl_tree[2*W]=0;O.dyn_ltree[2*C]=1,O.opt_len=O.static_len=0,O.last_lit=O.matches=0}function G(O){8<O.bi_valid?ce(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 de(O,W,le,q){var K=2*W,ne=2*le;return O[K]<O[ne]||O[K]===O[ne]&&q[W]<=q[le]}function ue(O,W,le){for(var q=O.heap[le],K=le<<1;K<=O.heap_len&&(K<O.heap_len&&de(W,O.heap[K+1],O.heap[K],O.depth)&&K++,!de(W,q,O.heap[K],O.depth));)O.heap[le]=O.heap[K],le=K,K<<=1;O.heap[le]=q}function te(O,W,le){var q,K,ne,ke,ge=0;if(O.last_lit!==0)for(;q=O.pending_buf[O.d_buf+2*ge]<<8|O.pending_buf[O.d_buf+2*ge+1],K=O.pending_buf[O.l_buf+ge],ge++,q===0?ee(O,K,W):(ee(O,(ne=k[K])+h+1,W),(ke=z[ne])!==0&&se(O,K-=F[ne],ke),ee(O,ne=H(--q),le),(ke=E[ne])!==0&&se(O,q-=Y[ne],ke)),ge<O.last_lit;);ee(O,C,W)}function Se(O,W){var le,q,K,ne=W.dyn_tree,ke=W.stat_desc.static_tree,ge=W.stat_desc.has_stree,Ce=W.stat_desc.elems,Fe=-1;for(O.heap_len=0,O.heap_max=m,le=0;le<Ce;le++)ne[2*le]!==0?(O.heap[++O.heap_len]=Fe=le,O.depth[le]=0):ne[2*le+1]=0;for(;O.heap_len<2;)ne[2*(K=O.heap[++O.heap_len]=Fe<2?++Fe:0)]=1,O.depth[K]=0,O.opt_len--,ge&&(O.static_len-=ke[2*K+1]);for(W.max_code=Fe,le=O.heap_len>>1;1<=le;le--)ue(O,ne,le);for(K=Ce;le=O.heap[1],O.heap[1]=O.heap[O.heap_len--],ue(O,ne,1),q=O.heap[1],O.heap[--O.heap_max]=le,O.heap[--O.heap_max]=q,ne[2*K]=ne[2*le]+ne[2*q],O.depth[K]=(O.depth[le]>=O.depth[q]?O.depth[le]:O.depth[q])+1,ne[2*le+1]=ne[2*q+1]=K,O.heap[1]=K++,ue(O,ne,1),2<=O.heap_len;);O.heap[--O.heap_max]=O.heap[1],function(Me,We){var Ze,Pe,Xe,He,et,tt,rt=We.dyn_tree,we=We.max_code,be=We.stat_desc.static_tree,ae=We.stat_desc.has_stree,Ne=We.stat_desc.extra_bits,Ae=We.stat_desc.extra_base,xe=We.stat_desc.max_length,Re=0;for(He=0;He<=y;He++)Me.bl_count[He]=0;for(rt[2*Me.heap[Me.heap_max]+1]=0,Ze=Me.heap_max+1;Ze<m;Ze++)xe<(He=rt[2*rt[2*(Pe=Me.heap[Ze])+1]+1]+1)&&(He=xe,Re++),rt[2*Pe+1]=He,we<Pe||(Me.bl_count[He]++,et=0,Ae<=Pe&&(et=Ne[Pe-Ae]),tt=rt[2*Pe],Me.opt_len+=tt*(He+et),ae&&(Me.static_len+=tt*(be[2*Pe+1]+et)));if(Re!==0){do{for(He=xe-1;Me.bl_count[He]===0;)He--;Me.bl_count[He]--,Me.bl_count[He+1]+=2,Me.bl_count[xe]--,Re-=2}while(0<Re);for(He=xe;He!==0;He--)for(Pe=Me.bl_count[He];Pe!==0;)we<(Xe=Me.heap[--Ze])||(rt[2*Xe+1]!==He&&(Me.opt_len+=(He-rt[2*Xe+1])*rt[2*Xe],rt[2*Xe+1]=He),Pe--)}}(O,W),fe(ne,Fe,O.bl_count)}function S(O,W,le){var q,K,ne=-1,ke=W[1],ge=0,Ce=7,Fe=4;for(ke===0&&(Ce=138,Fe=3),W[2*(le+1)+1]=65535,q=0;q<=le;q++)K=ke,ke=W[2*(q+1)+1],++ge<Ce&&K===ke||(ge<Fe?O.bl_tree[2*K]+=ge:K!==0?(K!==ne&&O.bl_tree[2*K]++,O.bl_tree[2*x]++):ge<=10?O.bl_tree[2*A]++:O.bl_tree[2*M]++,ne=K,Fe=(ge=0)===ke?(Ce=138,3):K===ke?(Ce=6,3):(Ce=7,4))}function X(O,W,le){var q,K,ne=-1,ke=W[1],ge=0,Ce=7,Fe=4;for(ke===0&&(Ce=138,Fe=3),q=0;q<=le;q++)if(K=ke,ke=W[2*(q+1)+1],!(++ge<Ce&&K===ke)){if(ge<Fe)for(;ee(O,K,O.bl_tree),--ge!=0;);else K!==0?(K!==ne&&(ee(O,K,O.bl_tree),ge--),ee(O,x,O.bl_tree),se(O,ge-3,2)):ge<=10?(ee(O,A,O.bl_tree),se(O,ge-3,3)):(ee(O,M,O.bl_tree),se(O,ge-11,7));ne=K,Fe=(ge=0)===ke?(Ce=138,3):K===ke?(Ce=6,3):(Ce=7,4)}}u(Y);var J=!1;function U(O,W,le,q){se(O,(f<<1)+(q?1:0),3),function(K,ne,ke,ge){G(K),ce(K,ke),ce(K,~ke),l.arraySet(K.pending_buf,K.window,ne,ke,K.pending),K.pending+=ke}(O,W,le)}i._tr_init=function(O){J||(function(){var W,le,q,K,ne,ke=new Array(y+1);for(K=q=0;K<d-1;K++)for(F[K]=q,W=0;W<1<<z[K];W++)k[q++]=K;for(k[q-1]=K,K=ne=0;K<16;K++)for(Y[K]=ne,W=0;W<1<<E[K];W++)N[ne++]=K;for(ne>>=7;K<p;K++)for(Y[K]=ne<<7,W=0;W<1<<E[K]-7;W++)N[256+ne++]=K;for(le=0;le<=y;le++)ke[le]=0;for(W=0;W<=143;)D[2*W+1]=8,W++,ke[8]++;for(;W<=255;)D[2*W+1]=9,W++,ke[9]++;for(;W<=279;)D[2*W+1]=7,W++,ke[7]++;for(;W<=287;)D[2*W+1]=8,W++,ke[8]++;for(fe(D,g+1,ke),W=0;W<p;W++)T[2*W+1]=5,T[2*W]=_e(W,5);re=new ie(D,z,h+1,g,y),V=new ie(T,E,0,p,y),oe=new ie(new Array(0),P,0,_,w)}(),J=!0),O.l_desc=new Z(O.dyn_ltree,re),O.d_desc=new Z(O.dyn_dtree,V),O.bl_desc=new Z(O.bl_tree,oe),O.bi_buf=0,O.bi_valid=0,ye(O)},i._tr_stored_block=U,i._tr_flush_block=function(O,W,le,q){var K,ne,ke=0;0<O.level?(O.strm.data_type===2&&(O.strm.data_type=function(ge){var Ce,Fe=4093624447;for(Ce=0;Ce<=31;Ce++,Fe>>>=1)if(1&Fe&&ge.dyn_ltree[2*Ce]!==0)return o;if(ge.dyn_ltree[18]!==0||ge.dyn_ltree[20]!==0||ge.dyn_ltree[26]!==0)return s;for(Ce=32;Ce<h;Ce++)if(ge.dyn_ltree[2*Ce]!==0)return s;return o}(O)),Se(O,O.l_desc),Se(O,O.d_desc),ke=function(ge){var Ce;for(S(ge,ge.dyn_ltree,ge.l_desc.max_code),S(ge,ge.dyn_dtree,ge.d_desc.max_code),Se(ge,ge.bl_desc),Ce=_-1;3<=Ce&&ge.bl_tree[2*I[Ce]+1]===0;Ce--);return ge.opt_len+=3*(Ce+1)+5+5+4,Ce}(O),K=O.opt_len+3+7>>>3,(ne=O.static_len+3+7>>>3)<=K&&(K=ne)):K=ne=le+5,le+4<=K&&W!==-1?U(O,W,le,q):O.strategy===4||ne===K?(se(O,2+(q?1:0),3),te(O,D,T)):(se(O,4+(q?1:0),3),function(ge,Ce,Fe,Me){var We;for(se(ge,Ce-257,5),se(ge,Fe-1,5),se(ge,Me-4,4),We=0;We<Me;We++)se(ge,ge.bl_tree[2*I[We]+1],3);X(ge,ge.dyn_ltree,Ce-1),X(ge,ge.dyn_dtree,Fe-1)}(O,O.l_desc.max_code+1,O.d_desc.max_code+1,ke+1),te(O,O.dyn_ltree,O.dyn_dtree)),ye(O),q&&G(O)},i._tr_tally=function(O,W,le){return O.pending_buf[O.d_buf+2*O.last_lit]=W>>>8&255,O.pending_buf[O.d_buf+2*O.last_lit+1]=255&W,O.pending_buf[O.l_buf+O.last_lit]=255&le,O.last_lit++,W===0?O.dyn_ltree[2*le]++:(O.matches++,W--,O.dyn_ltree[2*(k[le]+h+1)]++,O.dyn_dtree[2*H(W)]++),O.last_lit===O.lit_bufsize-1},i._tr_align=function(O){se(O,2,3),ee(O,C,D),function(W){W.bi_valid===16?(ce(W,W.bi_buf),W.bi_buf=0,W.bi_valid=0):8<=W.bi_valid&&(W.pending_buf[W.pending++]=255&W.bi_buf,W.bi_buf>>=8,W.bi_valid-=8)}(O)}},{"../utils/common":41}],53:[function(n,r,i){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,i){(function(l){(function(o,s){if(!o.setImmediate){var u,f,d,h,g=1,p={},_=!1,m=o.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(o);y=y&&y.setTimeout?y:o,u={}.toString.call(o.process)==="[object process]"?function(x){process.nextTick(function(){w(x)})}:function(){if(o.postMessage&&!o.importScripts){var x=!0,A=o.onmessage;return o.onmessage=function(){x=!1},o.postMessage("","*"),o.onmessage=A,x}}()?(h="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",C,!1):o.attachEvent("onmessage",C),function(x){o.postMessage(h+x,"*")}):o.MessageChannel?((d=new MessageChannel).port1.onmessage=function(x){w(x.data)},function(x){d.port2.postMessage(x)}):m&&"onreadystatechange"in m.createElement("script")?(f=m.documentElement,function(x){var A=m.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 z={callback:x,args:A};return p[g]=z,u(g),g++},y.clearImmediate=v}function v(x){delete p[x]}function w(x){if(_)setTimeout(w,0,x);else{var A=p[x];if(A){_=!0;try{(function(M){var z=M.callback,E=M.args;switch(E.length){case 0:z();break;case 1:z(E[0]);break;case 2:z(E[0],E[1]);break;case 3:z(E[0],E[1],E[2]);break;default:z.apply(s,E)}})(A)}finally{v(x),_=!1}}}}function C(x){x.source===o&&typeof x.data=="string"&&x.data.indexOf(h)===0&&w(+x.data.slice(h.length))}})(typeof self>"u"?l===void 0?this:l:self)}).call(this,typeof ri<"u"?ri:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(hc);var Xf=hc.exports;const Qf=Gf(Xf);function Io(e,t,n){const r=e.slice();return r[122]=t[n],r[123]=t,r[124]=n,r}function Po(e,t,n){const r=e.slice();return r[125]=t[n],r}function Do(e,t,n){const r=e.slice();return r[125]=t[n],r}function Oo(e,t,n){const r=e.slice();return r[125]=t[n],r}function Fo(e,t,n){const r=e.slice();return r[125]=t[n],r}function Ro(e,t,n){const r=e.slice();return r[125]=t[n],r}function Bo(e,t,n){const r=e.slice();return r[136]=t[n],r}function jo(e,t,n){const r=e.slice();return r[125]=t[n],r}function Uo(e,t,n){const r=e.slice();return r[141]=t[n],r}function Ho(e,t,n){const r=e.slice();return r[144]=t[n],r}function Wo(e){let t,n,r=e[60][e[144]].icon+"",i,l=e[60][e[144]].label+"",o,s,u,f=(e[8][e[144]]||0)+"",d,h,g,p,_,m;function y(){return e[67](e[144])}return{c(){t=b("button"),n=b("span"),i=L(),o=j(l),s=L(),u=b("span"),d=j(f),g=L(),a(n,"class","inline-flex"),a(u,"class",h="ml-1 px-1.5 py-0.5 rounded-full text-xs "+(e[0]===e[144]?"bg-indigo-100 text-indigo-700":"bg-gray-100 text-gray-600")),a(t,"class",p="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[144]?"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),c(t,n),n.innerHTML=r,c(t,i),c(t,o),c(t,s),c(t,u),c(u,d),c(t,g),_||(m=Q(t,"click",y),_=!0)},p(v,w){e=v,w[0]&256&&f!==(f=(e[8][e[144]]||0)+"")&&$(d,f),w[0]&1&&h!==(h="ml-1 px-1.5 py-0.5 rounded-full text-xs "+(e[0]===e[144]?"bg-indigo-100 text-indigo-700":"bg-gray-100 text-gray-600"))&&a(u,"class",h),w[0]&1&&p!==(p="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[144]?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))&&a(t,"class",p)},d(v){v&&R(t),_=!1,m()}}}function Zo(e){let t,n,r,i=e[31]?'<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>',l,o=e[31]?"Exporting…":"Export JSON ▾",s,u,f,d,h,g,p,_=e[33]&&Yo(e),m=e[32]&&Vo(e);return{c(){t=b("div"),n=b("button"),r=new lc(!1),l=L(),s=j(o),u=L(),_&&_.c(),f=L(),m&&m.c(),d=L(),h=b("button"),h.textContent="Import",r.a=l,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[31],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),c(t,n),r.m(i,n),c(n,l),c(n,s),c(t,u),_&&_.m(t,null),B(y,f,v),m&&m.m(y,v),B(y,d,v),B(y,h,v),g||(p=[Q(n,"click",e[68]),Q(h,"click",e[70])],g=!0)},p(y,v){v[1]&1&&i!==(i=y[31]?'<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(i),v[1]&1&&o!==(o=y[31]?"Exporting…":"Export JSON ▾")&&$(s,o),v[1]&1&&(n.disabled=y[31]),y[33]?_?_.p(y,v):(_=Yo(y),_.c(),_.m(t,null)):_&&(_.d(1),_=null),y[32]?m?m.p(y,v):(m=Vo(y),m.c(),m.m(d.parentNode,d)):m&&(m.d(1),m=null)},d(y){y&&(R(t),R(f),R(d),R(h)),_&&_.d(),m&&m.d(y),g=!1,$e(p)}}}function Yo(e){let t,n,r,i,l,o,s,u;return{c(){t=b("div"),n=L(),r=b("div"),i=b("button"),i.textContent="All languages (single file)",l=L(),o=b("button"),o.textContent="One file per language",a(t,"class","fixed inset-0 z-40"),a(t,"role","presentation"),a(i,"class","w-full text-left px-4 py-2.5 text-sm hover:bg-gray-50 rounded-t-md"),a(o,"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),c(r,i),c(r,l),c(r,o),s||(u=[Q(t,"click",e[69]),Q(i,"click",e[41]),Q(o,"click",e[42])],s=!0)},p:Be,d(f){f&&(R(t),R(n),R(r)),s=!1,$e(u)}}}function Vo(e){let t,n,r;return{c(){t=b("span"),n=j(e[32]),a(t,"class",r="text-xs "+(e[32].includes("!")?"text-green-600":"text-red-600"))},m(i,l){B(i,t,l),c(t,n)},p(i,l){l[1]&2&&$(n,i[32]),l[1]&2&&r!==(r="text-xs "+(i[32].includes("!")?"text-green-600":"text-red-600"))&&a(t,"class",r)},d(i){i&&R(t)}}}function qo(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(i,l){B(i,t,l),n||(r=Q(t,"click",e[71]),n=!0)},p:Be,d(i){i&&R(t),n=!1,r()}}}function Ko(e){let t,n=(e[141].name||e[141].code||e[141])+"",r,i;return{c(){t=b("option"),r=j(n),t.__value=i=e[141].code||e[141],Ee(t,t.__value)},m(l,o){B(l,t,o),c(t,r)},p(l,o){o[0]&32&&n!==(n=(l[141].name||l[141].code||l[141])+"")&&$(r,n),o[0]&32&&i!==(i=l[141].code||l[141])&&(t.__value=i,Ee(t,t.__value))},d(l){l&&R(t)}}}function Jo(e){let t,n=e[125].name+"",r,i;return{c(){t=b("option"),r=j(n),t.__value=i=e[125].id,Ee(t,t.__value)},m(l,o){B(l,t,o),c(t,r)},p(l,o){o[0]&16384&&n!==(n=l[125].name+"")&&$(r,n),o[0]&16384&&i!==(i=l[125].id)&&(t.__value=i,Ee(t,t.__value))},d(l){l&&R(t)}}}function Go(e){let t,n,r,i,l,o,s,u,f,d,h,g;return{c(){t=b("div"),n=b("input"),r=L(),i=b("input"),l=L(),o=b("input"),s=L(),u=b("button"),f=j("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(i,"placeholder","Context (optional)"),a(i,"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(o,"placeholder","Translated value (optional)"),a(o,"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(u,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),u.disabled=d=!e[25].trim(),a(t,"class","flex gap-2 mb-4")},m(p,_){B(p,t,_),c(t,n),Ee(n,e[25]),c(t,r),c(t,i),Ee(i,e[26]),c(t,l),c(t,o),Ee(o,e[27]),c(t,s),c(t,u),c(u,f),h||(g=[Q(n,"input",e[80]),Q(i,"input",e[81]),Q(o,"input",e[82]),Q(u,"click",e[58])],h=!0)},p(p,_){_[0]&33554432&&n.value!==p[25]&&Ee(n,p[25]),_[0]&67108864&&i.value!==p[26]&&Ee(i,p[26]),_[0]&134217728&&o.value!==p[27]&&Ee(o,p[27]),_[0]&33554432&&d!==(d=!p[25].trim())&&(u.disabled=d)},d(p){p&&R(t),h=!1,$e(g)}}}function Xo(e){let t,n,r,i,l,o;return{c(){t=b("div"),n=b("textarea"),r=L(),i=b("button"),i.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(i,"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,u){B(s,t,u),c(t,n),Ee(n,e[28]),c(t,r),c(t,i),l||(o=[Q(n,"input",e[83]),Q(i,"click",e[59])],l=!0)},p(s,u){u[0]&268435456&&Ee(n,s[28])},d(s){s&&R(t),l=!1,$e(o)}}}function Qo(e){let t,n,r,i,l,o,s;function u(y,v){return y[20]?ed:$f}let f=u(e),d=f(e),h=Le(e[60][e[0]].actions),g=[];for(let y=0;y<h.length;y+=1)g[y]=$o(Bo(e,h,y));let p=e[14].length>0&&es(e),_=e[0]==="trash"&&ls(e),m=(e[20]||e[22]>0)&&os(e);return{c(){t=b("div"),n=b("span"),d.c(),r=L();for(let y=0;y<g.length;y+=1)g[y].c();i=L(),p&&p.c(),l=L(),_&&_.c(),o=L(),m&&m.c(),s=bt(),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),c(t,n),d.m(n,null),c(t,r);for(let w=0;w<g.length;w+=1)g[w]&&g[w].m(t,null);c(t,i),p&&p.m(t,null),c(t,l),_&&_.m(t,null),B(y,o,v),m&&m.m(y,v),B(y,s,v)},p(y,v){if(f===(f=u(y))&&d?d.p(y,v):(d.d(1),d=f(y),d&&(d.c(),d.m(n,null))),v[0]&1048577|v[1]&545259520){h=Le(y[60][y[0]].actions);let w;for(w=0;w<h.length;w+=1){const C=Bo(y,h,w);g[w]?g[w].p(C,v):(g[w]=$o(C),g[w].c(),g[w].m(t,i))}for(;w<g.length;w+=1)g[w].d(1);g.length=h.length}y[14].length>0?p?p.p(y,v):(p=es(y),p.c(),p.m(t,l)):p&&(p.d(1),p=null),y[0]==="trash"?_?_.p(y,v):(_=ls(y),_.c(),_.m(t,null)):_&&(_.d(1),_=null),y[20]||y[22]>0?m?m.p(y,v):(m=os(y),m.c(),m.m(s.parentNode,s)):m&&(m.d(1),m=null)},d(y){y&&(R(t),R(o),R(s)),d.d(),it(g,y),p&&p.d(),_&&_.d(),m&&m.d(y)}}}function $f(e){let t=e[13].size+"",n,r;return{c(){n=j(t),r=j(" selected")},m(i,l){B(i,n,l),B(i,r,l)},p(i,l){l[0]&8192&&t!==(t=i[13].size+"")&&$(n,t)},d(i){i&&(R(n),R(r))}}}function ed(e){let t,n,r,i,l;return{c(){t=j(e[21]),n=L(),r=j(e[3]),i=j(" / "),l=j(e[4])},m(o,s){B(o,t,s),B(o,n,s),B(o,r,s),B(o,i,s),B(o,l,s)},p(o,s){s[0]&2097152&&$(t,o[21]),s[0]&8&&$(r,o[3]),s[0]&16&&$(l,o[4])},d(o){o&&(R(t),R(n),R(r),R(i),R(l))}}}function $o(e){let t,n=e[136].label+"",r,i,l,o,s;function u(){return e[84](e[136])}return{c(){t=b("button"),r=j(n),i=L(),a(t,"class",l="px-3 py-1.5 text-white text-sm rounded-md "+e[136].color+" disabled:opacity-50 disabled:cursor-not-allowed"),t.disabled=e[20]},m(f,d){B(f,t,d),c(t,r),c(t,i),o||(s=Q(t,"click",u),o=!0)},p(f,d){e=f,d[0]&1&&n!==(n=e[136].label+"")&&$(r,n),d[0]&1&&l!==(l="px-3 py-1.5 text-white text-sm rounded-md "+e[136].color+" disabled:opacity-50 disabled:cursor-not-allowed")&&a(t,"class",l),d[0]&1048576&&(t.disabled=e[20])},d(f){f&&R(t),o=!1,s()}}}function es(e){let t,n,r,i,l,o,s=e[16]&&ts(e);return{c(){t=b("div"),n=b("button"),r=j("Label ▾"),i=L(),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[20],a(t,"class","relative")},m(u,f){B(u,t,f),c(t,n),c(n,r),c(t,i),s&&s.m(t,null),l||(o=Q(n,"click",e[85]),l=!0)},p(u,f){f[0]&1048576&&(n.disabled=u[20]),u[16]?s?s.p(u,f):(s=ts(u),s.c(),s.m(t,null)):s&&(s.d(1),s=null)},d(u){u&&R(t),s&&s.d(),l=!1,o()}}}function ts(e){let t,n,r,i,l,o,s,u,f=Le(e[14]),d=[];for(let g=0;g<f.length;g+=1)d[g]=ns(Ro(e,f,g));let h=e[12]&&rs(e);return{c(){t=b("div"),n=L(),r=b("div"),i=b("div"),i.textContent="Assign Label",l=L();for(let g=0;g<d.length;g+=1)d[g].c();o=L(),h&&h.c(),a(t,"class","fixed inset-0 z-40"),a(t,"role","presentation"),a(i,"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(g,p){B(g,t,p),B(g,n,p),B(g,r,p),c(r,i),c(r,l);for(let _=0;_<d.length;_+=1)d[_]&&d[_].m(r,null);c(r,o),h&&h.m(r,null),s||(u=Q(t,"click",e[86]),s=!0)},p(g,p){if(p[0]&16384|p[1]&262144){f=Le(g[14]);let _;for(_=0;_<f.length;_+=1){const m=Ro(g,f,_);d[_]?d[_].p(m,p):(d[_]=ns(m),d[_].c(),d[_].m(r,o))}for(;_<d.length;_+=1)d[_].d(1);d.length=f.length}g[12]?h?h.p(g,p):(h=rs(g),h.c(),h.m(r,null)):h&&(h.d(1),h=null)},d(g){g&&(R(t),R(n),R(r)),it(d,g),h&&h.d(),s=!1,u()}}}function ns(e){let t,n,r,i=e[125].name+"",l,o,s;function u(){return e[87](e[125])}return{c(){t=b("button"),n=b("span"),r=L(),l=j(i),a(n,"class","w-3 h-3 rounded-full shrink-0"),ct(n,"background-color",e[125].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),c(t,n),c(t,r),c(t,l),o||(s=Q(t,"click",u),o=!0)},p(f,d){e=f,d[0]&16384&&ct(n,"background-color",e[125].color),d[0]&16384&&i!==(i=e[125].name+"")&&$(l,i)},d(f){f&&R(t),o=!1,s()}}}function rs(e){let t,n,r,i=Le(e[14]),l=[];for(let o=0;o<i.length;o+=1)l[o]=is(Fo(e,i,o));return{c(){t=b("div"),n=b("div"),n.textContent="Remove Label",r=L();for(let o=0;o<l.length;o+=1)l[o].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(o,s){B(o,t,s),c(t,n),c(t,r);for(let u=0;u<l.length;u+=1)l[u]&&l[u].m(t,null)},p(o,s){if(s[0]&16384|s[1]&524288){i=Le(o[14]);let u;for(u=0;u<i.length;u+=1){const f=Fo(o,i,u);l[u]?l[u].p(f,s):(l[u]=is(f),l[u].c(),l[u].m(t,null))}for(;u<l.length;u+=1)l[u].d(1);l.length=i.length}},d(o){o&&R(t),it(l,o)}}}function is(e){let t,n,r,i=e[125].name+"",l,o,s,u;function f(){return e[88](e[125])}return{c(){t=b("button"),n=b("span"),r=j(`
15
+ Remove "`),l=j(i),o=j(`"
16
+ `),a(n,"class","w-3 h-3 rounded-full shrink-0"),ct(n,"background-color",e[125].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),c(t,n),c(t,r),c(t,l),c(t,o),s||(u=Q(t,"click",f),s=!0)},p(d,h){e=d,h[0]&16384&&ct(n,"background-color",e[125].color),h[0]&16384&&i!==(i=e[125].name+"")&&$(l,i)},d(d){d&&R(t),s=!1,u()}}}function ls(e){let t,n=e[20]&&e[21]==="Deleting"?"Deleting…":"Delete Permanently",r,i,l;return{c(){t=b("button"),r=j(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[20]},m(o,s){B(o,t,s),c(t,r),i||(l=Q(t,"click",e[55]),i=!0)},p(o,s){s[0]&3145728&&n!==(n=o[20]&&o[21]==="Deleting"?"Deleting…":"Delete Permanently")&&$(r,n),s[0]&1048576&&(t.disabled=o[20])},d(o){o&&R(t),i=!1,l()}}}function os(e){let t,n,r,i,l,o,s,u,f,d,h,g,p,_,m,y,v;function w(A,M){if(A[20])return nd;if(A[22]>0)return td}let C=w(e),x=C&&C(e);return{c(){t=b("div"),n=b("div"),r=b("span"),x&&x.c(),i=L(),l=b("span"),o=j(e[37]),s=j("%"),u=L(),f=b("div"),d=b("div"),g=L(),p=b("div"),_=j(e[3]),m=j(" of "),y=j(e[4]),v=j(" 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[37]}%`),a(f,"class","mt-2 h-2 overflow-hidden rounded-full bg-indigo-100"),a(p,"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),c(t,n),c(n,r),x&&x.m(r,null),c(n,i),c(n,l),c(l,o),c(l,s),c(t,u),c(t,f),c(f,d),c(t,g),c(t,p),c(p,_),c(p,m),c(p,y),c(p,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]&64&&$(o,A[37]),M[1]&64&&h!==(h=`width: ${A[37]}%`)&&a(d,"style",h),M[0]&8&&$(_,A[3]),M[0]&16&&$(y,A[4])},d(A){A&&R(t),x&&x.d()}}}function td(e){let t,n,r;return{c(){t=j("Finished with "),n=j(e[22]),r=j(" failure(s)")},m(i,l){B(i,t,l),B(i,n,l),B(i,r,l)},p(i,l){l[0]&4194304&&$(n,i[22])},d(i){i&&(R(t),R(n),R(r))}}}function nd(e){let t,n;return{c(){t=j(e[21]),n=j(" selected items...")},m(r,i){B(r,t,i),B(r,n,i)},p(r,i){i[0]&2097152&&$(t,r[21])},d(r){r&&(R(t),R(n))}}}function rd(e){let t,n,r,i,l,o,s,u,f,d,h,g,p,_,m,y,v,w=[],C=new Map,x,A,M,z,E,P,I,D,T=Le(e[7]);const N=F=>F[122].key_id;for(let F=0;F<T.length;F+=1){let re=Io(e,T,F),V=N(re);C.set(V,w[F]=ms(V,re))}let k=e[38]>1&&_s(e);return{c(){t=b("div"),n=b("table"),r=b("thead"),i=b("tr"),l=b("th"),o=b("input"),s=L(),u=b("th"),u.textContent="Key",f=L(),d=b("th"),d.textContent="DomContext",h=L(),g=b("th"),p=j("Translation ("),_=j(e[6]),m=j(")"),y=L(),v=b("tbody");for(let F=0;F<w.length;F+=1)w[F].c();x=L(),A=b("div"),M=b("p"),z=j(e[2]),E=j(" phrase(s)"),P=L(),k&&k.c(),a(o,"type","checkbox"),o.checked=e[17],a(o,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(l,"class","w-10 px-3 py-2.5"),a(u,"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(g,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),a(i,"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(F,re){B(F,t,re),c(t,n),c(n,r),c(r,i),c(i,l),c(l,o),c(i,s),c(i,u),c(i,f),c(i,d),c(i,h),c(i,g),c(g,p),c(g,_),c(g,m),c(n,y),c(n,v);for(let V=0;V<w.length;V+=1)w[V]&&w[V].m(v,null);B(F,x,re),B(F,A,re),c(A,M),c(M,z),c(M,E),c(A,P),k&&k.m(A,null),I||(D=Q(o,"change",e[53]),I=!0)},p(F,re){re[0]&131072&&(o.checked=F[17]),re[0]&64&&$(_,F[6]),re[0]&1611198593|re[1]&69350168&&(T=Le(F[7]),w=Hi(w,re,N,1,F,T,C,v,Ui,ms,null,Io)),re[0]&4&&$(z,F[2]),F[38]>1?k?k.p(F,re):(k=_s(F),k.c(),k.m(A,null)):k&&(k.d(1),k=null)},d(F){F&&(R(t),R(x),R(A));for(let re=0;re<w.length;re+=1)w[re].d();k&&k.d(),I=!1,D()}}}function id(e){let t;function n(l,o){return l[9]?md:l[0]==="pending"?gd:l[0]==="approved"?pd:hd}let r=n(e),i=r(e);return{c(){t=b("div"),i.c(),a(t,"class","text-center py-12 text-gray-400")},m(l,o){B(l,t,o),i.m(t,null)},p(l,o){r===(r=n(l))&&i?i.p(l,o):(i.d(1),i=r(l),i&&(i.c(),i.m(t,null)))},d(l){l&&R(t),i.d()}}}function ld(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:Be,d(n){n&&R(t)}}}function ss(e){let t,n=Le(e[122].labels),r=[];for(let i=0;i<n.length;i+=1)r[i]=as(Oo(e,n,i));return{c(){t=b("div");for(let i=0;i<r.length;i+=1)r[i].c();a(t,"class","flex flex-wrap gap-1 mt-1")},m(i,l){B(i,t,l);for(let o=0;o<r.length;o+=1)r[o]&&r[o].m(t,null)},p(i,l){if(l[0]&528512|l[1]&8448){n=Le(i[122].labels);let o;for(o=0;o<n.length;o+=1){const s=Oo(i,n,o);r[o]?r[o].p(s,l):(r[o]=as(s),r[o].c(),r[o].m(t,null))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(i){i&&R(t),it(r,i)}}}function as(e){let t,n=e[125].name+"",r,i,l,o;function s(){return e[92](e[125])}return{c(){t=b("span"),r=j(n),a(t,"class","inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium text-white cursor-pointer hover:opacity-80"),ct(t,"background-color",e[125].color),a(t,"title",i=e[125].name)},m(u,f){B(u,t,f),c(t,r),l||(o=Q(t,"click",Bt(s)),l=!0)},p(u,f){e=u,f[0]&128&&n!==(n=e[125].name+"")&&$(r,n),f[0]&128&&ct(t,"background-color",e[125].color),f[0]&128&&i!==(i=e[125].name)&&a(t,"title",i)},d(u){u&&R(t),l=!1,o()}}}function od(e){let t,n=(e[122].value||"—")+"",r;return{c(){t=b("span"),r=j(n),a(t,"class","text-sm text-gray-500")},m(i,l){B(i,t,l),c(t,r)},p(i,l){l[0]&128&&n!==(n=(i[122].value||"—")+"")&&$(r,n)},d(i){i&&R(t)}}}function sd(e){let t,n,r,i;function l(...s){return e[93](e[122],e[123],e[124],...s)}function o(){return e[94](e[122])}return{c(){t=b("input"),a(t,"class","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"),t.value=n=e[122].value||"",a(t,"placeholder","Enter translation…")},m(s,u){B(s,t,u),r||(i=[Q(t,"input",l),Q(t,"change",o)],r=!0)},p(s,u){e=s,u[0]&128&&n!==(n=e[122].value||"")&&t.value!==n&&(t.value=n)},d(s){s&&R(t),r=!1,$e(i)}}}function us(e){let t,n,r,i,l,o,s,u=e[122].key+"",f,d,h,g,p,_=(e[122].context||"—")+"",m,y,v,w,C,x,A,M,z=e[122].status+"",E,P,I,D,T,N=(e[122].created_at||"—")+"",k,F,re,V,oe,Y,ie,Z,H,ce,se,ee,_e;function fe(J,U){return J[122].url?ud:ad}let ye=fe(e),G=ye(e),de=e[122].labels&&e[122].labels.length>0&&cs(e);function ue(){return e[97](e[122])}let te=e[15]===e[122].key_id&&ds(e);function Se(J,U){if(J[122].url&&J[30][J[122].url])return dd;if(J[122].url&&J[30][J[122].url]===null)return fd;if(J[122].url&&J[30][J[122].url]===!1)return cd}let S=Se(e),X=S&&S(e);return{c(){t=b("tr"),n=b("td"),r=b("div"),i=b("div"),l=b("span"),l.textContent="Key",o=L(),s=b("span"),f=j(u),d=L(),h=b("span"),h.textContent="DomContext",g=L(),p=b("span"),m=j(_),y=L(),v=b("span"),v.textContent="Source URL",w=L(),G.c(),C=L(),x=b("span"),x.textContent="Status",A=L(),M=b("span"),E=j(z),P=L(),I=b("span"),I.textContent="Discovered",D=L(),T=b("span"),k=j(N),F=L(),re=b("span"),re.textContent="Labels",V=L(),oe=b("div"),de&&de.c(),Y=L(),ie=b("div"),Z=b("button"),Z.textContent="+ Label",H=L(),te&&te.c(),ce=L(),X&&X.c(),se=L(),a(l,"class","text-gray-400 font-medium"),a(s,"class","font-mono text-gray-700 break-all"),a(h,"class","text-gray-400 font-medium"),a(p,"class","text-gray-600 break-all"),a(v,"class","text-gray-400 font-medium"),a(x,"class","text-gray-400 font-medium"),a(M,"class","text-gray-600"),a(I,"class","text-gray-400 font-medium"),a(T,"class","text-gray-600"),a(re,"class","text-gray-400 font-medium"),a(Z,"class","px-1.5 py-0.5 text-xs border border-dashed border-gray-300 rounded text-gray-400 hover:text-indigo-500 hover:border-indigo-300"),a(ie,"class","relative inline-block"),a(oe,"class","flex flex-wrap items-center gap-1.5"),a(i,"class","flex-1 grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm"),a(r,"class","flex gap-6"),a(n,"colspan","4"),a(n,"class","px-4 py-3"),a(t,"class","bg-gray-50 border-b border-gray-200")},m(J,U){B(J,t,U),c(t,n),c(n,r),c(r,i),c(i,l),c(i,o),c(i,s),c(s,f),c(i,d),c(i,h),c(i,g),c(i,p),c(p,m),c(i,y),c(i,v),c(i,w),G.m(i,null),c(i,C),c(i,x),c(i,A),c(i,M),c(M,E),c(i,P),c(i,I),c(i,D),c(i,T),c(T,k),c(i,F),c(i,re),c(i,V),c(i,oe),de&&de.m(oe,null),c(oe,Y),c(oe,ie),c(ie,Z),c(ie,H),te&&te.m(ie,null),c(r,ce),X&&X.m(r,null),c(t,se),ee||(_e=Q(Z,"click",Bt(ue)),ee=!0)},p(J,U){e=J,U[0]&128&&u!==(u=e[122].key+"")&&$(f,u),U[0]&128&&_!==(_=(e[122].context||"—")+"")&&$(m,_),ye===(ye=fe(e))&&G?G.p(e,U):(G.d(1),G=ye(e),G&&(G.c(),G.m(i,C))),U[0]&128&&z!==(z=e[122].status+"")&&$(E,z),U[0]&128&&N!==(N=(e[122].created_at||"—")+"")&&$(k,N),e[122].labels&&e[122].labels.length>0?de?de.p(e,U):(de=cs(e),de.c(),de.m(oe,Y)):de&&(de.d(1),de=null),e[15]===e[122].key_id?te?te.p(e,U):(te=ds(e),te.c(),te.m(ie,null)):te&&(te.d(1),te=null),S===(S=Se(e))&&X?X.p(e,U):(X&&X.d(1),X=S&&S(e),X&&(X.c(),X.m(r,null)))},d(J){J&&R(t),G.d(),de&&de.d(),te&&te.d(),X&&X.d(),ee=!1,_e()}}}function ad(e){let t;return{c(){t=b("span"),t.textContent="—",a(t,"class","text-gray-400")},m(n,r){B(n,t,r)},p:Be,d(n){n&&R(t)}}}function ud(e){let t,n=e[122].url+"",r,i;return{c(){t=b("a"),r=j(n),a(t,"href",i=e[122].url),a(t,"target","_blank"),a(t,"rel","noopener noreferrer"),a(t,"class","text-indigo-600 hover:underline break-all")},m(l,o){B(l,t,o),c(t,r)},p(l,o){o[0]&128&&n!==(n=l[122].url+"")&&$(r,n),o[0]&128&&i!==(i=l[122].url)&&a(t,"href",i)},d(l){l&&R(t)}}}function cs(e){let t,n=Le(e[122].labels),r=[];for(let i=0;i<n.length;i+=1)r[i]=fs(Do(e,n,i));return{c(){for(let i=0;i<r.length;i+=1)r[i].c();t=bt()},m(i,l){for(let o=0;o<r.length;o+=1)r[o]&&r[o].m(i,l);B(i,t,l)},p(i,l){if(l[0]&128|l[1]&131072){n=Le(i[122].labels);let o;for(o=0;o<n.length;o+=1){const s=Do(i,n,o);r[o]?r[o].p(s,l):(r[o]=fs(s),r[o].c(),r[o].m(t.parentNode,t))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(i){i&&R(t),it(r,i)}}}function fs(e){let t,n=e[125].name+"",r,i,l,o,s,u;function f(){return e[96](e[122],e[125])}return{c(){t=b("span"),r=j(n),i=L(),l=b("button"),l.textContent="×",o=L(),a(l,"class","ml-0.5 hover:opacity-70"),a(l,"title","Remove label"),a(t,"class","inline-flex items-center gap-0.5 px-2 py-0.5 rounded text-xs font-medium text-white"),ct(t,"background-color",e[125].color)},m(d,h){B(d,t,h),c(t,r),c(t,i),c(t,l),c(t,o),s||(u=Q(l,"click",Bt(f)),s=!0)},p(d,h){e=d,h[0]&128&&n!==(n=e[125].name+"")&&$(r,n),h[0]&128&&ct(t,"background-color",e[125].color)},d(d){d&&R(t),s=!1,u()}}}function ds(e){let t,n,r,i,l,o,s=Le(e[14]),u=[];for(let d=0;d<s.length;d+=1)u[d]=ps(Po(e,s,d));let f=e[14].length===0&&gs();return{c(){t=b("div"),n=L(),r=b("div");for(let d=0;d<u.length;d+=1)u[d].c();i=L(),f&&f.c(),a(t,"class","fixed inset-0 z-40"),a(t,"role","presentation"),a(r,"class","absolute left-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 g=0;g<u.length;g+=1)u[g]&&u[g].m(r,null);c(r,i),f&&f.m(r,null),l||(o=Q(t,"click",Bt(e[98])),l=!0)},p(d,h){if(h[0]&16512|h[1]&131072){s=Le(d[14]);let g;for(g=0;g<s.length;g+=1){const p=Po(d,s,g);u[g]?u[g].p(p,h):(u[g]=ps(p),u[g].c(),u[g].m(r,i))}for(;g<u.length;g+=1)u[g].d(1);u.length=s.length}d[14].length===0?f||(f=gs(),f.c(),f.m(r,null)):f&&(f.d(1),f=null)},d(d){d&&(R(t),R(n),R(r)),it(u,d),f&&f.d(),l=!1,o()}}}function hs(e){let t,n;return{c(){t=pe("svg"),n=pe("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,i){B(r,t,i),c(t,n)},d(r){r&&R(t)}}}function ps(e){let t,n,r,i,l=e[125].name+"",o,s,u=e[122].labels&&e[122].labels.some(h),f,d;function h(..._){return e[63](e[125],..._)}let g=u&&hs();function p(){return e[99](e[122],e[125])}return{c(){t=b("button"),n=b("span"),r=L(),i=b("span"),o=j(l),s=L(),g&&g.c(),a(n,"class","w-3 h-3 rounded-full shrink-0"),ct(n,"background-color",e[125].color),a(i,"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(_,t,m),c(t,n),c(t,r),c(t,i),c(i,o),c(t,s),g&&g.m(t,null),f||(d=Q(t,"click",Bt(p)),f=!0)},p(_,m){e=_,m[0]&16384&&ct(n,"background-color",e[125].color),m[0]&16384&&l!==(l=e[125].name+"")&&$(o,l),m[0]&16512&&(u=e[122].labels&&e[122].labels.some(h)),u?g||(g=hs(),g.c(),g.m(t,null)):g&&(g.d(1),g=null)},d(_){_&&R(t),g&&g.d(),f=!1,d()}}}function gs(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&&R(t)}}}function cd(e){let t;return{c(){t=b("div"),t.textContent="No screenshot yet",a(t,"class","shrink-0 w-[280px] h-[160px] rounded border border-gray-200 bg-gray-100 flex items-center justify-center text-xs text-gray-400")},m(n,r){B(n,t,r)},p:Be,d(n){n&&R(t)}}}function fd(e){let t;return{c(){t=b("div"),t.innerHTML='<svg width="32" height="32" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"><defs><style>@keyframes sspin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}#sr{animation:sspin 1.2s linear infinite;transform-origin:40px 40px}</style></defs><g id="sr"><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></g></svg>',a(t,"class","shrink-0 w-[280px] h-[160px] rounded border border-gray-200 bg-gray-100 flex items-center justify-center")},m(n,r){B(n,t,r)},p:Be,d(n){n&&R(t)}}}function dd(e){let t,n,r,i,l,o,s;return{c(){t=b("div"),n=b("p"),n.textContent="Page Screenshot",r=L(),i=b("a"),l=b("img"),a(n,"class","text-xs text-gray-400 mb-1"),yi(l.src,o="data:image/jpeg;base64,"+e[30][e[122].url])||a(l,"src",o),a(l,"alt","Page screenshot"),a(l,"class","rounded border border-gray-200 shadow-sm max-w-[280px] hover:opacity-90 transition-opacity"),a(i,"href",s=e[122].url),a(i,"target","_blank"),a(i,"rel","noopener noreferrer"),a(t,"class","shrink-0")},m(u,f){B(u,t,f),c(t,n),c(t,r),c(t,i),c(i,l)},p(u,f){f[0]&1073741952&&!yi(l.src,o="data:image/jpeg;base64,"+u[30][u[122].url])&&a(l,"src",o),f[0]&128&&s!==(s=u[122].url)&&a(i,"href",s)},d(u){u&&R(t)}}}function ms(e,t){let n,r,i,l,o,s,u,f,d=t[122].key+"",h,g,p,_,m,y,v,w,C,x,A,M,z=(t[122].context||"—")+"",E,P,I,D,T,N,k,F,re;function V(){return t[89](t[122])}function oe(){return t[90](t[122])}function Y(){return t[91](t[122])}let ie=t[122].labels&&t[122].labels.length>0&&ss(t);function Z(_e,fe){return _e[0]==="approved"?sd:od}let H=Z(t),ce=H(t);function se(){return t[95](t[122])}let ee=t[29]===t[122].key_id&&us(t);return{key:e,first:null,c(){n=b("tr"),r=b("td"),i=b("input"),o=L(),s=b("td"),u=b("div"),f=b("span"),h=j(d),g=L(),p=b("button"),p.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>',_=L(),m=b("button"),y=j("ARIA"),C=L(),ie&&ie.c(),A=L(),M=b("td"),E=j(z),I=L(),D=b("td"),ce.c(),N=L(),ee&&ee.c(),k=bt(),a(i,"type","checkbox"),i.checked=l=t[13].has(t[122].key_id),a(i,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(r,"class","px-3 py-2"),a(f,"class","truncate flex-1 min-w-0"),a(p,"class","shrink-0 p-0.5 text-gray-300 hover:text-indigo-500 transition-colors rounded"),a(p,"title","Edit vars"),a(m,"class",v="shrink-0 px-1 py-0.5 text-[10px] font-semibold rounded transition-colors "+(t[40](t[122])?"text-indigo-600 bg-indigo-50 hover:bg-indigo-100":"text-gray-300 hover:text-indigo-500")),a(m,"title",w=t[40](t[122])?"Edit ARIA accessibility attributes":"Add ARIA accessibility attributes"),a(u,"class","flex items-center gap-1 min-w-0"),a(s,"class","px-3 py-2 font-mono text-sm text-gray-700 max-w-[250px]"),a(s,"title",x=t[122].key),a(M,"class","px-3 py-2 text-xs text-gray-400 max-w-[180px] truncate"),a(M,"title",P=t[122].context),a(D,"class","px-3 py-2"),a(n,"class",T="border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer "+(!t[122].value&&t[0]==="approved"?"bg-amber-50":"")+" "+(t[29]===t[122].key_id?"bg-indigo-50":"")),this.first=n},m(_e,fe){B(_e,n,fe),c(n,r),c(r,i),c(n,o),c(n,s),c(s,u),c(u,f),c(f,h),c(u,g),c(u,p),c(u,_),c(u,m),c(m,y),c(s,C),ie&&ie.m(s,null),c(n,A),c(n,M),c(M,E),c(n,I),c(n,D),ce.m(D,null),B(_e,N,fe),ee&&ee.m(_e,fe),B(_e,k,fe),F||(re=[Q(i,"change",V),Q(r,"click",Bt(t[66])),Q(p,"click",Bt(oe)),Q(m,"click",Bt(Y)),Q(s,"click",Bt(t[65])),Q(D,"click",Bt(t[64])),Q(n,"click",se)],F=!0)},p(_e,fe){t=_e,fe[0]&8320&&l!==(l=t[13].has(t[122].key_id))&&(i.checked=l),fe[0]&128&&d!==(d=t[122].key+"")&&$(h,d),fe[0]&128&&v!==(v="shrink-0 px-1 py-0.5 text-[10px] font-semibold rounded transition-colors "+(t[40](t[122])?"text-indigo-600 bg-indigo-50 hover:bg-indigo-100":"text-gray-300 hover:text-indigo-500"))&&a(m,"class",v),fe[0]&128&&w!==(w=t[40](t[122])?"Edit ARIA accessibility attributes":"Add ARIA accessibility attributes")&&a(m,"title",w),t[122].labels&&t[122].labels.length>0?ie?ie.p(t,fe):(ie=ss(t),ie.c(),ie.m(s,null)):ie&&(ie.d(1),ie=null),fe[0]&128&&x!==(x=t[122].key)&&a(s,"title",x),fe[0]&128&&z!==(z=(t[122].context||"—")+"")&&$(E,z),fe[0]&128&&P!==(P=t[122].context)&&a(M,"title",P),H===(H=Z(t))&&ce?ce.p(t,fe):(ce.d(1),ce=H(t),ce&&(ce.c(),ce.m(D,null))),fe[0]&536871041&&T!==(T="border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer "+(!t[122].value&&t[0]==="approved"?"bg-amber-50":"")+" "+(t[29]===t[122].key_id?"bg-indigo-50":""))&&a(n,"class",T),t[29]===t[122].key_id?ee?ee.p(t,fe):(ee=us(t),ee.c(),ee.m(k.parentNode,k)):ee&&(ee.d(1),ee=null)},d(_e){_e&&(R(n),R(N),R(k)),ie&&ie.d(),ce.d(),ee&&ee.d(_e),F=!1,$e(re)}}}function _s(e){let t,n,r,i,l,o,s,u,f,d,h,g,p,_,m,y,v,w,C,x,A,M,z,E,P,I,D,T,N;return{c(){t=b("div"),n=b("button"),r=j("«"),l=L(),o=b("button"),s=j("‹"),f=L(),d=b("span"),h=j("Page "),g=j(e[19]),p=j(" of "),_=j(e[38]),m=L(),y=b("button"),v=j("›"),C=L(),x=b("button"),A=j("»"),z=L(),E=b("select"),P=b("option"),P.textContent="25 / page",I=b("option"),I.textContent="50 / page",D=b("option"),D.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=i=e[19]<=1,a(o,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),o.disabled=u=e[19]<=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[19]>=e[38],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[19]>=e[38],P.__value=25,Ee(P,P.__value),I.__value=50,Ee(I,I.__value),D.__value=100,Ee(D,D.__value),a(E,"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[1]===void 0&&Et(()=>e[104].call(E)),a(t,"class","flex items-center gap-1")},m(k,F){B(k,t,F),c(t,n),c(n,r),c(t,l),c(t,o),c(o,s),c(t,f),c(t,d),c(d,h),c(d,g),c(d,p),c(d,_),c(t,m),c(t,y),c(y,v),c(t,C),c(t,x),c(x,A),c(t,z),c(t,E),c(E,P),c(E,I),c(E,D),pt(E,e[1],!0),T||(N=[Q(n,"click",e[100]),Q(o,"click",e[101]),Q(y,"click",e[102]),Q(x,"click",e[103]),Q(E,"change",e[104]),Q(E,"change",e[105])],T=!0)},p(k,F){F[0]&524288&&i!==(i=k[19]<=1)&&(n.disabled=i),F[0]&524288&&u!==(u=k[19]<=1)&&(o.disabled=u),F[0]&524288&&$(g,k[19]),F[1]&128&&$(_,k[38]),F[0]&524288|F[1]&128&&w!==(w=k[19]>=k[38])&&(y.disabled=w),F[0]&524288|F[1]&128&&M!==(M=k[19]>=k[38])&&(x.disabled=M),F[0]&2&&pt(E,k[1])},d(k){k&&R(t),T=!1,$e(N)}}}function hd(e){let t;return{c(){t=b("p"),t.textContent="Trash is empty."},m(n,r){B(n,t,r)},p:Be,d(n){n&&R(t)}}}function pd(e){let t,n,r;return{c(){t=b("p"),t.textContent="No approved phrases yet.",n=L(),r=b("p"),r.textContent="Move phrases from Pending to start serving translations.",a(r,"class","text-sm mt-1")},m(i,l){B(i,t,l),B(i,n,l),B(i,r,l)},p:Be,d(i){i&&(R(t),R(n),R(r))}}}function gd(e){let t,n,r;return{c(){t=b("p"),t.textContent="No pending phrases.",n=L(),r=b("p"),r.textContent="Add the CDN script to a page to auto-discover text.",a(r,"class","text-sm mt-1")},m(i,l){B(i,t,l),B(i,n,l),B(i,r,l)},p:Be,d(i){i&&(R(t),R(n),R(r))}}}function md(e){let t,n,r,i;return{c(){t=b("p"),n=j('No results for "'),r=j(e[9]),i=j('"')},m(l,o){B(l,t,o),c(t,n),c(t,r),c(t,i)},p(l,o){o[0]&512&&$(r,l[9])},d(l){l&&R(t)}}}function bs(e){let t,n,r,i,l,o,s,u,f,d,h,g;return f=new Vf({props:{phraseKey:e[34].key,varSlots:e[107](),onSave:e[56]}}),{c(){t=b("div"),n=b("div"),r=b("div"),i=b("h2"),i.textContent="Edit Phrase Slots",l=L(),o=b("button"),o.textContent="×",s=L(),u=b("div"),mn(f.$$.fragment),a(i,"class","text-sm font-semibold text-gray-800"),a(o,"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(u,"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"),ct(t,"background","rgba(0,0,0,0.45)")},m(p,_){B(p,t,_),c(t,n),c(n,r),c(r,i),c(r,l),c(r,o),c(n,s),c(n,u),un(f,u,null),d=!0,h||(g=[Q(o,"click",e[106]),Q(t,"click",Nl(e[108]))],h=!0)},p(p,_){const m={};_[1]&8&&(m.phraseKey=p[34].key),_[1]&8&&(m.varSlots=p[107]()),f.$set(m)},i(p){d||(_t(f.$$.fragment,p),d=!0)},o(p){kt(f.$$.fragment,p),d=!1},d(p){p&&R(t),cn(f),h=!1,$e(g)}}}function ys(e){let t,n,r,i,l,o,s,u,f,d,h,g;return f=new Jf({props:{phraseKey:e[35].key,context:e[35].context||"",attributes:e[36][e[35].key+"\0"+(e[35].context||"")]||{},onSave:e[45]}}),{c(){t=b("div"),n=b("div"),r=b("div"),i=b("h2"),i.textContent="Accessibility (ARIA)",l=L(),o=b("button"),o.textContent="×",s=L(),u=b("div"),mn(f.$$.fragment),a(i,"class","text-sm font-semibold text-gray-800"),a(o,"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(u,"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"),ct(t,"background","rgba(0,0,0,0.45)")},m(p,_){B(p,t,_),c(t,n),c(n,r),c(r,i),c(r,l),c(r,o),c(n,s),c(n,u),un(f,u,null),d=!0,h||(g=[Q(o,"click",e[109]),Q(t,"click",Nl(e[110]))],h=!0)},p(p,_){const m={};_[1]&16&&(m.phraseKey=p[35].key),_[1]&16&&(m.context=p[35].context||""),_[1]&48&&(m.attributes=p[36][p[35].key+"\0"+(p[35].context||"")]||{}),f.$set(m)},i(p){d||(_t(f.$$.fragment,p),d=!0)},o(p){kt(f.$$.fragment,p),d=!1},d(p){p&&R(t),cn(f),h=!1,$e(g)}}}function _d(e){let t,n,r,i,l,o,s,u,f,d,h,g,p,_,m,y,v,w,C,x,A,M,z,E,P,I,D,T,N,k,F,re,V,oe,Y,ie,Z,H,ce,se,ee=Le(["pending","approved","trash"]),_e=[];for(let q=0;q<3;q+=1)_e[q]=Wo(Ho(e,ee,q));let fe=e[0]==="approved"&&Zo(e),ye=(e[0]==="pending"||e[0]==="approved")&&qo(e),G=Le(e[5]),de=[];for(let q=0;q<G.length;q+=1)de[q]=Ko(Uo(e,G,q));let ue=Le(e[14]),te=[];for(let q=0;q<ue.length;q+=1)te[q]=Jo(jo(e,ue,q));let Se=e[23]&&Go(e),S=e[24]&&Xo(e),X=(e[13].size>0||e[20])&&Qo(e);function J(q,K){return q[18]?ld:q[7].length===0?id:rd}let U=J(e),O=U(e),W=e[34]&&bs(e),le=e[35]&&ys(e);return{c(){t=b("div"),n=b("div"),r=b("div");for(let q=0;q<3;q+=1)_e[q].c();i=L(),l=b("div"),fe&&fe.c(),o=L(),ye&&ye.c(),s=L(),u=b("div"),f=b("select");for(let q=0;q<de.length;q+=1)de[q].c();d=L(),h=b("div"),g=b("select"),p=b("option"),p.textContent="All fields",_=b("option"),_.textContent="Key",m=b("option"),m.textContent="Context",y=b("option"),y.textContent="Translation",v=L(),w=b("div"),C=b("input"),A=L(),M=b("span"),M.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>',z=L(),E=b("select"),P=b("option"),P.textContent="All",I=b("option"),I.textContent="Translated",D=b("option"),D.textContent="Not Translated",T=L(),N=b("select"),k=b("option"),k.textContent="All Labels";for(let q=0;q<te.length;q+=1)te[q].c();F=L(),Se&&Se.c(),re=L(),S&&S.c(),V=L(),X&&X.c(),oe=L(),O.c(),Y=L(),W&&W.c(),ie=L(),le&&le.c(),Z=bt(),a(r,"class","flex items-center gap-1"),a(l,"class","flex items-center gap-2 -mb-px pb-2"),a(n,"class","flex items-center justify-between mb-4 border-b border-gray-200"),a(f,"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&&Et(()=>e[72].call(f)),p.__value="all",Ee(p,p.__value),_.__value="key",Ee(_,_.__value),m.__value="context",Ee(m,m.__value),y.__value="translation",Ee(y,y.__value),a(g,"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[10]===void 0&&Et(()=>e[73].call(g)),a(C,"type","text"),a(C,"placeholder",x=e[10]==="key"?"Search by key…":e[10]==="context"?"Search by context…":e[10]==="translation"?"Search by translated value…":"Search keys, context, translations…"),a(C,"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(M,"class","absolute left-2.5 top-2.5 text-gray-400"),a(w,"class","flex-1 relative"),a(h,"class","flex-1 flex gap-0"),P.__value="all",Ee(P,P.__value),I.__value="yes",Ee(I,I.__value),D.__value="no",Ee(D,D.__value),a(E,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[11]===void 0&&Et(()=>e[76].call(E)),k.__value="",Ee(k,k.__value),a(N,"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&&Et(()=>e[78].call(N)),a(u,"class","flex flex-wrap items-center gap-3 mb-4")},m(q,K){B(q,t,K),c(t,n),c(n,r);for(let ne=0;ne<3;ne+=1)_e[ne]&&_e[ne].m(r,null);c(n,i),c(n,l),fe&&fe.m(l,null),c(l,o),ye&&ye.m(l,null),c(t,s),c(t,u),c(u,f);for(let ne=0;ne<de.length;ne+=1)de[ne]&&de[ne].m(f,null);pt(f,e[6],!0),c(u,d),c(u,h),c(h,g),c(g,p),c(g,_),c(g,m),c(g,y),pt(g,e[10],!0),c(h,v),c(h,w),c(w,C),Ee(C,e[9]),c(w,A),c(w,M),c(u,z),c(u,E),c(E,P),c(E,I),c(E,D),pt(E,e[11],!0),c(u,T),c(u,N),c(N,k);for(let ne=0;ne<te.length;ne+=1)te[ne]&&te[ne].m(N,null);pt(N,e[12],!0),c(t,F),Se&&Se.m(t,null),c(t,re),S&&S.m(t,null),c(t,V),X&&X.m(t,null),c(t,oe),O.m(t,null),B(q,Y,K),W&&W.m(q,K),B(q,ie,K),le&&le.m(q,K),B(q,Z,K),H=!0,ce||(se=[Q(f,"change",e[72]),Q(f,"change",e[47]),Q(g,"change",e[73]),Q(g,"change",e[74]),Q(C,"input",e[75]),Q(C,"input",e[51]),Q(E,"change",e[76]),Q(E,"change",e[77]),Q(N,"change",e[78]),Q(N,"change",e[79])],ce=!0)},p(q,K){if(K[0]&257|K[1]&536903680){ee=Le(["pending","approved","trash"]);let ne;for(ne=0;ne<3;ne+=1){const ke=Ho(q,ee,ne);_e[ne]?_e[ne].p(ke,K):(_e[ne]=Wo(ke),_e[ne].c(),_e[ne].m(r,null))}for(;ne<3;ne+=1)_e[ne].d(1)}if(q[0]==="approved"?fe?fe.p(q,K):(fe=Zo(q),fe.c(),fe.m(l,o)):fe&&(fe.d(1),fe=null),q[0]==="pending"||q[0]==="approved"?ye?ye.p(q,K):(ye=qo(q),ye.c(),ye.m(l,null)):ye&&(ye.d(1),ye=null),K[0]&32){G=Le(q[5]);let ne;for(ne=0;ne<G.length;ne+=1){const ke=Uo(q,G,ne);de[ne]?de[ne].p(ke,K):(de[ne]=Ko(ke),de[ne].c(),de[ne].m(f,null))}for(;ne<de.length;ne+=1)de[ne].d(1);de.length=G.length}if(K[0]&96&&pt(f,q[6]),K[0]&1024&&pt(g,q[10]),(!H||K[0]&1024&&x!==(x=q[10]==="key"?"Search by key…":q[10]==="context"?"Search by context…":q[10]==="translation"?"Search by translated value…":"Search keys, context, translations…"))&&a(C,"placeholder",x),K[0]&512&&C.value!==q[9]&&Ee(C,q[9]),K[0]&2048&&pt(E,q[11]),K[0]&16384){ue=Le(q[14]);let ne;for(ne=0;ne<ue.length;ne+=1){const ke=jo(q,ue,ne);te[ne]?te[ne].p(ke,K):(te[ne]=Jo(ke),te[ne].c(),te[ne].m(N,null))}for(;ne<te.length;ne+=1)te[ne].d(1);te.length=ue.length}K[0]&20480&&pt(N,q[12]),q[23]?Se?Se.p(q,K):(Se=Go(q),Se.c(),Se.m(t,re)):Se&&(Se.d(1),Se=null),q[24]?S?S.p(q,K):(S=Xo(q),S.c(),S.m(t,V)):S&&(S.d(1),S=null),q[13].size>0||q[20]?X?X.p(q,K):(X=Qo(q),X.c(),X.m(t,oe)):X&&(X.d(1),X=null),U===(U=J(q))&&O?O.p(q,K):(O.d(1),O=U(q),O&&(O.c(),O.m(t,null))),q[34]?W?(W.p(q,K),K[1]&8&&_t(W,1)):(W=bs(q),W.c(),_t(W,1),W.m(ie.parentNode,ie)):W&&(cr(),kt(W,1,1,()=>{W=null}),fr()),q[35]?le?(le.p(q,K),K[1]&16&&_t(le,1)):(le=ys(q),le.c(),_t(le,1),le.m(Z.parentNode,Z)):le&&(cr(),kt(le,1,1,()=>{le=null}),fr())},i(q){H||(_t(W),_t(le),H=!0)},o(q){kt(W),kt(le),H=!1},d(q){q&&(R(t),R(Y),R(ie),R(Z)),it(_e,q),fe&&fe.d(),ye&&ye.d(),it(de,q),it(te,q),Se&&Se.d(),S&&S.d(),X&&X.d(),O.d(),W&&W.d(q),le&&le.d(q),ce=!1,$e(se)}}}const li=50;function bd(e){return e.key+"\0"+(e.context||"")}function vs(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 yd(e,t,n){let r,i,l;Or(e,Yt,he=>n(112,l=he));let{params:o={}}=t;const s=["pending","approved","trash"],u=[25,50,100];let d=[{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 h(he){const Ie=new URLSearchParams(he||"");return{page:Math.max(1,parseInt(Ie.get("page"),10)||1),pageSize:u.includes(parseInt(Ie.get("pageSize"),10))?parseInt(Ie.get("pageSize"),10):50,lang:Ie.get("lang")||null,search:Ie.get("search")||"",filter:["all","yes","no"].includes(Ie.get("filter"))?Ie.get("filter"):"all",label:Ie.get("label")||""}}let g="zh-Hans",p=s.includes(o.tab)?o.tab:"pending",_=[],m={pending:0,approved:0,trash:0},y="",v="all",w="all",C="",x=new Set,A=!1,M=[],z=null,E=!1,P=!1,I=!1,D=1,T=50,N=0;function k(){const he=new URLSearchParams;D>1&&he.set("page",D),T!==50&&he.set("pageSize",T),g&&he.set("lang",g),y.trim()&&he.set("search",y.trim()),w!=="all"&&he.set("filter",w),C&&he.set("label",C);const Ie=he.toString(),ot=`/translations/${s.includes(o.tab)?o.tab:p}${Ie?"?"+Ie:""}`;window.location.replace("#"+ot)}let F=!1,re="",V=0,oe=0,Y=0,ie=!1,Z=!1,H="",ce="",se="",ee="",_e=null,fe={},ye=!1,G="",de=!1,ue=null,te=null,Se={};function S(he){const Ie=Se[bd(he)];return Ie&&Object.keys(Ie).length>0}async function X(){n(31,ye=!0),n(32,G=""),n(33,de=!1);try{const he=await je("../api/export");if(!he.ok)throw new Error("Export failed");const Ie=await he.json();if(Ie.error)throw new Error(Ie.error);const Ge=new Blob([JSON.stringify(Ie,null,2)],{type:"application/json"});vs(Ge,"loco-translations.json"),n(32,G="Downloaded!"),setTimeout(()=>n(32,G=""),2e3)}catch(he){n(32,G=he.message||"Export failed"),setTimeout(()=>n(32,G=""),3e3)}finally{n(31,ye=!1)}}async function J(){n(31,ye=!0),n(32,G=""),n(33,de=!1);try{const he=await je("../api/export");if(!he.ok)throw new Error("Export failed");const Ie=await he.json();if(Ie.error)throw new Error(Ie.error);const Ge=Ie.languages||[];if(Ge.length===0)throw new Error("No translations to export");const ot=new Qf;for(const mt of Ge){const Zt={languages:[mt],languageNames:Ie.languageNames,translations:{[mt]:Ie.translations[mt]},timestamp:Ie.timestamp};ot.file(`${mt}.json`,JSON.stringify(Zt,null,2))}const St=await ot.generateAsync({type:"blob"});vs(St,"loco-translations.zip"),n(32,G=`Downloaded ZIP with ${Ge.length} language(s)!`),setTimeout(()=>n(32,G=""),2e3)}catch(he){n(32,G=he.message||"Export failed"),setTimeout(()=>n(32,G=""),3e3)}finally{n(31,ye=!1)}}async function U(he){if(!he||fe[he]!==void 0)return;n(30,fe[he]=null,fe);const Ge=await(await je(`../api/screenshots?url=${encodeURIComponent(he)}`)).json();n(30,fe[he]=Ge.screenshot||!1,fe),n(30,fe)}br(()=>{const he=window.location.hash||"",Ie=he.indexOf("?"),Ge=Ie>=0?he.slice(Ie+1):"",ot=h(Ge);n(19,D=ot.page),n(1,T=ot.pageSize),n(9,y=ot.search),n(11,w=ot.filter),n(12,C=ot.label);try{const St=JSON.parse(l.settings||"{}");St.languages&&St.languages.length&&n(5,d=St.languages)}catch{}ot.lang?n(6,g=ot.lang):d.length&&n(6,g=d[0].code||d[0]),n(62,A=!0),k(),O(),ge()});async function O(){n(18,I=!0),await Promise.all([W(),le(),q()]),n(18,I=!1)}async function W(){const he=new URLSearchParams({lang:g,status:p,page:D,limit:T});y.trim()&&(he.set("search",y.trim()),v!=="all"&&he.set("search_field",v)),w!=="all"&&he.set("translated",w),C&&he.set("label",C);const Ge=await(await je(`../api/translations/all?${he}`)).json();n(7,_=Ge.rows),n(2,N=Ge.total),n(13,x=new Set),n(17,P=!1)}async function le(){const he=await je("../api/translations/counts");n(8,m=await he.json())}async function q(){try{const he=await je("../api/aria/all");if(!he.ok)return;const Ie=await he.json(),Ge={};for(const ot of Ie)Ge[ot.key+"\0"+(ot.context||"")]=ot.attributes||{};n(36,Se=Ge)}catch(he){console.warn("[loco] Failed to load ARIA rules:",he)}}async function K(he){const Ie=te;if(Ie){n(35,te=null);try{const Ge=await je("../api/aria",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:Ie.key,context:Ie.context||"",attributes:he})});if(!Ge.ok)throw new Error(`Save failed (HTTP ${Ge.status})`);const ot=Ie.key+"\0"+(Ie.context||"");if(he&&Object.keys(he).length>0)n(36,Se={...Se,[ot]:he});else{const St={...Se};delete St[ot],n(36,Se=St)}}catch(Ge){console.warn("[loco] Failed to save ARIA rule:",Ge)}}}function ne(he){nr(`/translations/${he}`)}function ke(){n(19,D=1),k(),O()}async function ge(){const he=await je("../api/labels");he.ok&&n(14,M=await he.json())}async function Ce(he,Ie,Ge){Ge.some(St=>St.id===Ie)?await je(`../api/labels/${Ie}/unassign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({textnodeIds:[he]})}):await je(`../api/labels/${Ie}/assign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({textnodeIds:[he]})}),await W(),n(15,z=null)}async function Fe(he){x.size!==0&&(await je(`../api/labels/${he}/assign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({textnodeIds:[...x]})}),n(16,E=!1),await W(),await ge())}async function Me(he){x.size!==0&&(await je(`../api/labels/${he}/unassign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({textnodeIds:[...x]})}),n(16,E=!1),await W(),await ge())}let We;function Ze(){clearTimeout(We),We=setTimeout(()=>{n(19,D=1),k(),W()},300)}function Pe(he){x.has(he)?x.delete(he):x.add(he),n(13,x=new Set(x)),n(17,P=x.size===_.length&&_.length>0)}function Xe(){P?(n(13,x=new Set),n(17,P=!1)):(n(13,x=new Set(_.map(he=>he.key_id))),n(17,P=!0))}const He={pending:"Moving to Pending",approved:"Approving",trash:"Trashing"};async function et(he){if(x.size===0||F)return;const Ie=[...x];n(20,F=!0),n(21,re=He[he]||"Moving"),n(3,V=0),n(4,oe=Ie.length),n(22,Y=0),await ur();try{for(let Ge=0;Ge<Ie.length;Ge+=li){const ot=Ie.slice(Ge,Ge+li);try{(await je("../api/textnodes/status",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:ot,status:he})})).ok||n(22,Y+=ot.length)}catch{n(22,Y+=ot.length)}n(3,V=Math.min(Ge+ot.length,Ie.length))}await O()}finally{n(20,F=!1),Y===0&&(n(3,V=0),n(4,oe=0))}}async function tt(){if(x.size===0||F||!confirm(`Permanently delete ${x.size} item(s)? This cannot be undone.`))return;const he=[...x];n(20,F=!0),n(21,re="Deleting"),n(3,V=0),n(4,oe=he.length),n(22,Y=0),await ur();try{for(let Ie=0;Ie<he.length;Ie+=li){const Ge=he.slice(Ie,Ie+li);try{(await je("../api/textnodes/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:Ge})})).ok||n(22,Y+=Ge.length)}catch{n(22,Y+=Ge.length)}n(3,V=Math.min(Ie+Ge.length,he.length))}await O()}finally{n(20,F=!1),Y===0&&(n(3,V=0),n(4,oe=0))}}async function rt(he,Ie){const Ge=ue;if(!Ge)return;const ot=Ge.key,St=Ge.var_slots;n(7,_=_.map(mt=>mt.key_id===Ge.key_id?{...mt,key:he,var_slots:JSON.stringify(Ie)}:mt)),n(34,ue=null);try{const mt=await je(`../api/phrases/${Ge.key_id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:he,varSlots:Ie})});if(!mt.ok){const Zt=await mt.json().catch(()=>({}));throw new Error(Zt.error||`Save failed (HTTP ${mt.status})`)}await Promise.all([W(),le()])}catch(mt){n(7,_=_.map(Zt=>Zt.key_id===Ge.key_id?{...Zt,key:ot,var_slots:St}:Zt)),console.warn("[loco] Failed to save var edits:",mt)}}async function we(he){await je("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:g,translations:{[he.key]:he.value||""}})})}async function be(){H.trim()&&(await je("../api/textnodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:H.trim(),context:ce.trim(),status:p})}),se.trim()&&await je("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:g,translations:[{key:H.trim(),context:ce.trim(),value:se.trim()}]})}),n(25,H=""),n(26,ce=""),n(27,se=""),n(23,ie=!1),await O())}async function ae(){let he;try{he=JSON.parse(ee)}catch{alert("Invalid JSON");return}await je("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:g,translations:he})}),n(28,ee=""),n(24,Z=!1),await O()}const Ne={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"}]}},Ae=(he,Ie)=>Ie.id===he.id;function xe(he){lr.call(this,e,he)}function Re(he){lr.call(this,e,he)}function ve(he){lr.call(this,e,he)}const Ye=he=>ne(he),Ke=()=>n(33,de=!de),ht=()=>n(33,de=!1),Gt=()=>{n(24,Z=!Z),n(23,ie=!1)},Lt=()=>{n(23,ie=!ie),n(24,Z=!1)};function Xt(){g=qt(this),n(6,g),n(5,d)}function Wt(){v=qt(this),n(10,v),n(62,A),n(61,o),n(0,p)}const Qt=()=>{y.trim()&&(n(19,D=1),k(),W())};function me(){y=this.value,n(9,y),n(62,A),n(61,o),n(0,p)}function De(){w=qt(this),n(11,w),n(62,A),n(61,o),n(0,p)}const Ue=()=>{n(19,D=1),k(),W()};function nt(){C=qt(this),n(12,C),n(14,M)}const gt=()=>{n(19,D=1),k(),W()};function ft(){H=this.value,n(25,H)}function lt(){ce=this.value,n(26,ce)}function dt(){se=this.value,n(27,se)}function Je(){ee=this.value,n(28,ee)}const Oe=he=>et(he.status),ze=()=>n(16,E=!E),Ve=()=>n(16,E=!1),xt=he=>Fe(he.id),Qe=he=>Me(he.id),Hn=he=>Pe(he.key_id),Wn=he=>{n(34,ue=he)},vr=he=>{n(35,te=he)},Zr=he=>{n(12,C=String(he.id)),n(19,D=1),k(),W()},Nt=(he,Ie,Ge,ot)=>n(7,Ie[Ge].value=ot.target.value,_),vn=he=>we(he),Zn=he=>{const Ie=_e===he.key_id;n(29,_e=Ie?null:he.key_id),!Ie&&he.url&&U(he.url)},Yr=(he,Ie)=>Ce(he.key_id,Ie.id,he.labels),ln=he=>n(15,z=z===he.key_id?null:he.key_id),Vr=()=>n(15,z=null),Yn=(he,Ie)=>Ce(he.key_id,Ie.id,he.labels||[]),qr=()=>{n(19,D=1),k(),W()},wr=()=>{n(19,D--,D),k(),W()},Kr=()=>{n(19,D++,D),k(),W()},Ct=()=>{n(19,D=r),k(),W()};function Vn(){T=qt(this),n(1,T)}const Jr=()=>{n(19,D=1),k(),W()},qn=()=>n(34,ue=null),Gr=()=>{try{return JSON.parse(ue.var_slots||"[]")}catch{return[]}},dn=()=>n(34,ue=null),Kn=()=>n(35,te=null),kr=()=>n(35,te=null);return e.$$set=he=>{"params"in he&&n(61,o=he.params)},e.$$.update=()=>{if(e.$$.dirty[0]&1|e.$$.dirty[1]&1073741824|e.$$.dirty[2]&1&&A){const he=s.includes(o.tab)?o.tab:"pending";he!==p&&(n(0,p=he),n(9,y=""),n(10,v="all"),n(11,w="all"),n(19,D=1),k(),O())}e.$$.dirty[0]&6&&n(38,r=Math.max(1,Math.ceil(N/T))),e.$$.dirty[0]&24&&n(37,i=oe>0?Math.round(V/oe*100):0)},[p,T,N,V,oe,d,g,_,m,y,v,w,C,x,M,z,E,P,I,D,F,re,Y,ie,Z,H,ce,se,ee,_e,fe,ye,G,de,ue,te,Se,i,r,k,S,X,J,U,W,K,ne,ke,Ce,Fe,Me,Ze,Pe,Xe,et,tt,rt,we,be,ae,Ne,o,A,Ae,xe,Re,ve,Ye,Ke,ht,Gt,Lt,Xt,Wt,Qt,me,De,Ue,nt,gt,ft,lt,dt,Je,Oe,ze,Ve,xt,Qe,Hn,Wn,vr,Zr,Nt,vn,Zn,Yr,ln,Vr,Yn,qr,wr,Kr,Ct,Vn,Jr,qn,Gr,dn,Kn,kr]}class ws extends nn{constructor(t){super(),tn(this,t,yd,_d,Jt,{params:61},null,[-1,-1,-1,-1,-1])}}function ks(e,t,n){const r=e.slice();return r[86]=t[n],r}function xs(e,t,n){const r=e.slice();return r[73]=t[n],r}function Cs(e,t,n){const r=e.slice();return r[70]=t[n],r}function Ss(e,t,n){const r=e.slice();return r[73]=t[n],r}function As(e,t,n){const r=e.slice();return r[76]=t[n],r}function Ts(e,t,n){const r=e.slice();return r[79]=t[n],r}function Ms(e,t,n){const r=e.slice();return r[79]=t[n],r}function Es(e,t,n){const r=e.slice();return r[89]=t[n],r}function Ls(e){let t,n,r=e[89].icon+"",i,l=e[89].label+"",o,s,u,f,d;function h(){return e[38](e[89])}return{c(){t=b("button"),n=b("span"),i=L(),o=j(l),s=L(),a(n,"class","inline-flex items-center"),a(t,"class",u="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px "+(e[20]===e[89].id?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))},m(g,p){B(g,t,p),c(t,n),n.innerHTML=r,c(t,i),c(t,o),c(t,s),f||(d=Q(t,"click",h),f=!0)},p(g,p){e=g,p[0]&1048576&&u!==(u="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px "+(e[20]===e[89].id?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))&&a(t,"class",u)},d(g){g&&R(t),f=!1,d()}}}function vd(e){let t,n,r=e[11].length+"",i,l,o,s,u,f,d,h;function g(m,y){return m[11].length===0?Cd:xd}let p=g(e),_=p(e);return{c(){t=b("div"),n=b("p"),i=j(r),l=j(" job(s) in history"),o=L(),s=b("button"),s.textContent="Refresh",u=L(),_.c(),f=bt(),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(m,y){B(m,t,y),c(t,n),c(n,i),c(n,l),c(t,o),c(t,s),B(m,u,y),_.m(m,y),B(m,f,y),d||(h=Q(s,"click",e[26]),d=!0)},p(m,y){y[0]&2048&&r!==(r=m[11].length+"")&&$(i,r),p===(p=g(m))&&_?_.p(m,y):(_.d(1),_=p(m),_&&(_.c(),_.m(f.parentNode,f)))},d(m){m&&(R(t),R(u),R(f)),_.d(m),d=!1,h()}}}function wd(e){let t,n,r=e[3].length+"",i,l,o,s,u,f,d,h,g,p=e[6]&&zs(e);function _(v,w){return v[3].length===0&&!v[6]?Ad:Sd}let m=_(e),y=m(e);return{c(){t=b("div"),n=b("p"),i=j(r),l=j(" prompt template(s)"),o=L(),s=b("button"),s.textContent="+ New Prompt",u=L(),p&&p.c(),f=L(),y.c(),d=bt(),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),c(t,n),c(n,i),c(n,l),c(t,o),c(t,s),B(v,u,w),p&&p.m(v,w),B(v,f,w),y.m(v,w),B(v,d,w),h||(g=Q(s,"click",e[27]),h=!0)},p(v,w){w[0]&8&&r!==(r=v[3].length+"")&&$(i,r),v[6]?p?p.p(v,w):(p=zs(v),p.c(),p.m(f.parentNode,f)):p&&(p.d(1),p=null),m===(m=_(v))&&y?y.p(v,w):(y.d(1),y=m(v),y&&(y.c(),y.m(d.parentNode,d)))},d(v){v&&(R(t),R(u),R(f),R(d)),p&&p.d(v),y.d(v),h=!1,g()}}}function kd(e){let t=e[10].filter(Xs).length>0,n,r=e[10].filter(Gs).length>0,i,l,o,s,u,f,d,h,g,p,_,m,y,v,w,C,x,A,M,z,E,P,I,D,T,N,k,F,re=e[14].size+"",V,oe,Y,ie,Z,H,ce=e[23]!=null?` (${e[23]})`:"",se,ee,_e,fe,ye,G,de,ue,te,Se,S,X,J,U,O,W,le,q,K,ne,ke,ge=t&&Os(e),Ce=r&&Us(e),Fe=Le(e[12]),Me=[];for(let ae=0;ae<Fe.length;ae+=1)Me[ae]=Ws(As(e,Fe,ae));let We=e[3].length===0&&Zs(),Ze=Le(e[3]),Pe=[];for(let ae=0;ae<Ze.length;ae+=1)Pe[ae]=Ys(Ss(e,Ze,ae));let Xe=e[17]&&Vs();function He(ae,Ne){return ae[22]?Ld:Ed}let et=He(e),tt=et(e);function rt(ae,Ne){return ae[13].length===0?zd:Nd}let we=rt(e),be=we(e);return{c(){ge&&ge.c(),n=L(),Ce&&Ce.c(),i=L(),l=b("div"),o=b("div"),s=b("label"),s.textContent="Language",u=L(),f=b("select");for(let ae=0;ae<Me.length;ae+=1)Me[ae].c();d=L(),h=b("div"),g=b("label"),g.textContent="Prompt Template",p=L(),_=b("select"),We&&We.c(),m=bt();for(let ae=0;ae<Pe.length;ae+=1)Pe[ae].c();y=L(),v=b("div"),w=b("div"),w.textContent=" ",C=L(),x=b("label"),A=b("input"),M=j(`
17
+ Include screenshots`),z=L(),E=b("div"),P=L(),I=b("div"),D=b("div"),D.textContent=" ",T=L(),N=b("div"),k=b("button"),Xe&&Xe.c(),F=j(`
18
+ Generate (`),V=j(re),oe=j(" selected)"),ie=L(),Z=b("button"),tt.c(),H=j(`
19
+ Translate All`),se=j(ce),_e=L(),fe=b("div"),ye=b("div"),G=b("input"),de=L(),ue=b("span"),ue.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>',te=L(),Se=b("select"),S=b("option"),S.textContent="All",X=b("option"),X.textContent="Translated",J=b("option"),J.textContent="Not Translated",U=L(),O=b("span"),W=j(e[2]),le=j(" approved items"),q=L(),be.c(),K=bt(),a(s,"for","ai-translate-language"),a(s,"class","text-xs text-gray-500 font-medium"),a(f,"id","ai-translate-language"),a(f,"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&&Et(()=>e[40].call(f)),a(o,"class","flex flex-col gap-1"),a(g,"for","ai-translate-prompt"),a(g,"class","text-xs text-gray-500 font-medium"),a(_,"id","ai-translate-prompt"),a(_,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[4]===void 0&&Et(()=>e[42].call(_)),a(h,"class","flex flex-col gap-1"),a(w,"class","text-xs text-gray-500 font-medium"),a(w,"aria-hidden","true"),a(A,"type","checkbox"),a(A,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(x,"class","flex items-center gap-2 text-sm text-gray-600 cursor-pointer"),a(v,"class","flex flex-col gap-1 justify-end"),a(E,"class","flex-1"),a(D,"class","text-xs text-gray-500 font-medium"),a(D,"aria-hidden","true"),a(k,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"),k.disabled=Y=e[14].size===0||!e[4]||e[17],a(Z,"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"),Z.disabled=ee=!e[4]||e[22]||e[23]===0,a(N,"class","flex items-center gap-2"),a(I,"class","flex flex-col gap-1 justify-end"),a(l,"class","flex flex-wrap items-center gap-3 mb-4 p-4 bg-white border border-gray-200 rounded-lg"),a(G,"type","text"),a(G,"placeholder","Search approved keys…"),a(G,"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(ue,"class","absolute left-2.5 top-2.5 text-gray-400 flex items-center"),a(ye,"class","flex-1 relative"),S.__value="all",Ee(S,S.__value),X.__value="translated",Ee(X,X.__value),J.__value="untranslated",Ee(J,J.__value),a(Se,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[19]===void 0&&Et(()=>e[45].call(Se)),a(O,"class","text-xs text-gray-400"),a(fe,"class","flex items-center gap-3 mb-3")},m(ae,Ne){ge&&ge.m(ae,Ne),B(ae,n,Ne),Ce&&Ce.m(ae,Ne),B(ae,i,Ne),B(ae,l,Ne),c(l,o),c(o,s),c(o,u),c(o,f);for(let Ae=0;Ae<Me.length;Ae+=1)Me[Ae]&&Me[Ae].m(f,null);pt(f,e[0],!0),c(l,d),c(l,h),c(h,g),c(h,p),c(h,_),We&&We.m(_,null),c(_,m);for(let Ae=0;Ae<Pe.length;Ae+=1)Pe[Ae]&&Pe[Ae].m(_,null);pt(_,e[4],!0),c(l,y),c(l,v),c(v,w),c(v,C),c(v,x),c(x,A),A.checked=e[16],c(x,M),c(l,z),c(l,E),c(l,P),c(l,I),c(I,D),c(I,T),c(I,N),c(N,k),Xe&&Xe.m(k,null),c(k,F),c(k,V),c(k,oe),c(N,ie),c(N,Z),tt.m(Z,null),c(Z,H),c(Z,se),B(ae,_e,Ne),B(ae,fe,Ne),c(fe,ye),c(ye,G),Ee(G,e[18]),c(ye,de),c(ye,ue),c(fe,te),c(fe,Se),c(Se,S),c(Se,X),c(Se,J),pt(Se,e[19],!0),c(fe,U),c(fe,O),c(O,W),c(O,le),B(ae,q,Ne),be.m(ae,Ne),B(ae,K,Ne),ne||(ke=[Q(f,"change",e[40]),Q(f,"change",e[41]),Q(_,"change",e[42]),Q(A,"change",e[43]),Q(k,"click",e[34]),Q(Z,"click",e[35]),Q(G,"input",e[44]),Q(G,"input",e[33]),Q(Se,"change",e[45]),Q(Se,"change",e[46])],ne=!0)},p(ae,Ne){if(Ne[0]&1024&&(t=ae[10].filter(Xs).length>0),t?ge?ge.p(ae,Ne):(ge=Os(ae),ge.c(),ge.m(n.parentNode,n)):ge&&(ge.d(1),ge=null),Ne[0]&1024&&(r=ae[10].filter(Gs).length>0),r?Ce?Ce.p(ae,Ne):(Ce=Us(ae),Ce.c(),Ce.m(i.parentNode,i)):Ce&&(Ce.d(1),Ce=null),Ne[0]&4096){Fe=Le(ae[12]);let Ae;for(Ae=0;Ae<Fe.length;Ae+=1){const xe=As(ae,Fe,Ae);Me[Ae]?Me[Ae].p(xe,Ne):(Me[Ae]=Ws(xe),Me[Ae].c(),Me[Ae].m(f,null))}for(;Ae<Me.length;Ae+=1)Me[Ae].d(1);Me.length=Fe.length}if(Ne[0]&4097&&pt(f,ae[0]),ae[3].length===0?We||(We=Zs(),We.c(),We.m(_,m)):We&&(We.d(1),We=null),Ne[0]&8){Ze=Le(ae[3]);let Ae;for(Ae=0;Ae<Ze.length;Ae+=1){const xe=Ss(ae,Ze,Ae);Pe[Ae]?Pe[Ae].p(xe,Ne):(Pe[Ae]=Ys(xe),Pe[Ae].c(),Pe[Ae].m(_,null))}for(;Ae<Pe.length;Ae+=1)Pe[Ae].d(1);Pe.length=Ze.length}Ne[0]&24&&pt(_,ae[4]),Ne[0]&65536&&(A.checked=ae[16]),ae[17]?Xe||(Xe=Vs(),Xe.c(),Xe.m(k,F)):Xe&&(Xe.d(1),Xe=null),Ne[0]&16384&&re!==(re=ae[14].size+"")&&$(V,re),Ne[0]&147480&&Y!==(Y=ae[14].size===0||!ae[4]||ae[17])&&(k.disabled=Y),et!==(et=He(ae))&&(tt.d(1),tt=et(ae),tt&&(tt.c(),tt.m(Z,H))),Ne[0]&8388608&&ce!==(ce=ae[23]!=null?` (${ae[23]})`:"")&&$(se,ce),Ne[0]&12582936&&ee!==(ee=!ae[4]||ae[22]||ae[23]===0)&&(Z.disabled=ee),Ne[0]&262144&&G.value!==ae[18]&&Ee(G,ae[18]),Ne[0]&524288&&pt(Se,ae[19]),Ne[0]&4&&$(W,ae[2]),we===(we=rt(ae))&&be?be.p(ae,Ne):(be.d(1),be=we(ae),be&&(be.c(),be.m(K.parentNode,K)))},d(ae){ae&&(R(n),R(i),R(l),R(_e),R(fe),R(q),R(K)),ge&&ge.d(ae),Ce&&Ce.d(ae),it(Me,ae),We&&We.d(),it(Pe,ae),Xe&&Xe.d(),tt.d(),be.d(ae),ne=!1,$e(ke)}}}function xd(e){let t,n,r,i,l,o=Le(e[11]),s=[];for(let u=0;u<o.length;u+=1)s[u]=Ns(ks(e,o,u));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>',i=L(),l=b("tbody");for(let u=0;u<s.length;u+=1)s[u].c();a(n,"class","w-full"),a(t,"class","bg-white rounded-lg border border-gray-200 overflow-hidden")},m(u,f){B(u,t,f),c(t,n),c(n,r),c(n,i),c(n,l);for(let d=0;d<s.length;d+=1)s[d]&&s[d].m(l,null)},p(u,f){if(f[0]&2048|f[1]&64){o=Le(u[11]);let d;for(d=0;d<o.length;d+=1){const h=ks(u,o,d);s[d]?s[d].p(h,f):(s[d]=Ns(h),s[d].c(),s[d].m(l,null))}for(;d<s.length;d+=1)s[d].d(1);s.length=o.length}},d(u){u&&R(t),it(s,u)}}}function Cd(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:Be,d(n){n&&R(t)}}}function Ns(e){let t,n,r,i,l=e[37](e[86].status)+"",o,s=e[86].status+"",u,f,d,h,g=e[86].job_id+"",p,_,m,y=(e[86].prompt_name||"—")+"",v,w,C,x=e[86].lang+"",A,M,z,E=e[86].completed+"",P,I,D=e[86].total+"",T,N,k=e[86].failed+"",F,re,V,oe,Y=xn(e[86].created_at)+"",ie,Z,H,ce=xn(e[86].finished_at)+"",se,ee;return{c(){t=b("tr"),n=b("td"),r=b("span"),i=new lc(!1),o=L(),u=j(s),d=L(),h=b("td"),p=j(g),_=L(),m=b("td"),v=j(y),w=L(),C=b("td"),A=j(x),M=L(),z=b("td"),P=j(E),I=j("/"),T=j(D),N=j(" ("),F=j(k),re=j(" failed)"),V=L(),oe=b("td"),ie=j(Y),Z=L(),H=b("td"),se=j(ce),ee=L(),i.a=o,a(r,"class",f=xi(e[86].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(m,"class","px-3 py-2 text-sm text-gray-700"),a(C,"class","px-3 py-2 text-sm text-gray-600"),a(z,"class","px-3 py-2 text-sm text-gray-600"),a(oe,"class","px-3 py-2 text-xs text-gray-400"),a(H,"class","px-3 py-2 text-xs text-gray-400"),a(t,"class","border-b border-gray-100 hover:bg-gray-50")},m(_e,fe){B(_e,t,fe),c(t,n),c(n,r),i.m(l,r),c(r,o),c(r,u),c(t,d),c(t,h),c(h,p),c(t,_),c(t,m),c(m,v),c(t,w),c(t,C),c(C,A),c(t,M),c(t,z),c(z,P),c(z,I),c(z,T),c(z,N),c(z,F),c(z,re),c(t,V),c(t,oe),c(oe,ie),c(t,Z),c(t,H),c(H,se),c(t,ee)},p(_e,fe){fe[0]&2048&&l!==(l=_e[37](_e[86].status)+"")&&i.p(l),fe[0]&2048&&s!==(s=_e[86].status+"")&&$(u,s),fe[0]&2048&&f!==(f=xi(_e[86].status)+" text-sm font-medium inline-flex items-center gap-1")&&a(r,"class",f),fe[0]&2048&&g!==(g=_e[86].job_id+"")&&$(p,g),fe[0]&2048&&y!==(y=(_e[86].prompt_name||"—")+"")&&$(v,y),fe[0]&2048&&x!==(x=_e[86].lang+"")&&$(A,x),fe[0]&2048&&E!==(E=_e[86].completed+"")&&$(P,E),fe[0]&2048&&D!==(D=_e[86].total+"")&&$(T,D),fe[0]&2048&&k!==(k=_e[86].failed+"")&&$(F,k),fe[0]&2048&&Y!==(Y=xn(_e[86].created_at)+"")&&$(ie,Y),fe[0]&2048&&ce!==(ce=xn(_e[86].finished_at)+"")&&$(se,ce)},d(_e){_e&&R(t)}}}function zs(e){let t,n,r=e[5]?`Edit: ${e[5].name}`:"New Prompt Template",i,l,o,s,u,f,d,h,g,p,_,m,y,v,w,C,x,A,M,z,E,P,I=e[5]?"Update":"Create",D,T,N,k,F;return{c(){t=b("div"),n=b("h3"),i=j(r),l=L(),o=b("div"),s=b("div"),u=b("label"),u.textContent="Name",f=L(),d=b("input"),h=L(),g=b("div"),p=b("label"),_=j("Prompt "),m=b("span"),m.textContent="(use {{TARGET_LANGUAGE}}, {{CONTEXT}}, {{TEXT}} placeholders)",y=L(),v=b("textarea"),w=L(),C=b("div"),x=b("label"),x.textContent="System Message",A=L(),M=b("textarea"),z=L(),E=b("div"),P=b("button"),D=j(I),T=L(),N=b("button"),N.textContent="Cancel",a(n,"class","text-sm font-semibold text-gray-700 mb-3"),a(u,"for","prompt-name"),a(u,"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(m,"class","text-gray-400"),a(p,"for","prompt-template"),a(p,"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"),a(N,"class","px-4 py-2 border border-gray-300 text-sm rounded-md hover:bg-gray-50"),a(E,"class","flex gap-2"),a(o,"class","space-y-3"),a(t,"class","mb-6 p-5 bg-white border border-indigo-200 rounded-lg shadow-sm")},m(re,V){B(re,t,V),c(t,n),c(n,i),c(t,l),c(t,o),c(o,s),c(s,u),c(s,f),c(s,d),Ee(d,e[7]),c(o,h),c(o,g),c(g,p),c(p,_),c(p,m),c(g,y),c(g,v),Ee(v,e[8]),c(o,w),c(o,C),c(C,x),c(C,A),c(C,M),Ee(M,e[9]),c(o,z),c(o,E),c(E,P),c(P,D),c(E,T),c(E,N),k||(F=[Q(d,"input",e[54]),Q(v,"input",e[55]),Q(M,"input",e[56]),Q(P,"click",e[29]),Q(N,"click",e[57])],k=!0)},p(re,V){V[0]&32&&r!==(r=re[5]?`Edit: ${re[5].name}`:"New Prompt Template")&&$(i,r),V[0]&128&&d.value!==re[7]&&Ee(d,re[7]),V[0]&256&&Ee(v,re[8]),V[0]&512&&Ee(M,re[9]),V[0]&32&&I!==(I=re[5]?"Update":"Create")&&$(D,I)},d(re){re&&R(t),k=!1,$e(F)}}}function Sd(e){let t,n=Le(e[3]),r=[];for(let i=0;i<n.length;i+=1)r[i]=Ds(xs(e,n,i));return{c(){t=b("div");for(let i=0;i<r.length;i+=1)r[i].c();a(t,"class","space-y-3")},m(i,l){B(i,t,l);for(let o=0;o<r.length;o+=1)r[o]&&r[o].m(t,null)},p(i,l){if(l[0]&1342177288){n=Le(i[3]);let o;for(o=0;o<n.length;o+=1){const s=xs(i,n,o);r[o]?r[o].p(s,l):(r[o]=Ds(s),r[o].c(),r[o].m(t,null))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(i){i&&R(t),it(r,i)}}}function Ad(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:Be,d(n){n&&R(t)}}}function Is(e){let t,n=xn(e[73].updated_at)+"",r;return{c(){t=j("· Updated "),r=j(n)},m(i,l){B(i,t,l),B(i,r,l)},p(i,l){l[0]&8&&n!==(n=xn(i[73].updated_at)+"")&&$(r,n)},d(i){i&&(R(t),R(r))}}}function Ps(e){let t,n,r,i=e[73].system_message.substring(0,150)+"",l,o=e[73].system_message.length>150?"…":"",s;return{c(){t=b("p"),n=b("b"),n.textContent="System:",r=L(),l=j(i),s=j(o),a(t,"class","mt-1 text-xs text-gray-400")},m(u,f){B(u,t,f),c(t,n),c(t,r),c(t,l),c(t,s)},p(u,f){f[0]&8&&i!==(i=u[73].system_message.substring(0,150)+"")&&$(l,i),f[0]&8&&o!==(o=u[73].system_message.length>150?"…":"")&&$(s,o)},d(u){u&&R(t)}}}function Ds(e){let t,n,r,i,l,o=e[73].name+"",s,u,f,d,h=e[73].version+"",g,p,_,m,y=xn(e[73].created_at)+"",v,w,C,x,A=e[73].prompt.substring(0,300)+"",M,z=e[73].prompt.length>300?"…":"",E,P,I,D,T,N,k,F,re,V,oe=e[73].updated_at&&e[73].updated_at!==e[73].created_at&&Is(e),Y=e[73].system_message&&Ps(e);function ie(){return e[58](e[73])}function Z(){return e[59](e[73])}return{c(){t=b("div"),n=b("div"),r=b("div"),i=b("div"),l=b("h4"),s=j(o),u=L(),f=b("span"),d=j("v"),g=j(h),p=L(),_=b("p"),m=j("Created "),v=j(y),w=L(),oe&&oe.c(),C=L(),x=b("pre"),M=j(A),E=j(z),P=L(),Y&&Y.c(),I=L(),D=b("div"),T=b("button"),T.textContent="Edit",N=L(),k=b("button"),k.textContent="Delete",F=L(),a(l,"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(i,"class","flex items-center gap-2"),a(_,"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(D,"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(H,ce){B(H,t,ce),c(t,n),c(n,r),c(r,i),c(i,l),c(l,s),c(i,u),c(i,f),c(f,d),c(f,g),c(r,p),c(r,_),c(_,m),c(_,v),c(_,w),oe&&oe.m(_,null),c(r,C),c(r,x),c(x,M),c(x,E),c(r,P),Y&&Y.m(r,null),c(n,I),c(n,D),c(D,T),c(D,N),c(D,k),c(t,F),re||(V=[Q(T,"click",ie),Q(k,"click",Z)],re=!0)},p(H,ce){e=H,ce[0]&8&&o!==(o=e[73].name+"")&&$(s,o),ce[0]&8&&h!==(h=e[73].version+"")&&$(g,h),ce[0]&8&&y!==(y=xn(e[73].created_at)+"")&&$(v,y),e[73].updated_at&&e[73].updated_at!==e[73].created_at?oe?oe.p(e,ce):(oe=Is(e),oe.c(),oe.m(_,null)):oe&&(oe.d(1),oe=null),ce[0]&8&&A!==(A=e[73].prompt.substring(0,300)+"")&&$(M,A),ce[0]&8&&z!==(z=e[73].prompt.length>300?"…":"")&&$(E,z),e[73].system_message?Y?Y.p(e,ce):(Y=Ps(e),Y.c(),Y.m(r,null)):Y&&(Y.d(1),Y=null)},d(H){H&&R(t),oe&&oe.d(),Y&&Y.d(),re=!1,$e(V)}}}function Os(e){let t,n=Le(e[10].filter(Qs)),r=[];for(let i=0;i<n.length;i+=1)r[i]=js(Ms(e,n,i));return{c(){t=b("div");for(let i=0;i<r.length;i+=1)r[i].c();a(t,"class","mb-4 space-y-3")},m(i,l){B(i,t,l);for(let o=0;o<r.length;o+=1)r[o]&&r[o].m(t,null)},p(i,l){if(l[0]&1024|l[1]&96){n=Le(i[10].filter(Qs));let o;for(o=0;o<n.length;o+=1){const s=Ms(i,n,o);r[o]?r[o].p(s,l):(r[o]=js(s),r[o].c(),r[o].m(t,null))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(i){i&&R(t),it(r,i)}}}function Fs(e){let t,n=(e[79].currentItem.source||`#${e[79].currentItem.index}`)+"",r;return{c(){t=j("Processing: "),r=j(n)},m(i,l){B(i,t,l),B(i,r,l)},p(i,l){l[0]&1024&&n!==(n=(i[79].currentItem.source||`#${i[79].currentItem.index}`)+"")&&$(r,n)},d(i){i&&(R(t),R(r))}}}function Td(e){let t;return{c(){t=j("—")},m(n,r){B(n,t,r)},p:Be,d(n){n&&R(t)}}}function Md(e){let t,n=Js(e[79].estimatedTimeRemaining)+"",r;return{c(){t=j("ETA: "),r=j(n)},m(i,l){B(i,t,l),B(i,r,l)},p(i,l){l[0]&1024&&n!==(n=Js(i[79].estimatedTimeRemaining)+"")&&$(r,n)},d(i){i&&(R(t),R(r))}}}function Rs(e){let t,n=e[79].processingRate.toFixed(1)+"",r,i;return{c(){t=j("("),r=j(n),i=j("/s)")},m(l,o){B(l,t,o),B(l,r,o),B(l,i,o)},p(l,o){o[0]&1024&&n!==(n=l[79].processingRate.toFixed(1)+"")&&$(r,n)},d(l){l&&(R(t),R(r),R(i))}}}function Bs(e){let t,n=e[79].failed+"",r,i;return{c(){t=b("p"),r=j(n),i=j(" failed"),a(t,"class","text-xs text-yellow-700 mt-1")},m(l,o){B(l,t,o),c(t,r),c(t,i)},p(l,o){o[0]&1024&&n!==(n=l[79].failed+"")&&$(r,n)},d(l){l&&R(t)}}}function js(e){let t,n,r,i,l=e[37](e[79].status)+"",o,s,u=(e[79].promptName||"Translation Job")+"",f,d,h=e[79].langCode+"",g,p,_,m,y,v,w,C,x,A,M=e[79].completed+e[79].failed+"",z,E,P=e[79].total+"",I,D,T,N,k,F,re,V,oe,Y,ie;function Z(){return e[39](e[79])}let H=e[79].currentItem&&Fs(e);function ce(ye,G){return ye[79].estimatedTimeRemaining?Md:Td}let se=ce(e),ee=se(e),_e=e[79].processingRate&&Rs(e),fe=e[79].failed>0&&Bs(e);return{c(){t=b("div"),n=b("div"),r=b("div"),i=b("span"),o=L(),s=b("span"),f=j(u),d=j(" — "),g=j(h),p=L(),_=b("button"),_.textContent="Cancel",m=L(),y=b("div"),v=b("div"),C=L(),x=b("div"),A=b("span"),z=j(M),E=j(" / "),I=j(P),D=j(" items"),T=L(),N=b("span"),H&&H.c(),k=L(),F=b("span"),ee.c(),re=L(),_e&&_e.c(),V=L(),fe&&fe.c(),oe=L(),a(i,"class","inline-flex items-center"),a(s,"class","text-sm font-medium text-blue-800"),a(r,"class","flex items-center gap-2"),a(_,"class","px-3 py-1 text-xs text-red-600 border border-red-300 rounded hover:bg-red-50"),a(n,"class","flex items-center justify-between mb-2"),a(v,"class",w="h-full rounded-full transition-all duration-300 "+(e[79].failed>0?"bg-gradient-to-r from-blue-500 to-yellow-500":"bg-blue-500")),ct(v,"width",(e[79].total>0?(e[79].completed+e[79].failed)/e[79].total*100:0)+"%"),a(y,"class","w-full bg-blue-100 rounded-full h-3 overflow-hidden"),a(x,"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(ye,G){B(ye,t,G),c(t,n),c(n,r),c(r,i),i.innerHTML=l,c(r,o),c(r,s),c(s,f),c(s,d),c(s,g),c(n,p),c(n,_),c(t,m),c(t,y),c(y,v),c(t,C),c(t,x),c(x,A),c(A,z),c(A,E),c(A,I),c(A,D),c(x,T),c(x,N),H&&H.m(N,null),c(x,k),c(x,F),ee.m(F,null),c(F,re),_e&&_e.m(F,null),c(t,V),fe&&fe.m(t,null),c(t,oe),Y||(ie=Q(_,"click",Z),Y=!0)},p(ye,G){e=ye,G[0]&1024&&l!==(l=e[37](e[79].status)+"")&&(i.innerHTML=l),G[0]&1024&&u!==(u=(e[79].promptName||"Translation Job")+"")&&$(f,u),G[0]&1024&&h!==(h=e[79].langCode+"")&&$(g,h),G[0]&1024&&w!==(w="h-full rounded-full transition-all duration-300 "+(e[79].failed>0?"bg-gradient-to-r from-blue-500 to-yellow-500":"bg-blue-500"))&&a(v,"class",w),G[0]&1024&&ct(v,"width",(e[79].total>0?(e[79].completed+e[79].failed)/e[79].total*100:0)+"%"),G[0]&1024&&M!==(M=e[79].completed+e[79].failed+"")&&$(z,M),G[0]&1024&&P!==(P=e[79].total+"")&&$(I,P),e[79].currentItem?H?H.p(e,G):(H=Fs(e),H.c(),H.m(N,null)):H&&(H.d(1),H=null),se===(se=ce(e))&&ee?ee.p(e,G):(ee.d(1),ee=se(e),ee&&(ee.c(),ee.m(F,re))),e[79].processingRate?_e?_e.p(e,G):(_e=Rs(e),_e.c(),_e.m(F,null)):_e&&(_e.d(1),_e=null),e[79].failed>0?fe?fe.p(e,G):(fe=Bs(e),fe.c(),fe.m(t,oe)):fe&&(fe.d(1),fe=null)},d(ye){ye&&R(t),H&&H.d(),ee.d(),_e&&_e.d(),fe&&fe.d(),Y=!1,ie()}}}function Us(e){let t,n=Le(e[10].filter($s).slice(0,3)),r=[];for(let i=0;i<n.length;i+=1)r[i]=Hs(Ts(e,n,i));return{c(){t=b("div");for(let i=0;i<r.length;i+=1)r[i].c();a(t,"class","mb-4 space-y-2")},m(i,l){B(i,t,l);for(let o=0;o<r.length;o+=1)r[o]&&r[o].m(t,null)},p(i,l){if(l[0]&1024|l[1]&64){n=Le(i[10].filter($s).slice(0,3));let o;for(o=0;o<n.length;o+=1){const s=Ts(i,n,o);r[o]?r[o].p(s,l):(r[o]=Hs(s),r[o].c(),r[o].m(t,null))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(i){i&&R(t),it(r,i)}}}function Hs(e){let t,n,r,i=e[37](e[79].status)+"",l,o,s=e[79].status+"",u,f,d,h,g=(e[79].promptName||"Job")+"",p,_,m=e[79].langCode+"",y,v,w,C=e[79].completed+"",x,A,M=e[79].total+"",z,E,P;return{c(){t=b("div"),n=b("div"),r=b("span"),l=L(),o=b("span"),u=j(s),d=L(),h=b("span"),p=j(g),_=j(" — "),y=j(m),v=L(),w=b("span"),x=j(C),A=j("/"),z=j(M),E=j(" translated"),P=L(),a(r,"class","inline-flex items-center"),a(o,"class",f="font-medium "+xi(e[79].status)),a(h,"class","text-gray-500"),a(n,"class","flex items-center gap-2"),a(w,"class","text-gray-400"),a(t,"class","p-3 bg-gray-50 border border-gray-200 rounded-lg flex items-center justify-between text-sm")},m(I,D){B(I,t,D),c(t,n),c(n,r),r.innerHTML=i,c(n,l),c(n,o),c(o,u),c(n,d),c(n,h),c(h,p),c(h,_),c(h,y),c(t,v),c(t,w),c(w,x),c(w,A),c(w,z),c(w,E),c(t,P)},p(I,D){D[0]&1024&&i!==(i=I[37](I[79].status)+"")&&(r.innerHTML=i),D[0]&1024&&s!==(s=I[79].status+"")&&$(u,s),D[0]&1024&&f!==(f="font-medium "+xi(I[79].status))&&a(o,"class",f),D[0]&1024&&g!==(g=(I[79].promptName||"Job")+"")&&$(p,g),D[0]&1024&&m!==(m=I[79].langCode+"")&&$(y,m),D[0]&1024&&C!==(C=I[79].completed+"")&&$(x,C),D[0]&1024&&M!==(M=I[79].total+"")&&$(z,M)},d(I){I&&R(t)}}}function Ws(e){let t,n=(e[76].name||e[76].code||e[76])+"",r,i;return{c(){t=b("option"),r=j(n),t.__value=i=e[76].code||e[76],Ee(t,t.__value)},m(l,o){B(l,t,o),c(t,r)},p(l,o){o[0]&4096&&n!==(n=(l[76].name||l[76].code||l[76])+"")&&$(r,n),o[0]&4096&&i!==(i=l[76].code||l[76])&&(t.__value=i,Ee(t,t.__value))},d(l){l&&R(t)}}}function Zs(e){let t;return{c(){t=b("option"),t.textContent="— No prompts. Create one first. —",t.__value="",Ee(t,t.__value)},m(n,r){B(n,t,r)},d(n){n&&R(t)}}}function Ys(e){let t,n=e[73].name+"",r,i,l=e[73].version+"",o,s,u;return{c(){t=b("option"),r=j(n),i=j(" (v"),o=j(l),s=j(")"),t.__value=u=e[73].id,Ee(t,t.__value)},m(f,d){B(f,t,d),c(t,r),c(t,i),c(t,o),c(t,s)},p(f,d){d[0]&8&&n!==(n=f[73].name+"")&&$(r,n),d[0]&8&&l!==(l=f[73].version+"")&&$(o,l),d[0]&8&&u!==(u=f[73].id)&&(t.__value=u,Ee(t,t.__value))},d(f){f&&R(t)}}}function Vs(e){let t,n;return{c(){t=pe("svg"),n=pe("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,i){B(r,t,i),c(t,n)},d(r){r&&R(t)}}}function Ed(e){let t,n,r,i;return{c(){t=pe("svg"),n=pe("circle"),r=pe("line"),i=pe("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(i,"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(l,o){B(l,t,o),c(t,n),c(t,r),c(t,i)},d(l){l&&R(t)}}}function Ld(e){let t,n;return{c(){t=pe("svg"),n=pe("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,i){B(r,t,i),c(t,n)},d(r){r&&R(t)}}}function Nd(e){let t,n,r,i,l,o,s,u,f,d,h,g,p,_,m=[],y=new Map,v,w,C,x,A,M,z,E,P=Le(e[13]);const I=T=>T[70].key_id;for(let T=0;T<P.length;T+=1){let N=Cs(e,P,T),k=I(N);y.set(k,m[T]=qs(k,N))}let D=e[24]>1&&Ks(e);return{c(){t=b("div"),n=b("table"),r=b("thead"),i=b("tr"),l=b("th"),o=b("input"),s=L(),u=b("th"),u.textContent="Key (Source Text)",f=L(),d=b("th"),d.textContent="DOM Context",h=L(),g=b("th"),g.textContent="Current Translation",p=L(),_=b("tbody");for(let T=0;T<m.length;T+=1)m[T].c();v=L(),w=b("div"),C=b("p"),x=j(e[2]),A=j(" item(s)"),M=L(),D&&D.c(),a(o,"type","checkbox"),o.checked=e[15],a(o,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(l,"class","w-10 px-3 py-2.5"),a(u,"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(g,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),a(i,"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(C,"class","text-xs text-gray-400"),a(w,"class","flex items-center justify-between mt-3")},m(T,N){B(T,t,N),c(t,n),c(n,r),c(r,i),c(i,l),c(l,o),c(i,s),c(i,u),c(i,f),c(i,d),c(i,h),c(i,g),c(n,p),c(n,_);for(let k=0;k<m.length;k+=1)m[k]&&m[k].m(_,null);B(T,v,N),B(T,w,N),c(w,C),c(C,x),c(C,A),c(w,M),D&&D.m(w,null),z||(E=Q(o,"change",e[32]),z=!0)},p(T,N){N[0]&32768&&(o.checked=T[15]),N[0]&24576|N[1]&1&&(P=Le(T[13]),m=Hi(m,N,I,1,T,P,y,_,Ui,qs,null,Cs)),N[0]&4&&$(x,T[2]),T[24]>1?D?D.p(T,N):(D=Ks(T),D.c(),D.m(w,null)):D&&(D.d(1),D=null)},d(T){T&&(R(t),R(v),R(w));for(let N=0;N<m.length;N+=1)m[N].d();D&&D.d(),z=!1,E()}}}function zd(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:Be,d(n){n&&R(t)}}}function qs(e,t){let n,r,i,l,o,s,u=t[70].key+"",f,d,h,g,p=(t[70].context||"—")+"",_,m,y,v,w=(t[70].value||"(not translated)")+"",C,x,A,M,z,E;function P(){return t[47](t[70])}return{key:e,first:null,c(){n=b("tr"),r=b("td"),i=b("input"),o=L(),s=b("td"),f=j(u),h=L(),g=b("td"),_=j(p),y=L(),v=b("td"),C=j(w),A=L(),a(i,"type","checkbox"),i.checked=l=t[14].has(t[70].key_id),a(i,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(r,"class","px-3 py-2"),a(s,"class","px-3 py-2 font-mono text-sm text-gray-700 max-w-[250px] truncate"),a(s,"title",d=t[70].key),a(g,"class","px-3 py-2 text-xs text-gray-400 max-w-[180px] truncate"),a(g,"title",m=t[70].context),a(v,"class",x="px-3 py-2 text-sm "+(t[70].value?"text-gray-700":"text-gray-300")),a(n,"class",M="border-b border-gray-100 hover:bg-gray-50 transition-colors "+(t[70].value?"":"bg-amber-50")),this.first=n},m(I,D){B(I,n,D),c(n,r),c(r,i),c(n,o),c(n,s),c(s,f),c(n,h),c(n,g),c(g,_),c(n,y),c(n,v),c(v,C),c(n,A),z||(E=Q(i,"change",P),z=!0)},p(I,D){t=I,D[0]&24576&&l!==(l=t[14].has(t[70].key_id))&&(i.checked=l),D[0]&8192&&u!==(u=t[70].key+"")&&$(f,u),D[0]&8192&&d!==(d=t[70].key)&&a(s,"title",d),D[0]&8192&&p!==(p=(t[70].context||"—")+"")&&$(_,p),D[0]&8192&&m!==(m=t[70].context)&&a(g,"title",m),D[0]&8192&&w!==(w=(t[70].value||"(not translated)")+"")&&$(C,w),D[0]&8192&&x!==(x="px-3 py-2 text-sm "+(t[70].value?"text-gray-700":"text-gray-300"))&&a(v,"class",x),D[0]&8192&&M!==(M="border-b border-gray-100 hover:bg-gray-50 transition-colors "+(t[70].value?"":"bg-amber-50"))&&a(n,"class",M)},d(I){I&&R(n),z=!1,E()}}}function Ks(e){let t,n,r,i,l,o,s,u,f,d,h,g,p,_,m,y,v,w,C,x,A,M,z,E,P,I,D,T,N;return{c(){t=b("div"),n=b("button"),r=j("«"),l=L(),o=b("button"),s=j("‹"),f=L(),d=b("span"),h=j("Page "),g=j(e[21]),p=j(" of "),_=j(e[24]),m=L(),y=b("button"),v=j("›"),C=L(),x=b("button"),A=j("»"),z=L(),E=b("select"),P=b("option"),P.textContent="25 / page",I=b("option"),I.textContent="50 / page",D=b("option"),D.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=i=e[21]<=1,a(o,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),o.disabled=u=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[24],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[24],P.__value=25,Ee(P,P.__value),I.__value=50,Ee(I,I.__value),D.__value=100,Ee(D,D.__value),a(E,"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[1]===void 0&&Et(()=>e[52].call(E)),a(t,"class","flex items-center gap-1")},m(k,F){B(k,t,F),c(t,n),c(n,r),c(t,l),c(t,o),c(o,s),c(t,f),c(t,d),c(d,h),c(d,g),c(d,p),c(d,_),c(t,m),c(t,y),c(y,v),c(t,C),c(t,x),c(x,A),c(t,z),c(t,E),c(E,P),c(E,I),c(E,D),pt(E,e[1],!0),T||(N=[Q(n,"click",e[48]),Q(o,"click",e[49]),Q(y,"click",e[50]),Q(x,"click",e[51]),Q(E,"change",e[52]),Q(E,"change",e[53])],T=!0)},p(k,F){F[0]&2097152&&i!==(i=k[21]<=1)&&(n.disabled=i),F[0]&2097152&&u!==(u=k[21]<=1)&&(o.disabled=u),F[0]&2097152&&$(g,k[21]),F[0]&16777216&&$(_,k[24]),F[0]&18874368&&w!==(w=k[21]>=k[24])&&(y.disabled=w),F[0]&18874368&&M!==(M=k[21]>=k[24])&&(x.disabled=M),F[0]&2&&pt(E,k[1])},d(k){k&&R(t),T=!1,$e(N)}}}function Id(e){let t,n,r,i=Le([{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>'}]),l=[];for(let f=0;f<3;f+=1)l[f]=Ls(Es(e,i,f));function o(f,d){if(f[20]==="generate")return kd;if(f[20]==="prompts")return wd;if(f[20]==="log")return vd}let s=o(e),u=s&&s(e);return{c(){t=b("div"),n=b("div");for(let f=0;f<3;f+=1)l[f].c();r=L(),u&&u.c(),a(n,"class","flex items-center gap-1 mb-4 border-b border-gray-200")},m(f,d){B(f,t,d),c(t,n);for(let h=0;h<3;h+=1)l[h]&&l[h].m(n,null);c(t,r),u&&u.m(t,null)},p(f,d){if(d[0]&68157440){i=Le([{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 h;for(h=0;h<3;h+=1){const g=Es(f,i,h);l[h]?l[h].p(g,d):(l[h]=Ls(g),l[h].c(),l[h].m(n,null))}for(;h<3;h+=1)l[h].d(1)}s===(s=o(f))&&u?u.p(f,d):(u&&u.d(1),u=s&&s(f),u&&(u.c(),u.m(t,null)))},i:Be,o:Be,d(f){f&&R(t),it(l,f),u&&u.d()}}}const Pd="You are a professional translator. Provide only the translation without any explanations or additional text.";function Js(e){return!e||e<0?"—":e<60?`${Math.ceil(e)}s`:`${Math.floor(e/60)}m ${Math.ceil(e%60)}s`}function xn(e){return e?new Date(e).toLocaleString():"—"}function xi(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"}}const Gs=e=>e.status==="completed"||e.status==="failed"||e.status==="cancelled",Xs=e=>e.status==="running"||e.status==="pending",Qs=e=>e.status==="running"||e.status==="pending",$s=e=>e.status==="completed"||e.status==="failed"||e.status==="cancelled";function Dd(e,t,n){let r,i;Or(e,Yt,we=>n(62,i=we));let l=[],o="",s=null,u=!1,f="",d="",h="",g=[],p=[],_=null,m="zh-Hans",y=[],v=[],w=new Set,C=!1,x=!1,A=!1,M="",z,E="all",P="generate",I=1,D=50,T=0;const N=`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 we;try{const be=JSON.parse(i.settings||"{}");(we=be.languages)!=null&&we.length&&n(12,y=be.languages)}catch{}y.length||n(12,y=[{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"}]),y.length&&n(0,m=y[0].code||y[0]),await Promise.all([re(),V(),oe(),Y()]),k()}),oc(()=>{F()});function k(){_=setInterval(async()=>{await oe(),g.some(we=>we.status==="running"||we.status==="pending")&&await V()},2e3)}function F(){_&&clearInterval(_)}async function re(){const we=await je("../api/prompts");n(3,l=await we.json()),l.length&&!o&&n(4,o=l[0].id)}async function V(){const we=new URLSearchParams({lang:m,status:"approved",page:I,limit:D});M.trim()&&we.set("search",M.trim()),E==="translated"?we.set("translated","yes"):E==="untranslated"&&we.set("translated","no");const ae=await(await je(`../api/translations/all?${we}`)).json();n(13,v=ae.rows),n(2,T=ae.total);const Ne=new Set(v.map(Ae=>Ae.key_id));n(14,w=new Set([...w].filter(Ae=>Ne.has(Ae)))),n(15,C=w.size===v.length&&v.length>0)}async function oe(){const be=await(await je("../api/ai-jobs")).json();n(10,g=be.jobs||[])}async function Y(){const we=await je("../api/ai-jobs/log");n(11,p=await we.json())}function ie(){n(5,s=null),n(7,f=""),n(8,d=N),n(9,h=Pd),n(6,u=!0)}function Z(we){n(5,s=we),n(7,f=we.name),n(8,d=we.prompt),n(9,h=we.system_message),n(6,u=!0)}async function H(){!f.trim()||!d.trim()||(await je("../api/prompts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:(s==null?void 0:s.id)||null,name:f.trim(),prompt:d,system_message:h})}),n(6,u=!1),n(5,s=null),await re())}async function ce(we){confirm("Delete this prompt template?")&&(await je(`../api/prompts/${encodeURIComponent(we)}`,{method:"DELETE"}),o===we&&n(4,o=""),await re())}function se(we){w.has(we)?w.delete(we):w.add(we),n(14,w=new Set(w)),n(15,C=w.size===v.length&&v.length>0)}function ee(){C?(n(14,w=new Set),n(15,C=!1)):(n(14,w=new Set(v.map(we=>we.key_id))),n(15,C=!0))}function _e(){clearTimeout(z),z=setTimeout(()=>{n(21,I=1),V()},300)}async function fe(){if(!(w.size===0||!o)){n(17,A=!0);try{const be=await(await je("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:[...w],lang:m,prompt_id:o,include_screenshots:x,mode:"group"})})).json();be.error?alert(be.error):(n(14,w=new Set),n(15,C=!1),await oe(),await Y())}finally{n(17,A=!1)}}}let ye=!1,G=null;async function de(){try{const be=await(await je(`../api/textnodes/untranslated-ids?lang=${encodeURIComponent(m)}`)).json();n(23,G=be.total||0)}catch{n(23,G=null)}}async function ue(){var we;if(!o){alert("Select a prompt template first.");return}n(22,ye=!0);try{const ae=await(await je(`../api/textnodes/untranslated-ids?lang=${encodeURIComponent(m)}`)).json();if(!ae.ids||ae.ids.length===0){alert(`No untranslated approved keys for ${m}.`);return}const Ne=((we=y.find(Re=>(Re.code||Re)===m))==null?void 0:we.name)||m;if(!confirm(`Translate all ${ae.ids.length} untranslated approved key(s) to ${Ne}?`))return;const xe=await(await je("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:ae.ids,lang:m,prompt_id:o,include_screenshots:x,mode:"group"})})).json();xe.error?alert(xe.error):(await oe(),await Y(),await de())}finally{n(22,ye=!1)}}async function te(we){await je(`../api/ai-jobs/${encodeURIComponent(we)}`,{method:"DELETE"}),await oe()}const Se={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 S(we){return Se[we]??'<span class="text-gray-400">&mdash;</span>'}const X=we=>{n(20,P=we.id),we.id==="log"&&Y()},J=we=>te(we.id);function U(){m=qt(this),n(0,m),n(12,y)}const O=()=>{n(21,I=1),V()};function W(){o=qt(this),n(4,o),n(3,l)}function le(){x=this.checked,n(16,x)}function q(){M=this.value,n(18,M)}function K(){E=qt(this),n(19,E)}const ne=()=>{n(21,I=1),V()},ke=we=>se(we.key_id),ge=()=>{n(21,I=1),V()},Ce=()=>{n(21,I--,I),V()},Fe=()=>{n(21,I++,I),V()},Me=()=>{n(21,I=r),V()};function We(){D=qt(this),n(1,D)}const Ze=()=>{n(21,I=1),V()};function Pe(){f=this.value,n(7,f)}function Xe(){d=this.value,n(8,d)}function He(){h=this.value,n(9,h)}const et=()=>{n(6,u=!1),n(5,s=null)},tt=we=>Z(we),rt=we=>ce(we.id);return e.$$.update=()=>{e.$$.dirty[0]&6&&n(24,r=Math.max(1,Math.ceil(T/D))),e.$$.dirty[0]&1&&m&&de()},[m,D,T,l,o,s,u,f,d,h,g,p,y,v,w,C,x,A,M,E,P,I,ye,G,r,V,Y,ie,Z,H,ce,se,ee,_e,fe,ue,te,S,X,J,U,O,W,le,q,K,ne,ke,ge,Ce,Fe,Me,We,Ze,Pe,Xe,He,et,tt,rt]}class Od extends nn{constructor(t){super(),tn(this,t,Dd,Id,Jt,{},null,[-1,-1,-1])}}function ea(e,t,n){const r=e.slice();return r[71]=t[n],r[72]=t,r[73]=n,r}function ta(e,t,n){const r=e.slice();return r[74]=t[n],r}function na(e,t,n){const r=e.slice();return r[74]=t[n],r}function ra(e,t,n){const r=e.slice();return r[79]=t[n],r}function ia(e,t,n){const r=e.slice();return r[82]=t[n],r}function Fd(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(i,l){B(i,t,l),Ee(t,e[4]),n||(r=Q(t,"input",e[50]),n=!0)},p(i,l){l[0]&16&&t.value!==i[4]&&Ee(t,i[4])},d(i){i&&R(t),n=!1,r()}}}function Rd(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(i,l){B(i,t,l),Ee(t,e[4]),n||(r=Q(t,"input",e[49]),n=!0)},p(i,l){l[0]&16&&t.value!==i[4]&&Ee(t,i[4])},d(i){i&&R(t),n=!1,r()}}}function la(e){let t,n,r,i=e[82].name+"",l,o,s,u,f=e[82].code+"",d,h,g,p,_,m,y;function v(){return e[53](e[82])}return{c(){t=b("div"),n=b("div"),r=b("span"),l=j(i),o=L(),s=b("span"),u=j("("),d=j(f),h=j(")"),g=L(),p=b("button"),p.textContent="✕",_=L(),a(r,"class","text-gray-700"),a(s,"class","text-gray-400 text-xs"),a(n,"class","flex items-center gap-2"),a(p,"class","text-gray-400 hover:text-red-500 text-xs px-2 py-1 rounded hover:bg-red-50"),a(p,"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),c(t,n),c(n,r),c(r,l),c(n,o),c(n,s),c(s,u),c(s,d),c(s,h),c(t,g),c(t,p),c(t,_),m||(y=Q(p,"click",v),m=!0)},p(w,C){e=w,C[0]&128&&i!==(i=e[82].name+"")&&$(l,i),C[0]&128&&f!==(f=e[82].code+"")&&$(d,f)},d(w){w&&R(t),m=!1,y()}}}function oa(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&&R(t)}}}function Bd(e){let t,n,r,i,l;return{c(){t=pe("svg"),n=pe("path"),r=pe("polyline"),i=pe("polyline"),l=j(`
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(i,"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(o,s){B(o,t,s),c(t,n),c(t,r),c(t,i),B(o,l,s)},d(o){o&&(R(t),R(l))}}}function jd(e){let t,n,r;return{c(){t=pe("svg"),n=pe("path"),r=j(`
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(i,l){B(i,t,l),c(t,n),B(i,r,l)},d(i){i&&(R(t),R(r))}}}function sa(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(i,l){B(i,t,l),n||(r=Q(t,"click",e[43]),n=!0)},p:Be,d(i){i&&R(t),n=!1,r()}}}function Ud(e){let t,n=Le(e[18]),r=[];for(let i=0;i<n.length;i+=1)r[i]=aa(ra(e,n,i));return{c(){t=b("div");for(let i=0;i<r.length;i+=1)r[i].c();a(t,"class","border border-gray-200 rounded-md divide-y divide-gray-100 max-h-64 overflow-y-auto")},m(i,l){B(i,t,l);for(let o=0;o<r.length;o+=1)r[o]&&r[o].m(t,null)},p(i,l){if(l[0]&2359296|l[1]&16384){n=Le(i[18]);let o;for(o=0;o<n.length;o+=1){const s=ra(i,n,o);r[o]?r[o].p(s,l):(r[o]=aa(s),r[o].c(),r[o].m(t,null))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(i){i&&R(t),it(r,i)}}}function Hd(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:Be,d(n){n&&R(t)}}}function aa(e){let t,n,r,i=e[79].filename+"",l,o,s,u=ya(e[79].created)+"",f,d,h=ba(e[79].size)+"",g,p,_,m,y,v,w,C,x,A,M;function z(){return e[56](e[79])}return{c(){t=b("div"),n=b("div"),r=b("div"),l=j(i),o=L(),s=b("div"),f=j(u),d=j(" · "),g=j(h),p=L(),_=b("div"),m=b("button"),y=pe("svg"),v=pe("polyline"),w=pe("path"),x=L(),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(m,"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"),m.disabled=C=e[21]===e[79].filename,a(m,"title","Delete this backup"),a(_,"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(E,P){B(E,t,P),c(t,n),c(n,r),c(r,l),c(n,o),c(n,s),c(s,f),c(s,d),c(s,g),c(t,p),c(t,_),c(_,m),c(m,y),c(y,v),c(y,w),c(t,x),A||(M=Q(m,"click",z),A=!0)},p(E,P){e=E,P[0]&262144&&i!==(i=e[79].filename+"")&&$(l,i),P[0]&262144&&u!==(u=ya(e[79].created)+"")&&$(f,u),P[0]&262144&&h!==(h=ba(e[79].size)+"")&&$(g,h),P[0]&2359296&&C!==(C=e[21]===e[79].filename)&&(m.disabled=C)},d(E){E&&R(t),A=!1,M()}}}function ua(e){let t,n,r,i,l,o,s,u,f,d,h,g,p,_,m,y,v,w,C=e[13]>0&&ca(e),x=Le(e[27]),A=[];for(let M=0;M<x.length;M+=1)A[M]=pa(ea(e,x,M));return{c(){t=b("div"),n=b("div"),r=b("h4"),r.textContent="Context Depth",i=L(),l=b("p"),l.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.`,o=L(),s=b("div"),u=b("button"),f=j("∞ Unlimited"),h=L(),g=b("button"),p=j("Limit depth"),m=L(),C&&C.c(),y=L();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(l,"class","text-xs text-gray-400 mb-3"),a(u,"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(g,"class",_="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,z){B(M,t,z),c(t,n),c(n,r),c(n,i),c(n,l),c(n,o),c(n,s),c(s,u),c(u,f),c(s,h),c(s,g),c(g,p),c(n,m),C&&C.m(n,null),c(t,y);for(let E=0;E<A.length;E+=1)A[E]&&A[E].m(t,null);v||(w=[Q(u,"click",e[58]),Q(g,"click",e[59])],v=!0)},p(M,z){if(z[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(u,"class",d),z[0]&8192&&_!==(_="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(g,"class",_),M[13]>0?C?C.p(M,z):(C=ca(M),C.c(),C.m(n,null)):C&&(C.d(1),C=null),z[0]&201332736|z[1]&240){x=Le(M[27]);let E;for(E=0;E<x.length;E+=1){const P=ea(M,x,E);A[E]?A[E].p(P,z):(A[E]=pa(P),A[E].c(),A[E].m(t,null))}for(;E<A.length;E+=1)A[E].d(1);A.length=x.length}},d(M){M&&R(t),C&&C.d(),it(A,M),v=!1,$e(w)}}}function ca(e){let t,n,r,i,l,o,s,u,f,d,h,g;return{c(){t=b("div"),n=b("button"),r=j("−"),l=L(),o=b("input"),s=L(),u=b("button"),u.textContent="+",f=L(),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=i=e[13]<=1,a(o,"type","number"),a(o,"min","1"),a(o,"max","99"),a(o,"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(u,"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(p,_){B(p,t,_),c(t,n),c(n,r),c(t,l),c(t,o),Ee(o,e[13]),c(t,s),c(t,u),c(t,f),c(t,d),h||(g=[Q(n,"click",e[60]),Q(o,"input",e[61]),Q(o,"change",e[34]),Q(u,"click",e[62])],h=!0)},p(p,_){_[0]&8192&&i!==(i=p[13]<=1)&&(n.disabled=i),_[0]&8192&&ic(o.value)!==p[13]&&Ee(o,p[13])},d(p){p&&R(t),h=!1,$e(g)}}}function fa(e){let t,n=e[74]+"",r,i,l;function o(){return e[63](e[71],e[74])}return{c(){t=b("button"),r=j(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,u){B(s,t,u),c(t,r),i||(l=Q(t,"click",o),i=!0)},p(s,u){e=s},d(s){s&&R(t),i=!1,l()}}}function da(e){let t,n=Le(e[11][e[71].key].custom),r=[];for(let i=0;i<n.length;i+=1)r[i]=ha(ta(e,n,i));return{c(){t=b("div");for(let i=0;i<r.length;i+=1)r[i].c();a(t,"class","flex flex-wrap gap-1.5 mb-2")},m(i,l){B(i,t,l);for(let o=0;o<r.length;o+=1)r[o]&&r[o].m(t,null)},p(i,l){if(l[0]&134219776|l[1]&64){n=Le(i[11][i[71].key].custom);let o;for(o=0;o<n.length;o+=1){const s=ta(i,n,o);r[o]?r[o].p(s,l):(r[o]=ha(s),r[o].c(),r[o].m(t,null))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(i){i&&R(t),it(r,i)}}}function ha(e){let t,n=e[74]+"",r,i,l,o,s,u;function f(){return e[64](e[71],e[74])}return{c(){t=b("span"),r=j(n),i=L(),l=b("button"),l.textContent="✕",o=L(),a(l,"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),c(t,r),c(t,i),c(t,l),c(t,o),s||(u=Q(l,"click",f),s=!0)},p(d,h){e=d,h[0]&2048&&n!==(n=e[74]+"")&&$(r,n)},d(d){d&&R(t),s=!1,u()}}}function pa(e){let t,n,r,i,l,o,s,u,f,d,h,g,p,_,m,y,v,w=Le(e[26][e[71].key]),C=[];for(let E=0;E<w.length;E+=1)C[E]=fa(na(e,w,E));let x=e[11][e[71].key].custom.length>0&&da(e);function A(){e[65].call(d,e[71])}function M(...E){return e[66](e[71],...E)}function z(){return e[67](e[71])}return{c(){var E;t=b("div"),n=b("h4"),n.textContent=`${e[71].title}`,r=L(),i=b("p"),i.textContent=`${e[71].desc}`,l=L(),o=b("div");for(let P=0;P<C.length;P+=1)C[P].c();s=L(),x&&x.c(),u=L(),f=b("div"),d=b("input"),h=L(),g=b("button"),p=j("Add"),m=L(),a(n,"class","text-sm font-medium text-gray-700 mb-1"),a(i,"class","text-xs text-gray-400 mb-2"),a(o,"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(g,"class","px-3 py-1.5 bg-indigo-600 text-white text-xs rounded-md hover:bg-indigo-700 disabled:opacity-50"),g.disabled=_=!((E=e[12][e[71].key])!=null&&E.trim()),a(f,"class","flex gap-2")},m(E,P){B(E,t,P),c(t,n),c(t,r),c(t,i),c(t,l),c(t,o);for(let I=0;I<C.length;I+=1)C[I]&&C[I].m(o,null);c(t,s),x&&x.m(t,null),c(t,u),c(t,f),c(f,d),Ee(d,e[12][e[71].key]),c(f,h),c(f,g),c(g,p),c(t,m),y||(v=[Q(d,"input",A),Q(d,"keydown",M),Q(g,"click",z)],y=!0)},p(E,P){var I;if(e=E,P[0]&201326592|P[1]&144){w=Le(e[26][e[71].key]);let D;for(D=0;D<w.length;D+=1){const T=na(e,w,D);C[D]?C[D].p(T,P):(C[D]=fa(T),C[D].c(),C[D].m(o,null))}for(;D<C.length;D+=1)C[D].d(1);C.length=w.length}e[11][e[71].key].custom.length>0?x?x.p(e,P):(x=da(e),x.c(),x.m(t,u)):x&&(x.d(1),x=null),P[0]&134221824&&d.value!==e[12][e[71].key]&&Ee(d,e[12][e[71].key]),P[0]&4096&&_!==(_=!((I=e[12][e[71].key])!=null&&I.trim()))&&(g.disabled=_)},d(E){E&&R(t),it(C,E),x&&x.d(),y=!1,$e(v)}}}function ga(e){let t,n;function r(o,s){if(o[24]==="clearing")return Zd;if(o[24]==="success")return Wd}let i=r(e),l=i&&i(e);return{c(){t=b("div"),n=b("div"),l&&l.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(o,s){B(o,t,s),c(t,n),l&&l.m(n,null)},p(o,s){i!==(i=r(o))&&(l&&l.d(1),l=i&&i(o),l&&(l.c(),l.m(n,null)))},d(o){o&&R(t),l&&l.d()}}}function Wd(e){let t,n,r,i,l,o,s,u,f,d,h,g;return{c(){t=pe("svg"),n=pe("defs"),r=pe("style"),i=j(`#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
+ `),l=pe("circle"),o=pe("path"),s=pe("circle"),u=pe("circle"),f=pe("circle"),d=pe("circle"),h=L(),g=b("p"),g.textContent="Pending cleared!",a(l,"id","loco-clear-ok-circle"),a(l,"cx","40"),a(l,"cy","40"),a(l,"r","30"),a(l,"fill","#2ECC88"),a(o,"id","loco-clear-checkmark"),a(o,"d","M25 40 L35 50 L55 30"),a(o,"fill","none"),a(o,"stroke","white"),a(o,"stroke-width","5"),a(o,"stroke-linecap","round"),a(o,"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(u,"class","loco-clear-spark2"),a(u,"cx","68"),a(u,"cy","18"),a(u,"r","2.5"),a(u,"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(g,"class","text-sm font-medium text-gray-700")},m(p,_){B(p,t,_),c(t,n),c(n,r),c(r,i),c(t,l),c(t,o),c(t,s),c(t,u),c(t,f),c(t,d),B(p,h,_),B(p,g,_)},d(p){p&&(R(t),R(h),R(g))}}}function Zd(e){let t,n,r,i,l,o,s,u,f,d,h,g,p,_,m,y,v,w,C,x,A,M,z,E,P;return{c(){t=pe("svg"),n=pe("defs"),r=pe("style"),i=j(`#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
+ `),l=pe("g"),o=pe("circle"),s=pe("path"),u=pe("path"),f=pe("path"),d=pe("g"),h=pe("circle"),g=pe("circle"),p=pe("circle"),_=pe("circle"),m=pe("circle"),y=pe("circle"),v=pe("path"),w=pe("line"),C=pe("line"),x=pe("line"),A=pe("circle"),M=pe("circle"),z=pe("circle"),E=L(),P=b("p"),P.textContent="Clearing pending…",a(o,"cx","40"),a(o,"cy","40"),a(o,"r","34"),a(o,"fill","none"),a(o,"stroke","#2a3040"),a(o,"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(u,"d","M74 40 A34 34 0 0 1 56 70"),a(u,"fill","none"),a(u,"stroke","#3A8FE0"),a(u,"stroke-width","4"),a(u,"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(l,"id","loco-clear-ring"),a(h,"cx","40"),a(h,"cy","40"),a(h,"r","16"),a(h,"fill","#1a1f2e"),a(g,"cx","40"),a(g,"cy","38"),a(g,"r","10"),a(g,"fill","#2ECC88"),a(p,"cx","37"),a(p,"cy","37"),a(p,"r","2.5"),a(p,"fill","white"),a(_,"cx","37.5"),a(_,"cy","37.5"),a(_,"r","1.5"),a(_,"fill","#2C2C2A"),a(m,"cx","43"),a(m,"cy","37"),a(m,"r","2.5"),a(m,"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(z,"cx","44"),a(z,"cy","25.5"),a(z,"r","1.5"),a(z,"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(I,D){B(I,t,D),c(t,n),c(n,r),c(r,i),c(t,l),c(l,o),c(l,s),c(l,u),c(l,f),c(t,d),c(d,h),c(d,g),c(d,p),c(d,_),c(d,m),c(d,y),c(d,v),c(d,w),c(d,C),c(d,x),c(d,A),c(d,M),c(d,z),B(I,E,D),B(I,P,D)},d(I){I&&(R(t),R(E),R(P))}}}function ma(e){let t,n;function r(o,s){if(o[23]==="resetting")return Vd;if(o[23]==="success")return Yd}let i=r(e),l=i&&i(e);return{c(){t=b("div"),n=b("div"),l&&l.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(o,s){B(o,t,s),c(t,n),l&&l.m(n,null)},p(o,s){i!==(i=r(o))&&(l&&l.d(1),l=i&&i(o),l&&(l.c(),l.m(n,null)))},d(o){o&&R(t),l&&l.d()}}}function Yd(e){let t,n,r,i,l,o,s,u,f,d,h,g;return{c(){t=pe("svg"),n=pe("defs"),r=pe("style"),i=j(`#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
+ `),l=pe("circle"),o=pe("path"),s=pe("circle"),u=pe("circle"),f=pe("circle"),d=pe("circle"),h=L(),g=b("p"),g.textContent="Database reset!",a(l,"id","loco-reset-ok-circle"),a(l,"cx","40"),a(l,"cy","40"),a(l,"r","30"),a(l,"fill","#2ECC88"),a(o,"id","loco-reset-checkmark"),a(o,"d","M25 40 L35 50 L55 30"),a(o,"fill","none"),a(o,"stroke","white"),a(o,"stroke-width","5"),a(o,"stroke-linecap","round"),a(o,"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(u,"class","loco-reset-spark2"),a(u,"cx","68"),a(u,"cy","18"),a(u,"r","2.5"),a(u,"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(g,"class","text-sm font-medium text-gray-700")},m(p,_){B(p,t,_),c(t,n),c(n,r),c(r,i),c(t,l),c(t,o),c(t,s),c(t,u),c(t,f),c(t,d),B(p,h,_),B(p,g,_)},d(p){p&&(R(t),R(h),R(g))}}}function Vd(e){let t,n,r,i,l,o,s,u,f,d,h,g,p,_,m,y,v,w,C,x,A,M,z,E,P;return{c(){t=pe("svg"),n=pe("defs"),r=pe("style"),i=j(`#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
+ `),l=pe("g"),o=pe("circle"),s=pe("path"),u=pe("path"),f=pe("path"),d=pe("g"),h=pe("circle"),g=pe("circle"),p=pe("circle"),_=pe("circle"),m=pe("circle"),y=pe("circle"),v=pe("path"),w=pe("line"),C=pe("line"),x=pe("line"),A=pe("circle"),M=pe("circle"),z=pe("circle"),E=L(),P=b("p"),P.textContent="Resetting database…",a(o,"cx","40"),a(o,"cy","40"),a(o,"r","34"),a(o,"fill","none"),a(o,"stroke","#2a3040"),a(o,"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(u,"d","M74 40 A34 34 0 0 1 56 70"),a(u,"fill","none"),a(u,"stroke","#f97316"),a(u,"stroke-width","4"),a(u,"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(l,"id","loco-reset-ring"),a(h,"cx","40"),a(h,"cy","40"),a(h,"r","16"),a(h,"fill","#1a1f2e"),a(g,"cx","40"),a(g,"cy","38"),a(g,"r","10"),a(g,"fill","#2ECC88"),a(p,"cx","37"),a(p,"cy","37"),a(p,"r","2.5"),a(p,"fill","white"),a(_,"cx","37.5"),a(_,"cy","37.5"),a(_,"r","1.5"),a(_,"fill","#2C2C2A"),a(m,"cx","43"),a(m,"cy","37"),a(m,"r","2.5"),a(m,"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(z,"cx","44"),a(z,"cy","25.5"),a(z,"r","1.5"),a(z,"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(I,D){B(I,t,D),c(t,n),c(n,r),c(r,i),c(t,l),c(l,o),c(l,s),c(l,u),c(l,f),c(t,d),c(d,h),c(d,g),c(d,p),c(d,_),c(d,m),c(d,y),c(d,v),c(d,w),c(d,C),c(d,x),c(d,A),c(d,M),c(d,z),B(I,E,D),B(I,P,D)},d(I){I&&(R(t),R(E),R(P))}}}function _a(e){let t,n;function r(o,s){if(o[22]==="backing-up")return Kd;if(o[22]==="success")return qd}let i=r(e),l=i&&i(e);return{c(){t=b("div"),n=b("div"),l&&l.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(o,s){B(o,t,s),c(t,n),l&&l.m(n,null)},p(o,s){i!==(i=r(o))&&(l&&l.d(1),l=i&&i(o),l&&(l.c(),l.m(n,null)))},d(o){o&&R(t),l&&l.d()}}}function qd(e){let t,n,r,i,l,o,s,u,f,d,h,g;return{c(){t=pe("svg"),n=pe("defs"),r=pe("style"),i=j(`@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
+ `),l=pe("circle"),o=pe("path"),s=pe("circle"),u=pe("circle"),f=pe("circle"),d=pe("circle"),h=L(),g=b("p"),g.textContent="Backup created!",a(l,"id","loco-success-circle"),a(l,"cx","40"),a(l,"cy","40"),a(l,"r","30"),a(l,"fill","#2ECC88"),a(o,"id","loco-checkmark"),a(o,"d","M25 40 L35 50 L55 30"),a(o,"fill","none"),a(o,"stroke","white"),a(o,"stroke-width","5"),a(o,"stroke-linecap","round"),a(o,"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(u,"class","loco-spark2"),a(u,"cx","68"),a(u,"cy","18"),a(u,"r","2.5"),a(u,"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(g,"class","text-sm font-medium text-gray-700")},m(p,_){B(p,t,_),c(t,n),c(n,r),c(r,i),c(t,l),c(t,o),c(t,s),c(t,u),c(t,f),c(t,d),B(p,h,_),B(p,g,_)},d(p){p&&(R(t),R(h),R(g))}}}function Kd(e){let t,n,r,i,l,o,s,u,f,d,h,g,p,_,m,y,v,w,C,x,A,M,z,E,P;return{c(){t=pe("svg"),n=pe("defs"),r=pe("style"),i=j(`@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
+ `),l=pe("g"),o=pe("circle"),s=pe("path"),u=pe("path"),f=pe("path"),d=pe("g"),h=pe("circle"),g=pe("circle"),p=pe("circle"),_=pe("circle"),m=pe("circle"),y=pe("circle"),v=pe("path"),w=pe("line"),C=pe("line"),x=pe("line"),A=pe("circle"),M=pe("circle"),z=pe("circle"),E=L(),P=b("p"),P.textContent="Creating backup…",a(o,"cx","40"),a(o,"cy","40"),a(o,"r","34"),a(o,"fill","none"),a(o,"stroke","#2a3040"),a(o,"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(u,"d","M74 40 A34 34 0 0 1 56 70"),a(u,"fill","none"),a(u,"stroke","#3A8FE0"),a(u,"stroke-width","4"),a(u,"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(l,"id","loco-spinner-ring"),a(h,"cx","40"),a(h,"cy","40"),a(h,"r","16"),a(h,"fill","#1a1f2e"),a(g,"cx","40"),a(g,"cy","38"),a(g,"r","10"),a(g,"fill","#2ECC88"),a(p,"cx","37"),a(p,"cy","37"),a(p,"r","2.5"),a(p,"fill","white"),a(_,"cx","37.5"),a(_,"cy","37.5"),a(_,"r","1.5"),a(_,"fill","#2C2C2A"),a(m,"cx","43"),a(m,"cy","37"),a(m,"r","2.5"),a(m,"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(z,"cx","44"),a(z,"cy","25.5"),a(z,"r","1.5"),a(z,"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(I,D){B(I,t,D),c(t,n),c(n,r),c(r,i),c(t,l),c(l,o),c(l,s),c(l,u),c(l,f),c(t,d),c(d,h),c(d,g),c(d,p),c(d,_),c(d,m),c(d,y),c(d,v),c(d,w),c(d,C),c(d,x),c(d,A),c(d,M),c(d,z),B(I,E,D),B(I,P,D)},d(I){I&&(R(t),R(E),R(P))}}}function Jd(e){let t,n,r,i,l,o,s,u,f,d,h=e[2]?"Saving…":"Save",g,p,_,m,y,v,w,C,x=e[25].api_key+"",A,M,z,E=e[1]==="key"?"Copied":"Copy",P,I,D,T=e[3]?"Regenerating…":"Regenerate API Key",N,k,F,re,V,oe,Y,ie,Z,H,ce,se=e[6]?"🙈":"👁️",ee,_e,fe,ye=e[5]?"Saving…":"Save",G,de,ue,te,Se,S,X,J,U=e[1]==="snippet"?"Copied":"Copy Snippet",O,W,le,q,K,ne,ke,ge,Ce,Fe,Me,We,Ze,Pe,Xe,He,et,tt,rt,we,be,ae,Ne,Ae,xe,Re,ve,Ye,Ke,ht,Gt,Lt,Xt,Wt,Qt,me=e[14]?"Enabled":"Disabled",De,Ue,nt,gt,ft,lt,dt,Je,Oe,ze,Ve,xt,Qe,Hn,Wn=e[15]?"Enabled":"Disabled",vr,Zr,Nt,vn,Zn,Yr,ln,Vr,Yn,qr,wr,Kr,Ct,Vn,Jr,qn,Gr,dn,Kn=e[16]?"Clearing…":"Clear All Pending",kr,he,Ie,Ge,ot,St,mt,Zt=e[17]?"Resetting…":"Reset Entire Database",Qi,$l,An,Tn,Xr,eo,Qr,$r=e[10]?"▲":"▼",$i,to,el,xr,Cr,Sr,tl,no;function ro(Te,qe){return Te[6]?Rd:Fd}let ei=ro(e),on=ei(e),Jn=Le(e[7]),Mt=[];for(let Te=0;Te<Jn.length;Te+=1)Mt[Te]=la(ia(e,Jn,Te));let jt=e[7].length===0&&oa();function io(Te,qe){return Te[20]?jd:Bd}let ti=io(e),wn=ti(e),zt=!e[18].length&&!e[19]&&sa(e);function lo(Te,qe){if(Te[19])return Hd;if(Te[18].length>0)return Ud}let Gn=lo(e),It=Gn&&Gn(e),Pt=e[10]&&ua(e),Dt=e[24]&&ga(e),Ot=e[23]&&ma(e),Ft=e[22]&&_a(e);return{c(){t=b("div"),n=b("h2"),n.textContent="Settings",r=L(),i=b("div"),l=b("label"),l.textContent="Project Name",o=L(),s=b("div"),u=b("input"),f=L(),d=b("button"),g=j(h),_=L(),m=b("div"),y=b("div"),y.textContent="API Key",v=L(),w=b("div"),C=b("code"),A=j(x),M=L(),z=b("button"),P=j(E),I=L(),D=b("button"),N=j(T),k=L(),F=b("div"),re=b("label"),re.textContent="BlueHive API Key",V=L(),oe=b("p"),oe.innerHTML='Required for AI-powered translations. Get your key from <a href="https://bluehive.com" target="_blank" class="text-indigo-600 hover:underline">bluehive.com</a>',Y=L(),ie=b("div"),Z=b("div"),on.c(),H=L(),ce=b("button"),ee=j(se),_e=L(),fe=b("button"),G=j(ye),de=L(),ue=b("div"),te=b("div"),te.textContent="CDN Script Snippet",Se=L(),S=b("pre"),S.textContent=`${e[28]()}`,X=L(),J=b("button"),O=j(U),W=L(),le=b("div"),q=b("div"),q.textContent="Target Languages",K=L(),ne=b("div");for(let Te=0;Te<Mt.length;Te+=1)Mt[Te].c();ke=L(),jt&&jt.c(),ge=L(),Ce=b("div"),Fe=b("div"),Me=b("label"),Me.textContent="Language Code",We=L(),Ze=b("input"),Pe=L(),Xe=b("div"),He=b("label"),He.textContent="Language Name",et=L(),tt=b("input"),rt=L(),we=b("button"),be=j("Add"),Ne=L(),Ae=b("div"),xe=b("div"),xe.textContent="DOM Context",Re=L(),ve=b("p"),ve.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.",Ye=L(),Ke=b("label"),ht=b("button"),Gt=b("span"),Wt=L(),Qt=b("span"),De=j(me),Ue=L(),nt=b("div"),gt=b("div"),gt.textContent="Page Screenshots",ft=L(),lt=b("p"),lt.textContent="When enabled, the Loco client will capture a page screenshot and send it to the dashboard for context during translation.",dt=L(),Je=b("label"),Oe=b("button"),ze=b("span"),Qe=L(),Hn=b("span"),vr=j(Wn),Zr=L(),Nt=b("div"),vn=b("div"),Zn=b("div"),Zn.textContent="Backups",Yr=L(),ln=b("button"),wn.c(),Vr=L(),Yn=b("p"),Yn.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.',qr=L(),zt&&zt.c(),wr=L(),It&&It.c(),Kr=L(),Ct=b("div"),Vn=b("div"),Vn.textContent="Danger Zone",Jr=L(),qn=b("p"),qn.textContent="Delete all pending text nodes from the database. Approved and trashed items are not affected.",Gr=L(),dn=b("button"),kr=j(Kn),he=L(),Ie=b("hr"),Ge=L(),ot=b("p"),ot.textContent="Delete ALL text nodes, translations, and screenshots. The project and its settings will be kept.",St=L(),mt=b("button"),Qi=j(Zt),$l=L(),An=b("div"),Tn=b("button"),Xr=b("span"),Xr.textContent="Crawler Configuration",eo=L(),Qr=b("span"),$i=j($r),to=L(),Pt&&Pt.c(),el=L(),Dt&&Dt.c(),xr=L(),Ot&&Ot.c(),Cr=L(),Ft&&Ft.c(),Sr=bt(),a(n,"class","text-xl font-semibold text-gray-800 mb-6"),a(l,"for","project-name"),a(l,"class","block text-sm font-medium text-gray-600 mb-2"),a(u,"id","project-name"),a(u,"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(u,"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=p=e[2]||e[0]===e[25].name,a(s,"class","flex gap-2"),a(i,"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(z,"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(D,"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"),D.disabled=e[3],a(m,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(re,"for","bluehive-api-key"),a(re,"class","block text-sm font-medium text-gray-600 mb-2"),a(oe,"class","text-xs text-gray-400 mb-2"),a(ce,"class","absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 text-xs"),a(ce,"type","button"),a(Z,"class","relative flex-1"),a(fe,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),fe.disabled=e[5],a(ie,"class","flex gap-2"),a(F,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(te,"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(q,"class","block text-sm font-medium text-gray-600 mb-3"),a(ne,"class","space-y-1 mb-4"),a(Me,"for","new-language-code"),a(Me,"class","block text-xs text-gray-500 mb-1"),a(Ze,"id","new-language-code"),a(Ze,"placeholder","e.g. zh-Hans"),a(Ze,"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(Fe,"class","flex-1"),a(He,"for","new-language-name"),a(He,"class","block text-xs text-gray-500 mb-1"),a(tt,"id","new-language-name"),a(tt,"placeholder","e.g. Chinese (Simplified)"),a(tt,"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(Xe,"class","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=ae=!e[8].trim()||!e[9].trim(),a(Ce,"class","flex gap-2 items-end"),a(le,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(xe,"class","block text-sm font-medium text-gray-700 mb-2"),a(ve,"class","text-xs text-gray-500 mb-3"),a(Gt,"class",Lt="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(e[14]?"translate-x-6":"translate-x-1")),a(ht,"class",Xt="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(e[14]?"bg-indigo-600":"bg-gray-300")),a(ht,"role","switch"),a(ht,"aria-checked",e[14]),a(Qt,"class","text-sm text-gray-700"),a(Ke,"class","flex items-center gap-3 cursor-pointer"),a(Ae,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(gt,"class","block text-sm font-medium text-gray-700 mb-2"),a(lt,"class","text-xs text-gray-500 mb-3"),a(ze,"class",Ve="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(e[15]?"translate-x-6":"translate-x-1")),a(Oe,"class",xt="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(e[15]?"bg-indigo-600":"bg-gray-300")),a(Oe,"role","switch"),a(Oe,"aria-checked",e[15]),a(Hn,"class","text-sm text-gray-700"),a(Je,"class","flex items-center gap-3 cursor-pointer"),a(nt,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(Zn,"class","text-sm font-medium text-gray-700"),a(ln,"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"),ln.disabled=e[20],a(vn,"class","flex items-center justify-between mb-3"),a(Yn,"class","text-xs text-gray-400 mb-3"),a(Nt,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(Vn,"class","block text-sm font-medium text-red-600 mb-2"),a(qn,"class","text-xs text-gray-500 mb-3"),a(dn,"class","px-4 py-2 bg-red-600 text-white text-sm rounded-md hover:bg-red-700 disabled:opacity-50"),dn.disabled=e[16],a(Ie,"class","my-4 border-red-100"),a(ot,"class","text-xs text-gray-500 mb-3"),a(mt,"class","px-4 py-2 bg-red-700 text-white text-sm rounded-md hover:bg-red-800 disabled:opacity-50"),mt.disabled=e[17],a(Ct,"class","bg-white rounded-lg border border-red-200 p-5 mb-4"),a(Xr,"class","text-sm font-medium text-gray-600"),a(Qr,"class","text-gray-400 text-xs"),a(Tn,"class","flex items-center justify-between w-full text-left"),a(An,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(t,"class","max-w-2xl")},m(Te,qe){B(Te,t,qe),c(t,n),c(t,r),c(t,i),c(i,l),c(i,o),c(i,s),c(s,u),Ee(u,e[0]),c(s,f),c(s,d),c(d,g),c(t,_),c(t,m),c(m,y),c(m,v),c(m,w),c(w,C),c(C,A),c(w,M),c(w,z),c(z,P),c(m,I),c(m,D),c(D,N),c(t,k),c(t,F),c(F,re),c(F,V),c(F,oe),c(F,Y),c(F,ie),c(ie,Z),on.m(Z,null),c(Z,H),c(Z,ce),c(ce,ee),c(ie,_e),c(ie,fe),c(fe,G),c(t,de),c(t,ue),c(ue,te),c(ue,Se),c(ue,S),c(ue,X),c(ue,J),c(J,O),c(t,W),c(t,le),c(le,q),c(le,K),c(le,ne);for(let wt=0;wt<Mt.length;wt+=1)Mt[wt]&&Mt[wt].m(ne,null);c(le,ke),jt&&jt.m(le,null),c(le,ge),c(le,Ce),c(Ce,Fe),c(Fe,Me),c(Fe,We),c(Fe,Ze),Ee(Ze,e[8]),c(Ce,Pe),c(Ce,Xe),c(Xe,He),c(Xe,et),c(Xe,tt),Ee(tt,e[9]),c(Ce,rt),c(Ce,we),c(we,be),c(t,Ne),c(t,Ae),c(Ae,xe),c(Ae,Re),c(Ae,ve),c(Ae,Ye),c(Ae,Ke),c(Ke,ht),c(ht,Gt),c(Ke,Wt),c(Ke,Qt),c(Qt,De),c(t,Ue),c(t,nt),c(nt,gt),c(nt,ft),c(nt,lt),c(nt,dt),c(nt,Je),c(Je,Oe),c(Oe,ze),c(Je,Qe),c(Je,Hn),c(Hn,vr),c(t,Zr),c(t,Nt),c(Nt,vn),c(vn,Zn),c(vn,Yr),c(vn,ln),wn.m(ln,null),c(Nt,Vr),c(Nt,Yn),c(Nt,qr),zt&&zt.m(Nt,null),c(Nt,wr),It&&It.m(Nt,null),c(t,Kr),c(t,Ct),c(Ct,Vn),c(Ct,Jr),c(Ct,qn),c(Ct,Gr),c(Ct,dn),c(dn,kr),c(Ct,he),c(Ct,Ie),c(Ct,Ge),c(Ct,ot),c(Ct,St),c(Ct,mt),c(mt,Qi),c(t,$l),c(t,An),c(An,Tn),c(Tn,Xr),c(Tn,eo),c(Tn,Qr),c(Qr,$i),c(An,to),Pt&&Pt.m(An,null),B(Te,el,qe),Dt&&Dt.m(Te,qe),B(Te,xr,qe),Ot&&Ot.m(Te,qe),B(Te,Cr,qe),Ft&&Ft.m(Te,qe),B(Te,Sr,qe),tl||(no=[Q(u,"input",e[47]),Q(d,"click",e[30]),Q(z,"click",e[48]),Q(D,"click",e[31]),Q(ce,"click",e[51]),Q(fe,"click",e[29]),Q(J,"click",e[52]),Q(Ze,"input",e[54]),Q(tt,"input",e[55]),Q(we,"click",e[32]),Q(ht,"click",e[40]),Q(Oe,"click",e[39]),Q(ln,"click",e[44]),Q(dn,"click",e[41]),Q(mt,"click",e[42]),Q(Tn,"click",e[57])],tl=!0)},p(Te,qe){if(qe[0]&1&&u.value!==Te[0]&&Ee(u,Te[0]),qe[0]&4&&h!==(h=Te[2]?"Saving…":"Save")&&$(g,h),qe[0]&33554437&&p!==(p=Te[2]||Te[0]===Te[25].name)&&(d.disabled=p),qe[0]&33554432&&x!==(x=Te[25].api_key+"")&&$(A,x),qe[0]&2&&E!==(E=Te[1]==="key"?"Copied":"Copy")&&$(P,E),qe[0]&8&&T!==(T=Te[3]?"Regenerating…":"Regenerate API Key")&&$(N,T),qe[0]&8&&(D.disabled=Te[3]),ei===(ei=ro(Te))&&on?on.p(Te,qe):(on.d(1),on=ei(Te),on&&(on.c(),on.m(Z,H))),qe[0]&64&&se!==(se=Te[6]?"🙈":"👁️")&&$(ee,se),qe[0]&32&&ye!==(ye=Te[5]?"Saving…":"Save")&&$(G,ye),qe[0]&32&&(fe.disabled=Te[5]),qe[0]&2&&U!==(U=Te[1]==="snippet"?"Copied":"Copy Snippet")&&$(O,U),qe[0]&128|qe[1]&4){Jn=Le(Te[7]);let wt;for(wt=0;wt<Jn.length;wt+=1){const oo=ia(Te,Jn,wt);Mt[wt]?Mt[wt].p(oo,qe):(Mt[wt]=la(oo),Mt[wt].c(),Mt[wt].m(ne,null))}for(;wt<Mt.length;wt+=1)Mt[wt].d(1);Mt.length=Jn.length}Te[7].length===0?jt||(jt=oa(),jt.c(),jt.m(le,ge)):jt&&(jt.d(1),jt=null),qe[0]&256&&Ze.value!==Te[8]&&Ee(Ze,Te[8]),qe[0]&512&&tt.value!==Te[9]&&Ee(tt,Te[9]),qe[0]&768&&ae!==(ae=!Te[8].trim()||!Te[9].trim())&&(we.disabled=ae),qe[0]&16384&&Lt!==(Lt="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(Te[14]?"translate-x-6":"translate-x-1"))&&a(Gt,"class",Lt),qe[0]&16384&&Xt!==(Xt="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(Te[14]?"bg-indigo-600":"bg-gray-300"))&&a(ht,"class",Xt),qe[0]&16384&&a(ht,"aria-checked",Te[14]),qe[0]&16384&&me!==(me=Te[14]?"Enabled":"Disabled")&&$(De,me),qe[0]&32768&&Ve!==(Ve="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(Te[15]?"translate-x-6":"translate-x-1"))&&a(ze,"class",Ve),qe[0]&32768&&xt!==(xt="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(Te[15]?"bg-indigo-600":"bg-gray-300"))&&a(Oe,"class",xt),qe[0]&32768&&a(Oe,"aria-checked",Te[15]),qe[0]&32768&&Wn!==(Wn=Te[15]?"Enabled":"Disabled")&&$(vr,Wn),ti!==(ti=io(Te))&&(wn.d(1),wn=ti(Te),wn&&(wn.c(),wn.m(ln,null))),qe[0]&1048576&&(ln.disabled=Te[20]),!Te[18].length&&!Te[19]?zt?zt.p(Te,qe):(zt=sa(Te),zt.c(),zt.m(Nt,wr)):zt&&(zt.d(1),zt=null),Gn===(Gn=lo(Te))&&It?It.p(Te,qe):(It&&It.d(1),It=Gn&&Gn(Te),It&&(It.c(),It.m(Nt,null))),qe[0]&65536&&Kn!==(Kn=Te[16]?"Clearing…":"Clear All Pending")&&$(kr,Kn),qe[0]&65536&&(dn.disabled=Te[16]),qe[0]&131072&&Zt!==(Zt=Te[17]?"Resetting…":"Reset Entire Database")&&$(Qi,Zt),qe[0]&131072&&(mt.disabled=Te[17]),qe[0]&1024&&$r!==($r=Te[10]?"▲":"▼")&&$($i,$r),Te[10]?Pt?Pt.p(Te,qe):(Pt=ua(Te),Pt.c(),Pt.m(An,null)):Pt&&(Pt.d(1),Pt=null),Te[24]?Dt?Dt.p(Te,qe):(Dt=ga(Te),Dt.c(),Dt.m(xr.parentNode,xr)):Dt&&(Dt.d(1),Dt=null),Te[23]?Ot?Ot.p(Te,qe):(Ot=ma(Te),Ot.c(),Ot.m(Cr.parentNode,Cr)):Ot&&(Ot.d(1),Ot=null),Te[22]?Ft?Ft.p(Te,qe):(Ft=_a(Te),Ft.c(),Ft.m(Sr.parentNode,Sr)):Ft&&(Ft.d(1),Ft=null)},i:Be,o:Be,d(Te){Te&&(R(t),R(el),R(xr),R(Cr),R(Sr)),on.d(),it(Mt,Te),jt&&jt.d(),wn.d(),zt&&zt.d(),It&&It.d(),Pt&&Pt.d(),Dt&&Dt.d(Te),Ot&&Ot.d(Te),Ft&&Ft.d(Te),tl=!1,$e(no)}}}function ba(e){return e<1024?e+" B":e<1024*1024?(e/1024).toFixed(1)+" KB":(e/(1024*1024)).toFixed(1)+" MB"}function ya(e){return new Date(e).toLocaleString()}function Gd(e,t,n){let r;Or(e,Yt,be=>n(25,r=be));const i=[{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"}],l={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"]},o=[{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="",u="",f=!1,d=!1,h={},g="",p=!1,_=!1,m=[],y="",v="",w=!1,C={blockedTags:{disabled:[],custom:[]},inlineTags:{disabled:[],custom:[]},domContextSelectors:{disabled:[],custom:[]}},x={blockedTags:"",inlineTags:"",domContextSelectors:""},A=0,M=!0,z=!0,E=!1,P=!1,I=[],D=!1,T=!1,N=null,k=!1,F=!1,re=!1;br(()=>{n(0,s=r.name||"");try{h=JSON.parse(r.settings||"{}")}catch{h={}}n(7,m=h.languages||i.map(be=>({...be}))),n(4,g=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,z=h.screenshotsEnabled!==!1)});function V(){const be=window.location.pathname.replace(/\/dashboard\/?$/,""),ae=window.location.origin+be;return`<script src="${ae}/cdn/loco.js"><\/script>
62
+ <script>Loco.init({ apiUrl: '${ae}', apiKey: '${r.api_key}' });<\/script>`}async function oe(){n(5,p=!0),h.bluehiveApiKey=g.trim();const be=await je("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})});Xn(Yt,r=await be.json(),r),n(5,p=!1)}async function Y(){n(2,f=!0);const be=await je("../api/project",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s})});Xn(Yt,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 je("../api/project/regenerate-key",{method:"POST"});Xn(Yt,r=await be.json(),r),r&&r.api_key&&cc(r.api_key),n(3,d=!1)}async function Z(){h.languages=m;const be=await je("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})});Xn(Yt,r=await be.json(),r)}function H(){const be=y.trim(),ae=v.trim();!be||!ae||m.some(Ne=>Ne.code===be)||(n(7,m=[...m,{code:be,name:ae}]),n(8,y=""),n(9,v=""),Z())}function ce(be){n(7,m=m.filter(ae=>ae.code!==be)),Z()}async function se(){h.blockedTags=C.blockedTags,h.inlineTags=C.inlineTags,h.domContextSelectors=C.domContextSelectors,h.contextDepth=A;const be=await je("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})});Xn(Yt,r=await be.json(),r)}function ee(be,ae){const Ne=C[be].disabled,Ae=Ne.indexOf(ae);Ae>=0?Ne.splice(Ae,1):Ne.push(ae),n(11,C),se()}function _e(be){const ae=x[be].trim();!ae||C[be].custom.includes(ae)||(n(11,C[be].custom=[...C[be].custom,ae],C),n(12,x[be]="",x),n(12,x),se())}function fe(be,ae){n(11,C[be].custom=C[be].custom.filter(Ne=>Ne!==ae),C),n(11,C),se()}function ye(be,ae){return!C[be].disabled.includes(ae)}async function G(){n(15,z=!z),h.screenshotsEnabled=z,await je("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})})}async function de(){n(14,M=!M),h.domContextEnabled=M;const be=await je("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})});Xn(Yt,r=await be.json(),r)}async function ue(){if(confirm("Delete ALL pending text nodes? This cannot be undone.")){n(16,E=!0),n(24,re="clearing");try{await je("../api/textnodes/clear-pending",{method:"POST"}),n(24,re="success"),await new Promise(be=>setTimeout(be,1500))}catch{}n(24,re=!1),n(16,E=!1)}}async function te(){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,F="resetting");try{await je("../api/project/reset-database",{method:"POST"}),n(23,F="success"),await new Promise(be=>setTimeout(be,1500))}catch{}n(23,F=!1),n(17,P=!1)}}async function Se(){n(19,D=!0);try{const be=await je("../api/backups");n(18,I=await be.json())}catch{n(18,I=[])}n(19,D=!1)}async function S(){n(20,T=!0),n(22,k="backing-up");try{await je("../api/backups",{method:"POST"}),await Se(),n(22,k="success"),await new Promise(be=>setTimeout(be,1500))}catch{}n(22,k=!1),n(20,T=!1)}async function X(be){if(confirm(`Delete backup "${be}"? This cannot be undone.`)){n(21,N=be);try{await je(`../api/backups/${encodeURIComponent(be)}`,{method:"DELETE"}),await Se()}catch{}n(21,N=null)}}async function J(be,ae){await navigator.clipboard.writeText(be),n(1,u=ae),setTimeout(()=>{n(1,u="")},2e3)}function U(){s=this.value,n(0,s)}const O=()=>J(r.api_key,"key");function W(){g=this.value,n(4,g)}function le(){g=this.value,n(4,g)}const q=()=>n(6,_=!_),K=()=>J(V(),"snippet"),ne=be=>ce(be.code);function ke(){y=this.value,n(8,y)}function ge(){v=this.value,n(9,v)}const Ce=be=>X(be.filename),Fe=()=>n(10,w=!w),Me=()=>{n(13,A=0),se()},We=()=>{A===0&&(n(13,A=5),se())},Ze=()=>{n(13,A=Math.max(1,A-1)),se()};function Pe(){A=ic(this.value),n(13,A)}const Xe=()=>{n(13,A=A+1),se()},He=(be,ae)=>ee(be.key,ae),et=(be,ae)=>fe(be.key,ae);function tt(be){x[be.key]=this.value,n(12,x)}return[s,u,f,d,g,p,_,m,y,v,w,C,x,A,M,z,E,P,I,D,T,N,k,F,re,r,l,o,V,oe,Y,ie,H,ce,se,ee,_e,fe,ye,G,de,ue,te,Se,S,X,J,U,O,W,le,q,K,ne,ke,ge,Ce,Fe,Me,We,Ze,Pe,Xe,He,et,tt,(be,ae)=>{ae.key==="Enter"&&_e(be.key)},be=>_e(be.key)]}class Xd extends nn{constructor(t){super(),tn(this,t,Gd,Jd,Jt,{},null,[-1,-1,-1])}}function hi(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Qd(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Dl(e){let t,n,r;e.length!==2?(t=hi,n=(s,u)=>hi(e(s),u),r=(s,u)=>e(s)-u):(t=e===hi||e===Qd?e:$d,n=e,r=e);function i(s,u,f=0,d=s.length){if(f<d){if(t(u,u)!==0)return d;do{const h=f+d>>>1;n(s[h],u)<0?f=h+1:d=h}while(f<d)}return f}function l(s,u,f=0,d=s.length){if(f<d){if(t(u,u)!==0)return d;do{const h=f+d>>>1;n(s[h],u)<=0?f=h+1:d=h}while(f<d)}return f}function o(s,u,f=0,d=s.length){const h=i(s,u,f,d-1);return h>f&&r(s[h-1],u)>-r(s[h],u)?h-1:h}return{left:i,center:o,right:l}}function $d(){return 0}function e0(e){return e===null?NaN:+e}const t0=Dl(hi),n0=t0.right;Dl(e0).center;function r0(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let l of e)(l=t(l,++i,e))!=null&&(n===void 0?l>=l&&(n=r=l):(n>l&&(n=l),r<l&&(r=l)))}return[n,r]}class va extends Map{constructor(t,n=o0){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(wa(this,t))}has(t){return super.has(wa(this,t))}set(t,n){return super.set(i0(this,t),n)}delete(t){return super.delete(l0(this,t))}}function wa({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function i0({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function l0({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function o0(e){return e!==null&&typeof e=="object"?e.valueOf():e}const s0=Math.sqrt(50),a0=Math.sqrt(10),u0=Math.sqrt(2);function Ci(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),l=r/Math.pow(10,i),o=l>=s0?10:l>=a0?5:l>=u0?2:1;let s,u,f;return i<0?(f=Math.pow(10,-i)/o,s=Math.round(e*f),u=Math.round(t*f),s/f<e&&++s,u/f>t&&--u,f=-f):(f=Math.pow(10,i)*o,s=Math.round(e/f),u=Math.round(t/f),s*f<e&&++s,u*f>t&&--u),u<s&&.5<=n&&n<2?Ci(e,t,n*2):[s,u,f]}function c0(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,l,o]=r?Ci(t,e,n):Ci(e,t,n);if(!(l>=i))return[];const s=l-i+1,u=new Array(s);if(r)if(o<0)for(let f=0;f<s;++f)u[f]=(l-f)/-o;else for(let f=0;f<s;++f)u[f]=(l-f)*o;else if(o<0)for(let f=0;f<s;++f)u[f]=(i+f)/-o;else for(let f=0;f<s;++f)u[f]=(i+f)*o;return u}function _l(e,t,n){return t=+t,e=+e,n=+n,Ci(e,t,n)[2]}function bl(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?_l(t,e,n):_l(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function oi(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 i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function f0(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,l=new Array(i);++r<i;)l[r]=e+r*n;return l}function d0(e){return e}var rl=1,il=2,yl=3,Lr=4,ka=1e-6;function h0(e){return"translate("+e+",0)"}function p0(e){return"translate(0,"+e+")"}function g0(e){return t=>+e(t)}function m0(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function _0(){return!this.__axis}function pc(e,t){var n=[],r=null,i=null,l=6,o=6,s=3,u=typeof window<"u"&&window.devicePixelRatio>1?0:.5,f=e===rl||e===Lr?-1:1,d=e===Lr||e===il?"x":"y",h=e===rl||e===yl?h0:p0;function g(p){var _=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):d0),y=Math.max(l,0)+s,v=t.range(),w=+v[0]+u,C=+v[v.length-1]+u,x=(t.bandwidth?m0:g0)(t.copy(),u),A=p.selection?p.selection():p,M=A.selectAll(".domain").data([null]),z=A.selectAll(".tick").data(_,t).order(),E=z.exit(),P=z.enter().append("g").attr("class","tick"),I=z.select("line"),D=z.select("text");M=M.merge(M.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),z=z.merge(P),I=I.merge(P.append("line").attr("stroke","currentColor").attr(d+"2",f*l)),D=D.merge(P.append("text").attr("fill","currentColor").attr(d,f*y).attr("dy",e===rl?"0em":e===yl?"0.71em":"0.32em")),p!==A&&(M=M.transition(p),z=z.transition(p),I=I.transition(p),D=D.transition(p),E=E.transition(p).attr("opacity",ka).attr("transform",function(T){return isFinite(T=x(T))?h(T+u):this.getAttribute("transform")}),P.attr("opacity",ka).attr("transform",function(T){var N=this.parentNode.__axis;return h((N&&isFinite(N=N(T))?N:x(T))+u)})),E.remove(),M.attr("d",e===Lr||e===il?o?"M"+f*o+","+w+"H"+u+"V"+C+"H"+f*o:"M"+u+","+w+"V"+C:o?"M"+w+","+f*o+"V"+u+"H"+C+"V"+f*o:"M"+w+","+u+"H"+C),z.attr("opacity",1).attr("transform",function(T){return h(x(T)+u)}),I.attr(d+"2",f*l),D.attr(d,f*y).text(m),A.filter(_0).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===il?"start":e===Lr?"end":"middle"),A.each(function(){this.__axis=x})}return g.scale=function(p){return arguments.length?(t=p,g):t},g.ticks=function(){return n=Array.from(arguments),g},g.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),g):n.slice()},g.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),g):r&&r.slice()},g.tickFormat=function(p){return arguments.length?(i=p,g):i},g.tickSize=function(p){return arguments.length?(l=o=+p,g):l},g.tickSizeInner=function(p){return arguments.length?(l=+p,g):l},g.tickSizeOuter=function(p){return arguments.length?(o=+p,g):o},g.tickPadding=function(p){return arguments.length?(s=+p,g):s},g.offset=function(p){return arguments.length?(u=+p,g):u},g}function xa(e){return pc(yl,e)}function Ca(e){return pc(Lr,e)}var b0={value:()=>{}};function gc(){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 pi(n)}function pi(e){this._=e}function y0(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}pi.prototype=gc.prototype={constructor:pi,on:function(e,t){var n=this._,r=y0(e+"",n),i,l=-1,o=r.length;if(arguments.length<2){for(;++l<o;)if((i=(e=r[l]).type)&&(i=v0(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<o;)if(i=(e=r[l]).type)n[i]=Sa(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Sa(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new pi(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,l;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],r=0,i=l.length;r<i;++r)l[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],i=0,l=r.length;i<l;++i)r[i].value.apply(t,n)}};function v0(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Sa(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=b0,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var vl="http://www.w3.org/1999/xhtml";const Aa={svg:"http://www.w3.org/2000/svg",xhtml:vl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Wi(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Aa.hasOwnProperty(t)?{space:Aa[t],local:e}:e}function w0(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===vl&&t.documentElement.namespaceURI===vl?t.createElement(e):t.createElementNS(n,e)}}function k0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mc(e){var t=Wi(e);return(t.local?k0:w0)(t)}function x0(){}function Ol(e){return e==null?x0:function(){return this.querySelector(e)}}function C0(e){typeof e!="function"&&(e=Ol(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var l=t[i],o=l.length,s=r[i]=new Array(o),u,f,d=0;d<o;++d)(u=l[d])&&(f=e.call(u,u.__data__,d,l))&&("__data__"in u&&(f.__data__=u.__data__),s[d]=f);return new Ht(r,this._parents)}function S0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function A0(){return[]}function _c(e){return e==null?A0:function(){return this.querySelectorAll(e)}}function T0(e){return function(){return S0(e.apply(this,arguments))}}function M0(e){typeof e=="function"?e=T0(e):e=_c(e);for(var t=this._groups,n=t.length,r=[],i=[],l=0;l<n;++l)for(var o=t[l],s=o.length,u,f=0;f<s;++f)(u=o[f])&&(r.push(e.call(u,u.__data__,f,o)),i.push(u));return new Ht(r,i)}function bc(e){return function(){return this.matches(e)}}function yc(e){return function(t){return t.matches(e)}}var E0=Array.prototype.find;function L0(e){return function(){return E0.call(this.children,e)}}function N0(){return this.firstElementChild}function z0(e){return this.select(e==null?N0:L0(typeof e=="function"?e:yc(e)))}var I0=Array.prototype.filter;function P0(){return Array.from(this.children)}function D0(e){return function(){return I0.call(this.children,e)}}function O0(e){return this.selectAll(e==null?P0:D0(typeof e=="function"?e:yc(e)))}function F0(e){typeof e!="function"&&(e=bc(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var l=t[i],o=l.length,s=r[i]=[],u,f=0;f<o;++f)(u=l[f])&&e.call(u,u.__data__,f,l)&&s.push(u);return new Ht(r,this._parents)}function vc(e){return new Array(e.length)}function R0(){return new Ht(this._enter||this._groups.map(vc),this._parents)}function Si(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Si.prototype={constructor:Si,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 B0(e){return function(){return e}}function j0(e,t,n,r,i,l){for(var o=0,s,u=t.length,f=l.length;o<f;++o)(s=t[o])?(s.__data__=l[o],r[o]=s):n[o]=new Si(e,l[o]);for(;o<u;++o)(s=t[o])&&(i[o]=s)}function U0(e,t,n,r,i,l,o){var s,u,f=new Map,d=t.length,h=l.length,g=new Array(d),p;for(s=0;s<d;++s)(u=t[s])&&(g[s]=p=o.call(u,u.__data__,s,t)+"",f.has(p)?i[s]=u:f.set(p,u));for(s=0;s<h;++s)p=o.call(e,l[s],s,l)+"",(u=f.get(p))?(r[s]=u,u.__data__=l[s],f.delete(p)):n[s]=new Si(e,l[s]);for(s=0;s<d;++s)(u=t[s])&&f.get(g[s])===u&&(i[s]=u)}function H0(e){return e.__data__}function W0(e,t){if(!arguments.length)return Array.from(this,H0);var n=t?U0:j0,r=this._parents,i=this._groups;typeof e!="function"&&(e=B0(e));for(var l=i.length,o=new Array(l),s=new Array(l),u=new Array(l),f=0;f<l;++f){var d=r[f],h=i[f],g=h.length,p=Z0(e.call(d,d&&d.__data__,f,r)),_=p.length,m=s[f]=new Array(_),y=o[f]=new Array(_),v=u[f]=new Array(g);n(d,h,m,y,v,p,t);for(var w=0,C=0,x,A;w<_;++w)if(x=m[w]){for(w>=C&&(C=w+1);!(A=y[C])&&++C<_;);x._next=A||null}}return o=new Ht(o,r),o._enter=s,o._exit=u,o}function Z0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Y0(){return new Ht(this._exit||this._groups.map(vc),this._parents)}function V0(e,t,n){var r=this.enter(),i=this,l=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?l.remove():n(l),r&&i?r.merge(i).order():i}function q0(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,l=r.length,o=Math.min(i,l),s=new Array(i),u=0;u<o;++u)for(var f=n[u],d=r[u],h=f.length,g=s[u]=new Array(h),p,_=0;_<h;++_)(p=f[_]||d[_])&&(g[_]=p);for(;u<i;++u)s[u]=n[u];return new Ht(s,this._parents)}function K0(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,l=r[i],o;--i>=0;)(o=r[i])&&(l&&o.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(o,l),l=o);return this}function J0(e){e||(e=G0);function t(h,g){return h&&g?e(h.__data__,g.__data__):!h-!g}for(var n=this._groups,r=n.length,i=new Array(r),l=0;l<r;++l){for(var o=n[l],s=o.length,u=i[l]=new Array(s),f,d=0;d<s;++d)(f=o[d])&&(u[d]=f);u.sort(t)}return new Ht(i,this._parents).order()}function G0(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function X0(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Q0(){return Array.from(this)}function $0(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,l=r.length;i<l;++i){var o=r[i];if(o)return o}return null}function eh(){let e=0;for(const t of this)++e;return e}function th(){return!this.node()}function nh(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],l=0,o=i.length,s;l<o;++l)(s=i[l])&&e.call(s,s.__data__,l,i);return this}function rh(e){return function(){this.removeAttribute(e)}}function ih(e){return function(){this.removeAttributeNS(e.space,e.local)}}function lh(e,t){return function(){this.setAttribute(e,t)}}function oh(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function sh(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function ah(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 uh(e,t){var n=Wi(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?ih:rh:typeof t=="function"?n.local?ah:sh:n.local?oh:lh)(n,t))}function wc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ch(e){return function(){this.style.removeProperty(e)}}function fh(e,t,n){return function(){this.style.setProperty(e,t,n)}}function dh(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function hh(e,t,n){return arguments.length>1?this.each((t==null?ch:typeof t=="function"?dh:fh)(e,t,n??"")):dr(this.node(),e)}function dr(e,t){return e.style.getPropertyValue(t)||wc(e).getComputedStyle(e,null).getPropertyValue(t)}function ph(e){return function(){delete this[e]}}function gh(e,t){return function(){this[e]=t}}function mh(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function _h(e,t){return arguments.length>1?this.each((t==null?ph:typeof t=="function"?mh:gh)(e,t)):this.node()[e]}function kc(e){return e.trim().split(/^|\s+/)}function Fl(e){return e.classList||new xc(e)}function xc(e){this._node=e,this._names=kc(e.getAttribute("class")||"")}xc.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 Cc(e,t){for(var n=Fl(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Sc(e,t){for(var n=Fl(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function bh(e){return function(){Cc(this,e)}}function yh(e){return function(){Sc(this,e)}}function vh(e,t){return function(){(t.apply(this,arguments)?Cc:Sc)(this,e)}}function wh(e,t){var n=kc(e+"");if(arguments.length<2){for(var r=Fl(this.node()),i=-1,l=n.length;++i<l;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?vh:t?bh:yh)(n,t))}function kh(){this.textContent=""}function xh(e){return function(){this.textContent=e}}function Ch(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Sh(e){return arguments.length?this.each(e==null?kh:(typeof e=="function"?Ch:xh)(e)):this.node().textContent}function Ah(){this.innerHTML=""}function Th(e){return function(){this.innerHTML=e}}function Mh(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Eh(e){return arguments.length?this.each(e==null?Ah:(typeof e=="function"?Mh:Th)(e)):this.node().innerHTML}function Lh(){this.nextSibling&&this.parentNode.appendChild(this)}function Nh(){return this.each(Lh)}function zh(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ih(){return this.each(zh)}function Ph(e){var t=typeof e=="function"?e:mc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Dh(){return null}function Oh(e,t){var n=typeof e=="function"?e:mc(e),r=t==null?Dh:typeof t=="function"?t:Ol(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Fh(){var e=this.parentNode;e&&e.removeChild(this)}function Rh(){return this.each(Fh)}function Bh(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function jh(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Uh(e){return this.select(e?jh:Bh)}function Hh(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Wh(e){return function(t){e.call(this,t,this.__data__)}}function Zh(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 Yh(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,l;n<i;++n)l=t[n],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++r]=l;++r?t.length=r:delete this.__on}}}function Vh(e,t,n){return function(){var r=this.__on,i,l=Wh(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=l,i.options=n),i.value=t;return}}this.addEventListener(e.type,l,n),i={type:e.type,name:e.name,value:t,listener:l,options:n},r?r.push(i):this.__on=[i]}}function qh(e,t,n){var r=Zh(e+""),i,l=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var u=0,f=s.length,d;u<f;++u)for(i=0,d=s[u];i<l;++i)if((o=r[i]).type===d.type&&o.name===d.name)return d.value}return}for(s=t?Vh:Yh,i=0;i<l;++i)this.each(s(r[i],t,n));return this}function Ac(e,t,n){var r=wc(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Kh(e,t){return function(){return Ac(this,e,t)}}function Jh(e,t){return function(){return Ac(this,e,t.apply(this,arguments))}}function Gh(e,t){return this.each((typeof t=="function"?Jh:Kh)(e,t))}function*Xh(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,l=r.length,o;i<l;++i)(o=r[i])&&(yield o)}var Tc=[null];function Ht(e,t){this._groups=e,this._parents=t}function Hr(){return new Ht([[document.documentElement]],Tc)}function Qh(){return this}Ht.prototype=Hr.prototype={constructor:Ht,select:C0,selectAll:M0,selectChild:z0,selectChildren:O0,filter:F0,data:W0,enter:R0,exit:Y0,join:V0,merge:q0,selection:Qh,order:K0,sort:J0,call:X0,nodes:Q0,node:$0,size:eh,empty:th,each:nh,attr:uh,style:hh,property:_h,classed:wh,text:Sh,html:Eh,raise:Nh,lower:Ih,append:Ph,insert:Oh,remove:Rh,clone:Uh,datum:Hh,on:qh,dispatch:Gh,[Symbol.iterator]:Xh};function Ut(e){return typeof e=="string"?new Ht([[document.querySelector(e)]],[document.documentElement]):new Ht([[e]],Tc)}function Zi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Rl(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function yr(){}var On=.7,hr=1/On,sr="\\s*([+-]?\\d+)\\s*",Rr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",an="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$h=/^#([0-9a-f]{3,8})$/,ep=new RegExp(`^rgb\\(${sr},${sr},${sr}\\)$`),tp=new RegExp(`^rgb\\(${an},${an},${an}\\)$`),np=new RegExp(`^rgba\\(${sr},${sr},${sr},${Rr}\\)$`),rp=new RegExp(`^rgba\\(${an},${an},${an},${Rr}\\)$`),ip=new RegExp(`^hsl\\(${Rr},${an},${an}\\)$`),lp=new RegExp(`^hsla\\(${Rr},${an},${an},${Rr}\\)$`),Ta={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};Zi(yr,Fn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ma,formatHex:Ma,formatHex8:op,formatHsl:sp,formatRgb:Ea,toString:Ea});function Ma(){return this.rgb().formatHex()}function op(){return this.rgb().formatHex8()}function sp(){return Ec(this).formatHsl()}function Ea(){return this.rgb().formatRgb()}function Fn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=$h.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?La(t):n===3?new Tt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?si(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?si(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=ep.exec(e))?new Tt(t[1],t[2],t[3],1):(t=tp.exec(e))?new Tt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=np.exec(e))?si(t[1],t[2],t[3],t[4]):(t=rp.exec(e))?si(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ip.exec(e))?Ia(t[1],t[2]/100,t[3]/100,1):(t=lp.exec(e))?Ia(t[1],t[2]/100,t[3]/100,t[4]):Ta.hasOwnProperty(e)?La(Ta[e]):e==="transparent"?new Tt(NaN,NaN,NaN,0):null}function La(e){return new Tt(e>>16&255,e>>8&255,e&255,1)}function si(e,t,n,r){return r<=0&&(e=t=n=NaN),new Tt(e,t,n,r)}function Mc(e){return e instanceof yr||(e=Fn(e)),e?(e=e.rgb(),new Tt(e.r,e.g,e.b,e.opacity)):new Tt}function wl(e,t,n,r){return arguments.length===1?Mc(e):new Tt(e,t,n,r??1)}function Tt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Zi(Tt,wl,Rl(yr,{brighter(e){return e=e==null?hr:Math.pow(hr,e),new Tt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?On:Math.pow(On,e),new Tt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Tt(Pn(this.r),Pn(this.g),Pn(this.b),Ai(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:Na,formatHex:Na,formatHex8:ap,formatRgb:za,toString:za}));function Na(){return`#${zn(this.r)}${zn(this.g)}${zn(this.b)}`}function ap(){return`#${zn(this.r)}${zn(this.g)}${zn(this.b)}${zn((isNaN(this.opacity)?1:this.opacity)*255)}`}function za(){const e=Ai(this.opacity);return`${e===1?"rgb(":"rgba("}${Pn(this.r)}, ${Pn(this.g)}, ${Pn(this.b)}${e===1?")":`, ${e})`}`}function Ai(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zn(e){return e=Pn(e),(e<16?"0":"")+e.toString(16)}function Ia(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new en(e,t,n,r)}function Ec(e){if(e instanceof en)return new en(e.h,e.s,e.l,e.opacity);if(e instanceof yr||(e=Fn(e)),!e)return new en;if(e instanceof en)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),l=Math.max(t,n,r),o=NaN,s=l-i,u=(l+i)/2;return s?(t===l?o=(n-r)/s+(n<r)*6:n===l?o=(r-t)/s+2:o=(t-n)/s+4,s/=u<.5?l+i:2-l-i,o*=60):s=u>0&&u<1?0:o,new en(o,s,u,e.opacity)}function up(e,t,n,r){return arguments.length===1?Ec(e):new en(e,t,n,r??1)}function en(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Zi(en,up,Rl(yr,{brighter(e){return e=e==null?hr:Math.pow(hr,e),new en(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?On:Math.pow(On,e),new en(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,i=2*n-r;return new Tt(ll(e>=240?e-240:e+120,i,r),ll(e,i,r),ll(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new en(Pa(this.h),ai(this.s),ai(this.l),Ai(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=Ai(this.opacity);return`${e===1?"hsl(":"hsla("}${Pa(this.h)}, ${ai(this.s)*100}%, ${ai(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Pa(e){return e=(e||0)%360,e<0?e+360:e}function ai(e){return Math.max(0,Math.min(1,e||0))}function ll(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 cp=Math.PI/180,fp=180/Math.PI;var Lc=-.14861,Bl=1.78277,jl=-.29227,Yi=-.90649,Br=1.97294,Da=Br*Yi,Oa=Br*Bl,Fa=Bl*jl-Yi*Lc;function dp(e){if(e instanceof Dn)return new Dn(e.h,e.s,e.l,e.opacity);e instanceof Tt||(e=Mc(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Fa*r+Da*t-Oa*n)/(Fa+Da-Oa),l=r-i,o=(Br*(n-i)-jl*l)/Yi,s=Math.sqrt(o*o+l*l)/(Br*i*(1-i)),u=s?Math.atan2(o,l)*fp-120:NaN;return new Dn(u<0?u+360:u,s,i,e.opacity)}function Sn(e,t,n,r){return arguments.length===1?dp(e):new Dn(e,t,n,r??1)}function Dn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Zi(Dn,Sn,Rl(yr,{brighter(e){return e=e==null?hr:Math.pow(hr,e),new Dn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?On:Math.pow(On,e),new Dn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*cp,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Tt(255*(t+n*(Lc*r+Bl*i)),255*(t+n*(jl*r+Yi*i)),255*(t+n*(Br*r)),this.opacity)}}));const Vi=e=>()=>e;function Nc(e,t){return function(n){return e+n*t}}function hp(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 pp(e,t){var n=t-e;return n?Nc(e,n>180||n<-180?n-360*Math.round(n/360):n):Vi(isNaN(e)?t:e)}function gp(e){return(e=+e)==1?ar:function(t,n){return n-t?hp(t,n,e):Vi(isNaN(t)?n:t)}}function ar(e,t){var n=t-e;return n?Nc(e,n):Vi(isNaN(e)?t:e)}const Ti=function e(t){var n=gp(t);function r(i,l){var o=n((i=wl(i)).r,(l=wl(l)).r),s=n(i.g,l.g),u=n(i.b,l.b),f=ar(i.opacity,l.opacity);return function(d){return i.r=o(d),i.g=s(d),i.b=u(d),i.opacity=f(d),i+""}}return r.gamma=e,r}(1);function mp(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(l){for(i=0;i<n;++i)r[i]=e[i]*(1-l)+t[i]*l;return r}}function _p(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function bp(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),l=new Array(n),o;for(o=0;o<r;++o)i[o]=qi(e[o],t[o]);for(;o<n;++o)l[o]=t[o];return function(s){for(o=0;o<r;++o)l[o]=i[o](s);return l}}function yp(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function $t(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function vp(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=qi(e[i],t[i]):r[i]=t[i];return function(l){for(i in n)r[i]=n[i](l);return r}}var kl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ol=new RegExp(kl.source,"g");function wp(e){return function(){return e}}function kp(e){return function(t){return e(t)+""}}function zc(e,t){var n=kl.lastIndex=ol.lastIndex=0,r,i,l,o=-1,s=[],u=[];for(e=e+"",t=t+"";(r=kl.exec(e))&&(i=ol.exec(t));)(l=i.index)>n&&(l=t.slice(n,l),s[o]?s[o]+=l:s[++o]=l),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,u.push({i:o,x:$t(r,i)})),n=ol.lastIndex;return n<t.length&&(l=t.slice(n),s[o]?s[o]+=l:s[++o]=l),s.length<2?u[0]?kp(u[0].x):wp(t):(t=u.length,function(f){for(var d=0,h;d<t;++d)s[(h=u[d]).i]=h.x(f);return s.join("")})}function qi(e,t){var n=typeof t,r;return t==null||n==="boolean"?Vi(t):(n==="number"?$t:n==="string"?(r=Fn(t))?(t=r,Ti):zc:t instanceof Fn?Ti:t instanceof Date?yp:_p(t)?mp:Array.isArray(t)?bp:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?vp:$t)(e,t)}function Ic(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Ra=180/Math.PI,xl={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Pc(e,t,n,r,i,l){var o,s,u;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),e*r<t*n&&(e=-e,t=-t,u=-u,o=-o),{translateX:i,translateY:l,rotate:Math.atan2(t,e)*Ra,skewX:Math.atan(u)*Ra,scaleX:o,scaleY:s}}var ui;function xp(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?xl:Pc(t.a,t.b,t.c,t.d,t.e,t.f)}function Cp(e){return e==null||(ui||(ui=document.createElementNS("http://www.w3.org/2000/svg","g")),ui.setAttribute("transform",e),!(e=ui.transform.baseVal.consolidate()))?xl:(e=e.matrix,Pc(e.a,e.b,e.c,e.d,e.e,e.f))}function Dc(e,t,n,r){function i(f){return f.length?f.pop()+" ":""}function l(f,d,h,g,p,_){if(f!==h||d!==g){var m=p.push("translate(",null,t,null,n);_.push({i:m-4,x:$t(f,h)},{i:m-2,x:$t(d,g)})}else(h||g)&&p.push("translate("+h+t+g+n)}function o(f,d,h,g){f!==d?(f-d>180?d+=360:d-f>180&&(f+=360),g.push({i:h.push(i(h)+"rotate(",null,r)-2,x:$t(f,d)})):d&&h.push(i(h)+"rotate("+d+r)}function s(f,d,h,g){f!==d?g.push({i:h.push(i(h)+"skewX(",null,r)-2,x:$t(f,d)}):d&&h.push(i(h)+"skewX("+d+r)}function u(f,d,h,g,p,_){if(f!==h||d!==g){var m=p.push(i(p)+"scale(",null,",",null,")");_.push({i:m-4,x:$t(f,h)},{i:m-2,x:$t(d,g)})}else(h!==1||g!==1)&&p.push(i(p)+"scale("+h+","+g+")")}return function(f,d){var h=[],g=[];return f=e(f),d=e(d),l(f.translateX,f.translateY,d.translateX,d.translateY,h,g),o(f.rotate,d.rotate,h,g),s(f.skewX,d.skewX,h,g),u(f.scaleX,f.scaleY,d.scaleX,d.scaleY,h,g),f=d=null,function(p){for(var _=-1,m=g.length,y;++_<m;)h[(y=g[_]).i]=y.x(p);return h.join("")}}}var Sp=Dc(xp,"px, ","px)","deg)"),Ap=Dc(Cp,", ",")",")");function Oc(e){return function t(n){n=+n;function r(i,l){var o=e((i=Sn(i)).h,(l=Sn(l)).h),s=ar(i.s,l.s),u=ar(i.l,l.l),f=ar(i.opacity,l.opacity);return function(d){return i.h=o(d),i.s=s(d),i.l=u(Math.pow(d,n)),i.opacity=f(d),i+""}}return r.gamma=t,r}(1)}Oc(pp);var Fc=Oc(ar),pr=0,Nr=0,Ar=0,Rc=1e3,Mi,zr,Ei=0,Rn=0,Ki=0,jr=typeof performance=="object"&&performance.now?performance:Date,Bc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ul(){return Rn||(Bc(Tp),Rn=jr.now()+Ki)}function Tp(){Rn=0}function Li(){this._call=this._time=this._next=null}Li.prototype=jc.prototype={constructor:Li,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ul():+n)+(t==null?0:+t),!this._next&&zr!==this&&(zr?zr._next=this:Mi=this,zr=this),this._call=e,this._time=n,Cl()},stop:function(){this._call&&(this._call=null,this._time=1/0,Cl())}};function jc(e,t,n){var r=new Li;return r.restart(e,t,n),r}function Mp(){Ul(),++pr;for(var e=Mi,t;e;)(t=Rn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--pr}function Ba(){Rn=(Ei=jr.now())+Ki,pr=Nr=0;try{Mp()}finally{pr=0,Lp(),Rn=0}}function Ep(){var e=jr.now(),t=e-Ei;t>Rc&&(Ki-=t,Ei=e)}function Lp(){for(var e,t=Mi,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:Mi=n);zr=e,Cl(r)}function Cl(e){if(!pr){Nr&&(Nr=clearTimeout(Nr));var t=e-Rn;t>24?(e<1/0&&(Nr=setTimeout(Ba,e-jr.now()-Ki)),Ar&&(Ar=clearInterval(Ar))):(Ar||(Ei=jr.now(),Ar=setInterval(Ep,Rc)),pr=1,Bc(Ba))}}function ja(e,t,n){var r=new Li;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var Np=gc("start","end","cancel","interrupt"),zp=[],Uc=0,Ua=1,Sl=2,gi=3,Ha=4,Al=5,mi=6;function Ji(e,t,n,r,i,l){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Ip(e,n,{name:t,index:r,group:i,on:Np,tween:zp,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:Uc})}function Hl(e,t){var n=rn(e,t);if(n.state>Uc)throw new Error("too late; already scheduled");return n}function fn(e,t){var n=rn(e,t);if(n.state>gi)throw new Error("too late; already running");return n}function rn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Ip(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=jc(l,0,n.time);function l(f){n.state=Ua,n.timer.restart(o,n.delay,n.time),n.delay<=f&&o(f-n.delay)}function o(f){var d,h,g,p;if(n.state!==Ua)return u();for(d in r)if(p=r[d],p.name===n.name){if(p.state===gi)return ja(o);p.state===Ha?(p.state=mi,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+d<t&&(p.state=mi,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[d])}if(ja(function(){n.state===gi&&(n.state=Ha,n.timer.restart(s,n.delay,n.time),s(f))}),n.state=Sl,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Sl){for(n.state=gi,i=new Array(g=n.tween.length),d=0,h=-1;d<g;++d)(p=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=p);i.length=h+1}}function s(f){for(var d=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(u),n.state=Al,1),h=-1,g=i.length;++h<g;)i[h].call(e,d);n.state===Al&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=mi,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function Pp(e,t){var n=e.__transition,r,i,l=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){l=!1;continue}i=r.state>Sl&&r.state<Al,r.state=mi,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}l&&delete e.__transition}}function Dp(e){return this.each(function(){Pp(this,e)})}function Op(e,t){var n,r;return function(){var i=fn(this,e),l=i.tween;if(l!==n){r=n=l;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Fp(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var l=fn(this,e),o=l.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},u=0,f=i.length;u<f;++u)if(i[u].name===t){i[u]=s;break}u===f&&i.push(s)}l.tween=i}}function Rp(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=rn(this.node(),n).tween,i=0,l=r.length,o;i<l;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Op:Fp)(n,e,t))}function Wl(e,t,n){var r=e._id;return e.each(function(){var i=fn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return rn(i,r).value[t]}}function Hc(e,t){var n;return(typeof t=="number"?$t:t instanceof Fn?Ti:(n=Fn(t))?(t=n,Ti):zc)(e,t)}function Bp(e){return function(){this.removeAttribute(e)}}function jp(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Up(e,t,n){var r,i=n+"",l;return function(){var o=this.getAttribute(e);return o===i?null:o===r?l:l=t(r=o,n)}}function Hp(e,t,n){var r,i=n+"",l;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?l:l=t(r=o,n)}}function Wp(e,t,n){var r,i,l;return function(){var o,s=n(this),u;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),u=s+"",o===u?null:o===r&&u===i?l:(i=u,l=t(r=o,s)))}}function Zp(e,t,n){var r,i,l;return function(){var o,s=n(this),u;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),u=s+"",o===u?null:o===r&&u===i?l:(i=u,l=t(r=o,s)))}}function Yp(e,t){var n=Wi(e),r=n==="transform"?Ap:Hc;return this.attrTween(e,typeof t=="function"?(n.local?Zp:Wp)(n,r,Wl(this,"attr."+e,t)):t==null?(n.local?jp:Bp)(n):(n.local?Hp:Up)(n,r,t))}function Vp(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function qp(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Kp(e,t){var n,r;function i(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&qp(e,l)),n}return i._value=t,i}function Jp(e,t){var n,r;function i(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&Vp(e,l)),n}return i._value=t,i}function Gp(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=Wi(e);return this.tween(n,(r.local?Kp:Jp)(r,t))}function Xp(e,t){return function(){Hl(this,e).delay=+t.apply(this,arguments)}}function Qp(e,t){return t=+t,function(){Hl(this,e).delay=t}}function $p(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Xp:Qp)(t,e)):rn(this.node(),t).delay}function e1(e,t){return function(){fn(this,e).duration=+t.apply(this,arguments)}}function t1(e,t){return t=+t,function(){fn(this,e).duration=t}}function n1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?e1:t1)(t,e)):rn(this.node(),t).duration}function r1(e,t){if(typeof t!="function")throw new Error;return function(){fn(this,e).ease=t}}function i1(e){var t=this._id;return arguments.length?this.each(r1(t,e)):rn(this.node(),t).ease}function l1(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;fn(this,e).ease=n}}function o1(e){if(typeof e!="function")throw new Error;return this.each(l1(this._id,e))}function s1(e){typeof e!="function"&&(e=bc(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var l=t[i],o=l.length,s=r[i]=[],u,f=0;f<o;++f)(u=l[f])&&e.call(u,u.__data__,f,l)&&s.push(u);return new _n(r,this._parents,this._name,this._id)}function a1(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,l=Math.min(r,i),o=new Array(r),s=0;s<l;++s)for(var u=t[s],f=n[s],d=u.length,h=o[s]=new Array(d),g,p=0;p<d;++p)(g=u[p]||f[p])&&(h[p]=g);for(;s<r;++s)o[s]=t[s];return new _n(o,this._parents,this._name,this._id)}function u1(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 c1(e,t,n){var r,i,l=u1(t)?Hl:fn;return function(){var o=l(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function f1(e,t){var n=this._id;return arguments.length<2?rn(this.node(),n).on.on(e):this.each(c1(n,e,t))}function d1(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function h1(){return this.on("end.remove",d1(this._id))}function p1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ol(e));for(var r=this._groups,i=r.length,l=new Array(i),o=0;o<i;++o)for(var s=r[o],u=s.length,f=l[o]=new Array(u),d,h,g=0;g<u;++g)(d=s[g])&&(h=e.call(d,d.__data__,g,s))&&("__data__"in d&&(h.__data__=d.__data__),f[g]=h,Ji(f[g],t,n,g,f,rn(d,n)));return new _n(l,this._parents,t,n)}function g1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=_c(e));for(var r=this._groups,i=r.length,l=[],o=[],s=0;s<i;++s)for(var u=r[s],f=u.length,d,h=0;h<f;++h)if(d=u[h]){for(var g=e.call(d,d.__data__,h,u),p,_=rn(d,n),m=0,y=g.length;m<y;++m)(p=g[m])&&Ji(p,t,n,m,g,_);l.push(g),o.push(d)}return new _n(l,o,t,n)}var m1=Hr.prototype.constructor;function _1(){return new m1(this._groups,this._parents)}function b1(e,t){var n,r,i;return function(){var l=dr(this,e),o=(this.style.removeProperty(e),dr(this,e));return l===o?null:l===n&&o===r?i:i=t(n=l,r=o)}}function Wc(e){return function(){this.style.removeProperty(e)}}function y1(e,t,n){var r,i=n+"",l;return function(){var o=dr(this,e);return o===i?null:o===r?l:l=t(r=o,n)}}function v1(e,t,n){var r,i,l;return function(){var o=dr(this,e),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(e),dr(this,e))),o===u?null:o===r&&u===i?l:(i=u,l=t(r=o,s))}}function w1(e,t){var n,r,i,l="style."+t,o="end."+l,s;return function(){var u=fn(this,e),f=u.on,d=u.value[l]==null?s||(s=Wc(t)):void 0;(f!==n||i!==d)&&(r=(n=f).copy()).on(o,i=d),u.on=r}}function k1(e,t,n){var r=(e+="")=="transform"?Sp:Hc;return t==null?this.styleTween(e,b1(e,r)).on("end.style."+e,Wc(e)):typeof t=="function"?this.styleTween(e,v1(e,r,Wl(this,"style."+e,t))).each(w1(this._id,e)):this.styleTween(e,y1(e,r,t),n).on("end.style."+e,null)}function x1(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function C1(e,t,n){var r,i;function l(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&x1(e,o,n)),r}return l._value=t,l}function S1(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,C1(e,t,n??""))}function A1(e){return function(){this.textContent=e}}function T1(e){return function(){var t=e(this);this.textContent=t??""}}function M1(e){return this.tween("text",typeof e=="function"?T1(Wl(this,"text",e)):A1(e==null?"":e+""))}function E1(e){return function(t){this.textContent=e.call(this,t)}}function L1(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&E1(i)),t}return r._value=e,r}function N1(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,L1(e))}function z1(){for(var e=this._name,t=this._id,n=Zc(),r=this._groups,i=r.length,l=0;l<i;++l)for(var o=r[l],s=o.length,u,f=0;f<s;++f)if(u=o[f]){var d=rn(u,t);Ji(u,e,n,f,o,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new _n(r,this._parents,e,n)}function I1(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(l,o){var s={value:o},u={value:function(){--i===0&&l()}};n.each(function(){var f=fn(this,r),d=f.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(u)),f.on=t}),i===0&&l()})}var P1=0;function _n(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Zc(){return++P1}var hn=Hr.prototype;_n.prototype={constructor:_n,select:p1,selectAll:g1,selectChild:hn.selectChild,selectChildren:hn.selectChildren,filter:s1,merge:a1,selection:_1,transition:z1,call:hn.call,nodes:hn.nodes,node:hn.node,size:hn.size,empty:hn.empty,each:hn.each,on:f1,attr:Yp,attrTween:Gp,style:k1,styleTween:S1,text:M1,textTween:N1,remove:h1,tween:Rp,delay:$p,duration:n1,ease:i1,easeVarying:o1,end:I1,[Symbol.iterator]:hn[Symbol.iterator]};function D1(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var O1={time:null,delay:0,duration:250,ease:D1};function F1(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 R1(e){var t,n;e instanceof _n?(t=e._id,e=e._name):(t=Zc(),(n=O1).time=Ul(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,l=0;l<i;++l)for(var o=r[l],s=o.length,u,f=0;f<s;++f)(u=o[f])&&Ji(u,e,t,f,o,n||F1(u,t));return new _n(r,this._parents,e,t)}Hr.prototype.interrupt=Dp;Hr.prototype.transition=R1;const Tl=Math.PI,Ml=2*Tl,En=1e-6,B1=Ml-En;function Yc(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function j1(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Yc;const n=10**t;return function(r){this._+=r[0];for(let i=1,l=r.length;i<l;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class U1{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Yc:j1(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,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,l,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+l},${this._y1=+o}`}arcTo(t,n,r,i,l){if(t=+t,n=+n,r=+r,i=+i,l=+l,l<0)throw new Error(`negative radius: ${l}`);let o=this._x1,s=this._y1,u=r-t,f=i-n,d=o-t,h=s-n,g=d*d+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>En)if(!(Math.abs(h*u-f*d)>En)||!l)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-o,_=i-s,m=u*u+f*f,y=p*p+_*_,v=Math.sqrt(m),w=Math.sqrt(g),C=l*Math.tan((Tl-Math.acos((m+g-y)/(2*v*w)))/2),x=C/w,A=C/v;Math.abs(x-1)>En&&this._append`L${t+x*d},${n+x*h}`,this._append`A${l},${l},0,0,${+(h*p>d*_)},${this._x1=t+A*u},${this._y1=n+A*f}`}}arc(t,n,r,i,l,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),u=r*Math.sin(i),f=t+s,d=n+u,h=1^o,g=o?i-l:l-i;this._x1===null?this._append`M${f},${d}`:(Math.abs(this._x1-f)>En||Math.abs(this._y1-d)>En)&&this._append`L${f},${d}`,r&&(g<0&&(g=g%Ml+Ml),g>B1?this._append`A${r},${r},0,1,${h},${t-s},${n-u}A${r},${r},0,1,${h},${this._x1=f},${this._y1=d}`:g>En&&this._append`A${r},${r},0,${+(g>=Tl)},${h},${this._x1=t+r*Math.cos(l)},${this._y1=n+r*Math.sin(l)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function H1(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ni(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 gr(e){return e=Ni(Math.abs(e)),e?e[1]:NaN}function W1(e,t){return function(n,r){for(var i=n.length,l=[],o=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),l.push(n.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[o=(o+1)%e.length];return l.reverse().join(t)}}function Z1(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Y1=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function zi(e){if(!(t=Y1.exec(e)))throw new Error("invalid format: "+e);var t;return new Zl({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]})}zi.prototype=Zl.prototype;function Zl(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+""}Zl.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 V1(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Ii;function q1(e,t){var n=Ni(e,t);if(!n)return Ii=void 0,e.toPrecision(t);var r=n[0],i=n[1],l=i-(Ii=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return l===o?r:l>o?r+new Array(l-o+1).join("0"):l>0?r.slice(0,l)+"."+r.slice(l):"0."+new Array(1-l).join("0")+Ni(e,Math.max(0,t+l-1))[0]}function Wa(e,t){var n=Ni(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Za={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:H1,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)=>Wa(e*100,t),r:Wa,s:q1,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Ya(e){return e}var Va=Array.prototype.map,qa=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function K1(e){var t=e.grouping===void 0||e.thousands===void 0?Ya:W1(Va.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",l=e.numerals===void 0?Ya:Z1(Va.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function f(h,g){h=zi(h);var p=h.fill,_=h.align,m=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"):Za[M]||(x===void 0&&(x=12),A=!0,M="g"),(v||p==="0"&&_==="=")&&(v=!0,p="0",_="=");var z=(g&&g.prefix!==void 0?g.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(M)?"0"+M.toLowerCase():""),E=(y==="$"?r:/[%p]/.test(M)?o:"")+(g&&g.suffix!==void 0?g.suffix:""),P=Za[M],I=/[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 D(T){var N=z,k=E,F,re,V;if(M==="c")k=P(T)+k,T="";else{T=+T;var oe=T<0||1/T<0;if(T=isNaN(T)?u:P(Math.abs(T),x),A&&(T=V1(T)),oe&&+T==0&&m!=="+"&&(oe=!1),N=(oe?m==="("?m:s:m==="-"||m==="("?"":m)+N,k=(M==="s"&&!isNaN(T)&&Ii!==void 0?qa[8+Ii/3]:"")+k+(oe&&m==="("?")":""),I){for(F=-1,re=T.length;++F<re;)if(V=T.charCodeAt(F),48>V||V>57){k=(V===46?i+T.slice(F+1):T.slice(F))+k,T=T.slice(0,F);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(p):"";switch(C&&v&&(T=t(ie+T,ie.length?w-k.length:1/0),ie=""),_){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 l(T)}return D.toString=function(){return h+""},D}function d(h,g){var p=Math.max(-8,Math.min(8,Math.floor(gr(g)/3)))*3,_=Math.pow(10,-p),m=f((h=zi(h),h.type="f",h),{suffix:qa[8+p/3]});return function(y){return m(_*y)}}return{format:f,formatPrefix:d}}var ci,Pi,Vc;J1({thousands:",",grouping:[3],currency:["$",""]});function J1(e){return ci=K1(e),Pi=ci.format,Vc=ci.formatPrefix,ci}function G1(e){return Math.max(0,-gr(Math.abs(e)))}function X1(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(gr(t)/3)))*3-gr(Math.abs(e)))}function Q1(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,gr(t)-gr(e))+1}function Gi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function $1(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 Ka=Symbol("implicit");function qc(){var e=new va,t=[],n=[],r=Ka;function i(l){let o=e.get(l);if(o===void 0){if(r!==Ka)return r;e.set(l,o=t.push(l)-1)}return n[o%n.length]}return i.domain=function(l){if(!arguments.length)return t.slice();t=[],e=new va;for(const o of l)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(l){return arguments.length?(n=Array.from(l),i):n.slice()},i.unknown=function(l){return arguments.length?(r=l,i):r},i.copy=function(){return qc(t,n).unknown(r)},Gi.apply(i,arguments),i}function Kc(){var e=qc().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,l,o,s=!1,u=0,f=0,d=.5;delete e.unknown;function h(){var g=t().length,p=i<r,_=p?i:r,m=p?r:i;l=(m-_)/Math.max(1,g-u+f*2),s&&(l=Math.floor(l)),_+=(m-_-l*(g-u))*d,o=l*(1-u),s&&(_=Math.round(_),o=Math.round(o));var y=f0(g).map(function(v){return _+l*v});return n(p?y.reverse():y)}return e.domain=function(g){return arguments.length?(t(g),h()):t()},e.range=function(g){return arguments.length?([r,i]=g,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(g){return[r,i]=g,r=+r,i=+i,s=!0,h()},e.bandwidth=function(){return o},e.step=function(){return l},e.round=function(g){return arguments.length?(s=!!g,h()):s},e.padding=function(g){return arguments.length?(u=Math.min(1,f=+g),h()):u},e.paddingInner=function(g){return arguments.length?(u=Math.min(1,g),h()):u},e.paddingOuter=function(g){return arguments.length?(f=+g,h()):f},e.align=function(g){return arguments.length?(d=Math.max(0,Math.min(1,g)),h()):d},e.copy=function(){return Kc(t(),[r,i]).round(s).paddingInner(u).paddingOuter(f).align(d)},Gi.apply(h(),arguments)}function eg(e){return function(){return e}}function tg(e){return+e}var Ja=[0,1];function Cn(e){return e}function El(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:eg(isNaN(t)?NaN:.5)}function ng(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function rg(e,t,n){var r=e[0],i=e[1],l=t[0],o=t[1];return i<r?(r=El(i,r),l=n(o,l)):(r=El(r,i),l=n(l,o)),function(s){return l(r(s))}}function ig(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),l=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=El(e[o],e[o+1]),l[o]=n(t[o],t[o+1]);return function(s){var u=n0(e,s,1,r)-1;return l[u](i[u](s))}}function Jc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function lg(){var e=Ja,t=Ja,n=qi,r,i,l,o=Cn,s,u,f;function d(){var g=Math.min(e.length,t.length);return o!==Cn&&(o=ng(e[0],e[g-1])),s=g>2?ig:rg,u=f=null,h}function h(g){return g==null||isNaN(g=+g)?l:(u||(u=s(e.map(r),t,n)))(r(o(g)))}return h.invert=function(g){return o(i((f||(f=s(t,e.map(r),$t)))(g)))},h.domain=function(g){return arguments.length?(e=Array.from(g,tg),d()):e.slice()},h.range=function(g){return arguments.length?(t=Array.from(g),d()):t.slice()},h.rangeRound=function(g){return t=Array.from(g),n=Ic,d()},h.clamp=function(g){return arguments.length?(o=g?!0:Cn,d()):o!==Cn},h.interpolate=function(g){return arguments.length?(n=g,d()):n},h.unknown=function(g){return arguments.length?(l=g,h):l},function(g,p){return r=g,i=p,d()}}function Gc(){return lg()(Cn,Cn)}function og(e,t,n,r){var i=bl(e,t,n),l;switch(r=zi(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(l=X1(i,o))&&(r.precision=l),Vc(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(l=Q1(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=l-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(l=G1(i))&&(r.precision=l-(r.type==="%")*2);break}}return Pi(r)}function Xc(e){var t=e.domain;return e.ticks=function(n){var r=t();return c0(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return og(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,l=r.length-1,o=r[i],s=r[l],u,f,d=10;for(s<o&&(f=o,o=s,s=f,f=i,i=l,l=f);d-- >0;){if(f=_l(o,s,n),f===u)return r[i]=o,r[l]=s,t(r);if(f>0)o=Math.floor(o/f)*f,s=Math.ceil(s/f)*f;else if(f<0)o=Math.ceil(o*f)/f,s=Math.floor(s*f)/f;else break;u=f}return e},e}function Ir(){var e=Gc();return e.copy=function(){return Jc(e,Ir())},Gi.apply(e,arguments),Xc(e)}function sg(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],l=e[r],o;return l<i&&(o=n,n=r,r=o,o=i,i=l,l=o),e[n]=t.floor(i),e[r]=t.ceil(l),e}const sl=new Date,al=new Date;function yt(e,t,n,r){function i(l){return e(l=arguments.length===0?new Date:new Date(+l)),l}return i.floor=l=>(e(l=new Date(+l)),l),i.ceil=l=>(e(l=new Date(l-1)),t(l,1),e(l),l),i.round=l=>{const o=i(l),s=i.ceil(l);return l-o<s-l?o:s},i.offset=(l,o)=>(t(l=new Date(+l),o==null?1:Math.floor(o)),l),i.range=(l,o,s)=>{const u=[];if(l=i.ceil(l),s=s==null?1:Math.floor(s),!(l<o)||!(s>0))return u;let f;do u.push(f=new Date(+l)),t(l,s),e(l);while(f<l&&l<o);return u},i.filter=l=>yt(o=>{if(o>=o)for(;e(o),!l(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!l(o););else for(;--s>=0;)for(;t(o,1),!l(o););}),n&&(i.count=(l,o)=>(sl.setTime(+l),al.setTime(+o),e(sl),e(al),Math.floor(n(sl,al))),i.every=l=>(l=Math.floor(l),!isFinite(l)||!(l>0)?null:l>1?i.filter(r?o=>r(o)%l===0:o=>i.count(0,o)%l===0):i)),i}const Di=yt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Di.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?yt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Di);Di.range;const pn=1e3,Kt=pn*60,gn=Kt*60,bn=gn*24,Yl=bn*7,Ga=bn*30,ul=bn*365,rr=yt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*pn)},(e,t)=>(t-e)/pn,e=>e.getUTCSeconds());rr.range;const Vl=yt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*pn)},(e,t)=>{e.setTime(+e+t*Kt)},(e,t)=>(t-e)/Kt,e=>e.getMinutes());Vl.range;const ag=yt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Kt)},(e,t)=>(t-e)/Kt,e=>e.getUTCMinutes());ag.range;const ql=yt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*pn-e.getMinutes()*Kt)},(e,t)=>{e.setTime(+e+t*gn)},(e,t)=>(t-e)/gn,e=>e.getHours());ql.range;const ug=yt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*gn)},(e,t)=>(t-e)/gn,e=>e.getUTCHours());ug.range;const Wr=yt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Kt)/bn,e=>e.getDate()-1);Wr.range;const Kl=yt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/bn,e=>e.getUTCDate()-1);Kl.range;const cg=yt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/bn,e=>Math.floor(e/bn));cg.range;function jn(e){return yt(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())*Kt)/Yl)}const Xi=jn(0),Oi=jn(1),fg=jn(2),dg=jn(3),mr=jn(4),hg=jn(5),pg=jn(6);Xi.range;Oi.range;fg.range;dg.range;mr.range;hg.range;pg.range;function Un(e){return yt(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)/Yl)}const Qc=Un(0),Fi=Un(1),gg=Un(2),mg=Un(3),_r=Un(4),_g=Un(5),bg=Un(6);Qc.range;Fi.range;gg.range;mg.range;_r.range;_g.range;bg.range;const Jl=yt(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());Jl.range;const yg=yt(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());yg.range;const yn=yt(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());yn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:yt(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)});yn.range;const Bn=yt(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());Bn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:yt(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)});Bn.range;function vg(e,t,n,r,i,l){const o=[[rr,1,pn],[rr,5,5*pn],[rr,15,15*pn],[rr,30,30*pn],[l,1,Kt],[l,5,5*Kt],[l,15,15*Kt],[l,30,30*Kt],[i,1,gn],[i,3,3*gn],[i,6,6*gn],[i,12,12*gn],[r,1,bn],[r,2,2*bn],[n,1,Yl],[t,1,Ga],[t,3,3*Ga],[e,1,ul]];function s(f,d,h){const g=d<f;g&&([f,d]=[d,f]);const p=h&&typeof h.range=="function"?h:u(f,d,h),_=p?p.range(f,+d+1):[];return g?_.reverse():_}function u(f,d,h){const g=Math.abs(d-f)/h,p=Dl(([,,y])=>y).right(o,g);if(p===o.length)return e.every(bl(f/ul,d/ul,h));if(p===0)return Di.every(Math.max(bl(f,d,h),1));const[_,m]=o[g/o[p-1][2]<o[p][2]/g?p-1:p];return _.every(m)}return[s,u]}const[wg,kg]=vg(yn,Jl,Xi,Wr,ql,Vl);function cl(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 fl(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 Tr(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function xg(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,l=e.days,o=e.shortDays,s=e.months,u=e.shortMonths,f=Mr(i),d=Er(i),h=Mr(l),g=Er(l),p=Mr(o),_=Er(o),m=Mr(s),y=Er(s),v=Mr(u),w=Er(u),C={a:V,A:oe,b:Y,B:ie,c:null,d:nu,e:nu,f:Vg,g:nm,G:im,H:Wg,I:Zg,j:Yg,L:$c,m:qg,M:Kg,p:Z,q:H,Q:lu,s:ou,S:Jg,u:Gg,U:Xg,V:Qg,w:$g,W:em,x:null,X:null,y:tm,Y:rm,Z:lm,"%":iu},x={a:ce,A:se,b:ee,B:_e,c:null,d:ru,e:ru,f:um,g:ym,G:wm,H:om,I:sm,j:am,L:tf,m:cm,M:fm,p:fe,q:ye,Q:lu,s:ou,S:dm,u:hm,U:pm,V:gm,w:mm,W:_m,x:null,X:null,y:bm,Y:vm,Z:km,"%":iu},A={a:I,A:D,b:T,B:N,c:k,d:eu,e:eu,f:Bg,g:$a,G:Qa,H:tu,I:tu,j:Dg,L:Rg,m:Pg,M:Og,p:P,q:Ig,Q:Ug,s:Hg,S:Fg,u:Mg,U:Eg,V:Lg,w:Tg,W:Ng,x:F,X:re,y:$a,Y:Qa,Z:zg,"%":jg};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(G,de){return function(ue){var te=[],Se=-1,S=0,X=G.length,J,U,O;for(ue instanceof Date||(ue=new Date(+ue));++Se<X;)G.charCodeAt(Se)===37&&(te.push(G.slice(S,Se)),(U=Xa[J=G.charAt(++Se)])!=null?J=G.charAt(++Se):U=J==="e"?" ":"0",(O=de[J])&&(J=O(ue,U)),te.push(J),S=Se+1);return te.push(G.slice(S,Se)),te.join("")}}function z(G,de){return function(ue){var te=Tr(1900,void 0,1),Se=E(te,G,ue+="",0),S,X;if(Se!=ue.length)return null;if("Q"in te)return new Date(te.Q);if("s"in te)return new Date(te.s*1e3+("L"in te?te.L:0));if(de&&!("Z"in te)&&(te.Z=0),"p"in te&&(te.H=te.H%12+te.p*12),te.m===void 0&&(te.m="q"in te?te.q:0),"V"in te){if(te.V<1||te.V>53)return null;"w"in te||(te.w=1),"Z"in te?(S=fl(Tr(te.y,0,1)),X=S.getUTCDay(),S=X>4||X===0?Fi.ceil(S):Fi(S),S=Kl.offset(S,(te.V-1)*7),te.y=S.getUTCFullYear(),te.m=S.getUTCMonth(),te.d=S.getUTCDate()+(te.w+6)%7):(S=cl(Tr(te.y,0,1)),X=S.getDay(),S=X>4||X===0?Oi.ceil(S):Oi(S),S=Wr.offset(S,(te.V-1)*7),te.y=S.getFullYear(),te.m=S.getMonth(),te.d=S.getDate()+(te.w+6)%7)}else("W"in te||"U"in te)&&("w"in te||(te.w="u"in te?te.u%7:"W"in te?1:0),X="Z"in te?fl(Tr(te.y,0,1)).getUTCDay():cl(Tr(te.y,0,1)).getDay(),te.m=0,te.d="W"in te?(te.w+6)%7+te.W*7-(X+5)%7:te.w+te.U*7-(X+6)%7);return"Z"in te?(te.H+=te.Z/100|0,te.M+=te.Z%100,fl(te)):cl(te)}}function E(G,de,ue,te){for(var Se=0,S=de.length,X=ue.length,J,U;Se<S;){if(te>=X)return-1;if(J=de.charCodeAt(Se++),J===37){if(J=de.charAt(Se++),U=A[J in Xa?de.charAt(Se++):J],!U||(te=U(G,ue,te))<0)return-1}else if(J!=ue.charCodeAt(te++))return-1}return te}function P(G,de,ue){var te=f.exec(de.slice(ue));return te?(G.p=d.get(te[0].toLowerCase()),ue+te[0].length):-1}function I(G,de,ue){var te=p.exec(de.slice(ue));return te?(G.w=_.get(te[0].toLowerCase()),ue+te[0].length):-1}function D(G,de,ue){var te=h.exec(de.slice(ue));return te?(G.w=g.get(te[0].toLowerCase()),ue+te[0].length):-1}function T(G,de,ue){var te=v.exec(de.slice(ue));return te?(G.m=w.get(te[0].toLowerCase()),ue+te[0].length):-1}function N(G,de,ue){var te=m.exec(de.slice(ue));return te?(G.m=y.get(te[0].toLowerCase()),ue+te[0].length):-1}function k(G,de,ue){return E(G,t,de,ue)}function F(G,de,ue){return E(G,n,de,ue)}function re(G,de,ue){return E(G,r,de,ue)}function V(G){return o[G.getDay()]}function oe(G){return l[G.getDay()]}function Y(G){return u[G.getMonth()]}function ie(G){return s[G.getMonth()]}function Z(G){return i[+(G.getHours()>=12)]}function H(G){return 1+~~(G.getMonth()/3)}function ce(G){return o[G.getUTCDay()]}function se(G){return l[G.getUTCDay()]}function ee(G){return u[G.getUTCMonth()]}function _e(G){return s[G.getUTCMonth()]}function fe(G){return i[+(G.getUTCHours()>=12)]}function ye(G){return 1+~~(G.getUTCMonth()/3)}return{format:function(G){var de=M(G+="",C);return de.toString=function(){return G},de},parse:function(G){var de=z(G+="",!1);return de.toString=function(){return G},de},utcFormat:function(G){var de=M(G+="",x);return de.toString=function(){return G},de},utcParse:function(G){var de=z(G+="",!0);return de.toString=function(){return G},de}}}var Xa={"-":"",_:" ",0:"0"},vt=/^\s*\d+/,Cg=/^%/,Sg=/[\\^$*+?|[\]().{}]/g;function ut(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",l=i.length;return r+(l<n?new Array(n-l+1).join(t)+i:i)}function Ag(e){return e.replace(Sg,"\\$&")}function Mr(e){return new RegExp("^(?:"+e.map(Ag).join("|")+")","i")}function Er(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Tg(e,t,n){var r=vt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Mg(e,t,n){var r=vt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Eg(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Lg(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Ng(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Qa(e,t,n){var r=vt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function $a(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function zg(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 Ig(e,t,n){var r=vt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Pg(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function eu(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Dg(e,t,n){var r=vt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function tu(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Og(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Fg(e,t,n){var r=vt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Rg(e,t,n){var r=vt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Bg(e,t,n){var r=vt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function jg(e,t,n){var r=Cg.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Ug(e,t,n){var r=vt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Hg(e,t,n){var r=vt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function nu(e,t){return ut(e.getDate(),t,2)}function Wg(e,t){return ut(e.getHours(),t,2)}function Zg(e,t){return ut(e.getHours()%12||12,t,2)}function Yg(e,t){return ut(1+Wr.count(yn(e),e),t,3)}function $c(e,t){return ut(e.getMilliseconds(),t,3)}function Vg(e,t){return $c(e,t)+"000"}function qg(e,t){return ut(e.getMonth()+1,t,2)}function Kg(e,t){return ut(e.getMinutes(),t,2)}function Jg(e,t){return ut(e.getSeconds(),t,2)}function Gg(e){var t=e.getDay();return t===0?7:t}function Xg(e,t){return ut(Xi.count(yn(e)-1,e),t,2)}function ef(e){var t=e.getDay();return t>=4||t===0?mr(e):mr.ceil(e)}function Qg(e,t){return e=ef(e),ut(mr.count(yn(e),e)+(yn(e).getDay()===4),t,2)}function $g(e){return e.getDay()}function em(e,t){return ut(Oi.count(yn(e)-1,e),t,2)}function tm(e,t){return ut(e.getFullYear()%100,t,2)}function nm(e,t){return e=ef(e),ut(e.getFullYear()%100,t,2)}function rm(e,t){return ut(e.getFullYear()%1e4,t,4)}function im(e,t){var n=e.getDay();return e=n>=4||n===0?mr(e):mr.ceil(e),ut(e.getFullYear()%1e4,t,4)}function lm(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ut(t/60|0,"0",2)+ut(t%60,"0",2)}function ru(e,t){return ut(e.getUTCDate(),t,2)}function om(e,t){return ut(e.getUTCHours(),t,2)}function sm(e,t){return ut(e.getUTCHours()%12||12,t,2)}function am(e,t){return ut(1+Kl.count(Bn(e),e),t,3)}function tf(e,t){return ut(e.getUTCMilliseconds(),t,3)}function um(e,t){return tf(e,t)+"000"}function cm(e,t){return ut(e.getUTCMonth()+1,t,2)}function fm(e,t){return ut(e.getUTCMinutes(),t,2)}function dm(e,t){return ut(e.getUTCSeconds(),t,2)}function hm(e){var t=e.getUTCDay();return t===0?7:t}function pm(e,t){return ut(Qc.count(Bn(e)-1,e),t,2)}function nf(e){var t=e.getUTCDay();return t>=4||t===0?_r(e):_r.ceil(e)}function gm(e,t){return e=nf(e),ut(_r.count(Bn(e),e)+(Bn(e).getUTCDay()===4),t,2)}function mm(e){return e.getUTCDay()}function _m(e,t){return ut(Fi.count(Bn(e)-1,e),t,2)}function bm(e,t){return ut(e.getUTCFullYear()%100,t,2)}function ym(e,t){return e=nf(e),ut(e.getUTCFullYear()%100,t,2)}function vm(e,t){return ut(e.getUTCFullYear()%1e4,t,4)}function wm(e,t){var n=e.getUTCDay();return e=n>=4||n===0?_r(e):_r.ceil(e),ut(e.getUTCFullYear()%1e4,t,4)}function km(){return"+0000"}function iu(){return"%"}function lu(e){return+e}function ou(e){return Math.floor(+e/1e3)}var er,Gl,rf;xm({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 xm(e){return er=xg(e),Gl=er.format,rf=er.parse,er.utcFormat,er.utcParse,er}function Cm(e){return new Date(e)}function Sm(e){return e instanceof Date?+e:+new Date(+e)}function lf(e,t,n,r,i,l,o,s,u,f){var d=Gc(),h=d.invert,g=d.domain,p=f(".%L"),_=f(":%S"),m=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(u(M)<M?p:s(M)<M?_:o(M)<M?m:l(M)<M?y:r(M)<M?i(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?g(Array.from(M,Sm)):g().map(Cm)},d.ticks=function(M){var z=g();return e(z[0],z[z.length-1],M??10)},d.tickFormat=function(M,z){return z==null?A:f(z)},d.nice=function(M){var z=g();return(!M||typeof M.range!="function")&&(M=t(z[0],z[z.length-1],M??10)),M?g(sg(z,M)):d},d.copy=function(){return Jc(d,lf(e,t,n,r,i,l,o,s,u,f))},d}function Am(){return Gi.apply(lf(wg,kg,yn,Jl,Xi,Wr,ql,Vl,rr,Gl).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Tm(){var e=0,t=1,n,r,i,l,o=Cn,s=!1,u;function f(h){return h==null||isNaN(h=+h)?u:o(i===0?.5:(h=(l(h)-n)*i,s?Math.max(0,Math.min(1,h)):h))}f.domain=function(h){return arguments.length?([e,t]=h,n=l(e=+e),r=l(t=+t),i=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?(o=h,f):o};function d(h){return function(g){var p,_;return arguments.length?([p,_]=g,o=h(p,_),f):[o(0),o(1)]}}return f.range=d(qi),f.rangeRound=d(Ic),f.unknown=function(h){return arguments.length?(u=h,f):u},function(h){return l=h,n=h(e),r=h(t),i=n===r?0:1/(r-n),f}}function Mm(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function of(){var e=Xc(Tm()(Cn));return e.copy=function(){return Mm(e,of())},$1.apply(e,arguments)}Fc(Sn(-100,.75,.35),Sn(80,1.5,.8));var Em=Fc(Sn(260,.75,.35),Sn(80,1.5,.8));Sn();function at(e){return function(){return e}}const su=Math.abs,At=Math.atan2,Mn=Math.cos,Lm=Math.max,dl=Math.min,sn=Math.sin,ir=Math.sqrt,Rt=1e-12,Ur=Math.PI,Ri=Ur/2,_i=2*Ur;function Nm(e){return e>1?0:e<-1?Ur:Math.acos(e)}function au(e){return e>=1?Ri:e<=-1?-Ri:Math.asin(e)}function Xl(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 U1(t)}function zm(e){return e.innerRadius}function Im(e){return e.outerRadius}function Pm(e){return e.startAngle}function Dm(e){return e.endAngle}function Om(e){return e&&e.padAngle}function Fm(e,t,n,r,i,l,o,s){var u=n-e,f=r-t,d=o-i,h=s-l,g=h*u-d*f;if(!(g*g<Rt))return g=(d*(t-l)-h*(e-i))/g,[e+g*u,t+g*f]}function fi(e,t,n,r,i,l,o){var s=e-n,u=t-r,f=(o?l:-l)/ir(s*s+u*u),d=f*u,h=-f*s,g=e+d,p=t+h,_=n+d,m=r+h,y=(g+_)/2,v=(p+m)/2,w=_-g,C=m-p,x=w*w+C*C,A=i-l,M=g*m-_*p,z=(C<0?-1:1)*ir(Lm(0,A*A*x-M*M)),E=(M*C-w*z)/x,P=(-M*w-C*z)/x,I=(M*C+w*z)/x,D=(-M*w+C*z)/x,T=E-y,N=P-v,k=I-y,F=D-v;return T*T+N*N>k*k+F*F&&(E=I,P=D),{cx:E,cy:P,x01:-d,y01:-h,x11:E*(i/A-1),y11:P*(i/A-1)}}function uu(){var e=zm,t=Im,n=at(0),r=null,i=Pm,l=Dm,o=Om,s=null,u=Xl(f);function f(){var d,h,g=+e.apply(this,arguments),p=+t.apply(this,arguments),_=i.apply(this,arguments)-Ri,m=l.apply(this,arguments)-Ri,y=su(m-_),v=m>_;if(s||(s=d=u()),p<g&&(h=p,p=g,g=h),!(p>Rt))s.moveTo(0,0);else if(y>_i-Rt)s.moveTo(p*Mn(_),p*sn(_)),s.arc(0,0,p,_,m,!v),g>Rt&&(s.moveTo(g*Mn(m),g*sn(m)),s.arc(0,0,g,m,_,v));else{var w=_,C=m,x=_,A=m,M=y,z=y,E=o.apply(this,arguments)/2,P=E>Rt&&(r?+r.apply(this,arguments):ir(g*g+p*p)),I=dl(su(p-g)/2,+n.apply(this,arguments)),D=I,T=I,N,k;if(P>Rt){var F=au(P/g*sn(E)),re=au(P/p*sn(E));(M-=F*2)>Rt?(F*=v?1:-1,x+=F,A-=F):(M=0,x=A=(_+m)/2),(z-=re*2)>Rt?(re*=v?1:-1,w+=re,C-=re):(z=0,w=C=(_+m)/2)}var V=p*Mn(w),oe=p*sn(w),Y=g*Mn(A),ie=g*sn(A);if(I>Rt){var Z=p*Mn(C),H=p*sn(C),ce=g*Mn(x),se=g*sn(x),ee;if(y<Ur)if(ee=Fm(V,oe,ce,se,Z,H,Y,ie)){var _e=V-ee[0],fe=oe-ee[1],ye=Z-ee[0],G=H-ee[1],de=1/sn(Nm((_e*ye+fe*G)/(ir(_e*_e+fe*fe)*ir(ye*ye+G*G)))/2),ue=ir(ee[0]*ee[0]+ee[1]*ee[1]);D=dl(I,(g-ue)/(de-1)),T=dl(I,(p-ue)/(de+1))}else D=T=0}z>Rt?T>Rt?(N=fi(ce,se,V,oe,p,T,v),k=fi(Z,H,Y,ie,p,T,v),s.moveTo(N.cx+N.x01,N.cy+N.y01),T<I?s.arc(N.cx,N.cy,T,At(N.y01,N.x01),At(k.y01,k.x01),!v):(s.arc(N.cx,N.cy,T,At(N.y01,N.x01),At(N.y11,N.x11),!v),s.arc(0,0,p,At(N.cy+N.y11,N.cx+N.x11),At(k.cy+k.y11,k.cx+k.x11),!v),s.arc(k.cx,k.cy,T,At(k.y11,k.x11),At(k.y01,k.x01),!v))):(s.moveTo(V,oe),s.arc(0,0,p,w,C,!v)):s.moveTo(V,oe),!(g>Rt)||!(M>Rt)?s.lineTo(Y,ie):D>Rt?(N=fi(Y,ie,Z,H,g,-D,v),k=fi(V,oe,ce,se,g,-D,v),s.lineTo(N.cx+N.x01,N.cy+N.y01),D<I?s.arc(N.cx,N.cy,D,At(N.y01,N.x01),At(k.y01,k.x01),!v):(s.arc(N.cx,N.cy,D,At(N.y01,N.x01),At(N.y11,N.x11),!v),s.arc(0,0,g,At(N.cy+N.y11,N.cx+N.x11),At(k.cy+k.y11,k.cx+k.x11),v),s.arc(k.cx,k.cy,D,At(k.y11,k.x11),At(k.y01,k.x01),!v))):s.arc(0,0,g,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=(+i.apply(this,arguments)+ +l.apply(this,arguments))/2-Ur/2;return[Mn(h)*d,sn(h)*d]},f.innerRadius=function(d){return arguments.length?(e=typeof d=="function"?d:at(+d),f):e},f.outerRadius=function(d){return arguments.length?(t=typeof d=="function"?d:at(+d),f):t},f.cornerRadius=function(d){return arguments.length?(n=typeof d=="function"?d:at(+d),f):n},f.padRadius=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:at(+d),f):r},f.startAngle=function(d){return arguments.length?(i=typeof d=="function"?d:at(+d),f):i},f.endAngle=function(d){return arguments.length?(l=typeof d=="function"?d:at(+d),f):l},f.padAngle=function(d){return arguments.length?(o=typeof d=="function"?d:at(+d),f):o},f.context=function(d){return arguments.length?(s=d??null,f):s},f}function Ql(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function sf(e){this._context=e}sf.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 af(e){return new sf(e)}function uf(e){return e[0]}function cf(e){return e[1]}function ff(e,t){var n=at(!0),r=null,i=af,l=null,o=Xl(s);e=typeof e=="function"?e:e===void 0?uf:at(e),t=typeof t=="function"?t:t===void 0?cf:at(t);function s(u){var f,d=(u=Ql(u)).length,h,g=!1,p;for(r==null&&(l=i(p=o())),f=0;f<=d;++f)!(f<d&&n(h=u[f],f,u))===g&&((g=!g)?l.lineStart():l.lineEnd()),g&&l.point(+e(h,f,u),+t(h,f,u));if(p)return l=null,p+""||null}return s.x=function(u){return arguments.length?(e=typeof u=="function"?u:at(+u),s):e},s.y=function(u){return arguments.length?(t=typeof u=="function"?u:at(+u),s):t},s.defined=function(u){return arguments.length?(n=typeof u=="function"?u:at(!!u),s):n},s.curve=function(u){return arguments.length?(i=u,r!=null&&(l=i(r)),s):i},s.context=function(u){return arguments.length?(u==null?r=l=null:l=i(r=u),s):r},s}function Rm(e,t,n){var r=null,i=at(!0),l=null,o=af,s=null,u=Xl(f);e=typeof e=="function"?e:e===void 0?uf:at(+e),t=typeof t=="function"?t:at(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?cf:at(+n);function f(h){var g,p,_,m=(h=Ql(h)).length,y,v=!1,w,C=new Array(m),x=new Array(m);for(l==null&&(s=o(w=u())),g=0;g<=m;++g){if(!(g<m&&i(y=h[g],g,h))===v)if(v=!v)p=g,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),_=g-1;_>=p;--_)s.point(C[_],x[_]);s.lineEnd(),s.areaEnd()}v&&(C[g]=+e(y,g,h),x[g]=+t(y,g,h),s.point(r?+r(y,g,h):C[g],n?+n(y,g,h):x[g]))}if(w)return s=null,w+""||null}function d(){return ff().defined(i).curve(o).context(l)}return f.x=function(h){return arguments.length?(e=typeof h=="function"?h:at(+h),r=null,f):e},f.x0=function(h){return arguments.length?(e=typeof h=="function"?h:at(+h),f):e},f.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:at(+h),f):r},f.y=function(h){return arguments.length?(t=typeof h=="function"?h:at(+h),n=null,f):t},f.y0=function(h){return arguments.length?(t=typeof h=="function"?h:at(+h),f):t},f.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:at(+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?(i=typeof h=="function"?h:at(!!h),f):i},f.curve=function(h){return arguments.length?(o=h,l!=null&&(s=o(l)),f):o},f.context=function(h){return arguments.length?(h==null?l=s=null:s=o(l=h),f):l},f}function Bm(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function jm(e){return e}function Um(){var e=jm,t=Bm,n=null,r=at(0),i=at(_i),l=at(0);function o(s){var u,f=(s=Ql(s)).length,d,h,g=0,p=new Array(f),_=new Array(f),m=+r.apply(this,arguments),y=Math.min(_i,Math.max(-_i,i.apply(this,arguments)-m)),v,w=Math.min(Math.abs(y)/f,l.apply(this,arguments)),C=w*(y<0?-1:1),x;for(u=0;u<f;++u)(x=_[p[u]=u]=+e(s[u],u,s))>0&&(g+=x);for(t!=null?p.sort(function(A,M){return t(_[A],_[M])}):n!=null&&p.sort(function(A,M){return n(s[A],s[M])}),u=0,h=g?(y-f*C)/g:0;u<f;++u,m=v)d=p[u],x=_[d],v=m+(x>0?x*h:0)+C,_[d]={data:s[d],index:u,value:x,startAngle:m,endAngle:v,padAngle:w};return _}return o.value=function(s){return arguments.length?(e=typeof s=="function"?s:at(+s),o):e},o.sortValues=function(s){return arguments.length?(t=s,n=null,o):t},o.sort=function(s){return arguments.length?(n=s,t=null,o):n},o.startAngle=function(s){return arguments.length?(r=typeof s=="function"?s:at(+s),o):r},o.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:at(+s),o):i},o.padAngle=function(s){return arguments.length?(l=typeof s=="function"?s:at(+s),o):l},o}function cu(e){return e<0?-1:1}function fu(e,t,n){var r=e._x1-e._x0,i=t-e._x1,l=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(l*i+o*r)/(r+i);return(cu(l)+cu(o))*Math.min(Math.abs(l),Math.abs(o),.5*Math.abs(s))||0}function du(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function hl(e,t,n){var r=e._x0,i=e._y0,l=e._x1,o=e._y1,s=(l-r)/3;e._context.bezierCurveTo(r+s,i+s*t,l-s,o-s*n,l,o)}function Bi(e){this._context=e}Bi.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:hl(this,this._t0,du(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,hl(this,du(this,n=fu(this,e,t)),n);break;default:hl(this,this._t0,n=fu(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};Object.create(Bi.prototype).point=function(e,t){Bi.prototype.point.call(this,t,e)};function hu(e){return new Bi(e)}function Pr(e,t,n){this.k=e,this.x=t,this.y=n}Pr.prototype={constructor:Pr,scale:function(e){return e===1?this:new Pr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Pr(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+")"}};Pr.prototype;function pu(e,t,n){const r=e.slice();return r[88]=t[n],r}function pl(e){const t=e.slice(),n=new Set(t[24].translations.map(i=>i.lang));t[86]=n;const r=t[5].filter(function(...l){return e[74](t[86],...l)});return t[87]=r,t}function gu(e,t,n){const r=e.slice();return r[91]=t[n],r}function mu(e,t,n){const r=e.slice();return r[88]=t[n],r}function _u(e,t,n){const r=e.slice();return r[114]=t[n],r[116]=n,r}function bu(e,t,n){const r=e.slice();r[99]=t[n];const i=h2(r[99].url);r[100]=i;const l=r[99].phraseCount>0?Math.round(r[99].approved/r[99].phraseCount*100):0;return r[101]=l,r}function yu(e,t,n){const r=e.slice();return r[104]=t[n],r}function vu(e,t,n){const r=e.slice();return r[88]=t[n],r}function wu(e,t,n){const r=e.slice();return r[109]=t[n],r}function ku(e,t,n){const r=e.slice();return r[96]=t[n],r}function xu(e,t,n){const r=e.slice();return r[96]=t[n],r}function Cu(e,t,n){const r=e.slice();return r[117]=t[n][0],r[118]=t[n][1],r}function Su(e){let t,n=st(e[4].totalPhrases)+"",r,i,l=st(e[4].uniqueUrls)+"",o,s,u=st(e[4].languageCount)+"",f,d;return{c(){t=b("span"),r=j(n),i=j(" phrases · "),o=j(l),s=j(" pages · "),f=j(u),d=j(" 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,g){B(h,t,g),c(t,r),c(t,i),c(t,o),c(t,s),c(t,f),c(t,d)},p(h,g){g[0]&16&&n!==(n=st(h[4].totalPhrases)+"")&&$(r,n),g[0]&16&&l!==(l=st(h[4].uniqueUrls)+"")&&$(o,l),g[0]&16&&u!==(u=st(h[4].languageCount)+"")&&$(f,u)},d(h){h&&R(t)}}}function Hm(e){let t,n,r,i=Le([["overview","Overview"],["pages","Pages & URLs"],["languages","Languages"]]),l=[];for(let f=0;f<3;f+=1)l[f]=Au(Cu(e,i,f));function o(f,d){if(f[27]==="overview")return Vm;if(f[27]==="pages")return Ym;if(f[27]==="languages")return Zm}let s=o(e),u=s&&s(e);return{c(){t=b("div");for(let f=0;f<3;f+=1)l[f].c();n=L(),u&&u.c(),r=bt(),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)l[h]&&l[h].m(t,null);B(f,n,d),u&&u.m(f,d),B(f,r,d)},p(f,d){if(d[0]&134217728|d[1]&32768){i=Le([["overview","Overview"],["pages","Pages & URLs"],["languages","Languages"]]);let h;for(h=0;h<3;h+=1){const g=Cu(f,i,h);l[h]?l[h].p(g,d):(l[h]=Au(g),l[h].c(),l[h].m(t,null))}for(;h<3;h+=1)l[h].d(1)}s===(s=o(f))&&u?u.p(f,d):(u&&u.d(1),u=s&&s(f),u&&(u.c(),u.m(r.parentNode,r)))},d(f){f&&(R(t),R(n),R(r)),it(l,f),u&&u.d(f)}}}function Wm(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:Be,d(n){n&&R(t)}}}function Au(e){let t,n,r,i,l;function o(){return e[48](e[117])}return{c(){t=b("button"),n=j(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,u){B(s,t,u),c(t,n),i||(l=Q(t,"click",o),i=!0)},p(s,u){e=s,u[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&&R(t),i=!1,l()}}}function Zm(e){let t,n,r,i,l,o,s,u,f,d,h,g=Le(e[5]),p=[];for(let _=0;_<g.length;_+=1)p[_]=Tu(_u(e,g,_));return{c(){t=b("div"),n=b("div"),r=b("h3"),r.textContent="Translations per Language",i=L(),l=b("div"),o=L(),s=b("div"),u=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=L(),h=b("tbody");for(let _=0;_<p.length;_+=1)p[_].c();a(r,"class","text-xs font-semibold text-gray-400 uppercase mb-3"),a(l,"class","w-full"),ct(l,"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(u,"class","w-full text-xs"),a(s,"class","bg-gray-800 border border-gray-700 rounded-xl overflow-hidden")},m(_,m){B(_,t,m),c(t,n),c(n,r),c(n,i),c(n,l),e[70](l),B(_,o,m),B(_,s,m),c(s,u),c(u,f),c(u,d),c(u,h);for(let y=0;y<p.length;y+=1)p[y]&&p[y].m(h,null)},p(_,m){if(m[0]&32){g=Le(_[5]);let y;for(y=0;y<g.length;y+=1){const v=_u(_,g,y);p[y]?p[y].p(v,m):(p[y]=Tu(v),p[y].c(),p[y].m(h,null))}for(;y<p.length;y+=1)p[y].d(1);p.length=g.length}},d(_){_&&(R(t),R(o),R(s)),e[70](null),it(p,_)}}}function Ym(e){let t,n,r,i,l,o,s,u,f,d,h,g,p=st(e[9])+"",_,m,y,v,w,C,x=Le(e[6]),A=[];for(let D=0;D<x.length;D+=1)A[D]=Mu(ku(e,x,D));let M=Le(e[7].filter(Ju)),z=[];for(let D=0;D<M.length;D+=1)z[D]=Eu(wu(e,M,D));function E(D,T){return D[11]?Jm:D[8].length===0?Km:qm}let P=E(e),I=P(e);return{c(){t=b("div"),n=b("div"),r=pe("svg"),i=pe("path"),l=L(),o=b("input"),s=L(),u=b("div");for(let D=0;D<A.length;D+=1)A[D].c();f=L(),d=b("div");for(let D=0;D<z.length;D+=1)z[D].c();h=L(),g=b("span"),_=j(p),m=j(" pages"),y=L(),I.c(),v=bt(),a(i,"fill-rule","evenodd"),a(i,"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(i,"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(o,"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(o,"placeholder","Search URLs…"),a(n,"class","relative"),a(u,"class","flex gap-1.5 flex-wrap"),a(d,"class","flex gap-1.5 flex-wrap"),a(g,"class","text-xs text-gray-500 ml-auto"),a(t,"class","flex flex-wrap items-center gap-2")},m(D,T){B(D,t,T),c(t,n),c(n,r),c(r,i),c(n,l),c(n,o),Ee(o,e[12]),c(t,s),c(t,u);for(let N=0;N<A.length;N+=1)A[N]&&A[N].m(u,null);c(t,f),c(t,d);for(let N=0;N<z.length;N+=1)z[N]&&z[N].m(d,null);c(t,h),c(t,g),c(g,_),c(g,m),B(D,y,T),I.m(D,T),B(D,v,T),w||(C=[Q(o,"input",e[54]),Q(o,"input",e[41])],w=!0)},p(D,T){if(T[0]&4096&&o.value!==D[12]&&Ee(o,D[12]),T[0]&16448|T[1]&2048){x=Le(D[6]);let N;for(N=0;N<x.length;N+=1){const k=ku(D,x,N);A[N]?A[N].p(k,T):(A[N]=Mu(k),A[N].c(),A[N].m(u,null))}for(;N<A.length;N+=1)A[N].d(1);A.length=x.length}if(T[0]&32896|T[1]&4096){M=Le(D[7].filter(Ju));let N;for(N=0;N<M.length;N+=1){const k=wu(D,M,N);z[N]?z[N].p(k,T):(z[N]=Eu(k),z[N].c(),z[N].m(d,null))}for(;N<z.length;N+=1)z[N].d(1);z.length=M.length}T[0]&512&&p!==(p=st(D[9])+"")&&$(_,p),P===(P=E(D))&&I?I.p(D,T):(I.d(1),I=P(D),I&&(I.c(),I.m(v.parentNode,v)))},d(D){D&&(R(t),R(y),R(v)),it(A,D),it(z,D),I.d(D),w=!1,$e(C)}}}function Vm(e){let t,n,r,i,l,o=Vt(e[4].totalPhrases)+"",s,u,f,d=st(e[4].phrasesWithSlots)+"",h,g,p,_,m,y,v,w=Vt(e[4].approvedPhrases)+"",C,x,A,M=(e[4].totalPhrases?Math.round(e[4].approvedPhrases/e[4].totalPhrases*100):0)+"",z,E,P,I,D,T,N,k=e[4].languageCount+"",F,re,V,oe=Vt(e[4].totalTranslations)+"",Y,ie,Z,H,ce,se,ee,_e=st(e[4].uniqueUrls)+"",fe,ye,G,de,ue,te,Se,S,X,J,U,O,W,le,q,K,ne,ke,ge=st(e[4].pendingPhrases)+"",Ce,Fe,Me,We,Ze,Pe,Xe,He,et=st(e[4].approvedPhrases)+"",tt,rt,we,be,ae,Ne,Ae,xe,Re,ve,Ye,Ke,ht,Gt,Lt,Xt,Wt,Qt,me,De,Ue,nt,gt,ft,lt=e[4].trashPhrases>0&&Bu(e),dt=Le(e[6]),Je=[];for(let Oe=0;Oe<dt.length;Oe+=1)Je[Oe]=ju(xu(e,dt,Oe));return{c(){t=b("div"),n=b("div"),r=b("p"),r.textContent="Total Phrases",i=L(),l=b("p"),s=j(o),u=L(),f=b("p"),h=j(d),g=j(" with var-slots"),p=L(),_=b("div"),m=b("p"),m.textContent="Approved",y=L(),v=b("p"),C=j(w),x=L(),A=b("p"),z=j(M),E=j("% coverage"),P=L(),I=b("div"),D=b("p"),D.textContent="Languages",T=L(),N=b("p"),F=j(k),re=L(),V=b("p"),Y=j(oe),ie=j(" total translations"),Z=L(),H=b("div"),ce=b("p"),ce.textContent="Pages Crawled",se=L(),ee=b("p"),fe=j(_e),ye=L(),G=b("p"),G.textContent="unique URLs",de=L(),ue=b("div"),te=b("div"),Se=b("h3"),Se.textContent="Phrase Status",S=L(),X=b("div"),J=b("div"),U=L(),O=b("div"),W=b("div"),le=b("span"),q=L(),K=b("span"),K.textContent="Pending",ne=L(),ke=b("span"),Ce=j(ge),Fe=L(),Me=b("div"),We=b("span"),Ze=L(),Pe=b("span"),Pe.textContent="Approved",Xe=L(),He=b("span"),tt=j(et),rt=L(),lt&&lt.c(),we=L(),be=b("div"),ae=b("h3"),ae.textContent="Discovery Activity (phrases per day)",Ne=L(),Ae=b("div"),xe=L(),Re=b("div"),ve=b("div"),Ye=b("h3"),Ye.textContent="Phrases by Page Section",Ke=L(),ht=b("p"),ht.innerHTML="Grouped by <code>f=</code> URL parameter. Click a bar to filter pages.",Gt=L(),Lt=b("div"),Xt=L(),Wt=b("div");for(let Oe=0;Oe<Je.length;Oe+=1)Je[Oe].c();Qt=L(),me=b("div"),De=b("h3"),De.textContent="Phrases by WebChart Instance",Ue=L(),nt=b("p"),nt.innerHTML=`<span class="text-emerald-400">■</span> approved  
64
+ <span class="text-blue-400 opacity-40">■</span> total — click to filter pages`,gt=L(),ft=b("div"),a(r,"class","text-xs text-gray-400 uppercase tracking-wide"),a(l,"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(m,"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(_,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(D,"class","text-xs text-gray-400 uppercase tracking-wide"),a(N,"class","text-3xl font-bold text-indigo-400 mt-1"),a(V,"class","text-xs text-gray-500 mt-1"),a(I,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(ce,"class","text-xs text-gray-400 uppercase tracking-wide"),a(ee,"class","text-3xl font-bold text-blue-400 mt-1"),a(G,"class","text-xs text-gray-500 mt-1"),a(H,"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(Se,"class","text-xs font-semibold text-gray-400 uppercase mb-3"),a(J,"class","relative"),ct(J,"width","160px"),ct(J,"height","160px"),ct(J,"flex-shrink","0"),a(le,"class","w-2.5 h-2.5 rounded-full bg-yellow-400 shrink-0"),a(K,"class","text-gray-400"),a(ke,"class","ml-auto font-mono text-gray-200"),a(W,"class","flex items-center gap-2 text-xs"),a(We,"class","w-2.5 h-2.5 rounded-full bg-emerald-500 shrink-0"),a(Pe,"class","text-gray-400"),a(He,"class","ml-auto font-mono text-gray-200"),a(Me,"class","flex items-center gap-2 text-xs"),a(O,"class","space-y-2"),a(X,"class","flex items-center gap-6"),a(te,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(ae,"class","text-xs font-semibold text-gray-400 uppercase mb-3"),a(Ae,"class","w-full"),ct(Ae,"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(Ye,"class","text-xs font-semibold text-gray-400 uppercase mb-1"),a(ht,"class","text-xs text-gray-500 mb-3"),a(Lt,"class","w-full"),ct(Lt,"min-height","180px"),a(Wt,"class","flex flex-wrap gap-2 mt-3"),a(ve,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(De,"class","text-xs font-semibold text-gray-400 uppercase mb-1"),a(nt,"class","text-xs text-gray-500 mb-3"),a(ft,"class","w-full"),ct(ft,"min-height","160px"),a(me,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(Re,"class","grid grid-cols-1 lg:grid-cols-2 gap-4")},m(Oe,ze){B(Oe,t,ze),c(t,n),c(n,r),c(n,i),c(n,l),c(l,s),c(n,u),c(n,f),c(f,h),c(f,g),c(t,p),c(t,_),c(_,m),c(_,y),c(_,v),c(v,C),c(_,x),c(_,A),c(A,z),c(A,E),c(t,P),c(t,I),c(I,D),c(I,T),c(I,N),c(N,F),c(I,re),c(I,V),c(V,Y),c(V,ie),c(t,Z),c(t,H),c(H,ce),c(H,se),c(H,ee),c(ee,fe),c(H,ye),c(H,G),B(Oe,de,ze),B(Oe,ue,ze),c(ue,te),c(te,Se),c(te,S),c(te,X),c(X,J),e[49](J),c(X,U),c(X,O),c(O,W),c(W,le),c(W,q),c(W,K),c(W,ne),c(W,ke),c(ke,Ce),c(O,Fe),c(O,Me),c(Me,We),c(Me,Ze),c(Me,Pe),c(Me,Xe),c(Me,He),c(He,tt),c(O,rt),lt&&lt.m(O,null),c(ue,we),c(ue,be),c(be,ae),c(be,Ne),c(be,Ae),e[50](Ae),B(Oe,xe,ze),B(Oe,Re,ze),c(Re,ve),c(ve,Ye),c(ve,Ke),c(ve,ht),c(ve,Gt),c(ve,Lt),e[51](Lt),c(ve,Xt),c(ve,Wt);for(let Ve=0;Ve<Je.length;Ve+=1)Je[Ve]&&Je[Ve].m(Wt,null);c(Re,Qt),c(Re,me),c(me,De),c(me,Ue),c(me,nt),c(me,gt),c(me,ft),e[53](ft)},p(Oe,ze){if(ze[0]&16&&o!==(o=Vt(Oe[4].totalPhrases)+"")&&$(s,o),ze[0]&16&&d!==(d=st(Oe[4].phrasesWithSlots)+"")&&$(h,d),ze[0]&16&&w!==(w=Vt(Oe[4].approvedPhrases)+"")&&$(C,w),ze[0]&16&&M!==(M=(Oe[4].totalPhrases?Math.round(Oe[4].approvedPhrases/Oe[4].totalPhrases*100):0)+"")&&$(z,M),ze[0]&16&&k!==(k=Oe[4].languageCount+"")&&$(F,k),ze[0]&16&&oe!==(oe=Vt(Oe[4].totalTranslations)+"")&&$(Y,oe),ze[0]&16&&_e!==(_e=st(Oe[4].uniqueUrls)+"")&&$(fe,_e),ze[0]&16&&ge!==(ge=st(Oe[4].pendingPhrases)+"")&&$(Ce,ge),ze[0]&16&&et!==(et=st(Oe[4].approvedPhrases)+"")&&$(tt,et),Oe[4].trashPhrases>0?lt?lt.p(Oe,ze):(lt=Bu(Oe),lt.c(),lt.m(O,null)):lt&&(lt.d(1),lt=null),ze[0]&16448|ze[1]&2048){dt=Le(Oe[6]);let Ve;for(Ve=0;Ve<dt.length;Ve+=1){const xt=xu(Oe,dt,Ve);Je[Ve]?Je[Ve].p(xt,ze):(Je[Ve]=ju(xt),Je[Ve].c(),Je[Ve].m(Wt,null))}for(;Ve<Je.length;Ve+=1)Je[Ve].d(1);Je.length=dt.length}},d(Oe){Oe&&(R(t),R(de),R(ue),R(xe),R(Re)),e[49](null),lt&&lt.d(),e[50](null),e[51](null),it(Je,Oe),e[53](null)}}}function Tu(e){let t,n,r=e[114].lang+"",i,l,o,s=st(e[114].translated)+"",u,f,d,h,g,p,_,m,y=e[114].coverage+"",v,w,C;return{c(){t=b("tr"),n=b("td"),i=j(r),l=L(),o=b("td"),u=j(s),f=L(),d=b("td"),h=b("div"),g=b("div"),p=b("div"),_=L(),m=b("span"),v=j(y),w=j("%"),C=L(),a(n,"class","px-4 py-2.5 font-mono text-indigo-300"),a(o,"class","px-4 py-2.5 text-right font-mono text-gray-200"),a(p,"class","h-1.5 rounded-full transition-all"),ct(p,"width",e[114].coverage+"%"),ct(p,"background",e[114].coverage>80?"#10b981":e[114].coverage>40?"#6366f1":"#f59e0b"),a(g,"class","flex-1 bg-gray-700 rounded-full h-1.5 max-w-xs"),a(m,"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),c(t,n),c(n,i),c(t,l),c(t,o),c(o,u),c(t,f),c(t,d),c(d,h),c(h,g),c(g,p),c(h,_),c(h,m),c(m,v),c(m,w),c(t,C)},p(x,A){A[0]&32&&r!==(r=x[114].lang+"")&&$(i,r),A[0]&32&&s!==(s=st(x[114].translated)+"")&&$(u,s),A[0]&32&&ct(p,"width",x[114].coverage+"%"),A[0]&32&&ct(p,"background",x[114].coverage>80?"#10b981":x[114].coverage>40?"#6366f1":"#f59e0b"),A[0]&32&&y!==(y=x[114].coverage+"")&&$(v,y)},d(x){x&&R(t)}}}function Mu(e){let t,n=e[96].section+"",r,i,l,o;function s(){return e[55](e[96])}return{c(){t=b("button"),r=j(n),a(t,"class",i="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(u,f){B(u,t,f),c(t,r),l||(o=Q(t,"click",s),l=!0)},p(u,f){e=u,f[0]&64&&n!==(n=e[96].section+"")&&$(r,n),f[0]&16448&&i!==(i="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",i)},d(u){u&&R(t),l=!1,o()}}}function Eu(e){let t,n=e[109].instance+"",r,i,l,o;function s(){return e[56](e[109])}return{c(){t=b("button"),r=j(n),a(t,"class",i="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(u,f){B(u,t,f),c(t,r),l||(o=Q(t,"click",s),l=!0)},p(u,f){e=u,f[0]&128&&n!==(n=e[109].instance+"")&&$(r,n),f[0]&32896&&i!==(i="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",i)},d(u){u&&R(t),l=!1,o()}}}function qm(e){let t,n,r,i,l,o,s,u,f,d=e[13]+1+"",h,g,p=Math.min(e[13]+In,e[9])+"",_,m,y=st(e[9])+"",v,w,C,x,A,M,z,E,P,I,D,T,N=Le(e[8]),k=[];for(let F=0;F<N.length;F+=1)k[F]=Ru(bu(e,N,F));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>',i=L(),l=b("tbody");for(let F=0;F<k.length;F+=1)k[F].c();o=L(),s=b("div"),u=b("span"),f=j("Showing "),h=j(d),g=j("–"),_=j(p),m=j(" of "),v=j(y),w=L(),C=b("div"),x=b("button"),A=j("← Prev"),z=L(),E=b("button"),P=j("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(E,"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"),E.disabled=I=e[13]+In>=e[9],a(C,"class","flex gap-2"),a(s,"class","flex items-center justify-between text-xs text-gray-500")},m(F,re){B(F,t,re),c(t,n),c(n,r),c(n,i),c(n,l);for(let V=0;V<k.length;V+=1)k[V]&&k[V].m(l,null);B(F,o,re),B(F,s,re),c(s,u),c(u,f),c(u,h),c(u,g),c(u,_),c(u,m),c(u,v),c(s,w),c(s,C),c(C,x),c(x,A),c(C,z),c(C,E),c(E,P),D||(T=[Q(x,"click",e[44]),Q(E,"click",e[45])],D=!0)},p(F,re){if(re[0]&33489199|re[1]&1012){N=Le(F[8]);let V;for(V=0;V<N.length;V+=1){const oe=bu(F,N,V);k[V]?k[V].p(oe,re):(k[V]=Ru(oe),k[V].c(),k[V].m(l,null))}for(;V<k.length;V+=1)k[V].d(1);k.length=N.length}re[0]&8192&&d!==(d=F[13]+1+"")&&$(h,d),re[0]&8704&&p!==(p=Math.min(F[13]+In,F[9])+"")&&$(_,p),re[0]&512&&y!==(y=st(F[9])+"")&&$(v,y),re[0]&8192&&M!==(M=F[13]===0)&&(x.disabled=M),re[0]&8704&&I!==(I=F[13]+In>=F[9])&&(E.disabled=I)},d(F){F&&(R(t),R(o),R(s)),it(k,F),D=!1,$e(T)}}}function Km(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:Be,d(n){n&&R(t)}}}function Jm(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:Be,d(n){n&&R(t)}}}function Lu(e){let t,n,r;function i(s,u){if(s[17])return Xm;if(s[0])return Gm}let l=i(e),o=l&&l(e);return{c(){t=b("tr"),n=b("td"),o&&o.c(),r=L(),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,u){B(s,t,u),c(t,n),o&&o.m(n,null),c(t,r)},p(s,u){l===(l=i(s))&&o?o.p(s,u):(o&&o.d(1),o=l&&l(s),o&&(o.c(),o.m(n,null)))},d(s){s&&R(t),o&&o.d()}}}function Gm(e){let t,n,r,i=st(e[0].totalPhrases)+"",l,o,s,u,f=st(e[0].approved)+"",d,h,g,p,_=st(e[0].pending)+"",m,y,v,w,C,x,A,M,z,E,P,I,D,T,N,k,F,re=e[21]?"Queued…":`Translate all pending (${st(e[0].pending)})`,V,oe,Y,ie,Z,H,ce,se,ee,_e,fe,ye,G,de,ue,te,Se,S,X,J,U,O,W,le,q,K=e[33].length+"",ne,ke,ge=e[0].topPhrases.length+"",Ce,Fe,Me=e[0].topPhrases.length===200?"(200 max)":"",We,Ze,Pe,Xe,He,et,tt,rt=Le(e[5]),we=[];for(let ve=0;ve<rt.length;ve+=1)we[ve]=Nu(vu(e,rt,ve));let be=e[20].size>0&&zu(e),ae=e[22]&&Iu(e),Ne=Le(e[33]),Ae=[];for(let ve=0;ve<Ne.length;ve+=1)Ae[ve]=Ou(yu(e,Ne,ve));let xe=null;Ne.length||(xe=Pu());let Re=e[0].topPhrases.length===200&&Fu();return{c(){t=b("div"),n=b("div"),r=b("span"),l=j(i),o=j(" total"),s=L(),u=b("span"),d=j(f),h=j(" approved"),g=L(),p=b("span"),m=j(_),y=j(" pending"),v=L(),w=b("a"),C=pe("svg"),x=pe("path"),A=j(`
65
+ Open Page`),M=L(),z=b("div"),E=pe("svg"),P=pe("path"),I=L(),D=b("span"),D.textContent="Translate to",T=L(),N=b("select");for(let ve=0;ve<we.length;ve+=1)we[ve].c();k=L(),F=b("button"),V=j(re),Y=L(),be&&be.c(),ie=L(),ae&&ae.c(),Z=L(),H=b("div"),ce=b("div"),se=b("input"),_e=L(),fe=b("button"),ye=j(".*"),de=L(),ue=b("select"),te=b("option"),te.textContent="All",Se=b("option"),Se.textContent="Pending",S=b("option"),S.textContent="Approved",X=L(),J=b("label"),U=b("input"),W=j(`
66
+ All`),le=L(),q=b("span"),ne=j(K),ke=j("/"),Ce=j(ge),Fe=L(),We=j(Me),Ze=L(),Pe=b("div");for(let ve=0;ve<Ae.length;ve+=1)Ae[ve].c();xe&&xe.c(),Xe=L(),Re&&Re.c(),He=bt(),a(r,"class","bg-gray-800 rounded px-2 py-1 text-[10px] font-mono text-gray-400"),a(u,"class","bg-emerald-900/50 rounded px-2 py-1 text-[10px] font-mono text-emerald-400"),a(p,"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(E,"viewBox","0 0 24 24"),a(E,"width","14"),a(E,"height","14"),a(E,"xmlns","http://www.w3.org/2000/svg"),a(E,"class","shrink-0"),a(D,"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&&Et(()=>e[58].call(N)),a(F,"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"),F.disabled=oe=e[21]||e[0].pending===0,a(z,"class","flex items-center gap-2 mb-3 p-2.5 bg-gray-800 rounded-lg border border-gray-700"),a(se,"class",ee="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(se,"placeholder","Search phrases… (supports regex)"),a(fe,"class",G="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(fe,"title","Toggle regex mode"),a(ce,"class","flex-1 flex items-center relative"),te.__value="",Ee(te,te.__value),Se.__value="pending",Ee(Se,Se.__value),S.__value="approved",Ee(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&&Et(()=>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(q,"class","text-[10px] text-gray-600 shrink-0 whitespace-nowrap"),a(H,"class","flex items-center gap-2 mb-2"),a(Pe,"class","max-h-72 overflow-y-auto space-y-0.5 pr-1")},m(ve,Ye){B(ve,t,Ye),c(t,n),c(n,r),c(r,l),c(r,o),c(n,s),c(n,u),c(u,d),c(u,h),c(n,g),c(n,p),c(p,m),c(p,y),c(t,v),c(t,w),c(w,C),c(C,x),c(w,A),B(ve,M,Ye),B(ve,z,Ye),c(z,E),c(E,P),c(z,I),c(z,D),c(z,T),c(z,N);for(let Ke=0;Ke<we.length;Ke+=1)we[Ke]&&we[Ke].m(N,null);pt(N,e[18],!0),c(z,k),c(z,F),c(F,V),c(z,Y),be&&be.m(z,null),c(z,ie),ae&&ae.m(z,null),B(ve,Z,Ye),B(ve,H,Ye),c(H,ce),c(ce,se),Ee(se,e[1]),c(ce,_e),c(ce,fe),c(fe,ye),c(H,de),c(H,ue),c(ue,te),c(ue,Se),c(ue,S),pt(ue,e[3],!0),c(H,X),c(H,J),c(J,U),c(J,W),c(H,le),c(H,q),c(q,ne),c(q,ke),c(q,Ce),c(q,Fe),c(q,We),B(ve,Ze,Ye),B(ve,Pe,Ye);for(let Ke=0;Ke<Ae.length;Ke+=1)Ae[Ke]&&Ae[Ke].m(Pe,null);xe&&xe.m(Pe,null),B(ve,Xe,Ye),Re&&Re.m(ve,Ye),B(ve,He,Ye),et||(tt=[Q(N,"change",e[58]),Q(F,"click",e[59]),Q(se,"input",e[61]),Q(se,"input",e[62]),Q(fe,"click",e[63]),Q(ue,"change",e[64]),Q(ue,"change",e[65]),Q(U,"change",e[38])],et=!0)},p(ve,Ye){if(Ye[0]&1&&i!==(i=st(ve[0].totalPhrases)+"")&&$(l,i),Ye[0]&1&&f!==(f=st(ve[0].approved)+"")&&$(d,f),Ye[0]&1&&_!==(_=st(ve[0].pending)+"")&&$(m,_),Ye[0]&65536&&a(w,"href",ve[16]),Ye[0]&32){rt=Le(ve[5]);let Ke;for(Ke=0;Ke<rt.length;Ke+=1){const ht=vu(ve,rt,Ke);we[Ke]?we[Ke].p(ht,Ye):(we[Ke]=Nu(ht),we[Ke].c(),we[Ke].m(N,null))}for(;Ke<we.length;Ke+=1)we[Ke].d(1);we.length=rt.length}if(Ye[0]&262176&&pt(N,ve[18]),Ye[0]&2097153&&re!==(re=ve[21]?"Queued…":`Translate all pending (${st(ve[0].pending)})`)&&$(V,re),Ye[0]&2097153&&oe!==(oe=ve[21]||ve[0].pending===0)&&(F.disabled=oe),ve[20].size>0?be?be.p(ve,Ye):(be=zu(ve),be.c(),be.m(z,ie)):be&&(be.d(1),be=null),ve[22]?ae?ae.p(ve,Ye):(ae=Iu(ve),ae.c(),ae.m(z,null)):ae&&(ae.d(1),ae=null),Ye[0]&524288&&ee!==(ee="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 "+(ve[19]?"border-red-500 focus:border-red-500":"border-gray-700 focus:border-indigo-500"))&&a(se,"class",ee),Ye[0]&2&&se.value!==ve[1]&&Ee(se,ve[1]),Ye[0]&4&&G!==(G="absolute right-1.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold transition-colors "+(ve[2]?"bg-indigo-600 text-white":"bg-gray-700 text-gray-400 hover:bg-gray-600"))&&a(fe,"class",G),Ye[0]&8&&pt(ue,ve[3]),Ye[0]&1048576|Ye[1]&4&&O!==(O=ve[20].size>0&&ve[33].length>0&&ve[33].every(ve[66]))&&(U.checked=O),Ye[1]&4&&K!==(K=ve[33].length+"")&&$(ne,K),Ye[0]&1&&ge!==(ge=ve[0].topPhrases.length+"")&&$(Ce,ge),Ye[0]&1&&Me!==(Me=ve[0].topPhrases.length===200?"(200 max)":"")&&$(We,Me),Ye[0]&1310720|Ye[1]&836){Ne=Le(ve[33]);let Ke;for(Ke=0;Ke<Ne.length;Ke+=1){const ht=yu(ve,Ne,Ke);Ae[Ke]?Ae[Ke].p(ht,Ye):(Ae[Ke]=Ou(ht),Ae[Ke].c(),Ae[Ke].m(Pe,null))}for(;Ke<Ae.length;Ke+=1)Ae[Ke].d(1);Ae.length=Ne.length,!Ne.length&&xe?xe.p(ve,Ye):Ne.length?xe&&(xe.d(1),xe=null):(xe=Pu(),xe.c(),xe.m(Pe,null))}ve[0].topPhrases.length===200?Re||(Re=Fu(),Re.c(),Re.m(He.parentNode,He)):Re&&(Re.d(1),Re=null)},d(ve){ve&&(R(t),R(M),R(z),R(Z),R(H),R(Ze),R(Pe),R(Xe),R(He)),it(we,ve),be&&be.d(),ae&&ae.d(),it(Ae,ve),xe&&xe.d(),Re&&Re.d(ve),et=!1,$e(tt)}}}function Xm(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:Be,d(n){n&&R(t)}}}function Nu(e){let t,n=e[88].lang+"",r,i;return{c(){t=b("option"),r=j(n),t.__value=i=e[88].lang,Ee(t,t.__value)},m(l,o){B(l,t,o),c(t,r)},p(l,o){o[0]&32&&n!==(n=l[88].lang+"")&&$(r,n),o[0]&32&&i!==(i=l[88].lang)&&(t.__value=i,Ee(t,t.__value))},d(l){l&&R(t)}}}function zu(e){let t,n,r=e[20].size+"",i,l,o,s;return{c(){t=b("button"),n=j("Translate selected ("),i=j(r),l=j(")"),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(u,f){B(u,t,f),c(t,n),c(t,i),c(t,l),o||(s=Q(t,"click",e[60]),o=!0)},p(u,f){f[0]&1048576&&r!==(r=u[20].size+"")&&$(i,r)},d(u){u&&R(t),o=!1,s()}}}function Iu(e){let t,n=e[22].text+"",r,i;return{c(){t=b("span"),r=j(n),a(t,"class",i="text-xs "+(e[22].ok?"text-emerald-400":"text-red-400")+" ml-1")},m(l,o){B(l,t,o),c(t,r)},p(l,o){o[0]&4194304&&n!==(n=l[22].text+"")&&$(r,n),o[0]&4194304&&i!==(i="text-xs "+(l[22].ok?"text-emerald-400":"text-red-400")+" ml-1")&&a(t,"class",i)},d(l){l&&R(t)}}}function Pu(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:Be,d(n){n&&R(t)}}}function Du(e){let t,n=e[104].context+"",r;return{c(){t=b("div"),r=j(n),a(t,"class","text-gray-500 text-[10px] mt-0.5 break-words whitespace-normal leading-snug")},m(i,l){B(i,t,l),c(t,r)},p(i,l){l[1]&4&&n!==(n=i[104].context+"")&&$(r,n)},d(i){i&&R(t)}}}function Ou(e){let t,n,r,i,l,o=e[104].status[0].toUpperCase()+"",s,u,f,d,h,g=e[104].key+"",p,_,m,y,v,w,C,x,A,M,z;function E(){return e[67](e[104])}function P(){return e[68](e[104])}let I=e[104].context&&Du(e);function D(){return e[69](e[104])}return{c(){t=b("div"),n=b("input"),i=L(),l=b("span"),s=j(o),f=L(),d=b("div"),h=b("button"),p=j(g),_=L(),I&&I.c(),m=L(),y=b("button"),v=pe("svg"),w=pe("path"),x=L(),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(l,"class",u="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),c(t,n),c(t,i),c(t,l),c(l,s),c(t,f),c(t,d),c(d,h),c(h,p),c(d,_),I&&I.m(d,null),c(t,m),c(t,y),c(y,v),c(v,w),c(t,x),M||(z=[Q(n,"change",E),Q(h,"click",P),Q(y,"click",Bt(D))],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&&o!==(o=e[104].status[0].toUpperCase()+"")&&$(s,o),N[1]&4&&u!==(u="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(l,"class",u),N[1]&4&&g!==(g=e[104].key+"")&&$(p,g),e[104].context?I?I.p(e,N):(I=Du(e),I.c(),I.m(d,null)):I&&(I.d(1),I=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&&R(t),I&&I.d(),M=!1,$e(z)}}}function Fu(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&&R(t)}}}function Ru(e){let t,n,r,i,l=e[100].label+"",o,s,u,f,d,h=Ku(e[99].url)+"",g,p,_,m=qu(e[99].url)+"",y,v,w,C,x=st(e[99].phraseCount)+"",A,M,z,E=st(e[99].approved)+"",P,I,D,T,N=e[101]+"",k,F,re,V,oe,Y,ie,Z,H,ce,se,ee,_e,fe;function ye(){return e[57](e[99])}let G=e[16]===e[99].url&&Lu(e);return{c(){t=b("tr"),n=b("td"),r=b("div"),i=b("span"),o=j(l),u=L(),f=b("div"),d=b("div"),g=j(h),p=L(),_=b("div"),y=j(m),w=L(),C=b("td"),A=j(x),M=L(),z=b("td"),P=j(E),I=L(),D=b("td"),T=b("span"),k=j(N),F=j("%"),V=L(),oe=b("td"),Y=b("a"),ie=pe("svg"),Z=pe("path"),se=L(),G&&G.c(),ee=bt(),a(i,"class",s="text-[10px] font-medium "+e[100].color+" shrink-0"),a(d,"class","text-gray-500 text-[10px] truncate"),a(_,"class","font-mono text-gray-300 truncate max-w-sm"),a(_,"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(z,"class","px-3 py-2.5 text-right font-mono text-emerald-400"),a(T,"class",re="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(D,"class","px-3 py-2.5 text-right"),a(Z,"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(Z,"stroke-linecap","round"),a(Z,"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",H=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(oe,"class","px-3 py-2.5"),a(t,"class",ce="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(de,ue){B(de,t,ue),c(t,n),c(n,r),c(r,i),c(i,o),c(r,u),c(r,f),c(f,d),c(d,g),c(f,p),c(f,_),c(_,y),c(t,w),c(t,C),c(C,A),c(t,M),c(t,z),c(z,P),c(t,I),c(t,D),c(D,T),c(T,k),c(T,F),c(t,V),c(t,oe),c(oe,Y),c(Y,ie),c(ie,Z),B(de,se,ue),G&&G.m(de,ue),B(de,ee,ue),_e||(fe=[Q(Y,"click",Bt(e[47])),Q(t,"click",ye)],_e=!0)},p(de,ue){e=de,ue[0]&256&&l!==(l=e[100].label+"")&&$(o,l),ue[0]&256&&s!==(s="text-[10px] font-medium "+e[100].color+" shrink-0")&&a(i,"class",s),ue[0]&256&&h!==(h=Ku(e[99].url)+"")&&$(g,h),ue[0]&256&&m!==(m=qu(e[99].url)+"")&&$(y,m),ue[0]&256&&v!==(v=e[99].url)&&a(_,"title",v),ue[0]&256&&x!==(x=st(e[99].phraseCount)+"")&&$(A,x),ue[0]&256&&E!==(E=st(e[99].approved)+"")&&$(P,E),ue[0]&256&&N!==(N=e[101]+"")&&$(k,N),ue[0]&256&&re!==(re="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",re),ue[0]&256&&H!==(H=e[99].url)&&a(Y,"href",H),ue[0]&65792&&ce!==(ce="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",ce),e[16]===e[99].url?G?G.p(e,ue):(G=Lu(e),G.c(),G.m(ee.parentNode,ee)):G&&(G.d(1),G=null)},d(de){de&&(R(t),R(se),R(ee)),G&&G.d(de),_e=!1,$e(fe)}}}function Bu(e){let t,n,r,i,l,o,s=st(e[4].trashPhrases)+"",u;return{c(){t=b("div"),n=b("span"),r=L(),i=b("span"),i.textContent="Trash",l=L(),o=b("span"),u=j(s),a(n,"class","w-2.5 h-2.5 rounded-full bg-red-500 shrink-0"),a(i,"class","text-gray-400"),a(o,"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),c(t,n),c(t,r),c(t,i),c(t,l),c(t,o),c(o,u)},p(f,d){d[0]&16&&s!==(s=st(f[4].trashPhrases)+"")&&$(u,s)},d(f){f&&R(t)}}}function ju(e){let t,n=e[96].section+"",r,i,l=Vt(e[96].phrases)+"",o,s,u,f,d;function h(){return e[52](e[96])}return{c(){t=b("button"),r=j(n),i=j(" · "),o=j(l),s=L(),a(t,"class",u="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(g,p){B(g,t,p),c(t,r),c(t,i),c(t,o),c(t,s),f||(d=Q(t,"click",h),f=!0)},p(g,p){e=g,p[0]&64&&n!==(n=e[96].section+"")&&$(r,n),p[0]&64&&l!==(l=Vt(e[96].phrases)+"")&&$(o,l),p[0]&16448&&u!==(u="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",u)},d(g){g&&R(t),f=!1,d()}}}function Uu(e){var C;let t,n,r,i,l,o=(((C=e[24])==null?void 0:C.status)??e[23].status).toUpperCase()+"",s,u,f,d,h,g,p,_,m;function y(x,A){if(x[25])return $m;if(x[24])return Qm}let v=y(e),w=v&&v(e);return{c(){var x,A;t=b("div"),n=b("div"),r=b("div"),i=b("div"),l=b("span"),s=j(o),f=L(),d=b("h3"),d.textContent="Phrase Detail",h=L(),g=b("button"),g.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>',p=L(),w&&w.c(),a(l,"class",u="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(i,"class","flex items-center gap-2"),a(g,"class","text-gray-500 hover:text-white transition-colors p-1 rounded hover:bg-gray-700"),a(g,"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),c(t,n),c(n,r),c(r,i),c(i,l),c(l,s),c(i,f),c(i,d),c(r,h),c(r,g),c(n,p),w&&w.m(n,null),_||(m=[Q(g,"click",e[71]),Q(t,"click",Nl(e[75]))],_=!0)},p(x,A){var M,z,E;A[0]&25165824&&o!==(o=(((M=x[24])==null?void 0:M.status)??x[23].status).toUpperCase()+"")&&$(s,o),A[0]&25165824&&u!==(u="px-2 py-0.5 rounded text-[10px] font-semibold "+((((z=x[24])==null?void 0:z.status)??x[23].status)==="approved"?"bg-emerald-900 text-emerald-300":(((E=x[24])==null?void 0:E.status)??x[23].status)==="trash"?"bg-red-900 text-red-300":"bg-yellow-900 text-yellow-300"))&&a(l,"class",u),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&&R(t),w&&w.d(),_=!1,$e(m)}}}function Qm(e){let t,n,r,i,l,o,s=e[24].key+"",u,f,d,h,g,p=(e[24].context||"—")+"",_,m,y,v,w,C=e[24].status+"",x,A,M,z,E,P=(e[24].created_at||"—")+"",I,D,T,N,k,F,re,V,oe,Y,ie,Z=e[21]?"Queuing…":`★ AI Translate → ${e[18]}`,H,ce,se,ee,_e,fe,ye,G,de,ue,te,Se,S,X=e[24].translations.length+"",J,U,O=e[24].translations.length!==1?"s":"",W,le,q,K,ne,ke,ge;function Ce(xe,Re){return xe[24].url?t2:e2}let Fe=Ce(e),Me=Fe(e),We=Le(e[5]),Ze=[];for(let xe=0;xe<We.length;xe+=1)Ze[xe]=Hu(mu(e,We,xe));let Pe=e[22]&&Wu(e);function Xe(xe,Re){return xe[24].url?r2:n2}let He=Xe(e),et=He(e);function tt(xe,Re){return xe[24].translations.length<xe[5].length?u2:a2}let rt=tt(e),we=rt(e);function be(xe,Re){return xe[24].translations.length===0?f2:c2}let ae=be(e),Ne=ae(e),Ae=e[5].length>e[24].translations.length&&Yu(pl(e));return{c(){t=b("div"),n=b("div"),r=b("div"),i=b("span"),i.textContent="Key",l=L(),o=b("span"),u=j(s),f=L(),d=b("span"),d.textContent="DomContext",h=L(),g=b("span"),_=j(p),m=L(),y=b("span"),y.textContent="Status",v=L(),w=b("span"),x=j(C),A=L(),M=b("span"),M.textContent="Discovered",z=L(),E=b("span"),I=j(P),D=L(),T=b("span"),T.textContent="Source URL",N=L(),Me.c(),k=L(),F=b("span"),F.textContent="Translate",re=L(),V=b("div"),oe=b("select");for(let xe=0;xe<Ze.length;xe+=1)Ze[xe].c();Y=L(),ie=b("button"),H=j(Z),ce=L(),Pe&&Pe.c(),se=L(),ee=b("div"),_e=b("p"),_e.textContent="Page Screenshot",fe=L(),et.c(),ye=L(),G=b("div"),de=b("div"),ue=b("h4"),te=j(`Translations
67
+ `),Se=b("span"),S=j("("),J=j(X),U=j(" language"),W=j(O),le=j(")"),q=L(),we.c(),K=L(),Ne.c(),ne=L(),Ae&&Ae.c(),a(i,"class","text-gray-400 font-medium pt-0.5"),a(o,"class","font-mono text-white break-all leading-relaxed"),a(d,"class","text-gray-400 font-medium pt-0.5"),a(g,"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(E,"class","text-gray-300"),a(T,"class","text-gray-400 font-medium pt-0.5"),a(F,"class","text-gray-400 font-medium pt-0.5"),a(oe,"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&&Et(()=>e[72].call(oe)),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(V,"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(_e,"class","text-xs text-gray-400 font-medium"),a(ee,"class","w-72 shrink-0 p-4 flex flex-col gap-2"),a(n,"class","flex gap-0 divide-x divide-gray-700"),a(Se,"class","ml-1 text-gray-600 font-normal normal-case"),a(ue,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),a(de,"class","flex items-center justify-between mb-3"),a(G,"class","border-t border-gray-700 px-5 py-4"),a(t,"class","overflow-y-auto flex-1")},m(xe,Re){B(xe,t,Re),c(t,n),c(n,r),c(r,i),c(r,l),c(r,o),c(o,u),c(r,f),c(r,d),c(r,h),c(r,g),c(g,_),c(r,m),c(r,y),c(r,v),c(r,w),c(w,x),c(r,A),c(r,M),c(r,z),c(r,E),c(E,I),c(r,D),c(r,T),c(r,N),Me.m(r,null),c(r,k),c(r,F),c(r,re),c(r,V),c(V,oe);for(let ve=0;ve<Ze.length;ve+=1)Ze[ve]&&Ze[ve].m(oe,null);pt(oe,e[18],!0),c(V,Y),c(V,ie),c(ie,H),c(V,ce),Pe&&Pe.m(V,null),c(n,se),c(n,ee),c(ee,_e),c(ee,fe),et.m(ee,null),c(t,ye),c(t,G),c(G,de),c(de,ue),c(ue,te),c(ue,Se),c(Se,S),c(Se,J),c(Se,U),c(Se,W),c(Se,le),c(de,q),we.m(de,null),c(G,K),Ne.m(G,null),c(G,ne),Ae&&Ae.m(G,null),ke||(ge=[Q(oe,"change",e[72]),Q(ie,"click",e[73])],ke=!0)},p(xe,Re){if(Re[0]&16777216&&s!==(s=xe[24].key+"")&&$(u,s),Re[0]&16777216&&p!==(p=(xe[24].context||"—")+"")&&$(_,p),Re[0]&16777216&&C!==(C=xe[24].status+"")&&$(x,C),Re[0]&16777216&&P!==(P=(xe[24].created_at||"—")+"")&&$(I,P),Fe===(Fe=Ce(xe))&&Me?Me.p(xe,Re):(Me.d(1),Me=Fe(xe),Me&&(Me.c(),Me.m(r,k))),Re[0]&32){We=Le(xe[5]);let ve;for(ve=0;ve<We.length;ve+=1){const Ye=mu(xe,We,ve);Ze[ve]?Ze[ve].p(Ye,Re):(Ze[ve]=Hu(Ye),Ze[ve].c(),Ze[ve].m(oe,null))}for(;ve<Ze.length;ve+=1)Ze[ve].d(1);Ze.length=We.length}Re[0]&262176&&pt(oe,xe[18]),Re[0]&2359296&&Z!==(Z=xe[21]?"Queuing…":`★ AI Translate → ${xe[18]}`)&&$(H,Z),Re[0]&2097152&&(ie.disabled=xe[21]),xe[22]?Pe?Pe.p(xe,Re):(Pe=Wu(xe),Pe.c(),Pe.m(V,null)):Pe&&(Pe.d(1),Pe=null),He===(He=Xe(xe))&&et?et.p(xe,Re):(et.d(1),et=He(xe),et&&(et.c(),et.m(ee,null))),Re[0]&16777216&&X!==(X=xe[24].translations.length+"")&&$(J,X),Re[0]&16777216&&O!==(O=xe[24].translations.length!==1?"s":"")&&$(W,O),rt===(rt=tt(xe))&&we?we.p(xe,Re):(we.d(1),we=rt(xe),we&&(we.c(),we.m(de,null))),ae===(ae=be(xe))&&Ne?Ne.p(xe,Re):(Ne.d(1),Ne=ae(xe),Ne&&(Ne.c(),Ne.m(G,ne))),xe[5].length>xe[24].translations.length?Ae?Ae.p(pl(xe),Re):(Ae=Yu(pl(xe)),Ae.c(),Ae.m(G,null)):Ae&&(Ae.d(1),Ae=null)},d(xe){xe&&R(t),Me.d(),it(Ze,xe),Pe&&Pe.d(),et.d(),we.d(),Ne.d(),Ae&&Ae.d(),ke=!1,$e(ge)}}}function $m(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:Be,d(n){n&&R(t)}}}function e2(e){let t;return{c(){t=b("span"),t.textContent="—",a(t,"class","text-gray-500")},m(n,r){B(n,t,r)},p:Be,d(n){n&&R(t)}}}function t2(e){let t,n=e[24].url+"",r,i;return{c(){t=b("a"),r=j(n),a(t,"href",i=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(l,o){B(l,t,o),c(t,r)},p(l,o){o[0]&16777216&&n!==(n=l[24].url+"")&&$(r,n),o[0]&16777216&&i!==(i=l[24].url)&&a(t,"href",i)},d(l){l&&R(t)}}}function Hu(e){let t,n=e[88].lang+"",r,i;return{c(){t=b("option"),r=j(n),t.__value=i=e[88].lang,Ee(t,t.__value)},m(l,o){B(l,t,o),c(t,r)},p(l,o){o[0]&32&&n!==(n=l[88].lang+"")&&$(r,n),o[0]&32&&i!==(i=l[88].lang)&&(t.__value=i,Ee(t,t.__value))},d(l){l&&R(t)}}}function Wu(e){let t,n=e[22].text+"",r,i;return{c(){t=b("span"),r=j(n),a(t,"class",i="text-xs "+(e[22].ok?"text-emerald-400":"text-red-400"))},m(l,o){B(l,t,o),c(t,r)},p(l,o){o[0]&4194304&&n!==(n=l[22].text+"")&&$(r,n),o[0]&4194304&&i!==(i="text-xs "+(l[22].ok?"text-emerald-400":"text-red-400"))&&a(t,"class",i)},d(l){l&&R(t)}}}function n2(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"),ct(t,"min-height","140px")},m(n,r){B(n,t,r)},p:Be,d(n){n&&R(t)}}}function r2(e){let t;function n(l,o){return l[26][l[24].url]===void 0?s2:l[26][l[24].url]===null?o2:l[26][l[24].url]===!1?l2:i2}let r=n(e),i=r(e);return{c(){i.c(),t=bt()},m(l,o){i.m(l,o),B(l,t,o)},p(l,o){r===(r=n(l))&&i?i.p(l,o):(i.d(1),i=r(l),i&&(i.c(),i.m(t.parentNode,t)))},d(l){l&&R(t),i.d(l)}}}function i2(e){let t,n,r,i;return{c(){t=b("a"),n=b("img"),yi(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",i=e[24].url),a(t,"target","_blank"),a(t,"rel","noopener noreferrer")},m(l,o){B(l,t,o),c(t,n)},p(l,o){o[0]&83886080&&!yi(n.src,r="data:image/jpeg;base64,"+l[26][l[24].url])&&a(n,"src",r),o[0]&16777216&&i!==(i=l[24].url)&&a(t,"href",i)},d(l){l&&R(t)}}}function l2(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"),ct(t,"min-height","140px")},m(n,r){B(n,t,r)},p:Be,d(n){n&&R(t)}}}function o2(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:Be,d(n){n&&R(t)}}}function s2(e){let t=e[34](e[24].url)+"",n,r,i;return{c(){n=j(t),r=L(),i=b("div"),i.textContent="Loading…",a(i,"class","flex-1 flex items-center justify-center text-gray-600 text-xs")},m(l,o){B(l,n,o),B(l,r,o),B(l,i,o)},p(l,o){o[0]&16777216&&t!==(t=l[34](l[24].url)+"")&&$(n,t)},d(l){l&&(R(n),R(r),R(i))}}}function a2(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:Be,d(n){n&&R(t)}}}function u2(e){let t,n=e[5].length-e[24].translations.length+"",r,i,l=e[5].length-e[24].translations.length!==1?"s":"",o,s;return{c(){t=b("span"),r=j(n),i=j(" language"),o=j(l),s=j(" missing"),a(t,"class","text-[10px] text-yellow-500")},m(u,f){B(u,t,f),c(t,r),c(t,i),c(t,o),c(t,s)},p(u,f){f[0]&16777248&&n!==(n=u[5].length-u[24].translations.length+"")&&$(r,n),f[0]&16777248&&l!==(l=u[5].length-u[24].translations.length!==1?"s":"")&&$(o,l)},d(u){u&&R(t)}}}function c2(e){let t,n=Le(e[24].translations),r=[];for(let i=0;i<n.length;i+=1)r[i]=Zu(gu(e,n,i));return{c(){t=b("div");for(let i=0;i<r.length;i+=1)r[i].c();a(t,"class","grid grid-cols-1 sm:grid-cols-2 gap-2")},m(i,l){B(i,t,l);for(let o=0;o<r.length;o+=1)r[o]&&r[o].m(t,null)},p(i,l){if(l[0]&16777216){n=Le(i[24].translations);let o;for(o=0;o<n.length;o+=1){const s=gu(i,n,o);r[o]?r[o].p(s,l):(r[o]=Zu(s),r[o].c(),r[o].m(t,null))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(i){i&&R(t),it(r,i)}}}function f2(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:Be,d(n){n&&R(t)}}}function Zu(e){let t,n,r=e[91].lang+"",i,l,o,s=e[91].value+"",u,f;return{c(){t=b("div"),n=b("span"),i=j(r),l=L(),o=b("span"),u=j(s),f=L(),a(n,"class","font-mono text-indigo-400 text-xs w-10 shrink-0 pt-0.5"),a(o,"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),c(t,n),c(n,i),c(t,l),c(t,o),c(o,u),c(t,f)},p(d,h){h[0]&16777216&&r!==(r=d[91].lang+"")&&$(i,r),h[0]&16777216&&s!==(s=d[91].value+"")&&$(u,s)},d(d){d&&R(t)}}}function Yu(e){let t,n,r,i=Le(e[87]),l=[];for(let o=0;o<i.length;o+=1)l[o]=Vu(pu(e,i,o));return{c(){t=b("div"),n=b("span"),n.textContent="Missing:",r=L();for(let o=0;o<l.length;o+=1)l[o].c();a(n,"class","text-[10px] text-gray-500"),a(t,"class","mt-3 flex items-center gap-2 flex-wrap")},m(o,s){B(o,t,s),c(t,n),c(t,r);for(let u=0;u<l.length;u+=1)l[u]&&l[u].m(t,null)},p(o,s){if(s[0]&16777248){i=Le(o[87]);let u;for(u=0;u<i.length;u+=1){const f=pu(o,i,u);l[u]?l[u].p(f,s):(l[u]=Vu(f),l[u].c(),l[u].m(t,null))}for(;u<l.length;u+=1)l[u].d(1);l.length=i.length}},d(o){o&&R(t),it(l,o)}}}function Vu(e){let t,n=e[88].lang+"",r;return{c(){t=b("span"),r=j(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(i,l){B(i,t,l),c(t,r)},p(i,l){l[0]&16777248&&n!==(n=i[88].lang+"")&&$(r,n)},d(i){i&&R(t)}}}function d2(e){let t,n,r,i,l,o,s,u,f=e[4]&&Su(e);function d(_,m){return _[10]?Wm:Hm}let h=d(e),g=h(e),p=e[23]&&Uu(e);return{c(){t=b("div"),n=b("div"),r=b("div"),i=b("div"),i.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>',l=L(),f&&f.c(),o=L(),g.c(),s=L(),p&&p.c(),u=bt(),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(_,t,m),c(t,n),c(n,r),c(r,i),c(r,l),f&&f.m(r,null),c(n,o),g.m(n,null),B(_,s,m),p&&p.m(_,m),B(_,u,m)},p(_,m){_[4]?f?f.p(_,m):(f=Su(_),f.c(),f.m(r,null)):f&&(f.d(1),f=null),h===(h=d(_))&&g?g.p(_,m):(g.d(1),g=h(_),g&&(g.c(),g.m(n,null))),_[23]?p?p.p(_,m):(p=Uu(_),p.c(),p.m(u.parentNode,u)):p&&(p.d(1),p=null)},i:Be,o:Be,d(_){_&&(R(t),R(s),R(u)),f&&f.d(),g.d(),p&&p.d(_)}}}const In=50;function st(e){return e!=null?e.toLocaleString():"—"}function Vt(e){return e==null?"—":e>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"k":String(e)}function qu(e){try{const t=new URL(e),n=t.pathname.split("/").filter(Boolean).pop()||t.pathname,r=t.searchParams,i=[n];return r.get("f")&&i.push(`f=${r.get("f")}`),r.get("s")&&i.push(`s=${r.get("s")}`),r.get("module")&&i.push(`mod=${r.get("module")}`),r.get("func")&&i.push(`func=${r.get("func")}`),i.join(" · ")}catch{return e.length>70?e.slice(0,67)+"…":e}}function Ku(e){try{return new URL(e).hostname}catch{return""}}function h2(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 Ju=e=>e.phrases>=100;function p2(e,t,n){let r,i=null,l=[],o=[],s=[],u=[],f=[],d=0,h=!0,g=!1,p="",_=0,m="",y="",v=null,w=null,C=!1,x="",A="",M=!1,z=!1,E="pending",P=new Set,I=!1,D=null,T=null,N=null,k=!1,F={};function re(me){return!me||F[me]!==void 0||(n(26,F[me]=null,F),je(`../api/screenshots?url=${encodeURIComponent(me)}`).then(De=>De.json()).then(De=>{n(26,F[me]=De.screenshot||!1,F),n(26,F)}).catch(()=>{n(26,F[me]=!1,F),n(26,F)})),""}let V="overview",oe,Y,ie,Z,H;async function ce(){n(10,h=!0);const[me,De,Ue,nt,gt]=await Promise.all([je("../api/analytics"),je("../api/analytics/languages"),je("../api/analytics/sections"),je("../api/analytics/instances"),je("../api/analytics/activity")]);n(4,[i,l,o,s,u]=await Promise.all([me.json(),De.json(),Ue.json(),nt.json(),gt.json()]),i,n(5,l),n(6,o),n(7,s)),n(10,h=!1),await ur(),ue()}async function se(){n(11,g=!0);const me=new URLSearchParams({limit:In,offset:_});p&&me.set("search",p),m&&me.set("search",m==="chart"?"f=chart":m==="admin"?"f=admin":m==="layout"?"f=layout":m==="func"?"func=":p||""),y&&me.set("search",y);const Ue=await(await je(`../api/analytics/urls?${me}`)).json();n(8,f=Ue.rows),n(9,d=Ue.total),n(11,g=!1)}async function ee(me){n(16,v=me),n(0,w=null),n(17,C=!0),n(1,A=""),n(3,E="pending"),n(2,M=!1),n(19,z=!1),n(20,P=new Set),n(22,D=null),n(23,T=null),n(24,N=null);const De=await je(`../api/analytics/url-detail?url=${encodeURIComponent(me)}`);n(0,w=await De.json()),n(17,C=!1),!x&&l.length>0&&n(18,x=l[0].lang)}function _e(){n(16,v=null),n(0,w=null)}function fe(me){const De=new Set(P);De.has(me)?De.delete(me):De.add(me),n(20,P=De)}function ye(me){const De=new Set(P);me.target.checked?r.forEach(Ue=>De.add(Ue.id)):r.forEach(Ue=>De.delete(Ue.id)),n(20,P=De)}async function G(me,De){if(!(!x||!me||me.length===0)){n(21,I=!0),n(22,D=null);try{const Ue=await je("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:me,lang:x})});if(Ue.ok)n(22,D={ok:!0,text:`${De} queued for ${x}`}),n(20,P=new Set);else{const nt=await Ue.json().catch(()=>({}));n(22,D={ok:!1,text:nt.message||`Error ${Ue.status}`})}}catch(Ue){n(22,D={ok:!1,text:Ue.message})}finally{n(21,I=!1)}}}async function de(me){if((T==null?void 0:T.id)===me.id){n(23,T=null),n(24,N=null);return}n(23,T=me),n(24,N=null),n(25,k=!0);try{const De=await je(`../api/analytics/phrase-detail?id=${me.id}`);n(24,N=await De.json())}finally{n(25,k=!1)}}function ue(){te(),Se(),S(),X(),J()}function te(){if(!Y||!i)return;Ut(Y).selectAll("*").remove();const me=[{label:"Pending",value:i.pendingPhrases,color:"#F59E0B"},{label:"Approved",value:i.approvedPhrases,color:"#10B981"},{label:"Trash",value:i.trashPhrases,color:"#EF4444"}].filter(ze=>ze.value>0),De=160,Ue=De/2,nt=Ue*.6,ft=Ut(Y).append("svg").attr("width",De).attr("height",De).append("g").attr("transform",`translate(${Ue},${Ue})`),lt=Um().value(ze=>ze.value).sort(null),dt=uu().innerRadius(nt).outerRadius(Ue-3),Je=uu().innerRadius(nt).outerRadius(Ue),Oe=Ut(Y).append("div").attr("class","chart-tip").style("display","none");ft.selectAll("path").data(lt(me)).join("path").attr("d",dt).attr("fill",ze=>ze.data.color).attr("stroke","#111827").attr("stroke-width",2).style("cursor","pointer").on("mouseover",function(ze,Ve){Ut(this).transition().duration(120).attr("d",Je),Oe.style("display","block").html(`<b>${Ve.data.label}</b>: ${st(Ve.data.value)}`)}).on("mousemove",ze=>Oe.style("left",ze.offsetX+10+"px").style("top",ze.offsetY-8+"px")).on("mouseout",function(){Ut(this).transition().duration(120).attr("d",dt),Oe.style("display","none")}),ft.append("text").attr("text-anchor","middle").attr("dy","-0.25em").attr("fill","#f9fafb").attr("font-size",16).attr("font-weight","bold").text(Vt(i.totalPhrases)),ft.append("text").attr("text-anchor","middle").attr("dy","1.1em").attr("fill","#6b7280").attr("font-size",10).text("phrases")}function Se(){if(!oe||!l.length)return;Ut(oe).selectAll("*").remove();const me={top:8,right:60,bottom:8,left:68},De=26,Ue=4,nt=oe.clientWidth||400,gt=l.length*(De+Ue)+me.top+me.bottom,ft=nt-me.left-me.right,dt=Ut(oe).append("svg").attr("width",nt).attr("height",gt).append("g").attr("transform",`translate(${me.left},${me.top})`),Je=oi(l,Ve=>Ve.translated)||1,Oe=Ir().domain([0,Je]).range([0,ft]),ze=of(Em).domain([0,l.length-1]);l.forEach((Ve,xt)=>{const Qe=xt*(De+Ue);dt.append("text").attr("x",-6).attr("y",Qe+De/2+1).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","#a5b4fc").attr("font-size",11).attr("font-family","monospace").text(Ve.lang),dt.append("rect").attr("x",0).attr("y",Qe).attr("width",ft).attr("height",De).attr("fill","#1f2937").attr("rx",4),dt.append("rect").attr("x",0).attr("y",Qe).attr("width",Oe(Ve.translated)).attr("height",De).attr("fill",ze(xt)).attr("rx",4),dt.append("text").attr("x",ft+6).attr("y",Qe+De/2+1).attr("dominant-baseline","middle").attr("fill","#9ca3af").attr("font-size",10).text(`${Vt(Ve.translated)} (${Ve.coverage}%)`)})}function S(){if(!ie||!u.length)return;Ut(ie).selectAll("*").remove();const me={top:10,right:16,bottom:28,left:48},De=ie.clientWidth||500,Ue=130,nt=De-me.left-me.right,gt=Ue-me.top-me.bottom,ft=rf("%Y-%m-%d"),lt=u.map(Qe=>({day:ft(Qe.day),count:Qe.count})),Je=Ut(ie).append("svg").attr("width",De).attr("height",Ue).append("g").attr("transform",`translate(${me.left},${me.top})`),Oe=Am().domain(r0(lt,Qe=>Qe.day)).range([0,nt]),ze=Ir().domain([0,oi(lt,Qe=>Qe.count)]).nice().range([gt,0]),Ve=Rm().x(Qe=>Oe(Qe.day)).y0(gt).y1(Qe=>ze(Qe.count)).curve(hu);Je.append("path").datum(lt).attr("fill","#6366f133").attr("d",Ve);const xt=ff().x(Qe=>Oe(Qe.day)).y(Qe=>ze(Qe.count)).curve(hu);Je.append("path").datum(lt).attr("fill","none").attr("stroke","#6366f1").attr("stroke-width",2).attr("d",xt),Je.selectAll("circle").data(lt).join("circle").attr("cx",Qe=>Oe(Qe.day)).attr("cy",Qe=>ze(Qe.count)).attr("r",3).attr("fill","#818cf8").attr("stroke","#1f2937").attr("stroke-width",1.5),Je.append("g").attr("transform",`translate(0,${gt})`).call(xa(Oe).ticks(6).tickFormat(Gl("%b %d"))).call(Qe=>Qe.select(".domain").attr("stroke","#374151")).call(Qe=>Qe.selectAll("text").attr("fill","#6b7280").attr("font-size",10)),Je.append("g").call(Ca(ze).ticks(4).tickFormat(Pi(",d"))).call(Qe=>Qe.select(".domain").attr("stroke","#374151")).call(Qe=>Qe.selectAll("text").attr("fill","#6b7280").attr("font-size",10))}function X(){if(!Z||!o.length)return;Ut(Z).selectAll("*").remove();const me={chart:"#6366f1",admin:"#f59e0b",layout:"#10b981",func:"#3b82f6",other:"#8b5cf6"},De={top:10,right:16,bottom:32,left:48},Ue=Z.clientWidth||400,nt=180,gt=Ue-De.left-De.right,ft=nt-De.top-De.bottom,dt=Ut(Z).append("svg").attr("width",Ue).attr("height",nt).append("g").attr("transform",`translate(${De.left},${De.top})`),Je=Kc().domain(o.map(ze=>ze.section)).range([0,gt]).padding(.3),Oe=Ir().domain([0,oi(o,ze=>ze.phrases)]).nice().range([ft,0]);dt.append("g").call(Ca(Oe).ticks(4).tickFormat(Pi(",d"))).call(ze=>ze.select(".domain").attr("stroke","#374151")).call(ze=>ze.selectAll("text").attr("fill","#9ca3af").attr("font-size",10)),dt.selectAll(".bar").data(o).join("rect").attr("x",ze=>Je(ze.section)).attr("y",ze=>Oe(ze.phrases)).attr("width",Je.bandwidth()).attr("height",ze=>ft-Oe(ze.phrases)).attr("fill",ze=>me[ze.section]||"#6b7280").attr("rx",3).style("cursor","pointer").on("click",(ze,Ve)=>{n(14,m=m===Ve.section?"":Ve.section),n(13,_=0),n(27,V="pages"),se()}),dt.selectAll(".bar-label").data(o).join("text").attr("x",ze=>Je(ze.section)+Je.bandwidth()/2).attr("y",ze=>Oe(ze.phrases)-4).attr("text-anchor","middle").attr("fill","#d1d5db").attr("font-size",9).text(ze=>Vt(ze.phrases)),dt.append("g").attr("transform",`translate(0,${ft})`).call(xa(Je)).call(ze=>ze.select(".domain").attr("stroke","#374151")).call(ze=>ze.selectAll("text").attr("fill","#9ca3af").attr("font-size",11))}function J(){if(!H||!s.length)return;Ut(H).selectAll("*").remove();const me=s.filter(Ve=>Ve.phrases>=100);if(!me.length)return;const De={top:8,right:56,bottom:8,left:76},Ue=22,nt=4,gt=H.clientWidth||400,ft=me.length*(Ue+nt)+De.top+De.bottom,lt=gt-De.left-De.right,Je=Ut(H).append("svg").attr("width",gt).attr("height",ft).append("g").attr("transform",`translate(${De.left},${De.top})`),Oe=oi(me,Ve=>Ve.phrases)||1,ze=Ir().domain([0,Oe]).range([0,lt]);me.forEach((Ve,xt)=>{const Qe=xt*(Ue+nt);Je.append("text").attr("x",-6).attr("y",Qe+Ue/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","#93c5fd").attr("font-size",10).attr("font-family","monospace").text(Ve.instance),Je.append("rect").attr("x",0).attr("y",Qe).attr("width",lt).attr("height",Ue).attr("fill","#1f2937").attr("rx",3),Je.append("rect").attr("x",0).attr("y",Qe).attr("width",ze(Ve.phrases)).attr("height",Ue).attr("fill","#3b82f655").attr("rx",3),Je.append("rect").attr("x",0).attr("y",Qe).attr("width",ze(Ve.approved)).attr("height",Ue).attr("fill","#10b981").attr("rx",3).style("cursor","pointer").on("click",()=>{n(15,y=y===Ve.instance?"":Ve.instance),n(12,p=y),n(13,_=0),n(27,V="pages"),se()}),Je.append("text").attr("x",lt+6).attr("y",Qe+Ue/2).attr("dominant-baseline","middle").attr("fill","#9ca3af").attr("font-size",9).text(`${Vt(Ve.phrases)} phrases`)})}let U;function O(){n(14,m=""),n(15,y=""),clearTimeout(U),U=setTimeout(()=>{n(13,_=0),se()},300)}function W(me){n(14,m=m===me?"":me),n(12,p=""),n(15,y=""),n(13,_=0),se()}function le(me){n(15,y=y===me?"":me),n(12,p=y),n(14,m=""),n(13,_=0),se()}function q(){n(13,_=Math.max(0,_-In)),se()}function K(){n(13,_+=In),se()}function ne(me){n(27,V=me),me==="pages"&&f.length===0&&se(),me==="overview"&&ur().then(ue)}br(()=>{const me=new ResizeObserver(()=>{h||ue()});return ce().then(()=>{[oe,ie,Z,H].filter(Boolean).forEach(De=>me.observe(De))}),()=>me.disconnect()});function ke(me){lr.call(this,e,me)}const ge=me=>ne(me);function Ce(me){Ln[me?"unshift":"push"](()=>{Y=me,n(29,Y)})}function Fe(me){Ln[me?"unshift":"push"](()=>{ie=me,n(30,ie)})}function Me(me){Ln[me?"unshift":"push"](()=>{Z=me,n(31,Z)})}const We=me=>W(me.section);function Ze(me){Ln[me?"unshift":"push"](()=>{H=me,n(32,H)})}function Pe(){p=this.value,n(12,p)}const Xe=me=>W(me.section),He=me=>le(me.instance),et=me=>v===me.url?_e():ee(me.url);function tt(){x=qt(this),n(18,x),n(5,l)}const rt=()=>G(w.pendingKeyIds,"All pending"),we=()=>G([...P],"Selected");function be(){A=this.value,n(1,A)}const ae=()=>{n(23,T=null),n(24,N=null)},Ne=()=>{n(2,M=!M),n(23,T=null),n(24,N=null)};function Ae(){E=qt(this),n(3,E)}const xe=()=>{n(23,T=null),n(24,N=null)},Re=me=>P.has(me.id),ve=me=>fe(me.id),Ye=me=>de(me),Ke=me=>G([me.id],`"${me.key}"`);function ht(me){Ln[me?"unshift":"push"](()=>{oe=me,n(28,oe)})}const Gt=()=>{n(23,T=null),n(24,N=null)};function Lt(){x=qt(this),n(18,x),n(5,l)}const Xt=()=>G([N.id],`"${N.key}"`),Wt=(me,De)=>!me.has(De.lang),Qt=()=>{n(23,T=null),n(24,N=null)};return e.$$.update=()=>{e.$$.dirty[0]&15&&n(33,r=(()=>{const me=(w==null?void 0:w.topPhrases)||[];if(!A)return me.filter(Ue=>!E||Ue.status===E);if(M){let Ue;try{Ue=new RegExp(A,"i"),n(19,z=!1)}catch{return n(19,z=!0),[]}return me.filter(nt=>(!E||nt.status===E)&&(Ue.test(nt.key)||Ue.test(nt.context||"")))}const De=A.toLowerCase();return me.filter(Ue=>(!E||Ue.status===E)&&(Ue.key.toLowerCase().includes(De)||(Ue.context||"").toLowerCase().includes(De)))})())},n(19,z=!1),[w,A,M,E,i,l,o,s,f,d,h,g,p,_,m,y,v,C,x,z,P,I,D,T,N,k,F,V,oe,Y,ie,Z,H,r,re,ee,_e,fe,ye,G,de,O,W,le,q,K,ne,ke,ge,Ce,Fe,Me,We,Ze,Pe,Xe,He,et,tt,rt,we,be,ae,Ne,Ae,xe,Re,ve,Ye,Ke,ht,Gt,Lt,Xt,Wt,Qt]}class g2 extends nn{constructor(t){super(),tn(this,t,p2,d2,Jt,{},null,[-1,-1,-1,-1])}}function Gu(e,t,n){const r=e.slice();return r[23]=t[n],r}function Xu(e,t,n){const r=e.slice();return r[26]=t[n],r}function Qu(e){let t,n,r,i;function l(){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")),ct(t,"background-color",e[26]),a(t,"title",e[26])},m(o,s){B(o,t,s),r||(i=Q(t,"click",l),r=!0)},p(o,s){e=o,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(o){o&&R(t),r=!1,i()}}}function $u(e){let t,n;return{c(){t=b("p"),n=j(e[6]),a(t,"class","text-sm text-red-600 mb-4")},m(r,i){B(r,t,i),c(t,n)},p(r,i){i&64&&$(n,r[6])},d(r){r&&R(t)}}}function m2(e){let t,n=[],r=new Map,i=Le(e[0]);const l=o=>o[23].id;for(let o=0;o<i.length;o+=1){let s=Gu(e,i,o),u=l(s);r.set(u,n[o]=ec(u,s))}return{c(){t=b("div");for(let o=0;o<n.length;o+=1)n[o].c();a(t,"class","space-y-2")},m(o,s){B(o,t,s);for(let u=0;u<n.length;u+=1)n[u]&&n[u].m(t,null)},p(o,s){s&7737&&(i=Le(o[0]),n=Hi(n,s,l,1,o,i,r,t,Ui,ec,null,Gu))},d(o){o&&R(t);for(let s=0;s<n.length;s+=1)n[s].d()}}}function _2(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:Be,d(n){n&&R(t)}}}function b2(e){let t,n,r,i=e[23].name+"",l,o,s,u=e[23].count+"",f,d,h=e[23].count!==1?"s":"",g,p,_,m,y,v,w;function C(){return e[20](e[23])}function x(){return e[21](e[23])}return{c(){t=b("span"),n=L(),r=b("span"),l=j(i),o=L(),s=b("span"),f=j(u),d=j(" phrase"),g=j(h),p=L(),_=b("button"),_.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>',m=L(),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"),ct(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(_,"class","p-1 text-gray-400 hover:text-indigo-600 transition-colors"),a(_,"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),c(r,l),B(A,o,M),B(A,s,M),c(s,f),c(s,d),c(s,g),B(A,p,M),B(A,_,M),B(A,m,M),B(A,y,M),v||(w=[Q(_,"click",C),Q(y,"click",x)],v=!0)},p(A,M){e=A,M&1&&ct(t,"background-color",e[23].color),M&1&&i!==(i=e[23].name+"")&&$(l,i),M&1&&u!==(u=e[23].count+"")&&$(f,u),M&1&&h!==(h=e[23].count!==1?"s":"")&&$(g,h)},d(A){A&&(R(t),R(n),R(r),R(o),R(s),R(p),R(_),R(m),R(y)),v=!1,$e(w)}}}function y2(e){let t,n,r,i,l,o,s,u,f;return{c(){t=b("input"),n=L(),r=b("input"),i=L(),l=b("button"),l.textContent="Save",o=L(),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(l,"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),Ee(t,e[5]),B(d,n,h),B(d,r,h),Ee(r,e[4]),B(d,i,h),B(d,l,h),B(d,o,h),B(d,s,h),u||(f=[Q(t,"input",e[17]),Q(r,"input",e[18]),Q(r,"keydown",e[19]),Q(l,"click",e[10]),Q(s,"click",e[11])],u=!0)},p(d,h){h&32&&Ee(t,d[5]),h&16&&r.value!==d[4]&&Ee(r,d[4])},d(d){d&&(R(t),R(n),R(r),R(i),R(l),R(o),R(s)),u=!1,$e(f)}}}function ec(e,t){let n,r;function i(s,u){return s[3]===s[23].id?y2:b2}let l=i(t),o=l(t);return{key:e,first:null,c(){n=b("div"),o.c(),r=L(),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,u){B(s,n,u),o.m(n,null),c(n,r)},p(s,u){t=s,l===(l=i(t))&&o?o.p(t,u):(o.d(1),o=l(t),o&&(o.c(),o.m(n,r)))},d(s){s&&R(n),o.d()}}}function v2(e){let t,n,r,i,l,o,s,u,f,d,h,g,p,_,m,y,v,w,C,x,A,M=Le(e[7]),z=[];for(let T=0;T<M.length;T+=1)z[T]=Qu(Xu(e,M,T));let E=e[6]&&$u(e);function P(T,N){return T[0].length===0?_2:m2}let I=P(e),D=I(e);return{c(){t=b("section"),n=b("h2"),n.textContent="Labels",r=L(),i=b("p"),i.textContent="Create labels to organize and categorize your phrases. Labels work like GitHub labels — assign them to phrases and filter by them.",l=L(),o=b("div"),s=b("div"),u=b("input"),f=L(),d=b("div"),h=b("input"),g=L(),p=b("button"),_=j("Create"),y=L(),v=b("div");for(let T=0;T<z.length;T+=1)z[T].c();w=L(),E&&E.c(),C=L(),D.c(),a(n,"class","text-lg font-semibold text-gray-800 mb-4"),a(i,"class","text-sm text-gray-500 mb-6"),a(u,"type","text"),a(u,"placeholder","Label name"),a(u,"maxlength","50"),a(u,"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(p,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),p.disabled=m=!e[1].trim(),a(o,"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),c(t,n),c(t,r),c(t,i),c(t,l),c(t,o),c(o,s),c(s,u),Ee(u,e[1]),c(s,f),c(s,d),c(d,h),Ee(h,e[2]),c(o,g),c(o,p),c(p,_),c(t,y),c(t,v);for(let k=0;k<z.length;k+=1)z[k]&&z[k].m(v,null);c(t,w),E&&E.m(t,null),c(t,C),D.m(t,null),x||(A=[Q(u,"input",e[13]),Q(u,"keydown",e[14]),Q(h,"input",e[15]),Q(p,"click",e[8])],x=!0)},p(T,[N]){if(N&2&&u.value!==T[1]&&Ee(u,T[1]),N&4&&Ee(h,T[2]),N&2&&m!==(m=!T[1].trim())&&(p.disabled=m),N&132){M=Le(T[7]);let k;for(k=0;k<M.length;k+=1){const F=Xu(T,M,k);z[k]?z[k].p(F,N):(z[k]=Qu(F),z[k].c(),z[k].m(v,null))}for(;k<z.length;k+=1)z[k].d(1);z.length=M.length}T[6]?E?E.p(T,N):(E=$u(T),E.c(),E.m(t,C)):E&&(E.d(1),E=null),I===(I=P(T))&&D?D.p(T,N):(D.d(1),D=I(T),D&&(D.c(),D.m(t,null)))},i:Be,o:Be,d(T){T&&R(t),it(z,T),E&&E.d(),D.d(),x=!1,$e(A)}}}function w2(e,t,n){let r=[],i="",l="#6366f1",o=null,s="",u="",f="";const d=["#ef4444","#f97316","#f59e0b","#84cc16","#22c55e","#14b8a6","#06b6d4","#3b82f6","#6366f1","#8b5cf6","#a855f7","#d946ef","#ec4899","#f43f5e","#64748b"];br(h);async function h(){const I=await je("../api/labels");I.ok&&n(0,r=await I.json())}async function g(){if(!i.trim())return;n(6,f="");const I=await je("../api/labels",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i.trim(),color:l})});if(I.ok)n(1,i=""),n(2,l="#6366f1"),await h();else{const D=await I.json().catch(()=>({}));n(6,f=D.error||"Failed to create label")}}function p(I){n(3,o=I.id),n(4,s=I.name),n(5,u=I.color)}async function _(){if(!s.trim())return;(await je(`../api/labels/${o}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.trim(),color:u})})).ok&&(n(3,o=null),await h())}function m(){n(3,o=null)}async function y(I){confirm("Delete this label? It will be removed from all phrases.")&&(await je(`../api/labels/${I}`,{method:"DELETE"}),await h())}function v(){i=this.value,n(1,i)}const w=I=>I.key==="Enter"&&g();function C(){l=this.value,n(2,l)}const x=I=>n(2,l=I);function A(){u=this.value,n(5,u)}function M(){s=this.value,n(4,s)}return[r,i,l,o,s,u,f,d,g,p,_,m,y,v,w,C,x,A,M,I=>{I.key==="Enter"&&_(),I.key==="Escape"&&m()},I=>p(I),I=>y(I.id)]}class k2 extends nn{constructor(t){super(),tn(this,t,w2,v2,Jt,{})}}function tc(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 x2(e){let t,n;return t=new Ef({props:{routes:e[4]}}),t.$on("conditionsFailed",e[6]),t.$on("routeLoaded",e[7]),{c(){mn(t.$$.fragment)},m(r,i){un(t,r,i),n=!0},p:Be,i(r){n||(_t(t.$$.fragment,r),n=!0)},o(r){kt(t.$$.fragment,r),n=!1},d(r){cn(t,r)}}}function C2(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:Be,i:Be,o:Be,d(n){n&&R(t)}}}function S2(e){let t,n,r,i,l,o,s,u,f,d,h;n=new zf({props:{currentView:e[2]}}),n.$on("navigate",e[5]),o=new Bf({props:{projects:e[1],currentProject:e[3]}}),o.$on("switch",e[8]),o.$on("created",e[9]),o.$on("deleted",e[10]),o.$on("renamed",e[11]);const g=[C2,x2],p=[];function _(m,y){return m[0]?1:0}return f=_(e),d=p[f]=g[f](e),{c(){t=b("div"),mn(n.$$.fragment),r=L(),i=b("div"),l=b("header"),mn(o.$$.fragment),s=L(),u=b("main"),d.c(),a(l,"class","bg-white border-b border-gray-200 px-6 py-2 flex items-center justify-end gap-3 shrink-0"),a(u,"class","flex-1 p-6 overflow-auto"),a(i,"class","flex-1 flex flex-col overflow-hidden"),a(t,"class","flex min-h-screen bg-gray-100")},m(m,y){B(m,t,y),un(n,t,null),c(t,r),c(t,i),c(i,l),un(o,l,null),c(i,s),c(i,u),p[f].m(u,null),h=!0},p(m,[y]){const v={};y&4&&(v.currentView=m[2]),n.$set(v);const w={};y&2&&(w.projects=m[1]),y&8&&(w.currentProject=m[3]),o.$set(w);let C=f;f=_(m),f===C?p[f].p(m,y):(cr(),kt(p[C],1,1,()=>{p[C]=null}),fr(),d=p[f],d?d.p(m,y):(d=p[f]=g[f](m),d.c()),_t(d,1),d.m(u,null))},i(m){h||(_t(n.$$.fragment,m),_t(o.$$.fragment,m),_t(d),h=!0)},o(m){kt(n.$$.fragment,m),kt(o.$$.fragment,m),kt(d),h=!1},d(m){m&&R(t),cn(n),cn(o),p[f].d()}}}function A2(e,t,n){let r,i,l,o;Or(e,Yt,w=>n(3,l=w)),Or(e,Af,w=>n(13,o=w));let s=!1,u=[];const f={"/translations/:tab":tc({component:ws,conditions:[w=>{var C;return["pending","approved","trash"].includes((C=w.params)==null?void 0:C.tab)}]}),"/ai-translate":Od,"/analytics":g2,"/labels":k2,"/settings":Xd,"*":tc({component:ws})};function d(w){const C=w.detail;if(C==="translations"){if(o.startsWith("/translations/"))return;nr("/translations/pending")}else nr(`/${C}`)}function h(){nr("/translations/pending")}function g(w){w.detail.route==="*"&&nr("/translations/pending")}br(async()=>{(!window.location.hash||window.location.hash==="#"||window.location.hash==="#/")&&nr("/translations/pending");const w=await fetch("../api/projects");n(1,u=await w.json());const C=localStorage.getItem("loco_project_id");let x=u.find(A=>String(A.id)===C)||u[0];if(!x){n(0,s=!0);return}await p(x),n(0,s=!0)});async function p(w){cc(w.api_key),localStorage.setItem("loco_project_id",String(w.id)),Yt.set(w)}async function _(w){n(0,s=!1),await p(w.detail),n(0,s=!0)}async function m(w){n(1,u=[...u,w.detail]),n(0,s=!1),await p(w.detail),n(0,s=!0)}async function y(w){const C=w.detail;n(1,u=u.filter(x=>x.id!==C.id)),(l==null?void 0:l.id)===C.id&&(n(0,s=!1),await p(u[0]),n(0,s=!0))}async function v(w){const C=w.detail;n(1,u=u.map(x=>x.id===C.id?{...x,name:C.name}:x)),(l==null?void 0:l.id)===C.id&&Yt.update(x=>({...x,name:C.name}))}return e.$$.update=()=>{e.$$.dirty&8192&&n(12,r=(o||"").split("/")[1]||"translations"),e.$$.dirty&4096&&n(2,i=r==="ai-translate"?"ai-translate":r==="settings"?"settings":r==="analytics"?"analytics":r==="labels"?"labels":"translations")},[s,u,i,l,f,d,h,g,_,m,y,v,r,o]}class T2 extends nn{constructor(t){super(),tn(this,t,A2,S2,Jt,{})}}new T2({target:document.getElementById("app")});