@wix/create-app 0.0.23 → 0.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/index.cjs CHANGED
@@ -12,9 +12,9 @@
12
12
  const major = versionParts[0];
13
13
  const minor = versionParts[1];
14
14
 
15
- if (major < 16 || (major === 16 && minor < 20)) {
15
+ if (major < 18 || (major === 18 && minor < 16)) {
16
16
  const currentVersion = colorize(RED, process.versions.node);
17
- const supportedVersion = colorize(GREEN, '16.20.0');
17
+ const supportedVersion = colorize(GREEN, '18.16.0');
18
18
 
19
19
  console.error(
20
20
  `⛔️ Node version ${currentVersion} detected, minimum supported version is ${supportedVersion}`
package/build/index.js CHANGED
@@ -215,7 +215,7 @@ Url: ${yx(t)}`),!0)}function Kbe(t,e){return t.type||!e||!e.length?!1:eDe(t).som
215
215
  `)}catch{}return vx.set(t,r),r}l();import{execFile as Ewe}from"child_process";import{readFile as xwe,readdir as Swe}from"fs";import*as wr from"os";import{join as bwe}from"path";import{promisify as c5}from"util";var Dwe=c5(xwe),wwe=c5(Swe),Tl=class t{static __initStatic(){this.id="Context"}__init(){this.name=t.id}constructor(e={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0}){this._options=e,t.prototype.__init.call(this)}setupOnce(e){e(r=>this.addContext(r))}async addContext(e){this._cachedContext===void 0&&(this._cachedContext=this._getContexts());let r=this._updateContext(await this._cachedContext);return e.contexts={...e.contexts,app:{...r.app,...Z([e,"access",n=>n.contexts,"optionalAccess",n=>n.app])},os:{...r.os,...Z([e,"access",n=>n.contexts,"optionalAccess",n=>n.os])},device:{...r.device,...Z([e,"access",n=>n.contexts,"optionalAccess",n=>n.device])},culture:{...r.culture,...Z([e,"access",n=>n.contexts,"optionalAccess",n=>n.culture])},cloud_resource:{...r.cloud_resource,...Z([e,"access",n=>n.contexts,"optionalAccess",n=>n.cloud_resource])}},e}_updateContext(e){return Z([e,"optionalAccess",r=>r.app,"optionalAccess",r=>r.app_memory])&&(e.app.app_memory=process.memoryUsage().rss),Z([e,"optionalAccess",r=>r.device,"optionalAccess",r=>r.free_memory])&&(e.device.free_memory=wr.freemem()),e}async _getContexts(){let e={};if(this._options.os&&(e.os=await Cwe()),this._options.app&&(e.app=Twe()),this._options.device&&(e.device=Owe(this._options.device)),this._options.culture){let r=Awe();r&&(e.culture=r)}return this._options.cloudResource&&(e.cloud_resource=Lwe()),e}};Tl.__initStatic();async function Cwe(){let t=wr.platform();switch(t){case"darwin":return Pwe();case"linux":return Nwe();default:return{name:Rwe[t]||t,version:wr.release()}}}function Awe(){try{if(typeof process.versions.icu!="string")return;let t=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(t)==="enero"){let r=Intl.DateTimeFormat().resolvedOptions();return{locale:r.locale,timezone:r.timeZone}}}catch{}}function Twe(){let t=process.memoryUsage().rss;return{app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:t}}function Owe(t){let e={},r;try{r=wr.uptime&&wr.uptime()}catch{}if(typeof r=="number"&&(e.boot_time=new Date(Date.now()-r*1e3).toISOString()),e.arch=wr.arch(),(t===!0||t.memory)&&(e.memory_size=wr.totalmem(),e.free_memory=wr.freemem()),t===!0||t.cpu){let n=wr.cpus();if(n&&n.length){let i=n[0];e.processor_count=n.length,e.cpu_description=i.model,e.processor_frequency=i.speed}}return e}var Rwe={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows"},Iwe=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],Fwe={alpine:t=>t,arch:t=>no(/distrib_release=(.*)/,t),centos:t=>no(/release ([^ ]+)/,t),debian:t=>t,fedora:t=>no(/release (..)/,t),mint:t=>no(/distrib_release=(.*)/,t),red:t=>no(/release ([^ ]+)/,t),suse:t=>no(/VERSION = (.*)\n/,t),ubuntu:t=>no(/distrib_release=(.*)/,t)};function no(t,e){let r=t.exec(e);return r?r[1]:void 0}async function Pwe(){let t={kernel_version:wr.release(),name:"Mac OS X",version:`10.${Number(wr.release().split(".")[0])-4}`};try{let e=await new Promise((r,n)=>{Ewe("/usr/bin/sw_vers",(i,s)=>{if(i){n(i);return}r(s)})});t.name=no(/^ProductName:\s+(.*)$/m,e),t.version=no(/^ProductVersion:\s+(.*)$/m,e),t.build=no(/^BuildVersion:\s+(.*)$/m,e)}catch{}return t}function u5(t){return t.split(" ")[0].toLowerCase()}async function Nwe(){let t={kernel_version:wr.release(),name:"Linux"};try{let e=await wwe("/etc"),r=Iwe.find(a=>e.includes(a.name));if(!r)return t;let n=bwe("/etc",r.name),i=(await Dwe(n,{encoding:"utf-8"})).toLowerCase(),{distros:s}=r;t.name=s.find(a=>i.indexOf(u5(a))>=0)||s[0];let o=u5(t.name);t.version=Fwe[o](i)}catch{}return t}function Lwe(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}l();l();import*as d5 from"url";l();function l5(t){let e={},r=0;for(;r<t.length;){let n=t.indexOf("=",r);if(n===-1)break;let i=t.indexOf(";",r);if(i===-1)i=t.length;else if(i<n){r=t.lastIndexOf(";",n-1)+1;continue}let s=t.slice(r,n).trim();if(e[s]===void 0){let o=t.slice(n+1,i).trim();o.charCodeAt(0)===34&&(o=o.slice(1,-1));try{e[s]=o.indexOf("%")!==-1?decodeURIComponent(o):o}catch{e[s]=o}}r=i+1}return e}var kwe={ip:!1,request:!0,transaction:!0,user:!0},Bwe=["cookies","data","headers","method","query_string","url"],Mwe=["id","username","email"];function f5(t,e={}){let r=t.method&&t.method.toUpperCase(),n="",i="url";e.customRoute||t.route?(n=e.customRoute||`${t.baseUrl||""}${t.route&&t.route.path}`,i="route"):(t.originalUrl||t.url)&&(n=Iu(t.originalUrl||t.url||""));let s="";return e.method&&r&&(s+=r),e.method&&e.path&&(s+=" "),e.path&&n&&(s+=n),[s,i]}function Uwe(t,e){switch(e){case"path":return f5(t,{path:!0})[0];case"handler":return t.route&&t.route.stack&&t.route.stack[0]&&t.route.stack[0].name||"<anonymous>";case"methodPath":default:{let r=t._reconstructedRoute?t._reconstructedRoute:void 0;return f5(t,{path:!0,method:!0,customRoute:r})[0]}}}function jwe(t,e){let r={};return(Array.isArray(e)?e:Mwe).forEach(i=>{t&&i in t&&(r[i]=t[i])}),r}function p5(t,e){let{include:r=Bwe}=e||{},n={},i=t.headers||{},s=t.method,o=t.hostname||t.host||i.host||"<no host>",a=t.protocol==="https"||t.socket&&t.socket.encrypted?"https":"http",c=t.originalUrl||t.url||"",p=c.startsWith(a)?c:`${a}://${o}${c}`;return r.forEach(d=>{switch(d){case"headers":{n.headers=i,r.includes("cookies")||delete n.headers.cookie;break}case"method":{n.method=s;break}case"url":{n.url=p;break}case"cookies":{n.cookies=t.cookies||i.cookie&&l5(i.cookie)||{};break}case"query_string":{n.query_string=qwe(t);break}case"data":{if(s==="GET"||s==="HEAD")break;t.body!==void 0&&(n.data=_s(t.body)?t.body:JSON.stringify(fi(t.body)));break}default:({}).hasOwnProperty.call(t,d)&&(n[d]=t[d])}}),n}function h5(t,e,r){let n={...kwe,...Z([r,"optionalAccess",i=>i.include])};if(n.request){let i=Array.isArray(n.request)?p5(e,{include:n.request}):p5(e);t.request={...t.request,...i}}if(n.user){let i=e.user&&li(e.user)?jwe(e.user,n.user):{};Object.keys(i).length&&(t.user={...t.user,...i})}if(n.ip){let i=e.ip||e.socket&&e.socket.remoteAddress;i&&(t.user={...t.user,ip_address:i})}return n.transaction&&!t.transaction&&(t.transaction=Uwe(e,n.transaction)),t}function qwe(t){let e=t.originalUrl||t.url||"";if(e)return e.startsWith("/")&&(e=`http://dogs.are.great${e}`),t.query||new d5.URL(e).search.replace("?","")||void 0}var cR={include:{cookies:!0,data:!0,headers:!0,ip:!1,query_string:!0,url:!0,user:{id:!0,username:!0,email:!0}},transactionNamingScheme:"methodPath"},Ol=class t{static __initStatic(){this.id="RequestData"}__init(){this.name=t.id}constructor(e={}){t.prototype.__init.call(this),this._addRequestData=h5,this._options={...cR,...e,include:{method:!0,...cR.include,...e.include,user:e.include&&typeof e.include.user=="boolean"?e.include.user:{...cR.include.user,...(e.include||{}).user}}}}setupOnce(e,r){let{transactionNamingScheme:n}=this._options;e(i=>{let s=r(),o=s.getIntegration(t),{sdkProcessingMetadata:a={}}=i,c=a.request;if(!o||!c)return i;let p=a.requestDataOptionsFromExpressHandler||a.requestDataOptionsFromGCPWrapper||Hwe(this._options),d=this._addRequestData(i,c,p);if(i.type==="transaction"||n==="handler")return d;let g=c._sentryTransaction;if(g){let E=$we(s)==="sentry.javascript.nextjs"?g.name.startsWith("/api"):n!=="path",[S]=wg(c,{path:!0,method:E,customRoute:g.name});d.transaction=S}return d})}};Ol.__initStatic();function Hwe(t){let{transactionNamingScheme:e,include:{ip:r,user:n,...i}}=t,s=[];for(let[a,c]of Object.entries(i))c&&s.push(a);let o;if(n===void 0)o=!0;else if(typeof n=="boolean")o=n;else{let a=[];for(let[c,p]of Object.entries(n))p&&a.push(c);o=a}return{include:{ip:r,user:o,request:s.length!==0?s:void 0,transaction:e}}}function $we(t){try{return t.getClient().getOptions()._metadata.sdk.name}catch{return}}l();function Gwe(t,e,r){let n=0,i=5,s=0;return setInterval(()=>{s===0?n>t&&(i*=2,r(i),i>86400&&(i=86400),s=i):(s-=1,s===0&&e()),n=0},1e3).unref(),()=>{n+=1}}function g5(t){let e=[],r=!1;function n(o){e=[],!r&&(r=!0,t(o))}e.push(n);function i(o){e.push(o)}function s(o){let a=e.pop()||n;try{a(o)}catch{n(o)}}return{add:i,next:s}}var lR=class{constructor(){let{Session:e}=N("inspector");this._session=new e}configureAndConnect(e,r){this._session.connect(),this._session.on("Debugger.paused",n=>{e(n,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:r?"all":"uncaught"})}setPauseOnExceptions(e){this._session.post("Debugger.setPauseOnExceptions",{state:e?"all":"uncaught"})}getLocalVariables(e,r){this._getProperties(e,n=>{let{add:i,next:s}=g5(r);for(let o of n)if(Z([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.objectId])&&Z([o,"optionalAccess",a=>a.value,"access",a=>a.className])==="Array"){let a=o.value.objectId;i(c=>this._unrollArray(a,o.name,c,s))}else if(Z([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.objectId])&&Z([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.className])==="Object"){let a=o.value.objectId;i(c=>this._unrollObject(a,o.name,c,s))}else(Z([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])||Z([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.description]))&&i(a=>this._unrollOther(o,a,s));s({})})}_getProperties(e,r){this._session.post("Runtime.getProperties",{objectId:e,ownProperties:!0},(n,i)=>{r(n?[]:i.result)})}_unrollArray(e,r,n,i){this._getProperties(e,s=>{n[r]=s.filter(o=>o.name!=="length"&&!isNaN(parseInt(o.name,10))).sort((o,a)=>parseInt(o.name,10)-parseInt(a.name,10)).map(o=>Z([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])),i(n)})}_unrollObject(e,r,n,i){this._getProperties(e,s=>{n[r]=s.map(o=>[o.name,Z([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])]).reduce((o,[a,c])=>(o[a]=c,o),{}),i(n)})}_unrollOther(e,r,n){Z([e,"optionalAccess",i=>i.value,"optionalAccess",i=>i.value])?r[e.name]=e.value.value:Z([e,"optionalAccess",i=>i.value,"optionalAccess",i=>i.description])&&Z([e,"optionalAccess",i=>i.value,"optionalAccess",i=>i.type])!=="function"&&(r[e.name]=`<${e.value.description}>`),n(r)}};function zwe(){try{return new lR}catch{return}}function m5(t){return t!==void 0&&["","?","<anonymous>"].includes(t)}function Vwe(t,e){return t===e||m5(t)&&m5(e)}function y5(t){if(t!==void 0)return t.slice(-10).reduce((e,r)=>`${e},${r.function},${r.lineno},${r.colno}`,"")}function Wwe(t,e){if(e!==void 0)return y5(t(e,1))}var Rl=class t{static __initStatic(){this.id="LocalVariables"}__init(){this.name=t.id}__init2(){this._cachedFrames=new di(20)}constructor(e={},r=zwe()){this._options=e,this._session=r,t.prototype.__init.call(this),t.prototype.__init2.call(this)}setupOnce(e,r){this._setup(e,Z([r,"call",n=>n(),"access",n=>n.getClient,"call",n=>n(),"optionalAccess",n=>n.getOptions,"call",n=>n()]))}_setup(e,r){if(this._session&&Z([r,"optionalAccess",n=>n.includeLocalVariables])){if((bs.major||0)<18){J.log("The `LocalVariables` integration is only supported on Node >= v18.");return}let i=this._options.captureAllExceptions!==!1;if(this._session.configureAndConnect((s,o)=>this._handlePaused(r.stackParser,s,o),i),i){let s=this._options.maxExceptionsPerSecond||50;this._rateLimiter=Gwe(s,()=>{J.log("Local variables rate-limit lifted."),Z([this,"access",o=>o._session,"optionalAccess",o=>o.setPauseOnExceptions,"call",o=>o(!0)])},o=>{J.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${o} seconds.`),Z([this,"access",a=>a._session,"optionalAccess",a=>a.setPauseOnExceptions,"call",a=>a(!1)])})}e(async s=>this._addLocalVariables(s))}}_handlePaused(e,{params:{reason:r,data:n,callFrames:i}},s){if(r!=="exception"&&r!=="promiseRejection"){s();return}Z([this,"access",p=>p._rateLimiter,"optionalCall",p=>p()]);let o=Wwe(e,Z([n,"optionalAccess",p=>p.description]));if(o==null){s();return}let{add:a,next:c}=g5(p=>{this._cachedFrames.set(o,p),s()});for(let p=0;p<Math.min(i.length,5);p++){let{scopeChain:d,functionName:m,this:g}=i[p],E=d.find(b=>b.type==="local"),S=g.className==="global"||!g.className?m:`${g.className}.${m}`;if(Z([E,"optionalAccess",b=>b.object,"access",b=>b.objectId])===void 0)a(b=>{b[p]={function:S},c(b)});else{let b=E.object.objectId;a(C=>Z([this,"access",A=>A._session,"optionalAccess",A=>A.getLocalVariables,"call",A=>A(b,I=>{C[p]={function:S,vars:I},c(C)})]))}}c([])}_addLocalVariables(e){for(let r of Z([e,"optionalAccess",n=>n.exception,"optionalAccess",n=>n.values])||[])this._addLocalVariablesToException(r);return e}_addLocalVariablesToException(e){let r=y5(Z([e,"optionalAccess",s=>s.stacktrace,"optionalAccess",s=>s.frames]));if(r===void 0)return;let n=this._cachedFrames.remove(r);if(n===void 0)return;let i=Z([e,"access",s=>s.stacktrace,"optionalAccess",s=>s.frames,"optionalAccess",s=>s.length])||0;for(let s=0;s<i;s++){let o=i-s-1;if(!Z([e,"optionalAccess",a=>a.stacktrace,"optionalAccess",a=>a.frames,"optionalAccess",a=>a[o]])||!n[s])break;n[s].vars===void 0||e.stacktrace.frames[o].in_app===!1||!Vwe(e.stacktrace.frames[o].function,n[s].function)||(e.stacktrace.frames[o].vars=n[s].vars)}}};Rl.__initStatic();l();var qg;(function(t){let e="undici:request:create";t.RequestCreate=e;let r="undici:request:headers";t.RequestEnd=r;let n="undici:request:error";t.RequestError=n})(qg||(qg={}));var Il=class t{static __initStatic(){this.id="Undici"}__init(){this.name=t.id}__init2(){this._createSpanUrlMap=new di(100)}__init3(){this._headersUrlMap=new di(100)}constructor(e={}){t.prototype.__init.call(this),t.prototype.__init2.call(this),t.prototype.__init3.call(this),t.prototype.__init4.call(this),t.prototype.__init5.call(this),t.prototype.__init6.call(this),this._options={breadcrumbs:e.breadcrumbs===void 0?!0:e.breadcrumbs,shouldCreateSpanForRequest:e.shouldCreateSpanForRequest}}setupOnce(e){if(bs.major&&bs.major<16)return;let r;try{r=Ru(module,"diagnostics_channel")}catch{}!r||!r.subscribe||(r.subscribe(qg.RequestCreate,this._onRequestCreate),r.subscribe(qg.RequestEnd,this._onRequestEnd),r.subscribe(qg.RequestError,this._onRequestError))}_shouldCreateSpan(e){if(this._options.shouldCreateSpanForRequest===void 0)return!0;let r=this._createSpanUrlMap.get(e);if(r!==void 0)return r;let n=this._options.shouldCreateSpanForRequest(e);return this._createSpanUrlMap.set(e,n),n}__init4(){this._onRequestCreate=e=>{let r=Je();if(!r.getIntegration(t))return;let{request:n}=e,i=n.origin?n.origin.toString()+n.path:n.path;if(El(i,r)||n.__sentry_span__!==void 0)return;let s=r.getClient();if(!s)return;let o=s.getOptions(),a=r.getScope(),c=a.getSpan(),p=this._shouldCreateSpan(i)?Ywe(c,n,i):void 0;if(p&&(n.__sentry_span__=p),(m=>{if(o.tracePropagationTargets===void 0)return!0;let g=this._headersUrlMap.get(m);if(g!==void 0)return g;let E=ro(m,o.tracePropagationTargets);return this._headersUrlMap.set(m,E),E})(i))if(p){let m=Z([p,"optionalAccess",E=>E.transaction,"optionalAccess",E=>E.getDynamicSamplingContext,"call",E=>E()]),g=Qp(m);_5(n,p.toTraceparent(),g)}else{let{traceId:m,sampled:g,dsc:E}=a.getPropagationContext(),S=_l(m,void 0,g),b=E||Ss(m,s,a),C=Qp(b);_5(n,S,C)}}}__init5(){this._onRequestEnd=e=>{let r=Je();if(!r.getIntegration(t))return;let{request:n,response:i}=e,s=n.origin?n.origin.toString()+n.path:n.path;if(El(s,r))return;let o=n.__sentry_span__;o&&(o.setHttpStatus(i.statusCode),o.finish()),this._options.breadcrumbs&&r.addBreadcrumb({category:"http",data:{method:n.method,status_code:i.statusCode,url:s},type:"http"},{event:"response",request:n,response:i})}}__init6(){this._onRequestError=e=>{let r=Je();if(!r.getIntegration(t))return;let{request:n}=e,i=n.origin?n.origin.toString()+n.path:n.path;if(El(i,r))return;let s=n.__sentry_span__;s&&(s.setStatus("internal_error"),s.finish()),this._options.breadcrumbs&&r.addBreadcrumb({category:"http",data:{method:n.method,url:i},level:"error",type:"http"},{event:"error",request:n})}}};Il.__initStatic();function _5(t,e,r){t.__sentry_has_headers__||(t.addHeader("sentry-trace",e),r&&t.addHeader("baggage",r),t.__sentry_has_headers__=!0)}function Ywe(t,e,r){let n=IO(r),i=e.method||"GET",s={"http.method":i};return n.search&&(s["http.query"]=n.search),n.hash&&(s["http.fragment"]=n.hash),Z([t,"optionalAccess",o=>o.startChild,"call",o=>o({op:"http.client",origin:"auto.http.node.undici",description:`${i} ${FO(n)}`,data:s})])}var fR=[new vl.InboundFilters,new vl.FunctionToString,new Sl,new ku,new Il,new bl,new Dl,new Al,new Rl,new Tl,new Cl,new Ol,new wl];var pR=xO(SO(e5));var dR={};Gf(dR,{Console:()=>Sl,Context:()=>Tl,ContextLines:()=>Al,Http:()=>ku,LinkedErrors:()=>wl,LocalVariables:()=>Rl,Modules:()=>Cl,OnUncaughtException:()=>bl,OnUnhandledRejection:()=>Dl,RequestData:()=>Ol,Undici:()=>Il});l();var hR={};Gf(hR,{Apollo:()=>ud,Express:()=>rd,GraphQL:()=>ad,Mongo:()=>sd,Mysql:()=>id,Postgres:()=>nd,Prisma:()=>od});l();var dht={...vl,...dR,...hR};var mR=F(ol(),1);var Jwe=t=>(e,{data:r}={})=>{let n=eg(e);if(!Qm(n))return;let i=(0,v5.isType)(n.code,Bp.UnknownFailure)?n.code.error:n;t.withScope(s=>{let o=dg(i);o&&(s.setTag("requestId",o.requestId),s.setContext("requestInfo",$E(o))),i instanceof Error&&s.setContext("error details",{info:mR.default.info(i),fullStack:mR.default.fullStack(i)}),t.captureException(i,{data:r})})};function E5({dsn:t,release:e}){let{sentryDsn:r}=Gt(),n=new Lg({enabled:r!==void 0||!0,dsn:r??t,release:e,integrations:fR.filter(s=>s.name!=="OnUnhandledRejection"&&s.name!=="OnUncaughtException"&&s.name!=="Modules"),stackParser:pR,transport:iR,beforeSend(s){return delete s.server_name,s},normalizeDepth:10}),i=new Nu(n);return{reportError:Jwe(i),setContext:(s,o)=>i.setContext(s,o),setUser:s=>i.setUser(s)}}function yR({debugOutputPath:t,...e}){let r=E5(e),n=function({error:s,data:o}){r.reportError(s,{data:o}),m1(x5.default.createElement(dl,{error:s}));try{O4(t,s)}catch{}gR.exitCode=1};return{handler:n,errorReporter:r,registerToProcessErrors:function(){gR.on("uncaughtException",s=>{n({error:s,data:{mechanism:{handled:!1,type:"uncaughtException"}}})}),gR.on("unhandledRejection",s=>{n({error:s,data:{mechanism:{handled:!1,type:"unhandledRejection"}}})})}}}l();var ld=F(K(),1),S5=(0,ld.createContext)(null),_R=t=>ld.default.createElement(S5.Provider,{...t}),Vo=()=>{let t=(0,ld.useContext)(S5);if(t===null)throw new Error("useErrorReporter() cannot be used without an <ErrorReporterProvider>");return t};l();l();var O5=F(A5(),1),Xwe=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed"]),vR=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},Zwe=(t,e,r)=>{let n=r.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=n,t},Qwe=t=>Xwe.has(t),T5=t=>globalThis.DOMException===void 0?new Error(t):new DOMException(t);async function Vn(t,e){return new Promise((r,n)=>{e={onFailedAttempt(){},retries:10,...e};let i=O5.default.operation(e);i.attempt(async s=>{try{r(await t(s))}catch(o){if(!(o instanceof Error)){n(new TypeError(`Non-error was thrown: "${o}". You should only throw errors.`));return}if(o instanceof vR)i.stop(),n(o.originalError);else if(o instanceof TypeError&&!Qwe(o.message))i.stop(),n(o);else{Zwe(o,s,e);try{await e.onFailedAttempt(o)}catch(a){n(a);return}i.retry(o)||n(i.mainError())}}}),e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",()=>{i.stop();let s=e.signal.reason===void 0?T5("The operation was aborted."):e.signal.reason;n(s instanceof Error?s:T5(s))},{once:!0})})}l();l();l();l();function R5(t){t===void 0&&(t="");var e=eCe(t),r=e[0],n=e[1];return n?{schemaName:n,schemaType:r}:{schemaName:r}}var eCe=function(t){return t.split("#")};l();l();function I5(t,e,r,n){for(var i=t,s=0,o=e.split(".");s<o.length;s++){var a=o[s];if(!i)return r;i=i[a]}return"".concat(i).concat(n)}var tCe="_",rCe=["wix.com","editorx.com"],nCe=["42.wixprod.net"],iCe=/{(.*)}/,sCe=new RegExp("\\.(".concat(rCe.join("|"),")$")),oCe=new RegExp("\\.(".concat(nCe.join("|"),")$"));function Wo(t){var e=cCe(t.host),r=fCe(e,t.domainToMappings),n=aCe(t.protoPath,t.data||{});return pCe(n,r)}function aCe(t,e){return t.split("/").map(function(r){return uCe(r,e)}).join("/")}function uCe(t,e){var r=t.match(iCe)||[],n=r[1];if(n){var i=t.replace(r[0],"");return I5(e,n,t,i)}return t}function cCe(t){var e=lCe(t);return e.replace(sCe,"._base_domain_").replace(oCe,"._api_base_domain_")}function lCe(t){return t.replace("create.editorx.com","editor.editorx.com")}function fCe(t,e){var r=e[t]||e[tCe];return!r&&dCe(t)?e[hCe]:r}function pCe(t,e){var r=e?.find(function(n){return t.startsWith(n.destPath)});return r?r.srcPath+t.slice(r.destPath.length):t}function dCe(t){return!!t.match(/\._base_domain_$/)}var hCe="www._base_domain_";l();function F5(t,e){e===void 0&&(e="");var r={};return Object.entries(t).forEach(function(n){var i=n[0],s=n[1],o=s!==null&&typeof s=="object"&&!Array.isArray(s),a=mCe(e,i);if(o){var c=F5(s,a);Object.assign(r,c)}else r[a]=s}),r}function mCe(t,e){return"".concat(t).concat(t?".":"").concat(e)}function lt(t){var e=F5(t);return Object.entries(e).reduce(function(r,n){var i=n[0],s=n[1],o=Array.isArray(s)?s:[s];return o.forEach(function(a){a!=null&&r.append(i,a)}),r},new URLSearchParams)}l();l();var _r;(function(t){t[t.TO_JSON=0]="TO_JSON",t[t.FROM_JSON=1]="FROM_JSON"})(_r||(_r={}));l();function P5(t,e,r){return e===void 0&&(e={}),function(i,s){return i===void 0&&(i={}),typeof i=="string"?i:o(t,i);function o(d,m){var g={};return[null,void 0].includes(m)?m:(Object.entries(m).forEach(function(E){var S,b,C,A=E[0],I=E[1],O=d[A],P=R5(O),k=P.schemaName,B=P.schemaType,G=B==="Map",ee=(C=(b=(S=c(k))===null||S===void 0?void 0:S.checkRepetable)===null||b===void 0?void 0:b.call(S,I))!==null&&C!==void 0?C:Array.isArray(I),V;ee?V=I.map(function(oe){return a(oe,k)}):G?V=p(I,k):V=a(I,k),g[A]=V}),g)}function a(d,m){if(!m)return d;var g=e[m],E=c(m);if(E)return c(m).transform(d);if(g)return o(g,d);throw new Error("".concat(m," is neither schema nor serializable type"))}function c(d){var m;return(m=r[d])===null||m===void 0?void 0:m[s]}function p(d,m){return Object.entries(d).reduce(function(g,E){var S=E[0],b=E[1];return g[S]=a(b,m),g},{})}}}l();l();var Ex,N5=(Ex={types:["google.protobuf.Timestamp"]},Ex[_r.TO_JSON]={transform:function(t){return t.toISOString()}},Ex[_r.FROM_JSON]={transform:function(t){return new Date(t)}},Ex);l();var xx,L5=(xx={types:["google.protobuf.FieldMask"]},xx[_r.TO_JSON]={transform:function(t){return t.join(",")},checkRepetable:function(t){return t.some(function(e){return Array.isArray(e)})}},xx[_r.FROM_JSON]={transform:function(t){return typeof t=="object"?t.paths:t.split(",")}},xx);l();var Sx,k5=(Sx={types:["google.protobuf.BytesValue","BYTES"]},Sx[_r.TO_JSON]={transform:function(t){var e=t.reduce(function(r,n){return r+String.fromCharCode(n)},"");return btoa(e)}},Sx[_r.FROM_JSON]={transform:function(t){return Uint8Array.from(atob(t),function(e){return e.charCodeAt(0)})}},Sx);l();var bx,B5=(bx={types:["google.protobuf.Duration"]},bx[_r.TO_JSON]={transform:function(t){var e=t.seconds,r=e===void 0?"0":e,n=t.nanos,i=n===void 0?0:n,s="";return i!==0&&(s=".".concat(i.toString().padStart(9,"0"))),"".concat(r).concat(s,"s")}},bx[_r.FROM_JSON]={transform:function(t){var e=t.substring(0,t.length-1).split("."),r=e[0],n=e[1];return{seconds:r,nanos:gCe(n)}}},bx);function gCe(t){var e=0;if(t!==void 0){var r=3-t.length/3;e=parseInt(t,10)*Math.pow(1e3,r)}return e}l();var Dx,M5=(Dx={types:["FLOAT","DOUBLE","google.protobuf.FloatValue","google.protobuf.DoubleValue"]},Dx[_r.TO_JSON]={transform:function(t){return isFinite(t)?t:t.toString()}},Dx[_r.FROM_JSON]={transform:function(t){return t==="NaN"?NaN:t==="Infinity"?1/0:t==="-Infinity"?-1/0:t}},Dx);var U5=[N5,L5,k5,B5,M5];l();var fd=function(){return fd=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},fd.apply(this,arguments)};function j5(t){return t.reduce(function(e,r){var n=r.types.reduce(function(i,s){var o;return fd(fd({},i),(o={},o[s]=r,o))},{});return fd(fd({},e),n)},{})}var yCe=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))},_Ce=j5(yCe([],U5,!0));function ae(t,e){e===void 0&&(e={});var r=P5(t,e,_Ce);return{fromJSON:function(n){var i=vCe(n)||n;return r(i,_r.FROM_JSON)},toJSON:function(n){return r(n,_r.TO_JSON)}}}function vCe(t){try{return JSON.parse(t)}catch{}}var ECe={},xCe={},SCe={},bCe={},DCe={},wCe={},CCe={},ACe={body:"BYTES"},q5={body:"BYTES"},TCe={},OCe={};function pd(t){var e={"manage._base_domain_":[{srcPath:"/oauth2",destPath:"/v1/oauth"}],"www.wixapis.com":[{srcPath:"/oauth2",destPath:"/v1/oauth"}],"users._base_domain_":[{srcPath:"/v1/oauth/device/verify",destPath:"/v1/oauth/device/verify"},{srcPath:"/v1/oauth/manage/user-code",destPath:"/v1/oauth/manage/user-code"}],_:[{srcPath:"/_api/oauth2",destPath:"/v1/oauth"}]};return Wo(Object.assign(t,{domainToMappings:e}))}function RCe(t){var e=ae(ECe,{}),r=e.toJSON,n=e.fromJSON,i=ae(q5,{}).fromJSON;function s(o){var a=o.host,c=r(t),p={entityFqdn:"wix.identity.oauth.v1.refresh_token",method:"GET",methodFqn:"wix.identity.oauth2.v1.Oauth2Ng.Authorize",url:pd({protoPath:"/v1/oauth/authorize",data:c,host:a}),params:lt(c),transformResponse:i};return p}return s.fromReq=n,s}RCe.__isAmbassador=!0;function wx(t){var e=ae(ACe,{}),r=e.toJSON,n=e.fromJSON,i=ae(q5,{}).fromJSON;function s(o){var a=o.host,c=r(t),p={entityFqdn:"wix.identity.oauth.v1.refresh_token",method:"POST",methodFqn:"wix.identity.oauth2.v1.Oauth2Ng.Token",url:pd({protoPath:"/v1/oauth/token",data:c,host:a}),data:c,transformResponse:i};return p}return s.fromReq=n,s}wx.__isAmbassador=!0;function ER(t){var e=ae(xCe,{}),r=e.toJSON,n=e.fromJSON,i=ae(SCe,{}).fromJSON;function s(o){var a=o.host,c=r(t),p={entityFqdn:"wix.identity.oauth.v1.refresh_token",method:"GET",methodFqn:"wix.identity.oauth2.v1.Oauth2Ng.DeviceCode",url:pd({protoPath:"/v1/oauth/device/code",data:c,host:a}),params:lt(c),transformResponse:i};return p}return s.fromReq=n,s}ER.__isAmbassador=!0;function ICe(t){var e=ae(bCe,{}),r=e.toJSON,n=e.fromJSON,i=ae(DCe,{}).fromJSON;function s(o){var a=o.host,c=r(t),p={entityFqdn:"wix.identity.oauth.v1.refresh_token",method:"GET",methodFqn:"wix.identity.oauth2.v1.Oauth2Ng.DeviceVerify",url:pd({protoPath:"/v1/oauth/device/verify",data:c,host:a}),params:lt(c),transformResponse:i};return p}return s.fromReq=n,s}ICe.__isAmbassador=!0;function FCe(t){var e=ae(wCe,{}),r=e.toJSON,n=e.fromJSON,i=ae(CCe,{}).fromJSON;function s(o){var a=o.host,c=r(t),p={entityFqdn:"wix.identity.oauth.v1.refresh_token",method:"DELETE",methodFqn:"wix.identity.oauth2.v1.Oauth2Ng.InvalidateUserCode",url:pd({protoPath:"/v1/oauth/manage/user-code",data:c,host:a}),params:lt(c),transformResponse:i};return p}return s.fromReq=n,s}FCe.__isAmbassador=!0;function xR(t){var e=ae(TCe,{}),r=e.toJSON,n=e.fromJSON,i=ae(OCe,{}).fromJSON;function s(o){var a=o.host,c=r(t),p={entityFqdn:"wix.identity.oauth.v1.refresh_token",method:"POST",methodFqn:"wix.identity.oauth2.v1.Oauth2Ng.RevokeRefreshToken",url:pd({protoPath:"/v1/oauth/revoke",data:c,host:a}),data:c,transformResponse:i};return p}return s.fromReq=n,s}xR.__isAmbassador=!0;var Cx=F(Le(),1);l();var H5=ce.object({deviceCode:ce.string(),verificationUri:ce.string().url(),userCode:ce.string(),expiresIn:ce.number()}),SR=ce.object({access_token:ce.string(),refresh_token:ce.string(),expires_in:ce.number()}).transform(t=>({accessToken:t.access_token,refreshToken:t.refresh_token,expiresIn:t.expires_in})),bR=ce.object({userId:ce.string().uuid(),email:ce.string().email()}),$5=ce.object({accessToken:ce.string(),refreshToken:ce.string(),expiresIn:ce.number(),issuedAt:ce.number()}),G5=$5.extend({userInfo:bR});var{FailedToGetAuthToken:PCe,FailedToGetDeviceCode:NCe,FailedToRenewAuthToken:LCe,FailedToRevokeRefreshToken:kCe}=Ae,DR="6f95cec8-3e98-48b9-b4e5-1fb92fcd9973",z5=()=>Math.floor(Date.now()/1e3),Hg=class extends Error{},V5=(0,Cx.variant)({Success:(0,Cx.fields)(),RefreshTokenIsRevoked:{}}),wR=class{constructor(e){this.httpClient=e;let{minRetryTimeout:r}=Gt();this.retryOptions={retries:3,minTimeout:r,maxTimeout:3*1e3}}retryOptions;async requestDeviceCode(e={}){try{let{data:r}=await Vn(()=>this.httpClient.request(ER({...e,clientId:DR})),this.retryOptions);return H5.parse(r)}catch(r){throw new be({code:NCe(),cause:r})}}async createToken(e){try{let r={clientId:DR,grantType:"urn:ietf:params:oauth:grant-type:device_code",scope:["offline_access"],...e},{data:n}=await Vn(()=>this.httpClient.request(wx(r)),this.retryOptions);return{...SR.parse(n),issuedAt:z5()}}catch(r){throw sO(r)&&(r.response?.data?.message==="Device code is not yet verified"||r.response?.data?.error==="authorization_pending")?new Hg("Device code is not yet verified."):new be({code:PCe(),cause:r})}}async renewToken(e){try{let r={clientId:DR,grantType:"refresh_token",...e},{data:n}=await this.httpClient.request(wx(r)),i=SR.parse(n);return V5.Success({...i,issuedAt:z5()})}catch(r){if(sO(r)&&r.response?.status===400&&r.response?.data?.error==="invalid_grant")return V5.RefreshTokenIsRevoked();throw new be({code:LCe(),cause:r})}}async revokeRefreshToken(e,{email:r}){try{let{data:n}=await this.httpClient.request(xR(e));return n}catch(n){throw new be({code:kCe({email:r}),info:{email:r},cause:n})}}async userInfo({accessToken:e}){try{let r=pg({type:"backoffice",getAppToken:()=>e}),{data:n}=await r.get("/_serverless/wix-cli-userinfo/userinfo");return bR.parse(n)}catch(r){throw new be({code:Ae.FailedToGetUserInfo(),cause:r})}}},dd=new wR(pg({type:"backoffice"}));l();import{unlink as E1e,rm as x1e}from"node:fs/promises";import{resolve as NS}from"node:path";l();import{resolve as BCe}from"node:path";import{homedir as MCe}from"node:os";function $g(){return Gt().dataDir??BCe(MCe(),".wix")}var fo=F(Le(),1);l();var v1e=F(W7(),1),X7=F(ol(),1);import{access as g1e,readFile as y1e,writeFile as Y7,mkdir as J7,stat as Zyt}from"node:fs/promises";import{dirname as K7,join as e_t}from"node:path";import{EOL as _1e}from"node:os";async function ly(t,e,r){let n=JSON.stringify(e,null,r?.spaces).concat(_1e);await J7(K7(t),{recursive:!0}),await Y7(t,n,"utf-8")}async function Xu(t){let e=await y1e(t,"utf-8");try{return JSON.parse(e)}catch(r){throw new X7.default({name:"InvalidJsonFile",cause:r instanceof Error?r:new Error(JSON.stringify(r))},`Invalid json file ${t}.`)}}function Cs(t){return g1e(t).then(()=>!0).catch(()=>!1)}async function Z7(t,e){await J7(K7(t),{recursive:!0}),await Y7(t,e,"utf-8")}function Q7(){return NS($g(),"auth.json")}function hF(){return NS($g(),"auth")}function eW(){return NS(hF(),"account.json")}function S1e(t){return NS(hF(),`${t}.json`)}var dF=(0,fo.variant)({Authenticated:(0,fo.fields)(),Unauthenticated:{},Expired:(0,fo.fields)()});async function mF(){let t=eW();if(!await Cs(t))return dF.Unauthenticated();let e=await Xu(t),r=G5.parse(e);return b1e(r)?dF.Authenticated(r):dF.Expired(r)}var l_t=(0,fo.variant)({Authenticated:(0,fo.fields)(),Unauthenticated:{},Expired:(0,fo.fields)()});async function gF(t,e){try{let r=e?S1e(e):eW();await ly(r,t)}catch(r){throw new be({code:Ae.FailedToSaveAuthData({cause:r})})}}async function tW(){try{await x1e(hF(),{recursive:!0,force:!0})}catch(t){throw new be({code:Ae.FailedToDeleteAuthData({cause:t})})}}async function rW(){try{await E1e(Q7())}catch(t){throw new be({code:Ae.FailedToDeleteLegacyAuthData({cause:t})})}}async function LS(){return Cs(Q7())}function b1e(t){let e=Math.floor(Date.now()/1e3),r=t.expiresIn;return t.issuedAt+r>e}async function yF(){let t=await mF();return(0,fo.match)(t,{Authenticated:({userInfo:e})=>e,Expired:({userInfo:e})=>e,Unauthenticated:()=>null})}var nW=t=>1e3*t;async function D1e({deviceCode:t,expiresIn:e},{signal:r}){try{let n=await al(async()=>{try{let o=await dd.createToken({deviceCode:t});return al.resolveWith(o)}catch(o){if(o instanceof Hg)return!1;throw o}},{interval:Gt().waitForLoginInterval??nW(3),timeout:{milliseconds:nW(e),signal:r}}),i=await dd.userInfo({accessToken:n.accessToken}),s={...n,userInfo:i};return await tW(),await LS()&&await rW(),await gF(s),s}catch(n){throw n instanceof Du?new be({code:Ae.DeviceCodeTimedOut()}):n}}async function w1e(){let t=await mF();return(0,kS.match)(t,{Unauthenticated:()=>null,Authenticated:e=>e,Expired:async({refreshToken:e,userInfo:r})=>{let n=await dd.renewToken({refreshToken:e});return(0,kS.match)(n,{Success:async i=>{let s={userInfo:r,...i};return await gF(s),s},RefreshTokenIsRevoked:()=>null})}})}var BS={isLoggedIn(){return w1e()},login({deviceCode:t,signal:e}){return D1e(t,{signal:e})}};l();var sW=F(K(),1);l();var iW=F(K(),1),MS=(0,iW.createContext)(null);function _F(){let t=(0,sW.useContext)(MS);if(!t)throw new Error("useAuth() cannot be used without an <AuthProvider>");return t}l();var sP=F(K(),1);l();l();l();l();function oW(t,e,r){function n(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function i(){return!t||typeof t=="string"}for(var s=typeof e!="string"?[].concat(e):e.split(".");s.length>1;){if(i())return{};var o=n(s.shift());!t[o]&&r&&(t[o]=new r),t=t[o]}return i()?{}:{obj:t,k:n(s.shift())}}function aW(t,e,r){var n=oW(t,e,Object),i=n.obj,s=n.k;i[s]=r}function uW(t,e){var r=oW(t,e),n=r.obj,i=r.k;if(n)return n[i]}var cW=[],C1e=cW.forEach,A1e=cW.slice;function lW(t){return C1e.call(A1e.call(arguments,1),function(e){if(e)for(var r in e)t[r]===void 0&&(t[r]=e[r])}),t}l();l();ai();l();ai();l();var Xe;(function(t){t[t.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",t[t.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",t[t.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",t[t.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",t[t.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",t[t.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",t[t.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",t[t.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",t[t.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",t[t.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",t[t.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",t[t.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",t[t.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",t[t.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",t[t.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",t[t.INVALID_TAG=23]="INVALID_TAG",t[t.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",t[t.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",t[t.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(Xe||(Xe={}));l();ai();l();var Nt;(function(t){t[t.literal=0]="literal",t[t.argument=1]="argument",t[t.number=2]="number",t[t.date=3]="date",t[t.time=4]="time",t[t.select=5]="select",t[t.plural=6]="plural",t[t.pound=7]="pound",t[t.tag=8]="tag"})(Nt||(Nt={}));var zl;(function(t){t[t.number=0]="number",t[t.dateTime=1]="dateTime"})(zl||(zl={}));function vF(t){return t.type===Nt.literal}function fW(t){return t.type===Nt.argument}function US(t){return t.type===Nt.number}function jS(t){return t.type===Nt.date}function qS(t){return t.type===Nt.time}function HS(t){return t.type===Nt.select}function $S(t){return t.type===Nt.plural}function pW(t){return t.type===Nt.pound}function GS(t){return t.type===Nt.tag}function zS(t){return!!(t&&typeof t=="object"&&t.type===zl.number)}function fy(t){return!!(t&&typeof t=="object"&&t.type===zl.dateTime)}l();var EF=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;l();l();var O1e=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function dW(t){var e={};return t.replace(O1e,function(r){var n=r.length;switch(r[0]){case"G":e.era=n===4?"long":n===5?"narrow":"short";break;case"y":e.year=n===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":e.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":e.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":e.weekday=n===4?"short":n===5?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][n-4];break;case"a":e.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":e.hourCycle="h12",e.hour=["numeric","2-digit"][n-1];break;case"H":e.hourCycle="h23",e.hour=["numeric","2-digit"][n-1];break;case"K":e.hourCycle="h11",e.hour=["numeric","2-digit"][n-1];break;case"k":e.hourCycle="h24",e.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":e.minute=["numeric","2-digit"][n-1];break;case"s":e.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":e.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),e}l();ai();l();var hW=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function _W(t){if(t.length===0)throw new Error("Number skeleton cannot be empty");for(var e=t.split(hW).filter(function(g){return g.length>0}),r=[],n=0,i=e;n<i.length;n++){var s=i[n],o=s.split("/");if(o.length===0)throw new Error("Invalid number skeleton");for(var a=o[0],c=o.slice(1),p=0,d=c;p<d.length;p++){var m=d[p];if(m.length===0)throw new Error("Invalid number skeleton")}r.push({stem:a,options:c})}return r}function R1e(t){return t.replace(/^(.*?)-/,"")}var mW=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,vW=/^(@+)?(\+|#+)?[rs]?$/g,I1e=/(\*)(0+)|(#+)(0+)|(0+)/g,EW=/^(0+)$/;function gW(t){var e={};return t[t.length-1]==="r"?e.roundingPriority="morePrecision":t[t.length-1]==="s"&&(e.roundingPriority="lessPrecision"),t.replace(vW,function(r,n,i){return typeof i!="string"?(e.minimumSignificantDigits=n.length,e.maximumSignificantDigits=n.length):i==="+"?e.minimumSignificantDigits=n.length:n[0]==="#"?e.maximumSignificantDigits=n.length:(e.minimumSignificantDigits=n.length,e.maximumSignificantDigits=n.length+(typeof i=="string"?i.length:0)),""}),e}function xW(t){switch(t){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function F1e(t){var e;if(t[0]==="E"&&t[1]==="E"?(e={notation:"engineering"},t=t.slice(2)):t[0]==="E"&&(e={notation:"scientific"},t=t.slice(1)),e){var r=t.slice(0,2);if(r==="+!"?(e.signDisplay="always",t=t.slice(2)):r==="+?"&&(e.signDisplay="exceptZero",t=t.slice(2)),!EW.test(t))throw new Error("Malformed concise eng/scientific notation");e.minimumIntegerDigits=t.length}return e}function yW(t){var e={},r=xW(t);return r||e}function SW(t){for(var e={},r=0,n=t;r<n.length;r++){var i=n[r];switch(i.stem){case"percent":case"%":e.style="percent";continue;case"%x100":e.style="percent",e.scale=100;continue;case"currency":e.style="currency",e.currency=i.options[0];continue;case"group-off":case",_":e.useGrouping=!1;continue;case"precision-integer":case".":e.maximumFractionDigits=0;continue;case"measure-unit":case"unit":e.style="unit",e.unit=R1e(i.options[0]);continue;case"compact-short":case"K":e.notation="compact",e.compactDisplay="short";continue;case"compact-long":case"KK":e.notation="compact",e.compactDisplay="long";continue;case"scientific":e=Fe(Fe(Fe({},e),{notation:"scientific"}),i.options.reduce(function(c,p){return Fe(Fe({},c),yW(p))},{}));continue;case"engineering":e=Fe(Fe(Fe({},e),{notation:"engineering"}),i.options.reduce(function(c,p){return Fe(Fe({},c),yW(p))},{}));continue;case"notation-simple":e.notation="standard";continue;case"unit-width-narrow":e.currencyDisplay="narrowSymbol",e.unitDisplay="narrow";continue;case"unit-width-short":e.currencyDisplay="code",e.unitDisplay="short";continue;case"unit-width-full-name":e.currencyDisplay="name",e.unitDisplay="long";continue;case"unit-width-iso-code":e.currencyDisplay="symbol";continue;case"scale":e.scale=parseFloat(i.options[0]);continue;case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(I1e,function(c,p,d,m,g,E){if(p)e.minimumIntegerDigits=d.length;else{if(m&&g)throw new Error("We currently do not support maximum integer digits");if(E)throw new Error("We currently do not support exact integer digits")}return""});continue}if(EW.test(i.stem)){e.minimumIntegerDigits=i.stem.length;continue}if(mW.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(mW,function(c,p,d,m,g,E){return d==="*"?e.minimumFractionDigits=p.length:m&&m[0]==="#"?e.maximumFractionDigits=m.length:g&&E?(e.minimumFractionDigits=g.length,e.maximumFractionDigits=g.length+E.length):(e.minimumFractionDigits=p.length,e.maximumFractionDigits=p.length),""});var s=i.options[0];s==="w"?e=Fe(Fe({},e),{trailingZeroDisplay:"stripIfInteger"}):s&&(e=Fe(Fe({},e),gW(s)));continue}if(vW.test(i.stem)){e=Fe(Fe({},e),gW(i.stem));continue}var o=xW(i.stem);o&&(e=Fe(Fe({},e),o));var a=F1e(i.stem);a&&(e=Fe(Fe({},e),a))}return e}l();l();var py={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function bW(t,e){for(var r="",n=0;n<t.length;n++){var i=t.charAt(n);if(i==="j"){for(var s=0;n+1<t.length&&t.charAt(n+1)===i;)s++,n++;var o=1+(s&1),a=s<2?1:3+(s>>1),c="a",p=P1e(e);for((p=="H"||p=="k")&&(a=0);a-- >0;)r+=c;for(;o-- >0;)r=p+r}else i==="J"?r+="H":r+=i}return r}function P1e(t){var e=t.hourCycle;if(e===void 0&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r=t.language,n;r!=="root"&&(n=t.maximize().region);var i=py[n||""]||py[r||""]||py["".concat(r,"-001")]||py["001"];return i[0]}var xF,N1e=new RegExp("^".concat(EF.source,"*")),L1e=new RegExp("".concat(EF.source,"*$"));function rt(t,e){return{start:t,end:e}}var k1e=!!String.prototype.startsWith&&"_a".startsWith("a",1),B1e=!!String.fromCodePoint,M1e=!!Object.fromEntries,U1e=!!String.prototype.codePointAt,j1e=!!String.prototype.trimStart,q1e=!!String.prototype.trimEnd,H1e=!!Number.isSafeInteger,$1e=H1e?Number.isSafeInteger:function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},bF=!0;try{DW=TW("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),bF=((xF=DW.exec("a"))===null||xF===void 0?void 0:xF[0])==="a"}catch{bF=!1}var DW,wW=k1e?function(e,r,n){return e.startsWith(r,n)}:function(e,r,n){return e.slice(n,n+r.length)===r},DF=B1e?String.fromCodePoint:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];for(var n="",i=e.length,s=0,o;i>s;){if(o=e[s++],o>1114111)throw RangeError(o+" is not a valid code point");n+=o<65536?String.fromCharCode(o):String.fromCharCode(((o-=65536)>>10)+55296,o%1024+56320)}return n},CW=M1e?Object.fromEntries:function(e){for(var r={},n=0,i=e;n<i.length;n++){var s=i[n],o=s[0],a=s[1];r[o]=a}return r},AW=U1e?function(e,r){return e.codePointAt(r)}:function(e,r){var n=e.length;if(!(r<0||r>=n)){var i=e.charCodeAt(r),s;return i<55296||i>56319||r+1===n||(s=e.charCodeAt(r+1))<56320||s>57343?i:(i-55296<<10)+(s-56320)+65536}},G1e=j1e?function(e){return e.trimStart()}:function(e){return e.replace(N1e,"")},z1e=q1e?function(e){return e.trimEnd()}:function(e){return e.replace(L1e,"")};function TW(t,e){return new RegExp(t,e)}var wF;bF?(SF=TW("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),wF=function(e,r){var n;SF.lastIndex=r;var i=SF.exec(e);return(n=i[1])!==null&&n!==void 0?n:""}):wF=function(e,r){for(var n=[];;){var i=AW(e,r);if(i===void 0||RW(i)||Y1e(i))break;n.push(i),r+=i>=65536?2:1}return DF.apply(void 0,n)};var SF,OW=function(){function t(e,r){r===void 0&&(r={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.locale=r.locale,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}return t.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(e,r,n){for(var i=[];!this.isEOF();){var s=this.char();if(s===123){var o=this.parseArgument(e,n);if(o.err)return o;i.push(o.val)}else{if(s===125&&e>0)break;if(s===35&&(r==="plural"||r==="selectordinal")){var a=this.clonePosition();this.bump(),i.push({type:Nt.pound,location:rt(a,this.clonePosition())})}else if(s===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(Xe.UNMATCHED_CLOSING_TAG,rt(this.clonePosition(),this.clonePosition()))}else if(s===60&&!this.ignoreTag&&CF(this.peek()||0)){var o=this.parseTag(e,r);if(o.err)return o;i.push(o.val)}else{var o=this.parseLiteral(e,r);if(o.err)return o;i.push(o.val)}}}return{val:i,err:null}},t.prototype.parseTag=function(e,r){var n=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:Nt.literal,value:"<".concat(i,"/>"),location:rt(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var s=this.parseMessage(e+1,r,!0);if(s.err)return s;var o=s.val,a=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!CF(this.char()))return this.error(Xe.INVALID_TAG,rt(a,this.clonePosition()));var c=this.clonePosition(),p=this.parseTagName();return i!==p?this.error(Xe.UNMATCHED_CLOSING_TAG,rt(c,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:Nt.tag,value:i,children:o,location:rt(n,this.clonePosition())},err:null}:this.error(Xe.INVALID_TAG,rt(a,this.clonePosition())))}else return this.error(Xe.UNCLOSED_TAG,rt(n,this.clonePosition()))}else return this.error(Xe.INVALID_TAG,rt(n,this.clonePosition()))},t.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&W1e(this.char());)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(e,r){for(var n=this.clonePosition(),i="";;){var s=this.tryParseQuote(r);if(s){i+=s;continue}var o=this.tryParseUnquoted(e,r);if(o){i+=o;continue}var a=this.tryParseLeftAngleBracket();if(a){i+=a;continue}break}var c=rt(n,this.clonePosition());return{val:{type:Nt.literal,value:i,location:c},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!V1e(this.peek()||0))?(this.bump(),"<"):null},t.prototype.tryParseQuote=function(e){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(e==="plural"||e==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return DF.apply(void 0,r)},t.prototype.tryParseUnquoted=function(e,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&e>0?null:(this.bump(),DF(n))},t.prototype.parseArgument=function(e,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(Xe.EXPECT_ARGUMENT_CLOSING_BRACE,rt(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(Xe.EMPTY_ARGUMENT,rt(n,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(Xe.MALFORMED_ARGUMENT,rt(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(Xe.EXPECT_ARGUMENT_CLOSING_BRACE,rt(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:Nt.argument,value:i,location:rt(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(Xe.EXPECT_ARGUMENT_CLOSING_BRACE,rt(n,this.clonePosition())):this.parseArgumentOptions(e,r,i,n);default:return this.error(Xe.MALFORMED_ARGUMENT,rt(n,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),r=this.offset(),n=wF(this.message,r),i=r+n.length;this.bumpTo(i);var s=this.clonePosition(),o=rt(e,s);return{value:n,location:o}},t.prototype.parseArgumentOptions=function(e,r,n,i){var s,o=this.clonePosition(),a=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(a){case"":return this.error(Xe.EXPECT_ARGUMENT_TYPE,rt(o,c));case"number":case"date":case"time":{this.bumpSpace();var p=null;if(this.bumpIf(",")){this.bumpSpace();var d=this.clonePosition(),m=this.parseSimpleArgStyleIfPossible();if(m.err)return m;var g=z1e(m.val);if(g.length===0)return this.error(Xe.EXPECT_ARGUMENT_STYLE,rt(this.clonePosition(),this.clonePosition()));var E=rt(d,this.clonePosition());p={style:g,styleLocation:E}}var S=this.tryParseArgumentClose(i);if(S.err)return S;var b=rt(i,this.clonePosition());if(p&&wW(p?.style,"::",0)){var C=G1e(p.style.slice(2));if(a==="number"){var m=this.parseNumberSkeletonFromString(C,p.styleLocation);return m.err?m:{val:{type:Nt.number,value:n,location:b,style:m.val},err:null}}else{if(C.length===0)return this.error(Xe.EXPECT_DATE_TIME_SKELETON,b);var A=C;this.locale&&(A=bW(C,this.locale));var g={type:zl.dateTime,pattern:A,location:p.styleLocation,parsedOptions:this.shouldParseSkeletons?dW(A):{}},I=a==="date"?Nt.date:Nt.time;return{val:{type:I,value:n,location:b,style:g},err:null}}}return{val:{type:a==="number"?Nt.number:a==="date"?Nt.date:Nt.time,value:n,location:b,style:(s=p?.style)!==null&&s!==void 0?s:null},err:null}}case"plural":case"selectordinal":case"select":{var O=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(Xe.EXPECT_SELECT_ARGUMENT_OPTIONS,rt(O,Fe({},O)));this.bumpSpace();var P=this.parseIdentifierIfPossible(),k=0;if(a!=="select"&&P.value==="offset"){if(!this.bumpIf(":"))return this.error(Xe.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,rt(this.clonePosition(),this.clonePosition()));this.bumpSpace();var m=this.tryParseDecimalInteger(Xe.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Xe.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(m.err)return m;this.bumpSpace(),P=this.parseIdentifierIfPossible(),k=m.val}var B=this.tryParsePluralOrSelectOptions(e,a,r,P);if(B.err)return B;var S=this.tryParseArgumentClose(i);if(S.err)return S;var G=rt(i,this.clonePosition());return a==="select"?{val:{type:Nt.select,value:n,options:CW(B.val),location:G},err:null}:{val:{type:Nt.plural,value:n,options:CW(B.val),offset:k,pluralType:a==="plural"?"cardinal":"ordinal",location:G},err:null}}default:return this.error(Xe.INVALID_ARGUMENT_TYPE,rt(o,c))}},t.prototype.tryParseArgumentClose=function(e){return this.isEOF()||this.char()!==125?this.error(Xe.EXPECT_ARGUMENT_CLOSING_BRACE,rt(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(Xe.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,rt(i,this.clonePosition()));this.bump();break}case 123:{e+=1,this.bump();break}case 125:{if(e>0)e-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(e,r){var n=[];try{n=_W(e)}catch{return this.error(Xe.INVALID_NUMBER_SKELETON,r)}return{val:{type:zl.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?SW(n):{}},err:null}},t.prototype.tryParsePluralOrSelectOptions=function(e,r,n,i){for(var s,o=!1,a=[],c=new Set,p=i.value,d=i.location;;){if(p.length===0){var m=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var g=this.tryParseDecimalInteger(Xe.EXPECT_PLURAL_ARGUMENT_SELECTOR,Xe.INVALID_PLURAL_ARGUMENT_SELECTOR);if(g.err)return g;d=rt(m,this.clonePosition()),p=this.message.slice(m.offset,this.offset())}else break}if(c.has(p))return this.error(r==="select"?Xe.DUPLICATE_SELECT_ARGUMENT_SELECTOR:Xe.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,d);p==="other"&&(o=!0),this.bumpSpace();var E=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?Xe.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:Xe.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,rt(this.clonePosition(),this.clonePosition()));var S=this.parseMessage(e+1,r,n);if(S.err)return S;var b=this.tryParseArgumentClose(E);if(b.err)return b;a.push([p,{value:S.val,location:rt(E,this.clonePosition())}]),c.add(p),this.bumpSpace(),s=this.parseIdentifierIfPossible(),p=s.value,d=s.location}return a.length===0?this.error(r==="select"?Xe.EXPECT_SELECT_ARGUMENT_SELECTOR:Xe.EXPECT_PLURAL_ARGUMENT_SELECTOR,rt(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(Xe.MISSING_OTHER_CLAUSE,rt(this.clonePosition(),this.clonePosition())):{val:a,err:null}},t.prototype.tryParseDecimalInteger=function(e,r){var n=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var s=!1,o=0;!this.isEOF();){var a=this.char();if(a>=48&&a<=57)s=!0,o=o*10+(a-48),this.bump();else break}var c=rt(i,this.clonePosition());return s?(o*=n,$1e(o)?{val:o,err:null}:this.error(r,c)):this.error(e,c)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var r=AW(this.message,e);if(r===void 0)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return r},t.prototype.error=function(e,r){return{val:null,err:{kind:e,message:this.message,location:r}}},t.prototype.bump=function(){if(!this.isEOF()){var e=this.char();e===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},t.prototype.bumpIf=function(e){if(wW(this.message,e,this.offset())){for(var r=0;r<e.length;r++)this.bump();return!0}return!1},t.prototype.bumpUntil=function(e){var r=this.offset(),n=this.message.indexOf(e,r);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var r=this.offset();if(r===e)break;if(r>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&&RW(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(e>=65536?2:1));return n??null},t}();function CF(t){return t>=97&&t<=122||t>=65&&t<=90}function V1e(t){return CF(t)||t===47}function W1e(t){return t===45||t===46||t>=48&&t<=57||t===95||t>=97&&t<=122||t>=65&&t<=90||t==183||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}function RW(t){return t>=9&&t<=13||t===32||t===133||t>=8206&&t<=8207||t===8232||t===8233}function Y1e(t){return t>=33&&t<=35||t===36||t>=37&&t<=39||t===40||t===41||t===42||t===43||t===44||t===45||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||t===91||t===92||t===93||t===94||t===96||t===123||t===124||t===125||t===126||t===161||t>=162&&t<=165||t===166||t===167||t===169||t===171||t===172||t===174||t===176||t===177||t===182||t===187||t===191||t===215||t===247||t>=8208&&t<=8213||t>=8214&&t<=8215||t===8216||t===8217||t===8218||t>=8219&&t<=8220||t===8221||t===8222||t===8223||t>=8224&&t<=8231||t>=8240&&t<=8248||t===8249||t===8250||t>=8251&&t<=8254||t>=8257&&t<=8259||t===8260||t===8261||t===8262||t>=8263&&t<=8273||t===8274||t===8275||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||t===8608||t>=8609&&t<=8610||t===8611||t>=8612&&t<=8613||t===8614||t>=8615&&t<=8621||t===8622||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||t===8658||t===8659||t===8660||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||t===8968||t===8969||t===8970||t===8971||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||t===9001||t===9002||t>=9003&&t<=9083||t===9084||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||t===9655||t>=9656&&t<=9664||t===9665||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||t===9839||t>=9840&&t<=10087||t===10088||t===10089||t===10090||t===10091||t===10092||t===10093||t===10094||t===10095||t===10096||t===10097||t===10098||t===10099||t===10100||t===10101||t>=10132&&t<=10175||t>=10176&&t<=10180||t===10181||t===10182||t>=10183&&t<=10213||t===10214||t===10215||t===10216||t===10217||t===10218||t===10219||t===10220||t===10221||t===10222||t===10223||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||t===10627||t===10628||t===10629||t===10630||t===10631||t===10632||t===10633||t===10634||t===10635||t===10636||t===10637||t===10638||t===10639||t===10640||t===10641||t===10642||t===10643||t===10644||t===10645||t===10646||t===10647||t===10648||t>=10649&&t<=10711||t===10712||t===10713||t===10714||t===10715||t>=10716&&t<=10747||t===10748||t===10749||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||t===11158||t>=11159&&t<=11263||t>=11776&&t<=11777||t===11778||t===11779||t===11780||t===11781||t>=11782&&t<=11784||t===11785||t===11786||t===11787||t===11788||t===11789||t>=11790&&t<=11798||t===11799||t>=11800&&t<=11801||t===11802||t===11803||t===11804||t===11805||t>=11806&&t<=11807||t===11808||t===11809||t===11810||t===11811||t===11812||t===11813||t===11814||t===11815||t===11816||t===11817||t>=11818&&t<=11822||t===11823||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||t===11840||t===11841||t===11842||t>=11843&&t<=11855||t>=11856&&t<=11857||t===11858||t>=11859&&t<=11903||t>=12289&&t<=12291||t===12296||t===12297||t===12298||t===12299||t===12300||t===12301||t===12302||t===12303||t===12304||t===12305||t>=12306&&t<=12307||t===12308||t===12309||t===12310||t===12311||t===12312||t===12313||t===12314||t===12315||t===12316||t===12317||t>=12318&&t<=12319||t===12320||t===12336||t===64830||t===64831||t>=65093&&t<=65094}function AF(t){t.forEach(function(e){if(delete e.location,HS(e)||$S(e))for(var r in e.options)delete e.options[r].location,AF(e.options[r].value);else US(e)&&zS(e.style)||(jS(e)||qS(e))&&fy(e.style)?delete e.style.location:GS(e)&&AF(e.children)})}function IW(t,e){e===void 0&&(e={}),e=Fe({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var r=new OW(t,e).parse();if(r.err){var n=SyntaxError(Xe[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return e?.captureLocation||AF(r.val),r.val}l();function VS(t,e){var r=e&&e.cache?e.cache:eOe,n=e&&e.serializer?e.serializer:Q1e,i=e&&e.strategy?e.strategy:K1e;return i(t,{cache:r,serializer:n})}function J1e(t){return t==null||typeof t=="number"||typeof t=="boolean"}function FW(t,e,r,n){var i=J1e(n)?n:r(n),s=e.get(i);return typeof s>"u"&&(s=t.call(this,n),e.set(i,s)),s}function PW(t,e,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),s=e.get(i);return typeof s>"u"&&(s=t.apply(this,n),e.set(i,s)),s}function TF(t,e,r,n,i){return r.bind(e,t,n,i)}function K1e(t,e){var r=t.length===1?FW:PW;return TF(t,this,r,e.cache.create(),e.serializer)}function X1e(t,e){return TF(t,this,PW,e.cache.create(),e.serializer)}function Z1e(t,e){return TF(t,this,FW,e.cache.create(),e.serializer)}var Q1e=function(){return JSON.stringify(arguments)};function OF(){this.cache=Object.create(null)}OF.prototype.get=function(t){return this.cache[t]};OF.prototype.set=function(t,e){this.cache[t]=e};var eOe={create:function(){return new OF}},WS={variadic:X1e,monadic:Z1e};l();l();ai();var Vl;(function(t){t.MISSING_VALUE="MISSING_VALUE",t.INVALID_VALUE="INVALID_VALUE",t.MISSING_INTL_API="MISSING_INTL_API"})(Vl||(Vl={}));var dy=function(t){Xs(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.code=n,s.originalMessage=i,s}return e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error);var RF=function(t){Xs(e,t);function e(r,n,i,s){return t.call(this,'Invalid values for "'.concat(r,'": "').concat(n,'". Options are "').concat(Object.keys(i).join('", "'),'"'),Vl.INVALID_VALUE,s)||this}return e}(dy);var NW=function(t){Xs(e,t);function e(r,n,i){return t.call(this,'Value for "'.concat(r,'" must be of type ').concat(n),Vl.INVALID_VALUE,i)||this}return e}(dy);var LW=function(t){Xs(e,t);function e(r,n){return t.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(n,'"'),Vl.MISSING_VALUE,n)||this}return e}(dy);var yn;(function(t){t[t.literal=0]="literal",t[t.object=1]="object"})(yn||(yn={}));function tOe(t){return t.length<2?t:t.reduce(function(e,r){var n=e[e.length-1];return!n||n.type!==yn.literal||r.type!==yn.literal?e.push(r):n.value+=r.value,e},[])}function rOe(t){return typeof t=="function"}function hy(t,e,r,n,i,s,o){if(t.length===1&&vF(t[0]))return[{type:yn.literal,value:t[0].value}];for(var a=[],c=0,p=t;c<p.length;c++){var d=p[c];if(vF(d)){a.push({type:yn.literal,value:d.value});continue}if(pW(d)){typeof s=="number"&&a.push({type:yn.literal,value:r.getNumberFormat(e).format(s)});continue}var m=d.value;if(!(i&&m in i))throw new LW(m,o);var g=i[m];if(fW(d)){(!g||typeof g=="string"||typeof g=="number")&&(g=typeof g=="string"||typeof g=="number"?String(g):""),a.push({type:typeof g=="string"?yn.literal:yn.object,value:g});continue}if(jS(d)){var E=typeof d.style=="string"?n.date[d.style]:fy(d.style)?d.style.parsedOptions:void 0;a.push({type:yn.literal,value:r.getDateTimeFormat(e,E).format(g)});continue}if(qS(d)){var E=typeof d.style=="string"?n.time[d.style]:fy(d.style)?d.style.parsedOptions:n.time.medium;a.push({type:yn.literal,value:r.getDateTimeFormat(e,E).format(g)});continue}if(US(d)){var E=typeof d.style=="string"?n.number[d.style]:zS(d.style)?d.style.parsedOptions:void 0;E&&E.scale&&(g=g*(E.scale||1)),a.push({type:yn.literal,value:r.getNumberFormat(e,E).format(g)});continue}if(GS(d)){var S=d.children,b=d.value,C=i[b];if(!rOe(C))throw new NW(b,"function",o);var A=hy(S,e,r,n,i,s),I=C(A.map(function(k){return k.value}));Array.isArray(I)||(I=[I]),a.push.apply(a,I.map(function(k){return{type:typeof k=="string"?yn.literal:yn.object,value:k}}))}if(HS(d)){var O=d.options[g]||d.options.other;if(!O)throw new RF(d.value,g,Object.keys(d.options),o);a.push.apply(a,hy(O.value,e,r,n,i));continue}if($S(d)){var O=d.options["=".concat(g)];if(!O){if(!Intl.PluralRules)throw new dy(`Intl.PluralRules is not available in this environment.
216
216
  Try polyfilling it using "@formatjs/intl-pluralrules"
217
217
  `,Vl.MISSING_INTL_API,o);var P=r.getPluralRules(e,{type:d.pluralType}).select(g-(d.offset||0));O=d.options[P]||d.options.other}if(!O)throw new RF(d.value,g,Object.keys(d.options),o);a.push.apply(a,hy(O.value,e,r,n,i,g-(d.offset||0)));continue}}return tOe(a)}function nOe(t,e){return e?Fe(Fe(Fe({},t||{}),e||{}),Object.keys(t).reduce(function(r,n){return r[n]=Fe(Fe({},t[n]),e[n]||{}),r},{})):t}function iOe(t,e){return e?Object.keys(t).reduce(function(r,n){return r[n]=nOe(t[n],e[n]),r},Fe({},t)):t}function IF(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,r){t[e]=r}}}}}function sOe(t){return t===void 0&&(t={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:VS(function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return new((e=Intl.NumberFormat).bind.apply(e,Up([void 0],r,!1)))},{cache:IF(t.number),strategy:WS.variadic}),getDateTimeFormat:VS(function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return new((e=Intl.DateTimeFormat).bind.apply(e,Up([void 0],r,!1)))},{cache:IF(t.dateTime),strategy:WS.variadic}),getPluralRules:VS(function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return new((e=Intl.PluralRules).bind.apply(e,Up([void 0],r,!1)))},{cache:IF(t.pluralRules),strategy:WS.variadic})}}var kW=function(){function t(e,r,n,i){r===void 0&&(r=t.defaultLocale);var s=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(p){var d=s.formatToParts(p);if(d.length===1)return d[0].value;var m=d.reduce(function(g,E){return!g.length||E.type!==yn.literal||typeof g[g.length-1]!="string"?g.push(E.value):g[g.length-1]+=E.value,g},[]);return m.length<=1?m[0]||"":m},this.formatToParts=function(p){return hy(s.ast,s.locales,s.formatters,s.formats,p,void 0,s.message)},this.resolvedOptions=function(){var p;return{locale:((p=s.resolvedLocale)===null||p===void 0?void 0:p.toString())||Intl.NumberFormat.supportedLocalesOf(s.locales)[0]}},this.getAst=function(){return s.ast},this.locales=r,this.resolvedLocale=t.resolveLocale(r),typeof e=="string"){if(this.message=e,!t.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var o=i||{},a=o.formatters,c=hE(o,["formatters"]);this.ast=t.__parse(e,Fe(Fe({},c),{locale:this.resolvedLocale}))}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=iOe(t.formats,n),this.formatters=i&&i.formatters||sOe(this.formatterCache)}return Object.defineProperty(t,"defaultLocale",{get:function(){return t.memoizedDefaultLocale||(t.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),t.memoizedDefaultLocale},enumerable:!1,configurable:!0}),t.memoizedDefaultLocale=null,t.resolveLocale=function(e){if(!(typeof Intl.Locale>"u")){var r=Intl.NumberFormat.supportedLocalesOf(e);return r.length>0?new Intl.Locale(r[0]):new Intl.Locale(typeof e=="string"?e:e[0])}},t.__parse=IW,t.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},t}();var FF=kW;function BW(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function MW(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?BW(Object(r),!0).forEach(function(n){oOe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):BW(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function oOe(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function aOe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function UW(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function uOe(t,e,r){return e&&UW(t.prototype,e),r&&UW(t,r),t}function cOe(){return{memoize:!0,memoizeFallback:!1,bindI18n:"",bindI18nStore:"",parseErrorHandler:function(e,r,n,i){return n},parseLngForICU:function(e){return e}}}var jW=function(){function t(e){aOe(this,t),this.type="i18nFormat",this.mem={},this.init(null,e)}return uOe(t,[{key:"init",value:function(r,n){var i=this,s=r&&r.options&&r.options.i18nFormat||{};if(this.options=lW(s,n,this.options||{},cOe()),this.formats=this.options.formats,r){var o=this.options,a=o.bindI18n,c=o.bindI18nStore,p=o.memoize;r.IntlMessageFormat=FF,r.ICU=this,p&&(a&&r.on(a,function(){return i.clearCache()}),c&&r.store.on(c,function(){return i.clearCache()}))}}},{key:"addUserDefinedFormats",value:function(r){this.formats=this.formats?MW(MW({},this.formats),r):r}},{key:"parse",value:function(r,n,i,s,o,a){var c=a&&a.resolved&&a.resolved.res,p=this.options.memoize&&"".concat(i,".").concat(s,".").concat(o.replace(/\./g,"###")),d;this.options.memoize&&(d=uW(this.mem,p));try{if(!d){var m=this.options.parseLngForICU(i);d=new FF(r,m,this.formats,{ignoreTag:!0}),this.options.memoize&&(this.options.memoizeFallback||!a||c)&&aW(this.mem,p,d)}return d.format(n)}catch(g){return this.options.parseErrorHandler(g,o,r,n)}}},{key:"addLookupKeys",value:function(r,n,i,s,o){return r}},{key:"clearCache",value:function(){this.mem={}}}]),t}();jW.type="i18nFormat";var qW=jW;l();var lOe={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}},NF=class t{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,r)}init(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=e||lOe,this.options=r,this.debug=r.debug}log(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.forward(r,"log","",!0)}warn(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.forward(r,"warn","",!0)}error(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.forward(r,"error","")}deprecate(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(e,r,n,i){return i&&!this.debug?null:(typeof e[0]=="string"&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[r](e))}create(e){return new t(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new t(this.logger,e)}},po=new NF,Ud=class{constructor(){this.observers={}}on(e,r){return e.split(" ").forEach(n=>{this.observers[n]=this.observers[n]||[],this.observers[n].push(r)}),this}off(e,r){if(this.observers[e]){if(!r){delete this.observers[e];return}this.observers[e]=this.observers[e].filter(n=>n!==r)}}emit(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.observers[e]&&[].concat(this.observers[e]).forEach(o=>{o(...n)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(o=>{o.apply(o,[e,...n])})}};function my(){let t,e,r=new Promise((n,i)=>{t=n,e=i});return r.resolve=t,r.reject=e,r}function HW(t){return t==null?"":""+t}function fOe(t,e,r){t.forEach(n=>{e[n]&&(r[n]=e[n])})}function UF(t,e,r){function n(o){return o&&o.indexOf("###")>-1?o.replace(/###/g,"."):o}function i(){return!t||typeof t=="string"}let s=typeof e!="string"?[].concat(e):e.split(".");for(;s.length>1;){if(i())return{};let o=n(s.shift());!t[o]&&r&&(t[o]=new r),Object.prototype.hasOwnProperty.call(t,o)?t=t[o]:t={}}return i()?{}:{obj:t,k:n(s.shift())}}function $W(t,e,r){let{obj:n,k:i}=UF(t,e,Object);n[i]=r}function pOe(t,e,r,n){let{obj:i,k:s}=UF(t,e,Object);i[s]=i[s]||[],n&&(i[s]=i[s].concat(r)),n||i[s].push(r)}function JS(t,e){let{obj:r,k:n}=UF(t,e);if(r)return r[n]}function dOe(t,e,r){let n=JS(t,r);return n!==void 0?n:JS(e,r)}function JW(t,e,r){for(let n in e)n!=="__proto__"&&n!=="constructor"&&(n in t?typeof t[n]=="string"||t[n]instanceof String||typeof e[n]=="string"||e[n]instanceof String?r&&(t[n]=e[n]):JW(t[n],e[n],r):t[n]=e[n]);return t}function Bd(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var hOe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function mOe(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,e=>hOe[e]):t}var gOe=[" ",",","?","!",";"];function yOe(t,e,r){e=e||"",r=r||"";let n=gOe.filter(o=>e.indexOf(o)<0&&r.indexOf(o)<0);if(n.length===0)return!0;let i=new RegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`),s=!i.test(t);if(!s){let o=t.indexOf(r);o>0&&!i.test(t.substring(0,o))&&(s=!0)}return s}function KS(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];let n=e.split(r),i=t;for(let s=0;s<n.length;++s){if(!i||typeof i[n[s]]=="string"&&s+1<n.length)return;if(i[n[s]]===void 0){let o=2,a=n.slice(s,s+o).join(r),c=i[a];for(;c===void 0&&n.length>s+o;)o++,a=n.slice(s,s+o).join(r),c=i[a];if(c===void 0)return;if(c===null)return null;if(e.endsWith(a)){if(typeof c=="string")return c;if(a&&typeof c[a]=="string")return c[a]}let p=n.slice(s+o).join(r);return p?KS(c,p,r):void 0}i=i[n[s]]}return i}function XS(t){return t&&t.indexOf("_")>0?t.replace("_","-"):t}var ZS=class extends Ud{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let r=this.options.ns.indexOf(e);r>-1&&this.options.ns.splice(r,1)}getResource(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,r];n&&typeof n!="string"&&(a=a.concat(n)),n&&typeof n=="string"&&(a=a.concat(s?n.split(s):n)),e.indexOf(".")>-1&&(a=e.split("."));let c=JS(this.data,a);return c||!o||typeof n!="string"?c:KS(this.data&&this.data[e]&&this.data[e][r],n,s)}addResource(e,r,n,i){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,a=[e,r];n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."),i=r,r=a[1]),this.addNamespaces(r),$W(this.data,a,i),s.silent||this.emit("added",e,r,n,i)}addResources(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(let s in n)(typeof n[s]=="string"||Object.prototype.toString.apply(n[s])==="[object Array]")&&this.addResource(e,r,s,n[s],{silent:!0});i.silent||this.emit("added",e,r,n)}addResourceBundle(e,r,n,i,s){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},a=[e,r];e.indexOf(".")>-1&&(a=e.split("."),i=n,n=r,r=a[1]),this.addNamespaces(r);let c=JS(this.data,a)||{};i?JW(c,n,s):c={...c,...n},$W(this.data,a,c),o.silent||this.emit("added",e,r,n)}removeResourceBundle(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}hasResourceBundle(e,r){return this.getResource(e,r)!==void 0}getResourceBundle(e,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,r)}:this.getResource(e,r)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let r=this.getDataByLanguage(e);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}},KW={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,i){return t.forEach(s=>{this.processors[s]&&(e=this.processors[s].process(e,r,n,i))}),e}},GW={},QS=class t extends Ud{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),fOe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=po.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;let n=this.resolve(e,r);return n&&n.res!==void 0}extractFromKey(e,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");let i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,s=r.ns||this.options.defaultNS||[],o=n&&e.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!yOe(e,n,i);if(o&&!a){let c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:s};let p=e.split(n);(n!==i||n===i&&this.options.ns.indexOf(p[0])>-1)&&(s=p.shift()),e=p.join(i)}return typeof s=="string"&&(s=[s]),{key:e,namespaces:s}}translate(e,r,n){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);let i=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],r),c=a[a.length-1],p=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&p.toLowerCase()==="cimode"){if(d){let P=r.nsSeparator||this.options.nsSeparator;return i?{res:`${c}${P}${o}`,usedKey:o,exactUsedKey:o,usedLng:p,usedNS:c,usedParams:this.getUsedParamsDetails(r)}:`${c}${P}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:p,usedNS:c,usedParams:this.getUsedParamsDetails(r)}:o}let m=this.resolve(e,r),g=m&&m.res,E=m&&m.usedKey||o,S=m&&m.exactUsedKey||o,b=Object.prototype.toString.apply(g),C=["[object Number]","[object Function]","[object RegExp]"],A=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,I=!this.i18nFormat||this.i18nFormat.handleAsObject;if(I&&g&&(typeof g!="string"&&typeof g!="boolean"&&typeof g!="number")&&C.indexOf(b)<0&&!(typeof A=="string"&&b==="[object Array]")){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let P=this.options.returnedObjectHandler?this.options.returnedObjectHandler(E,g,{...r,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(m.res=P,m.usedParams=this.getUsedParamsDetails(r),m):P}if(s){let P=b==="[object Array]",k=P?[]:{},B=P?S:E;for(let G in g)if(Object.prototype.hasOwnProperty.call(g,G)){let ee=`${B}${s}${G}`;k[G]=this.translate(ee,{...r,joinArrays:!1,ns:a}),k[G]===ee&&(k[G]=g[G])}g=k}}else if(I&&typeof A=="string"&&b==="[object Array]")g=g.join(A),g&&(g=this.extendTranslation(g,e,r,n));else{let P=!1,k=!1,B=r.count!==void 0&&typeof r.count!="string",G=t.hasDefaultValue(r),ee=B?this.pluralResolver.getSuffix(p,r.count,r):"",V=r.ordinal&&B?this.pluralResolver.getSuffix(p,r.count,{ordinal:!1}):"",oe=r[`defaultValue${ee}`]||r[`defaultValue${V}`]||r.defaultValue;!this.isValidLookup(g)&&G&&(P=!0,g=oe),this.isValidLookup(g)||(k=!0,g=o);let De=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&k?void 0:g,Se=G&&oe!==g&&this.options.updateMissing;if(k||P||Se){if(this.logger.log(Se?"updateKey":"missingKey",p,c,o,Se?oe:g),s){let me=this.resolve(o,{...r,keySeparator:!1});me&&me.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.")}let He=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&U&&U[0])for(let me=0;me<U.length;me++)He.push(U[me]);else this.options.saveMissingTo==="all"?He=this.languageUtils.toResolveHierarchy(r.lng||this.language):He.push(r.lng||this.language);let H=(me,ne,Re)=>{let nr=G&&Re!==g?Re:De;this.options.missingKeyHandler?this.options.missingKeyHandler(me,c,ne,nr,Se,r):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(me,c,ne,nr,Se,r),this.emit("missingKey",me,c,ne,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&B?He.forEach(me=>{this.pluralResolver.getSuffixes(me,r).forEach(ne=>{H([me],o+ne,r[`defaultValue${ne}`]||oe)})}):H(He,o,oe))}g=this.extendTranslation(g,e,r,m,n),k&&g===o&&this.options.appendNamespaceToMissingKey&&(g=`${c}:${o}`),(k||P)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,P?g:void 0):g=this.options.parseMissingKeyHandler(g))}return i?(m.res=g,m.usedParams=this.getUsedParamsDetails(r),m):g}extendTranslation(e,r,n,i,s){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let p=typeof e=="string"&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),d;if(p){let g=e.match(this.interpolator.nestingRegexp);d=g&&g.length}let m=n.replace&&typeof n.replace!="string"?n.replace:n;if(this.options.interpolation.defaultVariables&&(m={...this.options.interpolation.defaultVariables,...m}),e=this.interpolator.interpolate(e,m,n.lng||this.language,n),p){let g=e.match(this.interpolator.nestingRegexp),E=g&&g.length;d<E&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(n.lng=i.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var g=arguments.length,E=new Array(g),S=0;S<g;S++)E[S]=arguments[S];return s&&s[0]===E[0]&&!n.context?(o.logger.warn(`It seems you are nesting recursively key: ${E[0]} in key: ${r[0]}`),null):o.translate(...E,r)},n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,c=typeof a=="string"?[a]:a;return e!=null&&c&&c.length&&n.applyPostProcessor!==!1&&(e=KW.handle(c,e,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:i,...n}:n,this)),e}resolve(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,i,s,o,a;return typeof e=="string"&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(n))return;let p=this.extractFromKey(c,r),d=p.key;i=d;let m=p.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));let g=r.count!==void 0&&typeof r.count!="string",E=g&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),S=r.context!==void 0&&(typeof r.context=="string"||typeof r.context=="number")&&r.context!=="",b=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);m.forEach(C=>{this.isValidLookup(n)||(a=C,!GW[`${b[0]}-${C}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(GW[`${b[0]}-${C}`]=!0,this.logger.warn(`key "${i}" for languages "${b.join(", ")}" won't get resolved as namespace "${a}" 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!!!")),b.forEach(A=>{if(this.isValidLookup(n))return;o=A;let I=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(I,d,A,C,r);else{let P;g&&(P=this.pluralResolver.getSuffix(A,r.count,r));let k=`${this.options.pluralSeparator}zero`,B=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(I.push(d+P),r.ordinal&&P.indexOf(B)===0&&I.push(d+P.replace(B,this.options.pluralSeparator)),E&&I.push(d+k)),S){let G=`${d}${this.options.contextSeparator}${r.context}`;I.push(G),g&&(I.push(G+P),r.ordinal&&P.indexOf(B)===0&&I.push(G+P.replace(B,this.options.pluralSeparator)),E&&I.push(G+k))}}let O;for(;O=I.pop();)this.isValidLookup(n)||(s=O,n=this.getResource(A,C,O,r))}))})}),{res:n,usedKey:i,exactUsedKey:s,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,r,n,i):this.resourceStore.getResource(e,r,n,i)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&typeof e.replace!="string",i=n?e.replace:e;if(n&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(let s of r)delete i[s]}return i}static hasDefaultValue(e){let r="defaultValue";for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&r===n.substring(0,r.length)&&e[n]!==void 0)return!0;return!1}};function PF(t){return t.charAt(0).toUpperCase()+t.slice(1)}var eb=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=po.create("languageUtils")}getScriptPartFromCode(e){if(e=XS(e),!e||e.indexOf("-")<0)return null;let r=e.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(e){if(e=XS(e),!e||e.indexOf("-")<0)return e;let r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){let r=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map(i=>i.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=PF(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=PF(n[1].toLowerCase())),r.indexOf(n[2].toLowerCase())>-1&&(n[2]=PF(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let r;return e.forEach(n=>{if(r)return;let i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&e.forEach(n=>{if(r)return;let i=this.getLanguagePartFromCode(n);if(this.isSupportedCode(i))return r=i;r=this.options.supportedLngs.find(s=>{if(s===i)return s;if(!(s.indexOf("-")<0&&i.indexOf("-")<0)&&s.indexOf(i)===0)return s})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(e,r){if(!e)return[];if(typeof e=="function"&&(e=e(r)),typeof e=="string"&&(e=[e]),Object.prototype.toString.apply(e)==="[object Array]")return e;if(!r)return e.default||[];let n=e[r];return n||(n=e[this.getScriptPartFromCode(r)]),n||(n=e[this.formatLanguageCode(r)]),n||(n=e[this.getLanguagePartFromCode(r)]),n||(n=e.default),n||[]}toResolveHierarchy(e,r){let n=this.getFallbackCodes(r||this.options.fallbackLng||[],e),i=[],s=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(e))):typeof e=="string"&&s(this.formatLanguageCode(e)),n.forEach(o=>{i.indexOf(o)<0&&s(this.formatLanguageCode(o))}),i}},_Oe=[{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}],vOe={1:function(t){return+(t>1)},2:function(t){return+(t!=1)},3:function(t){return 0},4:function(t){return 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 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 t==1?0:t>=2&&t<=4?1:2},7:function(t){return t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},8:function(t){return t==1?0:t==2?1:t!=8&&t!=11?2:3},9:function(t){return+(t>=2)},10:function(t){return t==1?0:t==2?1:t<7?2:t<11?3:4},11:function(t){return t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3},12:function(t){return+(t%10!=1||t%100==11)},13:function(t){return+(t!==0)},14:function(t){return t==1?0:t==2?1:t==3?2:3},15:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2},16:function(t){return t%10==1&&t%100!=11?0:t!==0?1:2},17:function(t){return t==1||t%10==1&&t%100!=11?0:1},18:function(t){return t==0?0:t==1?1:2},19:function(t){return t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3},20:function(t){return t==1?0:t==0||t%100>0&&t%100<20?1:2},21:function(t){return t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0},22:function(t){return t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3}},EOe=["v1","v2","v3"],xOe=["v4"],zW={zero:0,one:1,two:2,few:3,many:4,other:5};function SOe(){let t={};return _Oe.forEach(e=>{e.lngs.forEach(r=>{t[r]={numbers:e.nr,plurals:vOe[e.fc]}})}),t}var LF=class{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=r,this.logger=po.create("pluralResolver"),(!this.options.compatibilityJSON||xOe.includes(this.options.compatibilityJSON))&&(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=SOe()}addRule(e,r){this.rules[e]=r}getRule(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(XS(e),{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,r);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,n).map(i=>`${r}${i}`)}getSuffixes(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((i,s)=>zW[i]-zW[s]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):n.numbers.map(i=>this.getSuffix(e,i,r)):[]}getSuffix(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=this.getRule(e,n);return i?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:this.getSuffixRetroCompatible(i,r):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,r){let n=e.noAbs?e.plurals(r):e.plurals(Math.abs(r)),i=e.numbers[n];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));let s=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?s():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!EOe.includes(this.options.compatibilityJSON)}};function VW(t,e,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=dOe(t,e,r);return!s&&i&&typeof r=="string"&&(s=KS(t,r,n),s===void 0&&(s=KS(e,r,n))),s}var kF=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=po.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(r=>r),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});let r=e.interpolation;this.escape=r.escape!==void 0?r.escape:mOe,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Bd(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Bd(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?Bd(r.nestingPrefix):r.nestingPrefixEscaped||Bd("$t("),this.nestingSuffix=r.nestingSuffix?Bd(r.nestingSuffix):r.nestingSuffixEscaped||Bd(")"),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()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(e,"g");let r=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(r,"g");let n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(n,"g")}interpolate(e,r,n,i){let s,o,a,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function p(S){return S.replace(/\$/g,"$$$$")}let d=S=>{if(S.indexOf(this.formatSeparator)<0){let I=VW(r,c,S,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(I,void 0,n,{...i,...r,interpolationkey:S}):I}let b=S.split(this.formatSeparator),C=b.shift().trim(),A=b.join(this.formatSeparator).trim();return this.format(VW(r,c,C,this.options.keySeparator,this.options.ignoreJSONStructure),A,n,{...i,...r,interpolationkey:C})};this.resetRegExp();let m=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,g=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:S=>p(S)},{regex:this.regexp,safeValue:S=>this.escapeValue?p(this.escape(S)):p(S)}].forEach(S=>{for(a=0;s=S.regex.exec(e);){let b=s[1].trim();if(o=d(b),o===void 0)if(typeof m=="function"){let A=m(e,s,i);o=typeof A=="string"?A:""}else if(i&&Object.prototype.hasOwnProperty.call(i,b))o="";else if(g){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${e}`),o="";else typeof o!="string"&&!this.useRawValueToEscape&&(o=HW(o));let C=S.safeValue(o);if(e=e.replace(s[0],C),g?(S.regex.lastIndex+=o.length,S.regex.lastIndex-=s[0].length):S.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,s,o;function a(c,p){let d=this.nestingOptionsSeparator;if(c.indexOf(d)<0)return c;let m=c.split(new RegExp(`${d}[ ]*{`)),g=`{${m[1]}`;c=m[0],g=this.interpolate(g,o);let E=g.match(/'/g),S=g.match(/"/g);(E&&E.length%2===0&&!S||S.length%2!==0)&&(g=g.replace(/'/g,'"'));try{o=JSON.parse(g),p&&(o={...p,...o})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,b),`${c}${d}${g}`}return delete o.defaultValue,c}for(;i=this.nestingRegexp.exec(e);){let c=[];o={...n},o=o.replace&&typeof o.replace!="string"?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let p=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){let d=i[1].split(this.formatSeparator).map(m=>m.trim());i[1]=d.shift(),c=d,p=!0}if(s=r(a.call(this,i[1].trim(),o),o),s&&i[0]===e&&typeof s!="string")return s;typeof s!="string"&&(s=HW(s)),s||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),s=""),p&&(s=c.reduce((d,m)=>this.format(d,m,n.lng,{...n,interpolationkey:i[1].trim()}),s.trim())),e=e.replace(i[0],s),this.regexp.lastIndex=0}return e}};function bOe(t){let e=t.toLowerCase().trim(),r={};if(t.indexOf("(")>-1){let n=t.split("(");e=n[0].toLowerCase().trim();let i=n[1].substring(0,n[1].length-1);e==="currency"&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(o=>{if(!o)return;let[a,...c]=o.split(":"),p=c.join(":").trim().replace(/^'+|'+$/g,"");r[a.trim()]||(r[a.trim()]=p),p==="false"&&(r[a.trim()]=!1),p==="true"&&(r[a.trim()]=!0),isNaN(p)||(r[a.trim()]=parseInt(p,10))})}return{formatName:e,formatOptions:r}}function Md(t){let e={};return function(n,i,s){let o=i+JSON.stringify(s),a=e[o];return a||(a=t(XS(i),s),e[o]=a),a(n)}}var BF=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=po.create("formatter"),this.options=e,this.formats={number:Md((r,n)=>{let i=new Intl.NumberFormat(r,{...n});return s=>i.format(s)}),currency:Md((r,n)=>{let i=new Intl.NumberFormat(r,{...n,style:"currency"});return s=>i.format(s)}),datetime:Md((r,n)=>{let i=new Intl.DateTimeFormat(r,{...n});return s=>i.format(s)}),relativetime:Md((r,n)=>{let i=new Intl.RelativeTimeFormat(r,{...n});return s=>i.format(s,n.range||"day")}),list:Md((r,n)=>{let i=new Intl.ListFormat(r,{...n});return s=>i.format(s)})},this.init(e)}init(e){let n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=Md(r)}format(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return r.split(this.formatSeparator).reduce((a,c)=>{let{formatName:p,formatOptions:d}=bOe(c);if(this.formats[p]){let m=a;try{let g=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},E=g.locale||g.lng||i.locale||i.lng||n;m=this.formats[p](a,E,{...d,...i,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${p}`);return a},e)}};function DOe(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}var MF=class extends Ud{constructor(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=po.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,i.backend,i)}queueLoad(e,r,n,i){let s={},o={},a={},c={};return e.forEach(p=>{let d=!0;r.forEach(m=>{let g=`${p}|${m}`;!n.reload&&this.store.hasResourceBundle(p,m)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?o[g]===void 0&&(o[g]=!0):(this.state[g]=1,d=!1,o[g]===void 0&&(o[g]=!0),s[g]===void 0&&(s[g]=!0),c[m]===void 0&&(c[m]=!0)))}),d||(a[p]=!0)}),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(e,r,n){let i=e.split("|"),s=i[0],o=i[1];r&&this.emit("failedLoading",s,o,r),n&&this.store.addResourceBundle(s,o,n),this.state[e]=r?-1:2;let a={};this.queue.forEach(c=>{pOe(c.loaded,[s],o),DOe(c,e),r&&c.errors.push(r),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(p=>{a[p]||(a[p]={});let d=c.loaded[p];d.length&&d.forEach(m=>{a[p][m]===void 0&&(a[p][m]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(c=>!c.done)}read(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:i,wait:s,callback:o});return}this.readingCalls++;let a=(p,d)=>{if(this.readingCalls--,this.waitingReads.length>0){let m=this.waitingReads.shift();this.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(p&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,r,n,i+1,s*2,o)},s);return}o(p,d)},c=this.backend[n].bind(this.backend);if(c.length===2){try{let p=c(e,r);p&&typeof p.then=="function"?p.then(d=>a(null,d)).catch(a):a(null,p)}catch(p){a(p)}return}return c(e,r,a)}prepareLoading(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=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."),i&&i();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof r=="string"&&(r=[r]);let s=this.queueLoad(e,r,n,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}load(e,r,n){this.prepareLoading(e,r,{},n)}reload(e,r,n){this.prepareLoading(e,r,{reload:!0},n)}loadOne(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=e.split("|"),i=n[0],s=n[1];this.read(i,s,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${r}loading namespace ${s} for language ${i} failed`,o),!o&&a&&this.logger.log(`${r}loaded namespace ${s} for language ${i}`,a),this.loaded(e,o,a)})}saveMissing(e,r,n,i,s){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" 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}if(!(n==null||n==="")){if(this.backend&&this.backend.create){let c={...o,isUpdate:s},p=this.backend.create.bind(this.backend);if(p.length<6)try{let d;p.length===5?d=p(e,r,n,i,c):d=p(e,r,n,i),d&&typeof d.then=="function"?d.then(m=>a(null,m)).catch(a):a(null,d)}catch(d){a(d)}else p(e,r,n,i,a,c)}!e||!e[0]||this.store.addResource(e[0],r,n,i)}}};function WW(){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:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let r={};if(typeof e[1]=="object"&&(r=e[1]),typeof e[1]=="string"&&(r.defaultValue=e[1]),typeof e[2]=="string"&&(r.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){let n=e[3]||e[2];Object.keys(n).forEach(i=>{r[i]=n[i]})}return r},interpolation:{escapeValue:!0,format:(t,e,r,n)=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function YW(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function YS(){}function wOe(t){Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})}var tb=class t extends Ud{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=YW(e),this.services={},this.logger=po,this.modules={external:[]},wOe(this),r&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,r),this;setTimeout(()=>{this.init(e,r)},0)}}init(){var e=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;typeof r=="function"&&(n=r,r={}),!r.defaultNS&&r.defaultNS!==!1&&r.ns&&(typeof r.ns=="string"?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));let i=WW();this.options={...i,...this.options,...YW(r)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);function s(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?po.init(s(this.modules.logger),this.options):po.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=BF);let m=new eb(this.options);this.store=new ZS(this.options.resources,this.options);let g=this.services;g.logger=po,g.resourceStore=this.store,g.languageUtils=m,g.pluralResolver=new LF(m,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(g.formatter=s(d),g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new kF(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new MF(s(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",function(E){for(var S=arguments.length,b=new Array(S>1?S-1:0),C=1;C<S;C++)b[C-1]=arguments[C];e.emit(E,...b)}),this.modules.languageDetector&&(g.languageDetector=s(this.modules.languageDetector),g.languageDetector.init&&g.languageDetector.init(g,this.options.detection,this.options)),this.modules.i18nFormat&&(g.i18nFormat=s(this.modules.i18nFormat),g.i18nFormat.init&&g.i18nFormat.init(this)),this.translator=new QS(this.services,this.options),this.translator.on("*",function(E){for(var S=arguments.length,b=new Array(S>1?S-1:0),C=1;C<S;C++)b[C-1]=arguments[C];e.emit(E,...b)}),this.modules.external.forEach(E=>{E.init&&E.init(this)})}if(this.format=this.options.interpolation.format,n||(n=YS),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>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"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return e.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return e.store[d](...arguments),e}});let c=my(),p=()=>{let d=(m,g)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(g),n(m,g)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),c}loadResources(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:YS,i=typeof e=="string"?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();let s=[],o=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(p=>{p!=="cimode"&&s.indexOf(p)<0&&s.push(p)})};i?o(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>o(c)),this.options.preload&&this.options.preload.forEach(a=>o(a)),this.services.backendConnector.load(s,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(a)})}else n(null)}reloadResources(e,r,n){let i=my();return e||(e=this.languages),r||(r=this.options.ns),n||(n=YS),this.services.backendConnector.reload(e,r,s=>{i.resolve(),n(s)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&KW.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let r=0;r<this.languages.length;r++){let n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(e,r){var n=this;this.isLanguageChangingTo=e;let i=my();this.emit("languageChanging",e);let s=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,p)=>{p?(s(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,i.resolve(function(){return n.t(...arguments)}),r&&r(c,function(){return n.t(...arguments)})},a=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);let p=typeof c=="string"?c:this.services.languageUtils.getBestMatchFromCodes(c);p&&(this.language||s(p),this.translator.language||this.translator.changeLanguage(p),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(p)),this.loadResources(p,d=>{o(d,p)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),i}getFixedT(e,r,n){var i=this;let s=function(o,a){let c;if(typeof a!="object"){for(var p=arguments.length,d=new Array(p>2?p-2:0),m=2;m<p;m++)d[m-2]=arguments[m];c=i.options.overloadTranslationOptionHandler([o,a].concat(d))}else c={...a};c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,c.keyPrefix=c.keyPrefix||n||s.keyPrefix;let g=i.options.keySeparator||".",E;return c.keyPrefix&&Array.isArray(o)?E=o.map(S=>`${c.keyPrefix}${g}${S}`):E=c.keyPrefix?`${c.keyPrefix}${g}${o}`:o,i.t(E,c)};return typeof e=="string"?s.lng=e:s.lngs=e,s.ns=r,s.keyPrefix=n,s}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let r=arguments.length>1&&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;let n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;let o=(a,c)=>{let p=this.services.backendConnector.state[`${a}|${c}`];return p===-1||p===2};if(r.precheck){let a=r.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,e)&&(!i||o(s,e)))}loadNamespaces(e,r){let n=my();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(e,r){let n=my();typeof e=="string"&&(e=[e]);let i=this.options.preload||[],s=e.filter(o=>i.indexOf(o)<0);return s.length?(this.options.preload=i.concat(s),this.loadResources(o=>{n.resolve(),r&&r(o)}),n):(r&&r(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";let r=["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"],n=this.services&&this.services.languageUtils||new eb(WW());return r.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new t(e,r)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:YS,n=e.forkResourceStore;n&&delete e.forkResourceStore;let i={...this.options,...e,isClone:!0},s=new t(i);return(e.debug!==void 0||e.prefix!==void 0)&&(s.logger=s.logger.clone(e)),["store","services","language"].forEach(a=>{s[a]=this[a]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},n&&(s.store=new ZS(this.store.data,i),s.services.resourceStore=s.store),s.translator=new QS(s.services,i),s.translator.on("*",function(a){for(var c=arguments.length,p=new Array(c>1?c-1:0),d=1;d<c;d++)p[d-1]=arguments[d];s.emit(a,...p)}),s.init(i,r),s.translator.options=i,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}},Zr=tb.createInstance();Zr.createInstance=tb.createInstance;var Lvt=Zr.createInstance,kvt=Zr.dir,Bvt=Zr.init,Mvt=Zr.loadResources,Uvt=Zr.reloadResources,jvt=Zr.use,qvt=Zr.changeLanguage,Hvt=Zr.getFixedT,$vt=Zr.t,Gvt=Zr.exists,zvt=Zr.setDefaultNamespace,Vvt=Zr.hasLoadedNamespace,Wvt=Zr.loadNamespaces,Yvt=Zr.loadLanguages;l();l();var fY=F(K(),1);l();var cY=F(XW(),1),_n=F(K(),1);l();var tY=F(QW()),COe=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function eY(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=t.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(e.name=r[1],(tY.default[r[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var n=t.indexOf("-->");return{type:"comment",comment:n!==-1?t.slice(4,n):""}}for(var i=new RegExp(COe),s=null;(s=i.exec(t))!==null;)if(s[0].trim())if(s[1]){var o=s[1].trim(),a=[o,""];o.indexOf("=")>-1&&(a=o.split("=")),e.attrs[a[0]]=a[1],i.lastIndex--}else s[2]&&(e.attrs[s[2]]=s[3].trim().substring(1,s[3].length-1));return e}var AOe=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,TOe=/^\s*$/,OOe=Object.create(null);function rY(t,e){switch(e.type){case"text":return t+e.content;case"tag":return t+="<"+e.name+(e.attrs?function(r){var n=[];for(var i in r)n.push(i+'="'+r[i]+'"');return n.length?" "+n.join(" "):""}(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?t:t+e.children.reduce(rY,"")+"</"+e.name+">";case"comment":return t+"<!--"+e.comment+"-->"}}var ROe={parse:function(t,e){e||(e={}),e.components||(e.components=OOe);var r,n=[],i=[],s=-1,o=!1;if(t.indexOf("<")!==0){var a=t.indexOf("<");n.push({type:"text",content:a===-1?t:t.substring(0,a)})}return t.replace(AOe,function(c,p){if(o){if(c!=="</"+r.name+">")return;o=!1}var d,m=c.charAt(1)!=="/",g=c.startsWith("<!--"),E=p+c.length,S=t.charAt(E);if(g){var b=eY(c);return s<0?(n.push(b),n):((d=i[s]).children.push(b),n)}if(m&&(s++,(r=eY(c)).type==="tag"&&e.components[r.name]&&(r.type="component",o=!0),r.voidElement||o||!S||S==="<"||r.children.push({type:"text",content:t.slice(E,t.indexOf("<",E))}),s===0&&n.push(r),(d=i[s-1])&&d.children.push(r),i[s]=r),(!m||r.voidElement)&&(s>-1&&(r.voidElement||r.name===c.slice(2,-1))&&(s--,r=s===-1?n:i[s]),!o&&S!=="<"&&S)){d=s===-1?n:i[s].children;var C=t.indexOf("<",E),A=t.slice(E,C===-1?void 0:C);TOe.test(A)&&(A=" "),(C>-1&&s+d.length>=0||A!==" ")&&d.push({type:"text",content:A})}}),n},stringify:function(t){return t.reduce(function(e,r){return e+rY("",r)},"")}},nY=ROe;l();function gy(){if(console&&console.warn){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];typeof e[0]=="string"&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e)}}var iY={};function jd(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];typeof e[0]=="string"&&iY[e[0]]||(typeof e[0]=="string"&&(iY[e[0]]=new Date),gy(...e))}var sY=(t,e)=>()=>{if(t.isInitialized)e();else{let r=()=>{setTimeout(()=>{t.off("initialized",r)},0),e()};t.on("initialized",r)}};function qF(t,e,r){t.loadNamespaces(e,sY(t,r))}function HF(t,e,r,n){typeof r=="string"&&(r=[r]),r.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,sY(t,n))}function IOe(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=e.languages[0],i=e.options?e.options.fallbackLng:!1,s=e.languages[e.languages.length-1];if(n.toLowerCase()==="cimode")return!0;let o=(a,c)=>{let p=e.services.backendConnector.state[`${a}|${c}`];return p===-1||p===2};return r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!o(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(n,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||o(n,t)&&(!i||o(s,t)))}function oY(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(jd("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(t,{lng:r.lng,precheck:(i,s)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,t))return!1}}):IOe(t,e,r)}l();l();var FOe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,POe={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xA9","&#169;":"\xA9","&reg;":"\xAE","&#174;":"\xAE","&hellip;":"\u2026","&#8230;":"\u2026","&#x2F;":"/","&#47;":"/"},NOe=t=>POe[t],aY=t=>t.replace(FOe,NOe);var $F={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:aY};function rb(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$F={...$F,...t}}function qd(){return $F}l();var uY;function nb(t){uY=t}function ua(){return uY}function GF(t,e){if(!t)return!1;let r=t.props?t.props.children:t.children;return e?r.length>0:!!r}function zF(t){if(!t)return[];let e=t.props?t.props.children:t.children;return t.props&&t.props.i18nIsDynamicList?Hd(e):e}function LOe(t){return Object.prototype.toString.call(t)!=="[object Array]"?!1:t.every(e=>(0,_n.isValidElement)(e))}function Hd(t){return Array.isArray(t)?t:[t]}function kOe(t,e){let r={...e};return r.props=Object.assign(t.props,e.props),r}function VF(t,e){if(!t)return"";let r="",n=Hd(t),i=e.transSupportBasicHtmlNodes&&e.transKeepBasicHtmlNodesFor?e.transKeepBasicHtmlNodesFor:[];return n.forEach((s,o)=>{if(typeof s=="string")r+=`${s}`;else if((0,_n.isValidElement)(s)){let a=Object.keys(s.props).length,c=i.indexOf(s.type)>-1,p=s.props.children;if(!p&&c&&a===0)r+=`<${s.type}/>`;else if(!p&&(!c||a!==0))r+=`<${o}></${o}>`;else if(s.props.i18nIsDynamicList)r+=`<${o}></${o}>`;else if(c&&a===1&&typeof p=="string")r+=`<${s.type}>${p}</${s.type}>`;else{let d=VF(p,e);r+=`<${o}>${d}</${o}>`}}else if(s===null)gy("Trans: the passed in value is invalid - seems you passed in a null child.");else if(typeof s=="object"){let{format:a,...c}=s,p=Object.keys(c);if(p.length===1){let d=a?`${p[0]}, ${a}`:p[0];r+=`{{${d}}}`}else gy("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",s)}else gy("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",s)}),r}function BOe(t,e,r,n,i,s){if(e==="")return[];let o=n.transKeepBasicHtmlNodesFor||[],a=e&&new RegExp(o.map(C=>`<${C}`).join("|")).test(e);if(!t&&!a&&!s)return[e];let c={};function p(C){Hd(C).forEach(I=>{typeof I!="string"&&(GF(I)?p(zF(I)):typeof I=="object"&&!(0,_n.isValidElement)(I)&&Object.assign(c,I))})}p(t);let d=nY.parse(`<0>${e}</0>`),m={...c,...i};function g(C,A,I){let O=zF(C),P=S(O,A.children,I);return LOe(O)&&P.length===0||C.props&&C.props.i18nIsDynamicList?O:P}function E(C,A,I,O,P){C.dummy?(C.children=A,I.push((0,_n.cloneElement)(C,{key:O},P?void 0:A))):I.push(..._n.Children.map([C],k=>{let B={...k.props};return delete B.i18nIsDynamicList,_n.default.createElement(k.type,(0,cY.default)({},B,{key:O,ref:k.ref},P?{}:{children:A}))}))}function S(C,A,I){let O=Hd(C);return Hd(A).reduce((k,B,G)=>{let ee=B.children&&B.children[0]&&B.children[0].content&&r.services.interpolator.interpolate(B.children[0].content,m,r.language);if(B.type==="tag"){let V=O[parseInt(B.name,10)];I.length===1&&!V&&(V=I[0][B.name]),V||(V={});let oe=Object.keys(B.attrs).length!==0?kOe({props:B.attrs},V):V,q=(0,_n.isValidElement)(oe),De=q&&GF(B,!0)&&!B.voidElement,Se=a&&typeof oe=="object"&&oe.dummy&&!q,He=typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,B.name);if(typeof oe=="string"){let U=r.services.interpolator.interpolate(oe,m,r.language);k.push(U)}else if(GF(oe)||De){let U=g(oe,B,I);E(oe,U,k,G)}else if(Se){let U=S(O,B.children,I);E(oe,U,k,G)}else if(Number.isNaN(parseFloat(B.name)))if(He){let U=g(oe,B,I);E(oe,U,k,G,B.voidElement)}else if(n.transSupportBasicHtmlNodes&&o.indexOf(B.name)>-1)if(B.voidElement)k.push((0,_n.createElement)(B.name,{key:`${B.name}-${G}`}));else{let U=S(O,B.children,I);k.push((0,_n.createElement)(B.name,{key:`${B.name}-${G}`},U))}else if(B.voidElement)k.push(`<${B.name} />`);else{let U=S(O,B.children,I);k.push(`<${B.name}>${U}</${B.name}>`)}else if(typeof oe=="object"&&!q){let U=B.children[0]?ee:null;U&&k.push(U)}else E(oe,ee,k,G,B.children.length!==1||!ee)}else if(B.type==="text"){let V=n.transWrapTextNodes,oe=s?n.unescape(r.services.interpolator.interpolate(B.content,m,r.language)):r.services.interpolator.interpolate(B.content,m,r.language);V?k.push((0,_n.createElement)(V,{key:`${B.name}-${G}`},oe)):k.push(oe)}return k},[])}let b=S([{dummy:!0,children:t||[]}],d,Hd(t||[]));return zF(b[0])}function WF(t){let{children:e,count:r,parent:n,i18nKey:i,context:s,tOptions:o={},values:a,defaults:c,components:p,ns:d,i18n:m,t:g,shouldUnescape:E,...S}=t,b=m||ua();if(!b)return jd("You will need to pass in an i18next instance by using i18nextReactModule"),e;let C=g||b.t.bind(b)||(De=>De);s&&(o.context=s);let A={...qd(),...b.options&&b.options.react},I=d||C.ns||b.options&&b.options.defaultNS;I=typeof I=="string"?[I]:I||["translation"];let O=VF(e,A),P=c||O||A.transEmptyNodeValue||i,{hashTransKey:k}=A,B=i||(k?k(O||P):O||P);b.options&&b.options.interpolation&&b.options.interpolation.defaultVariables&&(a=a&&Object.keys(a).length>0?{...a,...b.options.interpolation.defaultVariables}:{...b.options.interpolation.defaultVariables});let G=a?o.interpolation:{interpolation:{...o.interpolation,prefix:"#$?",suffix:"?$#"}},ee={...o,count:r,...a,...G,defaultValue:P,ns:I},V=B?C(B,ee):P,oe=BOe(p||e,V,b,A,ee,E),q=n!==void 0?n:A.defaultTransParent;return q?(0,_n.createElement)(q,S,oe):oe}l();var lY=F(K(),1);l();var ib={type:"3rdParty",init(t){rb(t.options.react),nb(t)}};var Zu=(0,lY.createContext)(),sb=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}};function ht(t){let{children:e,count:r,parent:n,i18nKey:i,context:s,tOptions:o={},values:a,defaults:c,components:p,ns:d,i18n:m,t:g,shouldUnescape:E,...S}=t,{i18n:b,defaultNS:C}=(0,fY.useContext)(Zu)||{},A=m||b||ua(),I=g||A&&A.t.bind(A);return WF({children:e,count:r,parent:n,i18nKey:i,context:s,tOptions:o,values:a,defaults:c,components:p,ns:d||I&&I.ns||C||A&&A.options&&A.options.defaultNS,i18n:A,t:g,shouldUnescape:E,...S})}l();var Vi=F(K(),1);var MOe=(t,e)=>{let r=(0,Vi.useRef)();return(0,Vi.useEffect)(()=>{r.current=e?r.current:t},[t,e]),r.current};function $e(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{i18n:r}=e,{i18n:n,defaultNS:i}=(0,Vi.useContext)(Zu)||{},s=r||n||ua();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new sb),!s){jd("You will need to pass in an i18next instance by using initReactI18next");let O=(k,B)=>typeof B=="string"?B:B&&typeof B=="object"&&typeof B.defaultValue=="string"?B.defaultValue:Array.isArray(k)?k[k.length-1]:k,P=[O,{},!1];return P.t=O,P.i18n={},P.ready=!1,P}s.options.react&&s.options.react.wait!==void 0&&jd("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");let o={...qd(),...s.options.react,...e},{useSuspense:a,keyPrefix:c}=o,p=t||i||s.options&&s.options.defaultNS;p=typeof p=="string"?[p]:p||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(p);let d=(s.isInitialized||s.initializedStoreOnce)&&p.every(O=>oY(O,s,o));function m(){return s.getFixedT(e.lng||null,o.nsMode==="fallback"?p:p[0],c)}let[g,E]=(0,Vi.useState)(m),S=p.join();e.lng&&(S=`${e.lng}${S}`);let b=MOe(S),C=(0,Vi.useRef)(!0);(0,Vi.useEffect)(()=>{let{bindI18n:O,bindI18nStore:P}=o;C.current=!0,!d&&!a&&(e.lng?HF(s,e.lng,p,()=>{C.current&&E(m)}):qF(s,p,()=>{C.current&&E(m)})),d&&b&&b!==S&&C.current&&E(m);function k(){C.current&&E(m)}return O&&s&&s.on(O,k),P&&s&&s.store.on(P,k),()=>{C.current=!1,O&&s&&O.split(" ").forEach(B=>s.off(B,k)),P&&s&&P.split(" ").forEach(B=>s.store.off(B,k))}},[s,S]);let A=(0,Vi.useRef)(!0);(0,Vi.useEffect)(()=>{C.current&&!A.current&&E(m),A.current=!1},[s,c]);let I=[g,s,d];if(I.t=g,I.i18n=s,I.ready=d,d||!d&&!a)return I;throw new Promise(O=>{e.lng?HF(s,e.lng,p,()=>O()):qF(s,p,()=>O())})}l();var pY=F(K(),1);l();l();var ob=F(K(),1);function YF(t){let{i18n:e,defaultNS:r,children:n}=t,i=(0,ob.useMemo)(()=>({i18n:e,defaultNS:r}),[e,r]);return(0,ob.createElement)(Zu.Provider,{value:i},n)}l();var $Oe=F(K(),1);l();var jOe=F(K(),1);function dY(t){let e={lng:"en",resources:{en:{translation:t}},keySeparator:!1,react:{defaultTransParent:X}},r=new qW,n=Zr.createInstance(e);return n.use(r),n.use(ib),n.init(),n}l();var ab=F(K(),1);var Wl=({children:t,messages:e,i18n:r})=>{let[n]=(0,ab.useState)(()=>r??dY(e));return ab.default.createElement(YF,{i18n:n},t)};l();var hY=function(t){return{evid:5216,src:11,endpoint:"wix-cli",params:t}};var mY=function(t){return{evid:5214,src:11,endpoint:"wix-cli",params:t}};var JF=function(t){return{evid:5212,src:11,endpoint:"wix-cli",params:t}};var KF=function(t){return{evid:5201,src:11,endpoint:"wix-cli",params:t}},XF=function(t){return{evid:5215,src:11,endpoint:"wix-cli",params:t}};var gY=function(t){return{evid:5211,src:11,endpoint:"wix-cli",params:t}},yY=function(t){return{evid:5213,src:11,endpoint:"wix-cli",params:t}};var _Y=function(t){return{evid:5200,src:11,endpoint:"wix-cli",params:t}};var MY=F(Le(),1);var vY={"login.instructions_title":"Authorize the CLI to access your Wix account:","login.instructions_details":`1. Copy this code to the clipboard: <0>{code}</0>
218
- 2. Press <1/> to connect to <2/> then paste the code`,"login.legacy_auth_notice":"We implemented a new and more secure login method. You'll need to re-login to continue using the CLI.","login.error_opening_browser":"Failed to open browser, please try opening <0/> manually."};l();var Qr=F(K(),1);l();var kY=F(PY(),1);l();var NY=F(Jp(),1);async function LY(t,e){await(0,NY.createHttpClient)().post(t,void 0,{params:{url:e}})}async function pb(t){let{userBrowserTestEndpoint:e}=Gt();e?await LY(e,t):await(0,kY.default)(t,{background:!0})}var BY=({userCode:t,verificationUri:e})=>{let{reportError:r}=Vo(),[n,i]=(0,Qr.useState)(null);return Ni((s,o)=>{o.return&&pb(e).catch(a=>{r(a),i(a)})}),Qr.default.createElement(Qr.default.Fragment,null,Qr.default.createElement(ht,{i18nKey:"login.instructions_title"}),Qr.default.createElement(he,{flexDirection:"column",marginTop:1,marginBottom:1,marginLeft:2},Qr.default.createElement(ht,{i18nKey:"login.instructions_details",components:[Qr.default.createElement(X,{skin:"legacyBlue"}),Qr.default.createElement(xp,{value:"enter"}),Qr.default.createElement(Hn,{url:e})],values:{code:t}})),n&&Qr.default.createElement(Qr.default.Fragment,null,Qr.default.createElement(he,{flexDirection:"column",marginBottom:1},Qr.default.createElement(dl,{error:n})),Qr.default.createElement(ht,{i18nKey:"login.error_opening_browser",components:[Qr.default.createElement(Hn,{url:e})]})))};var UY=({loginFn:t,onLogin:e,onError:r})=>{let n=Oc();function i(a){n.report(JF({isSuccess:!1,...a instanceof Error?{errorType:a.name}:{errorType:"unknown",errorMessage:JSON.stringify(a)}})),r(a)}let s=zm(async({signal:a},c)=>{try{let p=await t({deviceCode:c,signal:a});n.report(JF({isSuccess:!0})),e(p)}catch(p){i(p)}}),{status:o}=Pt(async()=>(n.report(gY({})),dd.requestDeviceCode()),[],{onSuccess:a=>{s.execute(a)},onError:i});return(0,MY.match)(o,{Error:()=>null,Loading:()=>sP.default.createElement(er,null),Success:({result:{userCode:a,verificationUri:c}})=>sP.default.createElement(BY,{userCode:a,verificationUri:c})})};l();var oP=F(K(),1);l();var _y=F(K(),1),HY=F(Le(),1);l();var yy=F(K(),1),jY=F(Le(),1);var qY=({children:t})=>{let{status:e}=Pt(LS,[],{onError:()=>{}});return(0,jY.match)(e,{Error:()=>null,Loading:()=>null,Success:({result:r})=>yy.default.createElement(yy.default.Fragment,null,r&&yy.default.createElement(he,{marginBottom:1},yy.default.createElement(ht,{i18nKey:"login.legacy_auth_notice"})),t)})};var $Y=({authStrategy:{login:t,isLoggedIn:e},onLogin:r,onError:n,children:i})=>{let{status:s,merge:o}=Pt(e,[],{onSuccess:a=>{a&&r(a)},onError:n});return(0,HY.match)(s,{Loading:()=>_y.default.createElement(er,null),Error:()=>null,Success:({result:a})=>a===null?_y.default.createElement(Wl,{messages:vY},_y.default.createElement(qY,null,_y.default.createElement(UY,{loginFn:t,onLogin:c=>{o({result:c}),r(c)},onError:n}))):i(a)})};var aP=({children:t,onError:e,onLogin:r})=>{let n=yu();return oP.default.createElement($Y,{authStrategy:BS,onLogin:({userInfo:i})=>r?.(i),onError:e??n},i=>oP.default.createElement(MS.Provider,{value:{userInfo:i.userInfo,accessToken:i.accessToken}},t))};var{isLoggedIn:Axt}=BS;l();var oJ=F(sJ(),1),{program:Wxt,createCommand:Yxt,createArgument:Jxt,createOption:Kxt,CommanderError:Xxt,InvalidArgumentError:Zxt,InvalidOptionArgumentError:Qxt,Command:aJ,Argument:eSt,Option:tSt,Help:rSt}=oJ.default;l();import{join as vRe}from"node:path";var uJ="https://22f50012d85a41e78a75ae13d92bd04f@o37417.ingest.sentry.io/4505232975593472",xP="wix-error.log";function cJ(t){return vRe(t,xP)}l();l();var dJ=F(K(),1);l();import{uptime as ERe}from"node:process";var fJ=t=>({newAppNameEntered:({name:e})=>(t.report(mY({name:e})),{succeed({appId:r}){t.report(XF({result:"success",appId:r}))},failed(r){t.report(XF({result:"failure",...r instanceof Error?{errorType:r.name,errorMessage:r.message}:{}}))}}),typeOfCreationSelected:({appType:e})=>t.report(yY({type:e})),existingAppSelectedToExtend:({appName:e,numApps:r,appId:n})=>t.report(hY({appName:e,numApps:r,appId:n}))}),lJ=()=>Math.round(ERe()*1e3),pJ=(t,e)=>({reportCreateAppCommand:({command:r})=>{let n={command:"create-app",arguments:r.args.join(","),flags:Object.keys(r.opts()).join(",")};return t.report(_Y({...e,...n,isValid:!0})),{succeed(){t.report(KF({...e,...n,duration:lJ(),isSuccess:!0,isValid:!0}))},failed(i){t.report(KF({...e,...n,...i instanceof Error?{errorType:i.name,errorMessage:i.message}:{errorMessage:JSON.stringify(i)},duration:lJ(),isSuccess:!1,isValid:!0}))}}}});function Yl(){let t=Oc();return(0,dJ.useMemo)(()=>fJ(t),[t])}l();import{randomUUID as xIe}from"node:crypto";l();l();l();ai();var jJ=F(UJ()),qJ=F(Jp()),fIe={baseUrl:process.env.BI_BASE_URL||"https://frog.wix.com",endpoint:"",logError:!1},TP=function(){function t(){}return t.prototype.factory=function(e){var r=this;e===void 0&&(e={});var n=Fe(Fe({},fIe),e),i=jJ.default.factory();return n.onError&&i.setPublisherFailHandler(n.onError),i.addPublisher(function(s,o){return mE(r,void 0,void 0,function(){var a,c,p,d,m;return gE(this,function(g){switch(g.label){case 0:return a=o.endpoint||n.endpoint,c=n.baseUrl,p=n.userAgent,d=n.logError,m=p?{headers:{"User-Agent":p}}:{},[4,new qJ.HttpClient({baseURL:c}).get(a,{headers:m,params:s,timeout:30*1e3}).catch(function(E){return d?console.error(E.toJSON()):Promise.reject(E)})];case 1:return g.sent(),[2]}})})}),i},t}();var qSt=new TP;l();import{join as pIe}from"node:path";var dIe=ce.object({telemetry:ce.boolean().default(!0)}),hIe="user.config.json";function mIe(){return pIe($g(),hIe)}async function HJ(){let t=mIe(),r=await Cs(t)?await Xu(t):{};return dIe.parse(r)}l();import{randomUUID as gIe}from"node:crypto";function OP(t,e){t.updateDefaults(RP(e))}function RP(t){return t?{_client_id:t,_uuid:t,logged_user_id:t,logged_account_id:t,target_account_id:t}:{_client_id:gIe()}}async function IP(t,e){let r=Gt().biLoggerBaseUrl,n=r?{baseUrl:r}:{},i=RP(e),{telemetry:s}=await HJ();return new TP().factory(n).updateDefaults({localTime:()=>Date.now(),...t,...i}).setMuted(!s).logger()}l();var $J=F(DA(),1);import yIe from"node:os";import{platform as _Ie,version as vIe}from"node:process";function FP({cliVersion:t,flow:e}){return{...e?{flow:e}:{},cliVersion:t,isCI:$J.default,nodeVersion:vIe,osName:EIe(),osVersion:yIe.release()}}function EIe(){switch(_Ie){case"darwin":return"mac";case"win32":return"windows";default:return"linux"}}var zJ="0.0.23";var Vd={name:"@wix/create-app",description:"Create Wix apps",version:zJ,author:"Ihor Machuzhak",bin:"bin/index.cjs",dependencies:{"yoga-wasm-web":"~0.3.3"},devDependencies:{"@commander-js/extra-typings":"^11.1.0","@types/is-git-url":"^1.0.1","@types/lodash":"^4.14.200","@types/validate-npm-package-name":"^4.0.1","@wix/bi-logger-wix-cli":"^1.17.0","@wix/cli-auth":"workspace:*","@wix/cli-core-definitions":"workspace:*","@wix/cli-errors":"workspace:*","@wix/cli-fs":"workspace:*","@wix/cli-http-client":"workspace:*","@wix/cli-i18n":"workspace:*","@wix/cli-site-selector":"workspace:*","@wix/cli-telemetry":"workspace:*","@wix/cli-telemetry-react":"workspace:*","@wix/cli-test-overrides":"workspace:*","@wix/cli-ui-kit":"workspace:*","@wix/create-app-definitions":"workspace:*","@wix/dev-center-client":"workspace:*","@wix/gena":"workspace:*","@wix/site-list-client":"workspace:*","@wix/tsup-configs":"workspace:*",chalk:"^5.3.0",commander:"^11.1.0",execa:"^8.0.1",globby:"^13.2.2","is-git-url":"^1.0.0",lodash:"^4.17.21","package-json":"^8.1.1",react:"^18.2.0",semver:"^7.5.4","source-map-support":"^0.5.21",tempy:"^3.1.0","validate-npm-package-name":"^5.0.0",variant:"^3.0.0-dev.26",zod:"^3.22.4"},engines:{node:">= 16.20"},files:["bin","build","templates"],perfer:{bundleSize:{files:[{glob:"./build/index.js",maxSize:"400kb"}]}},publishConfig:{registry:"https://registry.npmjs.org/",access:"public",versionBumpStrategy:"manual",logLevel:"verbose"},scripts:{build:"run -T tsup","build:watch":"run build --watch","dev:npm":"npx $INIT_CWD","dev:yarn":"yarn create @wix/app@portal:$INIT_CWD",lint:"run -T lint-package",test:"yarn workspace @wix/create-app-spec run test","test:watch":"yarn workspace @wix/create-app-spec run test:watch",typecheck:"run -T tsc --noEmit"},type:"module",wix:{artifact:{groupId:"com.wixpress",artifactId:"wix-create-app"},validations:{postBuild:["typecheck","lint"]}}};var PP=async t=>{let e=FP({cliVersion:zJ,flow:"Apps"}),r=await IP({cliSessionId:xIe()},t);return{biLogger:r,coreBiEvents:pJ(r,e)}};l();l();import{env as zb}from"node:process";import{join as jN}from"node:path";var wQ=F(Le(),1);l();var xQ=F(Xd(),1);var SQ=F(Le(),1);l();l();l();var hQ=F(CZ(),1);import{Buffer as tLe}from"node:buffer";import rLe from"node:path";import PN from"node:child_process";import $b from"node:process";l();function lN(t){let e=typeof t=="string"?`
218
+ 2. Press <1/> to connect to <2/> then paste the code`,"login.legacy_auth_notice":"We implemented a new and more secure login method. You'll need to re-login to continue using the CLI.","login.error_opening_browser":"Failed to open browser, please try opening <0/> manually."};l();var Qr=F(K(),1);l();var kY=F(PY(),1);l();var NY=F(Jp(),1);async function LY(t,e){await(0,NY.createHttpClient)().post(t,void 0,{params:{url:e}})}async function pb(t){let{userBrowserTestEndpoint:e}=Gt();e?await LY(e,t):await(0,kY.default)(t,{background:!0})}var BY=({userCode:t,verificationUri:e})=>{let{reportError:r}=Vo(),[n,i]=(0,Qr.useState)(null);return Ni((s,o)=>{o.return&&pb(e).catch(a=>{r(a),i(a)})}),Qr.default.createElement(Qr.default.Fragment,null,Qr.default.createElement(ht,{i18nKey:"login.instructions_title"}),Qr.default.createElement(he,{flexDirection:"column",marginTop:1,marginBottom:1,marginLeft:2},Qr.default.createElement(ht,{i18nKey:"login.instructions_details",components:[Qr.default.createElement(X,{skin:"legacyBlue"}),Qr.default.createElement(xp,{value:"enter"}),Qr.default.createElement(Hn,{url:e})],values:{code:t}})),n&&Qr.default.createElement(Qr.default.Fragment,null,Qr.default.createElement(he,{flexDirection:"column",marginBottom:1},Qr.default.createElement(dl,{error:n})),Qr.default.createElement(ht,{i18nKey:"login.error_opening_browser",components:[Qr.default.createElement(Hn,{url:e})]})))};var UY=({loginFn:t,onLogin:e,onError:r})=>{let n=Oc();function i(a){n.report(JF({isSuccess:!1,...a instanceof Error?{errorType:a.name}:{errorType:"unknown",errorMessage:JSON.stringify(a)}})),r(a)}let s=zm(async({signal:a},c)=>{try{let p=await t({deviceCode:c,signal:a});n.report(JF({isSuccess:!0})),e(p)}catch(p){i(p)}}),{status:o}=Pt(async()=>(n.report(gY({})),dd.requestDeviceCode()),[],{onSuccess:a=>{s.execute(a)},onError:i});return(0,MY.match)(o,{Error:()=>null,Loading:()=>sP.default.createElement(er,null),Success:({result:{userCode:a,verificationUri:c}})=>sP.default.createElement(BY,{userCode:a,verificationUri:c})})};l();var oP=F(K(),1);l();var _y=F(K(),1),HY=F(Le(),1);l();var yy=F(K(),1),jY=F(Le(),1);var qY=({children:t})=>{let{status:e}=Pt(LS,[],{onError:()=>{}});return(0,jY.match)(e,{Error:()=>null,Loading:()=>null,Success:({result:r})=>yy.default.createElement(yy.default.Fragment,null,r&&yy.default.createElement(he,{marginBottom:1},yy.default.createElement(ht,{i18nKey:"login.legacy_auth_notice"})),t)})};var $Y=({authStrategy:{login:t,isLoggedIn:e},onLogin:r,onError:n,children:i})=>{let{status:s,merge:o}=Pt(e,[],{onSuccess:a=>{a&&r(a)},onError:n});return(0,HY.match)(s,{Loading:()=>_y.default.createElement(er,null),Error:()=>null,Success:({result:a})=>a===null?_y.default.createElement(Wl,{messages:vY},_y.default.createElement(qY,null,_y.default.createElement(UY,{loginFn:t,onLogin:c=>{o({result:c}),r(c)},onError:n}))):i(a)})};var aP=({children:t,onError:e,onLogin:r})=>{let n=yu();return oP.default.createElement($Y,{authStrategy:BS,onLogin:({userInfo:i})=>r?.(i),onError:e??n},i=>oP.default.createElement(MS.Provider,{value:{userInfo:i.userInfo,accessToken:i.accessToken}},t))};var{isLoggedIn:Axt}=BS;l();var oJ=F(sJ(),1),{program:Wxt,createCommand:Yxt,createArgument:Jxt,createOption:Kxt,CommanderError:Xxt,InvalidArgumentError:Zxt,InvalidOptionArgumentError:Qxt,Command:aJ,Argument:eSt,Option:tSt,Help:rSt}=oJ.default;l();import{join as vRe}from"node:path";var uJ="https://22f50012d85a41e78a75ae13d92bd04f@o37417.ingest.sentry.io/4505232975593472",xP="wix-error.log";function cJ(t){return vRe(t,xP)}l();l();var dJ=F(K(),1);l();import{uptime as ERe}from"node:process";var fJ=t=>({newAppNameEntered:({name:e})=>(t.report(mY({name:e})),{succeed({appId:r}){t.report(XF({result:"success",appId:r}))},failed(r){t.report(XF({result:"failure",...r instanceof Error?{errorType:r.name,errorMessage:r.message}:{}}))}}),typeOfCreationSelected:({appType:e})=>t.report(yY({type:e})),existingAppSelectedToExtend:({appName:e,numApps:r,appId:n})=>t.report(hY({appName:e,numApps:r,appId:n}))}),lJ=()=>Math.round(ERe()*1e3),pJ=(t,e)=>({reportCreateAppCommand:({command:r})=>{let n={command:"create-app",arguments:r.args.join(","),flags:Object.keys(r.opts()).join(",")};return t.report(_Y({...e,...n,isValid:!0})),{succeed(){t.report(KF({...e,...n,duration:lJ(),isSuccess:!0,isValid:!0}))},failed(i){t.report(KF({...e,...n,...i instanceof Error?{errorType:i.name,errorMessage:i.message}:{errorMessage:JSON.stringify(i)},duration:lJ(),isSuccess:!1,isValid:!0}))}}}});function Yl(){let t=Oc();return(0,dJ.useMemo)(()=>fJ(t),[t])}l();import{randomUUID as xIe}from"node:crypto";l();l();l();ai();var jJ=F(UJ()),qJ=F(Jp()),fIe={baseUrl:process.env.BI_BASE_URL||"https://frog.wix.com",endpoint:"",logError:!1},TP=function(){function t(){}return t.prototype.factory=function(e){var r=this;e===void 0&&(e={});var n=Fe(Fe({},fIe),e),i=jJ.default.factory();return n.onError&&i.setPublisherFailHandler(n.onError),i.addPublisher(function(s,o){return mE(r,void 0,void 0,function(){var a,c,p,d,m;return gE(this,function(g){switch(g.label){case 0:return a=o.endpoint||n.endpoint,c=n.baseUrl,p=n.userAgent,d=n.logError,m=p?{headers:{"User-Agent":p}}:{},[4,new qJ.HttpClient({baseURL:c}).get(a,{headers:m,params:s,timeout:30*1e3}).catch(function(E){return d?console.error(E.toJSON()):Promise.reject(E)})];case 1:return g.sent(),[2]}})})}),i},t}();var qSt=new TP;l();import{join as pIe}from"node:path";var dIe=ce.object({telemetry:ce.boolean().default(!0)}),hIe="user.config.json";function mIe(){return pIe($g(),hIe)}async function HJ(){let t=mIe(),r=await Cs(t)?await Xu(t):{};return dIe.parse(r)}l();import{randomUUID as gIe}from"node:crypto";function OP(t,e){t.updateDefaults(RP(e))}function RP(t){return t?{_client_id:t,_uuid:t,logged_user_id:t,logged_account_id:t,target_account_id:t}:{_client_id:gIe()}}async function IP(t,e){let r=Gt().biLoggerBaseUrl,n=r?{baseUrl:r}:{},i=RP(e),{telemetry:s}=await HJ();return new TP().factory(n).updateDefaults({localTime:()=>Date.now(),...t,...i}).setMuted(!s).logger()}l();var $J=F(DA(),1);import yIe from"node:os";import{platform as _Ie,version as vIe}from"node:process";function FP({cliVersion:t,flow:e}){return{...e?{flow:e}:{},cliVersion:t,isCI:$J.default,nodeVersion:vIe,osName:EIe(),osVersion:yIe.release()}}function EIe(){switch(_Ie){case"darwin":return"mac";case"win32":return"windows";default:return"linux"}}var zJ="0.0.24";var Vd={name:"@wix/create-app",description:"Create Wix apps",version:zJ,author:"Ihor Machuzhak",bin:"bin/index.cjs",dependencies:{"yoga-wasm-web":"~0.3.3"},devDependencies:{"@commander-js/extra-typings":"^11.1.0","@types/is-git-url":"^1.0.1","@types/lodash":"^4.14.200","@types/validate-npm-package-name":"^4.0.1","@wix/bi-logger-wix-cli":"^1.17.0","@wix/cli-auth":"workspace:*","@wix/cli-core-definitions":"workspace:*","@wix/cli-errors":"workspace:*","@wix/cli-fs":"workspace:*","@wix/cli-http-client":"workspace:*","@wix/cli-i18n":"workspace:*","@wix/cli-site-selector":"workspace:*","@wix/cli-telemetry":"workspace:*","@wix/cli-telemetry-react":"workspace:*","@wix/cli-test-overrides":"workspace:*","@wix/cli-ui-kit":"workspace:*","@wix/create-app-definitions":"workspace:*","@wix/dev-center-client":"workspace:*","@wix/gena":"workspace:*","@wix/site-list-client":"workspace:*","@wix/tsup-configs":"workspace:*",chalk:"^5.3.0",commander:"^11.1.0",execa:"^8.0.1",globby:"^13.2.2","is-git-url":"^1.0.0",lodash:"^4.17.21","package-json":"^8.1.1",react:"^18.2.0",semver:"^7.5.4","source-map-support":"^0.5.21",tempy:"^3.1.0","validate-npm-package-name":"^5.0.0",variant:"^3.0.0-dev.26",zod:"^3.22.4"},engines:{node:">= 16.20"},files:["bin","build","templates"],perfer:{bundleSize:{files:[{glob:"./build/index.js",maxSize:"400kb"}]}},publishConfig:{registry:"https://registry.npmjs.org/",access:"public",versionBumpStrategy:"manual",logLevel:"verbose"},scripts:{build:"run -T tsup","build:watch":"run build --watch","dev:npm":"npx $INIT_CWD","dev:yarn":"yarn create @wix/app@portal:$INIT_CWD",lint:"run -T lint-package",test:"yarn workspace @wix/create-app-spec run test","test:watch":"yarn workspace @wix/create-app-spec run test:watch",typecheck:"run -T tsc --noEmit"},type:"module",wix:{artifact:{groupId:"com.wixpress",artifactId:"wix-create-app"},validations:{postBuild:["typecheck","lint"]}}};var PP=async t=>{let e=FP({cliVersion:zJ,flow:"Apps"}),r=await IP({cliSessionId:xIe()},t);return{biLogger:r,coreBiEvents:pJ(r,e)}};l();l();import{env as zb}from"node:process";import{join as jN}from"node:path";var wQ=F(Le(),1);l();var xQ=F(Xd(),1);var SQ=F(Le(),1);l();l();l();var hQ=F(CZ(),1);import{Buffer as tLe}from"node:buffer";import rLe from"node:path";import PN from"node:child_process";import $b from"node:process";l();function lN(t){let e=typeof t=="string"?`
219
219
  `:`
220
220
  `.charCodeAt(),r=typeof t=="string"?"\r":"\r".charCodeAt();return t[t.length-1]===e&&(t=t.slice(0,-1)),t[t.length-1]===r&&(t=t.slice(0,-1)),t}l();import Ib from"node:process";import Oy from"node:path";import HNe from"node:url";l();function Rb(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}function $Ne(t={}){let{cwd:e=Ib.cwd(),path:r=Ib.env[Rb()],execPath:n=Ib.execPath}=t,i,s=e instanceof URL?HNe.fileURLToPath(e):e,o=Oy.resolve(s),a=[];for(;i!==o;)a.push(Oy.join(o,"node_modules/.bin")),i=o,o=Oy.resolve(o,"..");return a.push(Oy.resolve(s,n,"..")),[...a,r].join(Oy.delimiter)}function AZ({env:t=Ib.env,...e}={}){t={...t};let r=Rb({env:t});return e.path=t[r],t[r]=$Ne(e),t}l();l();var GNe=(t,e,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let i=Object.getOwnPropertyDescriptor(t,r),s=Object.getOwnPropertyDescriptor(e,r);!zNe(i,s)&&n||Object.defineProperty(t,r,s)},zNe=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},VNe=(t,e)=>{let r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},WNe=(t,e)=>`/* Wrapped ${t}*/
221
221
  ${e}`,YNe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),JNe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),KNe=(t,e,r)=>{let n=r===""?"":`with ${r.trim()}() `,i=WNe.bind(null,n,e.toString());Object.defineProperty(i,"name",JNe),Object.defineProperty(t,"toString",{...YNe,value:i})};function fN(t,e,{ignoreNonConfigurable:r=!1}={}){let{name:n}=t;for(let i of Reflect.ownKeys(e))GNe(t,e,i,r);return VNe(t,e),KNe(t,e,n),t}var Fb=new WeakMap,TZ=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,n=0,i=t.displayName||t.name||"<anonymous>",s=function(...o){if(Fb.set(s,++n),n===1)r=t.apply(this,o),t=null;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return r};return fN(s,t),Fb.set(s,n),s};TZ.callCount=t=>{if(!Fb.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return Fb.get(t)};var OZ=TZ;l();import o2e from"node:process";l();import{constants as e2e}from"node:os";l();var RZ=()=>{let t=FZ-IZ+1;return Array.from({length:t},XNe)},XNe=(t,e)=>({name:`SIGRT${e+1}`,number:IZ+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),IZ=34,FZ=64;l();import{constants as ZNe}from"node:os";l();var PZ=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var pN=()=>{let t=RZ();return[...PZ,...t].map(QNe)},QNe=({name:t,number:e,description:r,action:n,forced:i=!1,standard:s})=>{let{signals:{[t]:o}}=ZNe,a=o!==void 0;return{name:t,number:a?o:e,description:r,supported:a,action:n,forced:i,standard:s}};var t2e=()=>{let t=pN();return Object.fromEntries(t.map(r2e))},r2e=({name:t,number:e,description:r,supported:n,action:i,forced:s,standard:o})=>[t,{name:t,number:e,description:r,supported:n,action:i,forced:s,standard:o}],NZ=t2e(),n2e=()=>{let t=pN(),e=64+1,r=Array.from({length:e},(n,i)=>i2e(i,t));return Object.assign({},...r)},i2e=(t,e)=>{let r=s2e(t,e);if(r===void 0)return{};let{name:n,description:i,supported:s,action:o,forced:a,standard:c}=r;return{[t]:{name:n,number:t,description:i,supported:s,action:o,forced:a,standard:c}}},s2e=(t,e)=>{let r=e.find(({name:n})=>e2e.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},sCt=n2e();var a2e=({timedOut:t,timeout:e,errorCode:r,signal:n,signalDescription:i,exitCode:s,isCanceled:o})=>t?`timed out after ${e} milliseconds`:o?"was canceled":r!==void 0?`failed with ${r}`:n!==void 0?`was killed with ${n} (${i})`:s!==void 0?`failed with exit code ${s}`:"failed",Ry=({stdout:t,stderr:e,all:r,error:n,signal:i,exitCode:s,command:o,escapedCommand:a,timedOut:c,isCanceled:p,killed:d,parsed:{options:{timeout:m,cwd:g=o2e.cwd()}}})=>{s=s===null?void 0:s,i=i===null?void 0:i;let E=i===void 0?void 0:NZ[i].description,S=n&&n.code,C=`Command ${a2e({timedOut:c,timeout:m,errorCode:S,signal:i,signalDescription:E,exitCode:s,isCanceled:p})}: ${o}`,A=Object.prototype.toString.call(n)==="[object Error]",I=A?`${C}