@wix/bookings 1.0.1796 → 1.0.1797

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 (71) hide show
  1. package/build/cjs/context-booking-checkout.d.ts +3 -37
  2. package/build/cjs/context-booking-checkout.js +1350 -1340
  3. package/build/cjs/context-booking-checkout.js.map +1 -1
  4. package/build/cjs/context-categories.d.ts +1 -3
  5. package/build/cjs/context-categories.js +20 -43
  6. package/build/cjs/context-categories.js.map +1 -1
  7. package/build/cjs/context-locations.d.ts +1 -1
  8. package/build/cjs/context-locations.js +20 -43
  9. package/build/cjs/context-locations.js.map +1 -1
  10. package/build/cjs/context-service-addons.d.ts +1 -15
  11. package/build/cjs/context-service-addons.js +20 -43
  12. package/build/cjs/context-service-addons.js.map +1 -1
  13. package/build/cjs/context-service.d.ts +1 -65
  14. package/build/cjs/context-service.js +363 -386
  15. package/build/cjs/context-service.js.map +1 -1
  16. package/build/cjs/context-services.d.ts +1 -23
  17. package/build/cjs/context-services.js +542 -566
  18. package/build/cjs/context-services.js.map +1 -1
  19. package/build/cjs/context-time-slots.d.ts +1 -21
  20. package/build/cjs/context-time-slots.js +588 -615
  21. package/build/cjs/context-time-slots.js.map +1 -1
  22. package/build/es/context-booking-checkout.d.mts +3 -37
  23. package/build/es/context-booking-checkout.mjs +1350 -1340
  24. package/build/es/context-booking-checkout.mjs.map +1 -1
  25. package/build/es/context-categories.d.mts +1 -3
  26. package/build/es/context-categories.mjs +20 -43
  27. package/build/es/context-categories.mjs.map +1 -1
  28. package/build/es/context-locations.d.mts +1 -1
  29. package/build/es/context-locations.mjs +20 -43
  30. package/build/es/context-locations.mjs.map +1 -1
  31. package/build/es/context-service-addons.d.mts +1 -15
  32. package/build/es/context-service-addons.mjs +20 -43
  33. package/build/es/context-service-addons.mjs.map +1 -1
  34. package/build/es/context-service.d.mts +1 -65
  35. package/build/es/context-service.mjs +363 -386
  36. package/build/es/context-service.mjs.map +1 -1
  37. package/build/es/context-services.d.mts +1 -23
  38. package/build/es/context-services.mjs +542 -566
  39. package/build/es/context-services.mjs.map +1 -1
  40. package/build/es/context-time-slots.d.mts +1 -21
  41. package/build/es/context-time-slots.mjs +588 -615
  42. package/build/es/context-time-slots.mjs.map +1 -1
  43. package/build/internal/cjs/context-booking-checkout.d.ts +3 -37
  44. package/build/internal/cjs/context-categories.d.ts +1 -3
  45. package/build/internal/cjs/context-locations.d.ts +1 -1
  46. package/build/internal/cjs/context-service-addons.d.ts +1 -15
  47. package/build/internal/cjs/context-service.d.ts +1 -65
  48. package/build/internal/cjs/context-services.d.ts +1 -23
  49. package/build/internal/cjs/context-time-slots.d.ts +1 -21
  50. package/build/internal/es/context-booking-checkout.d.mts +3 -37
  51. package/build/internal/es/context-categories.d.mts +1 -3
  52. package/build/internal/es/context-locations.d.mts +1 -1
  53. package/build/internal/es/context-service-addons.d.mts +1 -15
  54. package/build/internal/es/context-service.d.mts +1 -65
  55. package/build/internal/es/context-services.d.mts +1 -23
  56. package/build/internal/es/context-time-slots.d.mts +1 -21
  57. package/context-runtime/context-booking-checkout/runtime.d.ts +3 -38
  58. package/context-runtime/context-booking-checkout/runtime.js +3 -3
  59. package/context-runtime/context-categories/runtime.d.ts +1 -4
  60. package/context-runtime/context-categories/runtime.js +2 -2
  61. package/context-runtime/context-locations/runtime.d.ts +1 -2
  62. package/context-runtime/context-locations/runtime.js +2 -2
  63. package/context-runtime/context-service/runtime.d.ts +1 -66
  64. package/context-runtime/context-service/runtime.js +3 -3
  65. package/context-runtime/context-service-addons/runtime.d.ts +1 -16
  66. package/context-runtime/context-service-addons/runtime.js +2 -2
  67. package/context-runtime/context-services/runtime.d.ts +1 -24
  68. package/context-runtime/context-services/runtime.js +3 -3
  69. package/context-runtime/context-time-slots/runtime.d.ts +1 -22
  70. package/context-runtime/context-time-slots/runtime.js +3 -3
  71. package/package.json +2 -2
@@ -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,useState as c,useSyncExternalStore as l}from"react";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),S=e=>e.__type===`host`;function C(e,t){return e.create(t)}var w=`x-wix-bi-gateway`;function ne(e,t,n){return{[w]:re({environment:`js-sdk${n?`-${n}`:``}`,"package-name":e.packageName??t?.PACKAGE_NAME,"method-fqn":e.methodFqn,entity:e.entityFqdn})}}function re(e){return Object.entries(e).filter(([e,t])=>!!t).map(([e,t])=>`${e}=${t}`).join(`,`)}function ie(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 ae={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function T(e){return ue(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var oe=/([\p{Ll}\d])(\p{Lu})/gu,se=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,ce=`$1\0$2`,le=/[^\p{L}\d]+/giu;function ue(e){let t=e.trim();t=t.replace(oe,ce).replace(se,ce),t=t.replace(le,`\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 de=e=>`validationError`in(e.response?.data?.details??{}),fe=e=>`applicationError`in(e.response?.data?.details??{}),pe=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function me(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(de(e))return he(e,t,n);if(fe(e))return ge(e);if(pe(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:T(n),data:{}},requestId:e.requestId};return E(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return _e(e)}var he=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=ve(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 E(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},E=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),ge=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??T(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 E(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},_e=e=>E(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:T(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),ve=({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:ye(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,ye(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},ye=(e,t)=>{let n=be(e);return n==null?e:e.replace(`$[${n}]`,t[n])},be=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function xe(e,t,n,r,i,a,o,s,c,l,u){return ie(()=>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=ne(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=Ce(s.status,e?.message??s.statusText,e?.details,{requestId:s.headers.get(`X-Wix-Request-Id`),details:e}),n=me(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 Se=class extends Error{response;requestId;constructor(e){super(),this.response=e.response,this.requestId=e.requestId}},Ce=(e,t,n,r)=>new Se({response:{data:{details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t},status:e},requestId:r?.requestId}),we=`.`;function Te(e,t,n){if(e==null)throw Error(`Cannot set value on null or undefined`);let r=Ee(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 Ee(e){return Array.isArray(e)?e:e.split(we).map(e=>De(e)?Number(e):e)}function De(e){return/^\d+$/.test(e)}function Oe(e){let t={};for(let[n,r]of Object.entries(e))ke(n)||Te(t,Ee(n),r);return t}function ke(e){return e===`__proto__`||e===`constructor`||e===`prototype`}var Ae=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])),Oe(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 ae?ae[e]:void 0;if(i&&i in t){r.push(i),n=t[i];return}let a=Pe(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 je(e,t){let n=e?.modifiedFields;if(!n)return null;let r=Me(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=Ne(s,a);return c===null?null:(o.modifiedFields=c,o)}function Me(e){if(typeof e==`object`&&e&&!Array.isArray(e))try{let t=new Ae(e);return{unflattenedModifiedFields:t.unflatten(),modifiedFieldsManipulator:t}}catch{return null}return null}function Ne(e,t){if(typeof e==`object`&&e&&!Array.isArray(e))try{return t.flatten(e)}catch{return null}return null}function Pe(e){return e.replace(/[-_\s]+(.)?/g,(e,t)=>t?t.toUpperCase():``).replace(/^./,e=>e.toLowerCase())}function Fe(){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 Ie=e=>e.__type===`event-definition`;function Le(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=je(s,a);if(e)return t(e)}}return t(a(o))}function Re(e){let t=new Map,n=Fe();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})=>Le(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})=>Le(t,n,e.payload,{instanceId:e.instanceId,identity:e.identity})))},apps:{AppInstalled:m(`AppInstalled`)(),AppRemoved:m(`AppRemoved`)()}}}}var ze=e=>e.__type===`service-plugin-definition`;function Be(e){let t=new Map,n=Fe();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 D=`X-Wix-Consistent`;function Ve(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`]?{[D]:t[D]}:{}},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=O(e);return a&&(t[D]=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=O(e);return a&&(t[D]=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}=Be(i),{client:u,initModule:d}=Re(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`]?{[D]:t[D]}:{}}}),u=O(l);return u&&(t[D]=u),l},m=(t,n)=>{if(Ie(t))return d(t);if(ze(t))return l(t);if(S(t)&&e.host)return C(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 xe(ie(()=>_(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 O(e){return e.headers?.get(`X-Wix-Consistent`)??e.headers?.get(`x-wix-consistent`)}var He={_id:`id`,_createdDate:`createdDate`,_updatedDate:`updatedDate`},Ue={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function We(e,t){return e?.split(`.`).map(e=>t?.[e]??e).join(`.`)}var Ge=`sort.fieldName`;function Ke(e,t,n){return(e===Ge||e.endsWith(`.${Ge}`))&&typeof t==`string`?We(t,n):t}function qe(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=Je(e,t);s!==e&&!(s in a)&&(a[s]=a[e],delete a[e]),a[s]=Ke(o,a[s],t),i(a[s],o)})}};return i(e,``),e}function Je(e,t){let n;return n=e.includes(`.`)?e.split(`.`).map(e=>t[e]??e).join(`.`):t[e]??e,n}function Ye(e,t=[]){return qe(e,He,t)}function Xe(e,t=[]){return qe(e,Ue,t)}var Ze=new WeakMap;function k(){return{leaves:void 0,fields:void 0,mapFields:void 0,anyField:void 0}}function Qe(e,t){let n=e.get(t);return n||(n=k(),e.set(t,n)),n}function $e(e,t){return t===`*`?(e.anyField??=k(),e.anyField):t.endsWith(`{}`)?(e.mapFields??=new Map,Qe(e.mapFields,t.slice(0,-2))):(e.fields??=new Map,Qe(e.fields,t))}function et(e){let t=k();for(let n of e){let e=n.path.split(`.`).reduce($e,t);e.leaves??=[],e.leaves.push(n)}return t}function tt(e){let t=Ze.get(e);return t||(t=et(e),Ze.set(e,t)),t}function A(e){return typeof e==`object`&&!!e}function nt(e,{isRepeated:t,isMap:n},r){return t?Array.isArray(e)?e.map(r):e:n?A(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r(t)])):e:r(e)}function j(e,t,n){A(e)&&at(e,t,n)}function rt(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]=nt(e[r],t,n);let t=e[r];Array.isArray(t)?t.forEach(e=>j(e,i,n)):j(t,i,n)}}function it(e,t,n){for(let[r,i]of t){let t=e[r];A(t)&&Object.values(t).forEach(e=>j(e,i,n))}}function at(e,{fields:t,mapFields:n,anyField:r},i){t&&rt(e,t,i),n&&it(e,n,i),r&&Object.values(e).forEach(e=>j(e,r,i))}function ot(e,t){if(!A(e))return e;for(let{paths:n,transformFn:r}of t)at(e,tt(n),r);return e}function st(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}function M(e){return ft(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var ct=/([\p{Ll}\d])(\p{Lu})/gu,lt=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,ut=`$1\0$2`,dt=/[^\p{L}\d]+/giu;function ft(e){let t=e.trim();t=t.replace(ct,ut).replace(lt,ut),t=t.replace(dt,`\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 pt=e=>`validationError`in(e.response?.data?.details??{}),mt=e=>`applicationError`in(e.response?.data?.details??{}),ht=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function gt(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(pt(e))return _t(e,t,n);if(mt(e))return vt(e);if(ht(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:M(n),data:{}},requestId:e.requestId};return N(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return yt(e)}var _t=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=bt(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 N(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},N=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),vt=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??M(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 N(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},yt=e=>N(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:M(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),bt=({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:xt(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,xt(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},xt=(e,t)=>{let n=St(e);return n==null?e:e.replace(`$[${n}]`,t[n])},St=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function Ct(){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 wt(()=>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 wt(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return wt(()=>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 wt(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 Tt(e,t){return((...n)=>{let r=Ct();return r?r.initWixModules(e,t).apply(void 0,n):e.apply(void 0,n)})}function Et(e,t=!1){return Tt(e,t)}function Dt(e){let t=Bt(Rt(e.host),e.domainToMappings);return Yt(Kt(e.protoPath,e.data||{}),t)}var Ot=[`wix.com`,`editorx.com`],kt=`_`,At=`*.`,jt=RegExp(`\\.(${Ot.join(`|`)})$`),Mt=[`42.wixprod.net`,`uw2-edt-1.wixprod.net`,`virginia-edt.wixprod.net`],Nt={"payments.base44.com":`manage.wix.com`,"create.editorx.com":`editor.editorx.com`},Pt=`dev.wix-code.com`,Ft=/{(.*)}/,It=RegExp(`\\.(${Mt.join(`|`)})$`),Lt=RegExp(`.*\\.${Pt}$`);function Rt(e){return zt(e).replace(jt,`._base_domain_`).replace(It,`._api_base_domain_`).replace(Lt,`*.dev.wix-code.com`)}function zt(e){return Nt[e]??e}function Bt(e,t){let n=t[e];if(n)return n;let r=Vt(e,t)??Ht(e,t);if(!r){if(Wt(e)){let e=t[Gt];if(e)return e}let n=t[kt];if(n)return n}return r??[]}function Vt(e,t){return Object.entries(t).find(([t])=>{let[,...n]=e.split(`.`);return n.join(`.`)===t})?.[1]}function Ht(e,t){let[n]=Object.entries(t).filter(([t])=>Ut(e,t)).sort(([e],[t])=>t.length-e.length);if(!n)return;let[,r]=n;return r}function Ut(e,t){if(!t.startsWith(At))return!1;let n=t.slice(1);return e.length>n.length&&e.endsWith(n)}function Wt(e){return!!e.match(/\._base_domain_$/)}var Gt=`www._base_domain_`;function Kt(e,t){return e.split(`/`).map(e=>qt(e,t)).join(`/`)}function qt(e,t){let n=e.match(Ft)||[],r=n[1];return r?Jt(t,r,e,e.replace(n[0],``)):e}function Jt(e,t,n,r){let i=e;for(let e of t.split(`.`)){if(!i)return n;i=i[e]}return`${i}${r}`}function Yt(e,t){let n=t?.find(t=>e.startsWith(t.destPath));return n?n.srcPath+e.slice(n.destPath.length):e}function Xt(e){return e===`NaN`?NaN:e===`Infinity`?1/0:e===`-Infinity`?-1/0:e}function Zt(e){return e&&st({formatted:e.formattedAddress,location:e.geocode,addressLine1:e.addressLine,addressLine2:e.addressLine2,streetAddress:e.streetAddress&&{name:e.streetAddress.name,number:e.streetAddress.number,apt:e.streetAddress.apt,formattedAddressLine:e.streetAddress.formattedAddressLine},hint:e.hint,city:e.city,subdivision:e.subdivision,country:e.country,postalCode:e.postalCode,countryFullname:e.countryFullname,subdivisionFullname:e.subdivisionFullname})}var P;(function(e){e.QUERY_PARAM=`QUERY_PARAM`,e.SUBDOMAIN=`SUBDOMAIN`,e.SUBDIRECTORY=`SUBDIRECTORY`})(P||={});var Qt={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ŋƅ`},$t=(e,t)=>{e.searchParams.set(`lang`,t)},en=(e,t)=>{let n=e.hostname.split(`.`);n[0]===`www`&&(n=n.slice(1)),n=[t,...n],e.hostname=n.join(`.`)},tn=(e,t)=>{e.pathname=`/${t}${e.pathname}`},nn=(e,t)=>{if(!t.languageCode||!t?.resolutionMethod)return e;let n=new URL(e);return(t?.resolutionMethod===`QUERY_PARAM`?$t:t?.resolutionMethod===`SUBDOMAIN`?en:tn)(n,t.languageCode),n.href},rn=(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 an(){let e=on();return e?sn(e):[]}function on(){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 sn(e){try{if(e?.supportedLanguages?.length){let t=e.supportedLanguages,n=t.map(e=>e.languageCode).filter(Boolean),r=e.cleanUrl??dn(n);return t.map(e=>({id:e.languageCode,displayName:cn(e),regionalFormat:[e.locale?.languageCode,e.locale?.country].filter(Boolean).join(`-`),url:ln(e,r),primary:e.isPrimary,resolutionMethod:e.resolutionMethod}))}if(e?.siteLanguages?.length){let t=e.siteLanguages,n=dn(t.map(e=>e.languageCode).filter(Boolean));return t.map(e=>({id:e.languageCode,displayName:cn(e),regionalFormat:e.locale,url:ln(e,n),primary:e.isPrimaryLanguage,resolutionMethod:e.resolutionMethod?un(e.resolutionMethod):void 0}))}}catch(e){return console.warn(`[Multilingual Manager] listSupportedLanguages failed`,e),[]}return console.warn(`[Multilingual Manager] listSupportedLanguages is not available`),[]}function cn(e){let t=Qt[e.languageCode];if(t)return t;let n=e.name??e.countryCode;if(n)return n}function ln(e,t){if(e.url||!t||!e.resolutionMethod)return e.url;if(e.languageCode)try{return nn(t,{languageCode:e.languageCode,countryCode:e.countryCode,resolutionMethod:un(e.resolutionMethod),locale:{languageCode:e.languageCode,country:e.countryCode}})}catch(e){console.warn(`[Multilingual Manager] buildUrlForLanguage failed`,e);return}}function un(e){switch(e){case`QUERY_PARAM`:case`QueryParam`:return P.QUERY_PARAM;case`SUBDOMAIN`:case`Subdomain`:return P.SUBDOMAIN;case`SUBDIRECTORY`:case`Subdirectory`:return P.SUBDIRECTORY;default:return}}function dn(e){let t=typeof window<`u`&&window.location?.href?window.location.href:``;try{return rn(t,e)}catch(e){return console.warn(`[Multilingual Manager] cleanCurrentUrl failed`,e),t}}var fn=`x-wix-currency`,pn=()=>{let e=F(`currency`);if(e)return{[fn]:e}},mn=`x-wix-linguist`,hn=`00000000-0000-0000-0000-000000000000`,gn=`false`,_n=()=>{let e=F(`language`),t=F(`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,F=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:F(`language`),locale:F(`locale`),get passThroughHeaders(){let e={..._n(),...pn()};return Object.keys(e).length>0?e:void 0}}}},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 Ve({auth:r,host:n}).enableContext(`module`),r.getAccessTokenInjector()},En=e=>Tn(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`,e);function Dn(){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 I(()=>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 I(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return I(()=>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 I(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 On(e,t){return{...e,...Object.fromEntries(t.map(t=>[t,(...n)=>{let r=Dn();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 kn(e){return On({__type:`host`,create:t=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:r(t)}),{})},Object.keys(e))}var L=e=>typeof e==`string`,R=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},An=e=>e==null?``:``+e,jn=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},Mn=/###/g,Nn=e=>e&&e.indexOf(`###`)>-1?e.replace(Mn,`.`):e,Pn=e=>!e||L(e),z=(e,t,n)=>{let r=L(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(Pn(e))return{};let t=Nn(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Pn(e)?{}:{obj:e,k:Nn(r[i])}},Fn=(e,t,n)=>{let{obj:r,k:i}=z(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=z(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=z(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},In=(e,t,n,r)=>{let{obj:i,k:a}=z(e,t,Object);i[a]=i[a]||[],i[a].push(n)},B=(e,t)=>{let{obj:n,k:r}=z(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Ln=(e,t,n)=>{let r=B(e,n);return r===void 0?B(t,n):r},Rn=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?L(e[r])||e[r]instanceof String||L(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Rn(e[r],t[r],n):e[r]=t[r]);return e},V=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),zn={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},Bn=e=>L(e)?e.replace(/[&<>"'\/]/g,e=>zn[e]):e,Vn=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}},Hn=[` `,`,`,`?`,`!`,`;`],Un=new Vn(20),Wn=(e,t,n)=>{t||=``,n||=``;let r=Hn.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Un.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},H=(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},U=e=>e?.replace(/_/g,`-`),Gn={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)}},W=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Gn,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:(L(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)}},G=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])})}},Kn=class extends G{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):L(n)&&i?o.push(...n.split(i)):o.push(n)));let s=B(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!L(n)?s:H(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),Fn(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)(L(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=B(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Rn(s,n,i):s={...s,...n},Fn(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}},qn={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}},Jn=Symbol(`i18next/PATH_KEY`);function Yn(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===Jn?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function K(e,t){let{[Jn]:n}=e(Yn()),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 Xn={},Zn=e=>!L(e)&&typeof e!=`boolean`&&typeof e!=`number`,Qn=class e extends G{constructor(e,t={}){super(),jn([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=W.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=Zn(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&&!Wn(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:L(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:L(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=K(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?K(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&&!L(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}):``,S=b&&!i.ordinal&&i.count===0,C=S&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${ee}`]||i[`defaultValue${te}`]||i.defaultValue,w=m;y&&!m&&x&&(w=C);let ne=Zn(w),re=Object.prototype.toString.apply(w);if(y&&w&&ne&&_.indexOf(re)<0&&!(L(v)&&Array.isArray(w))){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,w,{...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(w),t=e?[]:{},n=e?g:h;for(let e in w)if(Object.prototype.hasOwnProperty.call(w,e)){let r=`${n}${o}${e}`;t[e]=x&&!m?this.translate(r,{...i,defaultValue:Zn(C)?C[e]:void 0,joinArrays:!1,ns:c}):this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=w[e])}m=t}}else if(y&&L(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=C),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&C!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?C: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);S&&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}`]||C)})}):n(e,s,C))}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=L(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&&!L(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=L(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=qn.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 L(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?K(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&&!L(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(L(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,!Xn[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(Xn[`${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&&!L(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}},$n=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=W.create(`languageUtils`)}getScriptPartFromCode(e){if(e=U(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=U(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(L(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)),L(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 L(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))):L(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},er={zero:0,one:1,two:2,few:3,many:4,other:5},tr={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},nr=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=W.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=U(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!`),tr;if(!e.match(/-|_/))return tr;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)=>er[e]-er[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))}},rr=(e,t,n,r=`.`,i=!0)=>{let a=Ln(e,t,n);return!a&&i&&L(n)&&(a=H(e,n,r),a===void 0&&(a=H(t,n,r))),a},ir=e=>e.replace(/\$/g,`$$$$`),ar=class{constructor(e={}){this.logger=W.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?Bn:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?V(i):a||`{{`,this.suffix=o?V(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?V(d):f||V(`$t(`),this.nestingSuffix=p?V(p):m||V(`)`),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=rr(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(rr(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=>ir(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?ir(this.escape(e)):ir(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=L(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!L(a)&&!this.useRawValueToEscape&&(a=An(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(`${V(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&&!L(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&&!L(i))return i;L(i)||(i=An(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}},or=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}},sr=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(U(r),i),t[o]=s),s(n)}},cr=e=>(t,n,r)=>e(U(n),r)(t),lr=class{constructor(e={}){this.logger=W.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?sr:cr;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()]=sr(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}=or(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)}},ur=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},dr=class extends G{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=W.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=>{In(n.loaded,[i],a),ur(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();L(e)&&(e=this.languageUtils.toResolveHierarchy(e)),L(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)}}},fr=()=>({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]),L(e[1])&&(t.defaultValue=e[1]),L(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}),pr=e=>(L(e.ns)&&(e.ns=[e.ns]),L(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),L(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),q=()=>{},mr=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},hr=`__i18next_supportNoticeShown`,gr=()=>!!(typeof globalThis<`u`&&globalThis[hr]||typeof process<`u`&&{}.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`),_r=()=>{typeof globalThis<`u`&&(globalThis[hr]=!0)},vr=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)),J=class e extends G{constructor(e={},t){if(super(),this.options=pr(e),this.services={},this.logger=W,this.modules={external:[]},mr(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&&(L(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=fr();this.options={...n,...this.options,...pr(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&&!vr(this)&&!gr()&&(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 💙`),_r());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?W.init(r(this.modules.logger),this.options):W.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:lr;let t=new $n(this.options);this.store=new Kn(this.options.resources,this.options);let i=this.services;i.logger=W,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new nr(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 ar(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new dr(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 Qn(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||=q,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=R(),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=q){let n=t,r=L(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=R();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||=q,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`&&qn.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=R();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=L(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(L(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=K(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=K(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=K(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return L(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=R();return this.options.ns?(L(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=R();L(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 $n(fr());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=q){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 Kn(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={...fr().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new ar(n)}return a.translator=new Qn(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();J.createInstance,J.dir,J.init,J.loadResources,J.reloadResources,J.use,J.changeLanguage,J.getFixedT,J.t,J.exists,J.setDefaultNamespace,J.hasLoadedNamespace,J.loadNamespaces,J.loadLanguages;var yr=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,br={"&amp;":`&`,"&#38;":`&`,"&lt;":`<`,"&#60;":`<`,"&gt;":`>`,"&#62;":`>`,"&apos;":`'`,"&#39;":`'`,"&quot;":`"`,"&#34;":`"`,"&nbsp;":` `,"&#160;":` `,"&copy;":`©`,"&#169;":`©`,"&reg;":`®`,"&#174;":`®`,"&hellip;":`…`,"&#8230;":`…`,"&#x2F;":`/`,"&#47;":`/`},xr=e=>br[e],Sr={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(yr,xr),transDefaultProps:void 0},Cr=(e={})=>{Sr={...Sr,...e}},wr={type:`3rdParty`,init(e){Cr(e.options.react)}},Y=new Map,Tr=500,X;function Er(){if(X===void 0)try{X=new Intl.NumberFormat(`en-US`,{useGrouping:!1,maximumFractionDigits:0}).format(`9007199254740993`)===`9007199254740993`}catch{X=!1}return X}var Dr=15;function Or(e){if(!(typeof e!=`string`||Er())&&e.replace(/[^0-9]/g,``).replace(/^0+/,``).length>Dr)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 kr(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 Ar(e,t,n){let r=kr(e,t,n),i=Y.get(r);return i||(i=new Intl.NumberFormat(e,{...n,style:`currency`,currency:t}),Y.size>=Tr&&Y.clear(),Y.set(r,i)),i}function jr(e,{value:t,currency:n},r={}){return Or(t),Ar(e,n,r).format(t)}function Mr(e,{value:t,currency:n},r={}){return Or(t),Ar(e,n,r).formatToParts(t)}function Nr(e){return an().find(e=>e.primary)?.id??e}function Pr(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 Fr=kn({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}=Pr(e,n);return jr(r,t,i)},formatCurrencyToParts:e=>(t,n)=>{let{locale:r,formatOptions:i}=Pr(e,n);return Mr(r,t,i)},getTranslationFunction:e=>()=>{let t=e.translations?.();if(!t)throw Error(`Host translation resources are not available.`);let n=J.createInstance(),r=Nr(e.essentials?.language)||`en`,i={lng:e.essentials?.language||r,fallbackLng:r,resources:t};return n.use(wr).init(i,e=>{if(e)throw e}),n.t.bind(n)}}),Ir=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)}}},Lr=e=>new Ir(e),Rr=kn({getMonitoringClient:e=>()=>e.getMonitoringClient?e.getMonitoringClient():Lr(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`)}),zr={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 Br(e){try{let t=Rr.getMonitoringClient?.();return t&&typeof t[e]==`function`?t:null}catch{return null}}function Vr(e,{feature:t,action:n,level:r=`error`,contexts:i}){let a=Br(`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 Hr(e,{feature:t,tags:n},r){let i=Br(`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 Ur=class extends e{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){Vr(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 Wr(e){let t=e;return t.__state||(t.__state={status:`pending`},t.then(e=>{t.__state={status:`fulfilled`,value:e}},e=>{t.__state={status:`rejected`,reason:e}})),t.__state}function Gr(e){let t=Wr(e);if(t.status===`fulfilled`)return t.value;throw t.status===`rejected`?t.reason:e}function Kr(e){let t=Promise.resolve(e);return t.__state={status:`fulfilled`,value:e},t}var qr=new WeakMap;function Jr(e,t,n){let r=qr.get(e);r||(r=new WeakMap,qr.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`?Kr(t(r.__state.value)):r.__state?.status===`rejected`?Kr(n(r.__state.reason)):e.then(t,n),i.set(n,a)}return a}function Z(e){return e}var Yr=Z(`@wix/site-service-url`),Xr=`appSectionParams`;function Zr(e){let t=e.searchParams.get(Xr);if(t===null)return e;let n=new URL(e);n.searchParams.delete(Xr);for(let[e,r]of Object.entries(Qr(t)))typeof r==`string`&&!n.searchParams.has(e)&&n.searchParams.set(e,r);return n}function Qr(e){try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}var $r=`bookings-uou:url-change`,ei=e=>{let t=new URL(e);return t.searchParams.sort(),t.href};function ti(e,{disableScrollToTop:t,skipHistory:n}={}){let r=globalThis.window;if(!r?.history)return;let i=new URL(r.location.href);if(ei(i)===ei(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($r))}function ni(e){let t=globalThis.window;return t?(t.addEventListener($r,e),t.addEventListener(`popstate`,e),()=>{t.removeEventListener($r,e),t.removeEventListener(`popstate`,e)}):()=>{}}var ri=e=>{try{return decodeURIComponent(e)}catch{return e}};function ii(e,t){let n=t?new URL(t).pathname:`/`;return`./${ri(new URL(e).pathname.replace(n,``).replace(/^\/|\/$/g,``))}`}function ai(){let e=d(Yr),t=r(()=>e.currentUrl,[e]),n=l(ni,t,t),i=o(()=>Zr(new URL(n)),[n]),a=e.siteUrl.replace(/\/$/,``);return{pathname:i.pathname,search:i.search,searchParams:i.searchParams,href:i.href,getParsedUrl:()=>Zr(new URL(e.currentUrl)),getRelativeUrl:()=>ii(e.currentUrl,a),getExternalBaseUrl:()=>a,pushUrl:ti}}var Q={category:`category`,location:`location`,page:`page`,blob:`bookingSelection`,legacyBlob:`b`,resource:`resource`,referral:`referral`,timezone:`timezone`,bookingId:`bookingId`,token:`token`,rescheduleRedirectUrl:`rescheduleRedirectUrl`},oi=Z(`@wix/site-service-warmup-data`);function si(){try{return u()}catch{return null}}function ci(e){try{return e?e(oi):null}catch{return null}}function li(){let e=ci(si()),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 Vr(e,{feature:zr.warmup,action:`read`,level:`warning`,contexts:{warmup:{key:n}}}),null}},set:(n,r)=>{if(t&&e)try{e.set(n,r)}catch{}}}}var ui=Z(`@wix/site-service-locale`),di=Z,fi=di(`@wix/viewer-service-multilingual`);function pi(){try{return Fr.getLanguage()??`en`}catch{return`en`}}function mi(e){try{return d(e)}catch{return null}}function hi(){let e=mi(ui),t=mi(fi);return t?.multilingualEnabled&&t.currentLocale?.languageCode||e?.language||pi()}var gi=`bookings-uou`;function _i(e){return`${gi}:${e}:locations:all`}var vi=5e3,yi=100,bi=`wix-warmup-data`,xi=null;function Si(e){if(typeof document<`u`)try{let t=document.getElementById(bi)?.textContent;return t?(xi?.text!==t&&(xi={text:t,data:JSON.parse(t).builderComponentsWarmupData??{}}),xi.data[e]??void 0):void 0}catch{return}}var Ci=()=>({promises:new Map,invalidatedWarmup:new Set}),wi=Ci(),Ti=new WeakMap,Ei=new WeakMap;function Di(e){if(!e)return wi;let t=Ti.get(e);return t||(t=Ci(),Ti.set(e,t)),t}function Oi({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=Ei.get(i);a||(a=new Map,Ei.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=Di(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=Si(e);if(t!==void 0){let n=Kr(t);return i.promises.set(e,{promise:n,expiresAt:a+vi}),n}}let c=(async()=>{if(s){let n=await t.get(e);if(n!=null)return n}return n()})();i.promises.size>=yi&&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()+vi},()=>{i.promises.get(e)===l&&i.promises.delete(e)}),c}var ki=[{path:`businessLocations.locations.business.address.geocode.latitude`},{path:`businessLocations.locations.business.address.geocode.longitude`},{path:`businessLocations.locations.custom.address.geocode.latitude`},{path:`businessLocations.locations.custom.address.geocode.longitude`},{path:`businessLocations.locations.calculatedAddress.geocode.latitude`},{path:`businessLocations.locations.calculatedAddress.geocode.longitude`}];function Ai(e){return Dt(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 ji=`@wix/auto_sdk_bookings_services`;function Mi(e){function t({host:t}){return{entityFqdn:`wix.bookings.services.v2.service`,method:`POST`,methodFqn:`wix.bookings.services.v2.ServicesService.QueryLocations`,packageName:ji,migrationOptions:{optInTransformResponse:!0},url:Ai({protoPath:`/v2/services/locations/query`,data:e,host:t}),data:e,transformResponse:e=>ot(e,[{transformFn:Xt,paths:ki}])}}return t}var Ni=[{path:`businessLocations.locations.calculatedAddress`},{path:`businessLocations.locations.business.address`},{path:`businessLocations.locations.custom.address`}];async function Pi(e){let{httpClient:t,sideEffects:n}=arguments[1],r=Mi(Ye({filter:e?.filter}));n?.onSiteCall?.();try{let e=await t.request(r);return n?.onSuccess?.(e),Xe(ot(e.data,[{transformFn:Zt,paths:Ni}]))}catch(e){let t=gt(e,{spreadPathsToArguments:{},explicitPathsToArguments:{filter:`$[0].filter`},singleArgumentUnchanged:!1},[`options`]);throw n?.onError?.(e),t}}function Fi(e){return t=>Pi(t,{httpClient:e})}var Ii=Et(Fi),Li=`13d21c63-b5ec-5912-8397-c3a5ddb27a97`,Ri=function(e){return e.BOOK_ONLINE=`bookingsBookOnline`,e.SERVICE_PAGE=`bookingsServicePage`,e.CALENDAR_PAGE=`bookingsCalendar`,e.FORM_PAGE=`bookingsForm`,e}({});function zi(e){return e.business?._id??null}function Bi(e){return e.business?.name??null}async function Vi(){let e=await Ii({filter:{services:{appId:Li,hidden:!1}}});return{locations:[...e.businessLocations?.locations??[]].sort((e,t)=>(Bi(e)??``).localeCompare(Bi(t)??``)),hasOtherLocations:!!(e.customLocations?.exists||e.customerLocations?.exists)}}function Hi({isLoading:e,hasError:t,refetch:n,children:r}){let{searchParams:i}=ai(),a={locationItems:[],selectedLocationId:i.get(Q.location),hasOtherLocations:!1,hasMultipleLocations:!1,isLoading:e,hasError:t,refetch:n,selectLocation:()=>{}};return f($.Provider,{value:a,children:r})}function Ui({refetch:e,children:t}){return f(Hi,{isLoading:!0,hasError:!1,refetch:e,children:t})}function Wi({refetch:e,children:t}){return f(Hi,{isLoading:!1,hasError:!0,refetch:e,children:t})}var Gi=di(`@wix/site-service-business-logger`);function Ki(e){return{evid:32,src:16,endpoint:``,params:e}}var qi={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`};Ri.BOOK_ONLINE;var Ji=`new_bookings_server`,Yi=e=>{let{reportBi:t}=d(Gi);return r(n=>{t({widget_name:e,bookingsPlatform:Ji,is_over_editor:!1,...n.params,src:n.src,evid:n.evid},{endpoint:n.endpoint})},[t,e])},Xi=(e,t=!0)=>{let n=Yi(e),{getParsedUrl:r}=ai(),i=s(!1);a(()=>{t&&!i.current&&(i.current=!0,n(Ki({referralInfo:r().searchParams.get(Q.referral)??void 0})))},[t,n,r])},$=n(null),Zi=`useLocationsContext must be used within LocationsContextProvider`;function Qi(){let e=i($);if(!e)throw Error(Zi);return e}function $i(e,t){let n=zi(e);return{locationId:n,locationName:Bi(e),isSelected:n!=null&&n===t}}var ea=e=>({...e,hasError:!1}),ta=()=>({locations:[],hasOtherLocations:!1,hasError:!0});function na({locationsPromise:e,refetch:t,children:n}){let{locations:i,hasOtherLocations:s,hasError:c}=Gr(e),{pathname:l,searchParams:u,pushUrl:d,getExternalBaseUrl:p}=ai(),m=u.get(Q.location),h=r((e,t)=>{let n=new URLSearchParams(u);e?n.set(Q.location,e):n.delete(Q.location),n.delete(Q.page);let r=n.toString(),i=r?`${l}?${r}`:l;d(new URL(i,`${p()}/`),{disableScrollToTop:!0,skipHistory:t})},[l,u,d,p]),g=r(e=>h(e,!1),[h]),_=m!=null&&!c&&!(m===`OTHER_LOCATIONS`&&s)&&!i.some(e=>zi(e)===m);a(()=>{_&&h(null,!0)},[_,h]);let v=i.filter(e=>zi(e)).length+ +!!s,y=o(()=>({locationItems:i.map(e=>$i(e,m)),selectedLocationId:m,hasOtherLocations:s,hasMultipleLocations:v>1,isLoading:!1,hasError:c,refetch:t,selectLocation:g}),[i,m,s,c,v,t,g]);return f($.Provider,{value:y,children:n})}function ra({children:e}){Xi(qi.LOCATIONS);let n=li(),i=hi(),[a,s]=c(0),l=o(()=>Jr(Oi({key:_i(i),refresh:a!==0,warmupData:n,fetchData:()=>Hr(`locations-context-load`,{feature:zr.locations},Vi())}),ea,ta),[a,i]),u=r(()=>s(e=>e+1),[]);return f(Ur,{fallback:f(Wi,{refetch:u,children:e}),feature:zr.locations,children:f(t,{fallback:f(Ui,{refetch:u,children:e}),children:f(na,{locationsPromise:l,refetch:u,children:e})})})}var ia=En(`c151d9f7-1582-407c-bb59-59030f244b47`);export{Zi as LOCATIONS_CONTEXT_MISSING_PROVIDER_ERROR,ra as default,ia as injectAccessTokenGetter,$ as locationsContext,Qi as useLocationsContext};
2
- //# sourceMappingURL=context-provider-c151d9f7-1582-407c-bb59-59030f244b47-Dy_vWu-S.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,useState as c,useSyncExternalStore as l}from"react";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),S=e=>e.__type===`host`;function C(e,t){return e.create(t)}var w=`x-wix-bi-gateway`;function ne(e,t,n){return{[w]:re({environment:`js-sdk${n?`-${n}`:``}`,"package-name":e.packageName??t?.PACKAGE_NAME,"method-fqn":e.methodFqn,entity:e.entityFqdn})}}function re(e){return Object.entries(e).filter(([e,t])=>!!t).map(([e,t])=>`${e}=${t}`).join(`,`)}function ie(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 ae={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function T(e){return ue(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var oe=/([\p{Ll}\d])(\p{Lu})/gu,se=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,ce=`$1\0$2`,le=/[^\p{L}\d]+/giu;function ue(e){let t=e.trim();t=t.replace(oe,ce).replace(se,ce),t=t.replace(le,`\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 de=e=>`validationError`in(e.response?.data?.details??{}),fe=e=>`applicationError`in(e.response?.data?.details??{}),pe=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function me(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(de(e))return he(e,t,n);if(fe(e))return ge(e);if(pe(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:T(n),data:{}},requestId:e.requestId};return E(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return _e(e)}var he=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=ve(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 E(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},E=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),ge=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??T(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 E(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},_e=e=>E(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:T(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),ve=({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:ye(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,ye(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},ye=(e,t)=>{let n=be(e);return n==null?e:e.replace(`$[${n}]`,t[n])},be=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function xe(e,t,n,r,i,a,o,s,c,l,u){return ie(()=>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=ne(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=Ce(s.status,e?.message??s.statusText,e?.details,{requestId:s.headers.get(`X-Wix-Request-Id`),details:e}),n=me(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 Se=class extends Error{response;requestId;constructor(e){super(),this.response=e.response,this.requestId=e.requestId}},Ce=(e,t,n,r)=>new Se({response:{data:{details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t},status:e},requestId:r?.requestId}),we=`.`;function Te(e,t,n){if(e==null)throw Error(`Cannot set value on null or undefined`);let r=Ee(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 Ee(e){return Array.isArray(e)?e:e.split(we).map(e=>De(e)?Number(e):e)}function De(e){return/^\d+$/.test(e)}function Oe(e){let t={};for(let[n,r]of Object.entries(e))ke(n)||Te(t,Ee(n),r);return t}function ke(e){return e===`__proto__`||e===`constructor`||e===`prototype`}var Ae=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])),Oe(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 ae?ae[e]:void 0;if(i&&i in t){r.push(i),n=t[i];return}let a=Pe(e);if(a&&a in t)r.push(a),n=t[a];else 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;e in n?o(e,t):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 je(e,t){let n=e?.modifiedFields;if(!n)return null;let r=Me(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=Ne(s,a);return c===null?null:(o.modifiedFields=c,o)}function Me(e){if(typeof e==`object`&&e&&!Array.isArray(e))try{let t=new Ae(e);return{unflattenedModifiedFields:t.unflatten(),modifiedFieldsManipulator:t}}catch{return null}return null}function Ne(e,t){if(typeof e==`object`&&e&&!Array.isArray(e))try{return t.flatten(e)}catch{return null}return null}function Pe(e){return e.replace(/[-_\s]+(.)?/g,(e,t)=>t?t.toUpperCase():``).replace(/^./,e=>e.toLowerCase())}function Fe(){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 Ie=e=>e.__type===`event-definition`;function Le(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=je(s,a);if(e)return t(e)}}return t(a(o))}function Re(e){let t=new Map,n=Fe();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})=>Le(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})=>Le(t,n,e.payload,{instanceId:e.instanceId,identity:e.identity})))},apps:{AppInstalled:m(`AppInstalled`)(),AppRemoved:m(`AppRemoved`)()}}}}var ze=e=>e.__type===`service-plugin-definition`;function Be(e){let t=new Map,n=Fe();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 D=`X-Wix-Consistent`;function Ve(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`]?{[D]:t[D]}:{}},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=O(e);return a&&(t[D]=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=O(e);return a&&(t[D]=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}=Be(i),{client:u,initModule:d}=Re(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`]?{[D]:t[D]}:{}}}),u=O(l);return u&&(t[D]=u),l},m=(t,n)=>{if(Ie(t))return d(t);if(ze(t))return l(t);if(S(t)&&e.host)return C(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 xe(ie(()=>_(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 O(e){return e.headers?.get(`X-Wix-Consistent`)??e.headers?.get(`x-wix-consistent`)}var He={_id:`id`,_createdDate:`createdDate`,_updatedDate:`updatedDate`},Ue={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function We(e,t){return e?.split(`.`).map(e=>t?.[e]??e).join(`.`)}var Ge=`sort.fieldName`;function Ke(e,t,n){return(e===Ge||e.endsWith(`.${Ge}`))&&typeof t==`string`?We(t,n):t}function qe(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=Je(e,t);s!==e&&!(s in a)&&(a[s]=a[e],delete a[e]),a[s]=Ke(o,a[s],t),i(a[s],o)})}};return i(e,``),e}function Je(e,t){let n;return n=e.includes(`.`)?e.split(`.`).map(e=>t[e]??e).join(`.`):t[e]??e,n}function Ye(e,t=[]){return qe(e,He,t)}function Xe(e,t=[]){return qe(e,Ue,t)}var Ze=new WeakMap;function k(){return{leaves:void 0,fields:void 0,mapFields:void 0,anyField:void 0}}function Qe(e,t){let n=e.get(t);return n||(n=k(),e.set(t,n)),n}function $e(e,t){return t===`*`?(e.anyField??=k(),e.anyField):t.endsWith(`{}`)?(e.mapFields??=new Map,Qe(e.mapFields,t.slice(0,-2))):(e.fields??=new Map,Qe(e.fields,t))}function et(e){let t=k();for(let n of e){let e=n.path.split(`.`).reduce($e,t);e.leaves??=[],e.leaves.push(n)}return t}function tt(e){let t=Ze.get(e);return t||(t=et(e),Ze.set(e,t)),t}function A(e){return typeof e==`object`&&!!e}function nt(e,{isRepeated:t,isMap:n},r){return t?Array.isArray(e)?e.map(r):e:n?A(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r(t)])):e:r(e)}function j(e,t,n){A(e)&&at(e,t,n)}function rt(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]=nt(e[r],t,n);let t=e[r];Array.isArray(t)?t.forEach(e=>j(e,i,n)):j(t,i,n)}}function it(e,t,n){for(let[r,i]of t){let t=e[r];A(t)&&Object.values(t).forEach(e=>j(e,i,n))}}function at(e,{fields:t,mapFields:n,anyField:r},i){t&&rt(e,t,i),n&&it(e,n,i),r&&Object.values(e).forEach(e=>j(e,r,i))}function ot(e,t){if(!A(e))return e;for(let{paths:n,transformFn:r}of t)at(e,tt(n),r);return e}function st(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}function M(e){return ft(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var ct=/([\p{Ll}\d])(\p{Lu})/gu,lt=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,ut=`$1\0$2`,dt=/[^\p{L}\d]+/giu;function ft(e){let t=e.trim();t=t.replace(ct,ut).replace(lt,ut),t=t.replace(dt,`\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 pt=e=>`validationError`in(e.response?.data?.details??{}),mt=e=>`applicationError`in(e.response?.data?.details??{}),ht=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function gt(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(pt(e))return _t(e,t,n);if(mt(e))return vt(e);if(ht(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:M(n),data:{}},requestId:e.requestId};return N(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return yt(e)}var _t=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=bt(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 N(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},N=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),vt=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??M(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 N(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},yt=e=>N(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:M(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),bt=({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:xt(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,xt(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},xt=(e,t)=>{let n=St(e);return n==null?e:e.replace(`$[${n}]`,t[n])},St=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function Ct(){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 wt(()=>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 wt(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return wt(()=>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 wt(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 Tt(e,t){return((...n)=>{let r=Ct();return r?r.initWixModules(e,t).apply(void 0,n):e.apply(void 0,n)})}function Et(e,t=!1){return Tt(e,t)}function Dt(e){let t=Bt(Rt(e.host),e.domainToMappings);return Yt(Kt(e.protoPath,e.data||{}),t)}var Ot=[`wix.com`,`editorx.com`],kt=`_`,At=`*.`,jt=RegExp(`\\.(${Ot.join(`|`)})$`),Mt=[`42.wixprod.net`,`uw2-edt-1.wixprod.net`,`virginia-edt.wixprod.net`],Nt={"payments.base44.com":`manage.wix.com`,"create.editorx.com":`editor.editorx.com`},Pt=`dev.wix-code.com`,Ft=/{(.*)}/,It=RegExp(`\\.(${Mt.join(`|`)})$`),Lt=RegExp(`.*\\.${Pt}$`);function Rt(e){return zt(e).replace(jt,`._base_domain_`).replace(It,`._api_base_domain_`).replace(Lt,`*.dev.wix-code.com`)}function zt(e){return Nt[e]??e}function Bt(e,t){let n=t[e];if(n)return n;let r=Vt(e,t)??Ht(e,t);if(!r){if(Wt(e)){let e=t[Gt];if(e)return e}let n=t[kt];if(n)return n}return r??[]}function Vt(e,t){return Object.entries(t).find(([t])=>{let[,...n]=e.split(`.`);return n.join(`.`)===t})?.[1]}function Ht(e,t){let[n]=Object.entries(t).filter(([t])=>Ut(e,t)).sort(([e],[t])=>t.length-e.length);if(!n)return;let[,r]=n;return r}function Ut(e,t){if(!t.startsWith(At))return!1;let n=t.slice(1);return e.length>n.length&&e.endsWith(n)}function Wt(e){return!!e.match(/\._base_domain_$/)}var Gt=`www._base_domain_`;function Kt(e,t){return e.split(`/`).map(e=>qt(e,t)).join(`/`)}function qt(e,t){let n=e.match(Ft)||[],r=n[1];return r?Jt(t,r,e,e.replace(n[0],``)):e}function Jt(e,t,n,r){let i=e;for(let e of t.split(`.`)){if(!i)return n;i=i[e]}return`${i}${r}`}function Yt(e,t){let n=t?.find(t=>e.startsWith(t.destPath));return n?n.srcPath+e.slice(n.destPath.length):e}function Xt(e){return e===`NaN`?NaN:e===`Infinity`?1/0:e===`-Infinity`?-1/0:e}function Zt(e){return e&&st({formatted:e.formattedAddress,location:e.geocode,addressLine1:e.addressLine,addressLine2:e.addressLine2,streetAddress:e.streetAddress&&{name:e.streetAddress.name,number:e.streetAddress.number,apt:e.streetAddress.apt,formattedAddressLine:e.streetAddress.formattedAddressLine},hint:e.hint,city:e.city,subdivision:e.subdivision,country:e.country,postalCode:e.postalCode,countryFullname:e.countryFullname,subdivisionFullname:e.subdivisionFullname})}var P;(function(e){e.QUERY_PARAM=`QUERY_PARAM`,e.SUBDOMAIN=`SUBDOMAIN`,e.SUBDIRECTORY=`SUBDIRECTORY`})(P||={});var Qt={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ŋƅ`},$t=(e,t)=>{e.searchParams.set(`lang`,t)},en=(e,t)=>{let n=e.hostname.split(`.`);n[0]===`www`&&(n=n.slice(1)),n=[t,...n],e.hostname=n.join(`.`)},tn=(e,t)=>{e.pathname=`/${t}${e.pathname}`},nn=(e,t)=>{if(!t.languageCode||!t?.resolutionMethod)return e;let n=new URL(e);return(t?.resolutionMethod===`QUERY_PARAM`?$t:t?.resolutionMethod===`SUBDOMAIN`?en:tn)(n,t.languageCode),n.href},rn=(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 an(){let e=on();return e?sn(e):[]}function on(){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 sn(e){try{if(e?.supportedLanguages?.length){let t=e.supportedLanguages,n=t.map(e=>e.languageCode).filter(Boolean),r=e.cleanUrl??dn(n);return t.map(e=>({id:e.languageCode,displayName:cn(e),regionalFormat:[e.locale?.languageCode,e.locale?.country].filter(Boolean).join(`-`),url:ln(e,r),primary:e.isPrimary,resolutionMethod:e.resolutionMethod}))}if(e?.siteLanguages?.length){let t=e.siteLanguages,n=dn(t.map(e=>e.languageCode).filter(Boolean));return t.map(e=>({id:e.languageCode,displayName:cn(e),regionalFormat:e.locale,url:ln(e,n),primary:e.isPrimaryLanguage,resolutionMethod:e.resolutionMethod?un(e.resolutionMethod):void 0}))}}catch(e){return console.warn(`[Multilingual Manager] listSupportedLanguages failed`,e),[]}return console.warn(`[Multilingual Manager] listSupportedLanguages is not available`),[]}function cn(e){let t=Qt[e.languageCode];if(t)return t;let n=e.name??e.countryCode;if(n)return n}function ln(e,t){if(e.url||!t||!e.resolutionMethod)return e.url;if(e.languageCode)try{return nn(t,{languageCode:e.languageCode,countryCode:e.countryCode,resolutionMethod:un(e.resolutionMethod),locale:{languageCode:e.languageCode,country:e.countryCode}})}catch(e){console.warn(`[Multilingual Manager] buildUrlForLanguage failed`,e);return}}function un(e){switch(e){case`QUERY_PARAM`:case`QueryParam`:return P.QUERY_PARAM;case`SUBDOMAIN`:case`Subdomain`:return P.SUBDOMAIN;case`SUBDIRECTORY`:case`Subdirectory`:return P.SUBDIRECTORY;default:return}}function dn(e){let t=typeof window<`u`&&window.location?.href?window.location.href:``;try{return rn(t,e)}catch(e){return console.warn(`[Multilingual Manager] cleanCurrentUrl failed`,e),t}}var fn=`x-wix-currency`,pn=()=>{let e=F(`currency`);if(e)return{[fn]:e}},mn=`x-wix-linguist`,hn=`00000000-0000-0000-0000-000000000000`,gn=`false`,_n=()=>{let e=F(`language`),t=F(`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,F=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:F(`language`),locale:F(`locale`),get passThroughHeaders(){let e={..._n(),...pn()};return Object.keys(e).length>0?e:void 0}}}},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 Ve({auth:r,host:n}).enableContext(`module`),r.getAccessTokenInjector()},En=e=>Tn(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`,e);function Dn(){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 I(()=>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 I(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return I(()=>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 I(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 On(e,t){return{...e,...Object.fromEntries(t.map(t=>[t,(...n)=>{let r=Dn();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 kn(e){return On({__type:`host`,create:t=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:r(t)}),{})},Object.keys(e))}var L=e=>typeof e==`string`,R=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},An=e=>e==null?``:``+e,jn=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},Mn=/###/g,Nn=e=>e&&e.indexOf(`###`)>-1?e.replace(Mn,`.`):e,Pn=e=>!e||L(e),z=(e,t,n)=>{let r=L(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(Pn(e))return{};let t=Nn(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Pn(e)?{}:{obj:e,k:Nn(r[i])}},Fn=(e,t,n)=>{let{obj:r,k:i}=z(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=z(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=z(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},In=(e,t,n,r)=>{let{obj:i,k:a}=z(e,t,Object);i[a]=i[a]||[],i[a].push(n)},B=(e,t)=>{let{obj:n,k:r}=z(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Ln=(e,t,n)=>{let r=B(e,n);return r===void 0?B(t,n):r},Rn=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?L(e[r])||e[r]instanceof String||L(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Rn(e[r],t[r],n):e[r]=t[r]);return e},V=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),zn={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},Bn=e=>L(e)?e.replace(/[&<>"'\/]/g,e=>zn[e]):e,Vn=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}},Hn=[` `,`,`,`?`,`!`,`;`],Un=new Vn(20),Wn=(e,t,n)=>{t||=``,n||=``;let r=Hn.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Un.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},H=(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},U=e=>e?.replace(/_/g,`-`),Gn={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)}},W=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Gn,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:(L(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)}},G=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){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}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])})}},Kn=class extends G{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):L(n)&&i?o.push(...n.split(i)):o.push(n)));let s=B(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!L(n)?s:H(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),Fn(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)(L(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=B(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Rn(s,n,i):s={...s,...n},Fn(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}},qn={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}},Jn=Symbol(`i18next/PATH_KEY`);function Yn(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===Jn?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function K(e,t){let{[Jn]:n}=e(Yn()),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 Xn={},Zn=e=>!L(e)&&typeof e!=`boolean`&&typeof e!=`number`,Qn=class e extends G{constructor(e,t={}){super(),jn([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=W.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=Zn(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&&!Wn(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:L(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:L(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=K(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?K(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&&!L(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}):``,S=b&&!i.ordinal&&i.count===0,C=S&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${ee}`]||i[`defaultValue${te}`]||i.defaultValue,w=m;y&&!m&&x&&(w=C);let ne=Zn(w),re=Object.prototype.toString.apply(w);if(y&&w&&ne&&_.indexOf(re)<0&&!(L(v)&&Array.isArray(w))){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,w,{...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(w),t=e?[]:{},n=e?g:h;for(let e in w)if(Object.prototype.hasOwnProperty.call(w,e)){let r=`${n}${o}${e}`;t[e]=x&&!m?this.translate(r,{...i,defaultValue:Zn(C)?C[e]:void 0,joinArrays:!1,ns:c}):this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=w[e])}m=t}}else if(y&&L(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=C),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&C!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?C: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);S&&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}`]||C)})}):n(e,s,C))}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=L(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&&!L(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=L(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=qn.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 L(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?K(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&&!L(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(L(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,!Xn[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(Xn[`${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&&!L(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}},$n=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=W.create(`languageUtils`)}getScriptPartFromCode(e){if(e=U(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=U(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(L(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)),L(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 L(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))):L(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},er={zero:0,one:1,two:2,few:3,many:4,other:5},tr={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},nr=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=W.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=U(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!`),tr;if(!e.match(/-|_/))return tr;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)=>er[e]-er[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))}},rr=(e,t,n,r=`.`,i=!0)=>{let a=Ln(e,t,n);return!a&&i&&L(n)&&(a=H(e,n,r),a===void 0&&(a=H(t,n,r))),a},ir=e=>e.replace(/\$/g,`$$$$`),ar=class{constructor(e={}){this.logger=W.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?Bn:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?V(i):a||`{{`,this.suffix=o?V(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?V(d):f||V(`$t(`),this.nestingSuffix=p?V(p):m||V(`)`),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=rr(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(rr(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=>ir(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?ir(this.escape(e)):ir(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=L(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!L(a)&&!this.useRawValueToEscape&&(a=An(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(`${V(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&&!L(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&&!L(i))return i;L(i)||(i=An(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}},or=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}},sr=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(U(r),i),t[o]=s),s(n)}},cr=e=>(t,n,r)=>e(U(n),r)(t),lr=class{constructor(e={}){this.logger=W.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?sr:cr;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()]=sr(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}=or(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)}},ur=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},dr=class extends G{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=W.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=>{In(n.loaded,[i],a),ur(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)}o&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i):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)}else 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();L(e)&&(e=this.languageUtils.toResolveHierarchy(e)),L(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!!!`);else 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)}}},fr=()=>({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]),L(e[1])&&(t.defaultValue=e[1]),L(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}),pr=e=>(L(e.ns)&&(e.ns=[e.ns]),L(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),L(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),q=()=>{},mr=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},hr=`__i18next_supportNoticeShown`,gr=()=>!!(typeof globalThis<`u`&&globalThis[hr]||typeof process<`u`&&{}.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`),_r=()=>{typeof globalThis<`u`&&(globalThis[hr]=!0)},vr=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)),J=class e extends G{constructor(e={},t){if(super(),this.options=pr(e),this.services={},this.logger=W,this.modules={external:[]},mr(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&&(L(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=fr();this.options={...n,...this.options,...pr(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&&!vr(this)&&!gr()&&(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 💙`),_r());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?W.init(r(this.modules.logger),this.options):W.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:lr;let t=new $n(this.options);this.store=new Kn(this.options.resources,this.options);let i=this.services;i.logger=W,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new nr(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 ar(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new dr(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 Qn(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||=q,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=R(),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=q){let n=t,r=L(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=R();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||=q,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`&&qn.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=R();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=L(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(L(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=K(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=K(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=K(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return L(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=R();return this.options.ns?(L(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=R();L(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 $n(fr());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=q){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 Kn(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={...fr().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new ar(n)}return a.translator=new Qn(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();J.createInstance,J.dir,J.init,J.loadResources,J.reloadResources,J.use,J.changeLanguage,J.getFixedT,J.t,J.exists,J.setDefaultNamespace,J.hasLoadedNamespace,J.loadNamespaces,J.loadLanguages;var yr=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,br={"&amp;":`&`,"&#38;":`&`,"&lt;":`<`,"&#60;":`<`,"&gt;":`>`,"&#62;":`>`,"&apos;":`'`,"&#39;":`'`,"&quot;":`"`,"&#34;":`"`,"&nbsp;":` `,"&#160;":` `,"&copy;":`©`,"&#169;":`©`,"&reg;":`®`,"&#174;":`®`,"&hellip;":`…`,"&#8230;":`…`,"&#x2F;":`/`,"&#47;":`/`},xr=e=>br[e],Sr={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(yr,xr),transDefaultProps:void 0},Cr=(e={})=>{Sr={...Sr,...e}},wr={type:`3rdParty`,init(e){Cr(e.options.react)}},Y=new Map,Tr=500,X;function Er(){if(X===void 0)try{X=new Intl.NumberFormat(`en-US`,{useGrouping:!1,maximumFractionDigits:0}).format(`9007199254740993`)===`9007199254740993`}catch{X=!1}return X}var Dr=15;function Or(e){if(!(typeof e!=`string`||Er())&&e.replace(/[^0-9]/g,``).replace(/^0+/,``).length>Dr)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 kr(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 Ar(e,t,n){let r=kr(e,t,n),i=Y.get(r);return i||(i=new Intl.NumberFormat(e,{...n,style:`currency`,currency:t}),Y.size>=Tr&&Y.clear(),Y.set(r,i)),i}function jr(e,{value:t,currency:n},r={}){return Or(t),Ar(e,n,r).format(t)}function Mr(e,{value:t,currency:n},r={}){return Or(t),Ar(e,n,r).formatToParts(t)}function Nr(e){return an().find(e=>e.primary)?.id??e}function Pr(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 Fr=kn({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}=Pr(e,n);return jr(r,t,i)},formatCurrencyToParts:e=>(t,n)=>{let{locale:r,formatOptions:i}=Pr(e,n);return Mr(r,t,i)},getTranslationFunction:e=>()=>{let t=e.translations?.();if(!t)throw Error(`Host translation resources are not available.`);let n=J.createInstance(),r=Nr(e.essentials?.language)||`en`,i={lng:e.essentials?.language||r,fallbackLng:r,resources:t};return n.use(wr).init(i,e=>{if(e)throw e}),n.t.bind(n)}}),Ir=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)}}},Lr=e=>new Ir(e),Rr=kn({getMonitoringClient:e=>()=>e.getMonitoringClient?e.getMonitoringClient():Lr(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`)}),zr={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`,intakeForms:`intake-forms`};function Br(e){try{let t=Rr.getMonitoringClient?.();return t&&typeof t[e]==`function`?t:null}catch{return null}}function Vr(e,{feature:t,action:n,level:r=`error`,contexts:i}){let a=Br(`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 Hr(e,{feature:t,tags:n},r){let i=Br(`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 Ur=class extends e{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){Vr(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 Wr(e){let t=e;return t.__state||(t.__state={status:`pending`},t.then(e=>{t.__state={status:`fulfilled`,value:e}},e=>{t.__state={status:`rejected`,reason:e}})),t.__state}function Gr(e){let t=Wr(e);if(t.status===`fulfilled`)return t.value;throw t.status===`rejected`?t.reason:e}function Kr(e){let t=Promise.resolve(e);return t.__state={status:`fulfilled`,value:e},t}var qr=new WeakMap;function Jr(e,t,n){let r=qr.get(e);r||(r=new WeakMap,qr.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`?Kr(t(r.__state.value)):r.__state?.status===`rejected`?Kr(n(r.__state.reason)):e.then(t,n),i.set(n,a)}return a}function Z(e){return e}var Yr=Z(`@wix/site-service-url`),Xr=`appSectionParams`;function Zr(e){let t=e.searchParams.get(Xr);if(t===null)return e;let n=new URL(e);n.searchParams.delete(Xr);for(let[e,r]of Object.entries(Qr(t)))typeof r==`string`&&!n.searchParams.has(e)&&n.searchParams.set(e,r);return n}function Qr(e){try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}var $r=`bookings-uou:url-change`,ei=e=>{let t=new URL(e);return t.searchParams.sort(),t.href};function ti(e,{disableScrollToTop:t,skipHistory:n}={}){let r=globalThis.window;if(!r?.history)return;let i=new URL(r.location.href);if(ei(i)===ei(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($r))}function ni(e){let t=globalThis.window;return t?(t.addEventListener($r,e),t.addEventListener(`popstate`,e),()=>{t.removeEventListener($r,e),t.removeEventListener(`popstate`,e)}):()=>{}}var ri=e=>{try{return decodeURIComponent(e)}catch{return e}};function ii(e,t){let n=t?new URL(t).pathname:`/`;return`./${ri(new URL(e).pathname.replace(n,``).replace(/^\/|\/$/g,``))}`}function ai(){let e=d(Yr),t=r(()=>e.currentUrl,[e]),n=l(ni,t,t),i=o(()=>Zr(new URL(n)),[n]),a=e.siteUrl.replace(/\/$/,``);return{pathname:i.pathname,search:i.search,searchParams:i.searchParams,href:i.href,getParsedUrl:()=>Zr(new URL(e.currentUrl)),getRelativeUrl:()=>ii(e.currentUrl,a),getExternalBaseUrl:()=>a,pushUrl:ti}}var Q={category:`category`,location:`location`,page:`page`,blob:`bookingSelection`,legacyBlob:`b`,resource:`resource`,referral:`referral`,timezone:`timezone`,bookingId:`bookingId`,token:`token`,rescheduleRedirectUrl:`rescheduleRedirectUrl`},oi=Z(`@wix/site-service-warmup-data`);function si(){try{return u()}catch{return null}}function ci(e){try{return e?e(oi):null}catch{return null}}function li(){let e=ci(si()),t=typeof window>`u`;return o(()=>({scope:e??void 0,get:async n=>{if(t||!e)return null;try{return await e.get(n)}catch(e){return Vr(e,{feature:zr.warmup,action:`read`,level:`warning`,contexts:{warmup:{key:n}}}),null}},set:(n,r)=>{if(t&&e)try{e.set(n,r)}catch{}}}),[e,t])}var ui=Z(`@wix/site-service-locale`),di=Z,fi=di(`@wix/viewer-service-multilingual`);function pi(){try{return Fr.getLanguage()??`en`}catch{return`en`}}function mi(e){try{return d(e)}catch{return null}}function hi(){let e=mi(ui),t=mi(fi);return t?.multilingualEnabled&&t.currentLocale?.languageCode||e?.language||pi()}var gi=`bookings-uou`;function _i(e){return`${gi}:${e}:locations:all`}var vi=5e3,yi=100,bi=`wix-warmup-data`,xi=null;function Si(e){if(typeof document<`u`)try{let t=document.getElementById(bi)?.textContent;return t?(xi?.text!==t&&(xi={text:t,data:JSON.parse(t).builderComponentsWarmupData??{}}),xi.data[e]??void 0):void 0}catch{return}}var Ci=()=>({promises:new Map,invalidatedWarmup:new Set}),wi=Ci(),Ti=new WeakMap,Ei=new WeakMap;function Di(e){if(!e)return wi;let t=Ti.get(e);return t||(t=Ci(),Ti.set(e,t)),t}function Oi({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=Ei.get(i);a||(a=new Map,Ei.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=Di(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=Si(e);if(t!==void 0){let n=Kr(t);return i.promises.set(e,{promise:n,expiresAt:a+vi}),n}}let c=(async()=>{if(s){let n=await t.get(e);if(n!=null)return n}return n()})();i.promises.size>=yi&&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()+vi},()=>{i.promises.get(e)===l&&i.promises.delete(e)}),c}var ki=[{path:`businessLocations.locations.business.address.geocode.latitude`},{path:`businessLocations.locations.business.address.geocode.longitude`},{path:`businessLocations.locations.custom.address.geocode.latitude`},{path:`businessLocations.locations.custom.address.geocode.longitude`},{path:`businessLocations.locations.calculatedAddress.geocode.latitude`},{path:`businessLocations.locations.calculatedAddress.geocode.longitude`}];function Ai(e){return Dt(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 ji=`@wix/auto_sdk_bookings_services`;function Mi(e){function t({host:t}){return{entityFqdn:`wix.bookings.services.v2.service`,method:`POST`,methodFqn:`wix.bookings.services.v2.ServicesService.QueryLocations`,packageName:ji,migrationOptions:{optInTransformResponse:!0},url:Ai({protoPath:`/v2/services/locations/query`,data:e,host:t}),data:e,transformResponse:e=>ot(e,[{transformFn:Xt,paths:ki}])}}return t}var Ni=[{path:`businessLocations.locations.calculatedAddress`},{path:`businessLocations.locations.business.address`},{path:`businessLocations.locations.custom.address`}];async function Pi(e){let{httpClient:t,sideEffects:n}=arguments[1],r=Mi(Ye({filter:e?.filter}));n?.onSiteCall?.();try{let e=await t.request(r);return n?.onSuccess?.(e),Xe(ot(e.data,[{transformFn:Zt,paths:Ni}]))}catch(e){let t=gt(e,{spreadPathsToArguments:{},explicitPathsToArguments:{filter:`$[0].filter`},singleArgumentUnchanged:!1},[`options`]);throw n?.onError?.(e),t}}function Fi(e){return t=>Pi(t,{httpClient:e})}var Ii=Et(Fi),Li=`13d21c63-b5ec-5912-8397-c3a5ddb27a97`,Ri=function(e){return e.BOOK_ONLINE=`bookingsBookOnline`,e.SERVICE_PAGE=`bookingsServicePage`,e.CALENDAR_PAGE=`bookingsCalendar`,e.FORM_PAGE=`bookingsForm`,e}({});function zi(e){return e.business?._id??null}function Bi(e){return e.business?.name??null}async function Vi(){let e=await Ii({filter:{services:{appId:Li,hidden:!1}}});return{locations:[...e.businessLocations?.locations??[]].sort((e,t)=>(Bi(e)??``).localeCompare(Bi(t)??``)),hasOtherLocations:!!(e.customLocations?.exists||e.customerLocations?.exists)}}function Hi({isLoading:e,hasError:t,refetch:n,children:r}){let{searchParams:i}=ai(),a={locationItems:[],selectedLocationId:i.get(Q.location),hasOtherLocations:!1,hasMultipleLocations:!1,isLoading:e,hasError:t,refetch:n,selectLocation:()=>{}};return f($.Provider,{value:a,children:r})}function Ui({refetch:e,children:t}){return f(Hi,{isLoading:!0,hasError:!1,refetch:e,children:t})}function Wi({refetch:e,children:t}){return f(Hi,{isLoading:!1,hasError:!0,refetch:e,children:t})}var Gi=di(`@wix/site-service-business-logger`);function Ki(e){return{evid:32,src:16,endpoint:``,params:e}}var qi={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`};Ri.BOOK_ONLINE;var Ji=`new_bookings_server`,Yi=e=>{let{reportBi:t}=d(Gi);return r(n=>{t({widget_name:e,bookingsPlatform:Ji,is_over_editor:!1,...n.params,src:n.src,evid:n.evid},{endpoint:n.endpoint})},[t,e])},Xi=(e,t=!0)=>{let n=Yi(e),{getParsedUrl:r}=ai(),i=s(!1);a(()=>{t&&!i.current&&(i.current=!0,n(Ki({referralInfo:r().searchParams.get(Q.referral)??void 0})))},[t,n,r])},$=n(null),Zi=`useLocationsContext must be used within LocationsContextProvider`;function Qi(){let e=i($);if(!e)throw Error(Zi);return e}function $i(e,t){let n=zi(e);return{locationId:n,locationName:Bi(e),isSelected:n!=null&&n===t}}var ea=e=>({...e,hasError:!1}),ta=()=>({locations:[],hasOtherLocations:!1,hasError:!0});function na({locationsPromise:e,refetch:t,children:n}){let{locations:i,hasOtherLocations:s,hasError:c}=Gr(e),{pathname:l,searchParams:u,pushUrl:d,getExternalBaseUrl:p}=ai(),m=u.get(Q.location),h=r((e,t)=>{let n=new URLSearchParams(u);e?n.set(Q.location,e):n.delete(Q.location),n.delete(Q.page);let r=n.toString(),i=r?`${l}?${r}`:l;d(new URL(i,`${p()}/`),{disableScrollToTop:!0,skipHistory:t})},[l,u,d,p]),g=r(e=>h(e,!1),[h]),_=m!=null&&!c&&!(m===`OTHER_LOCATIONS`&&s)&&!i.some(e=>zi(e)===m);a(()=>{_&&h(null,!0)},[_,h]);let v=i.filter(e=>zi(e)).length+ +!!s,y=o(()=>({locationItems:i.map(e=>$i(e,m)),selectedLocationId:m,hasOtherLocations:s,hasMultipleLocations:v>1,isLoading:!1,hasError:c,refetch:t,selectLocation:g}),[i,m,s,c,v,t,g]);return f($.Provider,{value:y,children:n})}function ra({children:e}){Xi(qi.LOCATIONS);let n=li(),i=hi(),[a,s]=c(0),l=o(()=>Jr(Oi({key:_i(i),refresh:a!==0,warmupData:n,fetchData:()=>Hr(`locations-context-load`,{feature:zr.locations},Vi())}),ea,ta),[a,i,n]),u=r(()=>s(e=>e+1),[]);return f(Ur,{fallback:f(Wi,{refetch:u,children:e}),feature:zr.locations,children:f(t,{fallback:f(Ui,{refetch:u,children:e}),children:f(na,{locationsPromise:l,refetch:u,children:e})})})}var ia=En(`c151d9f7-1582-407c-bb59-59030f244b47`);export{Zi as LOCATIONS_CONTEXT_MISSING_PROVIDER_ERROR,ra as default,ia as injectAccessTokenGetter,$ as locationsContext,Qi as useLocationsContext};
2
+ //# sourceMappingURL=context-provider-c151d9f7-1582-407c-bb59-59030f244b47-DW2CIiei.js.map