@hkonda/loco-translate 1.0.0

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 (92) hide show
  1. package/README.md +284 -0
  2. package/bin/loco.js +5 -0
  3. package/dist/assets/index-CGo6e-bA.js +59 -0
  4. package/dist/assets/index-DBcQDZ75.css +1 -0
  5. package/dist/index.html +13 -0
  6. package/dist-server/app.d.ts +3 -0
  7. package/dist-server/app.d.ts.map +1 -0
  8. package/dist-server/app.js +154 -0
  9. package/dist-server/app.js.map +1 -0
  10. package/dist-server/config.d.ts +16 -0
  11. package/dist-server/config.d.ts.map +1 -0
  12. package/dist-server/config.js +41 -0
  13. package/dist-server/config.js.map +1 -0
  14. package/dist-server/db/index.d.ts +8 -0
  15. package/dist-server/db/index.d.ts.map +1 -0
  16. package/dist-server/db/index.js +28 -0
  17. package/dist-server/db/index.js.map +1 -0
  18. package/dist-server/db/schema.d.ts +851 -0
  19. package/dist-server/db/schema.d.ts.map +1 -0
  20. package/dist-server/db/schema.js +65 -0
  21. package/dist-server/db/schema.js.map +1 -0
  22. package/dist-server/db/seed.d.ts +14 -0
  23. package/dist-server/db/seed.d.ts.map +1 -0
  24. package/dist-server/db/seed.js +229 -0
  25. package/dist-server/db/seed.js.map +1 -0
  26. package/dist-server/index.d.ts +2 -0
  27. package/dist-server/index.d.ts.map +1 -0
  28. package/dist-server/index.js +31 -0
  29. package/dist-server/index.js.map +1 -0
  30. package/dist-server/routes/ai-jobs.d.ts +5 -0
  31. package/dist-server/routes/ai-jobs.d.ts.map +1 -0
  32. package/dist-server/routes/ai-jobs.js +141 -0
  33. package/dist-server/routes/ai-jobs.js.map +1 -0
  34. package/dist-server/routes/backup.d.ts +5 -0
  35. package/dist-server/routes/backup.d.ts.map +1 -0
  36. package/dist-server/routes/backup.js +125 -0
  37. package/dist-server/routes/backup.js.map +1 -0
  38. package/dist-server/routes/chrome-extension.d.ts +5 -0
  39. package/dist-server/routes/chrome-extension.d.ts.map +1 -0
  40. package/dist-server/routes/chrome-extension.js +140 -0
  41. package/dist-server/routes/chrome-extension.js.map +1 -0
  42. package/dist-server/routes/export.d.ts +5 -0
  43. package/dist-server/routes/export.d.ts.map +1 -0
  44. package/dist-server/routes/export.js +95 -0
  45. package/dist-server/routes/export.js.map +1 -0
  46. package/dist-server/routes/languages.d.ts +5 -0
  47. package/dist-server/routes/languages.d.ts.map +1 -0
  48. package/dist-server/routes/languages.js +36 -0
  49. package/dist-server/routes/languages.js.map +1 -0
  50. package/dist-server/routes/project.d.ts +5 -0
  51. package/dist-server/routes/project.d.ts.map +1 -0
  52. package/dist-server/routes/project.js +151 -0
  53. package/dist-server/routes/project.js.map +1 -0
  54. package/dist-server/routes/prompts.d.ts +5 -0
  55. package/dist-server/routes/prompts.d.ts.map +1 -0
  56. package/dist-server/routes/prompts.js +90 -0
  57. package/dist-server/routes/prompts.js.map +1 -0
  58. package/dist-server/routes/screenshots.d.ts +5 -0
  59. package/dist-server/routes/screenshots.d.ts.map +1 -0
  60. package/dist-server/routes/screenshots.js +71 -0
  61. package/dist-server/routes/screenshots.js.map +1 -0
  62. package/dist-server/routes/textnodes.d.ts +5 -0
  63. package/dist-server/routes/textnodes.d.ts.map +1 -0
  64. package/dist-server/routes/textnodes.js +318 -0
  65. package/dist-server/routes/textnodes.js.map +1 -0
  66. package/dist-server/routes/translations.d.ts +5 -0
  67. package/dist-server/routes/translations.d.ts.map +1 -0
  68. package/dist-server/routes/translations.js +224 -0
  69. package/dist-server/routes/translations.js.map +1 -0
  70. package/dist-server/scripts/backup.d.ts +2 -0
  71. package/dist-server/scripts/backup.d.ts.map +1 -0
  72. package/dist-server/scripts/backup.js +26 -0
  73. package/dist-server/scripts/backup.js.map +1 -0
  74. package/dist-server/services/ai-translation.d.ts +21 -0
  75. package/dist-server/services/ai-translation.d.ts.map +1 -0
  76. package/dist-server/services/ai-translation.js +137 -0
  77. package/dist-server/services/ai-translation.js.map +1 -0
  78. package/dist-server/services/job-manager.d.ts +67 -0
  79. package/dist-server/services/job-manager.d.ts.map +1 -0
  80. package/dist-server/services/job-manager.js +159 -0
  81. package/dist-server/services/job-manager.js.map +1 -0
  82. package/dist-server/services/slot-pattern.d.ts +16 -0
  83. package/dist-server/services/slot-pattern.d.ts.map +1 -0
  84. package/dist-server/services/slot-pattern.js +68 -0
  85. package/dist-server/services/slot-pattern.js.map +1 -0
  86. package/dist-server/utils/network.d.ts +2 -0
  87. package/dist-server/utils/network.d.ts.map +1 -0
  88. package/dist-server/utils/network.js +16 -0
  89. package/dist-server/utils/network.js.map +1 -0
  90. package/package.json +47 -0
  91. package/public/loco.js +2386 -0
  92. package/public/loco.min.js +4 -0
@@ -0,0 +1,59 @@
1
+ var gl=Object.defineProperty;var _l=(n,e,t)=>e in n?gl(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var kt=(n,e,t)=>_l(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&o(i)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function o(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function je(){}function In(n,e){for(const t in e)n[t]=e[t];return n}function rl(n){return n()}function vr(){return Object.create(null)}function Ze(n){n.forEach(rl)}function Xn(n){return typeof n=="function"}function St(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Sn;function wr(n,e){return n===e?!0:(Sn||(Sn=document.createElement("a")),Sn.href=e,n===Sn.href)}function bl(n){return Object.keys(n).length===0}function il(n,...e){if(n==null){for(const o of e)o(void 0);return je}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Rn(n,e,t){n.$$.on_destroy.push(il(e,t))}function Kt(n,e,t){return n.set(t),e}function a(n,e){n.appendChild(e)}function W(n,e,t){n.insertBefore(e,t||null)}function H(n){n.parentNode&&n.parentNode.removeChild(n)}function qe(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function x(n){return document.createElement(n)}function re(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function Z(n){return document.createTextNode(n)}function F(){return Z(" ")}function at(){return Z("")}function ie(n,e,t,o){return n.addEventListener(e,t,o),()=>n.removeEventListener(e,t,o)}function An(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function yl(n){return function(e){e.target===this&&n.call(this,e)}}function r(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function ll(n){return n===""?null:+n}function kl(n){return Array.from(n.childNodes)}function ce(n,e){e=""+e,n.data!==e&&(n.data=e)}function Ae(n,e){n.value=e??""}function Qn(n,e,t,o){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function Ve(n,e,t){for(let o=0;o<n.options.length;o+=1){const l=n.options[o];if(l.__value===e){l.selected=!0;return}}(!t||e!==void 0)&&(n.selectedIndex=-1)}function vt(n){const e=n.querySelector(":checked");return e&&e.__value}function xr(n,e,t){n.classList.toggle(e,!!t)}function vl(n,e,{bubbles:t=!1,cancelable:o=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:o})}class sl{constructor(e=!1){kt(this,"is_svg",!1);kt(this,"e");kt(this,"n");kt(this,"t");kt(this,"a");this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,o=null){this.e||(this.is_svg?this.e=re(t.nodeName):this.e=x(t.nodeType===11?"TEMPLATE":t.nodeName),this.t=t.tagName!=="TEMPLATE"?t:t.content,this.c(e)),this.i(o)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)W(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(H)}}function On(n,e){return new n(e)}let rn;function tn(n){rn=n}function Nn(){if(!rn)throw new Error("Function called outside component initialization");return rn}function Dn(n){Nn().$$.on_mount.push(n)}function wl(n){Nn().$$.after_update.push(n)}function ol(n){Nn().$$.on_destroy.push(n)}function al(){const n=Nn();return(e,t,{cancelable:o=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=vl(e,t,{cancelable:o});return l.slice().forEach(i=>{i.call(n,s)}),!s.defaultPrevented}return!0}}function nn(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(o=>o.call(this,e))}const Vt=[],Cr=[];let qt=[];const Sr=[],cl=Promise.resolve();let qn=!1;function ul(){qn||(qn=!0,cl.then(fl))}function Ln(){return ul(),cl}function ht(n){qt.push(n)}const Vn=new Set;let Gt=0;function fl(){if(Gt!==0)return;const n=rn;do{try{for(;Gt<Vt.length;){const e=Vt[Gt];Gt++,tn(e),xl(e.$$)}}catch(e){throw Vt.length=0,Gt=0,e}for(tn(null),Vt.length=0,Gt=0;Cr.length;)Cr.pop()();for(let e=0;e<qt.length;e+=1){const t=qt[e];Vn.has(t)||(Vn.add(t),t())}qt.length=0}while(Vt.length);for(;Sr.length;)Sr.pop()();qn=!1,Vn.clear(),tn(n)}function xl(n){if(n.fragment!==null){n.update(),Ze(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(ht)}}function Cl(n){const e=[],t=[];qt.forEach(o=>n.indexOf(o)===-1?e.push(o):t.push(o)),t.forEach(o=>o()),qt=e}const Bn=new Set;let Bt;function ln(){Bt={r:0,c:[],p:Bt}}function sn(){Bt.r||Ze(Bt.c),Bt=Bt.p}function Qe(n,e){n&&n.i&&(Bn.delete(n),n.i(e))}function ot(n,e,t,o){if(n&&n.o){if(Bn.has(n))return;Bn.add(n),Bt.c.push(()=>{Bn.delete(n),o&&(t&&n.d(1),o())}),n.o(e)}else o&&o()}function Oe(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function $n(n,e){n.d(1),e.delete(n.key)}function er(n,e,t,o,l,s,i,c,u,f,m,p){let k=n.length,d=s.length,g=k;const h={};for(;g--;)h[n[g].key]=g;const y=[],v=new Map,w=new Map,S=[];for(g=d;g--;){const I=p(l,s,g),E=t(I);let z=i.get(E);z?S.push(()=>z.p(I,e)):(z=f(E,I),z.c()),v.set(E,y[g]=z),E in h&&w.set(E,Math.abs(g-h[E]))}const C=new Set,A=new Set;function B(I){Qe(I,1),I.m(c,m),i.set(I.key,I),m=I.first,d--}for(;k&&d;){const I=y[d-1],E=n[k-1],z=I.key,j=E.key;I===E?(m=I.first,k--,d--):v.has(j)?!i.has(z)||C.has(z)?B(I):A.has(j)?k--:w.get(z)>w.get(j)?(A.add(z),B(I)):(C.add(j),k--):(u(E,i),k--)}for(;k--;){const I=n[k];v.has(I.key)||u(I,i)}for(;d;)B(y[d-1]);return Ze(S),y}function jn(n,e){const t={},o={},l={$$scope:1};let s=n.length;for(;s--;){const i=n[s],c=e[s];if(c){for(const u in i)u in c||(o[u]=1);for(const u in c)l[u]||(t[u]=c[u],l[u]=1);n[s]=c}else for(const u in i)l[u]=1}for(const i in o)i in t||(t[i]=void 0);return t}function Fn(n){return typeof n=="object"&&n!==null?n:{}}function It(n){n&&n.c()}function xt(n,e,t){const{fragment:o,after_update:l}=n.$$;o&&o.m(e,t),ht(()=>{const s=n.$$.on_mount.map(rl).filter(Xn);n.$$.on_destroy?n.$$.on_destroy.push(...s):Ze(s),n.$$.on_mount=[]}),l.forEach(ht)}function Ct(n,e){const t=n.$$;t.fragment!==null&&(Cl(t.after_update),Ze(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Sl(n,e){n.$$.dirty[0]===-1&&(Vt.push(n),ul(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function Ot(n,e,t,o,l,s,i=null,c=[-1]){const u=rn;tn(n);const f=n.$$={fragment:null,ctx:[],props:s,update:je,not_equal:l,bound:vr(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:vr(),dirty:c,skip_bound:!1,root:e.target||u.$$.root};i&&i(f.root);let m=!1;if(f.ctx=t?t(n,e.props||{},(p,k,...d)=>{const g=d.length?d[0]:k;return f.ctx&&l(f.ctx[p],f.ctx[p]=g)&&(!f.skip_bound&&f.bound[p]&&f.bound[p](g),m&&Sl(n,p)),k}):[],f.update(),m=!0,Ze(f.before_update),f.fragment=o?o(f.ctx):!1,e.target){if(e.hydrate){const p=kl(e.target);f.fragment&&f.fragment.l(p),p.forEach(H)}else f.fragment&&f.fragment.c();e.intro&&Qe(n.$$.fragment),xt(n,e.target,e.anchor),fl()}tn(u)}class Lt{constructor(){kt(this,"$$");kt(this,"$$set")}$destroy(){Ct(this,1),this.$destroy=je}$on(e,t){if(!Xn(t))return je;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(t),()=>{const l=o.indexOf(t);l!==-1&&o.splice(l,1)}}$set(e){this.$$set&&!bl(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Al="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Al);let Yn=null;function dl(n){Yn=n}function Re(n,e={}){const t={...e.headers||{}};return Yn&&(t["X-API-Key"]=Yn),fetch(n,{...e,headers:t})}const Jt=[];function hl(n,e){return{subscribe:tr(n,e).subscribe}}function tr(n,e=je){let t;const o=new Set;function l(c){if(St(n,c)&&(n=c,t)){const u=!Jt.length;for(const f of o)f[1](),Jt.push(f,n);if(u){for(let f=0;f<Jt.length;f+=2)Jt[f][0](Jt[f+1]);Jt.length=0}}}function s(c){l(c(n))}function i(c,u=je){const f=[c,u];return o.add(f),o.size===1&&(t=e(l,s)||je),c(n),()=>{o.delete(f),o.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:i}}function pl(n,e,t){const o=!Array.isArray(n),l=o?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return hl(t,(i,c)=>{let u=!1;const f=[];let m=0,p=je;const k=()=>{if(m)return;p();const g=e(o?f[0]:f,i,c);s?i(g):p=Xn(g)?g:je},d=l.map((g,h)=>il(g,y=>{f[h]=y,m&=~(1<<h),u&&k()},()=>{m|=1<<h}));return u=!0,k(),function(){Ze(d),p(),u=!1}})}const gt=tr(null);function El(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,o,l,s,i=[],c="",u=n.split("/");for(u[0]||u.shift();l=u.shift();)t=l[0],t==="*"?(i.push("wild"),c+="/(.*)"):t===":"?(o=l.indexOf("?",1),s=l.indexOf(".",1),i.push(l.substring(1,~o?o:~s?s:l.length)),c+=~o&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(c+=(~o?"?":"")+"\\"+l.substring(s))):c+="/"+l;return{keys:i,pattern:new RegExp("^"+c+"/?$","i")}}function Tl(n){let e,t,o;const l=[n[2]];var s=n[0];function i(c,u){let f={};for(let m=0;m<l.length;m+=1)f=In(f,l[m]);return u!==void 0&&u&4&&(f=In(f,jn(l,[Fn(c[2])]))),{props:f}}return s&&(e=On(s,i(n)),e.$on("routeEvent",n[7])),{c(){e&&It(e.$$.fragment),t=at()},m(c,u){e&&xt(e,c,u),W(c,t,u),o=!0},p(c,u){if(u&1&&s!==(s=c[0])){if(e){ln();const f=e;ot(f.$$.fragment,1,0,()=>{Ct(f,1)}),sn()}s?(e=On(s,i(c,u)),e.$on("routeEvent",c[7]),It(e.$$.fragment),Qe(e.$$.fragment,1),xt(e,t.parentNode,t)):e=null}else if(s){const f=u&4?jn(l,[Fn(c[2])]):{};e.$set(f)}},i(c){o||(e&&Qe(e.$$.fragment,c),o=!0)},o(c){e&&ot(e.$$.fragment,c),o=!1},d(c){c&&H(t),e&&Ct(e,c)}}}function zl(n){let e,t,o;const l=[{params:n[1]},n[2]];var s=n[0];function i(c,u){let f={};for(let m=0;m<l.length;m+=1)f=In(f,l[m]);return u!==void 0&&u&6&&(f=In(f,jn(l,[u&2&&{params:c[1]},u&4&&Fn(c[2])]))),{props:f}}return s&&(e=On(s,i(n)),e.$on("routeEvent",n[6])),{c(){e&&It(e.$$.fragment),t=at()},m(c,u){e&&xt(e,c,u),W(c,t,u),o=!0},p(c,u){if(u&1&&s!==(s=c[0])){if(e){ln();const f=e;ot(f.$$.fragment,1,0,()=>{Ct(f,1)}),sn()}s?(e=On(s,i(c,u)),e.$on("routeEvent",c[6]),It(e.$$.fragment),Qe(e.$$.fragment,1),xt(e,t.parentNode,t)):e=null}else if(s){const f=u&6?jn(l,[u&2&&{params:c[1]},u&4&&Fn(c[2])]):{};e.$set(f)}},i(c){o||(e&&Qe(e.$$.fragment,c),o=!0)},o(c){e&&ot(e.$$.fragment,c),o=!1},d(c){c&&H(t),e&&Ct(e,c)}}}function Bl(n){let e,t,o,l;const s=[zl,Tl],i=[];function c(u,f){return u[1]?0:1}return e=c(n),t=i[e]=s[e](n),{c(){t.c(),o=at()},m(u,f){i[e].m(u,f),W(u,o,f),l=!0},p(u,[f]){let m=e;e=c(u),e===m?i[e].p(u,f):(ln(),ot(i[m],1,1,()=>{i[m]=null}),sn(),t=i[e],t?t.p(u,f):(t=i[e]=s[e](u),t.c()),Qe(t,1),t.m(o.parentNode,o))},i(u){l||(Qe(t),l=!0)},o(u){ot(t),l=!1},d(u){u&&H(o),i[e].d(u)}}}function Ar(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let o="";return t>-1&&(o=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:o}}const nr=hl(null,function(e){e(Ar());const t=()=>{e(Ar())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}}),Il=pl(nr,n=>n.location);pl(nr,n=>n.querystring);const Er=tr(void 0);async function Qt(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await Ln(),history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=(n.charAt(0)=="#"?"":"#")+n}function Ol(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function Ll(n,e,t){let{routes:o={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class i{constructor(A,B){if(!B||typeof B!="function"&&(typeof B!="object"||B._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:I,keys:E}=El(A);this.path=A,typeof B=="object"&&B._sveltesparouter===!0?(this.component=B.component,this.conditions=B.conditions||[],this.userData=B.userData,this.props=B.props||{}):(this.component=()=>Promise.resolve(B),this.conditions=[],this.props={}),this._pattern=I,this._keys=E}match(A){if(l){if(typeof l=="string")if(A.startsWith(l))A=A.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const z=A.match(l);if(z&&z[0])A=A.substr(z[0].length)||"/";else return null}}const B=this._pattern.exec(A);if(B===null)return null;if(this._keys===!1)return B;const I={};let E=0;for(;E<this._keys.length;){try{I[this._keys[E]]=decodeURIComponent(B[E+1]||"")||null}catch{I[this._keys[E]]=null}E++}return I}async checkConditions(A){for(let B=0;B<this.conditions.length;B++)if(!await this.conditions[B](A))return!1;return!0}}const c=[];o instanceof Map?o.forEach((C,A)=>{c.push(new i(A,C))}):Object.keys(o).forEach(C=>{c.push(new i(C,o[C]))});let u=null,f=null,m={};const p=al();async function k(C,A){await Ln(),p(C,A)}let d=null,g=null;s&&(g=C=>{C.state&&(C.state.__svelte_spa_router_scrollY||C.state.__svelte_spa_router_scrollX)?d=C.state:d=null},window.addEventListener("popstate",g),wl(()=>{Ol(d)}));let h=null,y=null;const v=nr.subscribe(async C=>{h=C;let A=0;for(;A<c.length;){const B=c[A].match(C.location);if(!B){A++;continue}const I={route:c[A].path,location:C.location,querystring:C.querystring,userData:c[A].userData,params:B&&typeof B=="object"&&Object.keys(B).length?B:null};if(!await c[A].checkConditions(I)){t(0,u=null),y=null,k("conditionsFailed",I);return}k("routeLoading",Object.assign({},I));const E=c[A].component;if(y!=E){E.loading?(t(0,u=E.loading),y=E,t(1,f=E.loadingParams),t(2,m={}),k("routeLoaded",Object.assign({},I,{component:u,name:u.name,params:f}))):(t(0,u=null),y=null);const z=await E();if(C!=h)return;t(0,u=z&&z.default||z),y=E}B&&typeof B=="object"&&Object.keys(B).length?t(1,f=B):t(1,f=null),t(2,m=c[A].props),k("routeLoaded",Object.assign({},I,{component:u,name:u.name,params:f})).then(()=>{Er.set(f)});return}t(0,u=null),y=null,Er.set(void 0)});ol(()=>{v(),g&&window.removeEventListener("popstate",g)});function w(C){nn.call(this,n,C)}function S(C){nn.call(this,n,C)}return n.$$set=C=>{"routes"in C&&t(3,o=C.routes),"prefix"in C&&t(4,l=C.prefix),"restoreScrollState"in C&&t(5,s=C.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[u,f,m,o,l,s,w,S]}class jl extends Lt{constructor(e){super(),Ot(this,e,Ll,Bl,St,{routes:3,prefix:4,restoreScrollState:5})}}function Tr(n,e,t){const o=n.slice();return o[5]=e[t],o}function zr(n){let e,t,o=n[5].icon+"",l,s,i,c,u,f;function m(){return n[3](n[5])}return{c(){e=x("button"),t=x("span"),l=F(),s=x("span"),s.textContent=`${n[5].label}`,i=F(),r(e,"class",c="w-full text-left px-4 py-2.5 flex items-center gap-3 text-sm transition-colors "+(n[0]===n[5].id?"bg-indigo-600 text-white":"text-gray-300 hover:bg-gray-800 hover:text-white"))},m(p,k){W(p,e,k),a(e,t),t.innerHTML=o,a(e,l),a(e,s),a(e,i),u||(f=ie(e,"click",m),u=!0)},p(p,k){n=p,k&1&&c!==(c="w-full text-left px-4 py-2.5 flex items-center gap-3 text-sm transition-colors "+(n[0]===n[5].id?"bg-indigo-600 text-white":"text-gray-300 hover:bg-gray-800 hover:text-white"))&&r(e,"class",c)},d(p){p&&H(e),u=!1,f()}}}function Fl(n){let e,t,o,l,s,i,c=Oe(n[1]),u=[];for(let f=0;f<c.length;f+=1)u[f]=zr(Tr(n,c,f));return{c(){e=x("aside"),t=x("div"),t.innerHTML=`<h1 class="text-lg font-bold flex items-center gap-2"><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</h1> <p class="text-xs text-gray-400 mt-1">Translation Manager</p>`,o=F(),l=x("nav");for(let f=0;f<u.length;f+=1)u[f].c();s=F(),i=x("div"),i.textContent="Loco v1.0",r(t,"class","p-4 border-b border-gray-700"),r(l,"class","flex-1 py-4"),r(i,"class","p-4 border-t border-gray-700 text-xs text-gray-500"),r(e,"class","w-56 bg-gray-900 text-white flex flex-col min-h-screen shrink-0")},m(f,m){W(f,e,m),a(e,t),a(e,o),a(e,l);for(let p=0;p<u.length;p+=1)u[p]&&u[p].m(l,null);a(e,s),a(e,i)},p(f,[m]){if(m&7){c=Oe(f[1]);let p;for(p=0;p<c.length;p+=1){const k=Tr(f,c,p);u[p]?u[p].p(k,m):(u[p]=zr(k),u[p].c(),u[p].m(l,null))}for(;p<u.length;p+=1)u[p].d(1);u.length=c.length}},i:je,o:je,d(f){f&&H(e),qe(u,f)}}}function Pl(n,e,t){let{currentView:o="translations"}=e;const l=al(),s=[{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:"settings",label:"Settings",icon:'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>'}];function i(u){l("navigate",u)}const c=u=>i(u.id);return n.$$set=u=>{"currentView"in u&&t(0,o=u.currentView)},[o,s,i,c]}class Rl extends Lt{constructor(e){super(),Ot(this,e,Pl,Fl,St,{currentView:0})}}function Br(n,e,t){const o=n.slice();return o[22]=e[t],o}function Ir(n){let e,t,o,l=n[3]===1?"":"s",s;return{c(){e=x("span"),t=Z(n[3]),o=Z(" slot"),s=Z(l),r(e,"class","pve-badge svelte-19itaxc")},m(i,c){W(i,e,c),a(e,t),a(e,o),a(e,s)},p(i,c){c&8&&ce(t,i[3]),c&8&&l!==(l=i[3]===1?"":"s")&&ce(s,l)},d(i){i&&H(e)}}}function Nl(n){let e,t,o=n[22].originalText+"",l,s,i,c,u,f,m,p,k;function d(){return n[13](n[22])}return{c(){e=x("span"),t=x("span"),l=Z(o),s=F(),i=x("button"),c=Z("×"),f=F(),r(t,"class","pve-chip-label svelte-19itaxc"),r(i,"class","pve-chip-remove svelte-19itaxc"),r(i,"type","button"),r(i,"title",u="Remove "+n[22].kind+" slot — restores original text"),r(e,"class",m="pve-chip pve-chip--"+n[22].kind+" svelte-19itaxc")},m(g,h){W(g,e,h),a(e,t),a(t,l),a(e,s),a(e,i),a(i,c),a(e,f),p||(k=ie(i,"click",d),p=!0)},p(g,h){n=g,h&1&&o!==(o=n[22].originalText+"")&&ce(l,o),h&1&&u!==(u="Remove "+n[22].kind+" slot — restores original text")&&r(i,"title",u),h&1&&m!==(m="pve-chip pve-chip--"+n[22].kind+" svelte-19itaxc")&&r(e,"class",m)},d(g){g&&H(e),p=!1,k()}}}function Dl(n){let e,t=n[22].text+"",o,l,s;function i(){return n[12](n[22])}return{c(){var c;e=x("span"),o=Z(t),r(e,"class","pve-text-seg svelte-19itaxc"),xr(e,"pve-text-seg--active",((c=n[1])==null?void 0:c.segId)===n[22].id)},m(c,u){W(c,e,u),a(e,o),l||(s=ie(e,"mouseup",i),l=!0)},p(c,u){var f;n=c,u&1&&t!==(t=n[22].text+"")&&ce(o,t),u&3&&xr(e,"pve-text-seg--active",((f=n[1])==null?void 0:f.segId)===n[22].id)},d(c){c&&H(e),l=!1,s()}}}function Or(n,e){let t,o;function l(c,u){return c[22].kind==="plain"?Dl:Nl}let s=l(e),i=s(e);return{key:n,first:null,c(){t=at(),i.c(),o=at(),this.first=t},m(c,u){W(c,t,u),i.m(c,u),W(c,o,u)},p(c,u){e=c,s===(s=l(e))&&i?i.p(e,u):(i.d(1),i=s(e),i&&(i.c(),i.m(o.parentNode,o)))},d(c){c&&(H(t),H(o)),i.d(c)}}}function Lr(n){let e,t,o,l,s=n[1].selectedText+"",i,c,u,f,m,p,k,d,g,h,y,v,w,S;return{c(){e=x("div"),t=x("span"),o=Z("Selected: "),l=x("code"),i=Z(s),c=F(),u=x("div"),f=x("button"),f.textContent="Text",m=F(),p=x("button"),p.textContent="Number",k=F(),d=x("button"),d.textContent="Decimal",g=F(),h=x("button"),h.textContent="Date",y=F(),v=x("button"),v.textContent="Cancel",r(l,"class","pve-sel-code svelte-19itaxc"),r(t,"class","pve-sel-preview svelte-19itaxc"),r(f,"type","button"),r(f,"class","pve-btn pve-btn-text svelte-19itaxc"),r(p,"type","button"),r(p,"class","pve-btn pve-btn-number svelte-19itaxc"),r(d,"type","button"),r(d,"class","pve-btn pve-btn-decimal svelte-19itaxc"),r(h,"type","button"),r(h,"class","pve-btn pve-btn-date svelte-19itaxc"),r(v,"type","button"),r(v,"class","pve-btn pve-btn-ghost svelte-19itaxc"),r(u,"class","pve-action-bar-btns svelte-19itaxc"),r(e,"class","pve-action-bar svelte-19itaxc")},m(C,A){W(C,e,A),a(e,t),a(t,o),a(t,l),a(l,i),a(e,c),a(e,u),a(u,f),a(u,m),a(u,p),a(u,k),a(u,d),a(u,g),a(u,h),a(u,y),a(u,v),w||(S=[ie(f,"click",n[14]),ie(p,"click",n[15]),ie(d,"click",n[16]),ie(h,"click",n[17]),ie(v,"click",n[7])],w=!0)},p(C,A){A&2&&s!==(s=C[1].selectedText+"")&&ce(i,s)},d(C){C&&H(e),w=!1,Ze(S)}}}function Ml(n){let e,t,o,l,s,i,c=[],u=new Map,f,m,p,k,d,g,h,y,v,w,S,C,A=n[3]>0&&Ir(n),B=Oe(n[0]);const I=z=>z[22].id;for(let z=0;z<B.length;z+=1){let j=Br(n,B,z),N=I(j);u.set(N,c[z]=Or(N,j))}let E=n[1]&&Lr(n);return{c(){e=x("div"),t=x("div"),o=x("span"),o.textContent="Phrase Slot Editor",l=F(),A&&A.c(),s=F(),i=x("div");for(let z=0;z<c.length;z+=1)c[z].c();f=F(),E&&E.c(),m=F(),p=x("div"),k=x("span"),k.textContent="Resulting key",d=F(),g=x("code"),h=Z(n[2]),y=F(),v=x("div"),w=x("button"),w.textContent="Save",r(o,"class","pve-title svelte-19itaxc"),r(t,"class","pve-header svelte-19itaxc"),r(i,"class","pve-canvas svelte-19itaxc"),r(k,"class","pve-preview-label svelte-19itaxc"),r(g,"class","pve-preview-code svelte-19itaxc"),r(p,"class","pve-preview svelte-19itaxc"),r(w,"type","button"),r(w,"class","pve-btn pve-btn-primary svelte-19itaxc"),r(v,"class","pve-footer svelte-19itaxc"),r(e,"class","pve svelte-19itaxc")},m(z,j){W(z,e,j),a(e,t),a(t,o),a(t,l),A&&A.m(t,null),a(e,s),a(e,i);for(let N=0;N<c.length;N+=1)c[N]&&c[N].m(i,null);a(e,f),E&&E.m(e,null),a(e,m),a(e,p),a(p,k),a(p,d),a(p,g),a(g,h),a(e,y),a(e,v),a(v,w),S||(C=ie(w,"click",n[8]),S=!0)},p(z,[j]){z[3]>0?A?A.p(z,j):(A=Ir(z),A.c(),A.m(t,null)):A&&(A.d(1),A=null),j&83&&(B=Oe(z[0]),c=er(c,j,I,1,z,B,u,i,$n,Or,null,Br)),z[1]?E?E.p(z,j):(E=Lr(z),E.c(),E.m(e,m)):E&&(E.d(1),E=null),j&4&&ce(h,z[2])},i:je,o:je,d(z){z&&H(e),A&&A.d();for(let j=0;j<c.length;j+=1)c[j].d();E&&E.d(),S=!1,C()}}}const Ul=/(\{\{(?:text|number|decimal|date):\d+\}\})/g,Zl=/^\{\{(text|number|decimal|date):(\d+)\}\}$/;function jr(n){return n.map(e=>e.text).join("")}function Fr(n){const e={text:0,number:0,decimal:0,date:0};return n.map(t=>{if(t.kind==="plain")return t;const o=e[t.kind]++;return{...t,slotIndex:o,text:`{{${t.kind}:${o}}}`}})}function Hl(n,e,t){let o,l,s=0;function i(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"id-"+Date.now().toString(36)+"-"+ ++s}let{phraseKey:c=""}=e,{varSlots:u=[]}=e,{onSave:f=()=>{}}=e;function m(E){const z={};for(const N of u){const T=N.type||"text";z[`${T}:${N.index}`]=N.originalText}return E.split(Ul).filter(N=>N!=="").map(N=>{const T=N.match(Zl);if(T){const D=T[1],b=parseInt(T[2],10);return{kind:D,id:i(),slotIndex:b,originalText:z[`${D}:${b}`]??N,text:N}}return{kind:"plain",id:i(),text:N}})}let p=m(c),k=null;function d(E){if(E.kind!=="plain")return;const z=window.getSelection(),j=z?z.toString():"";if(!j){t(1,k=null);return}const N=E.text.indexOf(j);if(N===-1){t(1,k=null);return}t(1,k={segId:E.id,start:N,end:N+j.length,selectedText:j})}function g(E){if(!k)return;const{segId:z,start:j,end:N,selectedText:T}=k,D=p.findIndex(ee=>ee.id===z);if(D===-1){t(1,k=null);return}const b=p[D],P=[];j>0&&P.push({kind:"plain",id:i(),text:b.text.slice(0,j)}),P.push({kind:E,id:i(),slotIndex:0,originalText:T,text:`{{${E}:0}}`}),N<b.text.length&&P.push({kind:"plain",id:i(),text:b.text.slice(N)}),t(0,p=Fr([...p.slice(0,D),...P,...p.slice(D+1)])),t(1,k=null)}function h(E){const z=p.map(j=>j.id===E&&j.kind!=="plain"?{kind:"plain",id:i(),text:j.originalText}:j);t(0,p=Fr(z))}function y(){var E;t(1,k=null),(E=window.getSelection())==null||E.removeAllRanges()}function v(){const E=jr(p),z=p.filter(j=>j.kind!=="plain").map(j=>({type:j.kind,index:j.slotIndex,originalText:j.originalText}));f(E,z)}const w=E=>d(E),S=E=>h(E.id),C=()=>g("text"),A=()=>g("number"),B=()=>g("decimal"),I=()=>g("date");return n.$$set=E=>{"phraseKey"in E&&t(9,c=E.phraseKey),"varSlots"in E&&t(10,u=E.varSlots),"onSave"in E&&t(11,f=E.onSave)},n.$$.update=()=>{n.$$.dirty&1&&t(3,o=p.filter(E=>E.kind!=="plain").length),n.$$.dirty&1&&t(2,l=jr(p))},[p,k,l,o,d,g,h,y,v,c,u,f,w,S,C,A,B,I]}class Wl extends Lt{constructor(e){super(),Ot(this,e,Hl,Ml,St,{phraseKey:9,varSlots:10,onSave:11})}}var En=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Tn(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ml={exports:{}};/*!
3
+
4
+ JSZip v3.10.1 - A JavaScript class for generating and reading zip files
5
+ <http://stuartk.com/jszip>
6
+
7
+ (c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
8
+ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
9
+
10
+ JSZip uses the library pako released under the MIT license :
11
+ https://github.com/nodeca/pako/blob/main/LICENSE
12
+ */(function(n,e){(function(t){n.exports=t()})(function(){return function t(o,l,s){function i(f,m){if(!l[f]){if(!o[f]){var p=typeof Tn=="function"&&Tn;if(!m&&p)return p(f,!0);if(c)return c(f,!0);var k=new Error("Cannot find module '"+f+"'");throw k.code="MODULE_NOT_FOUND",k}var d=l[f]={exports:{}};o[f][0].call(d.exports,function(g){var h=o[f][1][g];return i(h||g)},d,d.exports,t,o,l,s)}return l[f].exports}for(var c=typeof Tn=="function"&&Tn,u=0;u<s.length;u++)i(s[u]);return i}({1:[function(t,o,l){var s=t("./utils"),i=t("./support"),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";l.encode=function(u){for(var f,m,p,k,d,g,h,y=[],v=0,w=u.length,S=w,C=s.getTypeOf(u)!=="string";v<u.length;)S=w-v,p=C?(f=u[v++],m=v<w?u[v++]:0,v<w?u[v++]:0):(f=u.charCodeAt(v++),m=v<w?u.charCodeAt(v++):0,v<w?u.charCodeAt(v++):0),k=f>>2,d=(3&f)<<4|m>>4,g=1<S?(15&m)<<2|p>>6:64,h=2<S?63&p:64,y.push(c.charAt(k)+c.charAt(d)+c.charAt(g)+c.charAt(h));return y.join("")},l.decode=function(u){var f,m,p,k,d,g,h=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,S=3*(u=u.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(u.charAt(u.length-1)===c.charAt(64)&&S--,u.charAt(u.length-2)===c.charAt(64)&&S--,S%1!=0)throw new Error("Invalid base64 input, bad content length.");for(w=i.uint8array?new Uint8Array(0|S):new Array(0|S);h<u.length;)f=c.indexOf(u.charAt(h++))<<2|(k=c.indexOf(u.charAt(h++)))>>4,m=(15&k)<<4|(d=c.indexOf(u.charAt(h++)))>>2,p=(3&d)<<6|(g=c.indexOf(u.charAt(h++))),w[y++]=f,d!==64&&(w[y++]=m),g!==64&&(w[y++]=p);return w}},{"./support":30,"./utils":32}],2:[function(t,o,l){var s=t("./external"),i=t("./stream/DataWorker"),c=t("./stream/Crc32Probe"),u=t("./stream/DataLengthProbe");function f(m,p,k,d,g){this.compressedSize=m,this.uncompressedSize=p,this.crc32=k,this.compression=d,this.compressedContent=g}f.prototype={getContentWorker:function(){var m=new i(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("data_length")),p=this;return m.on("end",function(){if(this.streamInfo.data_length!==p.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),m},getCompressedWorker:function(){return new i(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},f.createWorkerFrom=function(m,p,k){return m.pipe(new c).pipe(new u("uncompressedSize")).pipe(p.compressWorker(k)).pipe(new u("compressedSize")).withStreamInfo("compression",p)},o.exports=f},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,o,l){var s=t("./stream/GenericWorker");l.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},l.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,o,l){var s=t("./utils"),i=function(){for(var c,u=[],f=0;f<256;f++){c=f;for(var m=0;m<8;m++)c=1&c?3988292384^c>>>1:c>>>1;u[f]=c}return u}();o.exports=function(c,u){return c!==void 0&&c.length?s.getTypeOf(c)!=="string"?function(f,m,p,k){var d=i,g=k+p;f^=-1;for(var h=k;h<g;h++)f=f>>>8^d[255&(f^m[h])];return-1^f}(0|u,c,c.length,0):function(f,m,p,k){var d=i,g=k+p;f^=-1;for(var h=k;h<g;h++)f=f>>>8^d[255&(f^m.charCodeAt(h))];return-1^f}(0|u,c,c.length,0):0}},{"./utils":32}],5:[function(t,o,l){l.base64=!1,l.binary=!1,l.dir=!1,l.createFolders=!0,l.date=null,l.compression=null,l.compressionOptions=null,l.comment=null,l.unixPermissions=null,l.dosPermissions=null},{}],6:[function(t,o,l){var s=null;s=typeof Promise<"u"?Promise:t("lie"),o.exports={Promise:s}},{lie:37}],7:[function(t,o,l){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=t("pako"),c=t("./utils"),u=t("./stream/GenericWorker"),f=s?"uint8array":"array";function m(p,k){u.call(this,"FlateWorker/"+p),this._pako=null,this._pakoAction=p,this._pakoOptions=k,this.meta={}}l.magic="\b\0",c.inherits(m,u),m.prototype.processChunk=function(p){this.meta=p.meta,this._pako===null&&this._createPako(),this._pako.push(c.transformTo(f,p.data),!1)},m.prototype.flush=function(){u.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},m.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this._pako=null},m.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var p=this;this._pako.onData=function(k){p.push({data:k,meta:p.meta})}},l.compressWorker=function(p){return new m("Deflate",p)},l.uncompressWorker=function(){return new m("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,o,l){function s(d,g){var h,y="";for(h=0;h<g;h++)y+=String.fromCharCode(255&d),d>>>=8;return y}function i(d,g,h,y,v,w){var S,C,A=d.file,B=d.compression,I=w!==f.utf8encode,E=c.transformTo("string",w(A.name)),z=c.transformTo("string",f.utf8encode(A.name)),j=A.comment,N=c.transformTo("string",w(j)),T=c.transformTo("string",f.utf8encode(j)),D=z.length!==A.name.length,b=T.length!==j.length,P="",ee="",K="",se=A.dir,J=A.date,he={crc32:0,compressedSize:0,uncompressedSize:0};g&&!h||(he.crc32=d.crc32,he.compressedSize=d.compressedSize,he.uncompressedSize=d.uncompressedSize);var U=0;g&&(U|=8),I||!D&&!b||(U|=2048);var R=0,Q=0;se&&(R|=16),v==="UNIX"?(Q=798,R|=function(Y,me){var pe=Y;return Y||(pe=me?16893:33204),(65535&pe)<<16}(A.unixPermissions,se)):(Q=20,R|=function(Y){return 63&(Y||0)}(A.dosPermissions)),S=J.getUTCHours(),S<<=6,S|=J.getUTCMinutes(),S<<=5,S|=J.getUTCSeconds()/2,C=J.getUTCFullYear()-1980,C<<=4,C|=J.getUTCMonth()+1,C<<=5,C|=J.getUTCDate(),D&&(ee=s(1,1)+s(m(E),4)+z,P+="up"+s(ee.length,2)+ee),b&&(K=s(1,1)+s(m(N),4)+T,P+="uc"+s(K.length,2)+K);var X="";return X+=`
13
+ \0`,X+=s(U,2),X+=B.magic,X+=s(S,2),X+=s(C,2),X+=s(he.crc32,4),X+=s(he.compressedSize,4),X+=s(he.uncompressedSize,4),X+=s(E.length,2),X+=s(P.length,2),{fileRecord:p.LOCAL_FILE_HEADER+X+E+P,dirRecord:p.CENTRAL_FILE_HEADER+s(Q,2)+X+s(N.length,2)+"\0\0\0\0"+s(R,4)+s(y,4)+E+P+N}}var c=t("../utils"),u=t("../stream/GenericWorker"),f=t("../utf8"),m=t("../crc32"),p=t("../signature");function k(d,g,h,y){u.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=g,this.zipPlatform=h,this.encodeFileName=y,this.streamFiles=d,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}c.inherits(k,u),k.prototype.push=function(d){var g=d.meta.percent||0,h=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(d):(this.bytesWritten+=d.data.length,u.prototype.push.call(this,{data:d.data,meta:{currentFile:this.currentFile,percent:h?(g+100*(h-y-1))/h:100}}))},k.prototype.openedSource=function(d){this.currentSourceOffset=this.bytesWritten,this.currentFile=d.file.name;var g=this.streamFiles&&!d.file.dir;if(g){var h=i(d,g,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:h.fileRecord,meta:{percent:0}})}else this.accumulate=!0},k.prototype.closedSource=function(d){this.accumulate=!1;var g=this.streamFiles&&!d.file.dir,h=i(d,g,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(h.dirRecord),g)this.push({data:function(y){return p.DATA_DESCRIPTOR+s(y.crc32,4)+s(y.compressedSize,4)+s(y.uncompressedSize,4)}(d),meta:{percent:100}});else for(this.push({data:h.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},k.prototype.flush=function(){for(var d=this.bytesWritten,g=0;g<this.dirRecords.length;g++)this.push({data:this.dirRecords[g],meta:{percent:100}});var h=this.bytesWritten-d,y=function(v,w,S,C,A){var B=c.transformTo("string",A(C));return p.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(v,2)+s(v,2)+s(w,4)+s(S,4)+s(B.length,2)+B}(this.dirRecords.length,h,d,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},k.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},k.prototype.registerPrevious=function(d){this._sources.push(d);var g=this;return d.on("data",function(h){g.processChunk(h)}),d.on("end",function(){g.closedSource(g.previous.streamInfo),g._sources.length?g.prepareNextSource():g.end()}),d.on("error",function(h){g.error(h)}),this},k.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))},k.prototype.error=function(d){var g=this._sources;if(!u.prototype.error.call(this,d))return!1;for(var h=0;h<g.length;h++)try{g[h].error(d)}catch{}return!0},k.prototype.lock=function(){u.prototype.lock.call(this);for(var d=this._sources,g=0;g<d.length;g++)d[g].lock()},o.exports=k},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,o,l){var s=t("../compressions"),i=t("./ZipFileWorker");l.generateWorker=function(c,u,f){var m=new i(u.streamFiles,f,u.platform,u.encodeFileName),p=0;try{c.forEach(function(k,d){p++;var g=function(w,S){var C=w||S,A=s[C];if(!A)throw new Error(C+" is not a valid compression method !");return A}(d.options.compression,u.compression),h=d.options.compressionOptions||u.compressionOptions||{},y=d.dir,v=d.date;d._compressWorker(g,h).withStreamInfo("file",{name:k,dir:y,date:v,comment:d.comment||"",unixPermissions:d.unixPermissions,dosPermissions:d.dosPermissions}).pipe(m)}),m.entriesCount=p}catch(k){m.error(k)}return m}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,o,l){function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var i=new s;for(var c in this)typeof this[c]!="function"&&(i[c]=this[c]);return i}}(s.prototype=t("./object")).loadAsync=t("./load"),s.support=t("./support"),s.defaults=t("./defaults"),s.version="3.10.1",s.loadAsync=function(i,c){return new s().loadAsync(i,c)},s.external=t("./external"),o.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,o,l){var s=t("./utils"),i=t("./external"),c=t("./utf8"),u=t("./zipEntries"),f=t("./stream/Crc32Probe"),m=t("./nodejsUtils");function p(k){return new i.Promise(function(d,g){var h=k.decompressed.getContentWorker().pipe(new f);h.on("error",function(y){g(y)}).on("end",function(){h.streamInfo.crc32!==k.decompressed.crc32?g(new Error("Corrupted zip : CRC32 mismatch")):d()}).resume()})}o.exports=function(k,d){var g=this;return d=s.extend(d||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:c.utf8decode}),m.isNode&&m.isStream(k)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",k,!0,d.optimizedBinaryString,d.base64).then(function(h){var y=new u(d);return y.load(h),y}).then(function(h){var y=[i.Promise.resolve(h)],v=h.files;if(d.checkCRC32)for(var w=0;w<v.length;w++)y.push(p(v[w]));return i.Promise.all(y)}).then(function(h){for(var y=h.shift(),v=y.files,w=0;w<v.length;w++){var S=v[w],C=S.fileNameStr,A=s.resolve(S.fileNameStr);g.file(A,S.decompressed,{binary:!0,optimizedBinaryString:!0,date:S.date,dir:S.dir,comment:S.fileCommentStr.length?S.fileCommentStr:null,unixPermissions:S.unixPermissions,dosPermissions:S.dosPermissions,createFolders:d.createFolders}),S.dir||(g.file(A).unsafeOriginalName=C)}return y.zipComment.length&&(g.comment=y.zipComment),g})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,o,l){var s=t("../utils"),i=t("../stream/GenericWorker");function c(u,f){i.call(this,"Nodejs stream input adapter for "+u),this._upstreamEnded=!1,this._bindStream(f)}s.inherits(c,i),c.prototype._bindStream=function(u){var f=this;(this._stream=u).pause(),u.on("data",function(m){f.push({data:m,meta:{percent:0}})}).on("error",function(m){f.isPaused?this.generatedError=m:f.error(m)}).on("end",function(){f.isPaused?f._upstreamEnded=!0:f.end()})},c.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},c.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},o.exports=c},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,o,l){var s=t("readable-stream").Readable;function i(c,u,f){s.call(this,u),this._helper=c;var m=this;c.on("data",function(p,k){m.push(p)||m._helper.pause(),f&&f(k)}).on("error",function(p){m.emit("error",p)}).on("end",function(){m.push(null)})}t("../utils").inherits(i,s),i.prototype._read=function(){this._helper.resume()},o.exports=i},{"../utils":32,"readable-stream":16}],14:[function(t,o,l){o.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,i){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,i);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,i)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var i=new Buffer(s);return i.fill(0),i},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(t,o,l){function s(A,B,I){var E,z=c.getTypeOf(B),j=c.extend(I||{},m);j.date=j.date||new Date,j.compression!==null&&(j.compression=j.compression.toUpperCase()),typeof j.unixPermissions=="string"&&(j.unixPermissions=parseInt(j.unixPermissions,8)),j.unixPermissions&&16384&j.unixPermissions&&(j.dir=!0),j.dosPermissions&&16&j.dosPermissions&&(j.dir=!0),j.dir&&(A=v(A)),j.createFolders&&(E=y(A))&&w.call(this,E,!0);var N=z==="string"&&j.binary===!1&&j.base64===!1;I&&I.binary!==void 0||(j.binary=!N),(B instanceof p&&B.uncompressedSize===0||j.dir||!B||B.length===0)&&(j.base64=!1,j.binary=!0,B="",j.compression="STORE",z="string");var T=null;T=B instanceof p||B instanceof u?B:g.isNode&&g.isStream(B)?new h(A,B):c.prepareContent(A,B,j.binary,j.optimizedBinaryString,j.base64);var D=new k(A,T,j);this.files[A]=D}var i=t("./utf8"),c=t("./utils"),u=t("./stream/GenericWorker"),f=t("./stream/StreamHelper"),m=t("./defaults"),p=t("./compressedObject"),k=t("./zipObject"),d=t("./generate"),g=t("./nodejsUtils"),h=t("./nodejs/NodejsStreamInputAdapter"),y=function(A){A.slice(-1)==="/"&&(A=A.substring(0,A.length-1));var B=A.lastIndexOf("/");return 0<B?A.substring(0,B):""},v=function(A){return A.slice(-1)!=="/"&&(A+="/"),A},w=function(A,B){return B=B!==void 0?B:m.createFolders,A=v(A),this.files[A]||s.call(this,A,null,{dir:!0,createFolders:B}),this.files[A]};function S(A){return Object.prototype.toString.call(A)==="[object RegExp]"}var C={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(A){var B,I,E;for(B in this.files)E=this.files[B],(I=B.slice(this.root.length,B.length))&&B.slice(0,this.root.length)===this.root&&A(I,E)},filter:function(A){var B=[];return this.forEach(function(I,E){A(I,E)&&B.push(E)}),B},file:function(A,B,I){if(arguments.length!==1)return A=this.root+A,s.call(this,A,B,I),this;if(S(A)){var E=A;return this.filter(function(j,N){return!N.dir&&E.test(j)})}var z=this.files[this.root+A];return z&&!z.dir?z:null},folder:function(A){if(!A)return this;if(S(A))return this.filter(function(z,j){return j.dir&&A.test(z)});var B=this.root+A,I=w.call(this,B),E=this.clone();return E.root=I.name,E},remove:function(A){A=this.root+A;var B=this.files[A];if(B||(A.slice(-1)!=="/"&&(A+="/"),B=this.files[A]),B&&!B.dir)delete this.files[A];else for(var I=this.filter(function(z,j){return j.name.slice(0,A.length)===A}),E=0;E<I.length;E++)delete this.files[I[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 B,I={};try{if((I=c.extend(A||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=I.type.toLowerCase(),I.compression=I.compression.toUpperCase(),I.type==="binarystring"&&(I.type="string"),!I.type)throw new Error("No output type specified.");c.checkSupport(I.type),I.platform!=="darwin"&&I.platform!=="freebsd"&&I.platform!=="linux"&&I.platform!=="sunos"||(I.platform="UNIX"),I.platform==="win32"&&(I.platform="DOS");var E=I.comment||this.comment||"";B=d.generateWorker(this,I,E)}catch(z){(B=new u("error")).error(z)}return new f(B,I.type||"string",I.mimeType)},generateAsync:function(A,B){return this.generateInternalStream(A).accumulate(B)},generateNodeStream:function(A,B){return(A=A||{}).type||(A.type="nodebuffer"),this.generateInternalStream(A).toNodejsStream(B)}};o.exports=C},{"./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(t,o,l){o.exports=t("stream")},{stream:void 0}],17:[function(t,o,l){var s=t("./DataReader");function i(c){s.call(this,c);for(var u=0;u<this.data.length;u++)c[u]=255&c[u]}t("../utils").inherits(i,s),i.prototype.byteAt=function(c){return this.data[this.zero+c]},i.prototype.lastIndexOfSignature=function(c){for(var u=c.charCodeAt(0),f=c.charCodeAt(1),m=c.charCodeAt(2),p=c.charCodeAt(3),k=this.length-4;0<=k;--k)if(this.data[k]===u&&this.data[k+1]===f&&this.data[k+2]===m&&this.data[k+3]===p)return k-this.zero;return-1},i.prototype.readAndCheckSignature=function(c){var u=c.charCodeAt(0),f=c.charCodeAt(1),m=c.charCodeAt(2),p=c.charCodeAt(3),k=this.readData(4);return u===k[0]&&f===k[1]&&m===k[2]&&p===k[3]},i.prototype.readData=function(c){if(this.checkOffset(c),c===0)return[];var u=this.data.slice(this.zero+this.index,this.zero+this.index+c);return this.index+=c,u},o.exports=i},{"../utils":32,"./DataReader":18}],18:[function(t,o,l){var s=t("../utils");function i(c){this.data=c,this.length=c.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(c){this.checkIndex(this.index+c)},checkIndex:function(c){if(this.length<this.zero+c||c<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+c+"). Corrupted zip ?")},setIndex:function(c){this.checkIndex(c),this.index=c},skip:function(c){this.setIndex(this.index+c)},byteAt:function(){},readInt:function(c){var u,f=0;for(this.checkOffset(c),u=this.index+c-1;u>=this.index;u--)f=(f<<8)+this.byteAt(u);return this.index+=c,f},readString:function(c){return s.transformTo("string",this.readData(c))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var c=this.readInt(4);return new Date(Date.UTC(1980+(c>>25&127),(c>>21&15)-1,c>>16&31,c>>11&31,c>>5&63,(31&c)<<1))}},o.exports=i},{"../utils":32}],19:[function(t,o,l){var s=t("./Uint8ArrayReader");function i(c){s.call(this,c)}t("../utils").inherits(i,s),i.prototype.readData=function(c){this.checkOffset(c);var u=this.data.slice(this.zero+this.index,this.zero+this.index+c);return this.index+=c,u},o.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,o,l){var s=t("./DataReader");function i(c){s.call(this,c)}t("../utils").inherits(i,s),i.prototype.byteAt=function(c){return this.data.charCodeAt(this.zero+c)},i.prototype.lastIndexOfSignature=function(c){return this.data.lastIndexOf(c)-this.zero},i.prototype.readAndCheckSignature=function(c){return c===this.readData(4)},i.prototype.readData=function(c){this.checkOffset(c);var u=this.data.slice(this.zero+this.index,this.zero+this.index+c);return this.index+=c,u},o.exports=i},{"../utils":32,"./DataReader":18}],21:[function(t,o,l){var s=t("./ArrayReader");function i(c){s.call(this,c)}t("../utils").inherits(i,s),i.prototype.readData=function(c){if(this.checkOffset(c),c===0)return new Uint8Array(0);var u=this.data.subarray(this.zero+this.index,this.zero+this.index+c);return this.index+=c,u},o.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(t,o,l){var s=t("../utils"),i=t("../support"),c=t("./ArrayReader"),u=t("./StringReader"),f=t("./NodeBufferReader"),m=t("./Uint8ArrayReader");o.exports=function(p){var k=s.getTypeOf(p);return s.checkSupport(k),k!=="string"||i.uint8array?k==="nodebuffer"?new f(p):i.uint8array?new m(s.transformTo("uint8array",p)):new c(s.transformTo("array",p)):new u(p)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,o,l){l.LOCAL_FILE_HEADER="PK",l.CENTRAL_FILE_HEADER="PK",l.CENTRAL_DIRECTORY_END="PK",l.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",l.ZIP64_CENTRAL_DIRECTORY_END="PK",l.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,o,l){var s=t("./GenericWorker"),i=t("../utils");function c(u){s.call(this,"ConvertWorker to "+u),this.destType=u}i.inherits(c,s),c.prototype.processChunk=function(u){this.push({data:i.transformTo(this.destType,u.data),meta:u.meta})},o.exports=c},{"../utils":32,"./GenericWorker":28}],25:[function(t,o,l){var s=t("./GenericWorker"),i=t("../crc32");function c(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(c,s),c.prototype.processChunk=function(u){this.streamInfo.crc32=i(u.data,this.streamInfo.crc32||0),this.push(u)},o.exports=c},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,o,l){var s=t("../utils"),i=t("./GenericWorker");function c(u){i.call(this,"DataLengthProbe for "+u),this.propName=u,this.withStreamInfo(u,0)}s.inherits(c,i),c.prototype.processChunk=function(u){if(u){var f=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=f+u.data.length}i.prototype.processChunk.call(this,u)},o.exports=c},{"../utils":32,"./GenericWorker":28}],27:[function(t,o,l){var s=t("../utils"),i=t("./GenericWorker");function c(u){i.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(m){f.dataIsReady=!0,f.data=m,f.max=m&&m.length||0,f.type=s.getTypeOf(m),f.isPaused||f._tickAndRepeat()},function(m){f.error(m)})}s.inherits(c,i),c.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},c.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},c.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},c.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}})},o.exports=c},{"../utils":32,"./GenericWorker":28}],28:[function(t,o,l){function s(i){this.name=i||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,c){return this._listeners[i].push(c),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,c){if(this._listeners[i])for(var u=0;u<this._listeners[i].length;u++)this._listeners[i][u].call(this,c)},pipe:function(i){return i.registerPrevious(this)},registerPrevious:function(i){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=i.streamInfo,this.mergeStreamInfo(),this.previous=i;var c=this;return i.on("data",function(u){c.processChunk(u)}),i.on("end",function(){c.end()}),i.on("error",function(u){c.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 i=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),i=!0),this.previous&&this.previous.resume(),!i},flush:function(){},processChunk:function(i){this.push(i)},withStreamInfo:function(i,c){return this.extraStreamInfo[i]=c,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var i in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,i)&&(this.streamInfo[i]=this.extraStreamInfo[i])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var i="Worker "+this.name;return this.previous?this.previous+" -> "+i:i}},o.exports=s},{}],29:[function(t,o,l){var s=t("../utils"),i=t("./ConvertWorker"),c=t("./GenericWorker"),u=t("../base64"),f=t("../support"),m=t("../external"),p=null;if(f.nodestream)try{p=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function k(g,h){return new m.Promise(function(y,v){var w=[],S=g._internalType,C=g._outputType,A=g._mimeType;g.on("data",function(B,I){w.push(B),h&&h(I)}).on("error",function(B){w=[],v(B)}).on("end",function(){try{var B=function(I,E,z){switch(I){case"blob":return s.newBlob(s.transformTo("arraybuffer",E),z);case"base64":return u.encode(E);default:return s.transformTo(I,E)}}(C,function(I,E){var z,j=0,N=null,T=0;for(z=0;z<E.length;z++)T+=E[z].length;switch(I){case"string":return E.join("");case"array":return Array.prototype.concat.apply([],E);case"uint8array":for(N=new Uint8Array(T),z=0;z<E.length;z++)N.set(E[z],j),j+=E[z].length;return N;case"nodebuffer":return Buffer.concat(E);default:throw new Error("concat : unsupported type '"+I+"'")}}(S,w),A);y(B)}catch(I){v(I)}w=[]}).resume()})}function d(g,h,y){var v=h;switch(h){case"blob":case"arraybuffer":v="uint8array";break;case"base64":v="string"}try{this._internalType=v,this._outputType=h,this._mimeType=y,s.checkSupport(v),this._worker=g.pipe(new i(v)),g.lock()}catch(w){this._worker=new c("error"),this._worker.error(w)}}d.prototype={accumulate:function(g){return k(this,g)},on:function(g,h){var y=this;return g==="data"?this._worker.on(g,function(v){h.call(y,v.data,v.meta)}):this._worker.on(g,function(){s.delay(h,arguments,y)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(g){if(s.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new p(this,{objectMode:this._outputType!=="nodebuffer"},g)}},o.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,o,l){if(l.base64=!0,l.array=!0,l.string=!0,l.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",l.nodebuffer=typeof Buffer<"u",l.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")l.blob=!1;else{var s=new ArrayBuffer(0);try{l.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(s),l.blob=i.getBlob("application/zip").size===0}catch{l.blob=!1}}}try{l.nodestream=!!t("readable-stream").Readable}catch{l.nodestream=!1}},{"readable-stream":16}],31:[function(t,o,l){for(var s=t("./utils"),i=t("./support"),c=t("./nodejsUtils"),u=t("./stream/GenericWorker"),f=new Array(256),m=0;m<256;m++)f[m]=252<=m?6:248<=m?5:240<=m?4:224<=m?3:192<=m?2:1;f[254]=f[254]=1;function p(){u.call(this,"utf-8 decode"),this.leftOver=null}function k(){u.call(this,"utf-8 encode")}l.utf8encode=function(d){return i.nodebuffer?c.newBufferFrom(d,"utf-8"):function(g){var h,y,v,w,S,C=g.length,A=0;for(w=0;w<C;w++)(64512&(y=g.charCodeAt(w)))==55296&&w+1<C&&(64512&(v=g.charCodeAt(w+1)))==56320&&(y=65536+(y-55296<<10)+(v-56320),w++),A+=y<128?1:y<2048?2:y<65536?3:4;for(h=i.uint8array?new Uint8Array(A):new Array(A),w=S=0;S<A;w++)(64512&(y=g.charCodeAt(w)))==55296&&w+1<C&&(64512&(v=g.charCodeAt(w+1)))==56320&&(y=65536+(y-55296<<10)+(v-56320),w++),y<128?h[S++]=y:(y<2048?h[S++]=192|y>>>6:(y<65536?h[S++]=224|y>>>12:(h[S++]=240|y>>>18,h[S++]=128|y>>>12&63),h[S++]=128|y>>>6&63),h[S++]=128|63&y);return h}(d)},l.utf8decode=function(d){return i.nodebuffer?s.transformTo("nodebuffer",d).toString("utf-8"):function(g){var h,y,v,w,S=g.length,C=new Array(2*S);for(h=y=0;h<S;)if((v=g[h++])<128)C[y++]=v;else if(4<(w=f[v]))C[y++]=65533,h+=w-1;else{for(v&=w===2?31:w===3?15:7;1<w&&h<S;)v=v<<6|63&g[h++],w--;1<w?C[y++]=65533:v<65536?C[y++]=v:(v-=65536,C[y++]=55296|v>>10&1023,C[y++]=56320|1023&v)}return C.length!==y&&(C.subarray?C=C.subarray(0,y):C.length=y),s.applyFromCharCode(C)}(d=s.transformTo(i.uint8array?"uint8array":"array",d))},s.inherits(p,u),p.prototype.processChunk=function(d){var g=s.transformTo(i.uint8array?"uint8array":"array",d.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var h=g;(g=new Uint8Array(h.length+this.leftOver.length)).set(this.leftOver,0),g.set(h,this.leftOver.length)}else g=this.leftOver.concat(g);this.leftOver=null}var y=function(w,S){var C;for((S=S||w.length)>w.length&&(S=w.length),C=S-1;0<=C&&(192&w[C])==128;)C--;return C<0||C===0?S:C+f[w[C]]>S?C:S}(g),v=g;y!==g.length&&(i.uint8array?(v=g.subarray(0,y),this.leftOver=g.subarray(y,g.length)):(v=g.slice(0,y),this.leftOver=g.slice(y,g.length))),this.push({data:l.utf8decode(v),meta:d.meta})},p.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:l.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},l.Utf8DecodeWorker=p,s.inherits(k,u),k.prototype.processChunk=function(d){this.push({data:l.utf8encode(d.data),meta:d.meta})},l.Utf8EncodeWorker=k},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,o,l){var s=t("./support"),i=t("./base64"),c=t("./nodejsUtils"),u=t("./external");function f(h){return h}function m(h,y){for(var v=0;v<h.length;++v)y[v]=255&h.charCodeAt(v);return y}t("setimmediate"),l.newBlob=function(h,y){l.checkSupport("blob");try{return new Blob([h],{type:y})}catch{try{var v=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return v.append(h),v.getBlob(y)}catch{throw new Error("Bug : can't construct the Blob.")}}};var p={stringifyByChunk:function(h,y,v){var w=[],S=0,C=h.length;if(C<=v)return String.fromCharCode.apply(null,h);for(;S<C;)y==="array"||y==="nodebuffer"?w.push(String.fromCharCode.apply(null,h.slice(S,Math.min(S+v,C)))):w.push(String.fromCharCode.apply(null,h.subarray(S,Math.min(S+v,C)))),S+=v;return w.join("")},stringifyByChar:function(h){for(var y="",v=0;v<h.length;v++)y+=String.fromCharCode(h[v]);return y},applyCanBeUsed:{uint8array:function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,c.allocBuffer(1)).length===1}catch{return!1}}()}};function k(h){var y=65536,v=l.getTypeOf(h),w=!0;if(v==="uint8array"?w=p.applyCanBeUsed.uint8array:v==="nodebuffer"&&(w=p.applyCanBeUsed.nodebuffer),w)for(;1<y;)try{return p.stringifyByChunk(h,v,y)}catch{y=Math.floor(y/2)}return p.stringifyByChar(h)}function d(h,y){for(var v=0;v<h.length;v++)y[v]=h[v];return y}l.applyFromCharCode=k;var g={};g.string={string:f,array:function(h){return m(h,new Array(h.length))},arraybuffer:function(h){return g.string.uint8array(h).buffer},uint8array:function(h){return m(h,new Uint8Array(h.length))},nodebuffer:function(h){return m(h,c.allocBuffer(h.length))}},g.array={string:k,array:f,arraybuffer:function(h){return new Uint8Array(h).buffer},uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return c.newBufferFrom(h)}},g.arraybuffer={string:function(h){return k(new Uint8Array(h))},array:function(h){return d(new Uint8Array(h),new Array(h.byteLength))},arraybuffer:f,uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return c.newBufferFrom(new Uint8Array(h))}},g.uint8array={string:k,array:function(h){return d(h,new Array(h.length))},arraybuffer:function(h){return h.buffer},uint8array:f,nodebuffer:function(h){return c.newBufferFrom(h)}},g.nodebuffer={string:k,array:function(h){return d(h,new Array(h.length))},arraybuffer:function(h){return g.nodebuffer.uint8array(h).buffer},uint8array:function(h){return d(h,new Uint8Array(h.length))},nodebuffer:f},l.transformTo=function(h,y){if(y=y||"",!h)return y;l.checkSupport(h);var v=l.getTypeOf(y);return g[v][h](y)},l.resolve=function(h){for(var y=h.split("/"),v=[],w=0;w<y.length;w++){var S=y[w];S==="."||S===""&&w!==0&&w!==y.length-1||(S===".."?v.pop():v.push(S))}return v.join("/")},l.getTypeOf=function(h){return typeof h=="string"?"string":Object.prototype.toString.call(h)==="[object Array]"?"array":s.nodebuffer&&c.isBuffer(h)?"nodebuffer":s.uint8array&&h instanceof Uint8Array?"uint8array":s.arraybuffer&&h instanceof ArrayBuffer?"arraybuffer":void 0},l.checkSupport=function(h){if(!s[h.toLowerCase()])throw new Error(h+" is not supported by this platform")},l.MAX_VALUE_16BITS=65535,l.MAX_VALUE_32BITS=-1,l.pretty=function(h){var y,v,w="";for(v=0;v<(h||"").length;v++)w+="\\x"+((y=h.charCodeAt(v))<16?"0":"")+y.toString(16).toUpperCase();return w},l.delay=function(h,y,v){setImmediate(function(){h.apply(v||null,y||[])})},l.inherits=function(h,y){function v(){}v.prototype=y.prototype,h.prototype=new v},l.extend=function(){var h,y,v={};for(h=0;h<arguments.length;h++)for(y in arguments[h])Object.prototype.hasOwnProperty.call(arguments[h],y)&&v[y]===void 0&&(v[y]=arguments[h][y]);return v},l.prepareContent=function(h,y,v,w,S){return u.Promise.resolve(y).then(function(C){return s.blob&&(C instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(C))!==-1)&&typeof FileReader<"u"?new u.Promise(function(A,B){var I=new FileReader;I.onload=function(E){A(E.target.result)},I.onerror=function(E){B(E.target.error)},I.readAsArrayBuffer(C)}):C}).then(function(C){var A=l.getTypeOf(C);return A?(A==="arraybuffer"?C=l.transformTo("uint8array",C):A==="string"&&(S?C=i.decode(C):v&&w!==!0&&(C=function(B){return m(B,s.uint8array?new Uint8Array(B.length):new Array(B.length))}(C))),C):u.Promise.reject(new Error("Can't read the data of '"+h+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,o,l){var s=t("./reader/readerFor"),i=t("./utils"),c=t("./signature"),u=t("./zipEntry"),f=t("./support");function m(p){this.files=[],this.loadOptions=p}m.prototype={checkSignature:function(p){if(!this.reader.readAndCheckSignature(p)){this.reader.index-=4;var k=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(k)+", expected "+i.pretty(p)+")")}},isSignature:function(p,k){var d=this.reader.index;this.reader.setIndex(p);var g=this.reader.readString(4)===k;return this.reader.setIndex(d),g},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 p=this.reader.readData(this.zipCommentLength),k=f.uint8array?"uint8array":"array",d=i.transformTo(k,p);this.zipComment=this.loadOptions.decodeFileName(d)},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 p,k,d,g=this.zip64EndOfCentralSize-44;0<g;)p=this.reader.readInt(2),k=this.reader.readInt(4),d=this.reader.readData(k),this.zip64ExtensibleData[p]={id:p,length:k,value:d}},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 p,k;for(p=0;p<this.files.length;p++)k=this.files[p],this.reader.setIndex(k.localHeaderOffset),this.checkSignature(c.LOCAL_FILE_HEADER),k.readLocalPart(this.reader),k.handleUTF8(),k.processAttributes()},readCentralDir:function(){var p;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(c.CENTRAL_FILE_HEADER);)(p=new u({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(p);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 p=this.reader.lastIndexOfSignature(c.CENTRAL_DIRECTORY_END);if(p<0)throw this.isSignature(0,c.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(p);var k=p;if(this.checkSignature(c.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(p=this.reader.lastIndexOfSignature(c.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(p),this.checkSignature(c.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,c.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(c.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(c.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var d=this.centralDirOffset+this.centralDirSize;this.zip64&&(d+=20,d+=12+this.zip64EndOfCentralSize);var g=k-d;if(0<g)this.isSignature(k,c.CENTRAL_FILE_HEADER)||(this.reader.zero=g);else if(g<0)throw new Error("Corrupted zip: missing "+Math.abs(g)+" bytes.")},prepareReader:function(p){this.reader=s(p)},load:function(p){this.prepareReader(p),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},o.exports=m},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,o,l){var s=t("./reader/readerFor"),i=t("./utils"),c=t("./compressedObject"),u=t("./crc32"),f=t("./utf8"),m=t("./compressions"),p=t("./support");function k(d,g){this.options=d,this.loadOptions=g}k.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(d){var g,h;if(d.skip(22),this.fileNameLength=d.readInt(2),h=d.readInt(2),this.fileName=d.readData(this.fileNameLength),d.skip(h),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((g=function(y){for(var v in m)if(Object.prototype.hasOwnProperty.call(m,v)&&m[v].magic===y)return m[v];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new c(this.compressedSize,this.uncompressedSize,this.crc32,g,d.readData(this.compressedSize))},readCentralPart:function(d){this.versionMadeBy=d.readInt(2),d.skip(2),this.bitFlag=d.readInt(2),this.compressionMethod=d.readString(2),this.date=d.readDate(),this.crc32=d.readInt(4),this.compressedSize=d.readInt(4),this.uncompressedSize=d.readInt(4);var g=d.readInt(2);if(this.extraFieldsLength=d.readInt(2),this.fileCommentLength=d.readInt(2),this.diskNumberStart=d.readInt(2),this.internalFileAttributes=d.readInt(2),this.externalFileAttributes=d.readInt(4),this.localHeaderOffset=d.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");d.skip(g),this.readExtraFields(d),this.parseZIP64ExtraField(d),this.fileComment=d.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var d=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),d==0&&(this.dosPermissions=63&this.externalFileAttributes),d==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var d=s(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=d.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=d.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=d.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=d.readInt(4))}},readExtraFields:function(d){var g,h,y,v=d.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});d.index+4<v;)g=d.readInt(2),h=d.readInt(2),y=d.readData(h),this.extraFields[g]={id:g,length:h,value:y};d.setIndex(v)},handleUTF8:function(){var d=p.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=f.utf8decode(this.fileName),this.fileCommentStr=f.utf8decode(this.fileComment);else{var g=this.findExtraFieldUnicodePath();if(g!==null)this.fileNameStr=g;else{var h=i.transformTo(d,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(h)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var v=i.transformTo(d,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(v)}}},findExtraFieldUnicodePath:function(){var d=this.extraFields[28789];if(d){var g=s(d.value);return g.readInt(1)!==1||u(this.fileName)!==g.readInt(4)?null:f.utf8decode(g.readData(d.length-5))}return null},findExtraFieldUnicodeComment:function(){var d=this.extraFields[25461];if(d){var g=s(d.value);return g.readInt(1)!==1||u(this.fileComment)!==g.readInt(4)?null:f.utf8decode(g.readData(d.length-5))}return null}},o.exports=k},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,o,l){function s(g,h,y){this.name=g,this.dir=y.dir,this.date=y.date,this.comment=y.comment,this.unixPermissions=y.unixPermissions,this.dosPermissions=y.dosPermissions,this._data=h,this._dataBinary=y.binary,this.options={compression:y.compression,compressionOptions:y.compressionOptions}}var i=t("./stream/StreamHelper"),c=t("./stream/DataWorker"),u=t("./utf8"),f=t("./compressedObject"),m=t("./stream/GenericWorker");s.prototype={internalStream:function(g){var h=null,y="string";try{if(!g)throw new Error("No output type specified.");var v=(y=g.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),h=this._decompressWorker();var w=!this._dataBinary;w&&!v&&(h=h.pipe(new u.Utf8EncodeWorker)),!w&&v&&(h=h.pipe(new u.Utf8DecodeWorker))}catch(S){(h=new m("error")).error(S)}return new i(h,y,"")},async:function(g,h){return this.internalStream(g).accumulate(h)},nodeStream:function(g,h){return this.internalStream(g||"nodebuffer").toNodejsStream(h)},_compressWorker:function(g,h){if(this._data instanceof f&&this._data.compression.magic===g.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new u.Utf8EncodeWorker)),f.createWorkerFrom(y,g,h)},_decompressWorker:function(){return this._data instanceof f?this._data.getContentWorker():this._data instanceof m?this._data:new c(this._data)}};for(var p=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],k=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},d=0;d<p.length;d++)s.prototype[p[d]]=k;o.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,o,l){(function(s){var i,c,u=s.MutationObserver||s.WebKitMutationObserver;if(u){var f=0,m=new u(g),p=s.document.createTextNode("");m.observe(p,{characterData:!0}),i=function(){p.data=f=++f%2}}else if(s.setImmediate||s.MessageChannel===void 0)i="document"in s&&"onreadystatechange"in s.document.createElement("script")?function(){var h=s.document.createElement("script");h.onreadystatechange=function(){g(),h.onreadystatechange=null,h.parentNode.removeChild(h),h=null},s.document.documentElement.appendChild(h)}:function(){setTimeout(g,0)};else{var k=new s.MessageChannel;k.port1.onmessage=g,i=function(){k.port2.postMessage(0)}}var d=[];function g(){var h,y;c=!0;for(var v=d.length;v;){for(y=d,d=[],h=-1;++h<v;)y[h]();v=d.length}c=!1}o.exports=function(h){d.push(h)!==1||c||i()}}).call(this,typeof En<"u"?En:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(t,o,l){var s=t("immediate");function i(){}var c={},u=["REJECTED"],f=["FULFILLED"],m=["PENDING"];function p(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=m,this.queue=[],this.outcome=void 0,v!==i&&h(this,v)}function k(v,w,S){this.promise=v,typeof w=="function"&&(this.onFulfilled=w,this.callFulfilled=this.otherCallFulfilled),typeof S=="function"&&(this.onRejected=S,this.callRejected=this.otherCallRejected)}function d(v,w,S){s(function(){var C;try{C=w(S)}catch(A){return c.reject(v,A)}C===v?c.reject(v,new TypeError("Cannot resolve promise with itself")):c.resolve(v,C)})}function g(v){var w=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof w=="function")return function(){w.apply(v,arguments)}}function h(v,w){var S=!1;function C(I){S||(S=!0,c.reject(v,I))}function A(I){S||(S=!0,c.resolve(v,I))}var B=y(function(){w(A,C)});B.status==="error"&&C(B.value)}function y(v,w){var S={};try{S.value=v(w),S.status="success"}catch(C){S.status="error",S.value=C}return S}(o.exports=p).prototype.finally=function(v){if(typeof v!="function")return this;var w=this.constructor;return this.then(function(S){return w.resolve(v()).then(function(){return S})},function(S){return w.resolve(v()).then(function(){throw S})})},p.prototype.catch=function(v){return this.then(null,v)},p.prototype.then=function(v,w){if(typeof v!="function"&&this.state===f||typeof w!="function"&&this.state===u)return this;var S=new this.constructor(i);return this.state!==m?d(S,this.state===f?v:w,this.outcome):this.queue.push(new k(S,v,w)),S},k.prototype.callFulfilled=function(v){c.resolve(this.promise,v)},k.prototype.otherCallFulfilled=function(v){d(this.promise,this.onFulfilled,v)},k.prototype.callRejected=function(v){c.reject(this.promise,v)},k.prototype.otherCallRejected=function(v){d(this.promise,this.onRejected,v)},c.resolve=function(v,w){var S=y(g,w);if(S.status==="error")return c.reject(v,S.value);var C=S.value;if(C)h(v,C);else{v.state=f,v.outcome=w;for(var A=-1,B=v.queue.length;++A<B;)v.queue[A].callFulfilled(w)}return v},c.reject=function(v,w){v.state=u,v.outcome=w;for(var S=-1,C=v.queue.length;++S<C;)v.queue[S].callRejected(w);return v},p.resolve=function(v){return v instanceof this?v:c.resolve(new this(i),v)},p.reject=function(v){var w=new this(i);return c.reject(w,v)},p.all=function(v){var w=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var S=v.length,C=!1;if(!S)return this.resolve([]);for(var A=new Array(S),B=0,I=-1,E=new this(i);++I<S;)z(v[I],I);return E;function z(j,N){w.resolve(j).then(function(T){A[N]=T,++B!==S||C||(C=!0,c.resolve(E,A))},function(T){C||(C=!0,c.reject(E,T))})}},p.race=function(v){var w=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var S=v.length,C=!1;if(!S)return this.resolve([]);for(var A=-1,B=new this(i);++A<S;)I=v[A],w.resolve(I).then(function(E){C||(C=!0,c.resolve(B,E))},function(E){C||(C=!0,c.reject(B,E))});var I;return B}},{immediate:36}],38:[function(t,o,l){var s={};(0,t("./lib/utils/common").assign)(s,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),o.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,o,l){var s=t("./zlib/deflate"),i=t("./utils/common"),c=t("./utils/strings"),u=t("./zlib/messages"),f=t("./zlib/zstream"),m=Object.prototype.toString,p=0,k=-1,d=0,g=8;function h(v){if(!(this instanceof h))return new h(v);this.options=i.assign({level:k,method:g,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,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 S=s.deflateInit2(this.strm,w.level,w.method,w.windowBits,w.memLevel,w.strategy);if(S!==p)throw new Error(u[S]);if(w.header&&s.deflateSetHeader(this.strm,w.header),w.dictionary){var C;if(C=typeof w.dictionary=="string"?c.string2buf(w.dictionary):m.call(w.dictionary)==="[object ArrayBuffer]"?new Uint8Array(w.dictionary):w.dictionary,(S=s.deflateSetDictionary(this.strm,C))!==p)throw new Error(u[S]);this._dict_set=!0}}function y(v,w){var S=new h(w);if(S.push(v,!0),S.err)throw S.msg||u[S.err];return S.result}h.prototype.push=function(v,w){var S,C,A=this.strm,B=this.options.chunkSize;if(this.ended)return!1;C=w===~~w?w:w===!0?4:0,typeof v=="string"?A.input=c.string2buf(v):m.call(v)==="[object ArrayBuffer]"?A.input=new Uint8Array(v):A.input=v,A.next_in=0,A.avail_in=A.input.length;do{if(A.avail_out===0&&(A.output=new i.Buf8(B),A.next_out=0,A.avail_out=B),(S=s.deflate(A,C))!==1&&S!==p)return this.onEnd(S),!(this.ended=!0);A.avail_out!==0&&(A.avail_in!==0||C!==4&&C!==2)||(this.options.to==="string"?this.onData(c.buf2binstring(i.shrinkBuf(A.output,A.next_out))):this.onData(i.shrinkBuf(A.output,A.next_out)))}while((0<A.avail_in||A.avail_out===0)&&S!==1);return C===4?(S=s.deflateEnd(this.strm),this.onEnd(S),this.ended=!0,S===p):C!==2||(this.onEnd(p),!(A.avail_out=0))},h.prototype.onData=function(v){this.chunks.push(v)},h.prototype.onEnd=function(v){v===p&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=v,this.msg=this.strm.msg},l.Deflate=h,l.deflate=y,l.deflateRaw=function(v,w){return(w=w||{}).raw=!0,y(v,w)},l.gzip=function(v,w){return(w=w||{}).gzip=!0,y(v,w)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,o,l){var s=t("./zlib/inflate"),i=t("./utils/common"),c=t("./utils/strings"),u=t("./zlib/constants"),f=t("./zlib/messages"),m=t("./zlib/zstream"),p=t("./zlib/gzheader"),k=Object.prototype.toString;function d(h){if(!(this instanceof d))return new d(h);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},h||{});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)||h&&h.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 m,this.strm.avail_out=0;var v=s.inflateInit2(this.strm,y.windowBits);if(v!==u.Z_OK)throw new Error(f[v]);this.header=new p,s.inflateGetHeader(this.strm,this.header)}function g(h,y){var v=new d(y);if(v.push(h,!0),v.err)throw v.msg||f[v.err];return v.result}d.prototype.push=function(h,y){var v,w,S,C,A,B,I=this.strm,E=this.options.chunkSize,z=this.options.dictionary,j=!1;if(this.ended)return!1;w=y===~~y?y:y===!0?u.Z_FINISH:u.Z_NO_FLUSH,typeof h=="string"?I.input=c.binstring2buf(h):k.call(h)==="[object ArrayBuffer]"?I.input=new Uint8Array(h):I.input=h,I.next_in=0,I.avail_in=I.input.length;do{if(I.avail_out===0&&(I.output=new i.Buf8(E),I.next_out=0,I.avail_out=E),(v=s.inflate(I,u.Z_NO_FLUSH))===u.Z_NEED_DICT&&z&&(B=typeof z=="string"?c.string2buf(z):k.call(z)==="[object ArrayBuffer]"?new Uint8Array(z):z,v=s.inflateSetDictionary(this.strm,B)),v===u.Z_BUF_ERROR&&j===!0&&(v=u.Z_OK,j=!1),v!==u.Z_STREAM_END&&v!==u.Z_OK)return this.onEnd(v),!(this.ended=!0);I.next_out&&(I.avail_out!==0&&v!==u.Z_STREAM_END&&(I.avail_in!==0||w!==u.Z_FINISH&&w!==u.Z_SYNC_FLUSH)||(this.options.to==="string"?(S=c.utf8border(I.output,I.next_out),C=I.next_out-S,A=c.buf2string(I.output,S),I.next_out=C,I.avail_out=E-C,C&&i.arraySet(I.output,I.output,S,C,0),this.onData(A)):this.onData(i.shrinkBuf(I.output,I.next_out)))),I.avail_in===0&&I.avail_out===0&&(j=!0)}while((0<I.avail_in||I.avail_out===0)&&v!==u.Z_STREAM_END);return v===u.Z_STREAM_END&&(w=u.Z_FINISH),w===u.Z_FINISH?(v=s.inflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===u.Z_OK):w!==u.Z_SYNC_FLUSH||(this.onEnd(u.Z_OK),!(I.avail_out=0))},d.prototype.onData=function(h){this.chunks.push(h)},d.prototype.onEnd=function(h){h===u.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=h,this.msg=this.strm.msg},l.Inflate=d,l.inflate=g,l.inflateRaw=function(h,y){return(y=y||{}).raw=!0,g(h,y)},l.ungzip=g},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,o,l){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";l.assign=function(u){for(var f=Array.prototype.slice.call(arguments,1);f.length;){var m=f.shift();if(m){if(typeof m!="object")throw new TypeError(m+"must be non-object");for(var p in m)m.hasOwnProperty(p)&&(u[p]=m[p])}}return u},l.shrinkBuf=function(u,f){return u.length===f?u:u.subarray?u.subarray(0,f):(u.length=f,u)};var i={arraySet:function(u,f,m,p,k){if(f.subarray&&u.subarray)u.set(f.subarray(m,m+p),k);else for(var d=0;d<p;d++)u[k+d]=f[m+d]},flattenChunks:function(u){var f,m,p,k,d,g;for(f=p=0,m=u.length;f<m;f++)p+=u[f].length;for(g=new Uint8Array(p),f=k=0,m=u.length;f<m;f++)d=u[f],g.set(d,k),k+=d.length;return g}},c={arraySet:function(u,f,m,p,k){for(var d=0;d<p;d++)u[k+d]=f[m+d]},flattenChunks:function(u){return[].concat.apply([],u)}};l.setTyped=function(u){u?(l.Buf8=Uint8Array,l.Buf16=Uint16Array,l.Buf32=Int32Array,l.assign(l,i)):(l.Buf8=Array,l.Buf16=Array,l.Buf32=Array,l.assign(l,c))},l.setTyped(s)},{}],42:[function(t,o,l){var s=t("./common"),i=!0,c=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{c=!1}for(var u=new s.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 m(p,k){if(k<65537&&(p.subarray&&c||!p.subarray&&i))return String.fromCharCode.apply(null,s.shrinkBuf(p,k));for(var d="",g=0;g<k;g++)d+=String.fromCharCode(p[g]);return d}u[254]=u[254]=1,l.string2buf=function(p){var k,d,g,h,y,v=p.length,w=0;for(h=0;h<v;h++)(64512&(d=p.charCodeAt(h)))==55296&&h+1<v&&(64512&(g=p.charCodeAt(h+1)))==56320&&(d=65536+(d-55296<<10)+(g-56320),h++),w+=d<128?1:d<2048?2:d<65536?3:4;for(k=new s.Buf8(w),h=y=0;y<w;h++)(64512&(d=p.charCodeAt(h)))==55296&&h+1<v&&(64512&(g=p.charCodeAt(h+1)))==56320&&(d=65536+(d-55296<<10)+(g-56320),h++),d<128?k[y++]=d:(d<2048?k[y++]=192|d>>>6:(d<65536?k[y++]=224|d>>>12:(k[y++]=240|d>>>18,k[y++]=128|d>>>12&63),k[y++]=128|d>>>6&63),k[y++]=128|63&d);return k},l.buf2binstring=function(p){return m(p,p.length)},l.binstring2buf=function(p){for(var k=new s.Buf8(p.length),d=0,g=k.length;d<g;d++)k[d]=p.charCodeAt(d);return k},l.buf2string=function(p,k){var d,g,h,y,v=k||p.length,w=new Array(2*v);for(d=g=0;d<v;)if((h=p[d++])<128)w[g++]=h;else if(4<(y=u[h]))w[g++]=65533,d+=y-1;else{for(h&=y===2?31:y===3?15:7;1<y&&d<v;)h=h<<6|63&p[d++],y--;1<y?w[g++]=65533:h<65536?w[g++]=h:(h-=65536,w[g++]=55296|h>>10&1023,w[g++]=56320|1023&h)}return m(w,g)},l.utf8border=function(p,k){var d;for((k=k||p.length)>p.length&&(k=p.length),d=k-1;0<=d&&(192&p[d])==128;)d--;return d<0||d===0?k:d+u[p[d]]>k?d:k}},{"./common":41}],43:[function(t,o,l){o.exports=function(s,i,c,u){for(var f=65535&s|0,m=s>>>16&65535|0,p=0;c!==0;){for(c-=p=2e3<c?2e3:c;m=m+(f=f+i[u++]|0)|0,--p;);f%=65521,m%=65521}return f|m<<16|0}},{}],44:[function(t,o,l){o.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(t,o,l){var s=function(){for(var i,c=[],u=0;u<256;u++){i=u;for(var f=0;f<8;f++)i=1&i?3988292384^i>>>1:i>>>1;c[u]=i}return c}();o.exports=function(i,c,u,f){var m=s,p=f+u;i^=-1;for(var k=f;k<p;k++)i=i>>>8^m[255&(i^c[k])];return-1^i}},{}],46:[function(t,o,l){var s,i=t("../utils/common"),c=t("./trees"),u=t("./adler32"),f=t("./crc32"),m=t("./messages"),p=0,k=4,d=0,g=-2,h=-1,y=4,v=2,w=8,S=9,C=286,A=30,B=19,I=2*C+1,E=15,z=3,j=258,N=j+z+1,T=42,D=113,b=1,P=2,ee=3,K=4;function se(_,q){return _.msg=m[q],q}function J(_){return(_<<1)-(4<_?9:0)}function he(_){for(var q=_.length;0<=--q;)_[q]=0}function U(_){var q=_.state,V=q.pending;V>_.avail_out&&(V=_.avail_out),V!==0&&(i.arraySet(_.output,q.pending_buf,q.pending_out,V,_.next_out),_.next_out+=V,q.pending_out+=V,_.total_out+=V,_.avail_out-=V,q.pending-=V,q.pending===0&&(q.pending_out=0))}function R(_,q){c._tr_flush_block(_,0<=_.block_start?_.block_start:-1,_.strstart-_.block_start,q),_.block_start=_.strstart,U(_.strm)}function Q(_,q){_.pending_buf[_.pending++]=q}function X(_,q){_.pending_buf[_.pending++]=q>>>8&255,_.pending_buf[_.pending++]=255&q}function Y(_,q){var V,L,O=_.max_chain_length,M=_.strstart,$=_.prev_length,te=_.nice_match,G=_.strstart>_.w_size-N?_.strstart-(_.w_size-N):0,ae=_.window,_e=_.w_mask,le=_.prev,ge=_.strstart+j,ze=ae[M+$-1],we=ae[M+$];_.prev_length>=_.good_match&&(O>>=2),te>_.lookahead&&(te=_.lookahead);do if(ae[(V=q)+$]===we&&ae[V+$-1]===ze&&ae[V]===ae[M]&&ae[++V]===ae[M+1]){M+=2,V++;do;while(ae[++M]===ae[++V]&&ae[++M]===ae[++V]&&ae[++M]===ae[++V]&&ae[++M]===ae[++V]&&ae[++M]===ae[++V]&&ae[++M]===ae[++V]&&ae[++M]===ae[++V]&&ae[++M]===ae[++V]&&M<ge);if(L=j-(ge-M),M=ge-j,$<L){if(_.match_start=q,te<=($=L))break;ze=ae[M+$-1],we=ae[M+$]}}while((q=le[q&_e])>G&&--O!=0);return $<=_.lookahead?$:_.lookahead}function me(_){var q,V,L,O,M,$,te,G,ae,_e,le=_.w_size;do{if(O=_.window_size-_.lookahead-_.strstart,_.strstart>=le+(le-N)){for(i.arraySet(_.window,_.window,le,le,0),_.match_start-=le,_.strstart-=le,_.block_start-=le,q=V=_.hash_size;L=_.head[--q],_.head[q]=le<=L?L-le:0,--V;);for(q=V=le;L=_.prev[--q],_.prev[q]=le<=L?L-le:0,--V;);O+=le}if(_.strm.avail_in===0)break;if($=_.strm,te=_.window,G=_.strstart+_.lookahead,ae=O,_e=void 0,_e=$.avail_in,ae<_e&&(_e=ae),V=_e===0?0:($.avail_in-=_e,i.arraySet(te,$.input,$.next_in,_e,G),$.state.wrap===1?$.adler=u($.adler,te,_e,G):$.state.wrap===2&&($.adler=f($.adler,te,_e,G)),$.next_in+=_e,$.total_in+=_e,_e),_.lookahead+=V,_.lookahead+_.insert>=z)for(M=_.strstart-_.insert,_.ins_h=_.window[M],_.ins_h=(_.ins_h<<_.hash_shift^_.window[M+1])&_.hash_mask;_.insert&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[M+z-1])&_.hash_mask,_.prev[M&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=M,M++,_.insert--,!(_.lookahead+_.insert<z)););}while(_.lookahead<N&&_.strm.avail_in!==0)}function pe(_,q){for(var V,L;;){if(_.lookahead<N){if(me(_),_.lookahead<N&&q===p)return b;if(_.lookahead===0)break}if(V=0,_.lookahead>=z&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+z-1])&_.hash_mask,V=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),V!==0&&_.strstart-V<=_.w_size-N&&(_.match_length=Y(_,V)),_.match_length>=z)if(L=c._tr_tally(_,_.strstart-_.match_start,_.match_length-z),_.lookahead-=_.match_length,_.match_length<=_.max_lazy_match&&_.lookahead>=z){for(_.match_length--;_.strstart++,_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+z-1])&_.hash_mask,V=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart,--_.match_length!=0;);_.strstart++}else _.strstart+=_.match_length,_.match_length=0,_.ins_h=_.window[_.strstart],_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+1])&_.hash_mask;else L=c._tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++;if(L&&(R(_,!1),_.strm.avail_out===0))return b}return _.insert=_.strstart<z-1?_.strstart:z-1,q===k?(R(_,!0),_.strm.avail_out===0?ee:K):_.last_lit&&(R(_,!1),_.strm.avail_out===0)?b:P}function ve(_,q){for(var V,L,O;;){if(_.lookahead<N){if(me(_),_.lookahead<N&&q===p)return b;if(_.lookahead===0)break}if(V=0,_.lookahead>=z&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+z-1])&_.hash_mask,V=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),_.prev_length=_.match_length,_.prev_match=_.match_start,_.match_length=z-1,V!==0&&_.prev_length<_.max_lazy_match&&_.strstart-V<=_.w_size-N&&(_.match_length=Y(_,V),_.match_length<=5&&(_.strategy===1||_.match_length===z&&4096<_.strstart-_.match_start)&&(_.match_length=z-1)),_.prev_length>=z&&_.match_length<=_.prev_length){for(O=_.strstart+_.lookahead-z,L=c._tr_tally(_,_.strstart-1-_.prev_match,_.prev_length-z),_.lookahead-=_.prev_length-1,_.prev_length-=2;++_.strstart<=O&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+z-1])&_.hash_mask,V=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),--_.prev_length!=0;);if(_.match_available=0,_.match_length=z-1,_.strstart++,L&&(R(_,!1),_.strm.avail_out===0))return b}else if(_.match_available){if((L=c._tr_tally(_,0,_.window[_.strstart-1]))&&R(_,!1),_.strstart++,_.lookahead--,_.strm.avail_out===0)return b}else _.match_available=1,_.strstart++,_.lookahead--}return _.match_available&&(L=c._tr_tally(_,0,_.window[_.strstart-1]),_.match_available=0),_.insert=_.strstart<z-1?_.strstart:z-1,q===k?(R(_,!0),_.strm.avail_out===0?ee:K):_.last_lit&&(R(_,!1),_.strm.avail_out===0)?b:P}function be(_,q,V,L,O){this.good_length=_,this.max_lazy=q,this.nice_length=V,this.max_chain=L,this.func=O}function Be(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=w,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*I),this.dyn_dtree=new i.Buf16(2*(2*A+1)),this.bl_tree=new i.Buf16(2*(2*B+1)),he(this.dyn_ltree),he(this.dyn_dtree),he(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(E+1),this.heap=new i.Buf16(2*C+1),he(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*C+1),he(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 ke(_){var q;return _&&_.state?(_.total_in=_.total_out=0,_.data_type=v,(q=_.state).pending=0,q.pending_out=0,q.wrap<0&&(q.wrap=-q.wrap),q.status=q.wrap?T:D,_.adler=q.wrap===2?0:1,q.last_flush=p,c._tr_init(q),d):se(_,g)}function oe(_){var q=ke(_);return q===d&&function(V){V.window_size=2*V.w_size,he(V.head),V.max_lazy_match=s[V.level].max_lazy,V.good_match=s[V.level].good_length,V.nice_match=s[V.level].nice_length,V.max_chain_length=s[V.level].max_chain,V.strstart=0,V.block_start=0,V.lookahead=0,V.insert=0,V.match_length=V.prev_length=z-1,V.match_available=0,V.ins_h=0}(_.state),q}function xe(_,q,V,L,O,M){if(!_)return g;var $=1;if(q===h&&(q=6),L<0?($=0,L=-L):15<L&&($=2,L-=16),O<1||S<O||V!==w||L<8||15<L||q<0||9<q||M<0||y<M)return se(_,g);L===8&&(L=9);var te=new Be;return(_.state=te).strm=_,te.wrap=$,te.gzhead=null,te.w_bits=L,te.w_size=1<<te.w_bits,te.w_mask=te.w_size-1,te.hash_bits=O+7,te.hash_size=1<<te.hash_bits,te.hash_mask=te.hash_size-1,te.hash_shift=~~((te.hash_bits+z-1)/z),te.window=new i.Buf8(2*te.w_size),te.head=new i.Buf16(te.hash_size),te.prev=new i.Buf16(te.w_size),te.lit_bufsize=1<<O+6,te.pending_buf_size=4*te.lit_bufsize,te.pending_buf=new i.Buf8(te.pending_buf_size),te.d_buf=1*te.lit_bufsize,te.l_buf=3*te.lit_bufsize,te.level=q,te.strategy=M,te.method=V,oe(_)}s=[new be(0,0,0,0,function(_,q){var V=65535;for(V>_.pending_buf_size-5&&(V=_.pending_buf_size-5);;){if(_.lookahead<=1){if(me(_),_.lookahead===0&&q===p)return b;if(_.lookahead===0)break}_.strstart+=_.lookahead,_.lookahead=0;var L=_.block_start+V;if((_.strstart===0||_.strstart>=L)&&(_.lookahead=_.strstart-L,_.strstart=L,R(_,!1),_.strm.avail_out===0)||_.strstart-_.block_start>=_.w_size-N&&(R(_,!1),_.strm.avail_out===0))return b}return _.insert=0,q===k?(R(_,!0),_.strm.avail_out===0?ee:K):(_.strstart>_.block_start&&(R(_,!1),_.strm.avail_out),b)}),new be(4,4,8,4,pe),new be(4,5,16,8,pe),new be(4,6,32,32,pe),new be(4,4,16,16,ve),new be(8,16,32,32,ve),new be(8,16,128,128,ve),new be(8,32,128,256,ve),new be(32,128,258,1024,ve),new be(32,258,258,4096,ve)],l.deflateInit=function(_,q){return xe(_,q,w,15,8,0)},l.deflateInit2=xe,l.deflateReset=oe,l.deflateResetKeep=ke,l.deflateSetHeader=function(_,q){return _&&_.state?_.state.wrap!==2?g:(_.state.gzhead=q,d):g},l.deflate=function(_,q){var V,L,O,M;if(!_||!_.state||5<q||q<0)return _?se(_,g):g;if(L=_.state,!_.output||!_.input&&_.avail_in!==0||L.status===666&&q!==k)return se(_,_.avail_out===0?-5:g);if(L.strm=_,V=L.last_flush,L.last_flush=q,L.status===T)if(L.wrap===2)_.adler=0,Q(L,31),Q(L,139),Q(L,8),L.gzhead?(Q(L,(L.gzhead.text?1:0)+(L.gzhead.hcrc?2:0)+(L.gzhead.extra?4:0)+(L.gzhead.name?8:0)+(L.gzhead.comment?16:0)),Q(L,255&L.gzhead.time),Q(L,L.gzhead.time>>8&255),Q(L,L.gzhead.time>>16&255),Q(L,L.gzhead.time>>24&255),Q(L,L.level===9?2:2<=L.strategy||L.level<2?4:0),Q(L,255&L.gzhead.os),L.gzhead.extra&&L.gzhead.extra.length&&(Q(L,255&L.gzhead.extra.length),Q(L,L.gzhead.extra.length>>8&255)),L.gzhead.hcrc&&(_.adler=f(_.adler,L.pending_buf,L.pending,0)),L.gzindex=0,L.status=69):(Q(L,0),Q(L,0),Q(L,0),Q(L,0),Q(L,0),Q(L,L.level===9?2:2<=L.strategy||L.level<2?4:0),Q(L,3),L.status=D);else{var $=w+(L.w_bits-8<<4)<<8;$|=(2<=L.strategy||L.level<2?0:L.level<6?1:L.level===6?2:3)<<6,L.strstart!==0&&($|=32),$+=31-$%31,L.status=D,X(L,$),L.strstart!==0&&(X(L,_.adler>>>16),X(L,65535&_.adler)),_.adler=1}if(L.status===69)if(L.gzhead.extra){for(O=L.pending;L.gzindex<(65535&L.gzhead.extra.length)&&(L.pending!==L.pending_buf_size||(L.gzhead.hcrc&&L.pending>O&&(_.adler=f(_.adler,L.pending_buf,L.pending-O,O)),U(_),O=L.pending,L.pending!==L.pending_buf_size));)Q(L,255&L.gzhead.extra[L.gzindex]),L.gzindex++;L.gzhead.hcrc&&L.pending>O&&(_.adler=f(_.adler,L.pending_buf,L.pending-O,O)),L.gzindex===L.gzhead.extra.length&&(L.gzindex=0,L.status=73)}else L.status=73;if(L.status===73)if(L.gzhead.name){O=L.pending;do{if(L.pending===L.pending_buf_size&&(L.gzhead.hcrc&&L.pending>O&&(_.adler=f(_.adler,L.pending_buf,L.pending-O,O)),U(_),O=L.pending,L.pending===L.pending_buf_size)){M=1;break}M=L.gzindex<L.gzhead.name.length?255&L.gzhead.name.charCodeAt(L.gzindex++):0,Q(L,M)}while(M!==0);L.gzhead.hcrc&&L.pending>O&&(_.adler=f(_.adler,L.pending_buf,L.pending-O,O)),M===0&&(L.gzindex=0,L.status=91)}else L.status=91;if(L.status===91)if(L.gzhead.comment){O=L.pending;do{if(L.pending===L.pending_buf_size&&(L.gzhead.hcrc&&L.pending>O&&(_.adler=f(_.adler,L.pending_buf,L.pending-O,O)),U(_),O=L.pending,L.pending===L.pending_buf_size)){M=1;break}M=L.gzindex<L.gzhead.comment.length?255&L.gzhead.comment.charCodeAt(L.gzindex++):0,Q(L,M)}while(M!==0);L.gzhead.hcrc&&L.pending>O&&(_.adler=f(_.adler,L.pending_buf,L.pending-O,O)),M===0&&(L.status=103)}else L.status=103;if(L.status===103&&(L.gzhead.hcrc?(L.pending+2>L.pending_buf_size&&U(_),L.pending+2<=L.pending_buf_size&&(Q(L,255&_.adler),Q(L,_.adler>>8&255),_.adler=0,L.status=D)):L.status=D),L.pending!==0){if(U(_),_.avail_out===0)return L.last_flush=-1,d}else if(_.avail_in===0&&J(q)<=J(V)&&q!==k)return se(_,-5);if(L.status===666&&_.avail_in!==0)return se(_,-5);if(_.avail_in!==0||L.lookahead!==0||q!==p&&L.status!==666){var te=L.strategy===2?function(G,ae){for(var _e;;){if(G.lookahead===0&&(me(G),G.lookahead===0)){if(ae===p)return b;break}if(G.match_length=0,_e=c._tr_tally(G,0,G.window[G.strstart]),G.lookahead--,G.strstart++,_e&&(R(G,!1),G.strm.avail_out===0))return b}return G.insert=0,ae===k?(R(G,!0),G.strm.avail_out===0?ee:K):G.last_lit&&(R(G,!1),G.strm.avail_out===0)?b:P}(L,q):L.strategy===3?function(G,ae){for(var _e,le,ge,ze,we=G.window;;){if(G.lookahead<=j){if(me(G),G.lookahead<=j&&ae===p)return b;if(G.lookahead===0)break}if(G.match_length=0,G.lookahead>=z&&0<G.strstart&&(le=we[ge=G.strstart-1])===we[++ge]&&le===we[++ge]&&le===we[++ge]){ze=G.strstart+j;do;while(le===we[++ge]&&le===we[++ge]&&le===we[++ge]&&le===we[++ge]&&le===we[++ge]&&le===we[++ge]&&le===we[++ge]&&le===we[++ge]&&ge<ze);G.match_length=j-(ze-ge),G.match_length>G.lookahead&&(G.match_length=G.lookahead)}if(G.match_length>=z?(_e=c._tr_tally(G,1,G.match_length-z),G.lookahead-=G.match_length,G.strstart+=G.match_length,G.match_length=0):(_e=c._tr_tally(G,0,G.window[G.strstart]),G.lookahead--,G.strstart++),_e&&(R(G,!1),G.strm.avail_out===0))return b}return G.insert=0,ae===k?(R(G,!0),G.strm.avail_out===0?ee:K):G.last_lit&&(R(G,!1),G.strm.avail_out===0)?b:P}(L,q):s[L.level].func(L,q);if(te!==ee&&te!==K||(L.status=666),te===b||te===ee)return _.avail_out===0&&(L.last_flush=-1),d;if(te===P&&(q===1?c._tr_align(L):q!==5&&(c._tr_stored_block(L,0,0,!1),q===3&&(he(L.head),L.lookahead===0&&(L.strstart=0,L.block_start=0,L.insert=0))),U(_),_.avail_out===0))return L.last_flush=-1,d}return q!==k?d:L.wrap<=0?1:(L.wrap===2?(Q(L,255&_.adler),Q(L,_.adler>>8&255),Q(L,_.adler>>16&255),Q(L,_.adler>>24&255),Q(L,255&_.total_in),Q(L,_.total_in>>8&255),Q(L,_.total_in>>16&255),Q(L,_.total_in>>24&255)):(X(L,_.adler>>>16),X(L,65535&_.adler)),U(_),0<L.wrap&&(L.wrap=-L.wrap),L.pending!==0?d:1)},l.deflateEnd=function(_){var q;return _&&_.state?(q=_.state.status)!==T&&q!==69&&q!==73&&q!==91&&q!==103&&q!==D&&q!==666?se(_,g):(_.state=null,q===D?se(_,-3):d):g},l.deflateSetDictionary=function(_,q){var V,L,O,M,$,te,G,ae,_e=q.length;if(!_||!_.state||(M=(V=_.state).wrap)===2||M===1&&V.status!==T||V.lookahead)return g;for(M===1&&(_.adler=u(_.adler,q,_e,0)),V.wrap=0,_e>=V.w_size&&(M===0&&(he(V.head),V.strstart=0,V.block_start=0,V.insert=0),ae=new i.Buf8(V.w_size),i.arraySet(ae,q,_e-V.w_size,V.w_size,0),q=ae,_e=V.w_size),$=_.avail_in,te=_.next_in,G=_.input,_.avail_in=_e,_.next_in=0,_.input=q,me(V);V.lookahead>=z;){for(L=V.strstart,O=V.lookahead-(z-1);V.ins_h=(V.ins_h<<V.hash_shift^V.window[L+z-1])&V.hash_mask,V.prev[L&V.w_mask]=V.head[V.ins_h],V.head[V.ins_h]=L,L++,--O;);V.strstart=L,V.lookahead=z-1,me(V)}return V.strstart+=V.lookahead,V.block_start=V.strstart,V.insert=V.lookahead,V.lookahead=0,V.match_length=V.prev_length=z-1,V.match_available=0,_.next_in=te,_.input=G,_.avail_in=$,V.wrap=M,d},l.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,o,l){o.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(t,o,l){o.exports=function(s,i){var c,u,f,m,p,k,d,g,h,y,v,w,S,C,A,B,I,E,z,j,N,T,D,b,P;c=s.state,u=s.next_in,b=s.input,f=u+(s.avail_in-5),m=s.next_out,P=s.output,p=m-(i-s.avail_out),k=m+(s.avail_out-257),d=c.dmax,g=c.wsize,h=c.whave,y=c.wnext,v=c.window,w=c.hold,S=c.bits,C=c.lencode,A=c.distcode,B=(1<<c.lenbits)-1,I=(1<<c.distbits)-1;e:do{S<15&&(w+=b[u++]<<S,S+=8,w+=b[u++]<<S,S+=8),E=C[w&B];t:for(;;){if(w>>>=z=E>>>24,S-=z,(z=E>>>16&255)===0)P[m++]=65535&E;else{if(!(16&z)){if(!(64&z)){E=C[(65535&E)+(w&(1<<z)-1)];continue t}if(32&z){c.mode=12;break e}s.msg="invalid literal/length code",c.mode=30;break e}j=65535&E,(z&=15)&&(S<z&&(w+=b[u++]<<S,S+=8),j+=w&(1<<z)-1,w>>>=z,S-=z),S<15&&(w+=b[u++]<<S,S+=8,w+=b[u++]<<S,S+=8),E=A[w&I];n:for(;;){if(w>>>=z=E>>>24,S-=z,!(16&(z=E>>>16&255))){if(!(64&z)){E=A[(65535&E)+(w&(1<<z)-1)];continue n}s.msg="invalid distance code",c.mode=30;break e}if(N=65535&E,S<(z&=15)&&(w+=b[u++]<<S,(S+=8)<z&&(w+=b[u++]<<S,S+=8)),d<(N+=w&(1<<z)-1)){s.msg="invalid distance too far back",c.mode=30;break e}if(w>>>=z,S-=z,(z=m-p)<N){if(h<(z=N-z)&&c.sane){s.msg="invalid distance too far back",c.mode=30;break e}if(D=v,(T=0)===y){if(T+=g-z,z<j){for(j-=z;P[m++]=v[T++],--z;);T=m-N,D=P}}else if(y<z){if(T+=g+y-z,(z-=y)<j){for(j-=z;P[m++]=v[T++],--z;);if(T=0,y<j){for(j-=z=y;P[m++]=v[T++],--z;);T=m-N,D=P}}}else if(T+=y-z,z<j){for(j-=z;P[m++]=v[T++],--z;);T=m-N,D=P}for(;2<j;)P[m++]=D[T++],P[m++]=D[T++],P[m++]=D[T++],j-=3;j&&(P[m++]=D[T++],1<j&&(P[m++]=D[T++]))}else{for(T=m-N;P[m++]=P[T++],P[m++]=P[T++],P[m++]=P[T++],2<(j-=3););j&&(P[m++]=P[T++],1<j&&(P[m++]=P[T++]))}break}}break}}while(u<f&&m<k);u-=j=S>>3,w&=(1<<(S-=j<<3))-1,s.next_in=u,s.next_out=m,s.avail_in=u<f?f-u+5:5-(u-f),s.avail_out=m<k?k-m+257:257-(m-k),c.hold=w,c.bits=S}},{}],49:[function(t,o,l){var s=t("../utils/common"),i=t("./adler32"),c=t("./crc32"),u=t("./inffast"),f=t("./inftrees"),m=1,p=2,k=0,d=-2,g=1,h=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 s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function S(T){var D;return T&&T.state?(D=T.state,T.total_in=T.total_out=D.total=0,T.msg="",D.wrap&&(T.adler=1&D.wrap),D.mode=g,D.last=0,D.havedict=0,D.dmax=32768,D.head=null,D.hold=0,D.bits=0,D.lencode=D.lendyn=new s.Buf32(h),D.distcode=D.distdyn=new s.Buf32(y),D.sane=1,D.back=-1,k):d}function C(T){var D;return T&&T.state?((D=T.state).wsize=0,D.whave=0,D.wnext=0,S(T)):d}function A(T,D){var b,P;return T&&T.state?(P=T.state,D<0?(b=0,D=-D):(b=1+(D>>4),D<48&&(D&=15)),D&&(D<8||15<D)?d:(P.window!==null&&P.wbits!==D&&(P.window=null),P.wrap=b,P.wbits=D,C(T))):d}function B(T,D){var b,P;return T?(P=new w,(T.state=P).window=null,(b=A(T,D))!==k&&(T.state=null),b):d}var I,E,z=!0;function j(T){if(z){var D;for(I=new s.Buf32(512),E=new s.Buf32(32),D=0;D<144;)T.lens[D++]=8;for(;D<256;)T.lens[D++]=9;for(;D<280;)T.lens[D++]=7;for(;D<288;)T.lens[D++]=8;for(f(m,T.lens,0,288,I,0,T.work,{bits:9}),D=0;D<32;)T.lens[D++]=5;f(p,T.lens,0,32,E,0,T.work,{bits:5}),z=!1}T.lencode=I,T.lenbits=9,T.distcode=E,T.distbits=5}function N(T,D,b,P){var ee,K=T.state;return K.window===null&&(K.wsize=1<<K.wbits,K.wnext=0,K.whave=0,K.window=new s.Buf8(K.wsize)),P>=K.wsize?(s.arraySet(K.window,D,b-K.wsize,K.wsize,0),K.wnext=0,K.whave=K.wsize):(P<(ee=K.wsize-K.wnext)&&(ee=P),s.arraySet(K.window,D,b-P,ee,K.wnext),(P-=ee)?(s.arraySet(K.window,D,b-P,P,0),K.wnext=P,K.whave=K.wsize):(K.wnext+=ee,K.wnext===K.wsize&&(K.wnext=0),K.whave<K.wsize&&(K.whave+=ee))),0}l.inflateReset=C,l.inflateReset2=A,l.inflateResetKeep=S,l.inflateInit=function(T){return B(T,15)},l.inflateInit2=B,l.inflate=function(T,D){var b,P,ee,K,se,J,he,U,R,Q,X,Y,me,pe,ve,be,Be,ke,oe,xe,_,q,V,L,O=0,M=new s.Buf8(4),$=[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 d;(b=T.state).mode===12&&(b.mode=13),se=T.next_out,ee=T.output,he=T.avail_out,K=T.next_in,P=T.input,J=T.avail_in,U=b.hold,R=b.bits,Q=J,X=he,q=k;e:for(;;)switch(b.mode){case g:if(b.wrap===0){b.mode=13;break}for(;R<16;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}if(2&b.wrap&&U===35615){M[b.check=0]=255&U,M[1]=U>>>8&255,b.check=c(b.check,M,2,0),R=U=0,b.mode=2;break}if(b.flags=0,b.head&&(b.head.done=!1),!(1&b.wrap)||(((255&U)<<8)+(U>>8))%31){T.msg="incorrect header check",b.mode=30;break}if((15&U)!=8){T.msg="unknown compression method",b.mode=30;break}if(R-=4,_=8+(15&(U>>>=4)),b.wbits===0)b.wbits=_;else if(_>b.wbits){T.msg="invalid window size",b.mode=30;break}b.dmax=1<<_,T.adler=b.check=1,b.mode=512&U?10:12,R=U=0;break;case 2:for(;R<16;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}if(b.flags=U,(255&b.flags)!=8){T.msg="unknown compression method",b.mode=30;break}if(57344&b.flags){T.msg="unknown header flags set",b.mode=30;break}b.head&&(b.head.text=U>>8&1),512&b.flags&&(M[0]=255&U,M[1]=U>>>8&255,b.check=c(b.check,M,2,0)),R=U=0,b.mode=3;case 3:for(;R<32;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}b.head&&(b.head.time=U),512&b.flags&&(M[0]=255&U,M[1]=U>>>8&255,M[2]=U>>>16&255,M[3]=U>>>24&255,b.check=c(b.check,M,4,0)),R=U=0,b.mode=4;case 4:for(;R<16;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}b.head&&(b.head.xflags=255&U,b.head.os=U>>8),512&b.flags&&(M[0]=255&U,M[1]=U>>>8&255,b.check=c(b.check,M,2,0)),R=U=0,b.mode=5;case 5:if(1024&b.flags){for(;R<16;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}b.length=U,b.head&&(b.head.extra_len=U),512&b.flags&&(M[0]=255&U,M[1]=U>>>8&255,b.check=c(b.check,M,2,0)),R=U=0}else b.head&&(b.head.extra=null);b.mode=6;case 6:if(1024&b.flags&&(J<(Y=b.length)&&(Y=J),Y&&(b.head&&(_=b.head.extra_len-b.length,b.head.extra||(b.head.extra=new Array(b.head.extra_len)),s.arraySet(b.head.extra,P,K,Y,_)),512&b.flags&&(b.check=c(b.check,P,Y,K)),J-=Y,K+=Y,b.length-=Y),b.length))break e;b.length=0,b.mode=7;case 7:if(2048&b.flags){if(J===0)break e;for(Y=0;_=P[K+Y++],b.head&&_&&b.length<65536&&(b.head.name+=String.fromCharCode(_)),_&&Y<J;);if(512&b.flags&&(b.check=c(b.check,P,Y,K)),J-=Y,K+=Y,_)break e}else b.head&&(b.head.name=null);b.length=0,b.mode=8;case 8:if(4096&b.flags){if(J===0)break e;for(Y=0;_=P[K+Y++],b.head&&_&&b.length<65536&&(b.head.comment+=String.fromCharCode(_)),_&&Y<J;);if(512&b.flags&&(b.check=c(b.check,P,Y,K)),J-=Y,K+=Y,_)break e}else b.head&&(b.head.comment=null);b.mode=9;case 9:if(512&b.flags){for(;R<16;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}if(U!==(65535&b.check)){T.msg="header crc mismatch",b.mode=30;break}R=U=0}b.head&&(b.head.hcrc=b.flags>>9&1,b.head.done=!0),T.adler=b.check=0,b.mode=12;break;case 10:for(;R<32;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}T.adler=b.check=v(U),R=U=0,b.mode=11;case 11:if(b.havedict===0)return T.next_out=se,T.avail_out=he,T.next_in=K,T.avail_in=J,b.hold=U,b.bits=R,2;T.adler=b.check=1,b.mode=12;case 12:if(D===5||D===6)break e;case 13:if(b.last){U>>>=7&R,R-=7&R,b.mode=27;break}for(;R<3;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}switch(b.last=1&U,R-=1,3&(U>>>=1)){case 0:b.mode=14;break;case 1:if(j(b),b.mode=20,D!==6)break;U>>>=2,R-=2;break e;case 2:b.mode=17;break;case 3:T.msg="invalid block type",b.mode=30}U>>>=2,R-=2;break;case 14:for(U>>>=7&R,R-=7&R;R<32;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}if((65535&U)!=(U>>>16^65535)){T.msg="invalid stored block lengths",b.mode=30;break}if(b.length=65535&U,R=U=0,b.mode=15,D===6)break e;case 15:b.mode=16;case 16:if(Y=b.length){if(J<Y&&(Y=J),he<Y&&(Y=he),Y===0)break e;s.arraySet(ee,P,K,Y,se),J-=Y,K+=Y,he-=Y,se+=Y,b.length-=Y;break}b.mode=12;break;case 17:for(;R<14;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}if(b.nlen=257+(31&U),U>>>=5,R-=5,b.ndist=1+(31&U),U>>>=5,R-=5,b.ncode=4+(15&U),U>>>=4,R-=4,286<b.nlen||30<b.ndist){T.msg="too many length or distance symbols",b.mode=30;break}b.have=0,b.mode=18;case 18:for(;b.have<b.ncode;){for(;R<3;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}b.lens[$[b.have++]]=7&U,U>>>=3,R-=3}for(;b.have<19;)b.lens[$[b.have++]]=0;if(b.lencode=b.lendyn,b.lenbits=7,V={bits:b.lenbits},q=f(0,b.lens,0,19,b.lencode,0,b.work,V),b.lenbits=V.bits,q){T.msg="invalid code lengths set",b.mode=30;break}b.have=0,b.mode=19;case 19:for(;b.have<b.nlen+b.ndist;){for(;be=(O=b.lencode[U&(1<<b.lenbits)-1])>>>16&255,Be=65535&O,!((ve=O>>>24)<=R);){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}if(Be<16)U>>>=ve,R-=ve,b.lens[b.have++]=Be;else{if(Be===16){for(L=ve+2;R<L;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}if(U>>>=ve,R-=ve,b.have===0){T.msg="invalid bit length repeat",b.mode=30;break}_=b.lens[b.have-1],Y=3+(3&U),U>>>=2,R-=2}else if(Be===17){for(L=ve+3;R<L;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}R-=ve,_=0,Y=3+(7&(U>>>=ve)),U>>>=3,R-=3}else{for(L=ve+7;R<L;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}R-=ve,_=0,Y=11+(127&(U>>>=ve)),U>>>=7,R-=7}if(b.have+Y>b.nlen+b.ndist){T.msg="invalid bit length repeat",b.mode=30;break}for(;Y--;)b.lens[b.have++]=_}}if(b.mode===30)break;if(b.lens[256]===0){T.msg="invalid code -- missing end-of-block",b.mode=30;break}if(b.lenbits=9,V={bits:b.lenbits},q=f(m,b.lens,0,b.nlen,b.lencode,0,b.work,V),b.lenbits=V.bits,q){T.msg="invalid literal/lengths set",b.mode=30;break}if(b.distbits=6,b.distcode=b.distdyn,V={bits:b.distbits},q=f(p,b.lens,b.nlen,b.ndist,b.distcode,0,b.work,V),b.distbits=V.bits,q){T.msg="invalid distances set",b.mode=30;break}if(b.mode=20,D===6)break e;case 20:b.mode=21;case 21:if(6<=J&&258<=he){T.next_out=se,T.avail_out=he,T.next_in=K,T.avail_in=J,b.hold=U,b.bits=R,u(T,X),se=T.next_out,ee=T.output,he=T.avail_out,K=T.next_in,P=T.input,J=T.avail_in,U=b.hold,R=b.bits,b.mode===12&&(b.back=-1);break}for(b.back=0;be=(O=b.lencode[U&(1<<b.lenbits)-1])>>>16&255,Be=65535&O,!((ve=O>>>24)<=R);){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}if(be&&!(240&be)){for(ke=ve,oe=be,xe=Be;be=(O=b.lencode[xe+((U&(1<<ke+oe)-1)>>ke)])>>>16&255,Be=65535&O,!(ke+(ve=O>>>24)<=R);){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}U>>>=ke,R-=ke,b.back+=ke}if(U>>>=ve,R-=ve,b.back+=ve,b.length=Be,be===0){b.mode=26;break}if(32&be){b.back=-1,b.mode=12;break}if(64&be){T.msg="invalid literal/length code",b.mode=30;break}b.extra=15&be,b.mode=22;case 22:if(b.extra){for(L=b.extra;R<L;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}b.length+=U&(1<<b.extra)-1,U>>>=b.extra,R-=b.extra,b.back+=b.extra}b.was=b.length,b.mode=23;case 23:for(;be=(O=b.distcode[U&(1<<b.distbits)-1])>>>16&255,Be=65535&O,!((ve=O>>>24)<=R);){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}if(!(240&be)){for(ke=ve,oe=be,xe=Be;be=(O=b.distcode[xe+((U&(1<<ke+oe)-1)>>ke)])>>>16&255,Be=65535&O,!(ke+(ve=O>>>24)<=R);){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}U>>>=ke,R-=ke,b.back+=ke}if(U>>>=ve,R-=ve,b.back+=ve,64&be){T.msg="invalid distance code",b.mode=30;break}b.offset=Be,b.extra=15&be,b.mode=24;case 24:if(b.extra){for(L=b.extra;R<L;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}b.offset+=U&(1<<b.extra)-1,U>>>=b.extra,R-=b.extra,b.back+=b.extra}if(b.offset>b.dmax){T.msg="invalid distance too far back",b.mode=30;break}b.mode=25;case 25:if(he===0)break e;if(Y=X-he,b.offset>Y){if((Y=b.offset-Y)>b.whave&&b.sane){T.msg="invalid distance too far back",b.mode=30;break}me=Y>b.wnext?(Y-=b.wnext,b.wsize-Y):b.wnext-Y,Y>b.length&&(Y=b.length),pe=b.window}else pe=ee,me=se-b.offset,Y=b.length;for(he<Y&&(Y=he),he-=Y,b.length-=Y;ee[se++]=pe[me++],--Y;);b.length===0&&(b.mode=21);break;case 26:if(he===0)break e;ee[se++]=b.length,he--,b.mode=21;break;case 27:if(b.wrap){for(;R<32;){if(J===0)break e;J--,U|=P[K++]<<R,R+=8}if(X-=he,T.total_out+=X,b.total+=X,X&&(T.adler=b.check=b.flags?c(b.check,ee,X,se-X):i(b.check,ee,X,se-X)),X=he,(b.flags?U:v(U))!==b.check){T.msg="incorrect data check",b.mode=30;break}R=U=0}b.mode=28;case 28:if(b.wrap&&b.flags){for(;R<32;){if(J===0)break e;J--,U+=P[K++]<<R,R+=8}if(U!==(4294967295&b.total)){T.msg="incorrect length check",b.mode=30;break}R=U=0}b.mode=29;case 29:q=1;break e;case 30:q=-3;break e;case 31:return-4;case 32:default:return d}return T.next_out=se,T.avail_out=he,T.next_in=K,T.avail_in=J,b.hold=U,b.bits=R,(b.wsize||X!==T.avail_out&&b.mode<30&&(b.mode<27||D!==4))&&N(T,T.output,T.next_out,X-T.avail_out)?(b.mode=31,-4):(Q-=T.avail_in,X-=T.avail_out,T.total_in+=Q,T.total_out+=X,b.total+=X,b.wrap&&X&&(T.adler=b.check=b.flags?c(b.check,ee,X,T.next_out-X):i(b.check,ee,X,T.next_out-X)),T.data_type=b.bits+(b.last?64:0)+(b.mode===12?128:0)+(b.mode===20||b.mode===15?256:0),(Q==0&&X===0||D===4)&&q===k&&(q=-5),q)},l.inflateEnd=function(T){if(!T||!T.state)return d;var D=T.state;return D.window&&(D.window=null),T.state=null,k},l.inflateGetHeader=function(T,D){var b;return T&&T.state&&2&(b=T.state).wrap?((b.head=D).done=!1,k):d},l.inflateSetDictionary=function(T,D){var b,P=D.length;return T&&T.state?(b=T.state).wrap!==0&&b.mode!==11?d:b.mode===11&&i(1,D,P,0)!==b.check?-3:N(T,D,P,P)?(b.mode=31,-4):(b.havedict=1,k):d},l.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,o,l){var s=t("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],c=[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];o.exports=function(m,p,k,d,g,h,y,v){var w,S,C,A,B,I,E,z,j,N=v.bits,T=0,D=0,b=0,P=0,ee=0,K=0,se=0,J=0,he=0,U=0,R=null,Q=0,X=new s.Buf16(16),Y=new s.Buf16(16),me=null,pe=0;for(T=0;T<=15;T++)X[T]=0;for(D=0;D<d;D++)X[p[k+D]]++;for(ee=N,P=15;1<=P&&X[P]===0;P--);if(P<ee&&(ee=P),P===0)return g[h++]=20971520,g[h++]=20971520,v.bits=1,0;for(b=1;b<P&&X[b]===0;b++);for(ee<b&&(ee=b),T=J=1;T<=15;T++)if(J<<=1,(J-=X[T])<0)return-1;if(0<J&&(m===0||P!==1))return-1;for(Y[1]=0,T=1;T<15;T++)Y[T+1]=Y[T]+X[T];for(D=0;D<d;D++)p[k+D]!==0&&(y[Y[p[k+D]]++]=D);if(I=m===0?(R=me=y,19):m===1?(R=i,Q-=257,me=c,pe-=257,256):(R=u,me=f,-1),T=b,B=h,se=D=U=0,C=-1,A=(he=1<<(K=ee))-1,m===1&&852<he||m===2&&592<he)return 1;for(;;){for(E=T-se,j=y[D]<I?(z=0,y[D]):y[D]>I?(z=me[pe+y[D]],R[Q+y[D]]):(z=96,0),w=1<<T-se,b=S=1<<K;g[B+(U>>se)+(S-=w)]=E<<24|z<<16|j|0,S!==0;);for(w=1<<T-1;U&w;)w>>=1;if(w!==0?(U&=w-1,U+=w):U=0,D++,--X[T]==0){if(T===P)break;T=p[k+y[D]]}if(ee<T&&(U&A)!==C){for(se===0&&(se=ee),B+=b,J=1<<(K=T-se);K+se<P&&!((J-=X[K+se])<=0);)K++,J<<=1;if(he+=1<<K,m===1&&852<he||m===2&&592<he)return 1;g[C=U&A]=ee<<24|K<<16|B-h|0}}return U!==0&&(g[B+U]=T-se<<24|64<<16|0),v.bits=ee,0}},{"../utils/common":41}],51:[function(t,o,l){o.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(t,o,l){var s=t("../utils/common"),i=0,c=1;function u(O){for(var M=O.length;0<=--M;)O[M]=0}var f=0,m=29,p=256,k=p+1+m,d=30,g=19,h=2*k+1,y=15,v=16,w=7,S=256,C=16,A=17,B=18,I=[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],z=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],N=new Array(2*(k+2));u(N);var T=new Array(2*d);u(T);var D=new Array(512);u(D);var b=new Array(256);u(b);var P=new Array(m);u(P);var ee,K,se,J=new Array(d);function he(O,M,$,te,G){this.static_tree=O,this.extra_bits=M,this.extra_base=$,this.elems=te,this.max_length=G,this.has_stree=O&&O.length}function U(O,M){this.dyn_tree=O,this.max_code=0,this.stat_desc=M}function R(O){return O<256?D[O]:D[256+(O>>>7)]}function Q(O,M){O.pending_buf[O.pending++]=255&M,O.pending_buf[O.pending++]=M>>>8&255}function X(O,M,$){O.bi_valid>v-$?(O.bi_buf|=M<<O.bi_valid&65535,Q(O,O.bi_buf),O.bi_buf=M>>v-O.bi_valid,O.bi_valid+=$-v):(O.bi_buf|=M<<O.bi_valid&65535,O.bi_valid+=$)}function Y(O,M,$){X(O,$[2*M],$[2*M+1])}function me(O,M){for(var $=0;$|=1&O,O>>>=1,$<<=1,0<--M;);return $>>>1}function pe(O,M,$){var te,G,ae=new Array(y+1),_e=0;for(te=1;te<=y;te++)ae[te]=_e=_e+$[te-1]<<1;for(G=0;G<=M;G++){var le=O[2*G+1];le!==0&&(O[2*G]=me(ae[le]++,le))}}function ve(O){var M;for(M=0;M<k;M++)O.dyn_ltree[2*M]=0;for(M=0;M<d;M++)O.dyn_dtree[2*M]=0;for(M=0;M<g;M++)O.bl_tree[2*M]=0;O.dyn_ltree[2*S]=1,O.opt_len=O.static_len=0,O.last_lit=O.matches=0}function be(O){8<O.bi_valid?Q(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 Be(O,M,$,te){var G=2*M,ae=2*$;return O[G]<O[ae]||O[G]===O[ae]&&te[M]<=te[$]}function ke(O,M,$){for(var te=O.heap[$],G=$<<1;G<=O.heap_len&&(G<O.heap_len&&Be(M,O.heap[G+1],O.heap[G],O.depth)&&G++,!Be(M,te,O.heap[G],O.depth));)O.heap[$]=O.heap[G],$=G,G<<=1;O.heap[$]=te}function oe(O,M,$){var te,G,ae,_e,le=0;if(O.last_lit!==0)for(;te=O.pending_buf[O.d_buf+2*le]<<8|O.pending_buf[O.d_buf+2*le+1],G=O.pending_buf[O.l_buf+le],le++,te===0?Y(O,G,M):(Y(O,(ae=b[G])+p+1,M),(_e=I[ae])!==0&&X(O,G-=P[ae],_e),Y(O,ae=R(--te),$),(_e=E[ae])!==0&&X(O,te-=J[ae],_e)),le<O.last_lit;);Y(O,S,M)}function xe(O,M){var $,te,G,ae=M.dyn_tree,_e=M.stat_desc.static_tree,le=M.stat_desc.has_stree,ge=M.stat_desc.elems,ze=-1;for(O.heap_len=0,O.heap_max=h,$=0;$<ge;$++)ae[2*$]!==0?(O.heap[++O.heap_len]=ze=$,O.depth[$]=0):ae[2*$+1]=0;for(;O.heap_len<2;)ae[2*(G=O.heap[++O.heap_len]=ze<2?++ze:0)]=1,O.depth[G]=0,O.opt_len--,le&&(O.static_len-=_e[2*G+1]);for(M.max_code=ze,$=O.heap_len>>1;1<=$;$--)ke(O,ae,$);for(G=ge;$=O.heap[1],O.heap[1]=O.heap[O.heap_len--],ke(O,ae,1),te=O.heap[1],O.heap[--O.heap_max]=$,O.heap[--O.heap_max]=te,ae[2*G]=ae[2*$]+ae[2*te],O.depth[G]=(O.depth[$]>=O.depth[te]?O.depth[$]:O.depth[te])+1,ae[2*$+1]=ae[2*te+1]=G,O.heap[1]=G++,ke(O,ae,1),2<=O.heap_len;);O.heap[--O.heap_max]=O.heap[1],function(we,Fe){var De,Pe,Ne,Le,Ke,Me,We=Fe.dyn_tree,ye=Fe.max_code,fe=Fe.stat_desc.static_tree,ne=Fe.stat_desc.has_stree,Ee=Fe.stat_desc.extra_bits,Ce=Fe.stat_desc.extra_base,He=Fe.stat_desc.max_length,ct=0;for(Le=0;Le<=y;Le++)we.bl_count[Le]=0;for(We[2*we.heap[we.heap_max]+1]=0,De=we.heap_max+1;De<h;De++)He<(Le=We[2*We[2*(Pe=we.heap[De])+1]+1]+1)&&(Le=He,ct++),We[2*Pe+1]=Le,ye<Pe||(we.bl_count[Le]++,Ke=0,Ce<=Pe&&(Ke=Ee[Pe-Ce]),Me=We[2*Pe],we.opt_len+=Me*(Le+Ke),ne&&(we.static_len+=Me*(fe[2*Pe+1]+Ke)));if(ct!==0){do{for(Le=He-1;we.bl_count[Le]===0;)Le--;we.bl_count[Le]--,we.bl_count[Le+1]+=2,we.bl_count[He]--,ct-=2}while(0<ct);for(Le=He;Le!==0;Le--)for(Pe=we.bl_count[Le];Pe!==0;)ye<(Ne=we.heap[--De])||(We[2*Ne+1]!==Le&&(we.opt_len+=(Le-We[2*Ne+1])*We[2*Ne],We[2*Ne+1]=Le),Pe--)}}(O,M),pe(ae,ze,O.bl_count)}function _(O,M,$){var te,G,ae=-1,_e=M[1],le=0,ge=7,ze=4;for(_e===0&&(ge=138,ze=3),M[2*($+1)+1]=65535,te=0;te<=$;te++)G=_e,_e=M[2*(te+1)+1],++le<ge&&G===_e||(le<ze?O.bl_tree[2*G]+=le:G!==0?(G!==ae&&O.bl_tree[2*G]++,O.bl_tree[2*C]++):le<=10?O.bl_tree[2*A]++:O.bl_tree[2*B]++,ae=G,ze=(le=0)===_e?(ge=138,3):G===_e?(ge=6,3):(ge=7,4))}function q(O,M,$){var te,G,ae=-1,_e=M[1],le=0,ge=7,ze=4;for(_e===0&&(ge=138,ze=3),te=0;te<=$;te++)if(G=_e,_e=M[2*(te+1)+1],!(++le<ge&&G===_e)){if(le<ze)for(;Y(O,G,O.bl_tree),--le!=0;);else G!==0?(G!==ae&&(Y(O,G,O.bl_tree),le--),Y(O,C,O.bl_tree),X(O,le-3,2)):le<=10?(Y(O,A,O.bl_tree),X(O,le-3,3)):(Y(O,B,O.bl_tree),X(O,le-11,7));ae=G,ze=(le=0)===_e?(ge=138,3):G===_e?(ge=6,3):(ge=7,4)}}u(J);var V=!1;function L(O,M,$,te){X(O,(f<<1)+(te?1:0),3),function(G,ae,_e,le){be(G),Q(G,_e),Q(G,~_e),s.arraySet(G.pending_buf,G.window,ae,_e,G.pending),G.pending+=_e}(O,M,$)}l._tr_init=function(O){V||(function(){var M,$,te,G,ae,_e=new Array(y+1);for(G=te=0;G<m-1;G++)for(P[G]=te,M=0;M<1<<I[G];M++)b[te++]=G;for(b[te-1]=G,G=ae=0;G<16;G++)for(J[G]=ae,M=0;M<1<<E[G];M++)D[ae++]=G;for(ae>>=7;G<d;G++)for(J[G]=ae<<7,M=0;M<1<<E[G]-7;M++)D[256+ae++]=G;for($=0;$<=y;$++)_e[$]=0;for(M=0;M<=143;)N[2*M+1]=8,M++,_e[8]++;for(;M<=255;)N[2*M+1]=9,M++,_e[9]++;for(;M<=279;)N[2*M+1]=7,M++,_e[7]++;for(;M<=287;)N[2*M+1]=8,M++,_e[8]++;for(pe(N,k+1,_e),M=0;M<d;M++)T[2*M+1]=5,T[2*M]=me(M,5);ee=new he(N,I,p+1,k,y),K=new he(T,E,0,d,y),se=new he(new Array(0),z,0,g,w)}(),V=!0),O.l_desc=new U(O.dyn_ltree,ee),O.d_desc=new U(O.dyn_dtree,K),O.bl_desc=new U(O.bl_tree,se),O.bi_buf=0,O.bi_valid=0,ve(O)},l._tr_stored_block=L,l._tr_flush_block=function(O,M,$,te){var G,ae,_e=0;0<O.level?(O.strm.data_type===2&&(O.strm.data_type=function(le){var ge,ze=4093624447;for(ge=0;ge<=31;ge++,ze>>>=1)if(1&ze&&le.dyn_ltree[2*ge]!==0)return i;if(le.dyn_ltree[18]!==0||le.dyn_ltree[20]!==0||le.dyn_ltree[26]!==0)return c;for(ge=32;ge<p;ge++)if(le.dyn_ltree[2*ge]!==0)return c;return i}(O)),xe(O,O.l_desc),xe(O,O.d_desc),_e=function(le){var ge;for(_(le,le.dyn_ltree,le.l_desc.max_code),_(le,le.dyn_dtree,le.d_desc.max_code),xe(le,le.bl_desc),ge=g-1;3<=ge&&le.bl_tree[2*j[ge]+1]===0;ge--);return le.opt_len+=3*(ge+1)+5+5+4,ge}(O),G=O.opt_len+3+7>>>3,(ae=O.static_len+3+7>>>3)<=G&&(G=ae)):G=ae=$+5,$+4<=G&&M!==-1?L(O,M,$,te):O.strategy===4||ae===G?(X(O,2+(te?1:0),3),oe(O,N,T)):(X(O,4+(te?1:0),3),function(le,ge,ze,we){var Fe;for(X(le,ge-257,5),X(le,ze-1,5),X(le,we-4,4),Fe=0;Fe<we;Fe++)X(le,le.bl_tree[2*j[Fe]+1],3);q(le,le.dyn_ltree,ge-1),q(le,le.dyn_dtree,ze-1)}(O,O.l_desc.max_code+1,O.d_desc.max_code+1,_e+1),oe(O,O.dyn_ltree,O.dyn_dtree)),ve(O),te&&be(O)},l._tr_tally=function(O,M,$){return O.pending_buf[O.d_buf+2*O.last_lit]=M>>>8&255,O.pending_buf[O.d_buf+2*O.last_lit+1]=255&M,O.pending_buf[O.l_buf+O.last_lit]=255&$,O.last_lit++,M===0?O.dyn_ltree[2*$]++:(O.matches++,M--,O.dyn_ltree[2*(b[$]+p+1)]++,O.dyn_dtree[2*R(M)]++),O.last_lit===O.lit_bufsize-1},l._tr_align=function(O){X(O,2,3),Y(O,S,N),function(M){M.bi_valid===16?(Q(M,M.bi_buf),M.bi_buf=0,M.bi_valid=0):8<=M.bi_valid&&(M.pending_buf[M.pending++]=255&M.bi_buf,M.bi_buf>>=8,M.bi_valid-=8)}(O)}},{"../utils/common":41}],53:[function(t,o,l){o.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(t,o,l){(function(s){(function(i,c){if(!i.setImmediate){var u,f,m,p,k=1,d={},g=!1,h=i.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(i);y=y&&y.setTimeout?y:i,u={}.toString.call(i.process)==="[object process]"?function(C){process.nextTick(function(){w(C)})}:function(){if(i.postMessage&&!i.importScripts){var C=!0,A=i.onmessage;return i.onmessage=function(){C=!1},i.postMessage("","*"),i.onmessage=A,C}}()?(p="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",S,!1):i.attachEvent("onmessage",S),function(C){i.postMessage(p+C,"*")}):i.MessageChannel?((m=new MessageChannel).port1.onmessage=function(C){w(C.data)},function(C){m.port2.postMessage(C)}):h&&"onreadystatechange"in h.createElement("script")?(f=h.documentElement,function(C){var A=h.createElement("script");A.onreadystatechange=function(){w(C),A.onreadystatechange=null,f.removeChild(A),A=null},f.appendChild(A)}):function(C){setTimeout(w,0,C)},y.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var A=new Array(arguments.length-1),B=0;B<A.length;B++)A[B]=arguments[B+1];var I={callback:C,args:A};return d[k]=I,u(k),k++},y.clearImmediate=v}function v(C){delete d[C]}function w(C){if(g)setTimeout(w,0,C);else{var A=d[C];if(A){g=!0;try{(function(B){var I=B.callback,E=B.args;switch(E.length){case 0:I();break;case 1:I(E[0]);break;case 2:I(E[0],E[1]);break;case 3:I(E[0],E[1],E[2]);break;default:I.apply(c,E)}})(A)}finally{v(C),g=!1}}}}function S(C){C.source===i&&typeof C.data=="string"&&C.data.indexOf(p)===0&&w(+C.data.slice(p.length))}})(typeof self>"u"?s===void 0?this:s:self)}).call(this,typeof En<"u"?En:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(ml);var Gl=ml.exports;const Jl=Kl(Gl);function Pr(n,e,t){const o=n.slice();return o[94]=e[t],o[95]=e,o[96]=t,o}function Rr(n,e,t){const o=n.slice();return o[97]=e[t],o}function Nr(n,e,t){const o=n.slice();return o[100]=e[t],o}function Dr(n,e,t){const o=n.slice();return o[103]=e[t],o}function Mr(n){let e,t,o=n[49][n[103]].icon+"",l,s=n[49][n[103]].label+"",i,c,u,f=(n[8][n[103]]||0)+"",m,p,k,d,g,h;function y(){return n[55](n[103])}return{c(){e=x("button"),t=x("span"),l=F(),i=Z(s),c=F(),u=x("span"),m=Z(f),k=F(),r(t,"class","inline-flex"),r(u,"class",p="ml-1 px-1.5 py-0.5 rounded-full text-xs "+(n[0]===n[103]?"bg-indigo-100 text-indigo-700":"bg-gray-100 text-gray-600")),r(e,"class",d="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px flex items-center gap-1.5 "+(n[0]===n[103]?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))},m(v,w){W(v,e,w),a(e,t),t.innerHTML=o,a(e,l),a(e,i),a(e,c),a(e,u),a(u,m),a(e,k),g||(h=ie(e,"click",y),g=!0)},p(v,w){n=v,w[0]&256&&f!==(f=(n[8][n[103]]||0)+"")&&ce(m,f),w[0]&1&&p!==(p="ml-1 px-1.5 py-0.5 rounded-full text-xs "+(n[0]===n[103]?"bg-indigo-100 text-indigo-700":"bg-gray-100 text-gray-600"))&&r(u,"class",p),w[0]&1&&d!==(d="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px flex items-center gap-1.5 "+(n[0]===n[103]?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))&&r(e,"class",d)},d(v){v&&H(e),g=!1,h()}}}function Ur(n){let e,t=(n[100].name||n[100].code||n[100])+"",o,l;return{c(){e=x("option"),o=Z(t),e.__value=l=n[100].code||n[100],Ae(e,e.__value)},m(s,i){W(s,e,i),a(e,o)},p(s,i){i[0]&32&&t!==(t=(s[100].name||s[100].code||s[100])+"")&&ce(o,t),i[0]&32&&l!==(l=s[100].code||s[100])&&(e.__value=l,Ae(e,e.__value))},d(s){s&&H(e)}}}function Zr(n){let e,t,o,l=n[27]?'<svg viewBox="0 0 24 24" width="16" height="16" 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="16" height="16" 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>',s,i=n[27]?"Exporting…":"Export JSON ▾",c,u,f,m,p,k,d,g=n[29]&&Hr(n),h=n[28]&&Wr(n);return{c(){e=x("div"),t=x("button"),o=new sl(!1),s=F(),c=Z(i),u=F(),g&&g.c(),f=F(),h&&h.c(),m=F(),p=x("button"),p.textContent="Import JSON",o.a=s,r(t,"class","px-3 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-1.5"),t.disabled=n[27],r(e,"class","relative"),r(p,"class","px-3 py-2 border border-gray-300 rounded-md text-sm hover:bg-gray-50")},m(y,v){W(y,e,v),a(e,t),o.m(l,t),a(t,s),a(t,c),a(e,u),g&&g.m(e,null),W(y,f,v),h&&h.m(y,v),W(y,m,v),W(y,p,v),k||(d=[ie(t,"click",n[62]),ie(p,"click",n[64])],k=!0)},p(y,v){v[0]&134217728&&l!==(l=y[27]?'<svg viewBox="0 0 24 24" width="16" height="16" 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="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>')&&o.p(l),v[0]&134217728&&i!==(i=y[27]?"Exporting…":"Export JSON ▾")&&ce(c,i),v[0]&134217728&&(t.disabled=y[27]),y[29]?g?g.p(y,v):(g=Hr(y),g.c(),g.m(e,null)):g&&(g.d(1),g=null),y[28]?h?h.p(y,v):(h=Wr(y),h.c(),h.m(m.parentNode,m)):h&&(h.d(1),h=null)},d(y){y&&(H(e),H(f),H(m),H(p)),g&&g.d(),h&&h.d(y),k=!1,Ze(d)}}}function Hr(n){let e,t,o,l,s,i,c,u;return{c(){e=x("div"),t=F(),o=x("div"),l=x("button"),l.textContent="All languages (single file)",s=F(),i=x("button"),i.textContent="One file per language",r(e,"class","fixed inset-0 z-40"),r(e,"role","presentation"),r(l,"class","w-full text-left px-4 py-2.5 text-sm hover:bg-gray-50 rounded-t-md"),r(i,"class","w-full text-left px-4 py-2.5 text-sm hover:bg-gray-50 rounded-b-md border-t border-gray-100"),r(o,"class","absolute right-0 mt-1 w-56 bg-white border border-gray-200 rounded-md shadow-lg z-50")},m(f,m){W(f,e,m),W(f,t,m),W(f,o,m),a(o,l),a(o,s),a(o,i),c||(u=[ie(e,"click",n[63]),ie(l,"click",n[34]),ie(i,"click",n[35])],c=!0)},p:je,d(f){f&&(H(e),H(t),H(o)),c=!1,Ze(u)}}}function Wr(n){let e,t,o;return{c(){e=x("span"),t=Z(n[28]),r(e,"class",o="text-xs "+(n[28].includes("!")?"text-green-600":"text-red-600"))},m(l,s){W(l,e,s),a(e,t)},p(l,s){s[0]&268435456&&ce(t,l[28]),s[0]&268435456&&o!==(o="text-xs "+(l[28].includes("!")?"text-green-600":"text-red-600"))&&r(e,"class",o)},d(l){l&&H(e)}}}function Kr(n){let e,t,o;return{c(){e=x("button"),e.textContent="+ Add",r(e,"class","px-3 py-2 border border-gray-300 rounded-md text-sm hover:bg-gray-50")},m(l,s){W(l,e,s),t||(o=ie(e,"click",n[65]),t=!0)},p:je,d(l){l&&H(e),t=!1,o()}}}function Gr(n){let e,t,o,l,s,i,c,u,f,m,p,k;return{c(){e=x("div"),t=x("input"),o=F(),l=x("input"),s=F(),i=x("input"),c=F(),u=x("button"),f=Z("Save"),r(t,"placeholder","Key (original text)"),r(t,"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"),r(l,"placeholder","Context (optional)"),r(l,"class","flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),r(i,"placeholder","Translated value (optional)"),r(i,"class","flex-[2] px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),r(u,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),u.disabled=m=!n[21].trim(),r(e,"class","flex gap-2 mb-4")},m(d,g){W(d,e,g),a(e,t),Ae(t,n[21]),a(e,o),a(e,l),Ae(l,n[22]),a(e,s),a(e,i),Ae(i,n[23]),a(e,c),a(e,u),a(u,f),p||(k=[ie(t,"input",n[66]),ie(l,"input",n[67]),ie(i,"input",n[68]),ie(u,"click",n[47])],p=!0)},p(d,g){g[0]&2097152&&t.value!==d[21]&&Ae(t,d[21]),g[0]&4194304&&l.value!==d[22]&&Ae(l,d[22]),g[0]&8388608&&i.value!==d[23]&&Ae(i,d[23]),g[0]&2097152&&m!==(m=!d[21].trim())&&(u.disabled=m)},d(d){d&&H(e),p=!1,Ze(k)}}}function Jr(n){let e,t,o,l,s,i;return{c(){e=x("div"),t=x("textarea"),o=F(),l=x("button"),l.textContent="Import",r(t,"rows","4"),r(t,"placeholder",'{"Hello": "你好", "Goodbye": "再见"}'),r(t,"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"),r(l,"class","mt-2 px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700"),r(e,"class","mb-4")},m(c,u){W(c,e,u),a(e,t),Ae(t,n[24]),a(e,o),a(e,l),s||(i=[ie(t,"input",n[69]),ie(l,"click",n[48])],s=!0)},p(c,u){u[0]&16777216&&Ae(t,c[24])},d(c){c&&H(e),s=!1,Ze(i)}}}function Vr(n){let e,t,o,l,s,i;function c(g,h){return g[16]?Ql:Vl}let u=c(n),f=u(n),m=Oe(n[49][n[0]].actions),p=[];for(let g=0;g<m.length;g+=1)p[g]=Qr(Rr(n,m,g));let k=n[0]==="trash"&&qr(n),d=(n[16]||n[18]>0)&&Yr(n);return{c(){e=x("div"),t=x("span"),f.c(),o=F();for(let g=0;g<p.length;g+=1)p[g].c();l=F(),k&&k.c(),s=F(),d&&d.c(),i=at(),r(t,"class","text-sm text-indigo-700 font-medium"),r(e,"class","flex items-center gap-3 mb-3 p-3 bg-indigo-50 rounded-lg border border-indigo-200")},m(g,h){W(g,e,h),a(e,t),f.m(t,null),a(e,o);for(let y=0;y<p.length;y+=1)p[y]&&p[y].m(e,null);a(e,l),k&&k.m(e,null),W(g,s,h),d&&d.m(g,h),W(g,i,h)},p(g,h){if(u===(u=c(g))&&f?f.p(g,h):(f.d(1),f=u(g),f&&(f.c(),f.m(t,null))),h[0]&65537|h[1]&266240){m=Oe(g[49][g[0]].actions);let y;for(y=0;y<m.length;y+=1){const v=Rr(g,m,y);p[y]?p[y].p(v,h):(p[y]=Qr(v),p[y].c(),p[y].m(e,l))}for(;y<p.length;y+=1)p[y].d(1);p.length=m.length}g[0]==="trash"?k?k.p(g,h):(k=qr(g),k.c(),k.m(e,null)):k&&(k.d(1),k=null),g[16]||g[18]>0?d?d.p(g,h):(d=Yr(g),d.c(),d.m(i.parentNode,i)):d&&(d.d(1),d=null)},d(g){g&&(H(e),H(s),H(i)),f.d(),qe(p,g),k&&k.d(),d&&d.d(g)}}}function Vl(n){let e=n[12].size+"",t,o;return{c(){t=Z(e),o=Z(" selected")},m(l,s){W(l,t,s),W(l,o,s)},p(l,s){s[0]&4096&&e!==(e=l[12].size+"")&&ce(t,e)},d(l){l&&(H(t),H(o))}}}function Ql(n){let e,t,o,l,s;return{c(){e=Z(n[17]),t=F(),o=Z(n[3]),l=Z(" / "),s=Z(n[4])},m(i,c){W(i,e,c),W(i,t,c),W(i,o,c),W(i,l,c),W(i,s,c)},p(i,c){c[0]&131072&&ce(e,i[17]),c[0]&8&&ce(o,i[3]),c[0]&16&&ce(s,i[4])},d(i){i&&(H(e),H(t),H(o),H(l),H(s))}}}function Qr(n){let e,t=n[97].label+"",o,l,s,i;function c(){return n[70](n[97])}return{c(){e=x("button"),o=Z(t),r(e,"class",l="px-3 py-1.5 text-white text-sm rounded-md "+n[97].color+" disabled:opacity-50 disabled:cursor-not-allowed"),e.disabled=n[16]},m(u,f){W(u,e,f),a(e,o),s||(i=ie(e,"click",c),s=!0)},p(u,f){n=u,f[0]&1&&t!==(t=n[97].label+"")&&ce(o,t),f[0]&1&&l!==(l="px-3 py-1.5 text-white text-sm rounded-md "+n[97].color+" disabled:opacity-50 disabled:cursor-not-allowed")&&r(e,"class",l),f[0]&65536&&(e.disabled=n[16])},d(u){u&&H(e),s=!1,i()}}}function qr(n){let e,t=n[16]&&n[17]==="Deleting"?"Deleting…":"Delete Permanently",o,l,s;return{c(){e=x("button"),o=Z(t),r(e,"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"),e.disabled=n[16]},m(i,c){W(i,e,c),a(e,o),l||(s=ie(e,"click",n[44]),l=!0)},p(i,c){c[0]&196608&&t!==(t=i[16]&&i[17]==="Deleting"?"Deleting…":"Delete Permanently")&&ce(o,t),c[0]&65536&&(e.disabled=i[16])},d(i){i&&H(e),l=!1,s()}}}function Yr(n){let e,t,o,l,s,i,c,u,f,m,p,k,d,g,h,y,v;function w(A,B){if(A[16])return Yl;if(A[18]>0)return ql}let S=w(n),C=S&&S(n);return{c(){e=x("div"),t=x("div"),o=x("span"),C&&C.c(),l=F(),s=x("span"),i=Z(n[31]),c=Z("%"),u=F(),f=x("div"),m=x("div"),k=F(),d=x("div"),g=Z(n[3]),h=Z(" of "),y=Z(n[4]),v=Z(" processed"),r(t,"class","flex items-center justify-between text-xs font-medium text-gray-600"),r(m,"class","h-full bg-indigo-600 transition-all duration-200"),r(m,"style",p=`width: ${n[31]}%`),r(f,"class","mt-2 h-2 overflow-hidden rounded-full bg-indigo-100"),r(d,"class","mt-2 text-xs text-gray-500"),r(e,"class","mb-4 rounded-lg border border-indigo-200 bg-white px-3 py-3")},m(A,B){W(A,e,B),a(e,t),a(t,o),C&&C.m(o,null),a(t,l),a(t,s),a(s,i),a(s,c),a(e,u),a(e,f),a(f,m),a(e,k),a(e,d),a(d,g),a(d,h),a(d,y),a(d,v)},p(A,B){S===(S=w(A))&&C?C.p(A,B):(C&&C.d(1),C=S&&S(A),C&&(C.c(),C.m(o,null))),B[1]&1&&ce(i,A[31]),B[1]&1&&p!==(p=`width: ${A[31]}%`)&&r(m,"style",p),B[0]&8&&ce(g,A[3]),B[0]&16&&ce(y,A[4])},d(A){A&&H(e),C&&C.d()}}}function ql(n){let e,t,o;return{c(){e=Z("Finished with "),t=Z(n[18]),o=Z(" failure(s)")},m(l,s){W(l,e,s),W(l,t,s),W(l,o,s)},p(l,s){s[0]&262144&&ce(t,l[18])},d(l){l&&(H(e),H(t),H(o))}}}function Yl(n){let e,t;return{c(){e=Z(n[17]),t=Z(" selected items...")},m(o,l){W(o,e,l),W(o,t,l)},p(o,l){l[0]&131072&&ce(e,o[17])},d(o){o&&(H(e),H(t))}}}function Xl(n){let e,t,o,l,s,i,c,u,f,m,p,k,d,g,h,y,v,w=[],S=new Map,C,A,B,I,E,z,j,N,T=Oe(n[7]);const D=P=>P[94].key_id;for(let P=0;P<T.length;P+=1){let ee=Pr(n,T,P),K=D(ee);S.set(K,w[P]=$r(K,ee))}let b=n[32]>1&&ei(n);return{c(){e=x("div"),t=x("table"),o=x("thead"),l=x("tr"),s=x("th"),i=x("input"),c=F(),u=x("th"),u.textContent="Key",f=F(),m=x("th"),m.textContent="DomContext",p=F(),k=x("th"),d=Z("Translation ("),g=Z(n[6]),h=Z(")"),y=F(),v=x("tbody");for(let P=0;P<w.length;P+=1)w[P].c();C=F(),A=x("div"),B=x("p"),I=Z(n[2]),E=Z(" phrase(s)"),z=F(),b&&b.c(),r(i,"type","checkbox"),i.checked=n[13],r(i,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),r(s,"class","w-10 px-3 py-2.5"),r(u,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),r(m,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),r(k,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),r(l,"class","bg-gray-50 border-b border-gray-200"),r(t,"class","w-full"),r(e,"class","bg-white rounded-lg border border-gray-200 overflow-hidden"),r(B,"class","text-xs text-gray-400"),r(A,"class","flex items-center justify-between mt-3")},m(P,ee){W(P,e,ee),a(e,t),a(t,o),a(o,l),a(l,s),a(s,i),a(l,c),a(l,u),a(l,f),a(l,m),a(l,p),a(l,k),a(k,d),a(k,g),a(k,h),a(t,y),a(t,v);for(let K=0;K<w.length;K+=1)w[K]&&w[K].m(v,null);W(P,C,ee),W(P,A,ee),a(A,B),a(B,I),a(B,E),a(A,z),b&&b.m(A,null),j||(N=ie(i,"change",n[42]),j=!0)},p(P,ee){ee[0]&8192&&(i.checked=P[13]),ee[0]&64&&ce(g,P[6]),ee[0]&1174409345|ee[1]&33824&&(T=Oe(P[7]),w=er(w,ee,D,1,P,T,S,v,$n,$r,null,Pr)),ee[0]&4&&ce(I,P[2]),P[32]>1?b?b.p(P,ee):(b=ei(P),b.c(),b.m(A,null)):b&&(b.d(1),b=null)},d(P){P&&(H(e),H(C),H(A));for(let ee=0;ee<w.length;ee+=1)w[ee].d();b&&b.d(),j=!1,N()}}}function $l(n){let e;function t(s,i){return s[9]?fs:s[0]==="pending"?us:s[0]==="approved"?cs:as}let o=t(n),l=o(n);return{c(){e=x("div"),l.c(),r(e,"class","text-center py-12 text-gray-400")},m(s,i){W(s,e,i),l.m(e,null)},p(s,i){o===(o=t(s))&&l?l.p(s,i):(l.d(1),l=o(s),l&&(l.c(),l.m(e,null)))},d(s){s&&H(e),l.d()}}}function es(n){let e;return{c(){e=x("div"),e.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>',r(e,"class","flex justify-center py-8")},m(t,o){W(t,e,o)},p:je,d(t){t&&H(e)}}}function ts(n){let e,t=(n[94].value||"—")+"",o;return{c(){e=x("span"),o=Z(t),r(e,"class","text-sm text-gray-500")},m(l,s){W(l,e,s),a(e,o)},p(l,s){s[0]&128&&t!==(t=(l[94].value||"—")+"")&&ce(o,t)},d(l){l&&H(e)}}}function ns(n){let e,t,o,l;function s(...c){return n[73](n[94],n[95],n[96],...c)}function i(){return n[74](n[94])}return{c(){e=x("input"),r(e,"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"),e.value=t=n[94].value||"",r(e,"placeholder","Enter translation…")},m(c,u){W(c,e,u),o||(l=[ie(e,"input",s),ie(e,"change",i)],o=!0)},p(c,u){n=c,u[0]&128&&t!==(t=n[94].value||"")&&e.value!==t&&(e.value=t)},d(c){c&&H(e),o=!1,Ze(l)}}}function Xr(n){let e,t,o,l,s,i,c,u=n[94].key+"",f,m,p,k,d,g=(n[94].context||"—")+"",h,y,v,w,S,C,A,B,I=n[94].status+"",E,z,j,N,T,D=(n[94].created_at||"—")+"",b,P,ee;function K(Q,X){return Q[94].url?is:rs}let se=K(n),J=se(n);function he(Q,X){if(Q[94].url&&Q[26][Q[94].url])return os;if(Q[94].url&&Q[26][Q[94].url]===null)return ss;if(Q[94].url&&Q[26][Q[94].url]===!1)return ls}let U=he(n),R=U&&U(n);return{c(){e=x("tr"),t=x("td"),o=x("div"),l=x("div"),s=x("span"),s.textContent="Key",i=F(),c=x("span"),f=Z(u),m=F(),p=x("span"),p.textContent="DomContext",k=F(),d=x("span"),h=Z(g),y=F(),v=x("span"),v.textContent="Source URL",w=F(),J.c(),S=F(),C=x("span"),C.textContent="Status",A=F(),B=x("span"),E=Z(I),z=F(),j=x("span"),j.textContent="Discovered",N=F(),T=x("span"),b=Z(D),P=F(),R&&R.c(),ee=F(),r(s,"class","text-gray-400 font-medium"),r(c,"class","font-mono text-gray-700 break-all"),r(p,"class","text-gray-400 font-medium"),r(d,"class","text-gray-600 break-all"),r(v,"class","text-gray-400 font-medium"),r(C,"class","text-gray-400 font-medium"),r(B,"class","text-gray-600"),r(j,"class","text-gray-400 font-medium"),r(T,"class","text-gray-600"),r(l,"class","flex-1 grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm"),r(o,"class","flex gap-6"),r(t,"colspan","4"),r(t,"class","px-4 py-3"),r(e,"class","bg-gray-50 border-b border-gray-200")},m(Q,X){W(Q,e,X),a(e,t),a(t,o),a(o,l),a(l,s),a(l,i),a(l,c),a(c,f),a(l,m),a(l,p),a(l,k),a(l,d),a(d,h),a(l,y),a(l,v),a(l,w),J.m(l,null),a(l,S),a(l,C),a(l,A),a(l,B),a(B,E),a(l,z),a(l,j),a(l,N),a(l,T),a(T,b),a(o,P),R&&R.m(o,null),a(e,ee)},p(Q,X){X[0]&128&&u!==(u=Q[94].key+"")&&ce(f,u),X[0]&128&&g!==(g=(Q[94].context||"—")+"")&&ce(h,g),se===(se=K(Q))&&J?J.p(Q,X):(J.d(1),J=se(Q),J&&(J.c(),J.m(l,S))),X[0]&128&&I!==(I=Q[94].status+"")&&ce(E,I),X[0]&128&&D!==(D=(Q[94].created_at||"—")+"")&&ce(b,D),U===(U=he(Q))&&R?R.p(Q,X):(R&&R.d(1),R=U&&U(Q),R&&(R.c(),R.m(o,null)))},d(Q){Q&&H(e),J.d(),R&&R.d()}}}function rs(n){let e;return{c(){e=x("span"),e.textContent="—",r(e,"class","text-gray-400")},m(t,o){W(t,e,o)},p:je,d(t){t&&H(e)}}}function is(n){let e,t=n[94].url+"",o,l;return{c(){e=x("a"),o=Z(t),r(e,"href",l=n[94].url),r(e,"target","_blank"),r(e,"rel","noopener noreferrer"),r(e,"class","text-indigo-600 hover:underline break-all")},m(s,i){W(s,e,i),a(e,o)},p(s,i){i[0]&128&&t!==(t=s[94].url+"")&&ce(o,t),i[0]&128&&l!==(l=s[94].url)&&r(e,"href",l)},d(s){s&&H(e)}}}function ls(n){let e;return{c(){e=x("div"),e.textContent="No screenshot yet",r(e,"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(t,o){W(t,e,o)},p:je,d(t){t&&H(e)}}}function ss(n){let e;return{c(){e=x("div"),e.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>',r(e,"class","shrink-0 w-[280px] h-[160px] rounded border border-gray-200 bg-gray-100 flex items-center justify-center")},m(t,o){W(t,e,o)},p:je,d(t){t&&H(e)}}}function os(n){let e,t,o,l,s,i,c;return{c(){e=x("div"),t=x("p"),t.textContent="Page Screenshot",o=F(),l=x("a"),s=x("img"),r(t,"class","text-xs text-gray-400 mb-1"),wr(s.src,i="data:image/jpeg;base64,"+n[26][n[94].url])||r(s,"src",i),r(s,"alt","Page screenshot"),r(s,"class","rounded border border-gray-200 shadow-sm max-w-[280px] hover:opacity-90 transition-opacity"),r(l,"href",c=n[94].url),r(l,"target","_blank"),r(l,"rel","noopener noreferrer"),r(e,"class","shrink-0")},m(u,f){W(u,e,f),a(e,t),a(e,o),a(e,l),a(l,s)},p(u,f){f[0]&67108992&&!wr(s.src,i="data:image/jpeg;base64,"+u[26][u[94].url])&&r(s,"src",i),f[0]&128&&c!==(c=u[94].url)&&r(l,"href",c)},d(u){u&&H(e)}}}function $r(n,e){let t,o,l,s,i,c,u,f,m=e[94].key+"",p,k,d,g,h,y,v=(e[94].context||"—")+"",w,S,C,A,B,I,E,z,j;function N(){return e[71](e[94])}function T(){return e[72](e[94])}function D(se,J){return se[0]==="approved"?ns:ts}let b=D(e),P=b(e);function ee(){return e[75](e[94])}let K=e[25]===e[94].key_id&&Xr(e);return{key:n,first:null,c(){t=x("tr"),o=x("td"),l=x("input"),i=F(),c=x("td"),u=x("div"),f=x("span"),p=Z(m),k=F(),d=x("button"),d.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>',h=F(),y=x("td"),w=Z(v),C=F(),A=x("td"),P.c(),I=F(),K&&K.c(),E=at(),r(l,"type","checkbox"),l.checked=s=e[12].has(e[94].key_id),r(l,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),r(o,"class","px-3 py-2"),r(f,"class","truncate flex-1 min-w-0"),r(d,"class","shrink-0 p-0.5 text-gray-300 hover:text-indigo-500 transition-colors rounded"),r(d,"title","Edit vars"),r(u,"class","flex items-center gap-1 min-w-0"),r(c,"class","px-3 py-2 font-mono text-sm text-gray-700 max-w-[250px]"),r(c,"title",g=e[94].key),r(y,"class","px-3 py-2 text-xs text-gray-400 max-w-[180px] truncate"),r(y,"title",S=e[94].context),r(A,"class","px-3 py-2"),r(t,"class",B="border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer "+(!e[94].value&&e[0]==="approved"?"bg-amber-50":"")+" "+(e[25]===e[94].key_id?"bg-indigo-50":"")),this.first=t},m(se,J){W(se,t,J),a(t,o),a(o,l),a(t,i),a(t,c),a(c,u),a(u,f),a(f,p),a(u,k),a(u,d),a(t,h),a(t,y),a(y,w),a(t,C),a(t,A),P.m(A,null),W(se,I,J),K&&K.m(se,J),W(se,E,J),z||(j=[ie(l,"change",N),ie(o,"click",An(e[54])),ie(d,"click",An(T)),ie(c,"click",An(e[53])),ie(A,"click",An(e[52])),ie(t,"click",ee)],z=!0)},p(se,J){e=se,J[0]&4224&&s!==(s=e[12].has(e[94].key_id))&&(l.checked=s),J[0]&128&&m!==(m=e[94].key+"")&&ce(p,m),J[0]&128&&g!==(g=e[94].key)&&r(c,"title",g),J[0]&128&&v!==(v=(e[94].context||"—")+"")&&ce(w,v),J[0]&128&&S!==(S=e[94].context)&&r(y,"title",S),b===(b=D(e))&&P?P.p(e,J):(P.d(1),P=b(e),P&&(P.c(),P.m(A,null))),J[0]&33554561&&B!==(B="border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer "+(!e[94].value&&e[0]==="approved"?"bg-amber-50":"")+" "+(e[25]===e[94].key_id?"bg-indigo-50":""))&&r(t,"class",B),e[25]===e[94].key_id?K?K.p(e,J):(K=Xr(e),K.c(),K.m(E.parentNode,E)):K&&(K.d(1),K=null)},d(se){se&&(H(t),H(I),H(E)),P.d(),K&&K.d(se),z=!1,Ze(j)}}}function ei(n){let e,t,o,l,s,i,c,u,f,m,p,k,d,g,h,y,v,w,S,C,A,B,I,E,z,j,N,T,D;return{c(){e=x("div"),t=x("button"),o=Z("«"),s=F(),i=x("button"),c=Z("‹"),f=F(),m=x("span"),p=Z("Page "),k=Z(n[15]),d=Z(" of "),g=Z(n[32]),h=F(),y=x("button"),v=Z("›"),S=F(),C=x("button"),A=Z("»"),I=F(),E=x("select"),z=x("option"),z.textContent="25 / page",j=x("option"),j.textContent="50 / page",N=x("option"),N.textContent="100 / page",r(t,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),t.disabled=l=n[15]<=1,r(i,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),i.disabled=u=n[15]<=1,r(m,"class","px-3 py-1 text-xs text-gray-600"),r(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=n[15]>=n[32],r(C,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),C.disabled=B=n[15]>=n[32],z.__value=25,Ae(z,z.__value),j.__value=50,Ae(j,j.__value),N.__value=100,Ae(N,N.__value),r(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"),n[1]===void 0&&ht(()=>n[80].call(E)),r(e,"class","flex items-center gap-1")},m(b,P){W(b,e,P),a(e,t),a(t,o),a(e,s),a(e,i),a(i,c),a(e,f),a(e,m),a(m,p),a(m,k),a(m,d),a(m,g),a(e,h),a(e,y),a(y,v),a(e,S),a(e,C),a(C,A),a(e,I),a(e,E),a(E,z),a(E,j),a(E,N),Ve(E,n[1],!0),T||(D=[ie(t,"click",n[76]),ie(i,"click",n[77]),ie(y,"click",n[78]),ie(C,"click",n[79]),ie(E,"change",n[80]),ie(E,"change",n[81])],T=!0)},p(b,P){P[0]&32768&&l!==(l=b[15]<=1)&&(t.disabled=l),P[0]&32768&&u!==(u=b[15]<=1)&&(i.disabled=u),P[0]&32768&&ce(k,b[15]),P[1]&2&&ce(g,b[32]),P[0]&32768|P[1]&2&&w!==(w=b[15]>=b[32])&&(y.disabled=w),P[0]&32768|P[1]&2&&B!==(B=b[15]>=b[32])&&(C.disabled=B),P[0]&2&&Ve(E,b[1])},d(b){b&&H(e),T=!1,Ze(D)}}}function as(n){let e;return{c(){e=x("p"),e.textContent="Trash is empty."},m(t,o){W(t,e,o)},p:je,d(t){t&&H(e)}}}function cs(n){let e,t,o;return{c(){e=x("p"),e.textContent="No approved phrases yet.",t=F(),o=x("p"),o.textContent="Move phrases from Pending to start serving translations.",r(o,"class","text-sm mt-1")},m(l,s){W(l,e,s),W(l,t,s),W(l,o,s)},p:je,d(l){l&&(H(e),H(t),H(o))}}}function us(n){let e,t,o;return{c(){e=x("p"),e.textContent="No pending phrases.",t=F(),o=x("p"),o.textContent="Add the CDN script to a page to auto-discover text.",r(o,"class","text-sm mt-1")},m(l,s){W(l,e,s),W(l,t,s),W(l,o,s)},p:je,d(l){l&&(H(e),H(t),H(o))}}}function fs(n){let e,t,o,l;return{c(){e=x("p"),t=Z('No results for "'),o=Z(n[9]),l=Z('"')},m(s,i){W(s,e,i),a(e,t),a(e,o),a(e,l)},p(s,i){i[0]&512&&ce(o,s[9])},d(s){s&&H(e)}}}function ti(n){let e,t,o,l,s,i,c,u,f,m,p,k;return f=new Wl({props:{phraseKey:n[30].key,varSlots:n[83](),onSave:n[45]}}),{c(){e=x("div"),t=x("div"),o=x("div"),l=x("h2"),l.textContent="Edit Phrase Slots",s=F(),i=x("button"),i.textContent="×",c=F(),u=x("div"),It(f.$$.fragment),r(l,"class","text-sm font-semibold text-gray-800"),r(i,"class","text-gray-400 hover:text-gray-700 text-xl leading-none"),r(o,"class","flex items-center justify-between px-6 pt-5 pb-3 border-b border-gray-100"),r(u,"class","px-6 py-5"),r(t,"class","bg-white rounded-xl shadow-2xl w-full max-w-xl"),r(e,"class","fixed inset-0 z-50 flex items-center justify-center p-4"),Qn(e,"background","rgba(0,0,0,0.45)")},m(d,g){W(d,e,g),a(e,t),a(t,o),a(o,l),a(o,s),a(o,i),a(t,c),a(t,u),xt(f,u,null),m=!0,p||(k=[ie(i,"click",n[82]),ie(e,"click",yl(n[84]))],p=!0)},p(d,g){const h={};g[0]&1073741824&&(h.phraseKey=d[30].key),g[0]&1073741824&&(h.varSlots=d[83]()),f.$set(h)},i(d){m||(Qe(f.$$.fragment,d),m=!0)},o(d){ot(f.$$.fragment,d),m=!1},d(d){d&&H(e),Ct(f),p=!1,Ze(k)}}}function ds(n){let e,t,o,l,s,i,c,u,f,m,p,k,d,g,h,y,v,w,S,C,A,B,I,E,z,j,N,T,D,b,P,ee,K,se,J=Oe(["pending","approved","trash"]),he=[];for(let oe=0;oe<3;oe+=1)he[oe]=Mr(Dr(n,J,oe));let U=Oe(n[5]),R=[];for(let oe=0;oe<U.length;oe+=1)R[oe]=Ur(Nr(n,U,oe));let Q=n[0]==="approved"&&Zr(n),X=(n[0]==="pending"||n[0]==="approved")&&Kr(n),Y=n[19]&&Gr(n),me=n[20]&&Jr(n),pe=(n[12].size>0||n[16])&&Vr(n);function ve(oe,xe){return oe[14]?es:oe[7].length===0?$l:Xl}let be=ve(n),Be=be(n),ke=n[30]&&ti(n);return{c(){e=x("div"),t=x("div");for(let oe=0;oe<3;oe+=1)he[oe].c();o=F(),l=x("div"),s=x("select");for(let oe=0;oe<R.length;oe+=1)R[oe].c();i=F(),c=x("div"),u=x("select"),f=x("option"),f.textContent="All fields",m=x("option"),m.textContent="Key",p=x("option"),p.textContent="Context",k=x("option"),k.textContent="Translation",d=F(),g=x("div"),h=x("input"),v=F(),w=x("span"),w.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>',S=F(),C=x("select"),A=x("option"),A.textContent="All",B=x("option"),B.textContent="Translated",I=x("option"),I.textContent="Not Translated",E=F(),Q&&Q.c(),z=F(),X&&X.c(),j=F(),Y&&Y.c(),N=F(),me&&me.c(),T=F(),pe&&pe.c(),D=F(),Be.c(),b=F(),ke&&ke.c(),P=at(),r(t,"class","flex items-center gap-1 mb-4 border-b border-gray-200"),r(s,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),n[6]===void 0&&ht(()=>n[56].call(s)),f.__value="all",Ae(f,f.__value),m.__value="key",Ae(m,m.__value),p.__value="context",Ae(p,p.__value),k.__value="translation",Ae(k,k.__value),r(u,"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]"),n[10]===void 0&&ht(()=>n[57].call(u)),r(h,"type","text"),r(h,"placeholder",y=n[10]==="key"?"Search by key…":n[10]==="context"?"Search by context…":n[10]==="translation"?"Search by translated value…":"Search keys, context, translations…"),r(h,"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"),r(w,"class","absolute left-2.5 top-2.5 text-gray-400"),r(g,"class","flex-1 relative"),r(c,"class","flex-1 flex gap-0"),A.__value="all",Ae(A,A.__value),B.__value="yes",Ae(B,B.__value),I.__value="no",Ae(I,I.__value),r(C,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),n[11]===void 0&&ht(()=>n[60].call(C)),r(l,"class","flex flex-wrap items-center gap-3 mb-4")},m(oe,xe){W(oe,e,xe),a(e,t);for(let _=0;_<3;_+=1)he[_]&&he[_].m(t,null);a(e,o),a(e,l),a(l,s);for(let _=0;_<R.length;_+=1)R[_]&&R[_].m(s,null);Ve(s,n[6],!0),a(l,i),a(l,c),a(c,u),a(u,f),a(u,m),a(u,p),a(u,k),Ve(u,n[10],!0),a(c,d),a(c,g),a(g,h),Ae(h,n[9]),a(g,v),a(g,w),a(l,S),a(l,C),a(C,A),a(C,B),a(C,I),Ve(C,n[11],!0),a(l,E),Q&&Q.m(l,null),a(l,z),X&&X.m(l,null),a(e,j),Y&&Y.m(e,null),a(e,N),me&&me.m(e,null),a(e,T),pe&&pe.m(e,null),a(e,D),Be.m(e,null),W(oe,b,xe),ke&&ke.m(oe,xe),W(oe,P,xe),ee=!0,K||(se=[ie(s,"change",n[56]),ie(s,"change",n[39]),ie(u,"change",n[57]),ie(u,"change",n[58]),ie(h,"input",n[59]),ie(h,"input",n[40]),ie(C,"change",n[60]),ie(C,"change",n[61])],K=!0)},p(oe,xe){if(xe[0]&257|xe[1]&262272){J=Oe(["pending","approved","trash"]);let _;for(_=0;_<3;_+=1){const q=Dr(oe,J,_);he[_]?he[_].p(q,xe):(he[_]=Mr(q),he[_].c(),he[_].m(t,null))}for(;_<3;_+=1)he[_].d(1)}if(xe[0]&32){U=Oe(oe[5]);let _;for(_=0;_<U.length;_+=1){const q=Nr(oe,U,_);R[_]?R[_].p(q,xe):(R[_]=Ur(q),R[_].c(),R[_].m(s,null))}for(;_<R.length;_+=1)R[_].d(1);R.length=U.length}xe[0]&96&&Ve(s,oe[6]),xe[0]&1024&&Ve(u,oe[10]),(!ee||xe[0]&1024&&y!==(y=oe[10]==="key"?"Search by key…":oe[10]==="context"?"Search by context…":oe[10]==="translation"?"Search by translated value…":"Search keys, context, translations…"))&&r(h,"placeholder",y),xe[0]&512&&h.value!==oe[9]&&Ae(h,oe[9]),xe[0]&2048&&Ve(C,oe[11]),oe[0]==="approved"?Q?Q.p(oe,xe):(Q=Zr(oe),Q.c(),Q.m(l,z)):Q&&(Q.d(1),Q=null),oe[0]==="pending"||oe[0]==="approved"?X?X.p(oe,xe):(X=Kr(oe),X.c(),X.m(l,null)):X&&(X.d(1),X=null),oe[19]?Y?Y.p(oe,xe):(Y=Gr(oe),Y.c(),Y.m(e,N)):Y&&(Y.d(1),Y=null),oe[20]?me?me.p(oe,xe):(me=Jr(oe),me.c(),me.m(e,T)):me&&(me.d(1),me=null),oe[12].size>0||oe[16]?pe?pe.p(oe,xe):(pe=Vr(oe),pe.c(),pe.m(e,D)):pe&&(pe.d(1),pe=null),be===(be=ve(oe))&&Be?Be.p(oe,xe):(Be.d(1),Be=be(oe),Be&&(Be.c(),Be.m(e,null))),oe[30]?ke?(ke.p(oe,xe),xe[0]&1073741824&&Qe(ke,1)):(ke=ti(oe),ke.c(),Qe(ke,1),ke.m(P.parentNode,P)):ke&&(ln(),ot(ke,1,1,()=>{ke=null}),sn())},i(oe){ee||(Qe(ke),ee=!0)},o(oe){ot(ke),ee=!1},d(oe){oe&&(H(e),H(b),H(P)),qe(he,oe),qe(R,oe),Q&&Q.d(),X&&X.d(),Y&&Y.d(),me&&me.d(),pe&&pe.d(),Be.d(),ke&&ke.d(oe),K=!1,Ze(se)}}}const zn=50;function ni(n,e){const t=URL.createObjectURL(n),o=document.createElement("a");o.href=t,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(t)}function hs(n,e,t){let o,l,s;Rn(n,gt,ue=>t(86,s=ue));let{params:i={}}=e;const c=["pending","approved","trash"],u=[25,50,100];let m=[{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 p(ue){const Se=new URLSearchParams(ue||"");return{page:Math.max(1,parseInt(Se.get("page"),10)||1),pageSize:u.includes(parseInt(Se.get("pageSize"),10))?parseInt(Se.get("pageSize"),10):50,lang:Se.get("lang")||null,search:Se.get("search")||"",filter:["all","yes","no"].includes(Se.get("filter"))?Se.get("filter"):"all"}}let k="zh-Hans",d=c.includes(i.tab)?i.tab:"pending",g=[],h={pending:0,approved:0,trash:0},y="",v="all",w="all",S=new Set,C=!1,A=!1,B=!1,I=1,E=50,z=0;function j(){const ue=new URLSearchParams;I>1&&ue.set("page",I),E!==50&&ue.set("pageSize",E),k&&ue.set("lang",k),y.trim()&&ue.set("search",y.trim()),w!=="all"&&ue.set("filter",w);const Se=ue.toString(),Ue=`/translations/${c.includes(i.tab)?i.tab:d}${Se?"?"+Se:""}`;window.location.replace("#"+Ue)}let N=!1,T="",D=0,b=0,P=0,ee=!1,K=!1,se="",J="",he="",U="",R=null,Q={},X=!1,Y="",me=!1,pe=null;async function ve(){t(27,X=!0),t(28,Y=""),t(29,me=!1);try{const ue=await Re("../api/export");if(!ue.ok)throw new Error("Export failed");const Se=await ue.json();if(Se.error)throw new Error(Se.error);const Ie=new Blob([JSON.stringify(Se,null,2)],{type:"application/json"});ni(Ie,"loco-translations.json"),t(28,Y="Downloaded!"),setTimeout(()=>t(28,Y=""),2e3)}catch(ue){t(28,Y=ue.message||"Export failed"),setTimeout(()=>t(28,Y=""),3e3)}finally{t(27,X=!1)}}async function be(){t(27,X=!0),t(28,Y=""),t(29,me=!1);try{const ue=await Re("../api/export");if(!ue.ok)throw new Error("Export failed");const Se=await ue.json();if(Se.error)throw new Error(Se.error);const Ie=Se.languages||[];if(Ie.length===0)throw new Error("No translations to export");const Ue=new Jl;for(const Ge of Ie){const ut={languages:[Ge],languageNames:Se.languageNames,translations:{[Ge]:Se.translations[Ge]},timestamp:Se.timestamp};Ue.file(`${Ge}.json`,JSON.stringify(ut,null,2))}const lt=await Ue.generateAsync({type:"blob"});ni(lt,"loco-translations.zip"),t(28,Y=`Downloaded ZIP with ${Ie.length} language(s)!`),setTimeout(()=>t(28,Y=""),2e3)}catch(ue){t(28,Y=ue.message||"Export failed"),setTimeout(()=>t(28,Y=""),3e3)}finally{t(27,X=!1)}}async function Be(ue){if(!ue||Q[ue]!==void 0)return;t(26,Q[ue]=null,Q);const Ie=await(await Re(`../api/screenshots?url=${encodeURIComponent(ue)}`)).json();t(26,Q[ue]=Ie.screenshot||!1,Q),t(26,Q)}Dn(()=>{const ue=window.location.hash||"",Se=ue.indexOf("?"),Ie=Se>=0?ue.slice(Se+1):"",Ue=p(Ie);t(15,I=Ue.page),t(1,E=Ue.pageSize),t(9,y=Ue.search),t(11,w=Ue.filter);try{const lt=JSON.parse(s.settings||"{}");lt.languages&&lt.languages.length&&t(5,m=lt.languages)}catch{}Ue.lang?t(6,k=Ue.lang):m.length&&t(6,k=m[0].code||m[0]),t(51,C=!0),j(),ke()});async function ke(){t(14,B=!0),await Promise.all([oe(),xe()]),t(14,B=!1)}async function oe(){const ue=new URLSearchParams({lang:k,status:d,page:I,limit:E});y.trim()&&(ue.set("search",y.trim()),v!=="all"&&ue.set("search_field",v)),w!=="all"&&ue.set("translated",w);const Ie=await(await Re(`../api/translations/all?${ue}`)).json();t(7,g=Ie.rows),t(2,z=Ie.total),t(12,S=new Set),t(13,A=!1)}async function xe(){const ue=await Re("../api/translations/counts");t(8,h=await ue.json())}function _(ue){Qt(`/translations/${ue}`)}function q(){t(15,I=1),j(),ke()}let V;function L(){clearTimeout(V),V=setTimeout(()=>{t(15,I=1),j(),oe()},300)}function O(ue){S.has(ue)?S.delete(ue):S.add(ue),t(12,S=new Set(S)),t(13,A=S.size===g.length&&g.length>0)}function M(){A?(t(12,S=new Set),t(13,A=!1)):(t(12,S=new Set(g.map(ue=>ue.key_id))),t(13,A=!0))}const $={pending:"Moving to Pending",approved:"Approving",trash:"Trashing"};async function te(ue){if(S.size===0||N)return;const Se=[...S];t(16,N=!0),t(17,T=$[ue]||"Moving"),t(3,D=0),t(4,b=Se.length),t(18,P=0),await Ln();try{for(let Ie=0;Ie<Se.length;Ie+=zn){const Ue=Se.slice(Ie,Ie+zn);try{(await Re("../api/textnodes/status",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:Ue,status:ue})})).ok||t(18,P+=Ue.length)}catch{t(18,P+=Ue.length)}t(3,D=Math.min(Ie+Ue.length,Se.length))}await ke()}finally{t(16,N=!1),P===0&&(t(3,D=0),t(4,b=0))}}async function G(){if(S.size===0||N||!confirm(`Permanently delete ${S.size} item(s)? This cannot be undone.`))return;const ue=[...S];t(16,N=!0),t(17,T="Deleting"),t(3,D=0),t(4,b=ue.length),t(18,P=0),await Ln();try{for(let Se=0;Se<ue.length;Se+=zn){const Ie=ue.slice(Se,Se+zn);try{(await Re("../api/textnodes/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:Ie})})).ok||t(18,P+=Ie.length)}catch{t(18,P+=Ie.length)}t(3,D=Math.min(Se+Ie.length,ue.length))}await ke()}finally{t(16,N=!1),P===0&&(t(3,D=0),t(4,b=0))}}async function ae(ue,Se){const Ie=pe;if(!Ie)return;const Ue=Ie.key,lt=Ie.var_slots;t(7,g=g.map(Ge=>Ge.key_id===Ie.key_id?{...Ge,key:ue,var_slots:JSON.stringify(Se)}:Ge)),t(30,pe=null);try{const Ge=await Re(`../api/phrases/${Ie.key_id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:ue,varSlots:Se})});if(!Ge.ok){const ut=await Ge.json().catch(()=>({}));throw new Error(ut.error||`Save failed (HTTP ${Ge.status})`)}await Promise.all([oe(),xe()])}catch(Ge){t(7,g=g.map(ut=>ut.key_id===Ie.key_id?{...ut,key:Ue,var_slots:lt}:ut)),console.warn("[loco] Failed to save var edits:",Ge)}}async function _e(ue){await Re("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:k,translations:{[ue.key]:ue.value||""}})})}async function le(){se.trim()&&(await Re("../api/textnodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:se.trim(),context:J.trim(),status:d})}),he.trim()&&await Re("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:k,translations:[{key:se.trim(),context:J.trim(),value:he.trim()}]})}),t(21,se=""),t(22,J=""),t(23,he=""),t(19,ee=!1),await ke())}async function ge(){let ue;try{ue=JSON.parse(U)}catch{alert("Invalid JSON");return}await Re("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:k,translations:ue})}),t(24,U=""),t(20,K=!1),await ke()}const ze={pending:{label:"Pending",icon:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="#d97706" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',actions:[{label:"Approve Selected",status:"approved",color:"bg-green-600 hover:bg-green-700"},{label:"Trash Selected",status:"trash",color:"bg-red-600 hover:bg-red-700"}]},approved:{label:"Approved",icon:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="#16a34a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',actions:[{label:"Move to Pending",status:"pending",color:"bg-yellow-600 hover:bg-yellow-700"},{label:"Trash Selected",status:"trash",color:"bg-red-600 hover:bg-red-700"}]},trash:{label:"Trash",icon:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="#dc2626" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>',actions:[{label:"Restore to Pending",status:"pending",color:"bg-blue-600 hover:bg-blue-700"},{label:"Move to Approved",status:"approved",color:"bg-green-600 hover:bg-green-700"}]}};function we(ue){nn.call(this,n,ue)}function Fe(ue){nn.call(this,n,ue)}function De(ue){nn.call(this,n,ue)}const Pe=ue=>_(ue);function Ne(){k=vt(this),t(6,k),t(5,m)}function Le(){v=vt(this),t(10,v),t(51,C),t(50,i),t(0,d)}const Ke=()=>{y.trim()&&(t(15,I=1),j(),oe())};function Me(){y=this.value,t(9,y),t(51,C),t(50,i),t(0,d)}function We(){w=vt(this),t(11,w),t(51,C),t(50,i),t(0,d)}const ye=()=>{t(15,I=1),j(),oe()},fe=()=>t(29,me=!me),ne=()=>t(29,me=!1),Ee=()=>{t(20,K=!K),t(19,ee=!1)},Ce=()=>{t(19,ee=!ee),t(20,K=!1)};function He(){se=this.value,t(21,se)}function ct(){J=this.value,t(22,J)}function jt(){he=this.value,t(23,he)}function on(){U=this.value,t(24,U)}const _t=ue=>te(ue.status),dt=ue=>O(ue.key_id),Ft=ue=>{t(30,pe=ue)},Pt=(ue,Se,Ie,Ue)=>t(7,Se[Ie].value=Ue.target.value,g),Rt=ue=>_e(ue),an=ue=>{const Se=R===ue.key_id;t(25,R=Se?null:ue.key_id),!Se&&ue.url&&Be(ue.url)},Nt=()=>{t(15,I=1),j(),oe()},Dt=()=>{t(15,I--,I),j(),oe()},Yt=()=>{t(15,I++,I),j(),oe()},cn=()=>{t(15,I=o),j(),oe()};function pt(){E=vt(this),t(1,E)}const Mt=()=>{t(15,I=1),j(),oe()},un=()=>t(30,pe=null),Ut=()=>{try{return JSON.parse(pe.var_slots||"[]")}catch{return[]}},fn=()=>t(30,pe=null);return n.$$set=ue=>{"params"in ue&&t(50,i=ue.params)},n.$$.update=()=>{if(n.$$.dirty[0]&1|n.$$.dirty[1]&1572864&&C){const ue=c.includes(i.tab)?i.tab:"pending";ue!==d&&(t(0,d=ue),t(9,y=""),t(10,v="all"),t(11,w="all"),t(15,I=1),j(),ke())}n.$$.dirty[0]&6&&t(32,o=Math.max(1,Math.ceil(z/E))),n.$$.dirty[0]&24&&t(31,l=b>0?Math.round(D/b*100):0)},[d,E,z,D,b,m,k,g,h,y,v,w,S,A,B,I,N,T,P,ee,K,se,J,he,U,R,Q,X,Y,me,pe,l,o,j,ve,be,Be,oe,_,q,L,O,M,te,G,ae,_e,le,ge,ze,i,C,we,Fe,De,Pe,Ne,Le,Ke,Me,We,ye,fe,ne,Ee,Ce,He,ct,jt,on,_t,dt,Ft,Pt,Rt,an,Nt,Dt,Yt,cn,pt,Mt,un,Ut,fn]}class ri extends Lt{constructor(e){super(),Ot(this,e,hs,ds,St,{params:50},null,[-1,-1,-1,-1])}}function ii(n,e,t){const o=n.slice();return o[86]=e[t],o}function li(n,e,t){const o=n.slice();return o[73]=e[t],o}function si(n,e,t){const o=n.slice();return o[70]=e[t],o}function oi(n,e,t){const o=n.slice();return o[73]=e[t],o}function ai(n,e,t){const o=n.slice();return o[76]=e[t],o}function ci(n,e,t){const o=n.slice();return o[79]=e[t],o}function ui(n,e,t){const o=n.slice();return o[79]=e[t],o}function fi(n,e,t){const o=n.slice();return o[89]=e[t],o}function di(n){let e,t,o=n[89].icon+"",l,s=n[89].label+"",i,c,u,f,m;function p(){return n[38](n[89])}return{c(){e=x("button"),t=x("span"),l=F(),i=Z(s),c=F(),r(t,"class","inline-flex items-center"),r(e,"class",u="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px "+(n[20]===n[89].id?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))},m(k,d){W(k,e,d),a(e,t),t.innerHTML=o,a(e,l),a(e,i),a(e,c),f||(m=ie(e,"click",p),f=!0)},p(k,d){n=k,d[0]&1048576&&u!==(u="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px "+(n[20]===n[89].id?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))&&r(e,"class",u)},d(k){k&&H(e),f=!1,m()}}}function ps(n){let e,t,o=n[11].length+"",l,s,i,c,u,f,m,p;function k(h,y){return h[11].length===0?bs:_s}let d=k(n),g=d(n);return{c(){e=x("div"),t=x("p"),l=Z(o),s=Z(" job(s) in history"),i=F(),c=x("button"),c.textContent="Refresh",u=F(),g.c(),f=at(),r(t,"class","text-sm text-gray-500"),r(c,"class","px-3 py-1.5 text-xs border border-gray-300 rounded hover:bg-gray-50"),r(e,"class","flex items-center justify-between mb-4")},m(h,y){W(h,e,y),a(e,t),a(t,l),a(t,s),a(e,i),a(e,c),W(h,u,y),g.m(h,y),W(h,f,y),m||(p=ie(c,"click",n[26]),m=!0)},p(h,y){y[0]&2048&&o!==(o=h[11].length+"")&&ce(l,o),d===(d=k(h))&&g?g.p(h,y):(g.d(1),g=d(h),g&&(g.c(),g.m(f.parentNode,f)))},d(h){h&&(H(e),H(u),H(f)),g.d(h),m=!1,p()}}}function ms(n){let e,t,o=n[3].length+"",l,s,i,c,u,f,m,p,k,d=n[6]&&pi(n);function g(v,w){return v[3].length===0&&!v[6]?ks:ys}let h=g(n),y=h(n);return{c(){e=x("div"),t=x("p"),l=Z(o),s=Z(" prompt template(s)"),i=F(),c=x("button"),c.textContent="+ New Prompt",u=F(),d&&d.c(),f=F(),y.c(),m=at(),r(t,"class","text-sm text-gray-500"),r(c,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700"),r(e,"class","flex items-center justify-between mb-4")},m(v,w){W(v,e,w),a(e,t),a(t,l),a(t,s),a(e,i),a(e,c),W(v,u,w),d&&d.m(v,w),W(v,f,w),y.m(v,w),W(v,m,w),p||(k=ie(c,"click",n[27]),p=!0)},p(v,w){w[0]&8&&o!==(o=v[3].length+"")&&ce(l,o),v[6]?d?d.p(v,w):(d=pi(v),d.c(),d.m(f.parentNode,f)):d&&(d.d(1),d=null),h===(h=g(v))&&y?y.p(v,w):(y.d(1),y=h(v),y&&(y.c(),y.m(m.parentNode,m)))},d(v){v&&(H(e),H(u),H(f),H(m)),d&&d.d(v),y.d(v),p=!1,k()}}}function gs(n){let e=n[10].filter(Li).length>0,t,o=n[10].filter(Oi).length>0,l,s,i,c,u,f,m,p,k,d,g,h,y,v,w,S,C,A,B,I,E,z,j,N,T,D,b,P,ee=n[14].size+"",K,se,J,he,U,R,Q=n[23]!=null?` (${n[23]})`:"",X,Y,me,pe,ve,be,Be,ke,oe,xe,_,q,V,L,O,M,$,te,G,ae,_e,le=e&&bi(n),ge=o&&xi(n),ze=Oe(n[12]),we=[];for(let ne=0;ne<ze.length;ne+=1)we[ne]=Si(ai(n,ze,ne));let Fe=n[3].length===0&&Ai(),De=Oe(n[3]),Pe=[];for(let ne=0;ne<De.length;ne+=1)Pe[ne]=Ei(oi(n,De,ne));let Ne=n[17]&&Ti();function Le(ne,Ee){return ne[22]?Cs:xs}let Ke=Le(n),Me=Ke(n);function We(ne,Ee){return ne[13].length===0?As:Ss}let ye=We(n),fe=ye(n);return{c(){le&&le.c(),t=F(),ge&&ge.c(),l=F(),s=x("div"),i=x("div"),c=x("label"),c.textContent="Language",u=F(),f=x("select");for(let ne=0;ne<we.length;ne+=1)we[ne].c();m=F(),p=x("div"),k=x("label"),k.textContent="Prompt Template",d=F(),g=x("select"),Fe&&Fe.c(),h=at();for(let ne=0;ne<Pe.length;ne+=1)Pe[ne].c();y=F(),v=x("div"),w=x("div"),w.textContent=" ",S=F(),C=x("label"),A=x("input"),B=Z(`
14
+ Include screenshots`),I=F(),E=x("div"),z=F(),j=x("div"),N=x("div"),N.textContent=" ",T=F(),D=x("div"),b=x("button"),Ne&&Ne.c(),P=Z(`
15
+ Generate (`),K=Z(ee),se=Z(" selected)"),he=F(),U=x("button"),Me.c(),R=Z(`
16
+ Translate All`),X=Z(Q),me=F(),pe=x("div"),ve=x("div"),be=x("input"),Be=F(),ke=x("span"),ke.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>',oe=F(),xe=x("select"),_=x("option"),_.textContent="All",q=x("option"),q.textContent="Translated",V=x("option"),V.textContent="Not Translated",L=F(),O=x("span"),M=Z(n[2]),$=Z(" approved items"),te=F(),fe.c(),G=at(),r(c,"for","ai-translate-language"),r(c,"class","text-xs text-gray-500 font-medium"),r(f,"id","ai-translate-language"),r(f,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),n[0]===void 0&&ht(()=>n[40].call(f)),r(i,"class","flex flex-col gap-1"),r(k,"for","ai-translate-prompt"),r(k,"class","text-xs text-gray-500 font-medium"),r(g,"id","ai-translate-prompt"),r(g,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),n[4]===void 0&&ht(()=>n[42].call(g)),r(p,"class","flex flex-col gap-1"),r(w,"class","text-xs text-gray-500 font-medium"),r(w,"aria-hidden","true"),r(A,"type","checkbox"),r(A,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),r(C,"class","flex items-center gap-2 text-sm text-gray-600 cursor-pointer"),r(v,"class","flex flex-col gap-1 justify-end"),r(E,"class","flex-1"),r(N,"class","text-xs text-gray-500 font-medium"),r(N,"aria-hidden","true"),r(b,"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"),b.disabled=J=n[14].size===0||!n[4]||n[17],r(U,"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"),U.disabled=Y=!n[4]||n[22]||n[23]===0,r(D,"class","flex items-center gap-2"),r(j,"class","flex flex-col gap-1 justify-end"),r(s,"class","flex flex-wrap items-center gap-3 mb-4 p-4 bg-white border border-gray-200 rounded-lg"),r(be,"type","text"),r(be,"placeholder","Search approved keys…"),r(be,"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"),r(ke,"class","absolute left-2.5 top-2.5 text-gray-400 flex items-center"),r(ve,"class","flex-1 relative"),_.__value="all",Ae(_,_.__value),q.__value="translated",Ae(q,q.__value),V.__value="untranslated",Ae(V,V.__value),r(xe,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),n[19]===void 0&&ht(()=>n[45].call(xe)),r(O,"class","text-xs text-gray-400"),r(pe,"class","flex items-center gap-3 mb-3")},m(ne,Ee){le&&le.m(ne,Ee),W(ne,t,Ee),ge&&ge.m(ne,Ee),W(ne,l,Ee),W(ne,s,Ee),a(s,i),a(i,c),a(i,u),a(i,f);for(let Ce=0;Ce<we.length;Ce+=1)we[Ce]&&we[Ce].m(f,null);Ve(f,n[0],!0),a(s,m),a(s,p),a(p,k),a(p,d),a(p,g),Fe&&Fe.m(g,null),a(g,h);for(let Ce=0;Ce<Pe.length;Ce+=1)Pe[Ce]&&Pe[Ce].m(g,null);Ve(g,n[4],!0),a(s,y),a(s,v),a(v,w),a(v,S),a(v,C),a(C,A),A.checked=n[16],a(C,B),a(s,I),a(s,E),a(s,z),a(s,j),a(j,N),a(j,T),a(j,D),a(D,b),Ne&&Ne.m(b,null),a(b,P),a(b,K),a(b,se),a(D,he),a(D,U),Me.m(U,null),a(U,R),a(U,X),W(ne,me,Ee),W(ne,pe,Ee),a(pe,ve),a(ve,be),Ae(be,n[18]),a(ve,Be),a(ve,ke),a(pe,oe),a(pe,xe),a(xe,_),a(xe,q),a(xe,V),Ve(xe,n[19],!0),a(pe,L),a(pe,O),a(O,M),a(O,$),W(ne,te,Ee),fe.m(ne,Ee),W(ne,G,Ee),ae||(_e=[ie(f,"change",n[40]),ie(f,"change",n[41]),ie(g,"change",n[42]),ie(A,"change",n[43]),ie(b,"click",n[34]),ie(U,"click",n[35]),ie(be,"input",n[44]),ie(be,"input",n[33]),ie(xe,"change",n[45]),ie(xe,"change",n[46])],ae=!0)},p(ne,Ee){if(Ee[0]&1024&&(e=ne[10].filter(Li).length>0),e?le?le.p(ne,Ee):(le=bi(ne),le.c(),le.m(t.parentNode,t)):le&&(le.d(1),le=null),Ee[0]&1024&&(o=ne[10].filter(Oi).length>0),o?ge?ge.p(ne,Ee):(ge=xi(ne),ge.c(),ge.m(l.parentNode,l)):ge&&(ge.d(1),ge=null),Ee[0]&4096){ze=Oe(ne[12]);let Ce;for(Ce=0;Ce<ze.length;Ce+=1){const He=ai(ne,ze,Ce);we[Ce]?we[Ce].p(He,Ee):(we[Ce]=Si(He),we[Ce].c(),we[Ce].m(f,null))}for(;Ce<we.length;Ce+=1)we[Ce].d(1);we.length=ze.length}if(Ee[0]&4097&&Ve(f,ne[0]),ne[3].length===0?Fe||(Fe=Ai(),Fe.c(),Fe.m(g,h)):Fe&&(Fe.d(1),Fe=null),Ee[0]&8){De=Oe(ne[3]);let Ce;for(Ce=0;Ce<De.length;Ce+=1){const He=oi(ne,De,Ce);Pe[Ce]?Pe[Ce].p(He,Ee):(Pe[Ce]=Ei(He),Pe[Ce].c(),Pe[Ce].m(g,null))}for(;Ce<Pe.length;Ce+=1)Pe[Ce].d(1);Pe.length=De.length}Ee[0]&24&&Ve(g,ne[4]),Ee[0]&65536&&(A.checked=ne[16]),ne[17]?Ne||(Ne=Ti(),Ne.c(),Ne.m(b,P)):Ne&&(Ne.d(1),Ne=null),Ee[0]&16384&&ee!==(ee=ne[14].size+"")&&ce(K,ee),Ee[0]&147480&&J!==(J=ne[14].size===0||!ne[4]||ne[17])&&(b.disabled=J),Ke!==(Ke=Le(ne))&&(Me.d(1),Me=Ke(ne),Me&&(Me.c(),Me.m(U,R))),Ee[0]&8388608&&Q!==(Q=ne[23]!=null?` (${ne[23]})`:"")&&ce(X,Q),Ee[0]&12582936&&Y!==(Y=!ne[4]||ne[22]||ne[23]===0)&&(U.disabled=Y),Ee[0]&262144&&be.value!==ne[18]&&Ae(be,ne[18]),Ee[0]&524288&&Ve(xe,ne[19]),Ee[0]&4&&ce(M,ne[2]),ye===(ye=We(ne))&&fe?fe.p(ne,Ee):(fe.d(1),fe=ye(ne),fe&&(fe.c(),fe.m(G.parentNode,G)))},d(ne){ne&&(H(t),H(l),H(s),H(me),H(pe),H(te),H(G)),le&&le.d(ne),ge&&ge.d(ne),qe(we,ne),Fe&&Fe.d(),qe(Pe,ne),Ne&&Ne.d(),Me.d(),fe.d(ne),ae=!1,Ze(_e)}}}function _s(n){let e,t,o,l,s,i=Oe(n[11]),c=[];for(let u=0;u<i.length;u+=1)c[u]=hi(ii(n,i,u));return{c(){e=x("div"),t=x("table"),o=x("thead"),o.innerHTML='<tr class="bg-gray-50 border-b border-gray-200"><th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Status</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Job ID</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Prompt</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Language</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Progress</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Started</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Finished</th></tr>',l=F(),s=x("tbody");for(let u=0;u<c.length;u+=1)c[u].c();r(t,"class","w-full"),r(e,"class","bg-white rounded-lg border border-gray-200 overflow-hidden")},m(u,f){W(u,e,f),a(e,t),a(t,o),a(t,l),a(t,s);for(let m=0;m<c.length;m+=1)c[m]&&c[m].m(s,null)},p(u,f){if(f[0]&2048|f[1]&64){i=Oe(u[11]);let m;for(m=0;m<i.length;m+=1){const p=ii(u,i,m);c[m]?c[m].p(p,f):(c[m]=hi(p),c[m].c(),c[m].m(s,null))}for(;m<c.length;m+=1)c[m].d(1);c.length=i.length}},d(u){u&&H(e),qe(c,u)}}}function bs(n){let e;return{c(){e=x("div"),e.innerHTML="<p>No translation jobs yet.</p>",r(e,"class","text-center py-12 text-gray-400")},m(t,o){W(t,e,o)},p:je,d(t){t&&H(e)}}}function hi(n){let e,t,o,l,s=n[37](n[86].status)+"",i,c=n[86].status+"",u,f,m,p,k=n[86].job_id+"",d,g,h,y=(n[86].prompt_name||"—")+"",v,w,S,C=n[86].lang+"",A,B,I,E=n[86].completed+"",z,j,N=n[86].total+"",T,D,b=n[86].failed+"",P,ee,K,se,J=wt(n[86].created_at)+"",he,U,R,Q=wt(n[86].finished_at)+"",X,Y;return{c(){e=x("tr"),t=x("td"),o=x("span"),l=new sl(!1),i=F(),u=Z(c),m=F(),p=x("td"),d=Z(k),g=F(),h=x("td"),v=Z(y),w=F(),S=x("td"),A=Z(C),B=F(),I=x("td"),z=Z(E),j=Z("/"),T=Z(N),D=Z(" ("),P=Z(b),ee=Z(" failed)"),K=F(),se=x("td"),he=Z(J),U=F(),R=x("td"),X=Z(Q),Y=F(),l.a=i,r(o,"class",f=Pn(n[86].status)+" text-sm font-medium inline-flex items-center gap-1"),r(t,"class","px-3 py-2"),r(p,"class","px-3 py-2 text-xs font-mono text-gray-500"),r(h,"class","px-3 py-2 text-sm text-gray-700"),r(S,"class","px-3 py-2 text-sm text-gray-600"),r(I,"class","px-3 py-2 text-sm text-gray-600"),r(se,"class","px-3 py-2 text-xs text-gray-400"),r(R,"class","px-3 py-2 text-xs text-gray-400"),r(e,"class","border-b border-gray-100 hover:bg-gray-50")},m(me,pe){W(me,e,pe),a(e,t),a(t,o),l.m(s,o),a(o,i),a(o,u),a(e,m),a(e,p),a(p,d),a(e,g),a(e,h),a(h,v),a(e,w),a(e,S),a(S,A),a(e,B),a(e,I),a(I,z),a(I,j),a(I,T),a(I,D),a(I,P),a(I,ee),a(e,K),a(e,se),a(se,he),a(e,U),a(e,R),a(R,X),a(e,Y)},p(me,pe){pe[0]&2048&&s!==(s=me[37](me[86].status)+"")&&l.p(s),pe[0]&2048&&c!==(c=me[86].status+"")&&ce(u,c),pe[0]&2048&&f!==(f=Pn(me[86].status)+" text-sm font-medium inline-flex items-center gap-1")&&r(o,"class",f),pe[0]&2048&&k!==(k=me[86].job_id+"")&&ce(d,k),pe[0]&2048&&y!==(y=(me[86].prompt_name||"—")+"")&&ce(v,y),pe[0]&2048&&C!==(C=me[86].lang+"")&&ce(A,C),pe[0]&2048&&E!==(E=me[86].completed+"")&&ce(z,E),pe[0]&2048&&N!==(N=me[86].total+"")&&ce(T,N),pe[0]&2048&&b!==(b=me[86].failed+"")&&ce(P,b),pe[0]&2048&&J!==(J=wt(me[86].created_at)+"")&&ce(he,J),pe[0]&2048&&Q!==(Q=wt(me[86].finished_at)+"")&&ce(X,Q)},d(me){me&&H(e)}}}function pi(n){let e,t,o=n[5]?`Edit: ${n[5].name}`:"New Prompt Template",l,s,i,c,u,f,m,p,k,d,g,h,y,v,w,S,C,A,B,I,E,z,j=n[5]?"Update":"Create",N,T,D,b,P;return{c(){e=x("div"),t=x("h3"),l=Z(o),s=F(),i=x("div"),c=x("div"),u=x("label"),u.textContent="Name",f=F(),m=x("input"),p=F(),k=x("div"),d=x("label"),g=Z("Prompt "),h=x("span"),h.textContent="(use {{TARGET_LANGUAGE}}, {{CONTEXT}}, {{TEXT}} placeholders)",y=F(),v=x("textarea"),w=F(),S=x("div"),C=x("label"),C.textContent="System Message",A=F(),B=x("textarea"),I=F(),E=x("div"),z=x("button"),N=Z(j),T=F(),D=x("button"),D.textContent="Cancel",r(t,"class","text-sm font-semibold text-gray-700 mb-3"),r(u,"for","prompt-name"),r(u,"class","block text-xs text-gray-500 font-medium mb-1"),r(m,"id","prompt-name"),r(m,"placeholder","e.g. Medical Translation, Marketing Copy…"),r(m,"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"),r(h,"class","text-gray-400"),r(d,"for","prompt-template"),r(d,"class","block text-xs text-gray-500 font-medium mb-1"),r(v,"id","prompt-template"),r(v,"rows","8"),r(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"),r(C,"for","prompt-system-message"),r(C,"class","block text-xs text-gray-500 font-medium mb-1"),r(B,"id","prompt-system-message"),r(B,"rows","2"),r(B,"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"),r(z,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700"),r(D,"class","px-4 py-2 border border-gray-300 text-sm rounded-md hover:bg-gray-50"),r(E,"class","flex gap-2"),r(i,"class","space-y-3"),r(e,"class","mb-6 p-5 bg-white border border-indigo-200 rounded-lg shadow-sm")},m(ee,K){W(ee,e,K),a(e,t),a(t,l),a(e,s),a(e,i),a(i,c),a(c,u),a(c,f),a(c,m),Ae(m,n[7]),a(i,p),a(i,k),a(k,d),a(d,g),a(d,h),a(k,y),a(k,v),Ae(v,n[8]),a(i,w),a(i,S),a(S,C),a(S,A),a(S,B),Ae(B,n[9]),a(i,I),a(i,E),a(E,z),a(z,N),a(E,T),a(E,D),b||(P=[ie(m,"input",n[54]),ie(v,"input",n[55]),ie(B,"input",n[56]),ie(z,"click",n[29]),ie(D,"click",n[57])],b=!0)},p(ee,K){K[0]&32&&o!==(o=ee[5]?`Edit: ${ee[5].name}`:"New Prompt Template")&&ce(l,o),K[0]&128&&m.value!==ee[7]&&Ae(m,ee[7]),K[0]&256&&Ae(v,ee[8]),K[0]&512&&Ae(B,ee[9]),K[0]&32&&j!==(j=ee[5]?"Update":"Create")&&ce(N,j)},d(ee){ee&&H(e),b=!1,Ze(P)}}}function ys(n){let e,t=Oe(n[3]),o=[];for(let l=0;l<t.length;l+=1)o[l]=_i(li(n,t,l));return{c(){e=x("div");for(let l=0;l<o.length;l+=1)o[l].c();r(e,"class","space-y-3")},m(l,s){W(l,e,s);for(let i=0;i<o.length;i+=1)o[i]&&o[i].m(e,null)},p(l,s){if(s[0]&1342177288){t=Oe(l[3]);let i;for(i=0;i<t.length;i+=1){const c=li(l,t,i);o[i]?o[i].p(c,s):(o[i]=_i(c),o[i].c(),o[i].m(e,null))}for(;i<o.length;i+=1)o[i].d(1);o.length=t.length}},d(l){l&&H(e),qe(o,l)}}}function ks(n){let e;return{c(){e=x("div"),e.innerHTML='<p>No prompt templates yet.</p> <p class="text-sm mt-1">Create one to start generating AI translations.</p>',r(e,"class","text-center py-12 text-gray-400")},m(t,o){W(t,e,o)},p:je,d(t){t&&H(e)}}}function mi(n){let e,t=wt(n[73].updated_at)+"",o;return{c(){e=Z("· Updated "),o=Z(t)},m(l,s){W(l,e,s),W(l,o,s)},p(l,s){s[0]&8&&t!==(t=wt(l[73].updated_at)+"")&&ce(o,t)},d(l){l&&(H(e),H(o))}}}function gi(n){let e,t,o,l=n[73].system_message.substring(0,150)+"",s,i=n[73].system_message.length>150?"…":"",c;return{c(){e=x("p"),t=x("b"),t.textContent="System:",o=F(),s=Z(l),c=Z(i),r(e,"class","mt-1 text-xs text-gray-400")},m(u,f){W(u,e,f),a(e,t),a(e,o),a(e,s),a(e,c)},p(u,f){f[0]&8&&l!==(l=u[73].system_message.substring(0,150)+"")&&ce(s,l),f[0]&8&&i!==(i=u[73].system_message.length>150?"…":"")&&ce(c,i)},d(u){u&&H(e)}}}function _i(n){let e,t,o,l,s,i=n[73].name+"",c,u,f,m,p=n[73].version+"",k,d,g,h,y=wt(n[73].created_at)+"",v,w,S,C,A=n[73].prompt.substring(0,300)+"",B,I=n[73].prompt.length>300?"…":"",E,z,j,N,T,D,b,P,ee,K,se=n[73].updated_at&&n[73].updated_at!==n[73].created_at&&mi(n),J=n[73].system_message&&gi(n);function he(){return n[58](n[73])}function U(){return n[59](n[73])}return{c(){e=x("div"),t=x("div"),o=x("div"),l=x("div"),s=x("h4"),c=Z(i),u=F(),f=x("span"),m=Z("v"),k=Z(p),d=F(),g=x("p"),h=Z("Created "),v=Z(y),w=F(),se&&se.c(),S=F(),C=x("pre"),B=Z(A),E=Z(I),z=F(),J&&J.c(),j=F(),N=x("div"),T=x("button"),T.textContent="Edit",D=F(),b=x("button"),b.textContent="Delete",P=F(),r(s,"class","font-medium text-gray-800"),r(f,"class","px-2 py-0.5 bg-gray-100 text-gray-500 text-xs rounded-full"),r(l,"class","flex items-center gap-2"),r(g,"class","text-xs text-gray-400 mt-1"),r(C,"class","mt-2 text-xs text-gray-500 bg-gray-50 p-2 rounded max-h-24 overflow-auto whitespace-pre-wrap"),r(o,"class","flex-1"),r(T,"class","px-3 py-1.5 text-xs border border-gray-300 rounded hover:bg-gray-50"),r(b,"class","px-3 py-1.5 text-xs text-red-600 border border-red-200 rounded hover:bg-red-50"),r(N,"class","flex items-center gap-2 ml-4 shrink-0"),r(t,"class","flex items-start justify-between"),r(e,"class","p-4 bg-white border border-gray-200 rounded-lg hover:border-indigo-200 transition-colors")},m(R,Q){W(R,e,Q),a(e,t),a(t,o),a(o,l),a(l,s),a(s,c),a(l,u),a(l,f),a(f,m),a(f,k),a(o,d),a(o,g),a(g,h),a(g,v),a(g,w),se&&se.m(g,null),a(o,S),a(o,C),a(C,B),a(C,E),a(o,z),J&&J.m(o,null),a(t,j),a(t,N),a(N,T),a(N,D),a(N,b),a(e,P),ee||(K=[ie(T,"click",he),ie(b,"click",U)],ee=!0)},p(R,Q){n=R,Q[0]&8&&i!==(i=n[73].name+"")&&ce(c,i),Q[0]&8&&p!==(p=n[73].version+"")&&ce(k,p),Q[0]&8&&y!==(y=wt(n[73].created_at)+"")&&ce(v,y),n[73].updated_at&&n[73].updated_at!==n[73].created_at?se?se.p(n,Q):(se=mi(n),se.c(),se.m(g,null)):se&&(se.d(1),se=null),Q[0]&8&&A!==(A=n[73].prompt.substring(0,300)+"")&&ce(B,A),Q[0]&8&&I!==(I=n[73].prompt.length>300?"…":"")&&ce(E,I),n[73].system_message?J?J.p(n,Q):(J=gi(n),J.c(),J.m(o,null)):J&&(J.d(1),J=null)},d(R){R&&H(e),se&&se.d(),J&&J.d(),ee=!1,Ze(K)}}}function bi(n){let e,t=Oe(n[10].filter(ji)),o=[];for(let l=0;l<t.length;l+=1)o[l]=wi(ui(n,t,l));return{c(){e=x("div");for(let l=0;l<o.length;l+=1)o[l].c();r(e,"class","mb-4 space-y-3")},m(l,s){W(l,e,s);for(let i=0;i<o.length;i+=1)o[i]&&o[i].m(e,null)},p(l,s){if(s[0]&1024|s[1]&96){t=Oe(l[10].filter(ji));let i;for(i=0;i<t.length;i+=1){const c=ui(l,t,i);o[i]?o[i].p(c,s):(o[i]=wi(c),o[i].c(),o[i].m(e,null))}for(;i<o.length;i+=1)o[i].d(1);o.length=t.length}},d(l){l&&H(e),qe(o,l)}}}function yi(n){let e,t=(n[79].currentItem.source||`#${n[79].currentItem.index}`)+"",o;return{c(){e=Z("Processing: "),o=Z(t)},m(l,s){W(l,e,s),W(l,o,s)},p(l,s){s[0]&1024&&t!==(t=(l[79].currentItem.source||`#${l[79].currentItem.index}`)+"")&&ce(o,t)},d(l){l&&(H(e),H(o))}}}function vs(n){let e;return{c(){e=Z("—")},m(t,o){W(t,e,o)},p:je,d(t){t&&H(e)}}}function ws(n){let e,t=Ii(n[79].estimatedTimeRemaining)+"",o;return{c(){e=Z("ETA: "),o=Z(t)},m(l,s){W(l,e,s),W(l,o,s)},p(l,s){s[0]&1024&&t!==(t=Ii(l[79].estimatedTimeRemaining)+"")&&ce(o,t)},d(l){l&&(H(e),H(o))}}}function ki(n){let e,t=n[79].processingRate.toFixed(1)+"",o,l;return{c(){e=Z("("),o=Z(t),l=Z("/s)")},m(s,i){W(s,e,i),W(s,o,i),W(s,l,i)},p(s,i){i[0]&1024&&t!==(t=s[79].processingRate.toFixed(1)+"")&&ce(o,t)},d(s){s&&(H(e),H(o),H(l))}}}function vi(n){let e,t=n[79].failed+"",o,l;return{c(){e=x("p"),o=Z(t),l=Z(" failed"),r(e,"class","text-xs text-yellow-700 mt-1")},m(s,i){W(s,e,i),a(e,o),a(e,l)},p(s,i){i[0]&1024&&t!==(t=s[79].failed+"")&&ce(o,t)},d(s){s&&H(e)}}}function wi(n){let e,t,o,l,s=n[37](n[79].status)+"",i,c,u=(n[79].promptName||"Translation Job")+"",f,m,p=n[79].langCode+"",k,d,g,h,y,v,w,S,C,A,B=n[79].completed+n[79].failed+"",I,E,z=n[79].total+"",j,N,T,D,b,P,ee,K,se,J,he;function U(){return n[39](n[79])}let R=n[79].currentItem&&yi(n);function Q(ve,be){return ve[79].estimatedTimeRemaining?ws:vs}let X=Q(n),Y=X(n),me=n[79].processingRate&&ki(n),pe=n[79].failed>0&&vi(n);return{c(){e=x("div"),t=x("div"),o=x("div"),l=x("span"),i=F(),c=x("span"),f=Z(u),m=Z(" — "),k=Z(p),d=F(),g=x("button"),g.textContent="Cancel",h=F(),y=x("div"),v=x("div"),S=F(),C=x("div"),A=x("span"),I=Z(B),E=Z(" / "),j=Z(z),N=Z(" items"),T=F(),D=x("span"),R&&R.c(),b=F(),P=x("span"),Y.c(),ee=F(),me&&me.c(),K=F(),pe&&pe.c(),se=F(),r(l,"class","inline-flex items-center"),r(c,"class","text-sm font-medium text-blue-800"),r(o,"class","flex items-center gap-2"),r(g,"class","px-3 py-1 text-xs text-red-600 border border-red-300 rounded hover:bg-red-50"),r(t,"class","flex items-center justify-between mb-2"),r(v,"class",w="h-full rounded-full transition-all duration-300 "+(n[79].failed>0?"bg-gradient-to-r from-blue-500 to-yellow-500":"bg-blue-500")),Qn(v,"width",(n[79].total>0?(n[79].completed+n[79].failed)/n[79].total*100:0)+"%"),r(y,"class","w-full bg-blue-100 rounded-full h-3 overflow-hidden"),r(C,"class","flex items-center justify-between mt-2 text-xs text-blue-700"),r(e,"class","p-4 bg-blue-50 border border-blue-200 rounded-lg")},m(ve,be){W(ve,e,be),a(e,t),a(t,o),a(o,l),l.innerHTML=s,a(o,i),a(o,c),a(c,f),a(c,m),a(c,k),a(t,d),a(t,g),a(e,h),a(e,y),a(y,v),a(e,S),a(e,C),a(C,A),a(A,I),a(A,E),a(A,j),a(A,N),a(C,T),a(C,D),R&&R.m(D,null),a(C,b),a(C,P),Y.m(P,null),a(P,ee),me&&me.m(P,null),a(e,K),pe&&pe.m(e,null),a(e,se),J||(he=ie(g,"click",U),J=!0)},p(ve,be){n=ve,be[0]&1024&&s!==(s=n[37](n[79].status)+"")&&(l.innerHTML=s),be[0]&1024&&u!==(u=(n[79].promptName||"Translation Job")+"")&&ce(f,u),be[0]&1024&&p!==(p=n[79].langCode+"")&&ce(k,p),be[0]&1024&&w!==(w="h-full rounded-full transition-all duration-300 "+(n[79].failed>0?"bg-gradient-to-r from-blue-500 to-yellow-500":"bg-blue-500"))&&r(v,"class",w),be[0]&1024&&Qn(v,"width",(n[79].total>0?(n[79].completed+n[79].failed)/n[79].total*100:0)+"%"),be[0]&1024&&B!==(B=n[79].completed+n[79].failed+"")&&ce(I,B),be[0]&1024&&z!==(z=n[79].total+"")&&ce(j,z),n[79].currentItem?R?R.p(n,be):(R=yi(n),R.c(),R.m(D,null)):R&&(R.d(1),R=null),X===(X=Q(n))&&Y?Y.p(n,be):(Y.d(1),Y=X(n),Y&&(Y.c(),Y.m(P,ee))),n[79].processingRate?me?me.p(n,be):(me=ki(n),me.c(),me.m(P,null)):me&&(me.d(1),me=null),n[79].failed>0?pe?pe.p(n,be):(pe=vi(n),pe.c(),pe.m(e,se)):pe&&(pe.d(1),pe=null)},d(ve){ve&&H(e),R&&R.d(),Y.d(),me&&me.d(),pe&&pe.d(),J=!1,he()}}}function xi(n){let e,t=Oe(n[10].filter(Fi).slice(0,3)),o=[];for(let l=0;l<t.length;l+=1)o[l]=Ci(ci(n,t,l));return{c(){e=x("div");for(let l=0;l<o.length;l+=1)o[l].c();r(e,"class","mb-4 space-y-2")},m(l,s){W(l,e,s);for(let i=0;i<o.length;i+=1)o[i]&&o[i].m(e,null)},p(l,s){if(s[0]&1024|s[1]&64){t=Oe(l[10].filter(Fi).slice(0,3));let i;for(i=0;i<t.length;i+=1){const c=ci(l,t,i);o[i]?o[i].p(c,s):(o[i]=Ci(c),o[i].c(),o[i].m(e,null))}for(;i<o.length;i+=1)o[i].d(1);o.length=t.length}},d(l){l&&H(e),qe(o,l)}}}function Ci(n){let e,t,o,l=n[37](n[79].status)+"",s,i,c=n[79].status+"",u,f,m,p,k=(n[79].promptName||"Job")+"",d,g,h=n[79].langCode+"",y,v,w,S=n[79].completed+"",C,A,B=n[79].total+"",I,E,z;return{c(){e=x("div"),t=x("div"),o=x("span"),s=F(),i=x("span"),u=Z(c),m=F(),p=x("span"),d=Z(k),g=Z(" — "),y=Z(h),v=F(),w=x("span"),C=Z(S),A=Z("/"),I=Z(B),E=Z(" translated"),z=F(),r(o,"class","inline-flex items-center"),r(i,"class",f="font-medium "+Pn(n[79].status)),r(p,"class","text-gray-500"),r(t,"class","flex items-center gap-2"),r(w,"class","text-gray-400"),r(e,"class","p-3 bg-gray-50 border border-gray-200 rounded-lg flex items-center justify-between text-sm")},m(j,N){W(j,e,N),a(e,t),a(t,o),o.innerHTML=l,a(t,s),a(t,i),a(i,u),a(t,m),a(t,p),a(p,d),a(p,g),a(p,y),a(e,v),a(e,w),a(w,C),a(w,A),a(w,I),a(w,E),a(e,z)},p(j,N){N[0]&1024&&l!==(l=j[37](j[79].status)+"")&&(o.innerHTML=l),N[0]&1024&&c!==(c=j[79].status+"")&&ce(u,c),N[0]&1024&&f!==(f="font-medium "+Pn(j[79].status))&&r(i,"class",f),N[0]&1024&&k!==(k=(j[79].promptName||"Job")+"")&&ce(d,k),N[0]&1024&&h!==(h=j[79].langCode+"")&&ce(y,h),N[0]&1024&&S!==(S=j[79].completed+"")&&ce(C,S),N[0]&1024&&B!==(B=j[79].total+"")&&ce(I,B)},d(j){j&&H(e)}}}function Si(n){let e,t=(n[76].name||n[76].code||n[76])+"",o,l;return{c(){e=x("option"),o=Z(t),e.__value=l=n[76].code||n[76],Ae(e,e.__value)},m(s,i){W(s,e,i),a(e,o)},p(s,i){i[0]&4096&&t!==(t=(s[76].name||s[76].code||s[76])+"")&&ce(o,t),i[0]&4096&&l!==(l=s[76].code||s[76])&&(e.__value=l,Ae(e,e.__value))},d(s){s&&H(e)}}}function Ai(n){let e;return{c(){e=x("option"),e.textContent="— No prompts. Create one first. —",e.__value="",Ae(e,e.__value)},m(t,o){W(t,e,o)},d(t){t&&H(e)}}}function Ei(n){let e,t=n[73].name+"",o,l,s=n[73].version+"",i,c,u;return{c(){e=x("option"),o=Z(t),l=Z(" (v"),i=Z(s),c=Z(")"),e.__value=u=n[73].id,Ae(e,e.__value)},m(f,m){W(f,e,m),a(e,o),a(e,l),a(e,i),a(e,c)},p(f,m){m[0]&8&&t!==(t=f[73].name+"")&&ce(o,t),m[0]&8&&s!==(s=f[73].version+"")&&ce(i,s),m[0]&8&&u!==(u=f[73].id)&&(e.__value=u,Ae(e,e.__value))},d(f){f&&H(e)}}}function Ti(n){let e,t;return{c(){e=re("svg"),t=re("path"),r(t,"d","M21 12a9 9 0 1 1-6.219-8.56"),r(e,"class","animate-spin"),r(e,"width","14"),r(e,"height","14"),r(e,"viewBox","0 0 24 24"),r(e,"fill","none"),r(e,"stroke","currentColor"),r(e,"stroke-width","2"),r(e,"stroke-linecap","round")},m(o,l){W(o,e,l),a(e,t)},d(o){o&&H(e)}}}function xs(n){let e,t,o,l;return{c(){e=re("svg"),t=re("circle"),o=re("line"),l=re("path"),r(t,"cx","12"),r(t,"cy","12"),r(t,"r","10"),r(o,"x1","2"),r(o,"y1","12"),r(o,"x2","22"),r(o,"y2","12"),r(l,"d","M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10A15.3 15.3 0 0 1 12 2z"),r(e,"width","14"),r(e,"height","14"),r(e,"viewBox","0 0 24 24"),r(e,"fill","none"),r(e,"stroke","currentColor"),r(e,"stroke-width","2"),r(e,"stroke-linecap","round"),r(e,"stroke-linejoin","round")},m(s,i){W(s,e,i),a(e,t),a(e,o),a(e,l)},d(s){s&&H(e)}}}function Cs(n){let e,t;return{c(){e=re("svg"),t=re("path"),r(t,"d","M21 12a9 9 0 1 1-6.219-8.56"),r(e,"class","animate-spin"),r(e,"width","14"),r(e,"height","14"),r(e,"viewBox","0 0 24 24"),r(e,"fill","none"),r(e,"stroke","currentColor"),r(e,"stroke-width","2"),r(e,"stroke-linecap","round")},m(o,l){W(o,e,l),a(e,t)},d(o){o&&H(e)}}}function Ss(n){let e,t,o,l,s,i,c,u,f,m,p,k,d,g,h=[],y=new Map,v,w,S,C,A,B,I,E,z=Oe(n[13]);const j=T=>T[70].key_id;for(let T=0;T<z.length;T+=1){let D=si(n,z,T),b=j(D);y.set(b,h[T]=zi(b,D))}let N=n[24]>1&&Bi(n);return{c(){e=x("div"),t=x("table"),o=x("thead"),l=x("tr"),s=x("th"),i=x("input"),c=F(),u=x("th"),u.textContent="Key (Source Text)",f=F(),m=x("th"),m.textContent="DOM Context",p=F(),k=x("th"),k.textContent="Current Translation",d=F(),g=x("tbody");for(let T=0;T<h.length;T+=1)h[T].c();v=F(),w=x("div"),S=x("p"),C=Z(n[2]),A=Z(" item(s)"),B=F(),N&&N.c(),r(i,"type","checkbox"),i.checked=n[15],r(i,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),r(s,"class","w-10 px-3 py-2.5"),r(u,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),r(m,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),r(k,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),r(l,"class","bg-gray-50 border-b border-gray-200"),r(t,"class","w-full"),r(e,"class","bg-white rounded-lg border border-gray-200 overflow-hidden"),r(S,"class","text-xs text-gray-400"),r(w,"class","flex items-center justify-between mt-3")},m(T,D){W(T,e,D),a(e,t),a(t,o),a(o,l),a(l,s),a(s,i),a(l,c),a(l,u),a(l,f),a(l,m),a(l,p),a(l,k),a(t,d),a(t,g);for(let b=0;b<h.length;b+=1)h[b]&&h[b].m(g,null);W(T,v,D),W(T,w,D),a(w,S),a(S,C),a(S,A),a(w,B),N&&N.m(w,null),I||(E=ie(i,"change",n[32]),I=!0)},p(T,D){D[0]&32768&&(i.checked=T[15]),D[0]&24576|D[1]&1&&(z=Oe(T[13]),h=er(h,D,j,1,T,z,y,g,$n,zi,null,si)),D[0]&4&&ce(C,T[2]),T[24]>1?N?N.p(T,D):(N=Bi(T),N.c(),N.m(w,null)):N&&(N.d(1),N=null)},d(T){T&&(H(e),H(v),H(w));for(let D=0;D<h.length;D+=1)h[D].d();N&&N.d(),I=!1,E()}}}function As(n){let e;return{c(){e=x("div"),e.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>',r(e,"class","text-center py-12 text-gray-400")},m(t,o){W(t,e,o)},p:je,d(t){t&&H(e)}}}function zi(n,e){let t,o,l,s,i,c,u=e[70].key+"",f,m,p,k,d=(e[70].context||"—")+"",g,h,y,v,w=(e[70].value||"(not translated)")+"",S,C,A,B,I,E;function z(){return e[47](e[70])}return{key:n,first:null,c(){t=x("tr"),o=x("td"),l=x("input"),i=F(),c=x("td"),f=Z(u),p=F(),k=x("td"),g=Z(d),y=F(),v=x("td"),S=Z(w),A=F(),r(l,"type","checkbox"),l.checked=s=e[14].has(e[70].key_id),r(l,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),r(o,"class","px-3 py-2"),r(c,"class","px-3 py-2 font-mono text-sm text-gray-700 max-w-[250px] truncate"),r(c,"title",m=e[70].key),r(k,"class","px-3 py-2 text-xs text-gray-400 max-w-[180px] truncate"),r(k,"title",h=e[70].context),r(v,"class",C="px-3 py-2 text-sm "+(e[70].value?"text-gray-700":"text-gray-300")),r(t,"class",B="border-b border-gray-100 hover:bg-gray-50 transition-colors "+(e[70].value?"":"bg-amber-50")),this.first=t},m(j,N){W(j,t,N),a(t,o),a(o,l),a(t,i),a(t,c),a(c,f),a(t,p),a(t,k),a(k,g),a(t,y),a(t,v),a(v,S),a(t,A),I||(E=ie(l,"change",z),I=!0)},p(j,N){e=j,N[0]&24576&&s!==(s=e[14].has(e[70].key_id))&&(l.checked=s),N[0]&8192&&u!==(u=e[70].key+"")&&ce(f,u),N[0]&8192&&m!==(m=e[70].key)&&r(c,"title",m),N[0]&8192&&d!==(d=(e[70].context||"—")+"")&&ce(g,d),N[0]&8192&&h!==(h=e[70].context)&&r(k,"title",h),N[0]&8192&&w!==(w=(e[70].value||"(not translated)")+"")&&ce(S,w),N[0]&8192&&C!==(C="px-3 py-2 text-sm "+(e[70].value?"text-gray-700":"text-gray-300"))&&r(v,"class",C),N[0]&8192&&B!==(B="border-b border-gray-100 hover:bg-gray-50 transition-colors "+(e[70].value?"":"bg-amber-50"))&&r(t,"class",B)},d(j){j&&H(t),I=!1,E()}}}function Bi(n){let e,t,o,l,s,i,c,u,f,m,p,k,d,g,h,y,v,w,S,C,A,B,I,E,z,j,N,T,D;return{c(){e=x("div"),t=x("button"),o=Z("«"),s=F(),i=x("button"),c=Z("‹"),f=F(),m=x("span"),p=Z("Page "),k=Z(n[21]),d=Z(" of "),g=Z(n[24]),h=F(),y=x("button"),v=Z("›"),S=F(),C=x("button"),A=Z("»"),I=F(),E=x("select"),z=x("option"),z.textContent="25 / page",j=x("option"),j.textContent="50 / page",N=x("option"),N.textContent="100 / page",r(t,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),t.disabled=l=n[21]<=1,r(i,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),i.disabled=u=n[21]<=1,r(m,"class","px-3 py-1 text-xs text-gray-600"),r(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=n[21]>=n[24],r(C,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),C.disabled=B=n[21]>=n[24],z.__value=25,Ae(z,z.__value),j.__value=50,Ae(j,j.__value),N.__value=100,Ae(N,N.__value),r(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"),n[1]===void 0&&ht(()=>n[52].call(E)),r(e,"class","flex items-center gap-1")},m(b,P){W(b,e,P),a(e,t),a(t,o),a(e,s),a(e,i),a(i,c),a(e,f),a(e,m),a(m,p),a(m,k),a(m,d),a(m,g),a(e,h),a(e,y),a(y,v),a(e,S),a(e,C),a(C,A),a(e,I),a(e,E),a(E,z),a(E,j),a(E,N),Ve(E,n[1],!0),T||(D=[ie(t,"click",n[48]),ie(i,"click",n[49]),ie(y,"click",n[50]),ie(C,"click",n[51]),ie(E,"change",n[52]),ie(E,"change",n[53])],T=!0)},p(b,P){P[0]&2097152&&l!==(l=b[21]<=1)&&(t.disabled=l),P[0]&2097152&&u!==(u=b[21]<=1)&&(i.disabled=u),P[0]&2097152&&ce(k,b[21]),P[0]&16777216&&ce(g,b[24]),P[0]&18874368&&w!==(w=b[21]>=b[24])&&(y.disabled=w),P[0]&18874368&&B!==(B=b[21]>=b[24])&&(C.disabled=B),P[0]&2&&Ve(E,b[1])},d(b){b&&H(e),T=!1,Ze(D)}}}function Es(n){let e,t,o,l=Oe([{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>'}]),s=[];for(let f=0;f<3;f+=1)s[f]=di(fi(n,l,f));function i(f,m){if(f[20]==="generate")return gs;if(f[20]==="prompts")return ms;if(f[20]==="log")return ps}let c=i(n),u=c&&c(n);return{c(){e=x("div"),t=x("div");for(let f=0;f<3;f+=1)s[f].c();o=F(),u&&u.c(),r(t,"class","flex items-center gap-1 mb-4 border-b border-gray-200")},m(f,m){W(f,e,m),a(e,t);for(let p=0;p<3;p+=1)s[p]&&s[p].m(t,null);a(e,o),u&&u.m(e,null)},p(f,m){if(m[0]&68157440){l=Oe([{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 p;for(p=0;p<3;p+=1){const k=fi(f,l,p);s[p]?s[p].p(k,m):(s[p]=di(k),s[p].c(),s[p].m(t,null))}for(;p<3;p+=1)s[p].d(1)}c===(c=i(f))&&u?u.p(f,m):(u&&u.d(1),u=c&&c(f),u&&(u.c(),u.m(e,null)))},i:je,o:je,d(f){f&&H(e),qe(s,f),u&&u.d()}}}const Ts="You are a professional translator. Provide only the translation without any explanations or additional text.";function Ii(n){return!n||n<0?"—":n<60?`${Math.ceil(n)}s`:`${Math.floor(n/60)}m ${Math.ceil(n%60)}s`}function wt(n){return n?new Date(n).toLocaleString():"—"}function Pn(n){switch(n){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 Oi=n=>n.status==="completed"||n.status==="failed"||n.status==="cancelled",Li=n=>n.status==="running"||n.status==="pending",ji=n=>n.status==="running"||n.status==="pending",Fi=n=>n.status==="completed"||n.status==="failed"||n.status==="cancelled";function zs(n,e,t){let o,l;Rn(n,gt,ye=>t(62,l=ye));let s=[],i="",c=null,u=!1,f="",m="",p="",k=[],d=[],g=null,h="zh-Hans",y=[],v=[],w=new Set,S=!1,C=!1,A=!1,B="",I,E="all",z="generate",j=1,N=50,T=0;const D=`Translate the following text to {{TARGET_LANGUAGE}}.
17
+
18
+ Instructions:
19
+ - Ensure translations sound natural and contextually appropriate.
20
+ - Preserve formatting, punctuation, and any placeholder tokens.
21
+ - If a direct translation doesn't exist, use a descriptive equivalent.
22
+ - The context below is a breadcrumb trail: relevance decreases from right to left. Prioritize the rightmost (nearest) context elements for disambiguation.
23
+ - Return ONLY the translation, no explanations.
24
+
25
+ Context: "{{CONTEXT}}"
26
+ Text to translate: "{{TEXT}}"`;Dn(async()=>{var ye;try{const fe=JSON.parse(l.settings||"{}");(ye=fe.languages)!=null&&ye.length&&t(12,y=fe.languages)}catch{}y.length||t(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&&t(0,h=y[0].code||y[0]),await Promise.all([ee(),K(),se(),J()]),b()}),ol(()=>{P()});function b(){g=setInterval(async()=>{await se(),k.some(ye=>ye.status==="running"||ye.status==="pending")&&await K()},2e3)}function P(){g&&clearInterval(g)}async function ee(){const ye=await Re("../api/prompts");t(3,s=await ye.json()),s.length&&!i&&t(4,i=s[0].id)}async function K(){const ye=new URLSearchParams({lang:h,status:"approved",page:j,limit:N});B.trim()&&ye.set("search",B.trim()),E==="translated"?ye.set("translated","yes"):E==="untranslated"&&ye.set("translated","no");const ne=await(await Re(`../api/translations/all?${ye}`)).json();t(13,v=ne.rows),t(2,T=ne.total);const Ee=new Set(v.map(Ce=>Ce.key_id));t(14,w=new Set([...w].filter(Ce=>Ee.has(Ce)))),t(15,S=w.size===v.length&&v.length>0)}async function se(){const fe=await(await Re("../api/ai-jobs")).json();t(10,k=fe.jobs||[])}async function J(){const ye=await Re("../api/ai-jobs/log");t(11,d=await ye.json())}function he(){t(5,c=null),t(7,f=""),t(8,m=D),t(9,p=Ts),t(6,u=!0)}function U(ye){t(5,c=ye),t(7,f=ye.name),t(8,m=ye.prompt),t(9,p=ye.system_message),t(6,u=!0)}async function R(){!f.trim()||!m.trim()||(await Re("../api/prompts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:(c==null?void 0:c.id)||null,name:f.trim(),prompt:m,system_message:p})}),t(6,u=!1),t(5,c=null),await ee())}async function Q(ye){confirm("Delete this prompt template?")&&(await Re(`../api/prompts/${encodeURIComponent(ye)}`,{method:"DELETE"}),i===ye&&t(4,i=""),await ee())}function X(ye){w.has(ye)?w.delete(ye):w.add(ye),t(14,w=new Set(w)),t(15,S=w.size===v.length&&v.length>0)}function Y(){S?(t(14,w=new Set),t(15,S=!1)):(t(14,w=new Set(v.map(ye=>ye.key_id))),t(15,S=!0))}function me(){clearTimeout(I),I=setTimeout(()=>{t(21,j=1),K()},300)}async function pe(){if(!(w.size===0||!i)){t(17,A=!0);try{const fe=await(await Re("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:[...w],lang:h,prompt_id:i,include_screenshots:C,mode:"group"})})).json();fe.error?alert(fe.error):(t(14,w=new Set),t(15,S=!1),await se(),await J())}finally{t(17,A=!1)}}}let ve=!1,be=null;async function Be(){try{const fe=await(await Re(`../api/textnodes/untranslated-ids?lang=${encodeURIComponent(h)}`)).json();t(23,be=fe.total||0)}catch{t(23,be=null)}}async function ke(){var ye;if(!i){alert("Select a prompt template first.");return}t(22,ve=!0);try{const ne=await(await Re(`../api/textnodes/untranslated-ids?lang=${encodeURIComponent(h)}`)).json();if(!ne.ids||ne.ids.length===0){alert(`No untranslated approved keys for ${h}.`);return}const Ee=((ye=y.find(ct=>(ct.code||ct)===h))==null?void 0:ye.name)||h;if(!confirm(`Translate all ${ne.ids.length} untranslated approved key(s) to ${Ee}?`))return;const He=await(await Re("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:ne.ids,lang:h,prompt_id:i,include_screenshots:C,mode:"group"})})).json();He.error?alert(He.error):(await se(),await J(),await Be())}finally{t(22,ve=!1)}}async function oe(ye){await Re(`../api/ai-jobs/${encodeURIComponent(ye)}`,{method:"DELETE"}),await se()}const xe={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 _(ye){return xe[ye]??'<span class="text-gray-400">&mdash;</span>'}const q=ye=>{t(20,z=ye.id),ye.id==="log"&&J()},V=ye=>oe(ye.id);function L(){h=vt(this),t(0,h),t(12,y)}const O=()=>{t(21,j=1),K()};function M(){i=vt(this),t(4,i),t(3,s)}function $(){C=this.checked,t(16,C)}function te(){B=this.value,t(18,B)}function G(){E=vt(this),t(19,E)}const ae=()=>{t(21,j=1),K()},_e=ye=>X(ye.key_id),le=()=>{t(21,j=1),K()},ge=()=>{t(21,j--,j),K()},ze=()=>{t(21,j++,j),K()},we=()=>{t(21,j=o),K()};function Fe(){N=vt(this),t(1,N)}const De=()=>{t(21,j=1),K()};function Pe(){f=this.value,t(7,f)}function Ne(){m=this.value,t(8,m)}function Le(){p=this.value,t(9,p)}const Ke=()=>{t(6,u=!1),t(5,c=null)},Me=ye=>U(ye),We=ye=>Q(ye.id);return n.$$.update=()=>{n.$$.dirty[0]&6&&t(24,o=Math.max(1,Math.ceil(T/N))),n.$$.dirty[0]&1&&h&&Be()},[h,N,T,s,i,c,u,f,m,p,k,d,y,v,w,S,C,A,B,E,z,j,ve,be,o,K,J,he,U,R,Q,X,Y,me,pe,ke,oe,_,q,V,L,O,M,$,te,G,ae,_e,le,ge,ze,we,Fe,De,Pe,Ne,Le,Ke,Me,We]}class Bs extends Lt{constructor(e){super(),Ot(this,e,zs,Es,St,{},null,[-1,-1,-1])}}function Pi(n,e,t){const o=n.slice();return o[71]=e[t],o[72]=e,o[73]=t,o}function Ri(n,e,t){const o=n.slice();return o[74]=e[t],o}function Ni(n,e,t){const o=n.slice();return o[74]=e[t],o}function Di(n,e,t){const o=n.slice();return o[79]=e[t],o}function Mi(n,e,t){const o=n.slice();return o[82]=e[t],o}function Is(n){let e,t,o;return{c(){e=x("input"),r(e,"id","bluehive-api-key"),r(e,"type","password"),r(e,"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"),r(e,"placeholder","sk_...")},m(l,s){W(l,e,s),Ae(e,n[4]),t||(o=ie(e,"input",n[50]),t=!0)},p(l,s){s[0]&16&&e.value!==l[4]&&Ae(e,l[4])},d(l){l&&H(e),t=!1,o()}}}function Os(n){let e,t,o;return{c(){e=x("input"),r(e,"id","bluehive-api-key"),r(e,"type","text"),r(e,"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"),r(e,"placeholder","sk_...")},m(l,s){W(l,e,s),Ae(e,n[4]),t||(o=ie(e,"input",n[49]),t=!0)},p(l,s){s[0]&16&&e.value!==l[4]&&Ae(e,l[4])},d(l){l&&H(e),t=!1,o()}}}function Ui(n){let e,t,o,l=n[82].name+"",s,i,c,u,f=n[82].code+"",m,p,k,d,g,h,y;function v(){return n[53](n[82])}return{c(){e=x("div"),t=x("div"),o=x("span"),s=Z(l),i=F(),c=x("span"),u=Z("("),m=Z(f),p=Z(")"),k=F(),d=x("button"),d.textContent="✕",g=F(),r(o,"class","text-gray-700"),r(c,"class","text-gray-400 text-xs"),r(t,"class","flex items-center gap-2"),r(d,"class","text-gray-400 hover:text-red-500 text-xs px-2 py-1 rounded hover:bg-red-50"),r(d,"title","Remove language"),r(e,"class","flex items-center justify-between px-3 py-2 rounded-md hover:bg-gray-50 text-sm")},m(w,S){W(w,e,S),a(e,t),a(t,o),a(o,s),a(t,i),a(t,c),a(c,u),a(c,m),a(c,p),a(e,k),a(e,d),a(e,g),h||(y=ie(d,"click",v),h=!0)},p(w,S){n=w,S[0]&128&&l!==(l=n[82].name+"")&&ce(s,l),S[0]&128&&f!==(f=n[82].code+"")&&ce(m,f)},d(w){w&&H(e),h=!1,y()}}}function Zi(n){let e;return{c(){e=x("p"),e.textContent="No languages configured. Add one below.",r(e,"class","text-sm text-gray-400 mb-3")},m(t,o){W(t,e,o)},d(t){t&&H(e)}}}function Ls(n){let e,t,o,l,s;return{c(){e=re("svg"),t=re("path"),o=re("polyline"),l=re("polyline"),s=Z(`
27
+ Create Backup`),r(t,"d","M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"),r(o,"points","17 21 17 13 7 13 7 21"),r(l,"points","7 3 7 8 15 8"),r(e,"width","14"),r(e,"height","14"),r(e,"viewBox","0 0 24 24"),r(e,"fill","none"),r(e,"stroke","currentColor"),r(e,"stroke-width","2"),r(e,"stroke-linecap","round"),r(e,"stroke-linejoin","round")},m(i,c){W(i,e,c),a(e,t),a(e,o),a(e,l),W(i,s,c)},d(i){i&&(H(e),H(s))}}}function js(n){let e,t,o;return{c(){e=re("svg"),t=re("path"),o=Z(`
28
+ Creating…`),r(t,"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"),r(e,"class","animate-spin"),r(e,"width","14"),r(e,"height","14"),r(e,"viewBox","0 0 24 24"),r(e,"fill","none"),r(e,"stroke","currentColor"),r(e,"stroke-width","2")},m(l,s){W(l,e,s),a(e,t),W(l,o,s)},d(l){l&&(H(e),H(o))}}}function Hi(n){let e,t,o;return{c(){e=x("button"),e.textContent="Load existing backups",r(e,"class","text-xs text-indigo-600 hover:text-indigo-800 hover:underline")},m(l,s){W(l,e,s),t||(o=ie(e,"click",n[43]),t=!0)},p:je,d(l){l&&H(e),t=!1,o()}}}function Fs(n){let e,t=Oe(n[18]),o=[];for(let l=0;l<t.length;l+=1)o[l]=Wi(Di(n,t,l));return{c(){e=x("div");for(let l=0;l<o.length;l+=1)o[l].c();r(e,"class","border border-gray-200 rounded-md divide-y divide-gray-100 max-h-64 overflow-y-auto")},m(l,s){W(l,e,s);for(let i=0;i<o.length;i+=1)o[i]&&o[i].m(e,null)},p(l,s){if(s[0]&2359296|s[1]&16384){t=Oe(l[18]);let i;for(i=0;i<t.length;i+=1){const c=Di(l,t,i);o[i]?o[i].p(c,s):(o[i]=Wi(c),o[i].c(),o[i].m(e,null))}for(;i<o.length;i+=1)o[i].d(1);o.length=t.length}},d(l){l&&H(e),qe(o,l)}}}function Ps(n){let e;return{c(){e=x("div"),e.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>',r(e,"class","flex justify-center py-4")},m(t,o){W(t,e,o)},p:je,d(t){t&&H(e)}}}function Wi(n){let e,t,o,l=n[79].filename+"",s,i,c,u=tl(n[79].created)+"",f,m,p=el(n[79].size)+"",k,d,g,h,y,v,w,S,C,A,B;function I(){return n[56](n[79])}return{c(){e=x("div"),t=x("div"),o=x("div"),s=Z(l),i=F(),c=x("div"),f=Z(u),m=Z(" · "),k=Z(p),d=F(),g=x("div"),h=x("button"),y=re("svg"),v=re("polyline"),w=re("path"),C=F(),r(o,"class","text-gray-700 font-mono text-xs truncate"),r(c,"class","text-gray-400 text-xs mt-0.5"),r(t,"class","flex-1 min-w-0"),r(v,"points","3 6 5 6 21 6"),r(w,"d","M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"),r(y,"width","14"),r(y,"height","14"),r(y,"viewBox","0 0 24 24"),r(y,"fill","none"),r(y,"stroke","currentColor"),r(y,"stroke-width","2"),r(y,"stroke-linecap","round"),r(y,"stroke-linejoin","round"),r(h,"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"),h.disabled=S=n[21]===n[79].filename,r(h,"title","Delete this backup"),r(g,"class","flex items-center gap-1.5 ml-3 shrink-0"),r(e,"class","flex items-center justify-between px-3 py-2.5 hover:bg-gray-50 text-sm")},m(E,z){W(E,e,z),a(e,t),a(t,o),a(o,s),a(t,i),a(t,c),a(c,f),a(c,m),a(c,k),a(e,d),a(e,g),a(g,h),a(h,y),a(y,v),a(y,w),a(e,C),A||(B=ie(h,"click",I),A=!0)},p(E,z){n=E,z[0]&262144&&l!==(l=n[79].filename+"")&&ce(s,l),z[0]&262144&&u!==(u=tl(n[79].created)+"")&&ce(f,u),z[0]&262144&&p!==(p=el(n[79].size)+"")&&ce(k,p),z[0]&2359296&&S!==(S=n[21]===n[79].filename)&&(h.disabled=S)},d(E){E&&H(e),A=!1,B()}}}function Ki(n){let e,t,o,l,s,i,c,u,f,m,p,k,d,g,h,y,v,w,S=n[13]>0&&Gi(n),C=Oe(n[27]),A=[];for(let B=0;B<C.length;B+=1)A[B]=qi(Pi(n,C,B));return{c(){e=x("div"),t=x("div"),o=x("h4"),o.textContent="Context Depth",l=F(),s=x("p"),s.textContent=`How many ancestor levels to walk when building the context breadcrumb.
29
+ Unlimited walks to the document root; a limit keeps context focused on nearby elements.`,i=F(),c=x("div"),u=x("button"),f=Z("∞ Unlimited"),p=F(),k=x("button"),d=Z("Limit depth"),h=F(),S&&S.c(),y=F();for(let B=0;B<A.length;B+=1)A[B].c();r(o,"class","text-sm font-medium text-gray-700 mb-1"),r(s,"class","text-xs text-gray-400 mb-3"),r(u,"class",m="px-3 py-1.5 rounded-l-md text-xs font-medium border transition-colors "+(n[13]===0?"bg-indigo-600 text-white border-indigo-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50")),r(k,"class",g="px-3 py-1.5 rounded-r-md text-xs font-medium border border-l-0 transition-colors "+(n[13]>0?"bg-indigo-600 text-white border-indigo-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50")),r(c,"class","flex items-center gap-2 mb-2"),r(e,"class","mt-4 space-y-6 border-t border-gray-100 pt-4")},m(B,I){W(B,e,I),a(e,t),a(t,o),a(t,l),a(t,s),a(t,i),a(t,c),a(c,u),a(u,f),a(c,p),a(c,k),a(k,d),a(t,h),S&&S.m(t,null),a(e,y);for(let E=0;E<A.length;E+=1)A[E]&&A[E].m(e,null);v||(w=[ie(u,"click",n[58]),ie(k,"click",n[59])],v=!0)},p(B,I){if(I[0]&8192&&m!==(m="px-3 py-1.5 rounded-l-md text-xs font-medium border transition-colors "+(B[13]===0?"bg-indigo-600 text-white border-indigo-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50"))&&r(u,"class",m),I[0]&8192&&g!==(g="px-3 py-1.5 rounded-r-md text-xs font-medium border border-l-0 transition-colors "+(B[13]>0?"bg-indigo-600 text-white border-indigo-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50"))&&r(k,"class",g),B[13]>0?S?S.p(B,I):(S=Gi(B),S.c(),S.m(t,null)):S&&(S.d(1),S=null),I[0]&201332736|I[1]&240){C=Oe(B[27]);let E;for(E=0;E<C.length;E+=1){const z=Pi(B,C,E);A[E]?A[E].p(z,I):(A[E]=qi(z),A[E].c(),A[E].m(e,null))}for(;E<A.length;E+=1)A[E].d(1);A.length=C.length}},d(B){B&&H(e),S&&S.d(),qe(A,B),v=!1,Ze(w)}}}function Gi(n){let e,t,o,l,s,i,c,u,f,m,p,k;return{c(){e=x("div"),t=x("button"),o=Z("−"),s=F(),i=x("input"),c=F(),u=x("button"),u.textContent="+",f=F(),m=x("span"),m.textContent="ancestor levels",r(t,"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"),t.disabled=l=n[13]<=1,r(i,"type","number"),r(i,"min","1"),r(i,"max","99"),r(i,"class","w-14 text-center text-sm font-mono border border-gray-300 rounded-md py-1 bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300"),r(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"),r(m,"class","text-xs text-gray-500 ml-2"),r(e,"class","flex items-center gap-2 mt-2 p-3 bg-gray-50 rounded-lg border border-gray-200")},m(d,g){W(d,e,g),a(e,t),a(t,o),a(e,s),a(e,i),Ae(i,n[13]),a(e,c),a(e,u),a(e,f),a(e,m),p||(k=[ie(t,"click",n[60]),ie(i,"input",n[61]),ie(i,"change",n[34]),ie(u,"click",n[62])],p=!0)},p(d,g){g[0]&8192&&l!==(l=d[13]<=1)&&(t.disabled=l),g[0]&8192&&ll(i.value)!==d[13]&&Ae(i,d[13])},d(d){d&&H(e),p=!1,Ze(k)}}}function Ji(n){let e,t=n[74]+"",o,l,s;function i(){return n[63](n[71],n[74])}return{c(){e=x("button"),o=Z(t),r(e,"class","px-2 py-1 rounded border text-xs transition-colors "+(n[38](n[71].key,n[74])?"bg-indigo-50 border-indigo-300 text-indigo-700":"bg-gray-100 border-gray-200 text-gray-400 line-through")),r(e,"title",n[38](n[71].key,n[74])?"Click to disable":"Click to enable")},m(c,u){W(c,e,u),a(e,o),l||(s=ie(e,"click",i),l=!0)},p(c,u){n=c},d(c){c&&H(e),l=!1,s()}}}function Vi(n){let e,t=Oe(n[11][n[71].key].custom),o=[];for(let l=0;l<t.length;l+=1)o[l]=Qi(Ri(n,t,l));return{c(){e=x("div");for(let l=0;l<o.length;l+=1)o[l].c();r(e,"class","flex flex-wrap gap-1.5 mb-2")},m(l,s){W(l,e,s);for(let i=0;i<o.length;i+=1)o[i]&&o[i].m(e,null)},p(l,s){if(s[0]&134219776|s[1]&64){t=Oe(l[11][l[71].key].custom);let i;for(i=0;i<t.length;i+=1){const c=Ri(l,t,i);o[i]?o[i].p(c,s):(o[i]=Qi(c),o[i].c(),o[i].m(e,null))}for(;i<o.length;i+=1)o[i].d(1);o.length=t.length}},d(l){l&&H(e),qe(o,l)}}}function Qi(n){let e,t=n[74]+"",o,l,s,i,c,u;function f(){return n[64](n[71],n[74])}return{c(){e=x("span"),o=Z(t),l=F(),s=x("button"),s.textContent="✕",i=F(),r(s,"class","hover:text-red-500"),r(e,"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(m,p){W(m,e,p),a(e,o),a(e,l),a(e,s),a(e,i),c||(u=ie(s,"click",f),c=!0)},p(m,p){n=m,p[0]&2048&&t!==(t=n[74]+"")&&ce(o,t)},d(m){m&&H(e),c=!1,u()}}}function qi(n){let e,t,o,l,s,i,c,u,f,m,p,k,d,g,h,y,v,w=Oe(n[26][n[71].key]),S=[];for(let E=0;E<w.length;E+=1)S[E]=Ji(Ni(n,w,E));let C=n[11][n[71].key].custom.length>0&&Vi(n);function A(){n[65].call(m,n[71])}function B(...E){return n[66](n[71],...E)}function I(){return n[67](n[71])}return{c(){var E;e=x("div"),t=x("h4"),t.textContent=`${n[71].title}`,o=F(),l=x("p"),l.textContent=`${n[71].desc}`,s=F(),i=x("div");for(let z=0;z<S.length;z+=1)S[z].c();c=F(),C&&C.c(),u=F(),f=x("div"),m=x("input"),p=F(),k=x("button"),d=Z("Add"),h=F(),r(t,"class","text-sm font-medium text-gray-700 mb-1"),r(l,"class","text-xs text-gray-400 mb-2"),r(i,"class","flex flex-wrap gap-1.5 mb-2"),r(m,"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"),r(m,"placeholder",n[71].placeholder),r(k,"class","px-3 py-1.5 bg-indigo-600 text-white text-xs rounded-md hover:bg-indigo-700 disabled:opacity-50"),k.disabled=g=!((E=n[12][n[71].key])!=null&&E.trim()),r(f,"class","flex gap-2")},m(E,z){W(E,e,z),a(e,t),a(e,o),a(e,l),a(e,s),a(e,i);for(let j=0;j<S.length;j+=1)S[j]&&S[j].m(i,null);a(e,c),C&&C.m(e,null),a(e,u),a(e,f),a(f,m),Ae(m,n[12][n[71].key]),a(f,p),a(f,k),a(k,d),a(e,h),y||(v=[ie(m,"input",A),ie(m,"keydown",B),ie(k,"click",I)],y=!0)},p(E,z){var j;if(n=E,z[0]&201326592|z[1]&144){w=Oe(n[26][n[71].key]);let N;for(N=0;N<w.length;N+=1){const T=Ni(n,w,N);S[N]?S[N].p(T,z):(S[N]=Ji(T),S[N].c(),S[N].m(i,null))}for(;N<S.length;N+=1)S[N].d(1);S.length=w.length}n[11][n[71].key].custom.length>0?C?C.p(n,z):(C=Vi(n),C.c(),C.m(e,u)):C&&(C.d(1),C=null),z[0]&134221824&&m.value!==n[12][n[71].key]&&Ae(m,n[12][n[71].key]),z[0]&4096&&g!==(g=!((j=n[12][n[71].key])!=null&&j.trim()))&&(k.disabled=g)},d(E){E&&H(e),qe(S,E),C&&C.d(),y=!1,Ze(v)}}}function Yi(n){let e,t;function o(i,c){if(i[24]==="clearing")return Ns;if(i[24]==="success")return Rs}let l=o(n),s=l&&l(n);return{c(){e=x("div"),t=x("div"),s&&s.c(),r(t,"class","bg-white rounded-2xl shadow-2xl px-10 py-8 flex flex-col items-center gap-4 min-w-[220px]"),r(e,"class","fixed inset-0 z-50 flex items-center justify-center bg-black/40"),r(e,"data-testid","clear-modal")},m(i,c){W(i,e,c),a(e,t),s&&s.m(t,null)},p(i,c){l!==(l=o(i))&&(s&&s.d(1),s=l&&l(i),s&&(s.c(),s.m(t,null)))},d(i){i&&H(e),s&&s.d()}}}function Rs(n){let e,t,o,l,s,i,c,u,f,m,p,k;return{c(){e=re("svg"),t=re("defs"),o=re("style"),l=Z(`#loco-clear-ok-circle { animation: loco-circle-grow 0.5s cubic-bezier(.34,1.56,.64,1) both; transform-origin: 40px 40px; }
30
+ #loco-clear-checkmark { stroke-dasharray: 30; animation: loco-check-draw 0.4s ease 0.4s both; }
31
+ .loco-clear-spark1 { animation: loco-sparkle 0.6s ease 0.7s both; transform-origin: center; }
32
+ .loco-clear-spark2 { animation: loco-sparkle 0.6s ease 0.85s both; transform-origin: center; }
33
+ .loco-clear-spark3 { animation: loco-sparkle 0.6s ease 1.0s both; transform-origin: center; }
34
+ .loco-clear-spark4 { animation: loco-sparkle 0.6s ease 0.75s both; transform-origin: center; }
35
+ `),s=re("circle"),i=re("path"),c=re("circle"),u=re("circle"),f=re("circle"),m=re("circle"),p=F(),k=x("p"),k.textContent="Pending cleared!",r(s,"id","loco-clear-ok-circle"),r(s,"cx","40"),r(s,"cy","40"),r(s,"r","30"),r(s,"fill","#2ECC88"),r(i,"id","loco-clear-checkmark"),r(i,"d","M25 40 L35 50 L55 30"),r(i,"fill","none"),r(i,"stroke","white"),r(i,"stroke-width","5"),r(i,"stroke-linecap","round"),r(i,"stroke-linejoin","round"),r(c,"class","loco-clear-spark1"),r(c,"cx","12"),r(c,"cy","15"),r(c,"r","3"),r(c,"fill","#FFB833"),r(u,"class","loco-clear-spark2"),r(u,"cx","68"),r(u,"cy","18"),r(u,"r","2.5"),r(u,"fill","#3A8FE0"),r(f,"class","loco-clear-spark3"),r(f,"cx","65"),r(f,"cy","65"),r(f,"r","2"),r(f,"fill","#F07040"),r(m,"class","loco-clear-spark4"),r(m,"cx","15"),r(m,"cy","62"),r(m,"r","2.5"),r(m,"fill","#7BC74A"),r(e,"width","80"),r(e,"height","80"),r(e,"viewBox","0 0 80 80"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(k,"class","text-sm font-medium text-gray-700")},m(d,g){W(d,e,g),a(e,t),a(t,o),a(o,l),a(e,s),a(e,i),a(e,c),a(e,u),a(e,f),a(e,m),W(d,p,g),W(d,k,g)},d(d){d&&(H(e),H(p),H(k))}}}function Ns(n){let e,t,o,l,s,i,c,u,f,m,p,k,d,g,h,y,v,w,S,C,A,B,I,E,z;return{c(){e=re("svg"),t=re("defs"),o=re("style"),l=Z(`#loco-clear-ring { animation: loco-spin 1.2s linear infinite; transform-origin: 40px 40px; }
36
+ #loco-clear-parrot { animation: loco-pulse 2s ease-in-out infinite; transform-origin: 40px 40px; }
37
+ `),s=re("g"),i=re("circle"),c=re("path"),u=re("path"),f=re("path"),m=re("g"),p=re("circle"),k=re("circle"),d=re("circle"),g=re("circle"),h=re("circle"),y=re("circle"),v=re("path"),w=re("line"),S=re("line"),C=re("line"),A=re("circle"),B=re("circle"),I=re("circle"),E=F(),z=x("p"),z.textContent="Clearing pending…",r(i,"cx","40"),r(i,"cy","40"),r(i,"r","34"),r(i,"fill","none"),r(i,"stroke","#2a3040"),r(i,"stroke-width","4"),r(c,"d","M40 6 A34 34 0 0 1 74 40"),r(c,"fill","none"),r(c,"stroke","#2ECC88"),r(c,"stroke-width","4"),r(c,"stroke-linecap","round"),r(u,"d","M74 40 A34 34 0 0 1 56 70"),r(u,"fill","none"),r(u,"stroke","#3A8FE0"),r(u,"stroke-width","4"),r(u,"stroke-linecap","round"),r(f,"d","M56 70 A34 34 0 0 1 24 70"),r(f,"fill","none"),r(f,"stroke","#FFB833"),r(f,"stroke-width","4"),r(f,"stroke-linecap","round"),r(s,"id","loco-clear-ring"),r(p,"cx","40"),r(p,"cy","40"),r(p,"r","16"),r(p,"fill","#1a1f2e"),r(k,"cx","40"),r(k,"cy","38"),r(k,"r","10"),r(k,"fill","#2ECC88"),r(d,"cx","37"),r(d,"cy","37"),r(d,"r","2.5"),r(d,"fill","white"),r(g,"cx","37.5"),r(g,"cy","37.5"),r(g,"r","1.5"),r(g,"fill","#2C2C2A"),r(h,"cx","43"),r(h,"cy","37"),r(h,"r","2.5"),r(h,"fill","white"),r(y,"cx","42.5"),r(y,"cy","37.5"),r(y,"r","1.5"),r(y,"fill","#2C2C2A"),r(v,"d","M38 41 Q40 39 42 41 Q42 44 40 45 Q38 44 38 41Z"),r(v,"fill","#E8A020"),r(w,"x1","38"),r(w,"y1","30"),r(w,"x2","36"),r(w,"y2","26"),r(w,"stroke","#FFB833"),r(w,"stroke-width","1.5"),r(w,"stroke-linecap","round"),r(S,"x1","40"),r(S,"y1","29"),r(S,"x2","40"),r(S,"y2","24"),r(S,"stroke","#7BC74A"),r(S,"stroke-width","1.5"),r(S,"stroke-linecap","round"),r(C,"x1","42"),r(C,"y1","30"),r(C,"x2","44"),r(C,"y2","26"),r(C,"stroke","#F07040"),r(C,"stroke-width","1.5"),r(C,"stroke-linecap","round"),r(A,"cx","36"),r(A,"cy","25.5"),r(A,"r","1.5"),r(A,"fill","#FFB833"),r(B,"cx","40"),r(B,"cy","23.5"),r(B,"r","1.5"),r(B,"fill","#7BC74A"),r(I,"cx","44"),r(I,"cy","25.5"),r(I,"r","1.5"),r(I,"fill","#F07040"),r(m,"id","loco-clear-parrot"),r(e,"width","80"),r(e,"height","80"),r(e,"viewBox","0 0 80 80"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(z,"class","text-sm font-medium text-gray-700")},m(j,N){W(j,e,N),a(e,t),a(t,o),a(o,l),a(e,s),a(s,i),a(s,c),a(s,u),a(s,f),a(e,m),a(m,p),a(m,k),a(m,d),a(m,g),a(m,h),a(m,y),a(m,v),a(m,w),a(m,S),a(m,C),a(m,A),a(m,B),a(m,I),W(j,E,N),W(j,z,N)},d(j){j&&(H(e),H(E),H(z))}}}function Xi(n){let e,t;function o(i,c){if(i[23]==="resetting")return Ms;if(i[23]==="success")return Ds}let l=o(n),s=l&&l(n);return{c(){e=x("div"),t=x("div"),s&&s.c(),r(t,"class","bg-white rounded-2xl shadow-2xl px-10 py-8 flex flex-col items-center gap-4 min-w-[220px]"),r(e,"class","fixed inset-0 z-50 flex items-center justify-center bg-black/40"),r(e,"data-testid","reset-modal")},m(i,c){W(i,e,c),a(e,t),s&&s.m(t,null)},p(i,c){l!==(l=o(i))&&(s&&s.d(1),s=l&&l(i),s&&(s.c(),s.m(t,null)))},d(i){i&&H(e),s&&s.d()}}}function Ds(n){let e,t,o,l,s,i,c,u,f,m,p,k;return{c(){e=re("svg"),t=re("defs"),o=re("style"),l=Z(`#loco-reset-ok-circle { animation: loco-circle-grow 0.5s cubic-bezier(.34,1.56,.64,1) both; transform-origin: 40px 40px; }
38
+ #loco-reset-checkmark { stroke-dasharray: 30; animation: loco-check-draw 0.4s ease 0.4s both; }
39
+ .loco-reset-spark1 { animation: loco-sparkle 0.6s ease 0.7s both; transform-origin: center; }
40
+ .loco-reset-spark2 { animation: loco-sparkle 0.6s ease 0.85s both; transform-origin: center; }
41
+ .loco-reset-spark3 { animation: loco-sparkle 0.6s ease 1.0s both; transform-origin: center; }
42
+ .loco-reset-spark4 { animation: loco-sparkle 0.6s ease 0.75s both; transform-origin: center; }
43
+ `),s=re("circle"),i=re("path"),c=re("circle"),u=re("circle"),f=re("circle"),m=re("circle"),p=F(),k=x("p"),k.textContent="Database reset!",r(s,"id","loco-reset-ok-circle"),r(s,"cx","40"),r(s,"cy","40"),r(s,"r","30"),r(s,"fill","#2ECC88"),r(i,"id","loco-reset-checkmark"),r(i,"d","M25 40 L35 50 L55 30"),r(i,"fill","none"),r(i,"stroke","white"),r(i,"stroke-width","5"),r(i,"stroke-linecap","round"),r(i,"stroke-linejoin","round"),r(c,"class","loco-reset-spark1"),r(c,"cx","12"),r(c,"cy","15"),r(c,"r","3"),r(c,"fill","#FFB833"),r(u,"class","loco-reset-spark2"),r(u,"cx","68"),r(u,"cy","18"),r(u,"r","2.5"),r(u,"fill","#3A8FE0"),r(f,"class","loco-reset-spark3"),r(f,"cx","65"),r(f,"cy","65"),r(f,"r","2"),r(f,"fill","#F07040"),r(m,"class","loco-reset-spark4"),r(m,"cx","15"),r(m,"cy","62"),r(m,"r","2.5"),r(m,"fill","#7BC74A"),r(e,"width","80"),r(e,"height","80"),r(e,"viewBox","0 0 80 80"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(k,"class","text-sm font-medium text-gray-700")},m(d,g){W(d,e,g),a(e,t),a(t,o),a(o,l),a(e,s),a(e,i),a(e,c),a(e,u),a(e,f),a(e,m),W(d,p,g),W(d,k,g)},d(d){d&&(H(e),H(p),H(k))}}}function Ms(n){let e,t,o,l,s,i,c,u,f,m,p,k,d,g,h,y,v,w,S,C,A,B,I,E,z;return{c(){e=re("svg"),t=re("defs"),o=re("style"),l=Z(`#loco-reset-ring { animation: loco-spin 1.2s linear infinite; transform-origin: 40px 40px; }
44
+ #loco-reset-parrot { animation: loco-pulse 2s ease-in-out infinite; transform-origin: 40px 40px; }
45
+ `),s=re("g"),i=re("circle"),c=re("path"),u=re("path"),f=re("path"),m=re("g"),p=re("circle"),k=re("circle"),d=re("circle"),g=re("circle"),h=re("circle"),y=re("circle"),v=re("path"),w=re("line"),S=re("line"),C=re("line"),A=re("circle"),B=re("circle"),I=re("circle"),E=F(),z=x("p"),z.textContent="Resetting database…",r(i,"cx","40"),r(i,"cy","40"),r(i,"r","34"),r(i,"fill","none"),r(i,"stroke","#2a3040"),r(i,"stroke-width","4"),r(c,"d","M40 6 A34 34 0 0 1 74 40"),r(c,"fill","none"),r(c,"stroke","#ef4444"),r(c,"stroke-width","4"),r(c,"stroke-linecap","round"),r(u,"d","M74 40 A34 34 0 0 1 56 70"),r(u,"fill","none"),r(u,"stroke","#f97316"),r(u,"stroke-width","4"),r(u,"stroke-linecap","round"),r(f,"d","M56 70 A34 34 0 0 1 24 70"),r(f,"fill","none"),r(f,"stroke","#eab308"),r(f,"stroke-width","4"),r(f,"stroke-linecap","round"),r(s,"id","loco-reset-ring"),r(p,"cx","40"),r(p,"cy","40"),r(p,"r","16"),r(p,"fill","#1a1f2e"),r(k,"cx","40"),r(k,"cy","38"),r(k,"r","10"),r(k,"fill","#2ECC88"),r(d,"cx","37"),r(d,"cy","37"),r(d,"r","2.5"),r(d,"fill","white"),r(g,"cx","37.5"),r(g,"cy","37.5"),r(g,"r","1.5"),r(g,"fill","#2C2C2A"),r(h,"cx","43"),r(h,"cy","37"),r(h,"r","2.5"),r(h,"fill","white"),r(y,"cx","42.5"),r(y,"cy","37.5"),r(y,"r","1.5"),r(y,"fill","#2C2C2A"),r(v,"d","M38 41 Q40 39 42 41 Q42 44 40 45 Q38 44 38 41Z"),r(v,"fill","#E8A020"),r(w,"x1","38"),r(w,"y1","30"),r(w,"x2","36"),r(w,"y2","26"),r(w,"stroke","#FFB833"),r(w,"stroke-width","1.5"),r(w,"stroke-linecap","round"),r(S,"x1","40"),r(S,"y1","29"),r(S,"x2","40"),r(S,"y2","24"),r(S,"stroke","#7BC74A"),r(S,"stroke-width","1.5"),r(S,"stroke-linecap","round"),r(C,"x1","42"),r(C,"y1","30"),r(C,"x2","44"),r(C,"y2","26"),r(C,"stroke","#F07040"),r(C,"stroke-width","1.5"),r(C,"stroke-linecap","round"),r(A,"cx","36"),r(A,"cy","25.5"),r(A,"r","1.5"),r(A,"fill","#FFB833"),r(B,"cx","40"),r(B,"cy","23.5"),r(B,"r","1.5"),r(B,"fill","#7BC74A"),r(I,"cx","44"),r(I,"cy","25.5"),r(I,"r","1.5"),r(I,"fill","#F07040"),r(m,"id","loco-reset-parrot"),r(e,"width","80"),r(e,"height","80"),r(e,"viewBox","0 0 80 80"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(z,"class","text-sm font-medium text-gray-700")},m(j,N){W(j,e,N),a(e,t),a(t,o),a(o,l),a(e,s),a(s,i),a(s,c),a(s,u),a(s,f),a(e,m),a(m,p),a(m,k),a(m,d),a(m,g),a(m,h),a(m,y),a(m,v),a(m,w),a(m,S),a(m,C),a(m,A),a(m,B),a(m,I),W(j,E,N),W(j,z,N)},d(j){j&&(H(e),H(E),H(z))}}}function $i(n){let e,t;function o(i,c){if(i[22]==="backing-up")return Zs;if(i[22]==="success")return Us}let l=o(n),s=l&&l(n);return{c(){e=x("div"),t=x("div"),s&&s.c(),r(t,"class","bg-white rounded-2xl shadow-2xl px-10 py-8 flex flex-col items-center gap-4 min-w-[220px]"),r(e,"class","fixed inset-0 z-50 flex items-center justify-center bg-black/40"),r(e,"data-testid","backup-modal")},m(i,c){W(i,e,c),a(e,t),s&&s.m(t,null)},p(i,c){l!==(l=o(i))&&(s&&s.d(1),s=l&&l(i),s&&(s.c(),s.m(t,null)))},d(i){i&&H(e),s&&s.d()}}}function Us(n){let e,t,o,l,s,i,c,u,f,m,p,k;return{c(){e=re("svg"),t=re("defs"),o=re("style"),l=Z(`@keyframes loco-circle-grow { 0% { transform: scale(0); opacity: 0; } 50% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
46
+ @keyframes loco-check-draw { 0% { stroke-dashoffset: 30; } 100% { stroke-dashoffset: 0; } }
47
+ @keyframes loco-sparkle { 0%, 100% { opacity: 0; transform: scale(0); } 50% { opacity: 1; transform: scale(1); } }
48
+ #loco-success-circle { animation: loco-circle-grow 0.5s cubic-bezier(.34,1.56,.64,1) both; transform-origin: 40px 40px; }
49
+ #loco-checkmark { stroke-dasharray: 30; animation: loco-check-draw 0.4s ease 0.4s both; }
50
+ .loco-spark1 { animation: loco-sparkle 0.6s ease 0.7s both; transform-origin: center; }
51
+ .loco-spark2 { animation: loco-sparkle 0.6s ease 0.85s both; transform-origin: center; }
52
+ .loco-spark3 { animation: loco-sparkle 0.6s ease 1.0s both; transform-origin: center; }
53
+ .loco-spark4 { animation: loco-sparkle 0.6s ease 0.75s both; transform-origin: center; }
54
+ `),s=re("circle"),i=re("path"),c=re("circle"),u=re("circle"),f=re("circle"),m=re("circle"),p=F(),k=x("p"),k.textContent="Backup created!",r(s,"id","loco-success-circle"),r(s,"cx","40"),r(s,"cy","40"),r(s,"r","30"),r(s,"fill","#2ECC88"),r(i,"id","loco-checkmark"),r(i,"d","M25 40 L35 50 L55 30"),r(i,"fill","none"),r(i,"stroke","white"),r(i,"stroke-width","5"),r(i,"stroke-linecap","round"),r(i,"stroke-linejoin","round"),r(c,"class","loco-spark1"),r(c,"cx","12"),r(c,"cy","15"),r(c,"r","3"),r(c,"fill","#FFB833"),r(u,"class","loco-spark2"),r(u,"cx","68"),r(u,"cy","18"),r(u,"r","2.5"),r(u,"fill","#3A8FE0"),r(f,"class","loco-spark3"),r(f,"cx","65"),r(f,"cy","65"),r(f,"r","2"),r(f,"fill","#F07040"),r(m,"class","loco-spark4"),r(m,"cx","15"),r(m,"cy","62"),r(m,"r","2.5"),r(m,"fill","#7BC74A"),r(e,"width","80"),r(e,"height","80"),r(e,"viewBox","0 0 80 80"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(k,"class","text-sm font-medium text-gray-700")},m(d,g){W(d,e,g),a(e,t),a(t,o),a(o,l),a(e,s),a(e,i),a(e,c),a(e,u),a(e,f),a(e,m),W(d,p,g),W(d,k,g)},d(d){d&&(H(e),H(p),H(k))}}}function Zs(n){let e,t,o,l,s,i,c,u,f,m,p,k,d,g,h,y,v,w,S,C,A,B,I,E,z;return{c(){e=re("svg"),t=re("defs"),o=re("style"),l=Z(`@keyframes loco-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
55
+ @keyframes loco-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.7; transform: scale(0.92); } }
56
+ #loco-spinner-ring { animation: loco-spin 1.2s linear infinite; transform-origin: 40px 40px; }
57
+ #loco-center-parrot { animation: loco-pulse 2s ease-in-out infinite; transform-origin: 40px 40px; }
58
+ `),s=re("g"),i=re("circle"),c=re("path"),u=re("path"),f=re("path"),m=re("g"),p=re("circle"),k=re("circle"),d=re("circle"),g=re("circle"),h=re("circle"),y=re("circle"),v=re("path"),w=re("line"),S=re("line"),C=re("line"),A=re("circle"),B=re("circle"),I=re("circle"),E=F(),z=x("p"),z.textContent="Creating backup…",r(i,"cx","40"),r(i,"cy","40"),r(i,"r","34"),r(i,"fill","none"),r(i,"stroke","#2a3040"),r(i,"stroke-width","4"),r(c,"d","M40 6 A34 34 0 0 1 74 40"),r(c,"fill","none"),r(c,"stroke","#2ECC88"),r(c,"stroke-width","4"),r(c,"stroke-linecap","round"),r(u,"d","M74 40 A34 34 0 0 1 56 70"),r(u,"fill","none"),r(u,"stroke","#3A8FE0"),r(u,"stroke-width","4"),r(u,"stroke-linecap","round"),r(f,"d","M56 70 A34 34 0 0 1 24 70"),r(f,"fill","none"),r(f,"stroke","#FFB833"),r(f,"stroke-width","4"),r(f,"stroke-linecap","round"),r(s,"id","loco-spinner-ring"),r(p,"cx","40"),r(p,"cy","40"),r(p,"r","16"),r(p,"fill","#1a1f2e"),r(k,"cx","40"),r(k,"cy","38"),r(k,"r","10"),r(k,"fill","#2ECC88"),r(d,"cx","37"),r(d,"cy","37"),r(d,"r","2.5"),r(d,"fill","white"),r(g,"cx","37.5"),r(g,"cy","37.5"),r(g,"r","1.5"),r(g,"fill","#2C2C2A"),r(h,"cx","43"),r(h,"cy","37"),r(h,"r","2.5"),r(h,"fill","white"),r(y,"cx","42.5"),r(y,"cy","37.5"),r(y,"r","1.5"),r(y,"fill","#2C2C2A"),r(v,"d","M38 41 Q40 39 42 41 Q42 44 40 45 Q38 44 38 41Z"),r(v,"fill","#E8A020"),r(w,"x1","38"),r(w,"y1","30"),r(w,"x2","36"),r(w,"y2","26"),r(w,"stroke","#FFB833"),r(w,"stroke-width","1.5"),r(w,"stroke-linecap","round"),r(S,"x1","40"),r(S,"y1","29"),r(S,"x2","40"),r(S,"y2","24"),r(S,"stroke","#7BC74A"),r(S,"stroke-width","1.5"),r(S,"stroke-linecap","round"),r(C,"x1","42"),r(C,"y1","30"),r(C,"x2","44"),r(C,"y2","26"),r(C,"stroke","#F07040"),r(C,"stroke-width","1.5"),r(C,"stroke-linecap","round"),r(A,"cx","36"),r(A,"cy","25.5"),r(A,"r","1.5"),r(A,"fill","#FFB833"),r(B,"cx","40"),r(B,"cy","23.5"),r(B,"r","1.5"),r(B,"fill","#7BC74A"),r(I,"cx","44"),r(I,"cy","25.5"),r(I,"r","1.5"),r(I,"fill","#F07040"),r(m,"id","loco-center-parrot"),r(e,"width","80"),r(e,"height","80"),r(e,"viewBox","0 0 80 80"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(z,"class","text-sm font-medium text-gray-700")},m(j,N){W(j,e,N),a(e,t),a(t,o),a(o,l),a(e,s),a(s,i),a(s,c),a(s,u),a(s,f),a(e,m),a(m,p),a(m,k),a(m,d),a(m,g),a(m,h),a(m,y),a(m,v),a(m,w),a(m,S),a(m,C),a(m,A),a(m,B),a(m,I),W(j,E,N),W(j,z,N)},d(j){j&&(H(e),H(E),H(z))}}}function Hs(n){let e,t,o,l,s,i,c,u,f,m,p=n[2]?"Saving…":"Save",k,d,g,h,y,v,w,S,C=n[25].api_key+"",A,B,I,E=n[1]==="key"?"Copied":"Copy",z,j,N,T=n[3]?"Regenerating…":"Regenerate API Key",D,b,P,ee,K,se,J,he,U,R,Q,X=n[6]?"🙈":"👁️",Y,me,pe,ve=n[5]?"Saving…":"Save",be,Be,ke,oe,xe,_,q,V,L=n[1]==="snippet"?"Copied":"Copy Snippet",O,M,$,te,G,ae,_e,le,ge,ze,we,Fe,De,Pe,Ne,Le,Ke,Me,We,ye,fe,ne,Ee,Ce,He,ct,jt,on,_t,dt,Ft,Pt,Rt,an,Nt,Dt=n[14]?"Enabled":"Disabled",Yt,cn,pt,Mt,un,Ut,fn,ue,Se,Ie,Ue,lt,Ge,ut,dn=n[15]?"Enabled":"Disabled",Mn,rr,ft,Zt,hn,ir,bt,lr,pn,sr,Un,or,Xe,mn,ar,gn,cr,At,_n=n[16]?"Clearing…":"Clear All Pending",Zn,ur,Hn,fr,bn,dr,Et,yn=n[17]?"Resetting…":"Reset Entire Database",Wn,hr,Tt,zt,kn,pr,vn,wn=n[10]?"▲":"▼",Kn,mr,Gn,Xt,$t,en,Jn,gr;function _r(de,Te){return de[6]?Os:Is}let xn=_r(n),mt=xn(n),Ht=Oe(n[7]),Ye=[];for(let de=0;de<Ht.length;de+=1)Ye[de]=Ui(Mi(n,Ht,de));let st=n[7].length===0&&Zi();function br(de,Te){return de[20]?js:Ls}let Cn=br(n),yt=Cn(n),$e=!n[18].length&&!n[19]&&Hi(n);function yr(de,Te){if(de[19])return Ps;if(de[18].length>0)return Fs}let Wt=yr(n),et=Wt&&Wt(n),tt=n[10]&&Ki(n),nt=n[24]&&Yi(n),rt=n[23]&&Xi(n),it=n[22]&&$i(n);return{c(){e=x("div"),t=x("h2"),t.textContent="Settings",o=F(),l=x("div"),s=x("label"),s.textContent="Project Name",i=F(),c=x("div"),u=x("input"),f=F(),m=x("button"),k=Z(p),g=F(),h=x("div"),y=x("div"),y.textContent="API Key",v=F(),w=x("div"),S=x("code"),A=Z(C),B=F(),I=x("button"),z=Z(E),j=F(),N=x("button"),D=Z(T),b=F(),P=x("div"),ee=x("label"),ee.textContent="BlueHive API Key",K=F(),se=x("p"),se.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>',J=F(),he=x("div"),U=x("div"),mt.c(),R=F(),Q=x("button"),Y=Z(X),me=F(),pe=x("button"),be=Z(ve),Be=F(),ke=x("div"),oe=x("div"),oe.textContent="CDN Script Snippet",xe=F(),_=x("pre"),_.textContent=`${n[28]()}`,q=F(),V=x("button"),O=Z(L),M=F(),$=x("div"),te=x("div"),te.textContent="Target Languages",G=F(),ae=x("div");for(let de=0;de<Ye.length;de+=1)Ye[de].c();_e=F(),st&&st.c(),le=F(),ge=x("div"),ze=x("div"),we=x("label"),we.textContent="Language Code",Fe=F(),De=x("input"),Pe=F(),Ne=x("div"),Le=x("label"),Le.textContent="Language Name",Ke=F(),Me=x("input"),We=F(),ye=x("button"),fe=Z("Add"),Ee=F(),Ce=x("div"),He=x("div"),He.textContent="DOM Context",ct=F(),jt=x("p"),jt.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.",on=F(),_t=x("label"),dt=x("button"),Ft=x("span"),an=F(),Nt=x("span"),Yt=Z(Dt),cn=F(),pt=x("div"),Mt=x("div"),Mt.textContent="Page Screenshots",un=F(),Ut=x("p"),Ut.textContent="When enabled, the Loco client will capture a page screenshot and send it to the dashboard for context during translation.",fn=F(),ue=x("label"),Se=x("button"),Ie=x("span"),Ge=F(),ut=x("span"),Mn=Z(dn),rr=F(),ft=x("div"),Zt=x("div"),hn=x("div"),hn.textContent="Backups",ir=F(),bt=x("button"),yt.c(),lr=F(),pn=x("p"),pn.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.',sr=F(),$e&&$e.c(),Un=F(),et&&et.c(),or=F(),Xe=x("div"),mn=x("div"),mn.textContent="Danger Zone",ar=F(),gn=x("p"),gn.textContent="Delete all pending text nodes from the database. Approved and trashed items are not affected.",cr=F(),At=x("button"),Zn=Z(_n),ur=F(),Hn=x("hr"),fr=F(),bn=x("p"),bn.textContent="Delete ALL text nodes, translations, and screenshots. The project and its settings will be kept.",dr=F(),Et=x("button"),Wn=Z(yn),hr=F(),Tt=x("div"),zt=x("button"),kn=x("span"),kn.textContent="Crawler Configuration",pr=F(),vn=x("span"),Kn=Z(wn),mr=F(),tt&&tt.c(),Gn=F(),nt&&nt.c(),Xt=F(),rt&&rt.c(),$t=F(),it&&it.c(),en=at(),r(t,"class","text-xl font-semibold text-gray-800 mb-6"),r(s,"for","project-name"),r(s,"class","block text-sm font-medium text-gray-600 mb-2"),r(u,"id","project-name"),r(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"),r(u,"placeholder","Project name"),r(m,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),m.disabled=d=n[2]||n[0]===n[25].name,r(c,"class","flex gap-2"),r(l,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),r(y,"class","block text-sm font-medium text-gray-600 mb-2"),r(S,"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"),r(I,"class","px-3 py-2 border border-gray-300 rounded-md text-sm hover:bg-gray-50"),r(w,"class","flex gap-2 items-center"),r(N,"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"),N.disabled=n[3],r(h,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),r(ee,"for","bluehive-api-key"),r(ee,"class","block text-sm font-medium text-gray-600 mb-2"),r(se,"class","text-xs text-gray-400 mb-2"),r(Q,"class","absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 text-xs"),r(Q,"type","button"),r(U,"class","relative flex-1"),r(pe,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),pe.disabled=n[5],r(he,"class","flex gap-2"),r(P,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),r(oe,"class","block text-sm font-medium text-gray-600 mb-2"),r(_,"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"),r(V,"class","mt-2 px-3 py-1.5 border border-gray-300 rounded-md text-sm hover:bg-gray-50"),r(ke,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),r(te,"class","block text-sm font-medium text-gray-600 mb-3"),r(ae,"class","space-y-1 mb-4"),r(we,"for","new-language-code"),r(we,"class","block text-xs text-gray-500 mb-1"),r(De,"id","new-language-code"),r(De,"placeholder","e.g. zh-Hans"),r(De,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),r(ze,"class","flex-1"),r(Le,"for","new-language-name"),r(Le,"class","block text-xs text-gray-500 mb-1"),r(Me,"id","new-language-name"),r(Me,"placeholder","e.g. Chinese (Simplified)"),r(Me,"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"),r(Ne,"class","flex-1"),r(ye,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),ye.disabled=ne=!n[8].trim()||!n[9].trim(),r(ge,"class","flex gap-2 items-end"),r($,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),r(He,"class","block text-sm font-medium text-gray-700 mb-2"),r(jt,"class","text-xs text-gray-500 mb-3"),r(Ft,"class",Pt="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(n[14]?"translate-x-6":"translate-x-1")),r(dt,"class",Rt="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(n[14]?"bg-indigo-600":"bg-gray-300")),r(dt,"role","switch"),r(dt,"aria-checked",n[14]),r(Nt,"class","text-sm text-gray-700"),r(_t,"class","flex items-center gap-3 cursor-pointer"),r(Ce,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),r(Mt,"class","block text-sm font-medium text-gray-700 mb-2"),r(Ut,"class","text-xs text-gray-500 mb-3"),r(Ie,"class",Ue="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(n[15]?"translate-x-6":"translate-x-1")),r(Se,"class",lt="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(n[15]?"bg-indigo-600":"bg-gray-300")),r(Se,"role","switch"),r(Se,"aria-checked",n[15]),r(ut,"class","text-sm text-gray-700"),r(ue,"class","flex items-center gap-3 cursor-pointer"),r(pt,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),r(hn,"class","text-sm font-medium text-gray-700"),r(bt,"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"),bt.disabled=n[20],r(Zt,"class","flex items-center justify-between mb-3"),r(pn,"class","text-xs text-gray-400 mb-3"),r(ft,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),r(mn,"class","block text-sm font-medium text-red-600 mb-2"),r(gn,"class","text-xs text-gray-500 mb-3"),r(At,"class","px-4 py-2 bg-red-600 text-white text-sm rounded-md hover:bg-red-700 disabled:opacity-50"),At.disabled=n[16],r(Hn,"class","my-4 border-red-100"),r(bn,"class","text-xs text-gray-500 mb-3"),r(Et,"class","px-4 py-2 bg-red-700 text-white text-sm rounded-md hover:bg-red-800 disabled:opacity-50"),Et.disabled=n[17],r(Xe,"class","bg-white rounded-lg border border-red-200 p-5 mb-4"),r(kn,"class","text-sm font-medium text-gray-600"),r(vn,"class","text-gray-400 text-xs"),r(zt,"class","flex items-center justify-between w-full text-left"),r(Tt,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),r(e,"class","max-w-2xl")},m(de,Te){W(de,e,Te),a(e,t),a(e,o),a(e,l),a(l,s),a(l,i),a(l,c),a(c,u),Ae(u,n[0]),a(c,f),a(c,m),a(m,k),a(e,g),a(e,h),a(h,y),a(h,v),a(h,w),a(w,S),a(S,A),a(w,B),a(w,I),a(I,z),a(h,j),a(h,N),a(N,D),a(e,b),a(e,P),a(P,ee),a(P,K),a(P,se),a(P,J),a(P,he),a(he,U),mt.m(U,null),a(U,R),a(U,Q),a(Q,Y),a(he,me),a(he,pe),a(pe,be),a(e,Be),a(e,ke),a(ke,oe),a(ke,xe),a(ke,_),a(ke,q),a(ke,V),a(V,O),a(e,M),a(e,$),a($,te),a($,G),a($,ae);for(let Je=0;Je<Ye.length;Je+=1)Ye[Je]&&Ye[Je].m(ae,null);a($,_e),st&&st.m($,null),a($,le),a($,ge),a(ge,ze),a(ze,we),a(ze,Fe),a(ze,De),Ae(De,n[8]),a(ge,Pe),a(ge,Ne),a(Ne,Le),a(Ne,Ke),a(Ne,Me),Ae(Me,n[9]),a(ge,We),a(ge,ye),a(ye,fe),a(e,Ee),a(e,Ce),a(Ce,He),a(Ce,ct),a(Ce,jt),a(Ce,on),a(Ce,_t),a(_t,dt),a(dt,Ft),a(_t,an),a(_t,Nt),a(Nt,Yt),a(e,cn),a(e,pt),a(pt,Mt),a(pt,un),a(pt,Ut),a(pt,fn),a(pt,ue),a(ue,Se),a(Se,Ie),a(ue,Ge),a(ue,ut),a(ut,Mn),a(e,rr),a(e,ft),a(ft,Zt),a(Zt,hn),a(Zt,ir),a(Zt,bt),yt.m(bt,null),a(ft,lr),a(ft,pn),a(ft,sr),$e&&$e.m(ft,null),a(ft,Un),et&&et.m(ft,null),a(e,or),a(e,Xe),a(Xe,mn),a(Xe,ar),a(Xe,gn),a(Xe,cr),a(Xe,At),a(At,Zn),a(Xe,ur),a(Xe,Hn),a(Xe,fr),a(Xe,bn),a(Xe,dr),a(Xe,Et),a(Et,Wn),a(e,hr),a(e,Tt),a(Tt,zt),a(zt,kn),a(zt,pr),a(zt,vn),a(vn,Kn),a(Tt,mr),tt&&tt.m(Tt,null),W(de,Gn,Te),nt&&nt.m(de,Te),W(de,Xt,Te),rt&&rt.m(de,Te),W(de,$t,Te),it&&it.m(de,Te),W(de,en,Te),Jn||(gr=[ie(u,"input",n[47]),ie(m,"click",n[30]),ie(I,"click",n[48]),ie(N,"click",n[31]),ie(Q,"click",n[51]),ie(pe,"click",n[29]),ie(V,"click",n[52]),ie(De,"input",n[54]),ie(Me,"input",n[55]),ie(ye,"click",n[32]),ie(dt,"click",n[40]),ie(Se,"click",n[39]),ie(bt,"click",n[44]),ie(At,"click",n[41]),ie(Et,"click",n[42]),ie(zt,"click",n[57])],Jn=!0)},p(de,Te){if(Te[0]&1&&u.value!==de[0]&&Ae(u,de[0]),Te[0]&4&&p!==(p=de[2]?"Saving…":"Save")&&ce(k,p),Te[0]&33554437&&d!==(d=de[2]||de[0]===de[25].name)&&(m.disabled=d),Te[0]&33554432&&C!==(C=de[25].api_key+"")&&ce(A,C),Te[0]&2&&E!==(E=de[1]==="key"?"Copied":"Copy")&&ce(z,E),Te[0]&8&&T!==(T=de[3]?"Regenerating…":"Regenerate API Key")&&ce(D,T),Te[0]&8&&(N.disabled=de[3]),xn===(xn=_r(de))&&mt?mt.p(de,Te):(mt.d(1),mt=xn(de),mt&&(mt.c(),mt.m(U,R))),Te[0]&64&&X!==(X=de[6]?"🙈":"👁️")&&ce(Y,X),Te[0]&32&&ve!==(ve=de[5]?"Saving…":"Save")&&ce(be,ve),Te[0]&32&&(pe.disabled=de[5]),Te[0]&2&&L!==(L=de[1]==="snippet"?"Copied":"Copy Snippet")&&ce(O,L),Te[0]&128|Te[1]&4){Ht=Oe(de[7]);let Je;for(Je=0;Je<Ht.length;Je+=1){const kr=Mi(de,Ht,Je);Ye[Je]?Ye[Je].p(kr,Te):(Ye[Je]=Ui(kr),Ye[Je].c(),Ye[Je].m(ae,null))}for(;Je<Ye.length;Je+=1)Ye[Je].d(1);Ye.length=Ht.length}de[7].length===0?st||(st=Zi(),st.c(),st.m($,le)):st&&(st.d(1),st=null),Te[0]&256&&De.value!==de[8]&&Ae(De,de[8]),Te[0]&512&&Me.value!==de[9]&&Ae(Me,de[9]),Te[0]&768&&ne!==(ne=!de[8].trim()||!de[9].trim())&&(ye.disabled=ne),Te[0]&16384&&Pt!==(Pt="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(de[14]?"translate-x-6":"translate-x-1"))&&r(Ft,"class",Pt),Te[0]&16384&&Rt!==(Rt="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(de[14]?"bg-indigo-600":"bg-gray-300"))&&r(dt,"class",Rt),Te[0]&16384&&r(dt,"aria-checked",de[14]),Te[0]&16384&&Dt!==(Dt=de[14]?"Enabled":"Disabled")&&ce(Yt,Dt),Te[0]&32768&&Ue!==(Ue="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(de[15]?"translate-x-6":"translate-x-1"))&&r(Ie,"class",Ue),Te[0]&32768&&lt!==(lt="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(de[15]?"bg-indigo-600":"bg-gray-300"))&&r(Se,"class",lt),Te[0]&32768&&r(Se,"aria-checked",de[15]),Te[0]&32768&&dn!==(dn=de[15]?"Enabled":"Disabled")&&ce(Mn,dn),Cn!==(Cn=br(de))&&(yt.d(1),yt=Cn(de),yt&&(yt.c(),yt.m(bt,null))),Te[0]&1048576&&(bt.disabled=de[20]),!de[18].length&&!de[19]?$e?$e.p(de,Te):($e=Hi(de),$e.c(),$e.m(ft,Un)):$e&&($e.d(1),$e=null),Wt===(Wt=yr(de))&&et?et.p(de,Te):(et&&et.d(1),et=Wt&&Wt(de),et&&(et.c(),et.m(ft,null))),Te[0]&65536&&_n!==(_n=de[16]?"Clearing…":"Clear All Pending")&&ce(Zn,_n),Te[0]&65536&&(At.disabled=de[16]),Te[0]&131072&&yn!==(yn=de[17]?"Resetting…":"Reset Entire Database")&&ce(Wn,yn),Te[0]&131072&&(Et.disabled=de[17]),Te[0]&1024&&wn!==(wn=de[10]?"▲":"▼")&&ce(Kn,wn),de[10]?tt?tt.p(de,Te):(tt=Ki(de),tt.c(),tt.m(Tt,null)):tt&&(tt.d(1),tt=null),de[24]?nt?nt.p(de,Te):(nt=Yi(de),nt.c(),nt.m(Xt.parentNode,Xt)):nt&&(nt.d(1),nt=null),de[23]?rt?rt.p(de,Te):(rt=Xi(de),rt.c(),rt.m($t.parentNode,$t)):rt&&(rt.d(1),rt=null),de[22]?it?it.p(de,Te):(it=$i(de),it.c(),it.m(en.parentNode,en)):it&&(it.d(1),it=null)},i:je,o:je,d(de){de&&(H(e),H(Gn),H(Xt),H($t),H(en)),mt.d(),qe(Ye,de),st&&st.d(),yt.d(),$e&&$e.d(),et&&et.d(),tt&&tt.d(),nt&&nt.d(de),rt&&rt.d(de),it&&it.d(de),Jn=!1,Ze(gr)}}}function el(n){return n<1024?n+" B":n<1024*1024?(n/1024).toFixed(1)+" KB":(n/(1024*1024)).toFixed(1)+" MB"}function tl(n){return new Date(n).toLocaleString()}function Ws(n,e,t){let o;Rn(n,gt,fe=>t(25,o=fe));const l=[{code:"zh-Hans",name:"Chinese (Simplified)"},{code:"zh-Hant",name:"Chinese (Traditional)"},{code:"es",name:"Spanish"},{code:"fr",name:"French"},{code:"de",name:"German"},{code:"ja",name:"Japanese"},{code:"ko",name:"Korean"},{code:"pt",name:"Portuguese"}],s={blockedTags:["SCRIPT","STYLE","NOSCRIPT","IFRAME","CODE","SVG","AUDIO","VIDEO","LINK"],inlineTags:["VAR","STRONG","EM","B","I","SPAN","A","ABBR","MARK","SMALL","SUB","SUP","U","S","TIME"],domContextSelectors:["h1","h2","h3","h4","h5","h6","label","legend","caption","figcaption","nav","header","footer","main","section","article","form",".portlet-header",".admin-card",".wc_win_title",".miewin_title_bar",".ui-dialog-title",".ui-dialog-titlebar",".wc_tab_title"]},i=[{key:"blockedTags",title:"Blocked Tags",desc:"HTML tags to skip during text extraction.",placeholder:"e.g. CANVAS"},{key:"inlineTags",title:"Inline Tags",desc:"Tags treated as inline content in mixed-content extraction.",placeholder:"e.g. CITE"},{key:"domContextSelectors",title:"DOM Context Selectors",desc:"CSS selectors used to build context breadcrumbs for each phrase.",placeholder:"e.g. .my-header"}];let c="",u="",f=!1,m=!1,p={},k="",d=!1,g=!1,h=[],y="",v="",w=!1,S={blockedTags:{disabled:[],custom:[]},inlineTags:{disabled:[],custom:[]},domContextSelectors:{disabled:[],custom:[]}},C={blockedTags:"",inlineTags:"",domContextSelectors:""},A=0,B=!0,I=!0,E=!1,z=!1,j=[],N=!1,T=!1,D=null,b=!1,P=!1,ee=!1;Dn(()=>{t(0,c=o.name||"");try{p=JSON.parse(o.settings||"{}")}catch{p={}}t(7,h=p.languages||l.map(fe=>({...fe}))),t(4,k=p.bluehiveApiKey||""),t(11,S={blockedTags:{disabled:[],custom:[],...p.blockedTags||{}},inlineTags:{disabled:[],custom:[],...p.inlineTags||{}},domContextSelectors:{disabled:[],custom:[],...p.domContextSelectors||{}}}),t(13,A=typeof p.contextDepth=="number"?p.contextDepth:0),t(14,B=p.domContextEnabled!==!1),t(15,I=p.screenshotsEnabled!==!1)});function K(){const fe=window.location.origin+"/loco";return`<script src="${fe}/cdn/loco.js"><\/script>
59
+ <script>Loco.init({ apiUrl: '${fe}', apiKey: '${o.api_key}' });<\/script>`}async function se(){t(5,d=!0),p.bluehiveApiKey=k.trim();const fe=await Re("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:p})});Kt(gt,o=await fe.json(),o),t(5,d=!1)}async function J(){t(2,f=!0);const fe=await Re("../api/project",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c})});Kt(gt,o=await fe.json(),o),t(2,f=!1)}async function he(){if(!confirm("Are you sure? This will invalidate the current API key. All pages using the old key will stop receiving translations."))return;t(3,m=!0);const fe=await Re("../api/project/regenerate-key",{method:"POST"});Kt(gt,o=await fe.json(),o),o&&o.api_key&&dl(o.api_key),t(3,m=!1)}async function U(){p.languages=h;const fe=await Re("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:p})});Kt(gt,o=await fe.json(),o)}function R(){const fe=y.trim(),ne=v.trim();!fe||!ne||h.some(Ee=>Ee.code===fe)||(t(7,h=[...h,{code:fe,name:ne}]),t(8,y=""),t(9,v=""),U())}function Q(fe){t(7,h=h.filter(ne=>ne.code!==fe)),U()}async function X(){p.blockedTags=S.blockedTags,p.inlineTags=S.inlineTags,p.domContextSelectors=S.domContextSelectors,p.contextDepth=A;const fe=await Re("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:p})});Kt(gt,o=await fe.json(),o)}function Y(fe,ne){const Ee=S[fe].disabled,Ce=Ee.indexOf(ne);Ce>=0?Ee.splice(Ce,1):Ee.push(ne),t(11,S),X()}function me(fe){const ne=C[fe].trim();!ne||S[fe].custom.includes(ne)||(t(11,S[fe].custom=[...S[fe].custom,ne],S),t(12,C[fe]="",C),t(12,C),X())}function pe(fe,ne){t(11,S[fe].custom=S[fe].custom.filter(Ee=>Ee!==ne),S),t(11,S),X()}function ve(fe,ne){return!S[fe].disabled.includes(ne)}async function be(){t(15,I=!I),p.screenshotsEnabled=I,await Re("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:p})})}async function Be(){t(14,B=!B),p.domContextEnabled=B;const fe=await Re("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:p})});Kt(gt,o=await fe.json(),o)}async function ke(){if(confirm("Delete ALL pending text nodes? This cannot be undone.")){t(16,E=!0),t(24,ee="clearing");try{await Re("../api/textnodes/clear-pending",{method:"POST"}),t(24,ee="success"),await new Promise(fe=>setTimeout(fe,1500))}catch{}t(24,ee=!1),t(16,E=!1)}}async function oe(){if(confirm("This will permanently delete ALL text nodes, translations, and screenshots. This cannot be undone. Are you sure?")){t(17,z=!0),t(23,P="resetting");try{await Re("../api/project/reset-database",{method:"POST"}),t(23,P="success"),await new Promise(fe=>setTimeout(fe,1500))}catch{}t(23,P=!1),t(17,z=!1)}}async function xe(){t(19,N=!0);try{const fe=await Re("../api/backups");t(18,j=await fe.json())}catch{t(18,j=[])}t(19,N=!1)}async function _(){t(20,T=!0),t(22,b="backing-up");try{await Re("../api/backups",{method:"POST"}),await xe(),t(22,b="success"),await new Promise(fe=>setTimeout(fe,1500))}catch{}t(22,b=!1),t(20,T=!1)}async function q(fe){if(confirm(`Delete backup "${fe}"? This cannot be undone.`)){t(21,D=fe);try{await Re(`../api/backups/${encodeURIComponent(fe)}`,{method:"DELETE"}),await xe()}catch{}t(21,D=null)}}async function V(fe,ne){await navigator.clipboard.writeText(fe),t(1,u=ne),setTimeout(()=>{t(1,u="")},2e3)}function L(){c=this.value,t(0,c)}const O=()=>V(o.api_key,"key");function M(){k=this.value,t(4,k)}function $(){k=this.value,t(4,k)}const te=()=>t(6,g=!g),G=()=>V(K(),"snippet"),ae=fe=>Q(fe.code);function _e(){y=this.value,t(8,y)}function le(){v=this.value,t(9,v)}const ge=fe=>q(fe.filename),ze=()=>t(10,w=!w),we=()=>{t(13,A=0),X()},Fe=()=>{A===0&&(t(13,A=5),X())},De=()=>{t(13,A=Math.max(1,A-1)),X()};function Pe(){A=ll(this.value),t(13,A)}const Ne=()=>{t(13,A=A+1),X()},Le=(fe,ne)=>Y(fe.key,ne),Ke=(fe,ne)=>pe(fe.key,ne);function Me(fe){C[fe.key]=this.value,t(12,C)}return[c,u,f,m,k,d,g,h,y,v,w,S,C,A,B,I,E,z,j,N,T,D,b,P,ee,o,s,i,K,se,J,he,R,Q,X,Y,me,pe,ve,be,Be,ke,oe,xe,_,q,V,L,O,M,$,te,G,ae,_e,le,ge,ze,we,Fe,De,Pe,Ne,Le,Ke,Me,(fe,ne)=>{ne.key==="Enter"&&me(fe.key)},fe=>me(fe.key)]}class Ks extends Lt{constructor(e){super(),Ot(this,e,Ws,Hs,St,{},null,[-1,-1,-1])}}function nl(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t<n.conditions.length;t++)if(!n.conditions[t]||typeof n.conditions[t]!="function")throw Error("Invalid parameter conditions["+t+"]")}return n.loadingComponent&&(n.asyncComponent.loading=n.loadingComponent,n.asyncComponent.loadingParams=n.loadingParams||void 0),{component:n.asyncComponent,userData:n.userData,conditions:n.conditions&&n.conditions.length?n.conditions:void 0,props:n.props&&Object.keys(n.props).length?n.props:{},_sveltesparouter:!0}}function Gs(n){let e,t;return e=new jl({props:{routes:n[2]}}),e.$on("conditionsFailed",n[4]),e.$on("routeLoaded",n[5]),{c(){It(e.$$.fragment)},m(o,l){xt(e,o,l),t=!0},p:je,i(o){t||(Qe(e.$$.fragment,o),t=!0)},o(o){ot(e.$$.fragment,o),t=!1},d(o){Ct(e,o)}}}function Js(n){let e;return{c(){e=x("div"),e.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>',r(e,"class","flex items-center justify-center h-full")},m(t,o){W(t,e,o)},p:je,i:je,o:je,d(t){t&&H(e)}}}function Vs(n){let e,t,o,l,s,i,c;t=new Rl({props:{currentView:n[1]}}),t.$on("navigate",n[3]);const u=[Js,Gs],f=[];function m(p,k){return p[0]?1:0}return s=m(n),i=f[s]=u[s](n),{c(){e=x("div"),It(t.$$.fragment),o=F(),l=x("main"),i.c(),r(l,"class","flex-1 p-6 overflow-auto"),r(e,"class","flex min-h-screen bg-gray-100")},m(p,k){W(p,e,k),xt(t,e,null),a(e,o),a(e,l),f[s].m(l,null),c=!0},p(p,[k]){const d={};k&2&&(d.currentView=p[1]),t.$set(d);let g=s;s=m(p),s===g?f[s].p(p,k):(ln(),ot(f[g],1,1,()=>{f[g]=null}),sn(),i=f[s],i?i.p(p,k):(i=f[s]=u[s](p),i.c()),Qe(i,1),i.m(l,null))},i(p){c||(Qe(t.$$.fragment,p),Qe(i),c=!0)},o(p){ot(t.$$.fragment,p),ot(i),c=!1},d(p){p&&H(e),Ct(t),f[s].d()}}}function Qs(n,e,t){let o,l,s;Rn(n,Il,p=>t(7,s=p));let i=!1;const c={"/translations/:tab":nl({component:ri,conditions:[p=>{var k;return["pending","approved","trash"].includes((k=p.params)==null?void 0:k.tab)}]}),"/ai-translate":Bs,"/settings":Ks,"*":nl({component:ri})};function u(p){const k=p.detail;if(k==="translations"){if(s.startsWith("/translations/"))return;Qt("/translations/pending")}else Qt(`/${k}`)}function f(){Qt("/translations/pending")}function m(p){p.detail.route==="*"&&Qt("/translations/pending")}return Dn(async()=>{(!window.location.hash||window.location.hash==="#"||window.location.hash==="#/")&&Qt("/translations/pending");const k=await(await fetch("../api/project")).json();gt.set(k),k&&k.api_key&&dl(k.api_key),t(0,i=!0)}),n.$$.update=()=>{n.$$.dirty&128&&t(6,o=(s||"").split("/")[1]||"translations"),n.$$.dirty&64&&t(1,l=o==="ai-translate"?"ai-translate":o==="settings"?"settings":"translations")},[i,l,c,u,f,m,o,s]}class qs extends Lt{constructor(e){super(),Ot(this,e,Qs,Vs,St,{})}}new qs({target:document.getElementById("app")});