@wix/bookings 1.0.1780 → 1.0.1782

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/build/cjs/context-service-addons.d.ts +54 -3
  2. package/build/cjs/context-service-addons.js +1065 -578
  3. package/build/cjs/context-service-addons.js.map +1 -1
  4. package/build/cjs/context-service.d.ts +17 -0
  5. package/build/cjs/context-service.js +975 -963
  6. package/build/cjs/context-service.js.map +1 -1
  7. package/build/cjs/context-time-slots.d.ts +20 -91
  8. package/build/cjs/context-time-slots.js +456 -475
  9. package/build/cjs/context-time-slots.js.map +1 -1
  10. package/build/es/context-service-addons.d.mts +54 -3
  11. package/build/es/context-service-addons.mjs +1061 -574
  12. package/build/es/context-service-addons.mjs.map +1 -1
  13. package/build/es/context-service.d.mts +17 -0
  14. package/build/es/context-service.mjs +975 -963
  15. package/build/es/context-service.mjs.map +1 -1
  16. package/build/es/context-time-slots.d.mts +20 -91
  17. package/build/es/context-time-slots.mjs +456 -475
  18. package/build/es/context-time-slots.mjs.map +1 -1
  19. package/build/internal/cjs/context-service-addons.d.ts +54 -3
  20. package/build/internal/cjs/context-service.d.ts +17 -0
  21. package/build/internal/cjs/context-time-slots.d.ts +20 -91
  22. package/build/internal/es/context-service-addons.d.mts +54 -3
  23. package/build/internal/es/context-service.d.mts +17 -0
  24. package/build/internal/es/context-time-slots.d.mts +20 -91
  25. package/context-runtime/context-service/runtime.d.ts +17 -0
  26. package/context-runtime/context-service/runtime.js +3 -3
  27. package/context-runtime/context-service-addons/runtime.d.ts +54 -3
  28. package/context-runtime/context-service-addons/runtime.js +2 -2
  29. package/context-runtime/context-time-slots/runtime.d.ts +20 -91
  30. package/context-runtime/context-time-slots/runtime.js +3 -3
  31. package/package.json +3 -3
@@ -1,2 +1,2 @@
1
- import{Component as e,Suspense as t,createContext as n,useCallback as r,useContext as i,useEffect as a,useMemo as o,useRef as s,useSyncExternalStore as c}from"react";import{useServiceContext as l}from"@wix/bookings/context/service";import{useGetService as u,useService as d}from"@wix/services-manager-react";import{jsx as f}from"react/jsx-runtime";var p={};function m(e,t=!1,n=e=>e){return()=>({__type:`event-definition`,type:e,isDomainEvent:t,transformations:n})}var h=e=>{switch(e){case`get`:case`GET`:return`GET`;case`post`:case`POST`:return`POST`;case`put`:case`PUT`:return`PUT`;case`delete`:case`DELETE`:return`DELETE`;case`patch`:case`PATCH`:return`PATCH`;case`head`:case`HEAD`:return`HEAD`;case`options`:case`OPTIONS`:return`OPTIONS`;default:throw Error(`Unknown method: ${e}`)}},g=e=>t=>async n=>{let r,i=t=>{if(r=e(n)(t),r.url===void 0)throw Error(`Url was not successfully created for this request, please reach out to support channels for assistance.`);let{method:i,url:a,params:o}=r;return{...r,method:h(i),url:a,data:r.data,params:o}};try{let e=await t.request(i);if(r===void 0)throw Error(`Request options were not created for this request, please reach out to support channels for assistance.`);let n=Array.isArray(r.transformResponse)?r.transformResponse:[r.transformResponse],a=e.data;return n.forEach(t=>{t&&(a=t(e.data,e.headers))}),a}catch(e){throw typeof e==`object`&&e&&`response`in e&&typeof e.response==`object`&&e.response!==null&&`data`in e.response?e.response.data:e}},_=e=>e.__isAmbassador?!0:!!e().__isAmbassador,v=`__metadata`,y=`edge.wixapis.com`,b=class extends Error{message;response;constructor(e,t){super(e),this.message=e,this.response=t}async details(){let e=await this.response.json();return x(this.response.status,e?.message,e?.details,{requestId:this.response.headers.get(`X-Wix-Request-Id`),details:e})}},x=(e,t,n,r)=>({details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t,requestId:r?.requestId}),ee=e=>e?.method&&[`post`,`put`,`patch`].includes(e.method.toLocaleLowerCase())&&e.body?{"Content-Type":`application/json`}:{},te=e=>e&&typeof e==`object`&&!Array.isArray(e),ne=e=>e.__type===`host`;function S(e,t){return e.create(t)}var C=`x-wix-bi-gateway`;function re(e,t,n){return{[C]:ie({environment:`js-sdk${n?`-${n}`:``}`,"package-name":e.packageName??t?.PACKAGE_NAME,"method-fqn":e.methodFqn,entity:e.entityFqdn})}}function ie(e){return Object.entries(e).filter(([e,t])=>!!t).map(([e,t])=>`${e}=${t}`).join(`,`)}function ae(e){let t=globalThis.__wix_context__,n={client:p.client,elevatedClient:p.elevatedClient},r;globalThis.__wix_context__=void 0,p.client=void 0,p.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,p.client=n.client,p.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}var oe={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function se(e){return fe(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var ce=/([\p{Ll}\d])(\p{Lu})/gu,le=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,ue=`$1\0$2`,de=/[^\p{L}\d]+/giu;function fe(e){let t=e.trim();t=t.replace(ce,ue).replace(le,ue),t=t.replace(de,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}var pe=e=>`validationError`in(e.response?.data?.details??{}),me=e=>`applicationError`in(e.response?.data?.details??{}),he=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function ge(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(pe(e))return _e(e,t,n);if(me(e))return ve(e);if(he(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:se(n),data:{}},requestId:e.requestId};return w(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return ye(e)}var _e=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=be(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return w(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},w=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),ve=e=>{let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i=e.response?.data?.details?.applicationError?.description??n,a=e.response?.data?.details?.applicationError?.code??se(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return w(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},ye=e=>w(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:se(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),be=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,i)=>{let a={...e,...t},o=Object.keys(a);return r?.filter(e=>!r.some(t=>t.field.length>e.field.length&&t.field.startsWith(e.field)&&o.includes(t.field))).map(e=>{let r=t[e.field];if(r)return{...e,field:xe(r,i)};let s=o?.sort((e,t)=>t.length-e.length)?.find(t=>e.field.startsWith(t));if(s){let t=a[s];if(t)return{...e,field:e.field.replace(s,xe(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},xe=(e,t)=>{let n=Se(e);return n==null?e:e.replace(`$[${n}]`,t[n])},Se=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function Ce(e,t,n,r,i,a,o,s,c,l,u){return ae(()=>e({request:async e=>{let i=e({host:s?.HTTPHost||`www.wixapis.com`}),a=i;a.method===`GET`&&a.fallback?.length&&(a.params?.toString().length??0)>4e3&&(a=i.fallback[0]);let o=s?.HTTPHost??`www.wixapis.com`,u=`https://${l?y:o}${a.url}`;a.params&&a.params.toString()&&(u+=`?${a.params.toString()}`);try{let e=re(i,t,c),o={method:a.method,...a.data&&{body:JSON.stringify(a.data)},headers:{...e}},s=await n(u,o);if(s.status!==200){let e=null;try{e=await s.json()}catch{}let t=Te(s.status,e?.message??s.statusText,e?.details,{requestId:s.headers.get(`X-Wix-Request-Id`),details:e}),n=ge(t);throw r?.handleError(n,{requestOptions:{url:a.url,method:a.method,entityFqdn:i.entityFqdn,methodFqn:i.methodFqn}}),t}let l=await s.json();return{data:a.migrationOptions?.optInTransformResponse&&a.transformResponse?Array.isArray(a.transformResponse)?a.transformResponse[0](l):a.transformResponse(l):l,headers:s.headers,status:s.status,statusText:s.statusText}}catch(e){throw e.message?.includes(`fetch is not defined`)&&console.error(`Node.js v18+ is required`),e}},fetchWithAuth:n,wixAPIFetch:i,getActiveToken:a,getAuthHeaders:o},{validateRequestSchema:u}))}var we=class extends Error{response;requestId;constructor(e){super(),this.response=e.response,this.requestId=e.requestId}},Te=(e,t,n,r)=>new we({response:{data:{details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t},status:e},requestId:r?.requestId}),Ee=`.`;function De(e,t,n){if(e==null)throw Error(`Cannot set value on null or undefined`);let r=Oe(t),i=e;for(let e=0;e<r.length;e++){let t=r[e];if(e===r.length-1){i[t]=n;break}let a=r[e+1];(!(t in i)||i[t]==null||typeof i[t]!=`object`||i[t]===null)&&(i[t]=typeof a==`number`?[]:{}),i=i[t]}return e}function Oe(e){return Array.isArray(e)?e:e.split(Ee).map(e=>ke(e)?Number(e):e)}function ke(e){return/^\d+$/.test(e)}function Ae(e){let t={};for(let[n,r]of Object.entries(e))je(n)||De(t,Oe(n),r);return t}function je(e){return e===`__proto__`||e===`constructor`||e===`prototype`}var Me=class{BRACKET_PATTERN=/\[(\d+)\]/g;NUMERIC_PATTERN=/^\d+$/;ESCAPED_DOT_PATTERN=/\\\./g;ESCAPED_LEFT_BRACKET_PATTERN=/\\\[/g;ESCAPED_RIGHT_BRACKET_PATTERN=/\\\]/g;SPLIT_PATTERN=/\.|\[(\d+)\]/g;DOT_BEFORE_BRACKET_PATTERN=/\.\[/g;ESCAPED_DOT_PLACEHOLDER=`__DOT__`;ESCAPED_RIGHT_BRACKET_PLACEHOLDER=`__RB__`;ESCAPED_LEFT_BRACKET_PLACEHOLDER=`__LB__`;modifiedFields;cleanedModifiedFields;constructor(e){this.modifiedFields=e}replaceEscapedCharacters(e){return e.replace(this.ESCAPED_DOT_PATTERN,this.ESCAPED_DOT_PLACEHOLDER).replace(this.ESCAPED_LEFT_BRACKET_PATTERN,this.ESCAPED_LEFT_BRACKET_PLACEHOLDER).replace(this.ESCAPED_RIGHT_BRACKET_PATTERN,this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER)}restoreEscapedCharacters(e){return e.replace(this.ESCAPED_DOT_PLACEHOLDER,`\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER,`\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER,`\\[`)}unflatten(){return this.cleanedModifiedFields=Object.fromEntries(Object.entries(this.modifiedFields).map(([e,t])=>[this.replaceEscapedCharacters(this.bracketToDotNotation(e)),t])),Ae(this.cleanedModifiedFields)}flatten(e){let t={};for(let n of Object.keys(this.cleanedModifiedFields)){let r=this.splitPath(n),i=this.navigatePath(e,r);t={...t,...i}}return Object.fromEntries(Object.entries(t).map(([e,t])=>[this.restoreEscapedCharacters(e),t]))}splitPath(e){let t=[],n=0,r=Array.from(e.matchAll(this.SPLIT_PATTERN));for(let i of r)i.index>n&&t.push(e.substring(n,i.index)),i[1]&&t.push(i[1]),n=i.index+i[0].length;return n<e.length&&t.push(e.substring(n)),t}navigatePath(e,t){let n=e,r=[],i=e=>{if(!Array.isArray(n))throw Error(`Expected array at path ${this.buildPathString(r)}, but got ${typeof n}`);r.push(`[${e}]`),n=n[parseInt(e,10)]},a=(e,t)=>{let i=e in oe?oe[e]:void 0;if(i&&i in t){r.push(i),n=t[i];return}let a=Ie(e);if(a&&a in t){r.push(a),n=t[a];return}throw Error(`Cannot find key '${e}' or its transformations at path ${this.buildPathString(r)}`)},o=(e,t)=>{r.push(e),n=t[e]};for(let e of t){if(this.NUMERIC_PATTERN.test(e)){i(e);continue}if(typeof n!=`object`||!n)throw Error(`Cannot access property '${e}' on ${typeof n} at path ${this.buildPathString(r)}`);let t=n;if(e in n){o(e,t);continue}a(e,t)}return{[this.buildPathString(r)]:n}}buildPathString(e){return e.join(`.`).replace(this.DOT_BEFORE_BRACKET_PATTERN,`[`)}bracketToDotNotation(e){return e.replace(this.BRACKET_PATTERN,(t,n,r)=>r>0&&e[r-1]===`\\`?t:`.`+n)}};function Ne(e,t){let n=e?.modifiedFields;if(!n)return null;let r=Pe(n);if(!r)return null;let{unflattenedModifiedFields:i,modifiedFieldsManipulator:a}=r;e={...e,modifiedFields:i};let o=t(e),s=o?.modifiedFields;if(!s)return null;let c=Fe(s,a);return c===null?null:(o.modifiedFields=c,o)}function Pe(e){if(typeof e==`object`&&e&&!Array.isArray(e))try{let t=new Me(e);return{unflattenedModifiedFields:t.unflatten(),modifiedFieldsManipulator:t}}catch{return null}return null}function Fe(e,t){if(typeof e==`object`&&e&&!Array.isArray(e))try{return t.flatten(e)}catch{return null}return null}function Ie(e){return e.replace(/[-_\s]+(.)?/g,(e,t)=>t?t.toUpperCase():``).replace(/^./,e=>e.toLowerCase())}function Le(){return{emit(e,...t){for(let n=0,r=this.events[e]||[],i=r.length;n<i;n++)r[n](...t)},events:{},on(e,t){return(this.events[e]||=[]).push(t),()=>{this.events[e]=this.events[e]?.filter(e=>t!==e)}}}}var Re=e=>e.__type===`event-definition`;function ze(e,t,n,r){let i;if(e.isDomainEvent){let{deletedEvent:e,actionEvent:t,createdEvent:a,updatedEvent:o,...s}=n,c={...r,...s};i=e?e?.deletedEntity?{entity:e?.deletedEntity,metadata:c}:{metadata:c}:t?{data:t.body,metadata:c}:o?{entity:o.currentEntity,metadata:c,...o.modifiedFields?{modifiedFields:o.modifiedFields}:{}}:{entity:a?.entity,metadata:c}}else i={data:n,metadata:r};let a=e.transformations??(e=>e),o=i,s=i;if(s.modifiedFields){let e=s.modifiedFields;if(typeof e==`object`&&e&&!Array.isArray(e)){o=structuredClone(i);let e=Ne(s,a);if(e)return t(e)}}return t(a(o))}function Be(e){let t=new Map,n=Le();return{initModule(e){return r=>{let i=t.get(e.type)??[];i.push({eventDefinition:e,handler:r}),t.set(e.type,i),n.emit(`registered`,e)}},client:{...n,getRegisteredEvents:()=>t,async process(e,n={expectedEvents:[]}){let{eventType:r,identity:i,instanceId:a,payload:o,accountInfo:s}=await this.parseJWT(e),c=[...n.expectedEvents,...Array.from(t.keys()).map(e=>({type:e}))];if(c.length>0&&!c.some(({type:e})=>e===r))throw Error(`Unexpected event type: ${r}. Expected one of: ${c.map(e=>e.type).join(`, `)}`);let l=t.get(r)??[];return await Promise.all(l.map(({eventDefinition:e,handler:t})=>ze(e,t,o,{instanceId:a,identity:i,accountInfo:s}))),{instanceId:a,eventType:r,payload:o,identity:i,accountInfo:s}},async processRequest(e,t){let n=await e.text();return this.process(n,t)},async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`string`)throw Error(`Unexpected type of JWT data: expected string, got ${typeof r.data}`);let a=JSON.parse(r.data),o=a.eventType,s=a.accountInfo,c=a.instanceId,l=a.identity?JSON.parse(a.identity):void 0;return{instanceId:c,eventType:o,payload:JSON.parse(a.data),identity:l,accountInfo:s}},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async executeHandlers(e){let n=Array.from(t.keys()).map(e=>({type:e}));if(n.length>0&&!n.some(({type:t})=>t===e.eventType))throw Error(`Unexpected event type: ${e.eventType}. Expected one of: ${n.map(e=>e.type).join(`, `)}`);let r=t.get(e.eventType)??[];await Promise.all(r.map(({eventDefinition:t,handler:n})=>ze(t,n,e.payload,{instanceId:e.instanceId,identity:e.identity})))},apps:{AppInstalled:m(`AppInstalled`)(),AppRemoved:m(`AppRemoved`)()}}}}var Ve=e=>e.__type===`service-plugin-definition`;function He(e){let t=new Map,n=Le();return{initModule(e){return r=>{let i=t.get(e.componentType.toLowerCase())??[];i.push({servicePluginDefinition:e,implementation:r}),t.set(e.componentType.toLowerCase(),i),n.emit(`registered`,e)}},client:{...n,getRegisteredServicePlugins:()=>t,async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t,!0);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`object`||r.data===null||!(`metadata`in r.data)||typeof r.data.metadata!=`object`||r.data.metadata===null||!(`appExtensionType`in r.data.metadata)||typeof r.data.metadata.appExtensionType!=`string`)throw Error(`Unexpected JWT data: expected object with metadata.appExtensionType string`);return r.data},async process(e){let t=await this.parseJWT(e.body);return this.executeHandler(t,e.url)},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async processRequest(e){let t=await this.parseRequest(e);return this.processParsedRequest(t,e.url)},async processParsedRequest(e,t){try{let n=await this.executeHandler(e,t);return Response.json(n)}catch(e){if(e.errorType===`SPI`&&e.applicationCode&&e.httpCode)return Response.json({applicationError:{code:e.applicationCode,data:e.data}},{status:e.httpCode});throw e}},async executeHandler(e,n){let r=e.metadata.appExtensionType.toLowerCase(),i=t.get(r)??[];if(i.length===0)throw Error(`No service plugin implementations found for component type ${r}`);if(i.length>1)throw Error(`Multiple service plugin implementations found for component type ${r}. This is currently not supported`);let{implementation:a,servicePluginDefinition:o}=i[0],s=o.methods.find(e=>n.endsWith(e.primaryHttpMappingPath));if(!s)throw Error(`Unexpect request: request url did not match any method: `+n);let c=a[s.name];if(!c)throw Error(`Got request for service plugin method ${s.name} but no implementation was provided. Available methods: ${Object.keys(a).join(`, `)}`);return s.transformations.toREST(await c(s.transformations.fromREST(e)))}}}}var T=`X-Wix-Consistent`;function Ue(e){let t=e.headers||{Authorization:``},n={getAuthHeaders:e=>Promise.resolve({headers:{}})},r=e.auth,i=typeof r==`function`?r:()=>r??n,a=()=>i().getAuthHeaders(e.host),o=()=>e.fetch??fetch,s=async(n,r)=>{let i=o(),s=await a(),c={...r?.headers??{},...s.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[T]:t[T]}:{}},l=e.host?.getErrorHandler?.();try{if(typeof n==`string`||n instanceof URL){let e=await i(n,{...r,headers:c});l?.handleError(e,{requestOptions:{url:n.toString(),method:r?.method}});let a=E(e);return a&&(t[T]=a),e}{for(let[e,t]of Object.entries(c))typeof t==`string`&&n.headers.set(e,t);let e=await i(n,r);l?.handleError(e,{requestOptions:{url:n.url,method:r?.method}});let a=E(e);return a&&(t[T]=a),e}}catch(e){throw l?.handleError(e,{requestOptions:{url:typeof n==`string`||n instanceof URL?n.toString():n.url,method:r?.method}}),e}},{client:c,initModule:l}=He(i),{client:u,initModule:d}=Be(i),f=async(n,r)=>{let i=o(),s=await a(),c=ee(r),l=await i(n,{...r,headers:{...c,...t,...s?.headers,...r?.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[T]:t[T]}:{}}}),u=E(l);return u&&(t[T]=u),l},m=(t,n)=>{if(Re(t))return d(t);if(Ve(t))return l(t);if(ne(t)&&e.host)return S(t,e.host);if(typeof t==`function`){if(`__type`in t&&t.__type===`wix_spi_error`)return t;let r=e.host?.apiBaseUrl??`www.wixapis.com`,o=e.useCDN===void 0?i().shouldUseCDN:e.useCDN;return Ce(ae(()=>_(t))?g(t):t,n??{},f,e.host?.getErrorHandler?.(),(e,t)=>{let n=new URL(e,`https://${r}`);return n.host=r,n.protocol=`https`,f(n.toString(),t)},i().getActiveToken,async()=>a(),{HTTPHost:r},e.host?.name,o,e.validateRequestSchema)}return te(t)?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,m(n,t[v])])):t},h=e=>{for(let n in e)t[n]=e[n]};return{...e.modules?m(e.modules):{},get auth(){let t=i();return t.getAuthHeaders=t.getAuthHeaders.bind(void 0,e.host),t},setHeaders:h,use:m,enableContext(e,t={elevated:!1}){e===`global`?globalThis.__wix_context__==null?t.elevated?globalThis.__wix_context__={elevatedClient:this}:globalThis.__wix_context__={client:this}:t.elevated?globalThis.__wix_context__.elevatedClient=this:globalThis.__wix_context__.client=this:t.elevated?p.elevatedClient=this:p.client=this},fetch:(t,n)=>{let r=e.host?.apiBaseUrl??`www.wixapis.com`,i=new URL(t,`https://${r}`);return i.host=r,i.protocol=`https`,f(i.toString(),n)},fetchWithAuth:s,async graphql(t,n,r={apiVersion:`alpha`}){let i=e?.host?.apiBaseUrl??`www.wixapis.com`,a=await f(`https://${i}/graphql/${r.apiVersion}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({query:t,variables:n})});if(a.status!==200)throw new b(`GraphQL request failed with status ${a.status}`,a);let{data:o,errors:s}=await a.json();return{data:o??{},errors:s}},webhooks:u,servicePlugins:c}}function E(e){return e.headers?.get(`X-Wix-Consistent`)??e.headers?.get(`x-wix-consistent`)}var We={_id:`id`,_createdDate:`createdDate`,_updatedDate:`updatedDate`},Ge={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function Ke(e,t){return e?.split(`.`).map(e=>t?.[e]??e).join(`.`)}var qe=`sort.fieldName`;function Je(e,t,n){return(e===qe||e.endsWith(`.${qe}`))&&typeof t==`string`?Ke(t,n):t}function Ye(e,t,n){let r=e=>n.includes(e),i=(e,n)=>{if(Array.isArray(e))e.forEach(e=>{i(e,n)});else if(typeof e==`object`&&e){let a=e;Object.keys(a).forEach(e=>{let o=n===``?e:`${n}.${e}`;if(r(o))return;let s=Xe(e,t);s!==e&&!(s in a)&&(a[s]=a[e],delete a[e]),a[s]=Je(o,a[s],t),i(a[s],o)})}};return i(e,``),e}function Xe(e,t){let n;return n=e.includes(`.`)?e.split(`.`).map(e=>t[e]??e).join(`.`):t[e]??e,n}function Ze(e,t=[]){return Ye(e,We,t)}function Qe(e,t=[]){return Ye(e,Ge,t)}function $e(e){return e?new Date(e):void 0}var et=new WeakMap;function tt(){return{leaves:void 0,fields:void 0,mapFields:void 0,anyField:void 0}}function nt(e,t){let n=e.get(t);return n||(n=tt(),e.set(t,n)),n}function rt(e,t){return t===`*`?(e.anyField??=tt(),e.anyField):t.endsWith(`{}`)?(e.mapFields??=new Map,nt(e.mapFields,t.slice(0,-2))):(e.fields??=new Map,nt(e.fields,t))}function it(e){let t=tt();for(let n of e){let e=n.path.split(`.`).reduce(rt,t);e.leaves??=[],e.leaves.push(n)}return t}function at(e){let t=et.get(e);return t||(t=it(e),et.set(e,t)),t}function D(e){return typeof e==`object`&&!!e}function ot(e,{isRepeated:t,isMap:n},r){return t?Array.isArray(e)?e.map(r):e:n?D(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r(t)])):e:r(e)}function O(e,t,n){D(e)&&lt(e,t,n)}function st(e,t,n){for(let[r,i]of t){if(!(r in e))continue;if(i.leaves)for(let t of i.leaves)e[r]=ot(e[r],t,n);let t=e[r];Array.isArray(t)?t.forEach(e=>O(e,i,n)):O(t,i,n)}}function ct(e,t,n){for(let[r,i]of t){let t=e[r];D(t)&&Object.values(t).forEach(e=>O(e,i,n))}}function lt(e,{fields:t,mapFields:n,anyField:r},i){t&&st(e,t,i),n&&ct(e,n,i),r&&Object.values(e).forEach(e=>O(e,r,i))}function ut(e,t){if(!D(e))return e;for(let{paths:n,transformFn:r}of t)lt(e,at(n),r);return e}function dt(e){return gt(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var ft=/([\p{Ll}\d])(\p{Lu})/gu,pt=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,mt=`$1\0$2`,ht=/[^\p{L}\d]+/giu;function gt(e){let t=e.trim();t=t.replace(ft,mt).replace(pt,mt),t=t.replace(ht,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}var _t=e=>`validationError`in(e.response?.data?.details??{}),vt=e=>`applicationError`in(e.response?.data?.details??{}),yt=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function bt(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(_t(e))return xt(e,t,n);if(vt(e))return St(e);if(yt(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:dt(n),data:{}},requestId:e.requestId};return k(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return Ct(e)}var xt=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=wt(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return k(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},k=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),St=e=>{let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i=e.response?.data?.details?.applicationError?.description??n,a=e.response?.data?.details?.applicationError?.code??dt(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return k(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},Ct=e=>k(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:dt(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),wt=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,i)=>{let a={...e,...t},o=Object.keys(a);return r?.filter(e=>!r.some(t=>t.field.length>e.field.length&&t.field.startsWith(e.field)&&o.includes(t.field))).map(e=>{let r=t[e.field];if(r)return{...e,field:Tt(r,i)};let s=o?.sort((e,t)=>t.length-e.length)?.find(t=>e.field.startsWith(t));if(s){let t=a[s];if(t)return{...e,field:e.field.replace(s,Tt(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},Tt=(e,t)=>{let n=Et(e);return n==null?e:e.replace(`$[${n}]`,t[n])},Et=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function Dt(){let e=typeof $wixContext<`u`&&$wixContext.initWixModules?$wixContext.initWixModules:globalThis.__wix_context__!==void 0&&globalThis.__wix_context__.initWixModules?globalThis.__wix_context__.initWixModules:void 0;if(e)return{initWixModules(t,n){return Ot(()=>e(t,n))},fetchWithAuth(){throw Error(`fetchWithAuth is not available in this context`)},graphql(){throw Error(`graphql is not available in this context`)}};let t=typeof $wixContext<`u`?$wixContext.client:p.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:p.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:p.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:p.elevatedClient;if(t||n)return{initWixModules(e,r){if(r){if(!n)throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);return Ot(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return Ot(()=>t.use(e))},fetchWithAuth:(e,n)=>{if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.fetchWithAuth(e,n)},getAuth(){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.auth},async graphql(e,n,r){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.graphql(e,n,r)}}}function Ot(e){let t=globalThis.__wix_context__,n={client:p.client,elevatedClient:p.elevatedClient},r;globalThis.__wix_context__=void 0,p.client=void 0,p.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,p.client=n.client,p.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function kt(e,t){return((...n)=>{let r=Dt();return r?r.initWixModules(e,t).apply(void 0,n):e.apply(void 0,n)})}function At(e,t=!1){return kt(e,t)}function jt(e){let t=Wt(Ht(e.host),e.domainToMappings);return $t(Xt(e.protoPath,e.data||{}),t)}var Mt=[`wix.com`,`editorx.com`],Nt=`_`,Pt=`*.`,Ft=RegExp(`\\.(${Mt.join(`|`)})$`),It=[`42.wixprod.net`,`uw2-edt-1.wixprod.net`,`virginia-edt.wixprod.net`],Lt={"payments.base44.com":`manage.wix.com`,"create.editorx.com":`editor.editorx.com`},Rt=`dev.wix-code.com`,zt=/{(.*)}/,Bt=RegExp(`\\.(${It.join(`|`)})$`),Vt=RegExp(`.*\\.${Rt}$`);function Ht(e){return Ut(e).replace(Ft,`._base_domain_`).replace(Bt,`._api_base_domain_`).replace(Vt,`*.dev.wix-code.com`)}function Ut(e){return Lt[e]??e}function Wt(e,t){let n=t[e];if(n)return n;let r=Gt(e,t)??Kt(e,t);if(!r){if(Jt(e)){let e=t[Yt];if(e)return e}let n=t[Nt];if(n)return n}return r??[]}function Gt(e,t){return Object.entries(t).find(([t])=>{let[,...n]=e.split(`.`);return n.join(`.`)===t})?.[1]}function Kt(e,t){let[n]=Object.entries(t).filter(([t])=>qt(e,t)).sort(([e],[t])=>t.length-e.length);if(!n)return;let[,r]=n;return r}function qt(e,t){if(!t.startsWith(Pt))return!1;let n=t.slice(1);return e.length>n.length&&e.endsWith(n)}function Jt(e){return!!e.match(/\._base_domain_$/)}var Yt=`www._base_domain_`;function Xt(e,t){return e.split(`/`).map(e=>Zt(e,t)).join(`/`)}function Zt(e,t){let n=e.match(zt)||[],r=n[1];return r?Qt(t,r,e,e.replace(n[0],``)):e}function Qt(e,t,n,r){let i=e;for(let e of t.split(`.`)){if(!i)return n;i=i[e]}return`${i}${r}`}function $t(e,t){let n=t?.find(t=>e.startsWith(t.destPath));return n?n.srcPath+e.slice(n.destPath.length):e}var A;(function(e){e.QUERY_PARAM=`QUERY_PARAM`,e.SUBDOMAIN=`SUBDOMAIN`,e.SUBDIRECTORY=`SUBDIRECTORY`})(A||={});var en={cs:`Čeština`,da:`Dansk`,de:`Deutsch`,en:`English`,es:`Español`,fr:`Français`,hi:`हिन्दी`,id:`Bahasa Indonesia`,it:`Italiano`,ja:`日本語`,ko:`한국어`,nl:`Nederlands`,no:`Norsk`,pl:`Polski`,pt:`Português`,ru:`Русский`,sv:`Svenska`,th:`ไทย`,tr:`Türkçe`,uk:`Українська`,vi:`Tiếng Việt`,zh:`繁體中文`,sq:`Shqip`,am:`አማርኛ`,ar:`العربية`,hy:`Հայերեն`,az:`Azərbaycan dili`,eu:`Euskara`,be:`Беларуская`,bn:`বাংলা`,bs:`Bosanski`,bg:`Български`,ca:`Català`,ny:`ChiCheŵa`,co:`Corsu`,hr:`Hrvatski`,et:`Eesti`,fj:`Vosa Vakaviti`,fi:`Suomi`,ga:`Gaeilge`,gl:`Galego`,ka:`ქართული`,el:`Ελληνικά`,gu:`ગુજરાતી`,ht:`Kreyòl Ayisyen`,ha:`Hausa`,he:`עברית`,hu:`Magyar`,is:`Íslenska`,ig:`Igbo`,kn:`ಕನ್ನಡ`,kk:`Қазақ тілі`,km:`ភាសាខ្មែរ`,ku:`Kurdî`,ky:`Кыргызча`,lb:`Lëtzebuergesch`,lo:`ລາວ`,la:`Latina`,lv:`Latviešu`,lt:`Lietuvių`,mk:`Македонски`,mg:`Malagasy`,ms:`Bahasa Melayu`,ml:`മലയാളം`,mt:`Malti`,mn:`Монгол`,ne:`नेपाली`,ps:`پښتو`,fa:`فارسی`,ro:`Română`,sm:`Gagana Samoa`,sr:`Српски`,sn:`Shona`,sd:`سنڌي`,si:`සිංහල`,sk:`Slovenčina`,sl:`Slovenščina`,so:`Soomaaliga`,su:`Basa Sunda`,sw:`Kiswahili`,tl:`Filipino`,tg:`Тоҷикӣ`,ta:`தமிழ்`,te:`తెలుగు`,tk:`Türkmen`,ur:`اردو`,uz:`O'zbek`,cy:`Cymraeg`,xh:`isiXhosa`,yi:`ייִדיש`,yo:`Yorùbá`,zu:`isiZulu`,kl:`Kalaallisut`,fo:`Føroyskt`,ln:`Lingála`,mi:`Māori`,mr:`मराठी`,my:`မြန်မာ`,se:`Sámegiella`,ug:`ئۇيغۇرچە`,qu:`Runa Simi`,aa:`Afar`,ab:`Аҧсуа`,ae:`Avestan`,ak:`Akan`,an:`Aragonés`,as:`অসমীয়া`,av:`Авар`,ay:`Aymar aru`,ba:`Башҡортса`,bh:`भोजपुरी`,bi:`Bislama`,bm:`Bamanankan`,bo:`བོད་སྐད་`,br:`Brezhoneg`,ce:`Нохчийн`,ch:`Chamoru`,cr:`ᓀᐦᐃᔭᐍᐏᐣ`,cu:`Црькъвьнословѣньскъ`,cv:`Чӑвашла`,dv:`ދިވެހިބަސް`,dz:`རྫོང་ཁ`,ee:`Eʋegbe`,eo:`Esperanto`,ff:`Fulah`,fy:`Frysk`,gd:`Gàidhlig`,gn:`Avañe'ẽ`,gv:`Gaelg`,ho:`Hiri Motu`,hz:`Otjiherero`,ia:`Interlingua`,ie:`Interlingue`,ii:`ꆈꌠꉙ`,ik:`Iñupiaq`,io:`Ido`,iu:`ᐃᓄᒃᑎᑐᑦ`,jv:`Basa Jawa`,ki:`Gikuyu`,kr:`Kanuri`,ks:`کٲشُر`,kw:`Kernewek`,lg:`Luganda`,li:`Limburgs`,lu:`Tshiluba`,mh:`Kajin M̧ajeļ`,na:`Dorerin Naoero`,nb:`Norsk Bokmål`,nd:`isiNdebele`,ng:`Oshiwambo`,nn:`Norsk Nynorsk`,nr:`isiNdebele (South)`,nv:`Diné Bizaad`,oc:`Occitan`,oj:`Anishinaabemowin`,om:`Afaan Oromoo`,or:`ଓଡ଼ିଆ`,os:`Ирон`,pa:`ਪੰਜਾਬੀ`,pi:`𑀅𑀯𑀢`,rm:`Rumantsch`,rn:`Ikirundi`,rw:`Kinyarwanda`,sa:`संस्कृतम्`,sc:`Sardu`,sg:`Sängö`,ss:`SiSwati`,st:`Sesotho`,ti:`ትግርኛ`,tn:`Setswana`,to:`Faka Tonga`,ts:`Xitsonga`,tt:`Татарча`,tw:`Twi`,ty:`Reo Tahiti`,ve:`Tshivenḓa`,vo:`Volapük`,wa:`Walon`,wo:`Wolof`,za:`Saɯ cueŋƅ`},tn=(e,t)=>{e.searchParams.set(`lang`,t)},nn=(e,t)=>{let n=e.hostname.split(`.`);n[0]===`www`&&(n=n.slice(1)),n=[t,...n],e.hostname=n.join(`.`)},rn=(e,t)=>{e.pathname=`/${t}${e.pathname}`},an=(e,t)=>{if(!t.languageCode||!t?.resolutionMethod)return e;let n=new URL(e);return(t?.resolutionMethod===`QUERY_PARAM`?tn:t?.resolutionMethod===`SUBDOMAIN`?nn:rn)(n,t.languageCode),n.href},on=(e,t)=>{if(!e?.length)return e;let n;try{n=new URL(e)}catch{return e}n.searchParams.delete(`lang`);let r=n.pathname.split(`/`)[1]?.toLowerCase();if(t.includes(r??``)){let e=n.pathname.split(`/`);e.splice(1,1),n.pathname=e.join(`/`)}let i=n.hostname.split(`.`)[0]?.toLowerCase();if(t.includes(i??``)){let e=n.hostname.split(`.`);e.shift(),n.hostname=e.join(`.`)}return n.href};function sn(){let e=cn();return e?ln(e):[]}function cn(){let e=typeof globals<`u`?globals?.$ns?.[`wix-window`]?.multilingual:void 0,t=typeof window<`u`?window?.essentials?.multilingual:void 0;return e??t??globalThis?.__wix_site_metadata__?.multilingual}function ln(e){try{if(e?.supportedLanguages?.length){let t=e.supportedLanguages,n=t.map(e=>e.languageCode).filter(Boolean),r=e.cleanUrl??pn(n);return t.map(e=>({id:e.languageCode,displayName:un(e),regionalFormat:[e.locale?.languageCode,e.locale?.country].filter(Boolean).join(`-`),url:dn(e,r),primary:e.isPrimary,resolutionMethod:e.resolutionMethod}))}if(e?.siteLanguages?.length){let t=e.siteLanguages,n=pn(t.map(e=>e.languageCode).filter(Boolean));return t.map(e=>({id:e.languageCode,displayName:un(e),regionalFormat:e.locale,url:dn(e,n),primary:e.isPrimaryLanguage,resolutionMethod:e.resolutionMethod?fn(e.resolutionMethod):void 0}))}}catch(e){return console.warn(`[Multilingual Manager] listSupportedLanguages failed`,e),[]}return console.warn(`[Multilingual Manager] listSupportedLanguages is not available`),[]}function un(e){let t=en[e.languageCode];if(t)return t;let n=e.name??e.countryCode;if(n)return n}function dn(e,t){if(e.url||!t||!e.resolutionMethod)return e.url;if(e.languageCode)try{return an(t,{languageCode:e.languageCode,countryCode:e.countryCode,resolutionMethod:fn(e.resolutionMethod),locale:{languageCode:e.languageCode,country:e.countryCode}})}catch(e){console.warn(`[Multilingual Manager] buildUrlForLanguage failed`,e);return}}function fn(e){switch(e){case`QUERY_PARAM`:case`QueryParam`:return A.QUERY_PARAM;case`SUBDOMAIN`:case`Subdomain`:return A.SUBDOMAIN;case`SUBDIRECTORY`:case`Subdirectory`:return A.SUBDIRECTORY;default:return}}function pn(e){let t=typeof window<`u`&&window.location?.href?window.location.href:``;try{return on(t,e)}catch(e){return console.warn(`[Multilingual Manager] cleanCurrentUrl failed`,e),t}}var mn=`x-wix-linguist`,hn=`00000000-0000-0000-0000-000000000000`,gn=`false`,_n=()=>{let e=j(`language`),t=j(`locale`);if(e)return{[mn]:[e,t||e,gn,hn].join(`|`)}};function vn(){let e=null,t=null;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var yn=()=>(typeof window<`u`?window.commonConfig:void 0)??globalThis.commonConfig,j=e=>yn()?.[e],bn=({createHost:e})=>({__type:`host`,create:e=>({}),host:t=>{let{applicationId:n,componentId:r}=t??{},i=typeof window<`u`?window.wixEmbedsAPI:void 0,a=e(t),o=Sn();return{...a,apiBaseUrl:o,getMonitoringClient:i?.getMonitoringClientFunction?.(n,r),essentials:{language:j(`language`),locale:j(`locale`),get passThroughHeaders(){return _n()}}}},auth:e=>{let t=typeof window<`u`?window.wixEmbedsAPI:void 0;!e&&xn()&&(e=t?.getAccessTokenFunction?.());let n=!1,{resolve:r,promise:i}=vn();return{getAuthHeaders:async()=>{if(!e&&n&&(e=await i),!e)throw Error(`Failed to resolve auth token`);return{headers:{Authorization:await e()}}},getAccessTokenInjector:()=>(n=!0,e=>{r(e)})}}});function xn(){return typeof document<`u`&&document.currentScript?.tagName===`SCRIPT`}function Sn(){let e=(typeof window<`u`?window.wixEmbedsAPI:void 0)?.getExternalBaseUrl?.();if(!e)return;let t=new URL(e);return t?.pathname&&t.pathname!==`/`?`${t.hostname}${t.pathname}`:t.hostname}var Cn=({clientSdk:e,applicationId:t})=>({invoke:async({namespace:n,method:r,args:i})=>{if(!e)throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);return e.invoke({namespace:n,method:r,args:i,applicationId:t,accessToken:`accessToken`})},getAccessToken:()=>{throw Error(`Not implemented`)},observeState:()=>({disconnect:()=>{}})}),wn=bn({createHost:function(e){let t=(typeof $wixContext<`u`?$wixContext.clientSdk:void 0)??e?.clientSdk??(typeof window<`u`?window?.clientSdk:void 0),{applicationId:n}=e||{};if(!n)throw Error(`"createHost" was called without a required field "applicationId"`);return{channel:Cn({clientSdk:t,applicationId:n}),close:()=>{}}}}),Tn=(e,t)=>{let n=wn.host({applicationId:e,componentId:t}),r=wn.auth();return Ue({auth:r,host:n}).enableContext(`module`),r.getAccessTokenInjector()},En=e=>Tn(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`,e);function M(e,t){for(let n of e){let e=n.addOns.find(e=>e.addOnId===t);if(e)return{group:n,addOn:e}}return null}function Dn(e,t){return M(e,t)?.addOn??null}function N(e,t){return t.filter(t=>M(e,t.id)!==null)}function On(e,t,n){return n.filter(n=>M(e,n.id)?.group===t).length}function kn(e,t){return!e.maxNumberOfAddOns||t<e.maxNumberOfAddOns}function An(e,t){return e.map(n=>{let r=On(e,n,t);return{...n,addOns:n.addOns.map(e=>{let n=t.find(t=>t.id===e.addOnId)?.quantity??0;return{...e,isSelected:n>0,selectedQuantity:n}}),selectedCount:r,canSelectMore:kn(n,r)}})}function jn(e,t,n){let r=M(e,n);return r?t.some(e=>e.id===n)?!0:kn(r.group,On(e,r.group,t)):!1}function Mn(e,t){let n=e.maxQuantity??1;return Number.isFinite(t)?Math.min(Math.max(Math.trunc(t),0),n):0}var Nn={category:`category`,location:`location`,page:`page`,blob:`b`,resource:`resource`,referral:`referral`,timezone:`timezone`,bookingId:`bookingId`,token:`token`,rescheduleRedirectUrl:`rescheduleRedirectUrl`};function P(e){return e.addOns??[]}function Pn(e,t){let n={...e};return t.length?n.addOns=t:delete n.addOns,n}function Fn(e,t){let n=P(e);return Pn(e,n.some(e=>e.id===t)?n.filter(e=>e.id!==t):[...n,{id:t,quantity:1}])}function In(e,t,n){let r=P(e);return n<=0?Pn(e,r.filter(e=>e.id!==t)):Pn(e,r.some(e=>e.id===t)?r.map(e=>e.id===t?{...e,quantity:n}:e):[...r,{id:t,quantity:n}])}function Ln(){let e=typeof $wixContext<`u`&&$wixContext.initWixModules?$wixContext.initWixModules:globalThis.__wix_context__!==void 0&&globalThis.__wix_context__.initWixModules?globalThis.__wix_context__.initWixModules:void 0;if(e)return{initWixModules(t,n){return Rn(()=>e(t,n))},fetchWithAuth(){throw Error(`fetchWithAuth is not available in this context`)},graphql(){throw Error(`graphql is not available in this context`)}};let t=typeof $wixContext<`u`?$wixContext.client:p.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:p.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:p.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:p.elevatedClient;if(t||n)return{initWixModules(e,r){if(r){if(!n)throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);return Rn(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return Rn(()=>t.use(e))},fetchWithAuth:(e,n)=>{if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.fetchWithAuth(e,n)},getAuth(){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.auth},async graphql(e,n,r){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.graphql(e,n,r)}}}function Rn(e){let t=globalThis.__wix_context__,n={client:p.client,elevatedClient:p.elevatedClient},r;globalThis.__wix_context__=void 0,p.client=void 0,p.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,p.client=n.client,p.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function zn(e,t){return{...e,...Object.fromEntries(t.map(t=>[t,(...n)=>{let r=Ln();if(!r)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return r.initWixModules(e)[t].apply(void 0,n)}]))}}function Bn(e){return zn({__type:`host`,create:t=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:r(t)}),{})},Object.keys(e))}var F=e=>typeof e==`string`,I=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Vn=e=>e==null?``:``+e,Hn=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},Un=/###/g,Wn=e=>e&&e.indexOf(`###`)>-1?e.replace(Un,`.`):e,Gn=e=>!e||F(e),L=(e,t,n)=>{let r=F(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(Gn(e))return{};let t=Wn(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Gn(e)?{}:{obj:e,k:Wn(r[i])}},Kn=(e,t,n)=>{let{obj:r,k:i}=L(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=L(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=L(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},qn=(e,t,n,r)=>{let{obj:i,k:a}=L(e,t,Object);i[a]=i[a]||[],i[a].push(n)},R=(e,t)=>{let{obj:n,k:r}=L(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Jn=(e,t,n)=>{let r=R(e,n);return r===void 0?R(t,n):r},Yn=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?F(e[r])||e[r]instanceof String||F(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Yn(e[r],t[r],n):e[r]=t[r]);return e},z=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Xn={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},Zn=e=>F(e)?e.replace(/[&<>"'\/]/g,e=>Xn[e]):e,Qn=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},$n=[` `,`,`,`?`,`!`,`;`],er=new Qn(20),tr=(e,t,n)=>{t||=``,n||=``;let r=$n.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=er.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},B=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},V=e=>e?.replace(/_/g,`-`),nr={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},H=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||nr,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(F(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},U=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}},rr=class extends U{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,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 t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):F(n)&&i?o.push(...n.split(i)):o.push(n)));let s=R(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!F(n)?s:B(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),Kn(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(F(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=R(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Yn(s,n,i):s={...s,...n},Kn(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},ir={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},ar=Symbol(`i18next/PATH_KEY`);function or(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===ar?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function W(e,t){let{[ar]:n}=e(or()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var sr={},cr=e=>!F(e)&&typeof e!=`boolean`&&typeof e!=`number`,lr=class e extends U{constructor(e,t={}){super(),Hn([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=H.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=cr(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!tr(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:F(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:F(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=W(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?W(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!F(i.count),x=e.hasDefaultValue(i),ee=b?this.pluralResolver.getSuffix(d,i.count,i):``,te=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,ne=b&&!i.ordinal&&i.count===0,S=ne&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${ee}`]||i[`defaultValue${te}`]||i.defaultValue,C=m;y&&!m&&x&&(C=S);let re=cr(C),ie=Object.prototype.toString.apply(C);if(y&&C&&re&&_.indexOf(ie)<0&&!(F(v)&&Array.isArray(C))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,C,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(C),t=e?[]:{},n=e?g:h;for(let e in C)if(Object.prototype.hasOwnProperty.call(C,e)){let r=`${n}${o}${e}`;t[e]=x&&!m?this.translate(r,{...i,defaultValue:cr(S)?S[e]:void 0,joinArrays:!1,ns:c}):this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=C[e])}m=t}}else if(y&&F(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=S),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&S!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?S:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.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 e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);ne&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||S)})}):n(e,s,S))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=F(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!F(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=F(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=ir.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return F(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?W(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!F(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(F(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!sr[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(sr[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!F(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},ur=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=H.create(`languageUtils`)}getScriptPartFromCode(e){if(e=V(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=V(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(F(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}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 t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),F(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return F(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):F(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},dr={zero:0,one:1,two:2,few:3,many:4,other:5},fr={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},pr=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=H.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=V(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),fr;if(!e.match(/-|_/))return fr;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>dr[e]-dr[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},mr=(e,t,n,r=`.`,i=!0)=>{let a=Jn(e,t,n);return!a&&i&&F(n)&&(a=B(e,n,r),a===void 0&&(a=B(t,n,r))),a},hr=e=>e.replace(/\$/g,`$$$$`),gr=class{constructor(e={}){this.logger=H.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Zn:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?z(i):a||`{{`,this.suffix=o?z(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?z(d):f||z(`$t(`),this.nestingSuffix=p?z(p):m||z(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=mr(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(mr(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>hr(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?hr(this.escape(e)):hr(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0){if(typeof l==`function`){let t=l(e,i,r);a=F(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``}else!F(a)&&!this.useRawValueToEscape&&(a=Vn(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${z(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!F(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!F(i))return i;F(i)||(i=Vn(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},_r=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},vr=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(V(r),i),t[o]=s),s(n)}},yr=e=>(t,n,r)=>e(V(n),r)(t),br=class{constructor(e={}){this.logger=H.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?vr:yr;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=vr(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=_r(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}},xr=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Sr=class extends U{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=H.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{qn(n.loaded,[i],a),xr(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();F(e)&&(e=this.languageUtils.toResolveHierarchy(e)),F(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" 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?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}},Cr=()=>({debug:!1,initAsync:!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:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),F(e[1])&&(t.defaultValue=e[1]),F(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),wr=e=>(F(e.ns)&&(e.ns=[e.ns]),F(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),F(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),G=()=>{},Tr=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},Er=`__i18next_supportNoticeShown`,Dr=()=>!!(typeof globalThis<`u`&&globalThis[Er]||typeof process<`u`&&{}.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`),Or=()=>{typeof globalThis<`u`&&(globalThis[Er]=!0)},kr=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),K=class e extends U{constructor(e={},t){if(super(),this.options=wr(e),this.services={},this.logger=H,this.modules={external:[]},Tr(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(F(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=Cr();this.options={...n,...this.options,...wr(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!kr(this)&&!Dr()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),Or());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?H.init(r(this.modules.logger),this.options):H.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:br;let t=new ur(this.options);this.store=new rr(this.options.resources,this.options);let i=this.services;i.logger=H,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new pr(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new gr(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Sr(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new lr(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=G,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[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(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=I(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,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),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=G){let n=t,r=F(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=I();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=G,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw 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`&&ir.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 e=0;e<this.languages.length;e++){let t=this.languages[e];if(!([`cimode`,`dev`].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=I();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=F(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(F(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};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),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=W(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=W(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=W(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return F(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){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=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=I();return this.options.ns?(F(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=I();F(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`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`.split(`.`),n=this.services?.languageUtils||new ur(Cr());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=G){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new rr(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...Cr().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new gr(n)}return a.translator=new lr(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();K.createInstance,K.dir,K.init,K.loadResources,K.reloadResources,K.use,K.changeLanguage,K.getFixedT,K.t,K.exists,K.setDefaultNamespace,K.hasLoadedNamespace,K.loadNamespaces,K.loadLanguages;var Ar=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,jr={"&amp;":`&`,"&#38;":`&`,"&lt;":`<`,"&#60;":`<`,"&gt;":`>`,"&#62;":`>`,"&apos;":`'`,"&#39;":`'`,"&quot;":`"`,"&#34;":`"`,"&nbsp;":` `,"&#160;":` `,"&copy;":`©`,"&#169;":`©`,"&reg;":`®`,"&#174;":`®`,"&hellip;":`…`,"&#8230;":`…`,"&#x2F;":`/`,"&#47;":`/`},Mr=e=>jr[e],Nr={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(Ar,Mr),transDefaultProps:void 0},Pr=(e={})=>{Nr={...Nr,...e}},Fr={type:`3rdParty`,init(e){Pr(e.options.react)}},q=new Map,Ir=500,J;function Lr(){if(J===void 0)try{J=new Intl.NumberFormat(`en-US`,{useGrouping:!1,maximumFractionDigits:0}).format(`9007199254740993`)===`9007199254740993`}catch{J=!1}return J}var Rr=15;function zr(e){if(!(typeof e!=`string`||Lr())&&e.replace(/[^0-9]/g,``).replace(/^0+/,``).length>Rr)throw Error(`Cannot format the amount '${e}' exactly: this runtime's Intl implementation predates ES2023 string support and would lose precision. Use a runtime with ES2023 Intl support (for example Node 20+), or pass a value within 15 significant digits.`)}function Br(e,t,n){return`${e}|${t}|${Object.entries(n).filter(([,e])=>e!==void 0).sort(([e],[t])=>e<t?-1:1).map(([e,t])=>`${e}=${String(t)}`).join(`&`)}`}function Vr(e,t,n){let r=Br(e,t,n),i=q.get(r);return i||(i=new Intl.NumberFormat(e,{...n,style:`currency`,currency:t}),q.size>=Ir&&q.clear(),q.set(r,i)),i}function Hr(e,{value:t,currency:n},r={}){return zr(t),Vr(e,n,r).format(t)}function Ur(e,{value:t,currency:n},r={}){return zr(t),Vr(e,n,r).formatToParts(t)}function Wr(e){return sn().find(e=>e.primary)?.id??e}function Gr(e,t){let{locale:n,...r}=t??{},i=n??e.essentials?.locale;if(!i)throw Error(`Host locale is not available on the current host. Make sure to use an updated version of the host initialization package.`);return{locale:i,formatOptions:r}}var Kr=Bn({getLanguage:e=>()=>{let t=e.essentials?.language;if(!t)throw Error(`Host language is not available on the current host. Make sure to use an updated version of the host initialization package.`);return t},getLocale:e=>()=>{let t=e.essentials?.locale;if(!t)throw Error(`Host locale is not available on the current host. Make sure to use an updated version of the host initialization package.`);return t},formatCurrency:e=>(t,n)=>{let{locale:r,formatOptions:i}=Gr(e,n);return Hr(r,t,i)},formatCurrencyToParts:e=>(t,n)=>{let{locale:r,formatOptions:i}=Gr(e,n);return Ur(r,t,i)},getTranslationFunction:e=>()=>{let t=e.translations?.();if(!t)throw Error(`Host translation resources are not available.`);let n=K.createInstance(),r=Wr(e.essentials?.language)||`en`,i={lng:e.essentials?.language||r,fallbackLng:r,resources:t};return n.use(Fr).init(i,e=>{if(e)throw e}),n.t.bind(n)}}),qr=class{constructor(e){this.message=e,this.captureException=()=>{console.error(this.message)},this.captureMessage=()=>{console.error(this.message)},this.startSpan=(e,t)=>(console.error(this.message),t(void 0)),this.startSpanManual=()=>(console.error(this.message),{end:()=>{},fail:()=>{}}),this.endSpanManual=()=>{console.error(this.message)},this.addBreadcrumb=()=>{console.error(this.message)}}},Jr=e=>new qr(e),Yr=Bn({getMonitoringClient:e=>()=>e.getMonitoringClient?e.getMonitoringClient():Jr(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`)}),Y={service:`service`,services:`services`,categories:`categories`,locations:`locations`,sessions:`sessions`,timeSlots:`time-slots`,serviceAddOns:`service-addons`,bookingsSettings:`bookings-settings`,serviceCta:`service-cta`,preferences:`preferences`,bookingSummary:`booking-summary`,bookingCheckout:`booking-checkout`,formValues:`form-values`,paymentOptions:`payment-options`,seo:`seo`,warmup:`warmup`,reschedule:`reschedule`};function Xr(e){try{let t=Yr.getMonitoringClient?.();return t&&typeof t[e]==`function`?t:null}catch{return null}}function Zr(e,{feature:t,action:n,level:r=`error`,contexts:i}){let a=Xr(`captureException`);if(!a)return;let o=e instanceof Error?e:Error(String(e));a.captureException(o,{level:r,tags:{feature:t,action:n},...i?{contexts:i}:{}})}function Qr(e,{feature:t,tags:n},r){let i=Xr(`startSpanManual`);if(!i)return r;let a=i.startSpanManual({name:e,tags:{feature:t,...n}});return r.then(()=>a.end(),e=>a.fail(e)),r}var $r=class extends e{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){Zr(e,{feature:this.props.feature??`service`,action:`render`,contexts:{react:{componentStack:t.componentStack}}})}render(){return this.state.hasError?this.props.fallback:this.props.children}};function ei(e){let t=e;if(t.__state||(t.__state={status:`pending`},t.then(e=>{t.__state={status:`fulfilled`,value:e}},e=>{t.__state={status:`rejected`,reason:e}})),t.__state.status===`fulfilled`)return t.__state.value;throw t.__state.status===`rejected`?t.__state.reason:t}function X(e){let t=Promise.resolve(e);return t.__state={status:`fulfilled`,value:e},t}var ti=new WeakMap;function ni(e,t,n){let r=ti.get(e);r||(r=new WeakMap,ti.set(e,r));let i=r.get(t);i||(i=new WeakMap,r.set(t,i));let a=i.get(n);if(!a){let r=e;a=r.__state?.status===`fulfilled`?X(t(r.__state.value)):r.__state?.status===`rejected`?X(n(r.__state.reason)):e.then(t,n),i.set(n,a)}return a}function Z(e){return e}var ri=Z(`@wix/site-service-warmup-data`);function ii(){try{return u()}catch{return null}}function ai(e){try{return e?e(ri):null}catch{return null}}function oi(){let e=ai(ii()),t=typeof window>`u`;return{scope:e??void 0,get:async n=>{if(t||!e)return null;try{return await e.get(n)}catch(e){return Zr(e,{feature:Y.warmup,action:`read`,level:`warning`,contexts:{warmup:{key:n}}}),null}},set:(n,r)=>{if(t&&e)try{e.set(n,r)}catch{}}}}var si=Z(`@wix/site-service-locale`),ci=Z,li=ci(`@wix/viewer-service-multilingual`);function ui(){try{return Kr.getLanguage()??`en`}catch{return`en`}}function di(e){try{return d(e)}catch{return null}}function fi(){let e=di(si),t=di(li);return t?.multilingualEnabled&&t.currentLocale?.languageCode||e?.language||ui()}var pi=[],mi=[],hi=`useServiceAddOnsContext must be used within ServiceAddOnsContextProvider`;function gi({isLoading:e,hasError:t,children:n}){let r={addOnGroups:pi,selected:mi,isLoading:e,hasError:t,toggleAddOn:()=>{},setAddOnQuantity:()=>{}};return f($.Provider,{value:r,children:n})}function _i({children:e}){return f(gi,{isLoading:!0,hasError:!1,children:e})}function vi({children:e}){return f(gi,{isLoading:!1,hasError:!0,children:e})}function yi(e){if(!e)return;let t=``;return(e.filename||e.altText)&&(t=`/${encodeURIComponent(e.filename||e.altText)}`),e.id?`wix:image://v1/${e.id}${t}#originWidth=${e.width}&originHeight=${e.height}`:e.url}var bi=[{path:`addOnGroupsDetails.addOns.mainMedia.image.urlExpirationDate`}];function xi(e){return jt(Object.assign(e,{domainToMappings:{"*.dev.wix-code.com":[{srcPath:`/_api/services-2`,destPath:``},{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"www.wixapis.com":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`},{srcPath:`/bookings/services/v2/bulk/services`,destPath:`/v2/bulk/services`}],"manage._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/_api/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`}],"editor._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/_api/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`}],"blocks._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/_api/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`}],"create.editorx":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/_api/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`}],_:[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"www._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"bo._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"wixbo.ai":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"wix-bo.com":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"editor.wixapps.net":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"api._api_base_domain_":[{srcPath:`/services-2`,destPath:``}]}}))}var Si=`@wix/auto_sdk_bookings_services`;function Ci(e){function t({host:t}){return{entityFqdn:`wix.bookings.services.v2.service`,method:`POST`,methodFqn:`wix.bookings.services.v2.AddOnGroupsService.ListAddOnGroupsByServiceId`,packageName:Si,migrationOptions:{optInTransformResponse:!0},url:xi({protoPath:`/v2/services/add-on-groups/list-add-on-groups-by-service-id`,data:e,host:t}),data:e,transformResponse:e=>ut(e,[{transformFn:$e,paths:bi}])}}return t}var wi=[{path:`addOnGroupsDetails.addOns.mainMedia.image`}];async function Ti(e,t){let{httpClient:n,sideEffects:r}=arguments[2],i=Ci(Ze({serviceId:e,groupIds:t?.groupIds}));r?.onSiteCall?.();try{let e=await n.request(i);return r?.onSuccess?.(e),Qe(ut(e.data,[{transformFn:yi,paths:wi}]))}catch(e){let t=bt(e,{spreadPathsToArguments:{},explicitPathsToArguments:{serviceId:`$[0]`,groupIds:`$[1].groupIds`},singleArgumentUnchanged:!1},[`serviceId`,`options`]);throw r?.onError?.(e),t}}function Ei(e){return(t,n)=>Ti(t,n,{httpClient:e})}var Di=At(Ei);function Oi(e,t){let n=e?.value,r=e?.currency;if(n==null||!r)return null;let i=Number(n);if(!Number.isFinite(i))return null;let a=i%1==0?0:2;return new Intl.NumberFormat(t,{style:`currency`,currency:r,currencyDisplay:`symbol`,maximumFractionDigits:a,minimumFractionDigits:a}).format(i).replace(/\p{Zs}/gu,`\xA0`)}async function ki(e){return(await Di(e)).addOnGroupsDetails??[]}function Ai(e,t){let n=e.price?.value==null?null:Number(e.price.value);return{addOnId:e.addOnId??null,addOnName:e.nameTranslated??e.name??null,addOnPrice:Oi(e.price,t),addOnPriceValue:n!=null&&Number.isFinite(n)?n:null,addOnCurrency:e.price?.currency??null,durationInMinutes:e.durationInMinutes??null,maxQuantity:e.maxQuantity??null,isSelected:!1,selectedQuantity:0}}function ji(e,t){return e.map(e=>({groupId:e.groupId??null,groupName:e.groupNameTranslated??e.groupName??null,prompt:e.promptTranslated??e.prompt??null,maxNumberOfAddOns:e.maxNumberOfAddOns??null,addOns:(e.addOns??[]).map(e=>Ai(e,t)),selectedCount:0,canSelectMore:!0}))}var Mi=`bookings-uou`;function Ni(e,t,n){return`${Mi}:${e}:addons:${t}:${n}`}var Pi=5e3,Fi=100,Ii=`wix-warmup-data`,Li=null;function Ri(e){if(typeof document<`u`)try{let t=document.getElementById(Ii)?.textContent;return t?(Li?.text!==t&&(Li={text:t,data:JSON.parse(t).builderComponentsWarmupData??{}}),Li.data[e]??void 0):void 0}catch{return}}var zi=()=>({promises:new Map,invalidatedWarmup:new Set}),Bi=zi(),Vi=new WeakMap,Hi=new WeakMap;function Ui(e){if(!e)return Bi;let t=Vi.get(e);return t||(t=zi(),Vi.set(e,t)),t}function Wi({key:e,warmupData:t,fetchData:n,refresh:r=!1}){if(e===null)return n();if(typeof window>`u`){let r=()=>n().then(n=>(t.set(e,n),n)),{scope:i}=t;if(!i)return r();let a=Hi.get(i);a||(a=new Map,Hi.set(i,a));let o=a.get(e);if(o)return o;let s=r();return a.set(e,s),s.catch(()=>a.delete(e)),s}let i=Ui(t.scope),a=Date.now();for(let[e,t]of i.promises)t.expiresAt<=a&&i.promises.delete(e);let o=i.promises.get(e);if(o&&!r)return o.promise;r&&i.invalidatedWarmup.add(e);let s=!i.invalidatedWarmup.has(e);if(s){let t=Ri(e);if(t!==void 0){let n=X(t);return i.promises.set(e,{promise:n,expiresAt:a+Pi}),n}}let c=(async()=>{if(s){let n=await t.get(e);if(n!=null)return n}return n()})();i.promises.size>=Fi&&i.promises.delete(i.promises.keys().next().value);let l={promise:c,expiresAt:1/0};return i.promises.set(e,l),c.then(()=>{l.expiresAt=Date.now()+Pi},()=>{i.promises.get(e)===l&&i.promises.delete(e)}),c}function Gi(e,t){return Qr(`service-addons-context-load`,{feature:Y.serviceAddOns,tags:{serviceId:e}},ki(e)).then(e=>ji(e,t),t=>{throw Zr(t,{feature:Y.serviceAddOns,action:`fetch-add-on-groups`,level:`warning`,contexts:{service:{serviceId:e}}}),t})}function Ki({serviceId:e,locale:t,language:n,warmupData:r}){return Wi({key:Ni(n,e,t),warmupData:r,fetchData:()=>Gi(e,t)})}var qi=ci(`@wix/site-service-business-logger`);function Ji(e){return{evid:32,src:16,endpoint:``,params:e}}var Yi=Z(`@wix/site-service-url`),Xi=`appSectionParams`;function Zi(e){let t=e.searchParams.get(Xi);if(t===null)return e;let n=new URL(e);n.searchParams.delete(Xi);for(let[e,r]of Object.entries(Qi(t)))typeof r==`string`&&!n.searchParams.has(e)&&n.searchParams.set(e,r);return n}function Qi(e){try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}var Q=`bookings-uou:url-change`,$i=e=>{let t=new URL(e);return t.searchParams.sort(),t.href};function ea(e,{disableScrollToTop:t,skipHistory:n}={}){let r=globalThis.window;if(!r?.history)return;let i=new URL(r.location.href);if($i(i)===$i(e))return;let a={scrollY:r.scrollY};if(n)r.history.replaceState(a,``,e.href);else{r.history.replaceState(a,``,i.href);try{r.history.pushState(t?a:null,``,e.href)}catch{return}}r.dispatchEvent(new Event(Q))}function ta(e){let t=globalThis.window;return t?(t.addEventListener(Q,e),t.addEventListener(`popstate`,e),()=>{t.removeEventListener(Q,e),t.removeEventListener(`popstate`,e)}):()=>{}}var na=e=>{try{return decodeURIComponent(e)}catch{return e}};function ra(e,t){let n=t?new URL(t).pathname:`/`;return`./${na(new URL(e).pathname.replace(n,``).replace(/^\/|\/$/g,``))}`}function ia(){let e=d(Yi),t=r(()=>e.currentUrl,[e]),n=c(ta,t,t),i=o(()=>Zi(new URL(n)),[n]),a=e.siteUrl.replace(/\/$/,``);return{pathname:i.pathname,search:i.search,searchParams:i.searchParams,href:i.href,getParsedUrl:()=>Zi(new URL(e.currentUrl)),getRelativeUrl:()=>ra(e.currentUrl,a),getExternalBaseUrl:()=>a,pushUrl:ea}}var aa=function(e){return e.BOOK_ONLINE=`bookingsBookOnline`,e.SERVICE_PAGE=`bookingsServicePage`,e.CALENDAR_PAGE=`bookingsCalendar`,e.FORM_PAGE=`bookingsForm`,e}({}),oa={SERVICES:`services_context`,SERVICE:`service_context`,TIME_SLOTS:`time_slots_context`,BOOKING_CHECKOUT:`booking_checkout_context`,CATEGORIES:`categories_context`,LOCATIONS:`locations_context`,SERVICE_ADD_ONS:`service_addons_context`,PREFERENCES:`preferences_context`};aa.BOOK_ONLINE;var sa=`new_bookings_server`,ca=e=>{let{reportBi:t}=d(qi);return r(n=>{t({widget_name:e,bookingsPlatform:sa,is_over_editor:!1,...n.params,src:n.src,evid:n.evid},{endpoint:n.endpoint})},[t,e])},la=(e,t=!0)=>{let n=ca(e),{getParsedUrl:r}=ia(),i=s(!1);a(()=>{t&&!i.current&&(i.current=!0,n(Ji({referralInfo:r().searchParams.get(Nn.referral)??void 0})))},[t,n,r])},ua=X({addOnGroups:pi,hasError:!1}),da=e=>({addOnGroups:e,hasError:!1}),fa=()=>({addOnGroups:pi,hasError:!0}),$=n(null);function pa(){let e=i($);if(!e)throw Error(hi);return e}function ma({addOnsPromise:e,isLoading:t,pickedAddOns:n,forwardToggleAddOn:i,forwardSetAddOnQuantity:a,children:c}){let{addOnGroups:l,hasError:u}=ei(e),d=o(()=>N(l,n),[l,n]),p=o(()=>An(l,d),[l,d]),m=s({source:n,picks:n});m.current.source!==n&&(m.current={source:n,picks:n});let h=e=>{let t=m.current;t.picks=P(e({serviceId:``,addOns:t.picks}))},g=r(()=>{let e=m.current,t=N(l,e.picks);return e.picks.filter(e=>!t.includes(e)).forEach(e=>a(e.id,0)),e.picks=t,t},[l,a]),_=r(e=>{let n=N(l,m.current.picks);!t&&jn(l,n,e)&&(g(),i(e),h(t=>Fn(t,e)))},[t,l,g,i]),v=r((e,n)=>{let r=t?null:Dn(l,e);if(!r)return;let i=N(l,m.current.picks),o=i.find(t=>t.id===e)?.quantity??0,s=Mn(r,n);s===o||o===0&&!jn(l,i,e)||(g(),a(e,s),h(t=>In(t,e,s)))},[t,l,g,a]),y=o(()=>({addOnGroups:p,selected:d,isLoading:t,hasError:u,toggleAddOn:_,setAddOnQuantity:v}),[p,d,t,u,_,v]);return f($.Provider,{value:y,children:c})}function ha({children:e}){let{service:n,serviceId:r,hasAddOns:i,locale:a,isLoading:s,bookingsSettingsLoading:c,selection:u,toggleAddOn:d,setAddOnQuantity:p}=l();la(oa.SERVICE_ADD_ONS,!s&&!c);let m=o(()=>P(u),[u]),h=oi(),g=fi(),_=n&&i&&r?r:null,v=o(()=>_?ni(Ki({serviceId:_,locale:a,language:g,warmupData:h}),da,fa):ua,[_,a,g]),y=!_&&!!s;return f($r,{fallback:f(vi,{children:e}),feature:Y.serviceAddOns,children:f(t,{fallback:f(_i,{children:e}),children:f(ma,{addOnsPromise:v,isLoading:y,pickedAddOns:m,forwardToggleAddOn:d,forwardSetAddOnQuantity:p,children:e})})})}var ga=En(`bcc1b809-bde5-4d7d-a7bb-89831fe5ccb8`);export{ha as default,ga as injectAccessTokenGetter,$ as serviceAddOnsContext,pa as useServiceAddOnsContext};
2
- //# sourceMappingURL=context-provider-bcc1b809-bde5-4d7d-a7bb-89831fe5ccb8-BJS_D7cu.js.map
1
+ import{Component as e,Suspense as t,createContext as n,useCallback as r,useContext as i,useEffect as a,useMemo as o,useRef as s,useSyncExternalStore as c}from"react";import{useServiceContext as l}from"@wix/bookings/context/service";import{useGetService as u,useService as d}from"@wix/services-manager-react";import{jsx as f}from"react/jsx-runtime";var p={};function m(e,t=!1,n=e=>e){return()=>({__type:`event-definition`,type:e,isDomainEvent:t,transformations:n})}var h=e=>{switch(e){case`get`:case`GET`:return`GET`;case`post`:case`POST`:return`POST`;case`put`:case`PUT`:return`PUT`;case`delete`:case`DELETE`:return`DELETE`;case`patch`:case`PATCH`:return`PATCH`;case`head`:case`HEAD`:return`HEAD`;case`options`:case`OPTIONS`:return`OPTIONS`;default:throw Error(`Unknown method: ${e}`)}},g=e=>t=>async n=>{let r,i=t=>{if(r=e(n)(t),r.url===void 0)throw Error(`Url was not successfully created for this request, please reach out to support channels for assistance.`);let{method:i,url:a,params:o}=r;return{...r,method:h(i),url:a,data:r.data,params:o}};try{let e=await t.request(i);if(r===void 0)throw Error(`Request options were not created for this request, please reach out to support channels for assistance.`);let n=Array.isArray(r.transformResponse)?r.transformResponse:[r.transformResponse],a=e.data;return n.forEach(t=>{t&&(a=t(e.data,e.headers))}),a}catch(e){throw typeof e==`object`&&e&&`response`in e&&typeof e.response==`object`&&e.response!==null&&`data`in e.response?e.response.data:e}},_=e=>e.__isAmbassador?!0:!!e().__isAmbassador,v=`__metadata`,y=`edge.wixapis.com`,b=class extends Error{message;response;constructor(e,t){super(e),this.message=e,this.response=t}async details(){let e=await this.response.json();return x(this.response.status,e?.message,e?.details,{requestId:this.response.headers.get(`X-Wix-Request-Id`),details:e})}},x=(e,t,n,r)=>({details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t,requestId:r?.requestId}),ee=e=>e?.method&&[`post`,`put`,`patch`].includes(e.method.toLocaleLowerCase())&&e.body?{"Content-Type":`application/json`}:{},te=e=>e&&typeof e==`object`&&!Array.isArray(e),ne=e=>e.__type===`host`;function S(e,t){return e.create(t)}var C=`x-wix-bi-gateway`;function re(e,t,n){return{[C]:ie({environment:`js-sdk${n?`-${n}`:``}`,"package-name":e.packageName??t?.PACKAGE_NAME,"method-fqn":e.methodFqn,entity:e.entityFqdn})}}function ie(e){return Object.entries(e).filter(([e,t])=>!!t).map(([e,t])=>`${e}=${t}`).join(`,`)}function ae(e){let t=globalThis.__wix_context__,n={client:p.client,elevatedClient:p.elevatedClient},r;globalThis.__wix_context__=void 0,p.client=void 0,p.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,p.client=n.client,p.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}var oe={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function se(e){return fe(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var ce=/([\p{Ll}\d])(\p{Lu})/gu,le=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,ue=`$1\0$2`,de=/[^\p{L}\d]+/giu;function fe(e){let t=e.trim();t=t.replace(ce,ue).replace(le,ue),t=t.replace(de,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}var pe=e=>`validationError`in(e.response?.data?.details??{}),me=e=>`applicationError`in(e.response?.data?.details??{}),he=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function ge(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(pe(e))return _e(e,t,n);if(me(e))return ve(e);if(he(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:se(n),data:{}},requestId:e.requestId};return w(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return ye(e)}var _e=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=be(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return w(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},w=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),ve=e=>{let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i=e.response?.data?.details?.applicationError?.description??n,a=e.response?.data?.details?.applicationError?.code??se(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return w(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},ye=e=>w(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:se(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),be=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,i)=>{let a={...e,...t},o=Object.keys(a);return r?.filter(e=>!r.some(t=>t.field.length>e.field.length&&t.field.startsWith(e.field)&&o.includes(t.field))).map(e=>{let r=t[e.field];if(r)return{...e,field:xe(r,i)};let s=o?.sort((e,t)=>t.length-e.length)?.find(t=>e.field.startsWith(t));if(s){let t=a[s];if(t)return{...e,field:e.field.replace(s,xe(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},xe=(e,t)=>{let n=Se(e);return n==null?e:e.replace(`$[${n}]`,t[n])},Se=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function Ce(e,t,n,r,i,a,o,s,c,l,u){return ae(()=>e({request:async e=>{let i=e({host:s?.HTTPHost||`www.wixapis.com`}),a=i;a.method===`GET`&&a.fallback?.length&&(a.params?.toString().length??0)>4e3&&(a=i.fallback[0]);let o=s?.HTTPHost??`www.wixapis.com`,u=`https://${l?y:o}${a.url}`;a.params&&a.params.toString()&&(u+=`?${a.params.toString()}`);try{let e=re(i,t,c),o={method:a.method,...a.data&&{body:JSON.stringify(a.data)},headers:{...e}},s=await n(u,o);if(s.status!==200){let e=null;try{e=await s.json()}catch{}let t=Te(s.status,e?.message??s.statusText,e?.details,{requestId:s.headers.get(`X-Wix-Request-Id`),details:e}),n=ge(t);throw r?.handleError(n,{requestOptions:{url:a.url,method:a.method,entityFqdn:i.entityFqdn,methodFqn:i.methodFqn}}),t}let l=await s.json();return{data:a.migrationOptions?.optInTransformResponse&&a.transformResponse?Array.isArray(a.transformResponse)?a.transformResponse[0](l):a.transformResponse(l):l,headers:s.headers,status:s.status,statusText:s.statusText}}catch(e){throw e.message?.includes(`fetch is not defined`)&&console.error(`Node.js v18+ is required`),e}},fetchWithAuth:n,wixAPIFetch:i,getActiveToken:a,getAuthHeaders:o},{validateRequestSchema:u}))}var we=class extends Error{response;requestId;constructor(e){super(),this.response=e.response,this.requestId=e.requestId}},Te=(e,t,n,r)=>new we({response:{data:{details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t},status:e},requestId:r?.requestId}),Ee=`.`;function De(e,t,n){if(e==null)throw Error(`Cannot set value on null or undefined`);let r=Oe(t),i=e;for(let e=0;e<r.length;e++){let t=r[e];if(e===r.length-1){i[t]=n;break}let a=r[e+1];(!(t in i)||i[t]==null||typeof i[t]!=`object`||i[t]===null)&&(i[t]=typeof a==`number`?[]:{}),i=i[t]}return e}function Oe(e){return Array.isArray(e)?e:e.split(Ee).map(e=>ke(e)?Number(e):e)}function ke(e){return/^\d+$/.test(e)}function Ae(e){let t={};for(let[n,r]of Object.entries(e))je(n)||De(t,Oe(n),r);return t}function je(e){return e===`__proto__`||e===`constructor`||e===`prototype`}var Me=class{BRACKET_PATTERN=/\[(\d+)\]/g;NUMERIC_PATTERN=/^\d+$/;ESCAPED_DOT_PATTERN=/\\\./g;ESCAPED_LEFT_BRACKET_PATTERN=/\\\[/g;ESCAPED_RIGHT_BRACKET_PATTERN=/\\\]/g;SPLIT_PATTERN=/\.|\[(\d+)\]/g;DOT_BEFORE_BRACKET_PATTERN=/\.\[/g;ESCAPED_DOT_PLACEHOLDER=`__DOT__`;ESCAPED_RIGHT_BRACKET_PLACEHOLDER=`__RB__`;ESCAPED_LEFT_BRACKET_PLACEHOLDER=`__LB__`;modifiedFields;cleanedModifiedFields;constructor(e){this.modifiedFields=e}replaceEscapedCharacters(e){return e.replace(this.ESCAPED_DOT_PATTERN,this.ESCAPED_DOT_PLACEHOLDER).replace(this.ESCAPED_LEFT_BRACKET_PATTERN,this.ESCAPED_LEFT_BRACKET_PLACEHOLDER).replace(this.ESCAPED_RIGHT_BRACKET_PATTERN,this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER)}restoreEscapedCharacters(e){return e.replace(this.ESCAPED_DOT_PLACEHOLDER,`\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER,`\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER,`\\[`)}unflatten(){return this.cleanedModifiedFields=Object.fromEntries(Object.entries(this.modifiedFields).map(([e,t])=>[this.replaceEscapedCharacters(this.bracketToDotNotation(e)),t])),Ae(this.cleanedModifiedFields)}flatten(e){let t={};for(let n of Object.keys(this.cleanedModifiedFields)){let r=this.splitPath(n),i=this.navigatePath(e,r);t={...t,...i}}return Object.fromEntries(Object.entries(t).map(([e,t])=>[this.restoreEscapedCharacters(e),t]))}splitPath(e){let t=[],n=0,r=Array.from(e.matchAll(this.SPLIT_PATTERN));for(let i of r)i.index>n&&t.push(e.substring(n,i.index)),i[1]&&t.push(i[1]),n=i.index+i[0].length;return n<e.length&&t.push(e.substring(n)),t}navigatePath(e,t){let n=e,r=[],i=e=>{if(!Array.isArray(n))throw Error(`Expected array at path ${this.buildPathString(r)}, but got ${typeof n}`);r.push(`[${e}]`),n=n[parseInt(e,10)]},a=(e,t)=>{let i=e in oe?oe[e]:void 0;if(i&&i in t){r.push(i),n=t[i];return}let a=Ie(e);if(a&&a in t){r.push(a),n=t[a];return}throw Error(`Cannot find key '${e}' or its transformations at path ${this.buildPathString(r)}`)},o=(e,t)=>{r.push(e),n=t[e]};for(let e of t){if(this.NUMERIC_PATTERN.test(e)){i(e);continue}if(typeof n!=`object`||!n)throw Error(`Cannot access property '${e}' on ${typeof n} at path ${this.buildPathString(r)}`);let t=n;if(e in n){o(e,t);continue}a(e,t)}return{[this.buildPathString(r)]:n}}buildPathString(e){return e.join(`.`).replace(this.DOT_BEFORE_BRACKET_PATTERN,`[`)}bracketToDotNotation(e){return e.replace(this.BRACKET_PATTERN,(t,n,r)=>r>0&&e[r-1]===`\\`?t:`.`+n)}};function Ne(e,t){let n=e?.modifiedFields;if(!n)return null;let r=Pe(n);if(!r)return null;let{unflattenedModifiedFields:i,modifiedFieldsManipulator:a}=r;e={...e,modifiedFields:i};let o=t(e),s=o?.modifiedFields;if(!s)return null;let c=Fe(s,a);return c===null?null:(o.modifiedFields=c,o)}function Pe(e){if(typeof e==`object`&&e&&!Array.isArray(e))try{let t=new Me(e);return{unflattenedModifiedFields:t.unflatten(),modifiedFieldsManipulator:t}}catch{return null}return null}function Fe(e,t){if(typeof e==`object`&&e&&!Array.isArray(e))try{return t.flatten(e)}catch{return null}return null}function Ie(e){return e.replace(/[-_\s]+(.)?/g,(e,t)=>t?t.toUpperCase():``).replace(/^./,e=>e.toLowerCase())}function Le(){return{emit(e,...t){for(let n=0,r=this.events[e]||[],i=r.length;n<i;n++)r[n](...t)},events:{},on(e,t){return(this.events[e]||=[]).push(t),()=>{this.events[e]=this.events[e]?.filter(e=>t!==e)}}}}var Re=e=>e.__type===`event-definition`;function ze(e,t,n,r){let i;if(e.isDomainEvent){let{deletedEvent:e,actionEvent:t,createdEvent:a,updatedEvent:o,...s}=n,c={...r,...s};i=e?e?.deletedEntity?{entity:e?.deletedEntity,metadata:c}:{metadata:c}:t?{data:t.body,metadata:c}:o?{entity:o.currentEntity,metadata:c,...o.modifiedFields?{modifiedFields:o.modifiedFields}:{}}:{entity:a?.entity,metadata:c}}else i={data:n,metadata:r};let a=e.transformations??(e=>e),o=i,s=i;if(s.modifiedFields){let e=s.modifiedFields;if(typeof e==`object`&&e&&!Array.isArray(e)){o=structuredClone(i);let e=Ne(s,a);if(e)return t(e)}}return t(a(o))}function Be(e){let t=new Map,n=Le();return{initModule(e){return r=>{let i=t.get(e.type)??[];i.push({eventDefinition:e,handler:r}),t.set(e.type,i),n.emit(`registered`,e)}},client:{...n,getRegisteredEvents:()=>t,async process(e,n={expectedEvents:[]}){let{eventType:r,identity:i,instanceId:a,payload:o,accountInfo:s}=await this.parseJWT(e),c=[...n.expectedEvents,...Array.from(t.keys()).map(e=>({type:e}))];if(c.length>0&&!c.some(({type:e})=>e===r))throw Error(`Unexpected event type: ${r}. Expected one of: ${c.map(e=>e.type).join(`, `)}`);let l=t.get(r)??[];return await Promise.all(l.map(({eventDefinition:e,handler:t})=>ze(e,t,o,{instanceId:a,identity:i,accountInfo:s}))),{instanceId:a,eventType:r,payload:o,identity:i,accountInfo:s}},async processRequest(e,t){let n=await e.text();return this.process(n,t)},async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`string`)throw Error(`Unexpected type of JWT data: expected string, got ${typeof r.data}`);let a=JSON.parse(r.data),o=a.eventType,s=a.accountInfo,c=a.instanceId,l=a.identity?JSON.parse(a.identity):void 0;return{instanceId:c,eventType:o,payload:JSON.parse(a.data),identity:l,accountInfo:s}},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async executeHandlers(e){let n=Array.from(t.keys()).map(e=>({type:e}));if(n.length>0&&!n.some(({type:t})=>t===e.eventType))throw Error(`Unexpected event type: ${e.eventType}. Expected one of: ${n.map(e=>e.type).join(`, `)}`);let r=t.get(e.eventType)??[];await Promise.all(r.map(({eventDefinition:t,handler:n})=>ze(t,n,e.payload,{instanceId:e.instanceId,identity:e.identity})))},apps:{AppInstalled:m(`AppInstalled`)(),AppRemoved:m(`AppRemoved`)()}}}}var Ve=e=>e.__type===`service-plugin-definition`;function He(e){let t=new Map,n=Le();return{initModule(e){return r=>{let i=t.get(e.componentType.toLowerCase())??[];i.push({servicePluginDefinition:e,implementation:r}),t.set(e.componentType.toLowerCase(),i),n.emit(`registered`,e)}},client:{...n,getRegisteredServicePlugins:()=>t,async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t,!0);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`object`||r.data===null||!(`metadata`in r.data)||typeof r.data.metadata!=`object`||r.data.metadata===null||!(`appExtensionType`in r.data.metadata)||typeof r.data.metadata.appExtensionType!=`string`)throw Error(`Unexpected JWT data: expected object with metadata.appExtensionType string`);return r.data},async process(e){let t=await this.parseJWT(e.body);return this.executeHandler(t,e.url)},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async processRequest(e){let t=await this.parseRequest(e);return this.processParsedRequest(t,e.url)},async processParsedRequest(e,t){try{let n=await this.executeHandler(e,t);return Response.json(n)}catch(e){if(e.errorType===`SPI`&&e.applicationCode&&e.httpCode)return Response.json({applicationError:{code:e.applicationCode,data:e.data}},{status:e.httpCode});throw e}},async executeHandler(e,n){let r=e.metadata.appExtensionType.toLowerCase(),i=t.get(r)??[];if(i.length===0)throw Error(`No service plugin implementations found for component type ${r}`);if(i.length>1)throw Error(`Multiple service plugin implementations found for component type ${r}. This is currently not supported`);let{implementation:a,servicePluginDefinition:o}=i[0],s=o.methods.find(e=>n.endsWith(e.primaryHttpMappingPath));if(!s)throw Error(`Unexpect request: request url did not match any method: `+n);let c=a[s.name];if(!c)throw Error(`Got request for service plugin method ${s.name} but no implementation was provided. Available methods: ${Object.keys(a).join(`, `)}`);return s.transformations.toREST(await c(s.transformations.fromREST(e)))}}}}var T=`X-Wix-Consistent`;function Ue(e){let t=e.headers||{Authorization:``},n={getAuthHeaders:e=>Promise.resolve({headers:{}})},r=e.auth,i=typeof r==`function`?r:()=>r??n,a=()=>i().getAuthHeaders(e.host),o=()=>e.fetch??fetch,s=async(n,r)=>{let i=o(),s=await a(),c={...r?.headers??{},...s.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[T]:t[T]}:{}},l=e.host?.getErrorHandler?.();try{if(typeof n==`string`||n instanceof URL){let e=await i(n,{...r,headers:c});l?.handleError(e,{requestOptions:{url:n.toString(),method:r?.method}});let a=We(e);return a&&(t[T]=a),e}{for(let[e,t]of Object.entries(c))typeof t==`string`&&n.headers.set(e,t);let e=await i(n,r);l?.handleError(e,{requestOptions:{url:n.url,method:r?.method}});let a=We(e);return a&&(t[T]=a),e}}catch(e){throw l?.handleError(e,{requestOptions:{url:typeof n==`string`||n instanceof URL?n.toString():n.url,method:r?.method}}),e}},{client:c,initModule:l}=He(i),{client:u,initModule:d}=Be(i),f=async(n,r)=>{let i=o(),s=await a(),c=ee(r),l=await i(n,{...r,headers:{...c,...t,...s?.headers,...r?.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[T]:t[T]}:{}}}),u=We(l);return u&&(t[T]=u),l},m=(t,n)=>{if(Re(t))return d(t);if(Ve(t))return l(t);if(ne(t)&&e.host)return S(t,e.host);if(typeof t==`function`){if(`__type`in t&&t.__type===`wix_spi_error`)return t;let r=e.host?.apiBaseUrl??`www.wixapis.com`,o=e.useCDN===void 0?i().shouldUseCDN:e.useCDN;return Ce(ae(()=>_(t))?g(t):t,n??{},f,e.host?.getErrorHandler?.(),(e,t)=>{let n=new URL(e,`https://${r}`);return n.host=r,n.protocol=`https`,f(n.toString(),t)},i().getActiveToken,async()=>a(),{HTTPHost:r},e.host?.name,o,e.validateRequestSchema)}return te(t)?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,m(n,t[v])])):t},h=e=>{for(let n in e)t[n]=e[n]};return{...e.modules?m(e.modules):{},get auth(){let t=i();return t.getAuthHeaders=t.getAuthHeaders.bind(void 0,e.host),t},setHeaders:h,use:m,enableContext(e,t={elevated:!1}){e===`global`?globalThis.__wix_context__==null?t.elevated?globalThis.__wix_context__={elevatedClient:this}:globalThis.__wix_context__={client:this}:t.elevated?globalThis.__wix_context__.elevatedClient=this:globalThis.__wix_context__.client=this:t.elevated?p.elevatedClient=this:p.client=this},fetch:(t,n)=>{let r=e.host?.apiBaseUrl??`www.wixapis.com`,i=new URL(t,`https://${r}`);return i.host=r,i.protocol=`https`,f(i.toString(),n)},fetchWithAuth:s,async graphql(t,n,r={apiVersion:`alpha`}){let i=e?.host?.apiBaseUrl??`www.wixapis.com`,a=await f(`https://${i}/graphql/${r.apiVersion}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({query:t,variables:n})});if(a.status!==200)throw new b(`GraphQL request failed with status ${a.status}`,a);let{data:o,errors:s}=await a.json();return{data:o??{},errors:s}},webhooks:u,servicePlugins:c}}function We(e){return e.headers?.get(`X-Wix-Consistent`)??e.headers?.get(`x-wix-consistent`)}var Ge=1920,Ke=1920,qe=1e3,Je=1e3,E={SCALE_TO_FILL:`fill`,SCALE_TO_FIT:`fit`,STRETCH:`stretch`,ORIGINAL_SIZE:`original_size`,TILE:`tile`,TILE_HORIZONTAL:`tile_horizontal`,TILE_VERTICAL:`tile_vertical`,FIT_AND_TILE:`fit_and_tile`,LEGACY_STRIP_TILE:`legacy_strip_tile`,LEGACY_STRIP_TILE_HORIZONTAL:`legacy_strip_tile_horizontal`,LEGACY_STRIP_TILE_VERTICAL:`legacy_strip_tile_vertical`,LEGACY_STRIP_SCALE_TO_FILL:`legacy_strip_fill`,LEGACY_STRIP_SCALE_TO_FIT:`legacy_strip_fit`,LEGACY_STRIP_FIT_AND_TILE:`legacy_strip_fit_and_tile`,LEGACY_STRIP_ORIGINAL_SIZE:`legacy_strip_original_size`,LEGACY_ORIGINAL_SIZE:`actual_size`,LEGACY_FIT_WIDTH:`fitWidth`,LEGACY_FIT_HEIGHT:`fitHeight`,LEGACY_FULL:`full`,LEGACY_BG_FIT_AND_TILE:`legacy_tile`,LEGACY_BG_FIT_AND_TILE_HORIZONTAL:`legacy_tile_horizontal`,LEGACY_BG_FIT_AND_TILE_VERTICAL:`legacy_tile_vertical`,LEGACY_BG_NORMAL:`legacy_normal`},D={FIT:`fit`,FILL:`fill`,FILL_FOCAL:`fill_focal`,CROP:`crop`,LEGACY_CROP:`legacy_crop`,LEGACY_FILL:`legacy_fill`},O={CENTER:`center`,TOP:`top`,TOP_LEFT:`top_left`,TOP_RIGHT:`top_right`,BOTTOM:`bottom`,BOTTOM_LEFT:`bottom_left`,BOTTOM_RIGHT:`bottom_right`,LEFT:`left`,RIGHT:`right`},Ye={[O.CENTER]:{x:.5,y:.5},[O.TOP_LEFT]:{x:0,y:0},[O.TOP_RIGHT]:{x:1,y:0},[O.TOP]:{x:.5,y:0},[O.BOTTOM_LEFT]:{x:0,y:1},[O.BOTTOM_RIGHT]:{x:1,y:1},[O.BOTTOM]:{x:.5,y:1},[O.RIGHT]:{x:1,y:.5},[O.LEFT]:{x:0,y:.5}},Xe={center:`c`,top:`t`,top_left:`tl`,top_right:`tr`,bottom:`b`,bottom_left:`bl`,bottom_right:`br`,left:`l`,right:`r`},Ze={BG:`bg`,IMG:`img`,SVG:`svg`},Qe={AUTO:`auto`,CLASSIC:`classic`,SUPER:`super`},$e={classic:1,super:2},et={radius:`0.66`,amount:`1.00`,threshold:`0.01`},tt=25e6,nt=[1.5,2,4],k={HIGH:{size:196e4,quality:90,maxUpscale:1},MEDIUM:{size:36e4,quality:85,maxUpscale:1},LOW:{size:16e4,quality:80,maxUpscale:1.2},TINY:{size:0,quality:80,maxUpscale:1.4}},A={HIGH:`HIGH`,MEDIUM:`MEDIUM`,LOW:`LOW`,TINY:`TINY`},j={CONTRAST:`contrast`,BRIGHTNESS:`brightness`,SATURATION:`saturation`,HUE:`hue`,BLUR:`blur`},M={JPG:`jpg`,JPEG:`jpeg`,JPE:`jpe`,PNG:`png`,WEBP:`webp`,WIX_ICO_MP:`wix_ico_mp`,WIX_MP:`wix_mp`,GIF:`gif`,SVG:`svg`,AVIF:`avif`,UNRECOGNIZED:`unrecognized`},rt={AVIF:`AVIF`,PAVIF:`PAVIF`};M.JPG,M.JPEG,M.JPE,M.PNG,M.GIF,M.WEBP;function N(e,...t){return function(...n){let r=n[n.length-1]||{},i=[e[0]];return t.forEach(function(t,a){let o=Number.isInteger(t)?n[t]:r[t];i.push(o,e[a+1])}),i.join(``)}}function P(e){return e[e.length-1]}var it=[M.PNG,M.JPEG,M.JPG,M.JPE,M.WIX_ICO_MP,M.WIX_MP,M.WEBP,M.AVIF],at=[M.JPEG,M.JPG,M.JPE];function ot(e){return it.includes(L(e))}function st(e,t,n){return n&&t&&!ht(t.id)&&Object.values(E).includes(e)}function ct(e,t,n){return!(F(e)||I(e))||!t||n}function lt(e,t,n){return pt(e)?!!(t||n):!1}function ut(e,t,n,r){if(mt(e)||!ct(e,t,n))return!1;let i=ot(e),a=lt(e,n,r);return i||a}function dt(e){return at.includes(L(e))}function ft(e){return L(e)===M.PNG}function F(e){return L(e)===M.WEBP}function pt(e){return L(e)===M.GIF}function I(e){return L(e)===M.AVIF}function mt(e){return/(^https?)|(^data)|(^\/\/)/.test(e)}function ht(e){return!e||!e.trim()||e.toLowerCase()===`none`}function gt(e){return e?.isSEOBot??!1}var _t=[`/`,`\\`,`?`,`<`,`>`,`|`,`“`,`:`,`"`].map(encodeURIComponent),vt=[`\\.`,`\\*`],yt=`_`;function bt(e,t){let n=/\/(.*?)$/,r=/\.([^.]*)$/,i=RegExp(`(${_t.concat(vt).join(`|`)})`,`g`);if(t&&t.length){let e=t,n=t.match(r);return n&&it.includes(n[1])&&(e=t.replace(r,``)),encodeURIComponent(e).replace(i,yt)}let a=e.match(n);return(a?a[1]:e).replace(r,``)}function xt(e){return dt(e)?M.JPG:ft(e)?M.PNG:F(e)?M.WEBP:pt(e)?M.GIF:I(e)?M.AVIF:M.UNRECOGNIZED}function L(e){return(/[.]([^.]+)$/.exec(e)&&/[.]([^.]+)$/.exec(e)[1]||``).toLowerCase()}function St(e,t,n,r){return Math.min(n/e,r/t)}function Ct(e,t,n,r){return Math.max(n/e,r/t)}function wt(e,t,n,r,i){let a;return a=i===D.FILL?Ct(e,t,n,r):i===D.FIT?St(e,t,n,r):1,a}function Tt(e,t,n,r,i){let a,o=n,s=r;if(a=wt(e,t,n,r,i),i===D.FIT&&(o=e*a,s=t*a),o&&s&&o*s>25e6){let n=Math.sqrt(tt/(o*s));o*=n,s*=n,a=wt(e,t,o,s,i)}return{scaleFactor:a,width:o,height:s}}function Et(e,t,n,r,i,a){e||=r.width,t||=r.height;let{scaleFactor:o,width:s,height:c}=Tt(e,t,r.width*i,r.height*i,n);return Rt(e,t,s,c,a,o,n)}function Dt(e=O.CENTER){return Ye[e]}function Ot(e,t,n,r){let i=Mt(n)||Dt(r);return{x:Math.max(0,Math.min(e.width-t.width,i.x*e.width-t.width/2)),y:Math.max(0,Math.min(e.height-t.height,i.y*e.height-t.height/2)),width:Math.min(e.width,t.width),height:Math.min(e.height,t.height)}}function kt(e,t){let n=Math.max(0,Math.min(e.width,t.x+t.width)-Math.max(0,t.x)),r=Math.max(0,Math.min(e.height,t.y+t.height)-Math.max(0,t.y));return n&&r&&(e.width!==n||e.height!==r)?{x:Math.max(0,t.x),y:Math.max(0,t.y),width:n,height:r}:null}function At(e){return Math.min(e.pixelAspectRatio||1,2)}function jt(e){return e.alignment&&Xe[e.alignment]||Xe[O.CENTER]}function Mt(e){let t;return e&&typeof e.x==`number`&&!isNaN(e.x)&&typeof e.y==`number`&&!isNaN(e.y)&&(t={x:R(Math.max(0,Math.min(100,e.x))/100,2),y:R(Math.max(0,Math.min(100,e.y))/100,2)}),t}function Nt(e,t){return k[zt(e,t)].quality}function Pt(e,t){return{optimizedScaleFactor:k[zt(e,t)].maxUpscale,upscaleMethodValue:$e.classic,forceUSM:!1}}function Ft(e,t){return{optimizedScaleFactor:k[zt(e,t)].maxUpscale,upscaleMethodValue:$e.classic,forceUSM:!1}}function It(e){return{optimizedScaleFactor:P(nt),upscaleMethodValue:$e.super,forceUSM:!(nt.includes(e)||e>P(nt))}}function Lt(e,t,n,r){return r===`auto`?Ft(e,t):r===`super`?It(n):Pt(e,t)}function Rt(e,t,n,r,i,a,o){let{optimizedScaleFactor:s,upscaleMethodValue:c,forceUSM:l}=Lt(e,t,a,i),u=n,d=r;if(a<=s)return{width:u,height:d,scaleFactor:a,upscaleMethodValue:c,forceUSM:l,cssUpscaleNeeded:!1};switch(o){case D.FILL:u=s/a*n,d=s/a*r;break;case D.FIT:u=e*s,d=t*s}return{width:u,height:d,scaleFactor:s,upscaleMethodValue:c,forceUSM:l,cssUpscaleNeeded:!0}}function zt(e,t){let n=e*t;return n>k[A.HIGH].size?A.HIGH:n>k[A.MEDIUM].size?A.MEDIUM:n>k[A.LOW].size?A.LOW:A.TINY}function R(e,t){let n=10**(t||0);return(e*n/n).toFixed(t)}function Bt(e){return!e||!e.upscaleMethod?Qe.AUTO:Qe[e.upscaleMethod.toUpperCase()]||Qe.AUTO}function Vt(e,t){let n=F(e)||I(e);return L(e)===M.GIF||n&&t}var Ht={isMobile:!1},Ut=function(e){return Ht[e]},Wt=function(e,t){Ht[e]=t};function Gt(){if(typeof window<`u`&&typeof navigator<`u`){let e=window.matchMedia&&window.matchMedia(`(max-width: 767px)`).matches,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);Wt(`isMobile`,e&&t)}}O.CENTER,O.TOP,O.TOP_LEFT,O.TOP_RIGHT,O.BOTTOM,O.BOTTOM_LEFT,O.BOTTOM_RIGHT,O.LEFT,O.RIGHT;function Kt(){return Ut(`isMobile`)}function qt(e,t,n){let r;switch(t.crop&&(r=kt(t,t.crop),r&&(e.src.width=r.width,e.src.height=r.height,e.src.isCropped=!0,e.parts.push(Zt(r)))),e.fittingType){case E.SCALE_TO_FIT:case E.LEGACY_FIT_WIDTH:case E.LEGACY_FIT_HEIGHT:case E.LEGACY_FULL:case E.FIT_AND_TILE:case E.LEGACY_BG_FIT_AND_TILE:case E.LEGACY_BG_FIT_AND_TILE_HORIZONTAL:case E.LEGACY_BG_FIT_AND_TILE_VERTICAL:case E.LEGACY_BG_NORMAL:e.parts.push(Jt(e,n));break;case E.SCALE_TO_FILL:e.parts.push(Yt(e,n));break;case E.STRETCH:e.parts.push(Xt(e,n));break;case E.TILE_HORIZONTAL:case E.TILE_VERTICAL:case E.TILE:case E.LEGACY_ORIGINAL_SIZE:case E.ORIGINAL_SIZE:r=Ot(e.src,n,e.focalPoint,n.alignment),e.src.isCropped?(Object.assign(e.parts[0],r),e.src.width=r.width,e.src.height=r.height):e.parts.push(Zt(r));break;case E.LEGACY_STRIP_TILE_HORIZONTAL:case E.LEGACY_STRIP_TILE_VERTICAL:case E.LEGACY_STRIP_TILE:case E.LEGACY_STRIP_ORIGINAL_SIZE:e.parts.push(en(n));break;case E.LEGACY_STRIP_SCALE_TO_FIT:case E.LEGACY_STRIP_FIT_AND_TILE:e.parts.push(Qt(n));break;case E.LEGACY_STRIP_SCALE_TO_FILL:e.parts.push($t(n))}}function Jt(e,t){let n=Et(e.src.width,e.src.height,D.FIT,t,e.devicePixelRatio,e.upscaleMethod);return{transformType:!e.src.width||!e.src.height?D.FIT:D.FILL,width:Math.round(n.width),height:Math.round(n.height),alignment:Xe.center,upscale:n.scaleFactor>1,forceUSM:n.forceUSM,scaleFactor:n.scaleFactor,cssUpscaleNeeded:n.cssUpscaleNeeded,upscaleMethodValue:n.upscaleMethodValue}}function Yt(e,t){let n=Et(e.src.width,e.src.height,D.FILL,t,e.devicePixelRatio,e.upscaleMethod),r=Mt(e.focalPoint);return{transformType:r?D.FILL_FOCAL:D.FILL,width:Math.round(n.width),height:Math.round(n.height),alignment:jt(t),focalPointX:r&&r.x,focalPointY:r&&r.y,upscale:n.scaleFactor>1,forceUSM:n.forceUSM,scaleFactor:n.scaleFactor,cssUpscaleNeeded:n.cssUpscaleNeeded,upscaleMethodValue:n.upscaleMethodValue}}function Xt(e,t){let n=wt(e.src.width,e.src.height,t.width,t.height,D.FILL),r={...t};return r.width=e.src.width*n,r.height=e.src.height*n,Jt(e,r)}function Zt(e){return{transformType:D.CROP,x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height),upscale:!1,forceUSM:!1,scaleFactor:1,cssUpscaleNeeded:!1}}function Qt(e){return{transformType:D.FIT,width:Math.round(e.width),height:Math.round(e.height),upscale:!1,forceUSM:!0,scaleFactor:1,cssUpscaleNeeded:!1}}function $t(e){return{transformType:D.LEGACY_FILL,width:Math.round(e.width),height:Math.round(e.height),alignment:jt(e),upscale:!1,forceUSM:!0,scaleFactor:1,cssUpscaleNeeded:!1}}function en(e){return{transformType:D.LEGACY_CROP,width:Math.round(e.width),height:Math.round(e.height),alignment:jt(e),upscale:!1,forceUSM:!1,scaleFactor:1,cssUpscaleNeeded:!1}}function tn(e,t){t||={},e.quality=an(e,t),e.progressive=rn(t),e.watermark=nn(t),e.autoEncode=t.autoEncode??!0,e.encoding=t?.encoding,e.unsharpMask=sn(e,t),e.filters=on(t)}function nn(e){return e.watermark}function rn(e){return e.progressive!==!1}function an(e,t){let n=e.fileType===M.PNG,r=e.fileType===M.JPG,i=e.fileType===M.WEBP,a=e.fileType===M.AVIF;if(r||n||i||a){let r=P(e.parts),i=Nt(r.width,r.height),a=t.quality&&t.quality>=5&&t.quality<=90?t.quality:i;return a=n?a+5:a,a}return 0}function on(e){let t=e.filters||{},n={};return z(t[j.CONTRAST],-100,100)&&(n[j.CONTRAST]=t[j.CONTRAST]),z(t[j.BRIGHTNESS],-100,100)&&(n[j.BRIGHTNESS]=t[j.BRIGHTNESS]),z(t[j.SATURATION],-100,100)&&(n[j.SATURATION]=t[j.SATURATION]),z(t[j.HUE],-180,180)&&(n[j.HUE]=t[j.HUE]),z(t[j.BLUR],0,100)&&(n[j.BLUR]=t[j.BLUR]),n}function z(e,t,n){return typeof e==`number`&&!isNaN(e)&&e!==0&&e>=t&&e<=n}function sn(e,t){if(ln(t.unsharpMask))return{radius:R(t.unsharpMask?.radius,2),amount:R(t.unsharpMask?.amount,2),threshold:R(t.unsharpMask?.threshold,2)};if(!un(t.unsharpMask)&&cn(e))return et}function cn(e){let t=P(e.parts);return!(t.scaleFactor>=1)||t.forceUSM||t.transformType===D.FIT}function ln(e){e||={};let t=typeof e.radius==`number`&&!isNaN(e.radius)&&e.radius>=.1&&e.radius<=500,n=typeof e.amount==`number`&&!isNaN(e.amount)&&e.amount>=0&&e.amount<=10,r=typeof e.threshold==`number`&&!isNaN(e.threshold)&&e.threshold>=0&&e.threshold<=255;return t&&n&&r}function un(e){return e||={},typeof e.radius==`number`&&!isNaN(e.radius)&&e.radius===0&&typeof e.amount==`number`&&!isNaN(e.amount)&&e.amount===0&&typeof e.threshold==`number`&&!isNaN(e.threshold)&&e.threshold===0}function dn(e,t,n,r){let i=gt(r),a=xt(t.id),o=bt(t.id,t.name),s=i?1:At(n),c=L(t.id),l=c,u=ut(t.id,r?.hasAnimation,r?.allowAnimatedTransform,r?.allowFullGIFTransformation),d={fileName:o,fileExtension:c,fileType:a,fittingType:e,preferredExtension:l,src:{id:t.id,width:t.width,height:t.height,isCropped:!1,isAnimated:Vt(t.id,r?.hasAnimation)},focalPoint:{x:t.focalPoint&&t.focalPoint.x,y:t.focalPoint&&t.focalPoint.y},parts:[],devicePixelRatio:s,quality:0,upscaleMethod:Bt(r),progressive:!0,watermark:``,unsharpMask:{},filters:{},transformed:u,allowFullGIFTransformation:r?.allowFullGIFTransformation,isPlaceholderFlow:r?.isPlaceholderFlow};return u&&(qt(d,t,n),tn(d,r)),d}function fn(e,t,n){let r={...n},i=Kt();switch(e){case E.LEGACY_BG_FIT_AND_TILE:case E.LEGACY_BG_FIT_AND_TILE_HORIZONTAL:case E.LEGACY_BG_FIT_AND_TILE_VERTICAL:case E.LEGACY_BG_NORMAL:let e=i?qe:Ge,n=i?Je:Ke;r.width=Math.min(e,t.width),r.height=Math.min(n,Math.round(r.width/(t.width/t.height))),r.pixelAspectRatio=1}return r}var pn=N`fit/w_${`width`},h_${`height`}`,mn=N`fill/w_${`width`},h_${`height`},al_${`alignment`}`,hn=N`fill/w_${`width`},h_${`height`},fp_${`focalPointX`}_${`focalPointY`}`,gn=N`crop/x_${`x`},y_${`y`},w_${`width`},h_${`height`}`,_n=N`crop/w_${`width`},h_${`height`},al_${`alignment`}`,vn=N`fill/w_${`width`},h_${`height`},al_${`alignment`}`,yn=N`,lg_${`upscaleMethodValue`}`,bn=N`,q_${`quality`}`,xn=N`,quality_auto`,Sn=N`,usm_${`radius`}_${`amount`}_${`threshold`}`,Cn=N`,bl`,wn=N`,wm_${`watermark`}`,Tn={[j.CONTRAST]:N`,con_${`contrast`}`,[j.BRIGHTNESS]:N`,br_${`brightness`}`,[j.SATURATION]:N`,sat_${`saturation`}`,[j.HUE]:N`,hue_${`hue`}`,[j.BLUR]:N`,blur_${`blur`}`},En=N`,enc_auto`,Dn=N`,enc_avif`,On=N`,enc_pavif`,kn=N`,pstr`,An=N`,anm_all`;function jn(e){if(e.parts.some(({width:e,height:t})=>!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0))return e.src.id;let t=[];e.parts.forEach(e=>{switch(e.transformType){case D.CROP:t.push(gn(e));break;case D.LEGACY_CROP:t.push(_n(e));break;case D.LEGACY_FILL:let n=vn(e);e.upscale&&(n+=yn(e)),t.push(n);break;case D.FIT:let r=pn(e);e.upscale&&(r+=yn(e)),t.push(r);break;case D.FILL:let i=mn(e);e.upscale&&(i+=yn(e)),t.push(i);break;case D.FILL_FOCAL:let a=hn(e);e.upscale&&(a+=yn(e)),t.push(a)}});let n=t.join(`/`);if(e.quality&&(n+=bn(e)),e.unsharpMask&&(n+=Sn(e.unsharpMask)),e.progressive||(n+=Cn(e)),e.watermark&&(n+=wn(e)),e.filters&&(n+=Object.keys(e.filters).map(t=>Tn[t](e.filters)).join(``)),e.fileType!==M.GIF&&(e.encoding===rt.AVIF?(n+=Dn(e),n+=xn(e)):e.encoding===rt.PAVIF?(n+=On(e),n+=xn(e)):e.autoEncode&&(n+=En(e))),e.src?.isAnimated&&e.transformed){let t=pt(e.src.id),r=e.isPlaceholderFlow===!0,i=e.allowFullGIFTransformation===!0;r?n+=kn(e):t&&i&&(n+=An(e))}return`${e.src.id}/v1/${n}/${e.fileName}.${e.preferredExtension}`}function Mn(e,t,n,r={},i){if(ut(t.id,r?.hasAnimation,r?.allowAnimatedTransform,r?.allowFullGIFTransformation)){if((F(t.id)||I(t.id))&&!r.allowWebpAvifTransforms){let{alignment:a,...o}=n;t.focalPoint={x:void 0,y:void 0},delete t?.crop,i=dn(e,t,o,r)}else i||=dn(e,t,n,r);return jn(i)}return t.id}var Nn={[O.CENTER]:`50% 50%`,[O.TOP_LEFT]:`0% 0%`,[O.TOP_RIGHT]:`100% 0%`,[O.TOP]:`50% 0%`,[O.BOTTOM_LEFT]:`0% 100%`,[O.BOTTOM_RIGHT]:`100% 100%`,[O.BOTTOM]:`50% 100%`,[O.RIGHT]:`100% 50%`,[O.LEFT]:`0% 50%`};Object.entries(Nn).reduce((e,[t,n])=>(e[n]=t,e),{}),E.TILE,E.TILE_HORIZONTAL,E.TILE_VERTICAL,E.LEGACY_BG_FIT_AND_TILE,E.LEGACY_BG_FIT_AND_TILE_HORIZONTAL,E.LEGACY_BG_FIT_AND_TILE_VERTICAL,E.LEGACY_ORIGINAL_SIZE,E.ORIGINAL_SIZE,E.LEGACY_BG_NORMAL;function Pn(e,t,n,r){if(st(e,t,n)){let i=fn(e,t,n),a=dn(e,t,i,r);return{uri:Mn(e,t,i,r||{},a)}}return{uri:``}}var Fn=`https://static.wixstatic.com/`,In=`https://static.wixstatic.com/media/`,Ln=/^media\//i,Rn=typeof window<`u`?window.devicePixelRatio:1,zn=e=>Ln.test(e)?`${Fn}${e}`:`${In}${e}`,Bn=(e,t)=>{let n=t&&t.baseHostURL;return n?`${n}${e}`:zn(e)};function Vn(e,t,n,r,i,a){return Bn(Pn(E.SCALE_TO_FIT,{id:e,width:t,height:n,name:a&&a.name},{width:r,height:i,htmlTag:Ze.IMG,alignment:O.CENTER,pixelAspectRatio:a?.devicePixelRatio??Rn},a).uri,a)}function Hn(e,t,n,r,i,a){return Bn(Pn(E.SCALE_TO_FILL,{id:e,width:t,height:n,name:a&&a.name,focalPoint:{x:a&&a.focalPoint&&a.focalPoint.x,y:a&&a.focalPoint&&a.focalPoint.y}},{width:r,height:i,htmlTag:Ze.IMG,alignment:O.CENTER,pixelAspectRatio:a?.devicePixelRatio??Rn},a).uri,a)}function Un(e,t,n,r,i,a,o,s,c,l){return Bn(Pn(E.SCALE_TO_FILL,{id:e,width:t,height:n,name:l&&l.name,crop:{x:r,y:i,width:a,height:o}},{width:s,height:c,htmlTag:Ze.IMG,alignment:O.CENTER,pixelAspectRatio:l?.devicePixelRatio??Rn},l).uri,l)}Gt(),Gt();var Wn={getScaleToFitImageURL:Vn,getScaleToFillImageURL:Hn,getCropImageURL:Un},Gn=`wix:`,Kn=`image`,qn=`video`,Jn=`audio`,Yn=`document`,Xn=`https://static.wixstatic.com/media/`,Zn=`https://static.wixstatic.com/shapes/`,Qn=`https://video.wixstatic.com/video/`,$n=`https://static.wixstatic.com/mp3/`,er=`https://d945e594-8657-47e2-9cd9-e9033c3d8da0.usrfiles.com/`;function tr(e,t,n,r){let i=ir(e);return Wn.getScaleToFillImageURL(i.id,i.height,i.width,t,n,r)}function nr(e,t,n,r){let i=ir(e);return Wn.getScaleToFitImageURL(i.id,i.height,i.width,t,n,r)}function rr(e,t,n,r,i,a,o,s){let c=ir(e);return Wn.getCropImageURL(c.id,c.height,c.width,t,n,r,i,a,o,s)}function ir(e){return or(e,Xn)}function ar(e){return or(e,Zn)}function or(e,t=Xn){let n,r,i,a;if(e.startsWith(t))n=e.split(t).pop().split(`/`)[0],a=e.split(`/w_`).pop().split(`,`)[0],i=e.split(`,h_`).pop().split(`,`)[0];else{let t=dr(e,Kn),{hash:o,pathname:s}=new URL(t),c=new URLSearchParams(o.replace(`#`,``));i=c.get(`originHeight`),a=c.get(`originWidth`),[n,r]=s.replace(`${Kn}://v1/`,``).split(`/`)}let o=ur(r),s={id:n,url:`${t}${n}`,height:Number(i),width:Number(a)};return o?{...s,altText:o,filename:o}:s}function sr(e,t){let n,r,i,a,o=``;if(e.startsWith(Qn))n=e.split(Qn).pop().split(`/`)[0],r=`${n}.jpg`,i=`50`,a=`50`;else{let t=dr(e,qn),{pathname:s,hash:c}=new URL(t),l=new URLSearchParams(c.replace(`#`,``)),[u,d]=s.replace(`${qn}://v1/`,``).split(`/`);n=u,r=l.get(`posterUri`)||`${n}.jpg`,i=l.get(`posterWidth`)||`50`,a=l.get(`posterHeight`)||`50`,o=ur(d)}let s={id:n,url:`${Qn}${n}/${t?`${t}/mp4/file.mp4`:`file`}`,thumbnail:`${Gn}${Kn}://v1/${r}#originWidth=${i}&originHeight=${a}`};return o?{...s,filename:o}:s}function cr(e){let t=dr(e,Jn),{pathname:n,hash:r}=new URL(t),[i,a]=n.replace(`${Jn}://v1/`,``).split(`/`),o=ur(a),s=new URLSearchParams(r.replace(`#`,``)),c={id:i,duration:Number(s.get(`duration`)||``),url:`${$n}${i}`};return o?{...c,filename:o}:c}function lr(e){let t=dr(e,Yn),{pathname:n}=new URL(t),r=n.replace(`${Yn}://v1/`,``).split(`/`),i=r[0]===`ugd`||r[0]===`archives`?r.shift():`ugd`,[a,o]=r,s=ur(o),c={id:a,url:`${er}${i}/${a}`};return s?{...c,filename:s}:c}function ur(e){return e&&decodeURIComponent(e)}function dr(e,t){let{protocol:n}=new URL(e);return n===`${t}:`?`${Gn}${e}`:e}var fr;(function(e){e.MOBILE=`360p`,e.LOW=`480p`,e.MID=`720p`,e.HIGH=`1080p`})(fr||={});var pr={getCroppedImageUrl:rr,getScaledToFillImageUrl:tr,getScaledToFitImageUrl:nr,getImageUrl:ir,getVideoUrl:sr,getAudioUrl:cr,getDocumentUrl:lr,getShapeUrl:ar},mr={_id:`id`,_createdDate:`createdDate`,_updatedDate:`updatedDate`},hr={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function gr(e,t){return e?.split(`.`).map(e=>t?.[e]??e).join(`.`)}var _r=`sort.fieldName`;function vr(e,t,n){return(e===_r||e.endsWith(`.${_r}`))&&typeof t==`string`?gr(t,n):t}function yr(e,t,n){let r=e=>n.includes(e),i=(e,n)=>{if(Array.isArray(e))e.forEach(e=>{i(e,n)});else if(typeof e==`object`&&e){let a=e;Object.keys(a).forEach(e=>{let o=n===``?e:`${n}.${e}`;if(r(o))return;let s=br(e,t);s!==e&&!(s in a)&&(a[s]=a[e],delete a[e]),a[s]=vr(o,a[s],t),i(a[s],o)})}};return i(e,``),e}function br(e,t){let n;return n=e.includes(`.`)?e.split(`.`).map(e=>t[e]??e).join(`.`):t[e]??e,n}function xr(e,t=[]){return yr(e,mr,t)}function Sr(e,t=[]){return yr(e,hr,t)}function Cr(e){return e?new Date(e):void 0}var wr=new WeakMap;function Tr(){return{leaves:void 0,fields:void 0,mapFields:void 0,anyField:void 0}}function Er(e,t){let n=e.get(t);return n||(n=Tr(),e.set(t,n)),n}function Dr(e,t){return t===`*`?(e.anyField??=Tr(),e.anyField):t.endsWith(`{}`)?(e.mapFields??=new Map,Er(e.mapFields,t.slice(0,-2))):(e.fields??=new Map,Er(e.fields,t))}function Or(e){let t=Tr();for(let n of e){let e=n.path.split(`.`).reduce(Dr,t);e.leaves??=[],e.leaves.push(n)}return t}function kr(e){let t=wr.get(e);return t||(t=Or(e),wr.set(e,t)),t}function Ar(e){return typeof e==`object`&&!!e}function jr(e,{isRepeated:t,isMap:n},r){return t?Array.isArray(e)?e.map(r):e:n?Ar(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r(t)])):e:r(e)}function Mr(e,t,n){Ar(e)&&Fr(e,t,n)}function Nr(e,t,n){for(let[r,i]of t){if(!(r in e))continue;if(i.leaves)for(let t of i.leaves)e[r]=jr(e[r],t,n);let t=e[r];Array.isArray(t)?t.forEach(e=>Mr(e,i,n)):Mr(t,i,n)}}function Pr(e,t,n){for(let[r,i]of t){let t=e[r];Ar(t)&&Object.values(t).forEach(e=>Mr(e,i,n))}}function Fr(e,{fields:t,mapFields:n,anyField:r},i){t&&Nr(e,t,i),n&&Pr(e,n,i),r&&Object.values(e).forEach(e=>Mr(e,r,i))}function Ir(e,t){if(!Ar(e))return e;for(let{paths:n,transformFn:r}of t)Fr(e,kr(n),r);return e}function Lr(e){return Hr(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var Rr=/([\p{Ll}\d])(\p{Lu})/gu,zr=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,Br=`$1\0$2`,Vr=/[^\p{L}\d]+/giu;function Hr(e){let t=e.trim();t=t.replace(Rr,Br).replace(zr,Br),t=t.replace(Vr,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}var Ur=e=>`validationError`in(e.response?.data?.details??{}),Wr=e=>`applicationError`in(e.response?.data?.details??{}),Gr=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function Kr(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(Ur(e))return qr(e,t,n);if(Wr(e))return Yr(e);if(Gr(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:Lr(n),data:{}},requestId:e.requestId};return Jr(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return Xr(e)}var qr=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=Zr(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return Jr(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},Jr=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),Yr=e=>{let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i=e.response?.data?.details?.applicationError?.description??n,a=e.response?.data?.details?.applicationError?.code??Lr(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return Jr(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},Xr=e=>Jr(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:Lr(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),Zr=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,i)=>{let a={...e,...t},o=Object.keys(a);return r?.filter(e=>!r.some(t=>t.field.length>e.field.length&&t.field.startsWith(e.field)&&o.includes(t.field))).map(e=>{let r=t[e.field];if(r)return{...e,field:Qr(r,i)};let s=o?.sort((e,t)=>t.length-e.length)?.find(t=>e.field.startsWith(t));if(s){let t=a[s];if(t)return{...e,field:e.field.replace(s,Qr(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},Qr=(e,t)=>{let n=$r(e);return n==null?e:e.replace(`$[${n}]`,t[n])},$r=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function ei(){let e=typeof $wixContext<`u`&&$wixContext.initWixModules?$wixContext.initWixModules:globalThis.__wix_context__!==void 0&&globalThis.__wix_context__.initWixModules?globalThis.__wix_context__.initWixModules:void 0;if(e)return{initWixModules(t,n){return ti(()=>e(t,n))},fetchWithAuth(){throw Error(`fetchWithAuth is not available in this context`)},graphql(){throw Error(`graphql is not available in this context`)}};let t=typeof $wixContext<`u`?$wixContext.client:p.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:p.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:p.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:p.elevatedClient;if(t||n)return{initWixModules(e,r){if(r){if(!n)throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);return ti(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return ti(()=>t.use(e))},fetchWithAuth:(e,n)=>{if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.fetchWithAuth(e,n)},getAuth(){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.auth},async graphql(e,n,r){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.graphql(e,n,r)}}}function ti(e){let t=globalThis.__wix_context__,n={client:p.client,elevatedClient:p.elevatedClient},r;globalThis.__wix_context__=void 0,p.client=void 0,p.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,p.client=n.client,p.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function ni(e,t){return((...n)=>{let r=ei();return r?r.initWixModules(e,t).apply(void 0,n):e.apply(void 0,n)})}function ri(e,t=!1){return ni(e,t)}function ii(e){let t=_i(hi(e.host),e.domainToMappings);return Ei(Ci(e.protoPath,e.data||{}),t)}var ai=[`wix.com`,`editorx.com`],oi=`_`,si=`*.`,ci=RegExp(`\\.(${ai.join(`|`)})$`),li=[`42.wixprod.net`,`uw2-edt-1.wixprod.net`,`virginia-edt.wixprod.net`],ui={"payments.base44.com":`manage.wix.com`,"create.editorx.com":`editor.editorx.com`},di=`dev.wix-code.com`,fi=/{(.*)}/,pi=RegExp(`\\.(${li.join(`|`)})$`),mi=RegExp(`.*\\.${di}$`);function hi(e){return gi(e).replace(ci,`._base_domain_`).replace(pi,`._api_base_domain_`).replace(mi,`*.dev.wix-code.com`)}function gi(e){return ui[e]??e}function _i(e,t){let n=t[e];if(n)return n;let r=vi(e,t)??yi(e,t);if(!r){if(xi(e)){let e=t[Si];if(e)return e}let n=t[oi];if(n)return n}return r??[]}function vi(e,t){return Object.entries(t).find(([t])=>{let[,...n]=e.split(`.`);return n.join(`.`)===t})?.[1]}function yi(e,t){let[n]=Object.entries(t).filter(([t])=>bi(e,t)).sort(([e],[t])=>t.length-e.length);if(!n)return;let[,r]=n;return r}function bi(e,t){if(!t.startsWith(si))return!1;let n=t.slice(1);return e.length>n.length&&e.endsWith(n)}function xi(e){return!!e.match(/\._base_domain_$/)}var Si=`www._base_domain_`;function Ci(e,t){return e.split(`/`).map(e=>wi(e,t)).join(`/`)}function wi(e,t){let n=e.match(fi)||[],r=n[1];return r?Ti(t,r,e,e.replace(n[0],``)):e}function Ti(e,t,n,r){let i=e;for(let e of t.split(`.`)){if(!i)return n;i=i[e]}return`${i}${r}`}function Ei(e,t){let n=t?.find(t=>e.startsWith(t.destPath));return n?n.srcPath+e.slice(n.destPath.length):e}var B;(function(e){e.QUERY_PARAM=`QUERY_PARAM`,e.SUBDOMAIN=`SUBDOMAIN`,e.SUBDIRECTORY=`SUBDIRECTORY`})(B||={});var Di={cs:`Čeština`,da:`Dansk`,de:`Deutsch`,en:`English`,es:`Español`,fr:`Français`,hi:`हिन्दी`,id:`Bahasa Indonesia`,it:`Italiano`,ja:`日本語`,ko:`한국어`,nl:`Nederlands`,no:`Norsk`,pl:`Polski`,pt:`Português`,ru:`Русский`,sv:`Svenska`,th:`ไทย`,tr:`Türkçe`,uk:`Українська`,vi:`Tiếng Việt`,zh:`繁體中文`,sq:`Shqip`,am:`አማርኛ`,ar:`العربية`,hy:`Հայերեն`,az:`Azərbaycan dili`,eu:`Euskara`,be:`Беларуская`,bn:`বাংলা`,bs:`Bosanski`,bg:`Български`,ca:`Català`,ny:`ChiCheŵa`,co:`Corsu`,hr:`Hrvatski`,et:`Eesti`,fj:`Vosa Vakaviti`,fi:`Suomi`,ga:`Gaeilge`,gl:`Galego`,ka:`ქართული`,el:`Ελληνικά`,gu:`ગુજરાતી`,ht:`Kreyòl Ayisyen`,ha:`Hausa`,he:`עברית`,hu:`Magyar`,is:`Íslenska`,ig:`Igbo`,kn:`ಕನ್ನಡ`,kk:`Қазақ тілі`,km:`ភាសាខ្មែរ`,ku:`Kurdî`,ky:`Кыргызча`,lb:`Lëtzebuergesch`,lo:`ລາວ`,la:`Latina`,lv:`Latviešu`,lt:`Lietuvių`,mk:`Македонски`,mg:`Malagasy`,ms:`Bahasa Melayu`,ml:`മലയാളം`,mt:`Malti`,mn:`Монгол`,ne:`नेपाली`,ps:`پښتو`,fa:`فارسی`,ro:`Română`,sm:`Gagana Samoa`,sr:`Српски`,sn:`Shona`,sd:`سنڌي`,si:`සිංහල`,sk:`Slovenčina`,sl:`Slovenščina`,so:`Soomaaliga`,su:`Basa Sunda`,sw:`Kiswahili`,tl:`Filipino`,tg:`Тоҷикӣ`,ta:`தமிழ்`,te:`తెలుగు`,tk:`Türkmen`,ur:`اردو`,uz:`O'zbek`,cy:`Cymraeg`,xh:`isiXhosa`,yi:`ייִדיש`,yo:`Yorùbá`,zu:`isiZulu`,kl:`Kalaallisut`,fo:`Føroyskt`,ln:`Lingála`,mi:`Māori`,mr:`मराठी`,my:`မြန်မာ`,se:`Sámegiella`,ug:`ئۇيغۇرچە`,qu:`Runa Simi`,aa:`Afar`,ab:`Аҧсуа`,ae:`Avestan`,ak:`Akan`,an:`Aragonés`,as:`অসমীয়া`,av:`Авар`,ay:`Aymar aru`,ba:`Башҡортса`,bh:`भोजपुरी`,bi:`Bislama`,bm:`Bamanankan`,bo:`བོད་སྐད་`,br:`Brezhoneg`,ce:`Нохчийн`,ch:`Chamoru`,cr:`ᓀᐦᐃᔭᐍᐏᐣ`,cu:`Црькъвьнословѣньскъ`,cv:`Чӑвашла`,dv:`ދިވެހިބަސް`,dz:`རྫོང་ཁ`,ee:`Eʋegbe`,eo:`Esperanto`,ff:`Fulah`,fy:`Frysk`,gd:`Gàidhlig`,gn:`Avañe'ẽ`,gv:`Gaelg`,ho:`Hiri Motu`,hz:`Otjiherero`,ia:`Interlingua`,ie:`Interlingue`,ii:`ꆈꌠꉙ`,ik:`Iñupiaq`,io:`Ido`,iu:`ᐃᓄᒃᑎᑐᑦ`,jv:`Basa Jawa`,ki:`Gikuyu`,kr:`Kanuri`,ks:`کٲشُر`,kw:`Kernewek`,lg:`Luganda`,li:`Limburgs`,lu:`Tshiluba`,mh:`Kajin M̧ajeļ`,na:`Dorerin Naoero`,nb:`Norsk Bokmål`,nd:`isiNdebele`,ng:`Oshiwambo`,nn:`Norsk Nynorsk`,nr:`isiNdebele (South)`,nv:`Diné Bizaad`,oc:`Occitan`,oj:`Anishinaabemowin`,om:`Afaan Oromoo`,or:`ଓଡ଼ିଆ`,os:`Ирон`,pa:`ਪੰਜਾਬੀ`,pi:`𑀅𑀯𑀢`,rm:`Rumantsch`,rn:`Ikirundi`,rw:`Kinyarwanda`,sa:`संस्कृतम्`,sc:`Sardu`,sg:`Sängö`,ss:`SiSwati`,st:`Sesotho`,ti:`ትግርኛ`,tn:`Setswana`,to:`Faka Tonga`,ts:`Xitsonga`,tt:`Татарча`,tw:`Twi`,ty:`Reo Tahiti`,ve:`Tshivenḓa`,vo:`Volapük`,wa:`Walon`,wo:`Wolof`,za:`Saɯ cueŋƅ`},Oi=(e,t)=>{e.searchParams.set(`lang`,t)},ki=(e,t)=>{let n=e.hostname.split(`.`);n[0]===`www`&&(n=n.slice(1)),n=[t,...n],e.hostname=n.join(`.`)},Ai=(e,t)=>{e.pathname=`/${t}${e.pathname}`},ji=(e,t)=>{if(!t.languageCode||!t?.resolutionMethod)return e;let n=new URL(e);return(t?.resolutionMethod===`QUERY_PARAM`?Oi:t?.resolutionMethod===`SUBDOMAIN`?ki:Ai)(n,t.languageCode),n.href},Mi=(e,t)=>{if(!e?.length)return e;let n;try{n=new URL(e)}catch{return e}n.searchParams.delete(`lang`);let r=n.pathname.split(`/`)[1]?.toLowerCase();if(t.includes(r??``)){let e=n.pathname.split(`/`);e.splice(1,1),n.pathname=e.join(`/`)}let i=n.hostname.split(`.`)[0]?.toLowerCase();if(t.includes(i??``)){let e=n.hostname.split(`.`);e.shift(),n.hostname=e.join(`.`)}return n.href};function Ni(){let e=Pi();return e?Fi(e):[]}function Pi(){let e=typeof globals<`u`?globals?.$ns?.[`wix-window`]?.multilingual:void 0,t=typeof window<`u`?window?.essentials?.multilingual:void 0;return e??t??globalThis?.__wix_site_metadata__?.multilingual}function Fi(e){try{if(e?.supportedLanguages?.length){let t=e.supportedLanguages,n=t.map(e=>e.languageCode).filter(Boolean),r=e.cleanUrl??zi(n);return t.map(e=>({id:e.languageCode,displayName:Ii(e),regionalFormat:[e.locale?.languageCode,e.locale?.country].filter(Boolean).join(`-`),url:Li(e,r),primary:e.isPrimary,resolutionMethod:e.resolutionMethod}))}if(e?.siteLanguages?.length){let t=e.siteLanguages,n=zi(t.map(e=>e.languageCode).filter(Boolean));return t.map(e=>({id:e.languageCode,displayName:Ii(e),regionalFormat:e.locale,url:Li(e,n),primary:e.isPrimaryLanguage,resolutionMethod:e.resolutionMethod?Ri(e.resolutionMethod):void 0}))}}catch(e){return console.warn(`[Multilingual Manager] listSupportedLanguages failed`,e),[]}return console.warn(`[Multilingual Manager] listSupportedLanguages is not available`),[]}function Ii(e){let t=Di[e.languageCode];if(t)return t;let n=e.name??e.countryCode;if(n)return n}function Li(e,t){if(e.url||!t||!e.resolutionMethod)return e.url;if(e.languageCode)try{return ji(t,{languageCode:e.languageCode,countryCode:e.countryCode,resolutionMethod:Ri(e.resolutionMethod),locale:{languageCode:e.languageCode,country:e.countryCode}})}catch(e){console.warn(`[Multilingual Manager] buildUrlForLanguage failed`,e);return}}function Ri(e){switch(e){case`QUERY_PARAM`:case`QueryParam`:return B.QUERY_PARAM;case`SUBDOMAIN`:case`Subdomain`:return B.SUBDOMAIN;case`SUBDIRECTORY`:case`Subdirectory`:return B.SUBDIRECTORY;default:return}}function zi(e){let t=typeof window<`u`&&window.location?.href?window.location.href:``;try{return Mi(t,e)}catch(e){return console.warn(`[Multilingual Manager] cleanCurrentUrl failed`,e),t}}var Bi=`x-wix-linguist`,Vi=`00000000-0000-0000-0000-000000000000`,Hi=`false`,Ui=()=>{let e=V(`language`),t=V(`locale`);if(e)return{[Bi]:[e,t||e,Hi,Vi].join(`|`)}};function Wi(){let e=null,t=null;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var Gi=()=>(typeof window<`u`?window.commonConfig:void 0)??globalThis.commonConfig,V=e=>Gi()?.[e],Ki=({createHost:e})=>({__type:`host`,create:e=>({}),host:t=>{let{applicationId:n,componentId:r}=t??{},i=typeof window<`u`?window.wixEmbedsAPI:void 0,a=e(t),o=Ji();return{...a,apiBaseUrl:o,getMonitoringClient:i?.getMonitoringClientFunction?.(n,r),essentials:{language:V(`language`),locale:V(`locale`),get passThroughHeaders(){return Ui()}}}},auth:e=>{let t=typeof window<`u`?window.wixEmbedsAPI:void 0;!e&&qi()&&(e=t?.getAccessTokenFunction?.());let n=!1,{resolve:r,promise:i}=Wi();return{getAuthHeaders:async()=>{if(!e&&n&&(e=await i),!e)throw Error(`Failed to resolve auth token`);return{headers:{Authorization:await e()}}},getAccessTokenInjector:()=>(n=!0,e=>{r(e)})}}});function qi(){return typeof document<`u`&&document.currentScript?.tagName===`SCRIPT`}function Ji(){let e=(typeof window<`u`?window.wixEmbedsAPI:void 0)?.getExternalBaseUrl?.();if(!e)return;let t=new URL(e);return t?.pathname&&t.pathname!==`/`?`${t.hostname}${t.pathname}`:t.hostname}var Yi=({clientSdk:e,applicationId:t})=>({invoke:async({namespace:n,method:r,args:i})=>{if(!e)throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);return e.invoke({namespace:n,method:r,args:i,applicationId:t,accessToken:`accessToken`})},getAccessToken:()=>{throw Error(`Not implemented`)},observeState:()=>({disconnect:()=>{}})}),Xi=Ki({createHost:function(e){let t=(typeof $wixContext<`u`?$wixContext.clientSdk:void 0)??e?.clientSdk??(typeof window<`u`?window?.clientSdk:void 0),{applicationId:n}=e||{};if(!n)throw Error(`"createHost" was called without a required field "applicationId"`);return{channel:Yi({clientSdk:t,applicationId:n}),close:()=>{}}}}),Zi=(e,t)=>{let n=Xi.host({applicationId:e,componentId:t}),r=Xi.auth();return Ue({auth:r,host:n}).enableContext(`module`),r.getAccessTokenInjector()},Qi=e=>Zi(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`,e);function H(e,t){for(let n of e){let e=n.addOns.find(e=>e.addOnId===t);if(e)return{group:n,addOn:e}}return null}function $i(e,t){return H(e,t)?.addOn??null}function U(e,t){return t.filter(t=>H(e,t.id)!==null)}function ea(e,t,n){return n.filter(n=>H(e,n.id)?.group===t).length}function ta(e,t){return!e.maxNumberOfAddOns||t<e.maxNumberOfAddOns}function na(e,t){return e.map(n=>{let r=ea(e,n,t);return{...n,addOns:n.addOns.map(e=>{let n=t.find(t=>t.id===e.addOnId)?.quantity??0;return{...e,isSelected:n>0,selectedQuantity:n}}),selectedCount:r,canSelectMore:ta(n,r)}})}function ra(e,t,n){let r=H(e,n);return r?t.some(e=>e.id===n)?!0:ta(r.group,ea(e,r.group,t)):!1}function ia(e,t){let n=e.maxQuantity??1;return Number.isFinite(t)?Math.min(Math.max(Math.trunc(t),0),n):0}var aa={category:`category`,location:`location`,page:`page`,blob:`b`,resource:`resource`,referral:`referral`,timezone:`timezone`,bookingId:`bookingId`,token:`token`,rescheduleRedirectUrl:`rescheduleRedirectUrl`};function W(e){return e.addOns??[]}function oa(e,t){let n={...e};return t.length?n.addOns=t:delete n.addOns,n}function sa(e,t){let n=W(e);return oa(e,n.some(e=>e.id===t)?n.filter(e=>e.id!==t):[...n,{id:t,quantity:1}])}function ca(e,t,n){let r=W(e);return n<=0?oa(e,r.filter(e=>e.id!==t)):oa(e,r.some(e=>e.id===t)?r.map(e=>e.id===t?{...e,quantity:n}:e):[...r,{id:t,quantity:n}])}function la(){let e=typeof $wixContext<`u`&&$wixContext.initWixModules?$wixContext.initWixModules:globalThis.__wix_context__!==void 0&&globalThis.__wix_context__.initWixModules?globalThis.__wix_context__.initWixModules:void 0;if(e)return{initWixModules(t,n){return ua(()=>e(t,n))},fetchWithAuth(){throw Error(`fetchWithAuth is not available in this context`)},graphql(){throw Error(`graphql is not available in this context`)}};let t=typeof $wixContext<`u`?$wixContext.client:p.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:p.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:p.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:p.elevatedClient;if(t||n)return{initWixModules(e,r){if(r){if(!n)throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);return ua(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return ua(()=>t.use(e))},fetchWithAuth:(e,n)=>{if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.fetchWithAuth(e,n)},getAuth(){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.auth},async graphql(e,n,r){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.graphql(e,n,r)}}}function ua(e){let t=globalThis.__wix_context__,n={client:p.client,elevatedClient:p.elevatedClient},r;globalThis.__wix_context__=void 0,p.client=void 0,p.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,p.client=n.client,p.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function da(e,t){return{...e,...Object.fromEntries(t.map(t=>[t,(...n)=>{let r=la();if(!r)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return r.initWixModules(e)[t].apply(void 0,n)}]))}}function fa(e){return da({__type:`host`,create:t=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:r(t)}),{})},Object.keys(e))}var G=e=>typeof e==`string`,K=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},pa=e=>e==null?``:``+e,ma=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},ha=/###/g,ga=e=>e&&e.indexOf(`###`)>-1?e.replace(ha,`.`):e,_a=e=>!e||G(e),q=(e,t,n)=>{let r=G(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(_a(e))return{};let t=ga(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return _a(e)?{}:{obj:e,k:ga(r[i])}},va=(e,t,n)=>{let{obj:r,k:i}=q(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=q(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=q(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},ya=(e,t,n,r)=>{let{obj:i,k:a}=q(e,t,Object);i[a]=i[a]||[],i[a].push(n)},ba=(e,t)=>{let{obj:n,k:r}=q(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},xa=(e,t,n)=>{let r=ba(e,n);return r===void 0?ba(t,n):r},Sa=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?G(e[r])||e[r]instanceof String||G(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Sa(e[r],t[r],n):e[r]=t[r]);return e},J=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Ca={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},wa=e=>G(e)?e.replace(/[&<>"'\/]/g,e=>Ca[e]):e,Ta=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},Ea=[` `,`,`,`?`,`!`,`;`],Da=new Ta(20),Oa=(e,t,n)=>{t||=``,n||=``;let r=Ea.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Da.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},ka=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},Y=e=>e?.replace(/_/g,`-`),Aa={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},X=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Aa,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(G(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},ja=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}},Ma=class extends ja{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,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 t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):G(n)&&i?o.push(...n.split(i)):o.push(n)));let s=ba(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!G(n)?s:ka(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),va(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(G(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=ba(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Sa(s,n,i):s={...s,...n},va(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},Na={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},Pa=Symbol(`i18next/PATH_KEY`);function Fa(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===Pa?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Z(e,t){let{[Pa]:n}=e(Fa()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var Ia={},La=e=>!G(e)&&typeof e!=`boolean`&&typeof e!=`number`,Ra=class e extends ja{constructor(e,t={}){super(),ma([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=X.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=La(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Oa(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:G(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:G(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=Z(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?Z(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!G(i.count),x=e.hasDefaultValue(i),ee=b?this.pluralResolver.getSuffix(d,i.count,i):``,te=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,ne=b&&!i.ordinal&&i.count===0,S=ne&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${ee}`]||i[`defaultValue${te}`]||i.defaultValue,C=m;y&&!m&&x&&(C=S);let re=La(C),ie=Object.prototype.toString.apply(C);if(y&&C&&re&&_.indexOf(ie)<0&&!(G(v)&&Array.isArray(C))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,C,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(C),t=e?[]:{},n=e?g:h;for(let e in C)if(Object.prototype.hasOwnProperty.call(C,e)){let r=`${n}${o}${e}`;t[e]=x&&!m?this.translate(r,{...i,defaultValue:La(S)?S[e]:void 0,joinArrays:!1,ns:c}):this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=C[e])}m=t}}else if(y&&G(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=S),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&S!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?S:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.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 e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);ne&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||S)})}):n(e,s,S))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=G(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!G(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=G(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=Na.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return G(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?Z(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!G(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(G(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!Ia[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(Ia[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!G(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},za=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=X.create(`languageUtils`)}getScriptPartFromCode(e){if(e=Y(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=Y(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(G(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}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 t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),G(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return G(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):G(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},Ba={zero:0,one:1,two:2,few:3,many:4,other:5},Va={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},Ha=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=X.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=Y(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),Va;if(!e.match(/-|_/))return Va;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>Ba[e]-Ba[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},Ua=(e,t,n,r=`.`,i=!0)=>{let a=xa(e,t,n);return!a&&i&&G(n)&&(a=ka(e,n,r),a===void 0&&(a=ka(t,n,r))),a},Wa=e=>e.replace(/\$/g,`$$$$`),Ga=class{constructor(e={}){this.logger=X.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?wa:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?J(i):a||`{{`,this.suffix=o?J(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?J(d):f||J(`$t(`),this.nestingSuffix=p?J(p):m||J(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=Ua(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Ua(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Wa(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Wa(this.escape(e)):Wa(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0){if(typeof l==`function`){let t=l(e,i,r);a=G(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``}else!G(a)&&!this.useRawValueToEscape&&(a=pa(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${J(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!G(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!G(i))return i;G(i)||(i=pa(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Ka=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},qa=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(Y(r),i),t[o]=s),s(n)}},Ja=e=>(t,n,r)=>e(Y(n),r)(t),Ya=class{constructor(e={}){this.logger=X.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?qa:Ja;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=qa(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Ka(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}},Xa=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Za=class extends ja{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=X.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{ya(n.loaded,[i],a),Xa(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();G(e)&&(e=this.languageUtils.toResolveHierarchy(e)),G(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" 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?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}},Qa=()=>({debug:!1,initAsync:!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:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),G(e[1])&&(t.defaultValue=e[1]),G(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),$a=e=>(G(e.ns)&&(e.ns=[e.ns]),G(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),G(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),eo=()=>{},to=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},no=`__i18next_supportNoticeShown`,ro=()=>!!(typeof globalThis<`u`&&globalThis[no]||typeof process<`u`&&{}.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`),io=()=>{typeof globalThis<`u`&&(globalThis[no]=!0)},ao=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),Q=class e extends ja{constructor(e={},t){if(super(),this.options=$a(e),this.services={},this.logger=X,this.modules={external:[]},to(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(G(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=Qa();this.options={...n,...this.options,...$a(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!ao(this)&&!ro()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),io());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?X.init(r(this.modules.logger),this.options):X.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Ya;let t=new za(this.options);this.store=new Ma(this.options.resources,this.options);let i=this.services;i.logger=X,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new Ha(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new Ga(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Za(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new Ra(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=eo,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[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(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=K(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,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),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=eo){let n=t,r=G(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=K();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=eo,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw 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`&&Na.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 e=0;e<this.languages.length;e++){let t=this.languages[e];if(!([`cimode`,`dev`].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=K();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=G(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(G(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};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),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=Z(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=Z(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=Z(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return G(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){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=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=K();return this.options.ns?(G(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=K();G(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`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`.split(`.`),n=this.services?.languageUtils||new za(Qa());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=eo){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new Ma(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...Qa().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new Ga(n)}return a.translator=new Ra(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();Q.createInstance,Q.dir,Q.init,Q.loadResources,Q.reloadResources,Q.use,Q.changeLanguage,Q.getFixedT,Q.t,Q.exists,Q.setDefaultNamespace,Q.hasLoadedNamespace,Q.loadNamespaces,Q.loadLanguages;var oo=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,so={"&amp;":`&`,"&#38;":`&`,"&lt;":`<`,"&#60;":`<`,"&gt;":`>`,"&#62;":`>`,"&apos;":`'`,"&#39;":`'`,"&quot;":`"`,"&#34;":`"`,"&nbsp;":` `,"&#160;":` `,"&copy;":`©`,"&#169;":`©`,"&reg;":`®`,"&#174;":`®`,"&hellip;":`…`,"&#8230;":`…`,"&#x2F;":`/`,"&#47;":`/`},co=e=>so[e],lo={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(oo,co),transDefaultProps:void 0},uo=(e={})=>{lo={...lo,...e}},fo={type:`3rdParty`,init(e){uo(e.options.react)}},po=new Map,mo=500,$;function ho(){if($===void 0)try{$=new Intl.NumberFormat(`en-US`,{useGrouping:!1,maximumFractionDigits:0}).format(`9007199254740993`)===`9007199254740993`}catch{$=!1}return $}var go=15;function _o(e){if(!(typeof e!=`string`||ho())&&e.replace(/[^0-9]/g,``).replace(/^0+/,``).length>go)throw Error(`Cannot format the amount '${e}' exactly: this runtime's Intl implementation predates ES2023 string support and would lose precision. Use a runtime with ES2023 Intl support (for example Node 20+), or pass a value within 15 significant digits.`)}function vo(e,t,n){return`${e}|${t}|${Object.entries(n).filter(([,e])=>e!==void 0).sort(([e],[t])=>e<t?-1:1).map(([e,t])=>`${e}=${String(t)}`).join(`&`)}`}function yo(e,t,n){let r=vo(e,t,n),i=po.get(r);return i||(i=new Intl.NumberFormat(e,{...n,style:`currency`,currency:t}),po.size>=mo&&po.clear(),po.set(r,i)),i}function bo(e,{value:t,currency:n},r={}){return _o(t),yo(e,n,r).format(t)}function xo(e,{value:t,currency:n},r={}){return _o(t),yo(e,n,r).formatToParts(t)}function So(e){return Ni().find(e=>e.primary)?.id??e}function Co(e,t){let{locale:n,...r}=t??{},i=n??e.essentials?.locale;if(!i)throw Error(`Host locale is not available on the current host. Make sure to use an updated version of the host initialization package.`);return{locale:i,formatOptions:r}}var wo=fa({getLanguage:e=>()=>{let t=e.essentials?.language;if(!t)throw Error(`Host language is not available on the current host. Make sure to use an updated version of the host initialization package.`);return t},getLocale:e=>()=>{let t=e.essentials?.locale;if(!t)throw Error(`Host locale is not available on the current host. Make sure to use an updated version of the host initialization package.`);return t},formatCurrency:e=>(t,n)=>{let{locale:r,formatOptions:i}=Co(e,n);return bo(r,t,i)},formatCurrencyToParts:e=>(t,n)=>{let{locale:r,formatOptions:i}=Co(e,n);return xo(r,t,i)},getTranslationFunction:e=>()=>{let t=e.translations?.();if(!t)throw Error(`Host translation resources are not available.`);let n=Q.createInstance(),r=So(e.essentials?.language)||`en`,i={lng:e.essentials?.language||r,fallbackLng:r,resources:t};return n.use(fo).init(i,e=>{if(e)throw e}),n.t.bind(n)}}),To=class{constructor(e){this.message=e,this.captureException=()=>{console.error(this.message)},this.captureMessage=()=>{console.error(this.message)},this.startSpan=(e,t)=>(console.error(this.message),t(void 0)),this.startSpanManual=()=>(console.error(this.message),{end:()=>{},fail:()=>{}}),this.endSpanManual=()=>{console.error(this.message)},this.addBreadcrumb=()=>{console.error(this.message)}}},Eo=e=>new To(e),Do=fa({getMonitoringClient:e=>()=>e.getMonitoringClient?e.getMonitoringClient():Eo(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`)}),Oo={service:`service`,services:`services`,categories:`categories`,locations:`locations`,sessions:`sessions`,timeSlots:`time-slots`,serviceAddOns:`service-addons`,bookingsSettings:`bookings-settings`,serviceCta:`service-cta`,preferences:`preferences`,bookingSummary:`booking-summary`,bookingCheckout:`booking-checkout`,formValues:`form-values`,paymentOptions:`payment-options`,seo:`seo`,warmup:`warmup`,reschedule:`reschedule`};function ko(e){try{let t=Do.getMonitoringClient?.();return t&&typeof t[e]==`function`?t:null}catch{return null}}function Ao(e,{feature:t,action:n,level:r=`error`,contexts:i}){let a=ko(`captureException`);if(!a)return;let o=e instanceof Error?e:Error(String(e));a.captureException(o,{level:r,tags:{feature:t,action:n},...i?{contexts:i}:{}})}function jo(e,{feature:t,tags:n},r){let i=ko(`startSpanManual`);if(!i)return r;let a=i.startSpanManual({name:e,tags:{feature:t,...n}});return r.then(()=>a.end(),e=>a.fail(e)),r}var Mo=class extends e{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){Ao(e,{feature:this.props.feature??`service`,action:`render`,contexts:{react:{componentStack:t.componentStack}}})}render(){return this.state.hasError?this.props.fallback:this.props.children}};function No(e){let t=e;if(t.__state||(t.__state={status:`pending`},t.then(e=>{t.__state={status:`fulfilled`,value:e}},e=>{t.__state={status:`rejected`,reason:e}})),t.__state.status===`fulfilled`)return t.__state.value;throw t.__state.status===`rejected`?t.__state.reason:t}function Po(e){let t=Promise.resolve(e);return t.__state={status:`fulfilled`,value:e},t}var Fo=new WeakMap;function Io(e,t,n){let r=Fo.get(e);r||(r=new WeakMap,Fo.set(e,r));let i=r.get(t);i||(i=new WeakMap,r.set(t,i));let a=i.get(n);if(!a){let r=e;a=r.__state?.status===`fulfilled`?Po(t(r.__state.value)):r.__state?.status===`rejected`?Po(n(r.__state.reason)):e.then(t,n),i.set(n,a)}return a}function Lo(e){return e}var Ro=Lo(`@wix/site-service-warmup-data`);function zo(){try{return u()}catch{return null}}function Bo(e){try{return e?e(Ro):null}catch{return null}}function Vo(){let e=Bo(zo()),t=typeof window>`u`;return{scope:e??void 0,get:async n=>{if(t||!e)return null;try{return await e.get(n)}catch(e){return Ao(e,{feature:Oo.warmup,action:`read`,level:`warning`,contexts:{warmup:{key:n}}}),null}},set:(n,r)=>{if(t&&e)try{e.set(n,r)}catch{}}}}var Ho=Lo(`@wix/site-service-locale`),Uo=Lo,Wo=Uo(`@wix/viewer-service-multilingual`);function Go(){try{return wo.getLanguage()??`en`}catch{return`en`}}function Ko(e){try{return d(e)}catch{return null}}function qo(){let e=Ko(Ho),t=Ko(Wo);return t?.multilingualEnabled&&t.currentLocale?.languageCode||e?.language||Go()}var Jo=[],Yo=[],Xo=`useServiceAddOnsContext must be used within ServiceAddOnsContextProvider`;function Zo({isLoading:e,hasError:t,children:n}){let r={addOnGroups:Jo,selected:Yo,isLoading:e,hasError:t,toggleAddOn:()=>{},setAddOnQuantity:()=>{}};return f(Xs.Provider,{value:r,children:n})}function Qo({children:e}){return f(Zo,{isLoading:!0,hasError:!1,children:e})}function $o({children:e}){return f(Zo,{isLoading:!1,hasError:!0,children:e})}function es(e){if(!e)return;let t=``;return(e.filename||e.altText)&&(t=`/${encodeURIComponent(e.filename||e.altText)}`),e.id?`wix:image://v1/${e.id}${t}#originWidth=${e.width}&originHeight=${e.height}`:e.url}var ts=[{path:`addOnGroupsDetails.addOns.mainMedia.image.urlExpirationDate`}];function ns(e){return ii(Object.assign(e,{domainToMappings:{"*.dev.wix-code.com":[{srcPath:`/_api/services-2`,destPath:``},{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"www.wixapis.com":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`},{srcPath:`/bookings/services/v2/bulk/services`,destPath:`/v2/bulk/services`}],"manage._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/_api/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`}],"editor._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/_api/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`}],"blocks._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/_api/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`}],"create.editorx":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`},{srcPath:`/_api/bookings/v2/bulk/services`,destPath:`/v2/bulk/services`}],_:[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"www._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"bo._base_domain_":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"wixbo.ai":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"wix-bo.com":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"editor.wixapps.net":[{srcPath:`/_api/bookings/v2/services`,destPath:`/v2/services`}],"api._api_base_domain_":[{srcPath:`/services-2`,destPath:``}]}}))}var rs=`@wix/auto_sdk_bookings_services`;function is(e){function t({host:t}){return{entityFqdn:`wix.bookings.services.v2.service`,method:`POST`,methodFqn:`wix.bookings.services.v2.AddOnGroupsService.ListAddOnGroupsByServiceId`,packageName:rs,migrationOptions:{optInTransformResponse:!0},url:ns({protoPath:`/v2/services/add-on-groups/list-add-on-groups-by-service-id`,data:e,host:t}),data:e,transformResponse:e=>Ir(e,[{transformFn:Cr,paths:ts}])}}return t}var as=[{path:`addOnGroupsDetails.addOns.mainMedia.image`}];async function os(e,t){let{httpClient:n,sideEffects:r}=arguments[2],i=is(xr({serviceId:e,groupIds:t?.groupIds}));r?.onSiteCall?.();try{let e=await n.request(i);return r?.onSuccess?.(e),Sr(Ir(e.data,[{transformFn:es,paths:as}]))}catch(e){let t=Kr(e,{spreadPathsToArguments:{},explicitPathsToArguments:{serviceId:`$[0]`,groupIds:`$[1].groupIds`},singleArgumentUnchanged:!1},[`serviceId`,`options`]);throw r?.onError?.(e),t}}function ss(e){return(t,n)=>os(t,n,{httpClient:e})}var cs=ri(ss);function ls(e,t){let n=e?.value,r=e?.currency;if(n==null||!r)return null;let i=Number(n);if(!Number.isFinite(i))return null;let a=i%1==0?0:2;return new Intl.NumberFormat(t,{style:`currency`,currency:r,currencyDisplay:`symbol`,maximumFractionDigits:a,minimumFractionDigits:a}).format(i).replace(/\p{Zs}/gu,`\xA0`)}async function us(e){return(await cs(e)).addOnGroupsDetails??[]}function ds(e){if(!e)return null;try{let{id:t,url:n,width:r,height:i}=pr.getImageUrl(e);return t&&n?{uri:t,url:n,width:r,height:i}:null}catch{return null}}function fs(e,t){let n=e.price?.value==null?null:Number(e.price.value);return{addOnId:e.addOnId??null,addOnName:e.nameTranslated??e.name??null,addOnPrice:ls(e.price,t),addOnPriceValue:n!=null&&Number.isFinite(n)?n:null,addOnCurrency:e.price?.currency??null,durationInMinutes:e.durationInMinutes??null,maxQuantity:e.maxQuantity??null,addOnImage:ds(e.mainMedia?.image),isSelected:!1,selectedQuantity:0}}function ps(e,t){return e.map(e=>({groupId:e.groupId??null,groupName:e.groupNameTranslated??e.groupName??null,prompt:e.promptTranslated??e.prompt??null,maxNumberOfAddOns:e.maxNumberOfAddOns??null,addOns:(e.addOns??[]).map(e=>fs(e,t)),selectedCount:0,canSelectMore:!0}))}var ms=`bookings-uou`;function hs(e,t,n){return`${ms}:${e}:addons:${t}:${n}`}var gs=5e3,_s=100,vs=`wix-warmup-data`,ys=null;function bs(e){if(typeof document<`u`)try{let t=document.getElementById(vs)?.textContent;return t?(ys?.text!==t&&(ys={text:t,data:JSON.parse(t).builderComponentsWarmupData??{}}),ys.data[e]??void 0):void 0}catch{return}}var xs=()=>({promises:new Map,invalidatedWarmup:new Set}),Ss=xs(),Cs=new WeakMap,ws=new WeakMap;function Ts(e){if(!e)return Ss;let t=Cs.get(e);return t||(t=xs(),Cs.set(e,t)),t}function Es({key:e,warmupData:t,fetchData:n,refresh:r=!1}){if(e===null)return n();if(typeof window>`u`){let r=()=>n().then(n=>(t.set(e,n),n)),{scope:i}=t;if(!i)return r();let a=ws.get(i);a||(a=new Map,ws.set(i,a));let o=a.get(e);if(o)return o;let s=r();return a.set(e,s),s.catch(()=>a.delete(e)),s}let i=Ts(t.scope),a=Date.now();for(let[e,t]of i.promises)t.expiresAt<=a&&i.promises.delete(e);let o=i.promises.get(e);if(o&&!r)return o.promise;r&&i.invalidatedWarmup.add(e);let s=!i.invalidatedWarmup.has(e);if(s){let t=bs(e);if(t!==void 0){let n=Po(t);return i.promises.set(e,{promise:n,expiresAt:a+gs}),n}}let c=(async()=>{if(s){let n=await t.get(e);if(n!=null)return n}return n()})();i.promises.size>=_s&&i.promises.delete(i.promises.keys().next().value);let l={promise:c,expiresAt:1/0};return i.promises.set(e,l),c.then(()=>{l.expiresAt=Date.now()+gs},()=>{i.promises.get(e)===l&&i.promises.delete(e)}),c}function Ds(e,t){return jo(`service-addons-context-load`,{feature:Oo.serviceAddOns,tags:{serviceId:e}},us(e)).then(e=>ps(e,t),t=>{throw Ao(t,{feature:Oo.serviceAddOns,action:`fetch-add-on-groups`,level:`warning`,contexts:{service:{serviceId:e}}}),t})}function Os({serviceId:e,locale:t,language:n,warmupData:r}){return Es({key:hs(n,e,t),warmupData:r,fetchData:()=>Ds(e,t)})}var ks=Uo(`@wix/site-service-business-logger`);function As(e){return{evid:32,src:16,endpoint:``,params:e}}var js=Lo(`@wix/site-service-url`),Ms=`appSectionParams`;function Ns(e){let t=e.searchParams.get(Ms);if(t===null)return e;let n=new URL(e);n.searchParams.delete(Ms);for(let[e,r]of Object.entries(Ps(t)))typeof r==`string`&&!n.searchParams.has(e)&&n.searchParams.set(e,r);return n}function Ps(e){try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}var Fs=`bookings-uou:url-change`,Is=e=>{let t=new URL(e);return t.searchParams.sort(),t.href};function Ls(e,{disableScrollToTop:t,skipHistory:n}={}){let r=globalThis.window;if(!r?.history)return;let i=new URL(r.location.href);if(Is(i)===Is(e))return;let a={scrollY:r.scrollY};if(n)r.history.replaceState(a,``,e.href);else{r.history.replaceState(a,``,i.href);try{r.history.pushState(t?a:null,``,e.href)}catch{return}}r.dispatchEvent(new Event(Fs))}function Rs(e){let t=globalThis.window;return t?(t.addEventListener(Fs,e),t.addEventListener(`popstate`,e),()=>{t.removeEventListener(Fs,e),t.removeEventListener(`popstate`,e)}):()=>{}}var zs=e=>{try{return decodeURIComponent(e)}catch{return e}};function Bs(e,t){let n=t?new URL(t).pathname:`/`;return`./${zs(new URL(e).pathname.replace(n,``).replace(/^\/|\/$/g,``))}`}function Vs(){let e=d(js),t=r(()=>e.currentUrl,[e]),n=c(Rs,t,t),i=o(()=>Ns(new URL(n)),[n]),a=e.siteUrl.replace(/\/$/,``);return{pathname:i.pathname,search:i.search,searchParams:i.searchParams,href:i.href,getParsedUrl:()=>Ns(new URL(e.currentUrl)),getRelativeUrl:()=>Bs(e.currentUrl,a),getExternalBaseUrl:()=>a,pushUrl:Ls}}var Hs=function(e){return e.BOOK_ONLINE=`bookingsBookOnline`,e.SERVICE_PAGE=`bookingsServicePage`,e.CALENDAR_PAGE=`bookingsCalendar`,e.FORM_PAGE=`bookingsForm`,e}({}),Us={SERVICES:`services_context`,SERVICE:`service_context`,TIME_SLOTS:`time_slots_context`,BOOKING_CHECKOUT:`booking_checkout_context`,CATEGORIES:`categories_context`,LOCATIONS:`locations_context`,SERVICE_ADD_ONS:`service_addons_context`,PREFERENCES:`preferences_context`};Hs.BOOK_ONLINE;var Ws=`new_bookings_server`,Gs=e=>{let{reportBi:t}=d(ks);return r(n=>{t({widget_name:e,bookingsPlatform:Ws,is_over_editor:!1,...n.params,src:n.src,evid:n.evid},{endpoint:n.endpoint})},[t,e])},Ks=(e,t=!0)=>{let n=Gs(e),{getParsedUrl:r}=Vs(),i=s(!1);a(()=>{t&&!i.current&&(i.current=!0,n(As({referralInfo:r().searchParams.get(aa.referral)??void 0})))},[t,n,r])},qs=Po({addOnGroups:Jo,hasError:!1}),Js=e=>({addOnGroups:e,hasError:!1}),Ys=()=>({addOnGroups:Jo,hasError:!0}),Xs=n(null);function Zs(){let e=i(Xs);if(!e)throw Error(Xo);return e}function Qs({addOnsPromise:e,isLoading:t,pickedAddOns:n,forwardToggleAddOn:i,forwardSetAddOnQuantity:a,children:c}){let{addOnGroups:l,hasError:u}=No(e),d=o(()=>U(l,n),[l,n]),p=o(()=>na(l,d),[l,d]),m=s({source:n,picks:n});m.current.source!==n&&(m.current={source:n,picks:n});let h=e=>{let t=m.current;t.picks=W(e({serviceId:``,addOns:t.picks}))},g=r(()=>{let e=m.current,t=U(l,e.picks);return e.picks.filter(e=>!t.includes(e)).forEach(e=>a(e.id,0)),e.picks=t,t},[l,a]),_=r(e=>{let n=U(l,m.current.picks);!t&&ra(l,n,e)&&(g(),i(e),h(t=>sa(t,e)))},[t,l,g,i]),v=r((e,n)=>{let r=t?null:$i(l,e);if(!r)return;let i=U(l,m.current.picks),o=i.find(t=>t.id===e)?.quantity??0,s=ia(r,n);s===o||o===0&&!ra(l,i,e)||(g(),a(e,s),h(t=>ca(t,e,s)))},[t,l,g,a]),y=o(()=>({addOnGroups:p,selected:d,isLoading:t,hasError:u,toggleAddOn:_,setAddOnQuantity:v}),[p,d,t,u,_,v]);return f(Xs.Provider,{value:y,children:c})}function $s({children:e}){let{service:n,serviceId:r,hasAddOns:i,locale:a,isLoading:s,bookingsSettingsLoading:c,selection:u,toggleAddOn:d,setAddOnQuantity:p}=l();Ks(Us.SERVICE_ADD_ONS,!s&&!c);let m=o(()=>W(u),[u]),h=Vo(),g=qo(),_=n&&i&&r?r:null,v=o(()=>_?Io(Os({serviceId:_,locale:a,language:g,warmupData:h}),Js,Ys):qs,[_,a,g]),y=!_&&!!s;return f(Mo,{fallback:f($o,{children:e}),feature:Oo.serviceAddOns,children:f(t,{fallback:f(Qo,{children:e}),children:f(Qs,{addOnsPromise:v,isLoading:y,pickedAddOns:m,forwardToggleAddOn:d,forwardSetAddOnQuantity:p,children:e})})})}var ec=Qi(`bcc1b809-bde5-4d7d-a7bb-89831fe5ccb8`);export{$s as default,ec as injectAccessTokenGetter,Xs as serviceAddOnsContext,Zs as useServiceAddOnsContext};
2
+ //# sourceMappingURL=context-provider-bcc1b809-bde5-4d7d-a7bb-89831fe5ccb8-BFgaPMcI.js.map