"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vi(){}function Nw(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var Vo=function(e){ms(n,e);var t=_w(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(lt(this,n),r=t.call(this),vs&&un.call(sn(r)),r.options=td(i),r.services={},r.logger=gt,r.modules={external:[]},Nw(sn(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),ki(r,sn(r));setTimeout(function(){r.init(i,o)},0)}return r}return ut(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(s=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var a=Cw();this.options=ft(ft(ft({},a),this.options),td(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=ft(ft({},a.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(v){return v?typeof v=="function"?new v:v:null}if(!this.options.isClone){this.modules.logger?gt.init(l(this.modules.logger),this.options):gt.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=xw);var c=new pw(this.options);this.store=new cw(this.options.resources,this.options);var f=this.services;f.logger=gt,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new yw(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(f.formatter=l(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Sw(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Ew(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(v){for(var p=arguments.length,g=new Array(p>1?p-1:0),S=1;S1?p-1:0),S=1;S
0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var m=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];m.forEach(function(v){i[v]=function(){var p;return(p=i.store)[v].apply(p,arguments)}});var h=["addResource","addResources","addResourceBundle","removeResourceBundle"];h.forEach(function(v){i[v]=function(){var p;return(p=i.store)[v].apply(p,arguments),i}});var y=Ir(),k=function(){var p=function(S,O){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),y.resolve(O),s(S,O)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return p(null,i.t.bind(i));i.changeLanguage(i.options.lng,p)};return this.options.resources||!this.options.initImmediate?k():setTimeout(k,0),y}},{key:"loadResources",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vi,a=s,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(a=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var u=[],c=function(m){if(!!m){var h=o.services.languageUtils.toResolveHierarchy(m);h.forEach(function(y){u.indexOf(y)<0&&u.push(y)})}};if(l)c(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(d){return c(d)})}this.options.preload&&this.options.preload.forEach(function(d){return c(d)}),this.services.backendConnector.load(u,this.options.ns,function(d){!d&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),a(d)})}else a(null)}},{key:"reloadResources",value:function(i,o,s){var a=Ir();return i||(i=this.languages),o||(o=this.options.ns),s||(s=Vi),this.services.backendConnector.reload(i,o,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&fg.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(i,o){var s=this;this.isLanguageChangingTo=i;var a=Ir();this.emit("languageChanging",i);var l=function(d){s.language=d,s.languages=s.services.languageUtils.toResolveHierarchy(d),s.resolvedLanguage=void 0,s.setResolvedLanguage(d)},u=function(d,m){m?(l(m),s.translator.changeLanguage(m),s.isLanguageChangingTo=void 0,s.emit("languageChanged",m),s.logger.log("languageChanged",m)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),o&&o(d,function(){return s.t.apply(s,arguments)})},c=function(d){!i&&!d&&s.services.languageDetector&&(d=[]);var m=typeof d=="string"?d:s.services.languageUtils.getBestMatchFromCodes(d);m&&(s.language||l(m),s.translator.language||s.translator.changeLanguage(m),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage(m)),s.loadResources(m,function(h){u(h,m)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(c):c(i),a}},{key:"getFixedT",value:function(i,o,s){var a=this,l=function u(c,f){var d;if(on(f)!=="object"){for(var m=arguments.length,h=new Array(m>2?m-2:0),y=2;y1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var c=function(m,h){var y=o.services.backendConnector.state["".concat(m,"|").concat(h)];return y===-1||y===2};if(s.precheck){var f=s.precheck(this,c);if(f!==void 0)return f}return!!(this.hasResourceBundle(a,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(a,i)&&(!l||c(u,i)))}},{key:"loadNamespaces",value:function(i,o){var s=this,a=Ir();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var s=Ir();typeof i=="string"&&(i=[i]);var a=this.options.preload||[],l=i.filter(function(u){return a.indexOf(u)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(u){s.resolve(),o&&o(u)}),s):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vi,a=ft(ft(ft({},this.options),o),{isClone:!0}),l=new n(a);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(c){l[c]=i[c]}),l.services=ft({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new Gf(l.services,l.options),l.translator.on("*",function(c){for(var f=arguments.length,d=new Array(f>1?f-1:0),m=1;m0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Vo(e,t)});var Ce=Vo.createInstance();Ce.createInstance=Vo.createInstance;Ce.createInstance;Ce.init;Ce.loadResources;Ce.reloadResources;Ce.use;Ce.changeLanguage;Ce.getFixedT;Ce.t;Ce.exists;Ce.setDefaultNamespace;Ce.hasLoadedNamespace;Ce.loadNamespaces;Ce.loadLanguages;const Iw="Stable Diffusion UI",bw="",Lw={home:"Home",history:"History",community:"Community",settings:"Settings"},Tw={"status-starting":"Stable Diffusion is starting...","status-ready":"Stable Diffusion is ready to use!","status-error":"Stable Diffusion is not running!","editor-title":"Prompt","initial-img-txt":"Initial Image: (optional)","initial-img-btn":"Browse...","initial-img-text2":"No file selected.","make-img-btn":"Make Image","make-img-btn-stop":"Stop"},Dw={"base-img":"Use base image:",seed:"Seed:","amount-of-img":"Amount of images to make:","how-many":"How many at once:","stream-img":"Stream images (this will slow down image generation):",width:"Width:",height:"Height:",sampler:"Sampler:",steps:"Number of inference steps:","guide-scale":"Guidance Scale:","prompt-str":"Prompt Strength:","live-preview":"Show a live preview of the image (disable this for faster image generation)","fix-face":"Fix incorrect faces and eyes (uses GFPGAN)",ups:"Upscale the image to 4x resolution using:","no-ups":"No Upscaling",corrected:"Show only the corrected/upscaled image"},Fw={txt:"Image Modifiers (art styles, tags etc)"},Mw={"use-btn":"Use Image","use-btn2":"Use Image and Tags"},jw={fave:"Favorites Only",search:"Search"},Aw={ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cps:"Cross profile sharing","cps-disc":"Profiles will see suggestions from each other.",acb:"Allow cloud backup","acb-disc":"A button will show up for images on hover","acb-place":"Choose your","acc-api":"Api key","acb-api-place":"Your API key",save:"SAVE"},$w=`If you found this project useful and want to help keep it alive, please to help cover the cost of development and maintenance! Thank you for your support!
+`));return P.exports.cloneElement(u,Object.assign({},pg(u.props,wl(sa(a,["ref"]))),c,l,u1(u.ref,l.ref)))}return P.exports.createElement(i,Object.assign({},sa(a,["ref"]),i!==P.exports.Fragment&&l,i!==P.exports.Fragment&&c),u)}function u1(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}}function pg(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](i,...o){let s=n[r];for(let a of s){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...o)}}});return t}function ze(e){var t;return Object.assign(P.exports.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function wl(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function sa(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Mu(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&c1(n)?!1:r}function c1(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function f1(e){var t;let n=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(n){for(let r of n.elements)if(r.tagName==="INPUT"&&r.type==="submit"||r.tagName==="BUTTON"&&r.type==="submit"||r.nodeName==="INPUT"&&r.type==="image"){r.click();return}}}let d1="div";var _r=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(_r||{});let Er=ze(function(e,t){let{features:n=1,...r}=e,i={ref:t,"aria-hidden":(n&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Ie({ourProps:i,theirProps:r,slot:{},defaultTag:d1,name:"Hidden"})}),ju=P.exports.createContext(null);ju.displayName="OpenClosedContext";var Pi=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Pi||{});function hg(){return P.exports.useContext(ju)}function p1({value:e,children:t}){return G.createElement(ju.Provider,{value:e},t)}var se=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(se||{});function h1(e,t,n){let[r,i]=P.exports.useState(n),o=e!==void 0;return[o?e:r,q(s=>(o||i(s),t==null?void 0:t(s)))]}function g1(e,t,n){let r=Dn(t);P.exports.useEffect(()=>{function i(o){r.current(o)}return window.addEventListener(e,i,n),()=>window.removeEventListener(e,i,n)},[e,n])}var Tn=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Tn||{});function gg(){let e=P.exports.useRef(0);return g1("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function Au(...e){return P.exports.useMemo(()=>Lu(...e),[...e])}function m1(e,t,n,r){let i=Dn(n);P.exports.useEffect(()=>{e=e!=null?e:window;function o(s){i.current(s)}return e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r)},[e,t,r])}let mg=P.exports.createContext(null);function vg(){let e=P.exports.useContext(mg);if(e===null){let t=new Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,vg),t}return e}function v1(){let[e,t]=P.exports.useState([]);return[e.length>0?e.join(" "):void 0,P.exports.useMemo(()=>function(n){let r=q(o=>(t(s=>[...s,o]),()=>t(s=>{let a=s.slice(),l=a.indexOf(o);return l!==-1&&a.splice(l,1),a}))),i=P.exports.useMemo(()=>({register:r,slot:n.slot,name:n.name,props:n.props}),[r,n.slot,n.name,n.props]);return G.createElement(mg.Provider,{value:i},n.children)},[t])]}let y1="p",S1=ze(function(e,t){let n=vg(),r=`headlessui-description-${yt()}`,i=Ue(t);Wt(()=>n.register(r),[r,n.register]);let o=e,s={ref:i,...n.props,id:r};return Ie({ourProps:s,theirProps:o,slot:n.slot||{},defaultTag:y1,name:n.name||"Description"})});var w1=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(w1||{}),x1=(e=>(e[e.TogglePopover=0]="TogglePopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(x1||{});let P1={[0]:e=>({...e,popoverState:St(e.popoverState,{[0]:1,[1]:0})}),[1](e){return e.popoverState===1?e:{...e,popoverState:1}},[2](e,t){return e.button===t.button?e:{...e,button:t.button}},[3](e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},[4](e,t){return e.panel===t.panel?e:{...e,panel:t.panel}},[5](e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},$u=P.exports.createContext(null);$u.displayName="PopoverContext";function ws(e){let t=P.exports.useContext($u);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ws),n}return t}let Uu=P.exports.createContext(null);Uu.displayName="PopoverAPIContext";function zu(e){let t=P.exports.useContext(Uu);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,zu),n}return t}let Bu=P.exports.createContext(null);Bu.displayName="PopoverGroupContext";function yg(){return P.exports.useContext(Bu)}let Qu=P.exports.createContext(null);Qu.displayName="PopoverPanelContext";function k1(){return P.exports.useContext(Qu)}function O1(e,t){return St(t.type,P1,e,t)}let _1="div",E1=ze(function(e,t){var n;let r=`headlessui-popover-button-${yt()}`,i=`headlessui-popover-panel-${yt()}`,o=P.exports.useRef(null),s=Ue(t,a1(k=>{o.current=k})),a=P.exports.useReducer(O1,{popoverState:1,button:null,buttonId:r,panel:null,panelId:i,beforePanelSentinel:P.exports.createRef(),afterPanelSentinel:P.exports.createRef()}),[{popoverState:l,button:u,panel:c,beforePanelSentinel:f,afterPanelSentinel:d},p]=a,g=Au((n=o.current)!=null?n:u);P.exports.useEffect(()=>p({type:3,buttonId:r}),[r,p]),P.exports.useEffect(()=>p({type:5,panelId:i}),[i,p]);let y=P.exports.useMemo(()=>{if(!u||!c)return!1;for(let k of document.querySelectorAll("body > *"))if(Number(k==null?void 0:k.contains(u))^Number(k==null?void 0:k.contains(c)))return!0;return!1},[u,c]),x=P.exports.useMemo(()=>({buttonId:r,panelId:i,close:()=>p({type:1})}),[r,i,p]),v=yg(),h=v==null?void 0:v.registerPopover,m=q(()=>{var k;return(k=v==null?void 0:v.isFocusWithinPopoverGroup())!=null?k:(g==null?void 0:g.activeElement)&&((u==null?void 0:u.contains(g.activeElement))||(c==null?void 0:c.contains(g.activeElement)))});P.exports.useEffect(()=>h==null?void 0:h(x),[h,x]),m1(g==null?void 0:g.defaultView,"focus",k=>{var E,I,j,z;l===0&&(m()||!u||!c||(I=(E=f.current)==null?void 0:E.contains)!=null&&I.call(E,k.target)||(z=(j=d.current)==null?void 0:j.contains)!=null&&z.call(j,k.target)||p({type:1}))},!0),s1([u,c],(k,E)=>{p({type:1}),fg(E,Du.Loose)||(k.preventDefault(),u==null||u.focus())},l===0);let S=q(k=>{p({type:1});let E=(()=>k?k instanceof HTMLElement?k:"current"in k&&k.current instanceof HTMLElement?k.current:u:u)();E==null||E.focus()}),_=P.exports.useMemo(()=>({close:S,isPortalled:y}),[S,y]),O=P.exports.useMemo(()=>({open:l===0,close:S}),[l,S]),C=e,b={ref:s};return G.createElement($u.Provider,{value:a},G.createElement(Uu.Provider,{value:_},G.createElement(p1,{value:St(l,{[0]:Pi.Open,[1]:Pi.Closed})},Ie({ourProps:b,theirProps:C,slot:O,defaultTag:_1,name:"Popover"}))))}),C1="button",b1=ze(function(e,t){let[n,r]=ws("Popover.Button"),{isPortalled:i}=zu("Popover.Button"),o=P.exports.useRef(null),s=`headlessui-focus-sentinel-${yt()}`,a=yg(),l=a==null?void 0:a.closeOthers,u=k1(),c=u===null?!1:u===n.panelId,f=Ue(o,t,c?null:k=>r({type:2,button:k})),d=Ue(o,t),p=Au(o),g=q(k=>{var E,I,j;if(c){if(n.popoverState===1)return;switch(k.key){case se.Space:case se.Enter:k.preventDefault(),(I=(E=k.target).click)==null||I.call(E),r({type:1}),(j=n.button)==null||j.focus();break}}else switch(k.key){case se.Space:case se.Enter:k.preventDefault(),k.stopPropagation(),n.popoverState===1&&(l==null||l(n.buttonId)),r({type:0});break;case se.Escape:if(n.popoverState!==0)return l==null?void 0:l(n.buttonId);if(!o.current||(p==null?void 0:p.activeElement)&&!o.current.contains(p.activeElement))return;k.preventDefault(),k.stopPropagation(),r({type:1});break}}),y=q(k=>{c||k.key===se.Space&&k.preventDefault()}),x=q(k=>{var E,I;Mu(k.currentTarget)||e.disabled||(c?(r({type:1}),(E=n.button)==null||E.focus()):(k.preventDefault(),k.stopPropagation(),n.popoverState===1&&(l==null||l(n.buttonId)),r({type:0}),(I=n.button)==null||I.focus()))}),v=q(k=>{k.preventDefault(),k.stopPropagation()}),h=n.popoverState===0,m=P.exports.useMemo(()=>({open:h}),[h]),S=Fu(e,o),_=e,O=c?{ref:d,type:S,onKeyDown:g,onClick:x}:{ref:f,id:n.buttonId,type:S,"aria-expanded":e.disabled?void 0:n.popoverState===0,"aria-controls":n.panel?n.panelId:void 0,onKeyDown:g,onKeyUp:y,onClick:x,onMouseDown:v},C=gg(),b=q(()=>{let k=n.panel;if(!k)return;function E(){St(C.current,{[Tn.Forwards]:()=>nt(k,me.First),[Tn.Backwards]:()=>nt(k,me.Last)})}E()});return R(lt,{children:[Ie({ourProps:O,theirProps:_,slot:m,defaultTag:C1,name:"Popover.Button"}),h&&!c&&i&&w(Er,{id:s,features:_r.Focusable,as:"button",type:"button",onFocus:b})]})}),R1="div",N1=Un.RenderStrategy|Un.Static,T1=ze(function(e,t){let[{popoverState:n},r]=ws("Popover.Overlay"),i=Ue(t),o=`headlessui-popover-overlay-${yt()}`,s=hg(),a=(()=>s!==null?s===Pi.Open:n===0)(),l=q(c=>{if(Mu(c.currentTarget))return c.preventDefault();r({type:1})}),u=P.exports.useMemo(()=>({open:n===0}),[n]);return Ie({ourProps:{ref:i,id:o,"aria-hidden":!0,onClick:l},theirProps:e,slot:u,defaultTag:R1,features:N1,visible:a,name:"Popover.Overlay"})}),I1="div",L1=Un.RenderStrategy|Un.Static,D1=ze(function(e,t){let{focus:n=!1,...r}=e,[i,o]=ws("Popover.Panel"),{close:s,isPortalled:a}=zu("Popover.Panel"),l=`headlessui-focus-sentinel-before-${yt()}`,u=`headlessui-focus-sentinel-after-${yt()}`,c=P.exports.useRef(null),f=Ue(c,t,_=>{o({type:4,panel:_})}),d=Au(c),p=hg(),g=(()=>p!==null?p===Pi.Open:i.popoverState===0)(),y=q(_=>{var O;switch(_.key){case se.Escape:if(i.popoverState!==0||!c.current||(d==null?void 0:d.activeElement)&&!c.current.contains(d.activeElement))return;_.preventDefault(),_.stopPropagation(),o({type:1}),(O=i.button)==null||O.focus();break}});P.exports.useEffect(()=>{var _;e.static||i.popoverState===1&&((_=e.unmount)!=null?_:!0)&&o({type:4,panel:null})},[i.popoverState,e.unmount,e.static,o]),P.exports.useEffect(()=>{if(!n||i.popoverState!==0||!c.current)return;let _=d==null?void 0:d.activeElement;c.current.contains(_)||nt(c.current,me.First)},[n,c,i.popoverState]);let x=P.exports.useMemo(()=>({open:i.popoverState===0,close:s}),[i,s]),v={ref:f,id:i.panelId,onKeyDown:y,onBlur:n&&i.popoverState===0?_=>{var O,C,b,k,E;let I=_.relatedTarget;!I||!c.current||(O=c.current)!=null&&O.contains(I)||(o({type:1}),(((b=(C=i.beforePanelSentinel.current)==null?void 0:C.contains)==null?void 0:b.call(C,I))||((E=(k=i.afterPanelSentinel.current)==null?void 0:k.contains)==null?void 0:E.call(k,I)))&&I.focus({preventScroll:!0}))}:void 0,tabIndex:-1},h=gg(),m=q(()=>{let _=c.current;if(!_)return;function O(){St(h.current,{[Tn.Forwards]:()=>{nt(_,me.First)},[Tn.Backwards]:()=>{var C;(C=i.button)==null||C.focus({preventScroll:!0})}})}O()}),S=q(()=>{let _=c.current;if(!_)return;function O(){St(h.current,{[Tn.Forwards]:()=>{var C,b,k;if(!i.button)return;let E=cg(),I=E.indexOf(i.button),j=E.slice(0,I+1),z=[...E.slice(I+1),...j];for(let H of z.slice())if(((b=(C=H==null?void 0:H.id)==null?void 0:C.startsWith)==null?void 0:b.call(C,"headlessui-focus-sentinel-"))||((k=i.panel)==null?void 0:k.contains(H))){let Oe=z.indexOf(H);Oe!==-1&&z.splice(Oe,1)}nt(z,me.First,!1)},[Tn.Backwards]:()=>nt(_,me.Last)})}O()});return G.createElement(Qu.Provider,{value:i.panelId},g&&a&&w(Er,{id:l,ref:i.beforePanelSentinel,features:_r.Focusable,as:"button",type:"button",onFocus:m}),Ie({ourProps:v,theirProps:r,slot:x,defaultTag:I1,features:L1,visible:g,name:"Popover.Panel"}),g&&a&&w(Er,{id:u,ref:i.afterPanelSentinel,features:_r.Focusable,as:"button",type:"button",onFocus:S}))}),F1="div",M1=ze(function(e,t){let n=P.exports.useRef(null),r=Ue(n,t),[i,o]=P.exports.useState([]),s=q(g=>{o(y=>{let x=y.indexOf(g);if(x!==-1){let v=y.slice();return v.splice(x,1),v}return y})}),a=q(g=>(o(y=>[...y,g]),()=>s(g))),l=q(()=>{var g;let y=Lu(n);if(!y)return!1;let x=y.activeElement;return(g=n.current)!=null&&g.contains(x)?!0:i.some(v=>{var h,m;return((h=y.getElementById(v.buttonId))==null?void 0:h.contains(x))||((m=y.getElementById(v.panelId))==null?void 0:m.contains(x))})}),u=q(g=>{for(let y of i)y.buttonId!==g&&y.close()}),c=P.exports.useMemo(()=>({registerPopover:a,unregisterPopover:s,isFocusWithinPopoverGroup:l,closeOthers:u}),[a,s,l,u]),f=P.exports.useMemo(()=>({}),[]),d=e,p={ref:r};return G.createElement(Bu.Provider,{value:c},Ie({ourProps:p,theirProps:d,slot:f,defaultTag:F1,name:"Popover.Group"}))}),fr=Object.assign(E1,{Button:b1,Overlay:T1,Panel:D1,Group:M1}),Sg=P.exports.createContext(null);function wg(){let e=P.exports.useContext(Sg);if(e===null){let t=new Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,wg),t}return e}function j1(){let[e,t]=P.exports.useState([]);return[e.length>0?e.join(" "):void 0,P.exports.useMemo(()=>function(n){let r=q(o=>(t(s=>[...s,o]),()=>t(s=>{let a=s.slice(),l=a.indexOf(o);return l!==-1&&a.splice(l,1),a}))),i=P.exports.useMemo(()=>({register:r,slot:n.slot,name:n.name,props:n.props}),[r,n.slot,n.name,n.props]);return G.createElement(Sg.Provider,{value:i},n.children)},[t])]}let A1="label",$1=ze(function(e,t){let{passive:n=!1,...r}=e,i=wg(),o=`headlessui-label-${yt()}`,s=Ue(t);Wt(()=>i.register(o),[o,i.register]);let a={ref:s,...i.props,id:o};return n&&("onClick"in a&&delete a.onClick,"onClick"in r&&delete r.onClick),Ie({ourProps:a,theirProps:r,slot:i.slot||{},defaultTag:A1,name:i.name||"Label"})}),Hu=P.exports.createContext(null);Hu.displayName="GroupContext";let U1=P.exports.Fragment;function z1(e){let[t,n]=P.exports.useState(null),[r,i]=j1(),[o,s]=v1(),a=P.exports.useMemo(()=>({switch:t,setSwitch:n,labelledby:r,describedby:o}),[t,n,r,o]),l={},u=e;return G.createElement(s,{name:"Switch.Description"},G.createElement(i,{name:"Switch.Label",props:{onClick(){!t||(t.click(),t.focus({preventScroll:!0}))}}},G.createElement(Hu.Provider,{value:a},Ie({ourProps:l,theirProps:u,defaultTag:U1,name:"Switch.Group"}))))}let B1="button",Q1=ze(function(e,t){let{checked:n,defaultChecked:r=!1,onChange:i,name:o,value:s,...a}=e,l=`headlessui-switch-${yt()}`,u=P.exports.useContext(Hu),c=P.exports.useRef(null),f=Ue(c,t,u===null?null:u.setSwitch),[d,p]=h1(n,i,r),g=q(()=>p==null?void 0:p(!d)),y=q(S=>{if(Mu(S.currentTarget))return S.preventDefault();S.preventDefault(),g()}),x=q(S=>{S.key===se.Space?(S.preventDefault(),g()):S.key===se.Enter&&f1(S.currentTarget)}),v=q(S=>S.preventDefault()),h=P.exports.useMemo(()=>({checked:d}),[d]),m={id:l,ref:f,role:"switch",type:Fu(e,c),tabIndex:0,"aria-checked":d,"aria-labelledby":u==null?void 0:u.labelledby,"aria-describedby":u==null?void 0:u.describedby,onClick:y,onKeyUp:x,onKeyPress:v};return G.createElement(G.Fragment,null,o!=null&&d&&G.createElement(Er,{features:_r.Hidden,...wl({as:"input",type:"checkbox",hidden:!0,readOnly:!0,checked:d,name:o,value:s})}),Ie({ourProps:m,theirProps:a,slot:h,defaultTag:B1,name:"Switch"}))}),aa=Object.assign(Q1,{Group:z1,Label:$1,Description:S1});function H1({onFocus:e}){let[t,n]=P.exports.useState(!0);return t?G.createElement(Er,{as:"button",type:"button",features:_r.Focusable,onFocus:r=>{r.preventDefault();let i,o=50;function s(){if(o--<=0){i&&cancelAnimationFrame(i);return}if(e()){n(!1),cancelAnimationFrame(i);return}i=requestAnimationFrame(s)}i=requestAnimationFrame(s)}}):null}var V1=(e=>(e[e.SetSelectedIndex=0]="SetSelectedIndex",e[e.RegisterTab=1]="RegisterTab",e[e.UnregisterTab=2]="UnregisterTab",e[e.RegisterPanel=3]="RegisterPanel",e[e.UnregisterPanel=4]="UnregisterPanel",e))(V1||{});let q1={[0](e,t){let n=e.tabs.filter(o=>{var s;return!((s=o.current)!=null&&s.hasAttribute("disabled"))});if(t.index<0)return{...e,selectedIndex:e.tabs.indexOf(n[0])};if(t.index>e.tabs.length)return{...e,selectedIndex:e.tabs.indexOf(n[n.length-1])};let r=e.tabs.slice(0,t.index),i=[...e.tabs.slice(t.index),...r].find(o=>n.includes(o));return i?{...e,selectedIndex:e.tabs.indexOf(i)}:e},[1](e,t){var n;if(e.tabs.includes(t.tab))return e;let r=e.tabs[e.selectedIndex],i=Sl([...e.tabs,t.tab],s=>s.current),o=(n=i.indexOf(r))!=null?n:e.selectedIndex;return o===-1&&(o=e.selectedIndex),{...e,tabs:i,selectedIndex:o}},[2](e,t){return{...e,tabs:e.tabs.filter(n=>n!==t.tab)}},[3](e,t){return e.panels.includes(t.panel)?e:{...e,panels:Sl([...e.panels,t.panel],n=>n.current)}},[4](e,t){return{...e,panels:e.panels.filter(n=>n!==t.panel)}}},Vu=P.exports.createContext(null);Vu.displayName="TabsSSRContext";function qu(e){let t=P.exports.useContext(Vu);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,qu),n}return t}let Ku=P.exports.createContext(null);Ku.displayName="TabsDataContext";function Ni(e){let t=P.exports.useContext(Ku);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ni),n}return t}let Wu=P.exports.createContext(null);Wu.displayName="TabsActionsContext";function Gu(e){let t=P.exports.useContext(Wu);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Gu),n}return t}function K1(e,t){return St(t.type,q1,e,t)}let W1=P.exports.Fragment,G1=ze(function(e,t){let{defaultIndex:n=0,vertical:r=!1,manual:i=!1,onChange:o,selectedIndex:s=null,...a}=e;const l=r?"vertical":"horizontal",u=i?"manual":"auto";let c=s!==null,f=Ue(t),[d,p]=P.exports.useReducer(K1,{selectedIndex:s!=null?s:n,tabs:[],panels:[]}),g=P.exports.useMemo(()=>({selectedIndex:d.selectedIndex}),[d.selectedIndex]),y=Dn(o||(()=>{})),x=Dn(d.tabs),v=P.exports.useMemo(()=>({orientation:l,activation:u,...d}),[l,u,d]),h=Dn(c?e.selectedIndex:d.selectedIndex),m=P.exports.useMemo(()=>({registerTab(O){return p({type:1,tab:O}),()=>p({type:2,tab:O})},registerPanel(O){return p({type:3,panel:O}),()=>p({type:4,panel:O})},change(O){h.current!==O&&y.current(O),c||p({type:0,index:O})}}),[p,c]);Wt(()=>{p({type:0,index:s!=null?s:n})},[s]);let S=P.exports.useRef({tabs:[],panels:[]}),_={ref:f};return G.createElement(Vu.Provider,{value:S},G.createElement(Wu.Provider,{value:m},G.createElement(Ku.Provider,{value:v},v.tabs.length<=0&&G.createElement(H1,{onFocus:()=>{var O,C;for(let b of x.current)if(((O=b.current)==null?void 0:O.tabIndex)===0)return(C=b.current)==null||C.focus(),!0;return!1}}),Ie({ourProps:_,theirProps:a,slot:g,defaultTag:W1,name:"Tabs"}))))}),Y1="div",J1=ze(function(e,t){let{orientation:n,selectedIndex:r}=Ni("Tab.List"),i=Ue(t);return Ie({ourProps:{ref:i,role:"tablist","aria-orientation":n},theirProps:e,slot:{selectedIndex:r},defaultTag:Y1,name:"Tabs.List"})}),X1="button",Z1=ze(function(e,t){var n,r;let i=`headlessui-tabs-tab-${yt()}`,{orientation:o,activation:s,selectedIndex:a,tabs:l,panels:u}=Ni("Tab"),c=Gu("Tab"),f=qu("Tab"),d=P.exports.useRef(null),p=Ue(d,t);Wt(()=>c.registerTab(d),[c,d]);let g=f.current.tabs.indexOf(i);g===-1&&(g=f.current.tabs.push(i)-1);let y=l.indexOf(d);y===-1&&(y=g);let x=y===a,v=q(k=>{let E=l.map(I=>I.current).filter(Boolean);if(k.key===se.Space||k.key===se.Enter){k.preventDefault(),k.stopPropagation(),c.change(y);return}switch(k.key){case se.Home:case se.PageUp:return k.preventDefault(),k.stopPropagation(),nt(E,me.First);case se.End:case se.PageDown:return k.preventDefault(),k.stopPropagation(),nt(E,me.Last)}if(St(o,{vertical(){if(k.key===se.ArrowUp)return nt(E,me.Previous|me.WrapAround);if(k.key===se.ArrowDown)return nt(E,me.Next|me.WrapAround)},horizontal(){if(k.key===se.ArrowLeft)return nt(E,me.Previous|me.WrapAround);if(k.key===se.ArrowRight)return nt(E,me.Next|me.WrapAround)}}))return k.preventDefault()}),h=q(()=>{var k;(k=d.current)==null||k.focus()}),m=P.exports.useRef(!1),S=q(()=>{var k;m.current||(m.current=!0,(k=d.current)==null||k.focus(),c.change(y),Z0(()=>{m.current=!1}))}),_=q(k=>{k.preventDefault()}),O=P.exports.useMemo(()=>({selected:x}),[x]),C=e,b={ref:p,onKeyDown:v,onFocus:s==="manual"?h:S,onMouseDown:_,onClick:S,id:i,role:"tab",type:Fu(e,d),"aria-controls":(r=(n=u[y])==null?void 0:n.current)==null?void 0:r.id,"aria-selected":x,tabIndex:x?0:-1};return Ie({ourProps:b,theirProps:C,slot:O,defaultTag:X1,name:"Tabs.Tab"})}),eS="div",tS=ze(function(e,t){let{selectedIndex:n}=Ni("Tab.Panels"),r=Ue(t),i=P.exports.useMemo(()=>({selectedIndex:n}),[n]);return Ie({ourProps:{ref:r},theirProps:e,slot:i,defaultTag:eS,name:"Tabs.Panels"})}),nS="div",rS=Un.RenderStrategy|Un.Static,iS=ze(function(e,t){var n,r,i,o;let{selectedIndex:s,tabs:a,panels:l}=Ni("Tab.Panel"),u=Gu("Tab.Panel"),c=qu("Tab.Panel"),f=`headlessui-tabs-panel-${yt()}`,d=P.exports.useRef(null),p=Ue(d,t);Wt(()=>u.registerPanel(d),[u,d]);let g=c.current.panels.indexOf(f);g===-1&&(g=c.current.panels.push(f)-1);let y=l.indexOf(d);y===-1&&(y=g);let x=y===s,v=P.exports.useMemo(()=>({selected:x}),[x]),h=e,m={ref:p,id:f,role:"tabpanel","aria-labelledby":(r=(n=a[y])==null?void 0:n.current)==null?void 0:r.id,tabIndex:x?0:-1};return!x&&((i=e.unmount)!=null?i:!0)&&!((o=e.static)!=null&&o)?G.createElement(Er,{as:"span",...m}):Ie({ourProps:m,theirProps:h,slot:v,defaultTag:nS,features:rS,visible:x,name:"Tabs.Panel"})}),On=Object.assign(Z1,{Group:G1,List:J1,Panels:tS,Panel:iS});var xg="_1m2mgvr1",Pg="_1m2mgvr0",kg="_1m2mgvr2 _1g1xsdd0 _1g1xsdd3 _1g1xsdd7 _1g1xsdd4";var Ve="_1961rof1",re="_1961rof0",oS="_1961rof2";var sS="_1d4r83s0";function aS(){return R(fr,{className:Pg,children:[R(fr.Button,{className:xg,children:[w("i",{className:[Ve,"fa-solid","fa-comments"].join(" ")}),"Help & Community"]}),w(fr.Panel,{className:kg,children:w("div",{className:sS,children:R("ul",{children:[w("li",{className:re,children:R("a",{href:"https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md",target:"_blank",rel:"noreferrer",children:[w("i",{className:[Ve,"fa-solid","fa-circle-question"].join(" ")})," Usual Problems and Solutions"]})}),w("li",{className:re,children:R("a",{href:"https://discord.com/invite/u9yhsFmEkB",target:"_blank",rel:"noreferrer",children:[w("i",{className:[Ve,"fa-brands","fa-discord"].join(" ")})," Discord user Community"]})}),w("li",{className:re,children:R("a",{href:"https://old.reddit.com/r/StableDiffusionUI/",target:"_blank",rel:"noreferrer",children:[w("i",{className:[Ve,"fa-brands","fa-reddit"].join(" ")})," Reddit Community"]})}),w("li",{className:re,children:R("a",{href:"https://github.com/cmdr2/stable-diffusion-ui ",target:"_blank",rel:"noreferrer",children:[w("i",{className:[Ve,"fa-brands","fa-github"].join(" ")})," Source Code on Github"]})})]})})})]})}function mn(e){return mn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mn(e)}function Dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qf(e,t){for(var n=0;n",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026","/":"/","/":"/"},cS=function(t){return uS[t]},fS=function(t){return t.replace(lS,cS)};function Kf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Wf(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};xl=Wf(Wf({},xl),e)}function hS(){return xl}var gS=function(){function e(){wt(this,e),this.usedNamespaces={}}return xt(e,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(i){r.usedNamespaces[i]||(r.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function mS(e){Og=e}function vS(){return Og}var yS={type:"3rdParty",init:function(t){pS(t.options.react),mS(t)}};function SS(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var s=function(l,u){var c=t.services.backendConnector.state["".concat(l,"|").concat(u)];return c===-1||c===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!s(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||s(r,e)&&(!i||s(o,e)))}function xS(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Pl("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(o,s){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!s(o.isLanguageChangingTo,e))return!1}}):wS(e,t,n)}function _g(e){if(Array.isArray(e))return e}function PS(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function Jf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=P.exports.useContext(dS)||{},i=r.i18n,o=r.defaultNS,s=n||i||vS();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new gS),!s){Pl("You will need to pass in an i18next instance by using initReactI18next");var a=function(k){return Array.isArray(k)?k[k.length-1]:k},l=[a,{},!1];return l.t=a,l.i18n={},l.ready=!1,l}s.options.react&&s.options.react.wait!==void 0&&Pl("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=la(la(la({},hS()),s.options.react),t),c=u.useSuspense,f=u.keyPrefix,d=e||o||s.options&&s.options.defaultNS;d=typeof d=="string"?[d]:d||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(d);var p=(s.isInitialized||s.initializedStoreOnce)&&d.every(function(b){return xS(b,s,u)});function g(){return s.getFixedT(null,u.nsMode==="fallback"?d:d[0],f)}var y=P.exports.useState(g),x=kS(y,2),v=x[0],h=x[1],m=d.join(),S=OS(m),_=P.exports.useRef(!0);P.exports.useEffect(function(){var b=u.bindI18n,k=u.bindI18nStore;_.current=!0,!p&&!c&&Yf(s,d,function(){_.current&&h(g)}),p&&S&&S!==m&&_.current&&h(g);function E(){_.current&&h(g)}return b&&s&&s.on(b,E),k&&s&&s.store.on(k,E),function(){_.current=!1,b&&s&&b.split(" ").forEach(function(I){return s.off(I,E)}),k&&s&&k.split(" ").forEach(function(I){return s.store.off(I,E)})}},[s,m]);var O=P.exports.useRef(!0);P.exports.useEffect(function(){_.current&&!O.current&&h(g),O.current=!1},[s,f]);var C=[v,s,p];if(C.t=v,C.i18n=s,C.ready=p,p||!p&&!c)return C;throw new Promise(function(b){Yf(s,d,function(){b()})})}function _S(){const{t:e}=Ft(),[t,n]=P.exports.useState(!1),[r,i]=P.exports.useState("beta"),{status:o,data:s}=wr([vl],og),a=zh(),{status:l,data:u}=wr([C0],async()=>await b0(r),{enabled:t});return P.exports.useEffect(()=>{if(o==="success"){const{update_branch:c}=s;i(c==="main"?"beta":"main")}},[o,s]),P.exports.useEffect(()=>{l==="success"&&(u[0]==="OK"&&a.invalidateQueries([vl]),n(!1))},[l,u,n]),R("label",{children:[w("input",{type:"checkbox",checked:r==="main",onChange:c=>{n(!0)}}),"\u{1F525}",e("advanced-settings.beta")," ",e("advanced-settings.beta-disc")]})}var ES="cg4q680";function CS(){const{t:e}=Ft(),t=D(c=>c.isUseAutoSave()),n=D(c=>c.getValueForRequestKey("save_to_disk_path")),r=D(c=>c.getValueForRequestKey("turbo")),i=D(c=>c.getValueForRequestKey("use_cpu")),o=D(c=>c.getValueForRequestKey("use_full_precision")),s=D(c=>c.isSoundEnabled()),a=D(c=>c.setRequestOptions),l=D(c=>c.toggleUseAutoSave),u=D(c=>c.toggleSoundEnabled);return R(fr,{className:Pg,children:[R(fr.Button,{className:xg,children:[w("i",{className:[Ve,"fa-solid","fa-gear"].join(" ")}),"Settings"]}),w(fr.Panel,{className:kg,children:R("div",{className:ES,children:[w("h4",{children:"System Settings"}),R("ul",{children:[R("li",{className:re,children:[R("label",{children:[w("input",{checked:t,onChange:c=>l(),type:"checkbox"}),e("storage.ast")," "]}),R("label",{children:[w("input",{value:n,onChange:c=>a("save_to_disk_path",c.target.value),size:40,disabled:!t}),w("span",{className:"visually-hidden",children:"Path on disk where images will be saved"})]})]}),w("li",{className:re,children:R("label",{children:[w("input",{checked:s,onChange:c=>u(),type:"checkbox"}),e("advanced-settings.sound")]})}),w("li",{className:re,children:R("label",{children:[w("input",{checked:r,onChange:c=>a("turbo",c.target.checked),type:"checkbox"}),e("advanced-settings.turbo")," ",e("advanced-settings.turbo-disc")]})}),w("li",{className:re,children:R("label",{children:[w("input",{type:"checkbox",checked:i,onChange:c=>a("use_cpu",c.target.checked)}),e("advanced-settings.cpu")," ",e("advanced-settings.cpu-disc")]})}),w("li",{className:re,children:R("label",{children:[w("input",{checked:o,onChange:c=>a("use_full_precision",c.target.checked),type:"checkbox"}),e("advanced-settings.gpu")," ",e("advanced-settings.gpu-disc")]})}),w("li",{className:re,children:w(_S,{})})]})]})})]})}var bS="_1v2cc580",RS="_1v2cc582",NS="_1v2cc581";function TS(){const{t:e}=Ft(),{status:t,data:n}=wr([vl],og),[r,i]=P.exports.useState("2.1.0"),[o,s]=P.exports.useState("");return P.exports.useEffect(()=>{if(t==="success"){const{update_branch:a}=n;i("v2.1"),s(a==="main"?"(stable)":"(beta)")}},[t,n,i,i]),R("div",{className:bS,children:[R("div",{className:NS,children:[R("h1",{children:[e("title")," ",r," ",o," "]}),w(X0,{className:"status-display"})]}),R("div",{className:RS,children:[w(aS,{}),w(CS,{})]})]})}const on={IDLE:"IDLE",FETCHING:"FETCHING",PROGRESSING:"PROGRESSING",SUCCEEDED:"SUCCEEDED",COMPLETE:"COMPLETE",ERROR:"ERROR"},xe=Ri(e=>({status:on.IDLE,step:0,totalSteps:0,data:"",progressImages:[],timeStarted:new Date,timeNow:new Date,appendData:t=>{e(A(n=>{n.data+=t}))},reset:()=>{e(A(t=>{t.status=on.IDLE,t.step=0,t.totalSteps=0,t.data=""}))},setStatus:t=>{e(A(n=>{n.status=t}))},setStep:t=>{e(A(n=>{n.step=t}))},setTotalSteps:t=>{e(A(n=>{n.totalSteps=t}))},addProgressImage:t=>{e(A(n=>{n.progressImages.push(t)}))},setStartTime:()=>{e(A(t=>{t.timeStarted=new Date}))},setNowTime:()=>{e(A(t=>{t.timeNow=new Date}))},resetForFetching:()=>{e(A(t=>{t.status=on.FETCHING,t.progressImages=[],t.step=0,t.totalSteps=0,t.timeNow=new Date,t.timeStarted=new Date}))}})),ei=Ri((e,t)=>({imageMap:new Map,images:[],currentImage:null,updateDisplay:(n,r,i)=>{e(A(o=>{o.currentImage={id:n,display:r,info:i},o.images.unshift({id:n,data:r,info:i}),o.currentImage=o.images[0]}))},setCurrentImage:n=>{e(A(r=>{r.currentImage=n}))},clearDisplay:()=>{e(A(n=>{n.images=[],n.currentImage=null}))}}));var IS="_1xhk59i0";var LS="_1yvg52n0";function DS({imageData:e,metadata:t,className:n}){return w("div",{className:[LS,n].join(" "),children:w("img",{src:e,alt:t.prompt})})}var FS="_1swsr2r2",MS="_1swsr2r1",jS="_1swsr2r3",AS="_1swsr2r0";function $S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ed(e){for(var t=1;t{for(var r of Object.keys(e)){var i;if(e[r]!==((i=t[r])!==null&&i!==void 0?i:n[r]))return!1}return!0},Yu=e=>t=>{var n=e.defaultClassName,r=ed(ed({},e.defaultVariants),t);for(var i in r){var o,s=(o=r[i])!==null&&o!==void 0?o:e.defaultVariants[i];if(s!=null){var a=s;typeof a=="boolean"&&(a=a===!0?"true":"false");var l=e.variantClassNames[i][a];l&&(n+=" "+l)}}for(var[u,c]of e.compoundVariants)US(u,r,e.defaultVariants)&&(n+=" "+c);return n},ie=Yu({defaultClassName:"_1wzejc90",variantClassNames:{color:{primary:"_1wzejc91",secondary:"_1wzejc92",tertiary:"_1wzejc93",cancel:"_1wzejc94",accent:"_1wzejc95",clear:"_1wzejc96"},type:{fill:"_1wzejc97",outline:"_1wzejc98",action:"_1wzejc99"},size:{slim:"_1wzejc9a",large:"_1wzejc9b"}},defaultVariants:{color:"primary",type:"fill"},compoundVariants:[]});function zS({info:e,data:t}){const n=()=>{const{prompt:s,negative_prompt:a,seed:l,num_inference_steps:u,guidance_scale:c,use_face_correction:f,use_upscale:d,width:p,height:g}=e;let y=s.replace(/[^a-zA-Z0-9]/g,"_");y=y.substring(0,100);let x=`${y}_Seed-${l}_Steps-${u}_Guidance-${c}`;return typeof f=="string"&&(x+=`_FaceCorrection-${f}`),typeof d=="string"&&(x+=`_Upscale-${d}`),x+=`_${p}x${g}`,x+=".png",x},r=D(s=>s.setRequestOptions),i=()=>{const s=document.createElement("a");s.download=n(),s.href=t!=null?t:"",s.click()},o=()=>{r("init_image",t)};return w("div",{className:AS,children:w("div",{className:MS,children:w("div",{className:FS,children:R("div",{className:jS,children:[R("div",{children:[R("p",{children:[" ",e==null?void 0:e.prompt]}),R("p",{children:[" ",e==null?void 0:e.negative_prompt]}),R("div",{children:[w("button",{className:ie(),onClick:i,children:"Save"}),w("button",{className:ie({color:"secondary",type:"outline"}),onClick:o,children:"Use as Input"})]})]}),w(DS,{imageData:t,metadata:e})]})})})})}const BS=()=>w("h4",{className:"no-image",children:"Try Making a new image!"}),QS=({images:e})=>w(lt,{children:e.map((t,n)=>{if(n==e.length-1)return w("img",{src:`${Lt}${t}`},n)})});function HS(){xe(n=>n.status);const e=ei(n=>n.currentImage),t=xe(n=>n.progressImages);return R("div",{className:IS,children:[e==null&&w(BS,{}),t.length>0?w(QS,{images:t}):e!=null&&w(zS,{info:e==null?void 0:e.info,data:e==null?void 0:e.data})]})}var VS="_1ma99901 _1g1xsdd0 _1g1xsdd2 _1g1xsdd9 _1g1xsdd4",qS="_1ma99902",KS="_1ma99900",WS="_1ma99903";function GS(){P.exports.useState(!1);const e=ei(i=>i.images),t=ei(i=>i.setCurrentImage),n=ei(i=>i.clearDisplay),r=()=>{n()};return w("div",{className:KS,children:R("div",{className:VS,children:[e!=null&&e.length>0&&w("button",{className:ie(),onClick:()=>{r()},children:"REMOVE ALL"}),w("ul",{className:qS,children:e==null?void 0:e.map((i,o)=>i===void 0?(console.warn(`image ${o} is undefined`),null):w("li",{children:w("button",{className:WS,onClick:()=>{t(i)},children:w("img",{src:i.data,alt:i.info.prompt})})},i.id))})]})})}var kl=Yu({defaultClassName:"ejmsqv0",variantClassNames:{selected:{true:"ejmsqv1"}},defaultVariants:{},compoundVariants:[]});var YS="_3dzc6s0",JS="_3dzc6s1",XS="_3dzc6s3";function ZS(){const[e,t]=P.exports.useState(!0),n=P.exports.useRef(null);return P.exports.useEffect(()=>{n.current!=null&&(e?n.current.removeAttribute("data-hide-history"):n.current.setAttribute("data-hide-history",""))},[n,e]),R("div",{ref:n,className:YS,children:[w("div",{className:JS,children:w(HS,{})}),R("div",{className:XS,children:[w("button",{className:kl({}),onClick:()=>t(r=>!r),children:e?"Hide History":"Show History"}),w(GS,{})]})]})}var ew="_97t2g71",tw="_97t2g70";function nw(){return R("div",{className:tw,children:[R("p",{children:["If you found this project useful and want to help keep it alive, please"," ",w("a",{href:"https://ko-fi.com/cmdr2_stablediffusion_ui",target:"_blank",rel:"noreferrer",children:w("img",{src:`${Lt}/kofi.png`,className:ew})})," ","to help cover the cost of development and maintenance! Thank you for your support!"]}),R("p",{children:["Please feel free to join the"," ",w("a",{href:"https://discord.com/invite/u9yhsFmEkB",target:"_blank",rel:"noreferrer",children:"discord community"})," ","or"," ",w("a",{href:"https://github.com/cmdr2/stable-diffusion-ui/issues",target:"_blank",rel:"noreferrer",children:"file an issue"})," ","if you have any problems or suggestions in using this interface."]}),R("div",{id:"footer-legal",children:[R("p",{children:[w("b",{children:"Disclaimer:"})," The authors of this project are not responsible for any content generated using this interface."]}),R("p",{children:["This license of this software forbids you from sharing any content that violates any laws, produce any harm to a person, disseminate any personal information that would be meant for harm, ",w("br",{}),"spread misinformation and target vulnerable groups. For the full list of restrictions please read"," ",w("a",{href:"https://github.com/cmdr2/stable-diffusion-ui/blob/main/LICENSE",target:"_blank",rel:"noreferrer",children:"the license"}),"."]}),w("p",{children:"By using this software, you consent to the terms and conditions of the license."})]})]})}var rw="_1how28i0 _1g1xsdd0 _1g1xsdd1 _1g1xsdd6 _1g1xsdd4",He=(e=>(e.pending="pending",e.processing="processing",e.complete="complete",e.paused="paused",e.error="error",e))(He||{});const be=Ri((e,t)=>({requests:[],addtoQueue:(n,r)=>{e(A(i=>{const o={id:n,options:r,status:"pending"};i.requests.push(o)}))},pendingRequests:()=>t().requests.filter(n=>n.status==="pending"),hasPendingQueue:()=>t().pendingRequests().length>0,hasAnyQueue:()=>t().requests.length>0,firstInQueue:()=>{const n=t().pendingRequests()[0];return n===void 0?{id:"",options:{},status:"pending"}:n},updateStatus:(n,r)=>{e(A(i=>{const o=i.requests.find(s=>s.id===n);o!==void 0&&(o.status=r)}))},sendPendingToTop:n=>{e(A(r=>{const i=r.requests.find(o=>o.id===n);if(i!==void 0){const o=r.requests.indexOf(i);r.requests.splice(o,1);for(let s=0;s{e(A(r=>{const i=r.requests.findIndex(o=>o.id===n);i>-1&&r.requests.splice(i,1)}))},removeCompleted:()=>{e(A(n=>{n.requests.filter(i=>i.status==="complete").forEach(i=>{const o=n.requests.indexOf(i);n.requests.splice(o,1)})}))},removeErrored:()=>{e(A(n=>{n.requests.filter(i=>i.status==="error").forEach(i=>{const o=n.requests.indexOf(i);n.requests.splice(o,1)})}))},clearQueue:()=>{e(A(n=>{n.requests=[]}))}}));let Ji;const iw=new Uint8Array(16);function ow(){if(!Ji&&(Ji=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ji))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ji(iw)}const he=[];for(let e=0;e<256;++e)he.push((e+256).toString(16).slice(1));function sw(e,t=0){return(he[e[t+0]]+he[e[t+1]]+he[e[t+2]]+he[e[t+3]]+"-"+he[e[t+4]]+he[e[t+5]]+"-"+he[e[t+6]]+he[e[t+7]]+"-"+he[e[t+8]]+he[e[t+9]]+"-"+he[e[t+10]]+he[e[t+11]]+he[e[t+12]]+he[e[t+13]]+he[e[t+14]]+he[e[t+15]]).toLowerCase()}const aw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),td={randomUUID:aw};function Yo(e,t,n){if(td.randomUUID&&!t&&!e)return td.randomUUID();e=e||{};const r=e.random||(e.rng||ow)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return sw(r)}const lw="_batch";function uw(){const{t:e}=Ft(),t=P.exports.useRef(),n=D(E=>E.parallelCount),r=D(E=>E.builtRequest),i=D(E=>E.isRandomSeed()),o=D(E=>E.setRequestOptions),s=D(E=>E.isSoundEnabled()),a=be(E=>E.addtoQueue),l=be(E=>E.hasPendingQueue()),{id:u,options:c}=be(E=>E.firstInQueue()),f=be(E=>E.updateStatus),d=xe(E=>E.status),p=xe(E=>E.setStatus),g=xe(E=>E.setStep),y=xe(E=>E.setTotalSteps),x=xe(E=>E.addProgressImage),v=xe(E=>E.setStartTime),h=xe(E=>E.setNowTime),m=xe(E=>E.resetForFetching);xe(E=>E.appendData);const S=ei(E=>E.updateDisplay),_=(E,I)=>{try{const j=JSON.parse(E),{status:z,request:H,output:Oe}=j;z==="succeeded"?(f(I,He.complete),Oe.forEach((Xe,De)=>{const{data:T,seed:F}=Xe,M={...H,seed:F},B=`${I}${lw}-${F}-${De}`;S(B,T,M)})):(console.warn(`Unexpected status: ${z}`),f(I,He.error))}catch(j){f(I,He.error),console.warn("Error HACKING JSON: ",j)}},O=async(E,I)=>{var H;const j=new TextDecoder;let z="";for(;;){const{done:Oe,value:Xe}=await I.read(),De=j.decode(Xe);if(Oe){p(on.COMPLETE),_(z,E),s&&((H=t.current)==null||H.play());break}try{const T=JSON.parse(De),{status:F}=T;if(F==="progress"){p(on.PROGRESSING);const{progress:{step:M,total_steps:B},output:X}=T;g(M),y(B),M===0?v():h(),X!==void 0&&X.forEach(Yt=>{const _e=`${Yt.path}?t=${new Date().getTime()}`;x(_e)})}else F==="succeeded"?p(on.SUCCEEDED):F==="failed"?(console.warn("failed"),console.warn(T)):console.warn("UNKNOWN ?",T)}catch{z+=De}}},C=async(E,I)=>{var j;try{f(E,He.processing),m();const H=(j=(await R0(I)).body)==null?void 0:j.getReader();H!==void 0&&O(E,H)}catch(z){console.log("TOP LINE STREAM ERROR"),f(E,He.error),console.log(z)}},b=E=>{const I=[];let{num_outputs:j}=E;if(n>j)I.push(j);else for(;j>=1;)j-=n,j<=0?I.push(n):I.push(Math.abs(j));I.forEach((z,H)=>{let Oe=E.seed;H!==0&&(Oe=Go()),a(Yo(),{...E,num_outputs:z,seed:Oe})})},k=async()=>{i&&o("seed",Go());const E=r();b(E)};return P.exports.useEffect(()=>{const E=async I=>{await C(u!=null?u:"",I)};if(!(d===on.PROGRESSING||d===on.FETCHING)&&l){if(c===void 0){console.log("req is undefined");return}E(c).catch(I=>{console.log("HAS QUEUE ERROR"),console.log(I)})}},[l,d,u,c,C]),R(lt,{children:[w("button",{className:ie({size:"large"}),onClick:()=>{k()},children:e("home.make-img-btn")}),w(Iu,{ref:t})]})}var cw="_1ilavkl0 _1g1xsdd0 _1g1xsdd1 _1g1xsdd6 _1g1xsdd4 _1g1xsdd5",fw="_1ilavkl1",dw="_1ilavkl2",pw="_1ilavkl4 _1961rof2",hw="_1ilavkl3";function gw({id:e,name:t,category:n,previews:r,type:i}){const[o,s]=P.exports.useState(!1),a=D(p=>p.removeCreateTag),l=D(p=>p.changeCreateTagType),u=()=>{s(!0)},c=()=>{s(!1)},f=()=>{i==="positive"?l(e,"negative"):l(e,"positive")},d=()=>{console.log("remove"),a(e)};return R("div",{onMouseEnter:u,onMouseLeave:c,className:[cw,i].join(" "),children:[w("p",{className:o?dw:fw,children:t}),o&&w("button",{className:hw,onClick:f,children:i==="positive"?w("i",{className:[Ve,"fa-solid","fa-minus"].join(" ")}):w("i",{className:[Ve,"fa-solid","fa-plus"].join(" ")})}),o&&w("button",{className:pw,onClick:d,children:w("i",{className:[Ve,"fa-solid","fa-close"].join(" ")})})]})}var mw="d1va400";function vw(){D(t=>t.selectedTags());const e=D(t=>t.createTags);return w("div",{children:w("ul",{className:mw,children:e.map(t=>(console.log(t),w("li",{children:w(gw,{id:t.id,name:t.name,category:t==null?void 0:t.category,previews:t==null?void 0:t.previews,type:t.type})},t.id)))})})}var yw="_9fxd10",Sw="_9fxd11",ww="_9fxd12",xw="_9fxd15",Pw="_9fxd16";function kw({positive:e,setPositive:t}){return w(aa.Group,{as:P.exports.Fragment,children:R("div",{className:Sw,children:[w(aa.Label,{children:" Type "}),w(aa,{className:ww,checked:e,onChange:t,children:w("span",{className:xw,children:e?w("i",{className:[Ve,"fa-solid","fa-plus"].join(" ")}):w("i",{className:[Ve,"fa-solid","fa-minus"].join(" ")})})})]})})}function Ow(){const[e,t]=P.exports.useState(!0),[n,r]=P.exports.useState("An astronaut riding a horse"),i=D(a=>a.addCreateTag),{t:o}=Ft(),s=a=>{if(a.key==="Enter"&&n!==""){const l=e?"positive":"negative";n.split(",").map(u=>u.trim()).forEach(u=>{i({id:Yo(),name:u,type:l})}),r("")}};return R("div",{className:yw,children:[R("div",{children:[w("p",{children:o("home.editor-title")}),w("input",{value:n,onKeyDown:s,onChange:a=>{r(a.target.value)}})]}),R("div",{className:Pw,children:[w("button",{className:ie({size:"slim"}),onClick:()=>{},children:"Add Prompt"}),w(kw,{positive:e,setPositive:t})]}),w(vw,{})]})}var _w="_1rn4m8a3",Ew="_1rn4m8a2",Cw="_1rn4m8a0",bw="_1rn4m8a1";function Rw(e){const{t}=Ft(),n=P.exports.useRef(null),r=D(c=>c.getValueForRequestKey("init_image")),i=D(c=>c.isInpainting),o=D(c=>c.setRequestOptions),s=()=>{var c;(c=n.current)==null||c.click()},a=c=>{const f=c.target.files[0];if(f!==void 0){const d=new FileReader;d.onload=p=>{p.target!=null&&o("init_image",p.target.result)},d.readAsDataURL(f)}},l=D(c=>c.toggleInpainting),u=()=>{o("init_image",void 0),o("mask",void 0),i&&l()};return R("div",{className:Cw,children:[R("div",{children:[w("label",{className:bw,children:w("b",{children:t("home.initial-img-txt")})}),w("input",{ref:n,className:Ew,name:"init_image",type:"file",onChange:a}),w("button",{className:ie(),onClick:s,children:t("home.initial-img-btn")})]}),w("div",{className:_w,children:r!==void 0&&R(lt,{children:[R("div",{children:[w("img",{src:r,width:"100",height:"100"}),w("button",{className:oS,onClick:u,children:"X"})]}),R("label",{children:[w("input",{type:"checkbox",onChange:c=>{l()},checked:i}),t("in-paint.txt")]})]})})]})}function Nw(){return Ft(),D(e=>e.getValueForRequestKey("prompt")),D(e=>e.setRequestOptions),R("div",{className:rw,children:[w(uw,{}),w(Ow,{}),w(Rw,{})]})}const Tt=Ri(K0((e,t)=>({isOpenAdvancedSettings:!1,isOpenAdvImprovementSettings:!1,isOpenAdvPropertySettings:!1,isOpenAdvWorkflowSettings:!1,isOpenImageModifier:!1,showQueue:!1,toggleAdvancedSettings:()=>{e(A(n=>{n.isOpenAdvancedSettings=!n.isOpenAdvancedSettings}))},toggleAdvImprovementSettings:()=>{e(A(n=>{n.isOpenAdvImprovementSettings=!n.isOpenAdvImprovementSettings}))},toggleAdvPropertySettings:()=>{e(A(n=>{n.isOpenAdvPropertySettings=!n.isOpenAdvPropertySettings}))},toggleAdvWorkflowSettings:()=>{e(A(n=>{n.isOpenAdvWorkflowSettings=!n.isOpenAdvWorkflowSettings}))},toggleImageModifier:()=>{e(A(n=>{n.isOpenImageModifier=!n.isOpenImageModifier}))},toggleQueue:()=>{e(A(n=>{n.showQueue=!n.showQueue}))}}),{name:"createUI"}));var bg=Yu({defaultClassName:"_1g1xsdd0",variantClassNames:{backing:{normal:"_1g1xsdd1",light:"_1g1xsdd2",dark:"_1g1xsdd3"},rounded:{true:"_1g1xsdd4"},info:{true:"_1g1xsdd5"},level:{1:"_1g1xsdd6",2:"_1g1xsdd7",3:"_1g1xsdd8",flat:"_1g1xsdd9"}},defaultVariants:{backing:"light",level:"flat",rounded:!0},compoundVariants:[]});var ua="_11d5x3d1",Tw="_11d5x3d0";function Iw(){const{t:e}=Ft(),t=D(f=>f.isUsingFaceCorrection()),n=D(f=>f.isUsingUpscaling()),r=D(f=>f.getValueForRequestKey("use_upscale")),i=D(f=>f.getValueForRequestKey("show_only_filtered_image")),o=D(f=>f.toggleUseFaceCorrection),s=D(f=>f.setRequestOptions),a=Tt(f=>f.isOpenAdvImprovementSettings),l=Tt(f=>f.toggleAdvImprovementSettings),[u,c]=P.exports.useState(!1);return P.exports.useEffect(()=>{t||r!=""?c(!1):c(!0)},[t,n,c]),R("div",{children:[w("button",{type:"button",className:ie({type:"action",color:"accent"}),onClick:l,children:"Improvement Settings"}),a&&R(lt,{children:[w("div",{className:re,children:R("label",{children:[w("input",{type:"checkbox",checked:t,onChange:f=>o()}),"Fix incorrect faces and eyes (uses GFPGAN)"]})}),w("div",{className:re,children:R("label",{children:[e("settings.ups"),R("select",{id:"upscale_model",name:"upscale_model",value:r,onChange:f=>{s("use_upscale",f.target.value)},children:[w("option",{value:"",children:e("settings.no-ups")}),w("option",{value:"RealESRGAN_x4plus",children:"RealESRGAN_x4plus"}),w("option",{value:"RealESRGAN_x4plus_anime_6B",children:"RealESRGAN_x4plus_anime_6B"})]})]})}),w("div",{className:re,children:R("label",{children:[w("input",{disabled:u,type:"checkbox",checked:i,onChange:f=>s("show_only_filtered_image",f.target.checked)}),e("settings.corrected")]})})]})]})}const nd=[{value:128,label:"128 (*)"},{value:192,label:"192"},{value:256,label:"256 (*)"},{value:320,label:"320"},{value:384,label:"384"},{value:448,label:"448"},{value:512,label:"512 (*)"},{value:576,label:"576"},{value:640,label:"640"},{value:704,label:"704"},{value:768,label:"768 (*)"},{value:832,label:"832"},{value:896,label:"896"},{value:960,label:"960"},{value:1024,label:"1024 (*)"}];function Lw(){const{t:e}=Ft(),t=D(g=>g.setRequestOptions),n=D(g=>g.toggleUseRandomSeed),r=D(g=>g.isRandomSeed()),i=D(g=>g.getValueForRequestKey("seed")),o=D(g=>g.getValueForRequestKey("num_inference_steps")),s=D(g=>g.getValueForRequestKey("guidance_scale")),a=D(g=>g.getValueForRequestKey("init_image")),l=D(g=>g.getValueForRequestKey("prompt_strength")),u=D(g=>g.getValueForRequestKey("width")),c=D(g=>g.getValueForRequestKey("height")),f=D(g=>g.getValueForRequestKey("sampler")),d=Tt(g=>g.isOpenAdvPropertySettings),p=Tt(g=>g.toggleAdvPropertySettings);return R("div",{children:[w("button",{type:"button",className:ie({type:"action",color:"accent"}),onClick:p,children:"Property Settings"}),d&&R(lt,{children:[R("div",{className:re,children:[R("label",{children:["Seed:",w("input",{size:10,value:i,onChange:g=>t("seed",g.target.value),disabled:r,placeholder:"random"})]}),R("label",{children:[w("input",{type:"checkbox",checked:r,onChange:g=>n()})," ","Random Image"]})]}),w("div",{className:re,children:R("label",{children:[e("settings.steps")," ",w("input",{value:o,onChange:g=>{t("num_inference_steps",g.target.value)},size:4})]})}),R("div",{className:re,children:[R("label",{children:[e("settings.guide-scale"),w("input",{value:s,onChange:g=>t("guidance_scale",g.target.value),type:"range",min:"0",max:"20",step:".1"})]}),w("span",{children:s})]}),a!==void 0&&R("div",{className:re,children:[R("label",{children:[e("settings.prompt-str")," ",w("input",{value:l,onChange:g=>t("prompt_strength",g.target.value),type:"range",min:"0",max:"1",step:".05"})]}),w("span",{children:l})]}),R("div",{className:re,children:[R("label",{children:[e("settings.width"),w("select",{value:u,onChange:g=>t("width",g.target.value),children:nd.map(g=>w("option",{value:g.value,children:g.label},`width-option_${g.value}`))})]}),R("label",{children:[e("settings.height"),w("select",{value:c,onChange:g=>t("height",g.target.value),children:nd.map(g=>w("option",{value:g.value,children:g.label},`height-option_${g.value}`))})]})]}),w("div",{className:re,children:R("label",{children:[e("settings.sampler"),w("select",{value:f,onChange:g=>t("sampler",g.target.value),children:W0.map(g=>w("option",{value:g,children:g},`sampler-option_${g}`))})]})})]})]})}function Dw(){const{t:e}=Ft(),t=D(l=>l.getValueForRequestKey("num_outputs")),n=D(l=>l.parallelCount),r=D(l=>l.setRequestOptions),i=D(l=>l.setParallelCount),o=D(l=>l.getValueForRequestKey("stream_image_progress")),s=Tt(l=>l.isOpenAdvWorkflowSettings),a=Tt(l=>l.toggleAdvWorkflowSettings);return R("div",{children:[w("button",{type:"button",className:ie({type:"action",color:"accent"}),onClick:a,children:"Workflow Settings"}),s&&R(lt,{children:[w("div",{className:re,children:R("label",{children:[e("settings.amount-of-img")," ",w("input",{type:"number",value:t,onChange:l=>r("num_outputs",parseInt(l.target.value,10)),size:4})]})}),w("div",{className:re,children:R("label",{children:[e("settings.how-many"),w("input",{type:"number",value:n,onChange:l=>i(parseInt(l.target.value,10)),size:4})]})}),w("div",{className:re,children:R("label",{children:[e("settings.stream-img"),w("input",{type:"checkbox",checked:o,onChange:l=>r("stream_image_progress",l.target.checked)})]})})]})]})}function Fw(){return R("ul",{className:Tw,children:[w("li",{className:ua,children:w(Iw,{})}),w("li",{className:ua,children:w(Lw,{})}),w("li",{className:ua,children:w(Dw,{})})]})}function Mw(){const e=Tt(n=>n.isOpenAdvancedSettings),t=Tt(n=>n.toggleAdvancedSettings);return R("div",{className:bg({level:1,backing:"normal"}),children:[w("button",{type:"button",onClick:t,className:ie({type:"action",color:"secondary",size:"large"}),children:"Advanced Settings"}),e&&w(Fw,{})]})}var jw="g3uahc1",Aw="g3uahc0",$w="g3uahc2";var Uw="_1uf7s3f3",zw="_1uf7s3f0 _1g1xsdd0 _1g1xsdd1 _1g1xsdd6 _1g1xsdd4 _1g1xsdd5",Bw="_1uf7s3f1",Qw="_1uf7s3f2";function Hw({name:e,category:t,previews:n}){const[r,i]=P.exports.useState(!1),o=()=>{i(!0)},s=()=>{i(!1)},a=D(c=>c.addCreateTag),l=()=>{a({id:Yo(),name:e,type:"positive"})},u=()=>{a({id:Yo(),name:e,type:"negative"})};return D(c=>c.hasTag(t,e)),D(c=>c.toggleTag),R("div",{className:zw,onMouseEnter:o,onMouseLeave:s,children:[w("p",{className:r?Qw:Bw,children:e}),r&&R("div",{className:Uw,children:[w("button",{onClick:l,children:w("i",{className:[Ve,"fa-solid","fa-plus"].join(" ")})}),w("button",{onClick:u,children:w("i",{className:[Ve,"fa-solid","fa-minus"].join(" ")})})]})]})}function Vw({tags:e,category:t}){return w("ul",{className:$w,children:e.map(n=>w("li",{children:w(Hw,{category:t,name:n.modifier,previews:n.previews})},n.modifier))})}function qw({title:e,category:t,tags:n}){const[r,i]=P.exports.useState(!1),o=()=>{i(!r)};return R("div",{className:jw,children:[w("button",{type:"button",className:ie({type:"action",color:"accent"}),onClick:o,children:w("h4",{children:e})}),r&&w(Vw,{category:t,tags:n})]})}function Kw(){const e=D(i=>i.allModifiers),t=Tt(i=>i.isOpenImageModifier),n=Tt(i=>i.toggleImageModifier),r=()=>{n()};return R("div",{className:bg({level:1,backing:"normal"}),children:[w("button",{type:"button",onClick:r,className:ie({type:"action",color:"secondary",size:"large"}),children:"Image Modifiers"}),t&&w("ul",{className:Aw,children:e.map((i,o)=>w("li",{children:w(qw,{title:i.category,category:i.category,tags:i.modifiers})},i.category))})]})}var Ww="fma0ug0";function Gw({imageData:e,brushSize:t,brushShape:n,brushColor:r,isErasing:i,setData:o}){const s=P.exports.useRef(null),a=P.exports.useRef(null),[l,u]=P.exports.useState(!1),[c,f]=P.exports.useState(512),[d,p]=P.exports.useState(512);P.exports.useEffect(()=>{const m=new Image;m.onload=()=>{f(m.width),p(m.height)},m.src=e},[e]),P.exports.useEffect(()=>{if(s.current!=null){const m=s.current.getContext("2d");if(m!=null){const S=m.getImageData(0,0,c,d),_=S.data;for(let O=0;O<_.length;O+=4)_[O+3]>0&&(_[O]=parseInt(r,16),_[O+1]=parseInt(r,16),_[O+2]=parseInt(r,16));m.putImageData(S,0,0)}}},[r]);const g=m=>{u(!0)},y=m=>{u(!1);const S=s.current;if(S!=null){const _=S.toDataURL();o(_)}},x=(m,S,_,O,C)=>{const b=s.current;if(b!=null){const k=b.getContext("2d");if(k!=null)if(i){const E=_/2;k.clearRect(m-E,S-E,_,_)}else k.beginPath(),k.lineWidth=_,k.lineCap=O,k.strokeStyle=C,k.moveTo(m,S),k.lineTo(m,S),k.stroke()}},v=(m,S,_,O,C)=>{const b=a.current;if(b!=null){const k=b.getContext("2d");if(k!=null)if(k.beginPath(),k.clearRect(0,0,b.width,b.height),i){const E=_/2;k.lineWidth=2,k.lineCap="butt",k.strokeStyle=C,k.moveTo(m-E,S-E),k.lineTo(m+E,S-E),k.lineTo(m+E,S+E),k.lineTo(m-E,S+E),k.lineTo(m-E,S-E),k.stroke()}else k.lineWidth=_,k.lineCap=O,k.strokeStyle=C,k.moveTo(m,S),k.lineTo(m,S),k.stroke()}};return R("div",{className:Ww,children:[w("img",{src:e}),w("canvas",{ref:s,width:c,height:d}),w("canvas",{ref:a,width:c,height:d,onMouseDown:g,onMouseUp:y,onMouseMove:m=>{const{nativeEvent:{offsetX:S,offsetY:_}}=m;v(S,_,t,n,r),l&&x(S,_,t,n,r)}})]})}var rd="_2yyo4x2",Yw="_2yyo4x1",Jw="_2yyo4x0";function Xw(){const[e,t]=P.exports.useState("20"),[n,r]=P.exports.useState("round"),[i,o]=P.exports.useState("#fff"),[s,a]=P.exports.useState(!1),l=D(g=>g.getValueForRequestKey("init_image")),u=D(g=>g.setRequestOptions);return R("div",{className:Jw,children:[w(Gw,{imageData:l,brushSize:e,brushShape:n,brushColor:i,isErasing:s,setData:g=>{u("mask",g)}}),R("div",{className:Yw,children:[R("div",{className:rd,children:[w("button",{onClick:()=>{a(!1)},children:"Mask"}),w("button",{onClick:()=>{a(!0)},children:"Erase"}),R("label",{children:["Brush Size",w("input",{type:"range",min:"1",max:"100",value:e,onChange:g=>{t(g.target.value)}})]})]}),R("div",{className:rd,children:[w("button",{onClick:()=>{r("round")},children:"Cirle Brush"}),w("button",{onClick:()=>{r("square")},children:"Square Brush"})]})]})]})}var Zw="jx6k9z0",ex="jx6k9z1";function tx(){const e=D(t=>t.isInpainting);return be(t=>t.hasAnyQueue()),R(lt,{children:[R("div",{className:Zw,children:[w(Nw,{}),w(Mw,{}),w(Kw,{})]}),e&&w("div",{className:ex,children:w(Xw,{})})]})}var nx="_1jtagr80",rx="_1jtagr81";function ix(){const e=be(r=>r.hasAnyQueue()),t=be(r=>r.clearQueue),n=async()=>{try{t();const r=await sg()}catch(r){console.log(r)}};return w("button",{className:ie({color:"cancel",size:"large"}),disabled:!e,onClick:()=>void n(),children:"STOP ALL"})}function ox(){const e=async()=>{try{const t=await sg()}catch(t){console.log(t)}};return w("button",{className:ie({color:"cancel",size:"large"}),onClick:()=>void e(),children:"Stop"})}var sx="_133914l2",ax="_133914l1",lx="_133914l0 _1g1xsdd0 _1g1xsdd2 _1g1xsdd6 _1g1xsdd4 _1g1xsdd5";function ux({request:e}){const t=be(x=>x.removeItem),n=be(x=>x.updateStatus),r=be(x=>x.sendPendingToTop),{id:i,options:{prompt:o,num_outputs:s,seed:a,sampler:l,guidance_scale:u,num_inference_steps:c},status:f}=e,d=()=>{t(i)},p=()=>{n(i,He.paused)},g=()=>{n(i,He.pending)},y=()=>{r(i)};return R("div",{className:[lx,f].join(" "),children:[R("div",{className:ax,children:[w("p",{children:o}),R("p",{children:["Making ",s," concurrent images"]}),R("p",{children:[R("span",{children:["Seed: ",a," "]}),R("span",{children:["Sampler: ",l," "]}),R("span",{children:["Guidance Scale: ",u," "]}),R("span",{children:["Num Inference Steps: ",c," "]})]})]}),R("div",{className:sx,children:[f===He.processing&&w(ox,{}),f===He.complete&&w("button",{className:ie({size:"large"}),onClick:d,children:"Clear"}),f===He.pending&&R(lt,{children:[w("button",{className:ie({color:"cancel"}),onClick:d,children:"Remove"}),w("button",{className:ie({color:"secondary",type:"outline"}),onClick:p,children:"Pause"}),w("button",{className:ie({color:"tertiary",type:"action"}),onClick:y,children:"Send to top"})]}),f===He.paused&&w("button",{className:ie({size:"large"}),onClick:g,children:"Resume"}),f===He.error&&w("button",{className:ie({size:"large"}),onClick:g,children:"Retry"})]})]})}function cx(){const e=be(o=>o.requests),t=be(o=>o.removeCompleted),n=be(o=>o.removeErrored),r=()=>{t()},i=()=>{n()};return R("div",{className:nx,children:[w(ix,{}),R("div",{className:rx,children:[w("button",{className:ie({type:"outline"}),onClick:r,children:"Clear Completed"}),w("button",{className:ie({type:"outline"}),onClick:i,children:"Clear Errored"})]}),e.map(o=>w(ux,{request:o},o.id))]})}function fx(){const[e,t]=P.exports.useState(!0),n=be(p=>p.hasPendingQueue()),r=be(p=>p.pendingRequests()),i=xe(p=>p.status),o=xe(p=>p.step),s=xe(p=>p.totalSteps),a=xe(p=>p.timeStarted),l=xe(p=>p.timeNow),[u,c]=P.exports.useState(0),[f,d]=P.exports.useState(0);return P.exports.useEffect(()=>{s>0?d(Math.round(o/s*100)):d(0)},[o,s]),P.exports.useEffect(()=>{const p=+l-+a,x=((o==0?0:p/o)*s-p)/1e3;c(x.toPrecision(3))},[o,s,a,l,c]),P.exports.useEffect(()=>{n&&t(!1)},[i,n]),R(lt,{children:[w("span",{children:"Queue "}),n&&R("span",{children:[" Items Remaining: ",r.length," "]})]})}var dx="_1j91ti00 ejmsqv2";function px(){return R(On.Group,{children:[R(On.List,{children:[w(On,{as:P.exports.Fragment,children:({selected:e})=>w("button",{className:kl({selected:e}),children:"Create"})}),w(On,{as:P.exports.Fragment,children:({selected:e})=>w("button",{className:kl({selected:e}),children:w(fx,{})})})]}),R(On.Panels,{className:dx,children:[w(On.Panel,{children:w(tx,{})}),w(On.Panel,{children:w(cx,{})})]})]})}function hx(){const e=D(s=>s.setRequestOptions),{status:t,data:n}=wr(["SaveDir"],E0),{status:r,data:i}=wr(["modifications"],_0),o=D(s=>s.setAllModifiers);return P.exports.useEffect(()=>{t==="success"&&e("save_to_disk_path",n)},[e,t,n]),P.exports.useEffect(()=>{r==="success"?o(i):r==="error"&&o(N0)},[e,r,i]),R(lt,{children:[R("div",{className:[y0].join(" "),children:[w("header",{className:P0,children:w(TS,{})}),w("nav",{className:S0,children:w(px,{})}),w("main",{className:w0,children:w(ZS,{})})]}),w("footer",{className:x0,children:w(nw,{})})]})}function gx(){return w("div",{children:w("h1",{children:"Settings"})})}function vn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ol(e,t){return Ol=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Ol(e,t)}function xs(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ol(e,t)}function Ti(e,t){if(t&&(mn(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vn(e)}function It(e){return It=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},It(e)}function mx(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vx(e){return _g(e)||mx(e)||Eg(e)||Cg()}function id(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function od(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};wt(this,e),this.init(t,n)}return xt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||yx,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i1?r-1:0),o=1;o-1?a.replace(/###/g,"."):a}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function ad(e,t,n){var r=Ju(e,t,Object),i=r.obj,o=r.k;i[o]=n}function xx(e,t,n,r){var i=Ju(e,t,Object),o=i.obj,s=i.k;o[s]=o[s]||[],r&&(o[s]=o[s].concat(n)),r||o[s].push(n)}function Jo(e,t){var n=Ju(e,t),r=n.obj,i=n.k;if(!!r)return r[i]}function ld(e,t,n){var r=Jo(e,n);return r!==void 0?r:Jo(t,n)}function Rg(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):Rg(e[r],t[r],n):e[r]=t[r]);return e}function qn(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Px={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function kx(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return Px[t]}):e}var Ps=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Ox=[" ",",","?","!",";"];function _x(e,t,n){t=t||"",n=n||"";var r=Ox.filter(function(a){return t.indexOf(a)<0&&n.indexOf(a)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),o=!i.test(e);if(!o){var s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o}function ud(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Xi(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ng(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;oo+s;)s++,a=r.slice(o,o+s).join(n),l=i[a];if(l===void 0)return;if(l===null)return null;if(t.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var u=r.slice(o+s).join(n);return u?Ng(l,u,n):void 0}i=i[r[o]]}return i}}var bx=function(e){xs(n,e);var t=Ex(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return wt(this,n),i=t.call(this),Ps&&wn.call(vn(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return xt(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,u=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,c=[i,o];s&&typeof s!="string"&&(c=c.concat(s)),s&&typeof s=="string"&&(c=c.concat(l?s.split(l):s)),i.indexOf(".")>-1&&(c=i.split("."));var f=Jo(this.data,c);return f||!u||typeof s!="string"?f:Ng(this.data&&this.data[i]&&this.data[i][o],s,l)}},{key:"addResource",value:function(i,o,s,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var c=[i,o];s&&(c=c.concat(u?s.split(u):s)),i.indexOf(".")>-1&&(c=i.split("."),a=o,o=c[1]),this.addNamespaces(o),ad(this.data,c,a),l.silent||this.emit("added",i,o,s,a)}},{key:"addResources",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in s)(typeof s[l]=="string"||Object.prototype.toString.apply(s[l])==="[object Array]")&&this.addResource(i,o,l,s[l],{silent:!0});a.silent||this.emit("added",i,o,s)}},{key:"addResourceBundle",value:function(i,o,s,a,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},c=[i,o];i.indexOf(".")>-1&&(c=i.split("."),a=s,s=o,o=c[1]),this.addNamespaces(o);var f=Jo(this.data,c)||{};a?Rg(f,s,l):f=Xi(Xi({},f),s),ad(this.data,c,f),u.silent||this.emit("added",i,o,s)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Xi(Xi({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),s=o&&Object.keys(o)||[];return!!s.find(function(a){return o[a]&&Object.keys(o[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(wn),Tg={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,i,o){var s=this;return t.forEach(function(a){s.processors[a]&&(n=s.processors[a].process(n,r,i,o))}),n}};function cd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ee(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var fd={},dd=function(e){xs(n,e);var t=Rx(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return wt(this,n),i=t.call(this),Ps&&wn.call(vn(i)),wx(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,vn(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Ct.create("translator"),i}return xt(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var s=this.resolve(i,o);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(i,o){var s=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],u=s&&i.indexOf(s)>-1,c=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!_x(i,s,a);if(u&&!c){var f=i.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:i,namespaces:l};var d=i.split(s);(s!==a||s===a&&this.options.ns.indexOf(d[0])>-1)&&(l=d.shift()),i=d.join(a)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,s){var a=this;if(mn(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,c=this.extractFromKey(i[i.length-1],o),f=c.key,d=c.namespaces,p=d[d.length-1],g=o.lng||this.language,y=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g&&g.toLowerCase()==="cimode"){if(y){var x=o.nsSeparator||this.options.nsSeparator;return l?(v.res="".concat(p).concat(x).concat(f),v):"".concat(p).concat(x).concat(f)}return l?(v.res=f,v):f}var v=this.resolve(i,o),h=v&&v.res,m=v&&v.usedKey||f,S=v&&v.exactUsedKey||f,_=Object.prototype.toString.apply(h),O=["[object Number]","[object Function]","[object RegExp]"],C=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,k=typeof h!="string"&&typeof h!="boolean"&&typeof h!="number";if(b&&h&&k&&O.indexOf(_)<0&&!(typeof C=="string"&&_==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var E=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,h,Ee(Ee({},o),{},{ns:d})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return l?(v.res=E,v):E}if(u){var I=_==="[object Array]",j=I?[]:{},z=I?S:m;for(var H in h)if(Object.prototype.hasOwnProperty.call(h,H)){var Oe="".concat(z).concat(u).concat(H);j[H]=this.translate(Oe,Ee(Ee({},o),{joinArrays:!1,ns:d})),j[H]===Oe&&(j[H]=h[H])}h=j}}else if(b&&typeof C=="string"&&_==="[object Array]")h=h.join(C),h&&(h=this.extendTranslation(h,i,o,s));else{var Xe=!1,De=!1,T=o.count!==void 0&&typeof o.count!="string",F=n.hasDefaultValue(o),M=T?this.pluralResolver.getSuffix(g,o.count,o):"",B=o["defaultValue".concat(M)]||o.defaultValue;!this.isValidLookup(h)&&F&&(Xe=!0,h=B),this.isValidLookup(h)||(De=!0,h=f);var X=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Yt=X&&De?void 0:h,_e=F&&B!==h&&this.options.updateMissing;if(De||Xe||_e){if(this.logger.log(_e?"updateKey":"missingKey",g,p,f,_e?B:h),u){var Qn=this.resolve(f,Ee(Ee({},o),{},{keySeparator:!1}));Qn&&Qn.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Be=[],Mt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Mt&&Mt[0])for(var ks=0;ks1&&arguments[1]!==void 0?arguments[1]:{},a,l,u,c,f;return typeof i=="string"&&(i=[i]),i.forEach(function(d){if(!o.isValidLookup(a)){var p=o.extractFromKey(d,s),g=p.key;l=g;var y=p.namespaces;o.options.fallbackNS&&(y=y.concat(o.options.fallbackNS));var x=s.count!==void 0&&typeof s.count!="string",v=x&&!s.ordinal&&s.count===0&&o.pluralResolver.shouldUseIntlApi(),h=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",m=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);y.forEach(function(S){o.isValidLookup(a)||(f=S,!fd["".concat(m[0],"-").concat(S)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(f)&&(fd["".concat(m[0],"-").concat(S)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(m.join(", "),`" won't get resolved as namespace "`).concat(f,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(function(_){if(!o.isValidLookup(a)){c=_;var O=[g];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(O,g,_,S,s);else{var C;x&&(C=o.pluralResolver.getSuffix(_,s.count,s));var b="".concat(o.options.pluralSeparator,"zero");if(x&&(O.push(g+C),v&&O.push(g+b)),h){var k="".concat(g).concat(o.options.contextSeparator).concat(s.context);O.push(k),x&&(O.push(k+C),v&&O.push(k+b))}}for(var E;E=O.pop();)o.isValidLookup(a)||(u=E,a=o.getResource(_,S,E,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:u,usedLng:c,usedNS:f}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,s,a):this.resourceStore.getResource(i,o,s,a)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&o===s.substring(0,o.length)&&i[s]!==void 0)return!0;return!1}}]),n}(wn);function ca(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Tx=function(){function e(t){wt(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ct.create("languageUtils")}return xt(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=ca(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=ca(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=ca(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var s=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(s))&&(i=s)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var s=r.getLanguagePartFromCode(o);if(r.isSupportedCode(s))return i=s;i=r.options.supportedLngs.find(function(a){if(a.indexOf(s)===0)return a})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),s=[],a=function(u){!u||(i.isSupportedCode(u)?s.push(u):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(n))):typeof n=="string"&&a(this.formatLanguageCode(n)),o.forEach(function(l){s.indexOf(l)<0&&a(i.formatLanguageCode(l))}),s}}]),e}(),Ix=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Lx={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},Dx=["v1","v2","v3"],pd={zero:0,one:1,two:2,few:3,many:4,other:5};function Fx(){var e={};return Ix.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:Lx[t.fc]}})}),e}var Mx=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};wt(this,e),this.languageUtils=t,this.options=n,this.logger=Ct.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Fx()}return xt(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(s,a){return pd[s]-pd[a]}).map(function(s){return"".concat(r.options.prepend).concat(s)}):o.numbers.map(function(s){return r.getSuffix(n,s,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),s=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var a=function(){return i.options.prepend&&s.toString()?i.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!Dx.includes(this.options.compatibilityJSON)}}]),e}();function hd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ct(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};wt(this,e),this.logger=Ct.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return xt(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:kx,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?qn(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?qn(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?qn(r.nestingPrefix):r.nestingPrefixEscaped||qn("$t("),this.nestingSuffix=r.nestingSuffix?qn(r.nestingSuffix):r.nestingSuffixEscaped||qn(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var s=this,a,l,u,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(x){return x.replace(/\$/g,"$$$$")}var d=function(v){if(v.indexOf(s.formatSeparator)<0){var h=ld(r,c,v);return s.alwaysFormat?s.format(h,void 0,i,ct(ct(ct({},o),r),{},{interpolationkey:v})):h}var m=v.split(s.formatSeparator),S=m.shift().trim(),_=m.join(s.formatSeparator).trim();return s.format(ld(r,c,S),_,i,ct(ct(ct({},o),r),{},{interpolationkey:S}))};this.resetRegExp();var p=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,g=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,y=[{regex:this.regexpUnescape,safeValue:function(v){return f(v)}},{regex:this.regexp,safeValue:function(v){return s.escapeValue?f(s.escape(v)):f(v)}}];return y.forEach(function(x){for(u=0;a=x.regex.exec(n);){var v=a[1].trim();if(l=d(v),l===void 0)if(typeof p=="function"){var h=p(n,a,o);l=typeof h=="string"?h:""}else if(o&&o.hasOwnProperty(v))l="";else if(g){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(v," for interpolating ").concat(n)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=sd(l));var m=x.safeValue(l);if(n=n.replace(a[0],m),g?(x.regex.lastIndex+=l.length,x.regex.lastIndex-=a[0].length):x.regex.lastIndex=0,u++,u>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,a,l=ct({},o);l.applyPostProcessor=!1,delete l.defaultValue;function u(p,g){var y=this.nestingOptionsSeparator;if(p.indexOf(y)<0)return p;var x=p.split(new RegExp("".concat(y,"[ ]*{"))),v="{".concat(x[1]);p=x[0],v=this.interpolate(v,l);var h=v.match(/'/g),m=v.match(/"/g);(h&&h.length%2===0&&!m||m.length%2!==0)&&(v=v.replace(/'/g,'"'));try{l=JSON.parse(v),g&&(l=ct(ct({},g),l))}catch(S){return this.logger.warn("failed parsing options string in nesting for key ".concat(p),S),"".concat(p).concat(y).concat(v)}return delete l.defaultValue,p}for(;s=this.nestingRegexp.exec(n);){var c=[],f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var d=s[1].split(this.formatSeparator).map(function(p){return p.trim()});s[1]=d.shift(),c=d,f=!0}if(a=r(u.call(this,s[1].trim(),l),l),a&&s[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=sd(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),a=""),f&&(a=c.reduce(function(p,g){return i.format(p,g,o.lng,ct(ct({},o),{},{interpolationkey:s[1].trim()}))},a.trim())),n=n.replace(s[0],a),this.regexp.lastIndex=0}return n}}]),e}();function gd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Xt(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(t==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(s){if(!!s){var a=s.split(":"),l=vx(a),u=l[0],c=l.slice(1),f=c.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=f),f==="false"&&(n[u.trim()]=!1),f==="true"&&(n[u.trim()]=!0),isNaN(f)||(n[u.trim()]=parseInt(f,10))}})}}return{formatName:t,formatOptions:n}}var $x=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wt(this,e),this.logger=Ct.create("formatter"),this.options=t,this.formats={number:function(r,i,o){return new Intl.NumberFormat(i,o).format(r)},currency:function(r,i,o){return new Intl.NumberFormat(i,Xt(Xt({},o),{},{style:"currency"})).format(r)},datetime:function(r,i,o){return new Intl.DateTimeFormat(i,Xt({},o)).format(r)},relativetime:function(r,i,o){return new Intl.RelativeTimeFormat(i,Xt({},o)).format(r,o.range||"day")},list:function(r,i,o){return new Intl.ListFormat(i,Xt({},o)).format(r)}},this.init(t)}return xt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"format",value:function(n,r,i,o){var s=this,a=r.split(this.formatSeparator),l=a.reduce(function(u,c){var f=Ax(c),d=f.formatName,p=f.formatOptions;if(s.formats[d]){var g=u;try{var y=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},x=y.locale||y.lng||o.locale||o.lng||i;g=s.formats[d](u,x,Xt(Xt(Xt({},p),o),y))}catch(v){s.logger.warn(v)}return g}else s.logger.warn("there was no format function for ".concat(d));return u},n);return l}}]),e}();function md(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vd(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bx(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var Qx=function(e){xs(n,e);var t=Ux(n);function n(r,i,o){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return wt(this,n),s=t.call(this),Ps&&wn.call(vn(s)),s.backend=r,s.store=i,s.services=o,s.languageUtils=o.languageUtils,s.options=a,s.logger=Ct.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(o,a.backend,a),s}return xt(n,[{key:"queueLoad",value:function(i,o,s,a){var l=this,u={},c={},f={},d={};return i.forEach(function(p){var g=!0;o.forEach(function(y){var x="".concat(p,"|").concat(y);!s.reload&&l.store.hasResourceBundle(p,y)?l.state[x]=2:l.state[x]<0||(l.state[x]===1?c[x]===void 0&&(c[x]=!0):(l.state[x]=1,g=!1,c[x]===void 0&&(c[x]=!0),u[x]===void 0&&(u[x]=!0),d[y]===void 0&&(d[y]=!0)))}),g||(f[p]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(d)}}},{key:"loaded",value:function(i,o,s){var a=i.split("|"),l=a[0],u=a[1];o&&this.emit("failedLoading",l,u,o),s&&this.store.addResourceBundle(l,u,s),this.state[i]=o?-1:2;var c={};this.queue.forEach(function(f){xx(f.loaded,[l],u),Bx(f,i),o&&f.errors.push(o),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(d){c[d]||(c[d]={});var p=f.loaded[d];p.length&&p.forEach(function(g){c[d][g]===void 0&&(c[d][g]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(i,o,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,c=arguments.length>5?arguments[5]:void 0;if(!i.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:s,tried:l,wait:u,callback:c});return}return this.readingCalls++,this.backend[s](i,o,function(f,d){if(a.readingCalls--,a.waitingReads.length>0){var p=a.waitingReads.shift();a.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(f&&d&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var u=this.queueLoad(i,o,a,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(c){s.loadOne(c)})}},{key:"load",value:function(i,o,s){this.prepareLoading(i,o,{},s)}},{key:"reload",value:function(i,o,s){this.prepareLoading(i,o,{reload:!0},s)}},{key:"loadOne",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=i.split("|"),l=a[0],u=a[1];this.read(l,u,"read",void 0,void 0,function(c,f){c&&o.logger.warn("".concat(s,"loading namespace ").concat(u," for language ").concat(l," failed"),c),!c&&f&&o.logger.log("".concat(s,"loaded namespace ").concat(u," for language ").concat(l),f),o.loaded(i,c,f)})}},{key:"saveMissing",value:function(i,o,s,a,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}s==null||s===""||(this.backend&&this.backend.create&&this.backend.create(i,o,s,a,null,vd(vd({},u),{},{isUpdate:l})),!(!i||!i[0])&&this.store.addResource(i[0],o,s,a))}}]),n}(wn);function Hx(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(mn(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),mn(t[2])==="object"||mn(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function yd(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Sd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kt(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Zi(){}function Kx(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var Xo=function(e){xs(n,e);var t=Vx(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(wt(this,n),r=t.call(this),Ps&&wn.call(vn(r)),r.options=yd(i),r.services={},r.logger=Ct,r.modules={external:[]},Kx(vn(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),Ti(r,vn(r));setTimeout(function(){r.init(i,o)},0)}return r}return xt(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(s=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var a=Hx();this.options=kt(kt(kt({},a),this.options),yd(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=kt(kt({},a.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(v){return v?typeof v=="function"?new v:v:null}if(!this.options.isClone){this.modules.logger?Ct.init(l(this.modules.logger),this.options):Ct.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=$x);var c=new Tx(this.options);this.store=new bx(this.options.resources,this.options);var f=this.services;f.logger=Ct,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new Mx(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(f.formatter=l(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new jx(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Qx(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(v){for(var h=arguments.length,m=new Array(h>1?h-1:0),S=1;S1?h-1:0),S=1;S0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var p=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];p.forEach(function(v){i[v]=function(){var h;return(h=i.store)[v].apply(h,arguments)}});var g=["addResource","addResources","addResourceBundle","removeResourceBundle"];g.forEach(function(v){i[v]=function(){var h;return(h=i.store)[v].apply(h,arguments),i}});var y=$r(),x=function(){var h=function(S,_){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),y.resolve(_),s(S,_)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return h(null,i.t.bind(i));i.changeLanguage(i.options.lng,h)};return this.options.resources||!this.options.initImmediate?x():setTimeout(x,0),y}},{key:"loadResources",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zi,a=s,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(a=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var u=[],c=function(p){if(!!p){var g=o.services.languageUtils.toResolveHierarchy(p);g.forEach(function(y){u.indexOf(y)<0&&u.push(y)})}};if(l)c(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(d){return c(d)})}this.options.preload&&this.options.preload.forEach(function(d){return c(d)}),this.services.backendConnector.load(u,this.options.ns,function(d){!d&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),a(d)})}else a(null)}},{key:"reloadResources",value:function(i,o,s){var a=$r();return i||(i=this.languages),o||(o=this.options.ns),s||(s=Zi),this.services.backendConnector.reload(i,o,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&Tg.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(i,o){var s=this;this.isLanguageChangingTo=i;var a=$r();this.emit("languageChanging",i);var l=function(d){s.language=d,s.languages=s.services.languageUtils.toResolveHierarchy(d),s.resolvedLanguage=void 0,s.setResolvedLanguage(d)},u=function(d,p){p?(l(p),s.translator.changeLanguage(p),s.isLanguageChangingTo=void 0,s.emit("languageChanged",p),s.logger.log("languageChanged",p)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),o&&o(d,function(){return s.t.apply(s,arguments)})},c=function(d){!i&&!d&&s.services.languageDetector&&(d=[]);var p=typeof d=="string"?d:s.services.languageUtils.getBestMatchFromCodes(d);p&&(s.language||l(p),s.translator.language||s.translator.changeLanguage(p),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage(p)),s.loadResources(p,function(g){u(g,p)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(c):c(i),a}},{key:"getFixedT",value:function(i,o,s){var a=this,l=function u(c,f){var d;if(mn(f)!=="object"){for(var p=arguments.length,g=new Array(p>2?p-2:0),y=2;y1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var c=function(p,g){var y=o.services.backendConnector.state["".concat(p,"|").concat(g)];return y===-1||y===2};if(s.precheck){var f=s.precheck(this,c);if(f!==void 0)return f}return!!(this.hasResourceBundle(a,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(a,i)&&(!l||c(u,i)))}},{key:"loadNamespaces",value:function(i,o){var s=this,a=$r();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var s=$r();typeof i=="string"&&(i=[i]);var a=this.options.preload||[],l=i.filter(function(u){return a.indexOf(u)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(u){s.resolve(),o&&o(u)}),s):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zi,a=kt(kt(kt({},this.options),o),{isClone:!0}),l=new n(a);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(c){l[c]=i[c]}),l.services=kt({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new dd(l.services,l.options),l.translator.on("*",function(c){for(var f=arguments.length,d=new Array(f>1?f-1:0),p=1;p0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Xo(e,t)});var Le=Xo.createInstance();Le.createInstance=Xo.createInstance;Le.createInstance;Le.init;Le.loadResources;Le.reloadResources;Le.use;Le.changeLanguage;Le.getFixedT;Le.t;Le.exists;Le.setDefaultNamespace;Le.hasLoadedNamespace;Le.loadNamespaces;Le.loadLanguages;const Wx="Stable Diffusion UI",Gx="",Yx={home:"Home",history:"History",community:"Community",settings:"Settings"},Jx={"status-starting":"Stable Diffusion is starting...","status-ready":"Stable Diffusion is ready to use!","status-error":"Stable Diffusion is not running!","editor-title":"Prompt","initial-img-txt":"Initial Image: (optional)","initial-img-btn":"Browse...","initial-img-text2":"No file selected.","make-img-btn":"Make Image","make-img-btn-stop":"Stop"},Xx={"base-img":"Use base image:",seed:"Seed:","amount-of-img":"Amount of images to make:","how-many":"How many at once:","stream-img":"Stream images (this will slow down image generation):",width:"Width:",height:"Height:",sampler:"Sampler:",steps:"Number of inference steps:","guide-scale":"Guidance Scale:","prompt-str":"Prompt Strength:","live-preview":"Show a live preview of the image (disable this for faster image generation)","fix-face":"Fix incorrect faces and eyes (uses GFPGAN)",ups:"Upscale the image to 4x resolution using:","no-ups":"No Upscaling",corrected:"Show only the corrected/upscaled image"},Zx={txt:"Image Modifiers (art styles, tags etc)"},eP={"use-btn":"Use Image","use-btn2":"Use Image and Tags"},tP={fave:"Favorites Only",search:"Search"},nP={ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cps:"Cross profile sharing","cps-disc":"Profiles will see suggestions from each other.",acb:"Allow cloud backup","acb-disc":"A button will show up for images on hover","acb-place":"Choose your","acc-api":"Api key","acb-api-place":"Your API key",save:"SAVE"},rP=`If you found this project useful and want to help keep it alive, please to help cover the cost of development and maintenance! Thank you for your support!
Please feel free to join the discord community or file an issue if you have any problems or suggestions in using this interface.
@@ -94,10 +94,10 @@ This license of this software forbids you from sharing any content that violates
spread misinformation and target vulnerable groups. For the full list of restrictions please read the license.
By using this software, you consent to the terms and conditions of the license.
-`,Uw={title:Iw,description:bw,navbar:Lw,"land-cre":{cp:"Create Profile","cp-place":"Profile name",pp:"Profile Picture","pp-disc":"",ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cre:"Create"},"land-pre":{user:"Username",add:"Add Profile"},home:Tw,"in-paint":{txt:"In-Painting (select the area which the AI will paint into)",clear:"Clear"},settings:Dw,tags:Fw,"preview-prompt":{part1:'Type a prompt and press the "Make Image" button.',part2:`You can set an "Initial Image" if you want to guide the AI.
+`,iP={title:Wx,description:Gx,navbar:Yx,"land-cre":{cp:"Create Profile","cp-place":"Profile name",pp:"Profile Picture","pp-disc":"",ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cre:"Create"},"land-pre":{user:"Username",add:"Add Profile"},home:Jx,"in-paint":{txt:"In-Painting (select the area which the AI will paint into)",clear:"Clear"},settings:Xx,tags:Zx,"preview-prompt":{part1:'Type a prompt and press the "Make Image" button.',part2:`You can set an "Initial Image" if you want to guide the AI.
`,part3:`You can also add modifiers like "Realistic", "Pencil Sketch", "ArtStation" etc by browsing through the "Image Modifiers" section and selecting the desired modifiers.
-`,part4:'Click "Advanced Settings" for additional settings like seed, image size, number of images to generate etc.',part5:"Enjoy! :)"},"current-task":"Current task","recent-create":"Recently Created",popup:Mw,history:jw,"advanced-settings":{sound:"Play sound on task completion","sound-disc":"Will play a sound so user can hear when image is done.",turbo:"Turbo mode","turbo-disc":"Generates images faster, but uses an additional 1 GB of GPU memory",cpu:"Use CPU instead of GPU","cpu-disc":"Warning: this will be *very* slow",gpu:"Use full precision","gpu-disc":"(for GPU-only. warning: this will consume more VRAM)",beta:"Beta Features","beta-disc":`Get the latest features immediately (but could be less stable).
-Please restart the program after changing this.`,save:"SAVE"},storage:Aw,import:{"imp-btn":"IMPORT","exp-btn":"EXPORT",disc:"It is a good idea to leave the exported file as it is. Otherwise it may not import correctly","disc:2":"When importing, only profiles that are not already present on the will be added."},about:$w},zw="Stable Diffusion UI",Bw="",Hw={home:"Home",history:"History",community:"Community",settings:"Settings"},Qw={"status-starting":"Stable Diffusion is starting...","status-ready":"Stable Diffusion is ready to use!","status-error":"Stable Diffusion is not running!","editor-title":"Prompt","initial-img-txt":"Initial Image: (optional)","initial-img-btn":"Browse...","initial-img-text2":"No file selected.","make-img-btn":"Make Image","make-img-btn-stop":"Stop"},Vw={"base-img":"Use base image:",seed:"Seed:","amount-of-img":"Amount of images to make:","how-many":"How many at once:",width:"Width:",height:"Height:",steps:"Number of inference steps:","guide-scale":"Guidance Scale:","prompt-str":"Prompt Strength:","live-preview":"Show a live preview of the image (disable this for faster image generation)","fix-face":"Fix incorrect faces and eyes (uses GFPGAN)",ups:"Upscale the image to 4x resolution using:","no-ups":"No Upscaling",corrected:"Show only the corrected/upscaled image"},Kw={txt:"Image Modifiers (art styles, tags etc)"},qw={"use-btn":"Use Image","use-btn2":"Use Image and Tags"},Ww={fave:"Favorites Only",search:"Search"},Gw={ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cps:"Cross profile sharing","cps-disc":"Profiles will see suggestions from each other.",acb:"Allow cloud backup","acb-disc":"A button will show up for images on hover","acb-place":"Choose your","acc-api":"Api key","acb-api-place":"Your API key",save:"SAVE"},Yw=`If you found this project useful and want to help keep it alive, please to help cover the cost of development and maintenance! Thank you for your support!
+`,part4:'Click "Advanced Settings" for additional settings like seed, image size, number of images to generate etc.',part5:"Enjoy! :)"},"current-task":"Current task","recent-create":"Recently Created",popup:eP,history:tP,"advanced-settings":{sound:"Play sound on task completion","sound-disc":"Will play a sound so user can hear when image is done.",turbo:"Turbo mode","turbo-disc":"Generates images faster, but uses an additional 1 GB of GPU memory",cpu:"Use CPU instead of GPU","cpu-disc":"Warning: this will be *very* slow",gpu:"Use full precision","gpu-disc":"(for GPU-only. warning: this will consume more VRAM)",beta:"Beta Features","beta-disc":`Get the latest features immediately (but could be less stable).
+Please restart the program after changing this.`,save:"SAVE"},storage:nP,import:{"imp-btn":"IMPORT","exp-btn":"EXPORT",disc:"It is a good idea to leave the exported file as it is. Otherwise it may not import correctly","disc:2":"When importing, only profiles that are not already present on the will be added."},about:rP},oP="Stable Diffusion UI",sP="",aP={home:"Home",history:"History",community:"Community",settings:"Settings"},lP={"status-starting":"Stable Diffusion is starting...","status-ready":"Stable Diffusion is ready to use!","status-error":"Stable Diffusion is not running!","editor-title":"Prompt","initial-img-txt":"Initial Image: (optional)","initial-img-btn":"Browse...","initial-img-text2":"No file selected.","make-img-btn":"Make Image","make-img-btn-stop":"Stop"},uP={"base-img":"Use base image:",seed:"Seed:","amount-of-img":"Amount of images to make:","how-many":"How many at once:",width:"Width:",height:"Height:",steps:"Number of inference steps:","guide-scale":"Guidance Scale:","prompt-str":"Prompt Strength:","live-preview":"Show a live preview of the image (disable this for faster image generation)","fix-face":"Fix incorrect faces and eyes (uses GFPGAN)",ups:"Upscale the image to 4x resolution using:","no-ups":"No Upscaling",corrected:"Show only the corrected/upscaled image"},cP={txt:"Image Modifiers (art styles, tags etc)"},fP={"use-btn":"Use Image","use-btn2":"Use Image and Tags"},dP={fave:"Favorites Only",search:"Search"},pP={ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cps:"Cross profile sharing","cps-disc":"Profiles will see suggestions from each other.",acb:"Allow cloud backup","acb-disc":"A button will show up for images on hover","acb-place":"Choose your","acc-api":"Api key","acb-api-place":"Your API key",save:"SAVE"},hP=`If you found this project useful and want to help keep it alive, please to help cover the cost of development and maintenance! Thank you for your support!
Please feel free to join the discord community or file an issue if you have any problems or suggestions in using this interface.
@@ -107,7 +107,7 @@ This license of this software forbids you from sharing any content that violates
spread misinformation and target vulnerable groups. For the full list of restrictions please read the license.
By using this software, you consent to the terms and conditions of the license.
-`,Jw={title:zw,description:Bw,navbar:Hw,"land-cre":{cp:"Create Profile","cp-place":"Profile name",pp:"Profile Picture","pp-disc":"",ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cre:"Create"},"land-pre":{user:"Username",add:"Add Profile"},home:Qw,"in-paint":{txt:"In-Painting (select the area which the AI will paint into)",clear:"Clear"},settings:Vw,tags:Kw,"preview-prompt":{part1:'Type a prompt and press the "Make Image" button.',part2:`You can set an "Initial Image" if you want to guide the AI.
+`,gP={title:oP,description:sP,navbar:aP,"land-cre":{cp:"Create Profile","cp-place":"Profile name",pp:"Profile Picture","pp-disc":"",ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cre:"Create"},"land-pre":{user:"Username",add:"Add Profile"},home:lP,"in-paint":{txt:"In-Painting (select the area which the AI will paint into)",clear:"Clear"},settings:uP,tags:cP,"preview-prompt":{part1:'Type a prompt and press the "Make Image" button.',part2:`You can set an "Initial Image" if you want to guide the AI.
`,part3:`You can also add modifiers like "Realistic", "Pencil Sketch", "ArtStation" etc by browsing through the "Image Modifiers" section and selecting the desired modifiers.
-`,part4:'Click "Advanced Settings" for additional settings like seed, image size, number of images to generate etc.',part5:"Enjoy! :)"},"current-task":"Current task","recent-create":"Recently Created",popup:qw,history:Ww,"advanced-settings":{sound:"Play sound on task completion","sound-disc":"Will play a sound so user can hear when image is done.",turbo:"Turbo mode","turbo-disc":"Generates images faster, but uses an additional 1 GB of GPU memory",cpu:"Use CPU instead of GPU","cpu-disc":"Warning: this will be *very* slow",gpu:"Use full precision","gpu-disc":"(for GPU-only. warning: this will consume more VRAM)",beta:"Beta Features","beta-disc":`Get the latest features immediately (but could be less stable).
-Please restart the program after changing this.`,save:"SAVE"},storage:Gw,import:{"imp-btn":"IMPORT","exp-btn":"EXPORT",disc:"It is a good idea to leave the exported file as it is. Otherwise it may not import correctly","disc:2":"When importing, only profiles that are not already present on the will be added."},about:Yw},Xw={en:{translation:Uw},es:{translation:Jw}};Ce.use(E1).init({lng:"en",interpolation:{escapeValue:!1},resources:Xw}).then(()=>{console.log("i18n initialized")}).catch(e=>{console.error("i18n initialization failed",e)}).finally(()=>{console.log("i18n initialization finished")});const Zw=new My;function ex(){const e=JS;return x(jy,{location:Zw,routes:[{path:"/",element:x(GS,{className:e})},{path:"/settings",element:x(YS,{className:e})}]})}const tx=new iy({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1,staleTime:1/0,cacheTime:1/0}}});xy();oa.createRoot(document.getElementById("root")).render(x(rt.StrictMode,{children:I(ay,{client:tx,children:[x(ex,{}),x(hy,{initialIsOpen:!0})]})}));
+`,part4:'Click "Advanced Settings" for additional settings like seed, image size, number of images to generate etc.',part5:"Enjoy! :)"},"current-task":"Current task","recent-create":"Recently Created",popup:fP,history:dP,"advanced-settings":{sound:"Play sound on task completion","sound-disc":"Will play a sound so user can hear when image is done.",turbo:"Turbo mode","turbo-disc":"Generates images faster, but uses an additional 1 GB of GPU memory",cpu:"Use CPU instead of GPU","cpu-disc":"Warning: this will be *very* slow",gpu:"Use full precision","gpu-disc":"(for GPU-only. warning: this will consume more VRAM)",beta:"Beta Features","beta-disc":`Get the latest features immediately (but could be less stable).
+Please restart the program after changing this.`,save:"SAVE"},storage:pP,import:{"imp-btn":"IMPORT","exp-btn":"EXPORT",disc:"It is a good idea to leave the exported file as it is. Otherwise it may not import correctly","disc:2":"When importing, only profiles that are not already present on the will be added."},about:hP},mP={en:{translation:iP},es:{translation:gP}};Le.use(yS).init({lng:"en",interpolation:{escapeValue:!1},resources:mP}).then(()=>{console.log("i18n initialized")}).catch(e=>{console.error("i18n initialization failed",e)}).finally(()=>{console.log("i18n initialization finished")});const vP=new n0;function yP(){return w(r0,{location:vP,routes:[{path:"/",element:w(hx,{})},{path:"/settings",element:w(gx,{})}]})}const SP=new Oy({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1,staleTime:1/0,cacheTime:1/0}}});zy();fa.createRoot(document.getElementById("root")).render(w(G.StrictMode,{children:R(Cy,{client:SP,children:[w(yP,{}),w(Dy,{initialIsOpen:!0})]})}));