@wix/bookings 1.0.1791 → 1.0.1793

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/build/cjs/context-booking-checkout.js +1 -1
  2. package/build/cjs/context-booking-checkout.js.map +1 -1
  3. package/build/cjs/context-service-addons.js +123 -134
  4. package/build/cjs/context-service-addons.js.map +1 -1
  5. package/build/cjs/context-service.d.ts +16 -6
  6. package/build/cjs/context-service.js +728 -724
  7. package/build/cjs/context-service.js.map +1 -1
  8. package/build/cjs/context-services.js +801 -812
  9. package/build/cjs/context-services.js.map +1 -1
  10. package/build/cjs/context-time-slots.js +1300 -1267
  11. package/build/cjs/context-time-slots.js.map +1 -1
  12. package/build/es/context-booking-checkout.mjs +1 -1
  13. package/build/es/context-booking-checkout.mjs.map +1 -1
  14. package/build/es/context-service-addons.mjs +123 -134
  15. package/build/es/context-service-addons.mjs.map +1 -1
  16. package/build/es/context-service.d.mts +16 -6
  17. package/build/es/context-service.mjs +728 -724
  18. package/build/es/context-service.mjs.map +1 -1
  19. package/build/es/context-services.mjs +801 -812
  20. package/build/es/context-services.mjs.map +1 -1
  21. package/build/es/context-time-slots.mjs +1300 -1267
  22. package/build/es/context-time-slots.mjs.map +1 -1
  23. package/build/internal/cjs/context-service.d.ts +16 -6
  24. package/build/internal/es/context-service.d.mts +16 -6
  25. package/context-runtime/context-booking-checkout/runtime.js +2 -2
  26. package/context-runtime/context-service/runtime.d.ts +16 -6
  27. package/context-runtime/context-service/runtime.js +2 -2
  28. package/context-runtime/context-service-addons/runtime.js +2 -2
  29. package/context-runtime/context-services/runtime.js +3 -3
  30. package/context-runtime/context-time-slots/runtime.js +3 -3
  31. package/package.json +3 -3
@@ -1,2 +1,2 @@
1
- import{Component as e,Suspense as t,createContext as n,useCallback as r,useContext as i,useDeferredValue as a,useEffect as o,useMemo as s,useRef as c,useSyncExternalStore as l}from"react";import{useServiceContext as u}from"@wix/bookings/context/service";import{useGetService as d,useService as f}from"@wix/services-manager-react";import{jsx as p}from"react/jsx-runtime";var m={};function h(e,t=!1,n=e=>e){return()=>({__type:`event-definition`,type:e,isDomainEvent:t,transformations:n})}var g=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}`)}},_=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:g(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}},v=e=>e.__isAmbassador?!0:!!e().__isAmbassador,y=`__metadata`,b=`edge.wixapis.com`,x=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 ee(this.response.status,e?.message,e?.details,{requestId:this.response.headers.get(`X-Wix-Request-Id`),details:e})}},ee=(e,t,n,r)=>({details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t,requestId:r?.requestId}),te=e=>e?.method&&[`post`,`put`,`patch`].includes(e.method.toLocaleLowerCase())&&e.body?{"Content-Type":`application/json`}:{},ne=e=>e&&typeof e==`object`&&!Array.isArray(e),S=e=>e.__type===`host`;function C(e,t){return e.create(t)}var re=`x-wix-bi-gateway`;function ie(e,t,n){return{[re]:ae({environment:`js-sdk${n?`-${n}`:``}`,"package-name":e.packageName??t?.PACKAGE_NAME,"method-fqn":e.methodFqn,entity:e.entityFqdn})}}function ae(e){return Object.entries(e).filter(([e,t])=>!!t).map(([e,t])=>`${e}=${t}`).join(`,`)}function oe(e){let t=globalThis.__wix_context__,n={client:m.client,elevatedClient:m.elevatedClient},r;globalThis.__wix_context__=void 0,m.client=void 0,m.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,m.client=n.client,m.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}var se={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function ce(e){return pe(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var le=/([\p{Ll}\d])(\p{Lu})/gu,ue=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,de=`$1\0$2`,fe=/[^\p{L}\d]+/giu;function pe(e){let t=e.trim();t=t.replace(le,de).replace(ue,de),t=t.replace(fe,`\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 me=e=>`validationError`in(e.response?.data?.details??{}),he=e=>`applicationError`in(e.response?.data?.details??{}),ge=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function _e(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(me(e))return ve(e,t,n);if(he(e))return ye(e);if(ge(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:ce(n),data:{}},requestId:e.requestId};return w(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return be(e)}var ve=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=xe(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return w(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},w=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),ye=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??ce(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return w(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},be=e=>w(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:ce(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),xe=({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:Se(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,Se(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},Se=(e,t)=>{let n=Ce(e);return n==null?e:e.replace(`$[${n}]`,t[n])},Ce=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function we(e,t,n,r,i,a,o,s,c,l,u){return oe(()=>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?b:o}${a.url}`;a.params&&a.params.toString()&&(u+=`?${a.params.toString()}`);try{let e=ie(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=Ee(s.status,e?.message??s.statusText,e?.details,{requestId:s.headers.get(`X-Wix-Request-Id`),details:e}),n=_e(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 Te=class extends Error{response;requestId;constructor(e){super(),this.response=e.response,this.requestId=e.requestId}},Ee=(e,t,n,r)=>new Te({response:{data:{details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t},status:e},requestId:r?.requestId}),De=`.`;function Oe(e,t,n){if(e==null)throw Error(`Cannot set value on null or undefined`);let r=ke(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 ke(e){return Array.isArray(e)?e:e.split(De).map(e=>Ae(e)?Number(e):e)}function Ae(e){return/^\d+$/.test(e)}function je(e){let t={};for(let[n,r]of Object.entries(e))Me(n)||Oe(t,ke(n),r);return t}function Me(e){return e===`__proto__`||e===`constructor`||e===`prototype`}var Ne=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])),je(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 se?se[e]:void 0;if(i&&i in t){r.push(i),n=t[i];return}let a=Le(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 Pe(e,t){let n=e?.modifiedFields;if(!n)return null;let r=Fe(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=Ie(s,a);return c===null?null:(o.modifiedFields=c,o)}function Fe(e){if(typeof e==`object`&&e&&!Array.isArray(e))try{let t=new Ne(e);return{unflattenedModifiedFields:t.unflatten(),modifiedFieldsManipulator:t}}catch{return null}return null}function Ie(e,t){if(typeof e==`object`&&e&&!Array.isArray(e))try{return t.flatten(e)}catch{return null}return null}function Le(e){return e.replace(/[-_\s]+(.)?/g,(e,t)=>t?t.toUpperCase():``).replace(/^./,e=>e.toLowerCase())}function Re(){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 ze=e=>e.__type===`event-definition`;function Be(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=Pe(s,a);if(e)return t(e)}}return t(a(o))}function Ve(e){let t=new Map,n=Re();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})=>Be(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})=>Be(t,n,e.payload,{instanceId:e.instanceId,identity:e.identity})))},apps:{AppInstalled:h(`AppInstalled`)(),AppRemoved:h(`AppRemoved`)()}}}}var He=e=>e.__type===`service-plugin-definition`;function Ue(e){let t=new Map,n=Re();return{initModule(e){return r=>{let i=t.get(e.componentType.toLowerCase())??[];i.push({servicePluginDefinition:e,implementation:r}),t.set(e.componentType.toLowerCase(),i),n.emit(`registered`,e)}},client:{...n,getRegisteredServicePlugins:()=>t,async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t,!0);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`object`||r.data===null||!(`metadata`in r.data)||typeof r.data.metadata!=`object`||r.data.metadata===null||!(`appExtensionType`in r.data.metadata)||typeof r.data.metadata.appExtensionType!=`string`)throw Error(`Unexpected JWT data: expected object with metadata.appExtensionType string`);return r.data},async process(e){let t=await this.parseJWT(e.body);return this.executeHandler(t,e.url)},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async processRequest(e){let t=await this.parseRequest(e);return this.processParsedRequest(t,e.url)},async processParsedRequest(e,t){try{let n=await this.executeHandler(e,t);return Response.json(n)}catch(e){if(e.errorType===`SPI`&&e.applicationCode&&e.httpCode)return Response.json({applicationError:{code:e.applicationCode,data:e.data}},{status:e.httpCode});throw e}},async executeHandler(e,n){let r=e.metadata.appExtensionType.toLowerCase(),i=t.get(r)??[];if(i.length===0)throw Error(`No service plugin implementations found for component type ${r}`);if(i.length>1)throw Error(`Multiple service plugin implementations found for component type ${r}. This is currently not supported`);let{implementation:a,servicePluginDefinition:o}=i[0],s=o.methods.find(e=>n.endsWith(e.primaryHttpMappingPath));if(!s)throw Error(`Unexpect request: request url did not match any method: `+n);let c=a[s.name];if(!c)throw Error(`Got request for service plugin method ${s.name} but no implementation was provided. Available methods: ${Object.keys(a).join(`, `)}`);return s.transformations.toREST(await c(s.transformations.fromREST(e)))}}}}var T=`X-Wix-Consistent`;function We(e){let t=e.headers||{Authorization:``},n={getAuthHeaders:e=>Promise.resolve({headers:{}})},r=e.auth,i=typeof r==`function`?r:()=>r??n,a=()=>i().getAuthHeaders(e.host),o=()=>e.fetch??fetch,s=async(n,r)=>{let i=o(),s=await a(),c={...r?.headers??{},...s.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[T]:t[T]}:{}},l=e.host?.getErrorHandler?.();try{if(typeof n==`string`||n instanceof URL){let e=await i(n,{...r,headers:c});l?.handleError(e,{requestOptions:{url:n.toString(),method:r?.method}});let a=Ge(e);return a&&(t[T]=a),e}{for(let[e,t]of Object.entries(c))typeof t==`string`&&n.headers.set(e,t);let e=await i(n,r);l?.handleError(e,{requestOptions:{url:n.url,method:r?.method}});let a=Ge(e);return a&&(t[T]=a),e}}catch(e){throw l?.handleError(e,{requestOptions:{url:typeof n==`string`||n instanceof URL?n.toString():n.url,method:r?.method}}),e}},{client:c,initModule:l}=Ue(i),{client:u,initModule:d}=Ve(i),f=async(n,r)=>{let i=o(),s=await a(),c=te(r),l=await i(n,{...r,headers:{...c,...t,...s?.headers,...r?.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[T]:t[T]}:{}}}),u=Ge(l);return u&&(t[T]=u),l},p=(t,n)=>{if(ze(t))return d(t);if(He(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 we(oe(()=>v(t))?_(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 ne(t)?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,p(n,t[y])])):t},h=e=>{for(let n in e)t[n]=e[n]};return{...e.modules?p(e.modules):{},get auth(){let t=i();return t.getAuthHeaders=t.getAuthHeaders.bind(void 0,e.host),t},setHeaders:h,use:p,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?m.elevatedClient=this:m.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 x(`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 Ge(e){return e.headers?.get(`X-Wix-Consistent`)??e.headers?.get(`x-wix-consistent`)}var Ke=1920,qe=1920,Je=1e3,Ye=1e3,E={SCALE_TO_FILL:`fill`,SCALE_TO_FIT:`fit`,STRETCH:`stretch`,ORIGINAL_SIZE:`original_size`,TILE:`tile`,TILE_HORIZONTAL:`tile_horizontal`,TILE_VERTICAL:`tile_vertical`,FIT_AND_TILE:`fit_and_tile`,LEGACY_STRIP_TILE:`legacy_strip_tile`,LEGACY_STRIP_TILE_HORIZONTAL:`legacy_strip_tile_horizontal`,LEGACY_STRIP_TILE_VERTICAL:`legacy_strip_tile_vertical`,LEGACY_STRIP_SCALE_TO_FILL:`legacy_strip_fill`,LEGACY_STRIP_SCALE_TO_FIT:`legacy_strip_fit`,LEGACY_STRIP_FIT_AND_TILE:`legacy_strip_fit_and_tile`,LEGACY_STRIP_ORIGINAL_SIZE:`legacy_strip_original_size`,LEGACY_ORIGINAL_SIZE:`actual_size`,LEGACY_FIT_WIDTH:`fitWidth`,LEGACY_FIT_HEIGHT:`fitHeight`,LEGACY_FULL:`full`,LEGACY_BG_FIT_AND_TILE:`legacy_tile`,LEGACY_BG_FIT_AND_TILE_HORIZONTAL:`legacy_tile_horizontal`,LEGACY_BG_FIT_AND_TILE_VERTICAL:`legacy_tile_vertical`,LEGACY_BG_NORMAL:`legacy_normal`},D={FIT:`fit`,FILL:`fill`,FILL_FOCAL:`fill_focal`,CROP:`crop`,LEGACY_CROP:`legacy_crop`,LEGACY_FILL:`legacy_fill`},O={CENTER:`center`,TOP:`top`,TOP_LEFT:`top_left`,TOP_RIGHT:`top_right`,BOTTOM:`bottom`,BOTTOM_LEFT:`bottom_left`,BOTTOM_RIGHT:`bottom_right`,LEFT:`left`,RIGHT:`right`},Xe={[O.CENTER]:{x:.5,y:.5},[O.TOP_LEFT]:{x:0,y:0},[O.TOP_RIGHT]:{x:1,y:0},[O.TOP]:{x:.5,y:0},[O.BOTTOM_LEFT]:{x:0,y:1},[O.BOTTOM_RIGHT]:{x:1,y:1},[O.BOTTOM]:{x:.5,y:1},[O.RIGHT]:{x:1,y:.5},[O.LEFT]:{x:0,y:.5}},Ze={center:`c`,top:`t`,top_left:`tl`,top_right:`tr`,bottom:`b`,bottom_left:`bl`,bottom_right:`br`,left:`l`,right:`r`},Qe={BG:`bg`,IMG:`img`,SVG:`svg`},$e={AUTO:`auto`,CLASSIC:`classic`,SUPER:`super`},et={classic:1,super:2},tt={radius:`0.66`,amount:`1.00`,threshold:`0.01`},nt=25e6,rt=[1.5,2,4],k={HIGH:{size:196e4,quality:90,maxUpscale:1},MEDIUM:{size:36e4,quality:85,maxUpscale:1},LOW:{size:16e4,quality:80,maxUpscale:1.2},TINY:{size:0,quality:80,maxUpscale:1.4}},A={HIGH:`HIGH`,MEDIUM:`MEDIUM`,LOW:`LOW`,TINY:`TINY`},j={CONTRAST:`contrast`,BRIGHTNESS:`brightness`,SATURATION:`saturation`,HUE:`hue`,BLUR:`blur`},M={JPG:`jpg`,JPEG:`jpeg`,JPE:`jpe`,PNG:`png`,WEBP:`webp`,WIX_ICO_MP:`wix_ico_mp`,WIX_MP:`wix_mp`,GIF:`gif`,SVG:`svg`,AVIF:`avif`,UNRECOGNIZED:`unrecognized`},it={AVIF:`AVIF`,PAVIF:`PAVIF`};M.JPG,M.JPEG,M.JPE,M.PNG,M.GIF,M.WEBP;function N(e,...t){return function(...n){let r=n[n.length-1]||{},i=[e[0]];return t.forEach(function(t,a){let o=Number.isInteger(t)?n[t]:r[t];i.push(o,e[a+1])}),i.join(``)}}function at(e){return e[e.length-1]}var ot=[M.PNG,M.JPEG,M.JPG,M.JPE,M.WIX_ICO_MP,M.WIX_MP,M.WEBP,M.AVIF],st=[M.JPEG,M.JPG,M.JPE];function ct(e){return ot.includes(I(e))}function lt(e,t,n){return n&&t&&!_t(t.id)&&Object.values(E).includes(e)}function ut(e,t,n){return!(P(e)||F(e))||!t||n}function dt(e,t,n){return ht(e)?!!(t||n):!1}function ft(e,t,n,r){if(gt(e)||!ut(e,t,n))return!1;let i=ct(e),a=dt(e,n,r);return i||a}function pt(e){return st.includes(I(e))}function mt(e){return I(e)===M.PNG}function P(e){return I(e)===M.WEBP}function ht(e){return I(e)===M.GIF}function F(e){return I(e)===M.AVIF}function gt(e){return/(^https?)|(^data)|(^\/\/)/.test(e)}function _t(e){return!e||!e.trim()||e.toLowerCase()===`none`}function vt(e){return e?.isSEOBot??!1}var yt=[`/`,`\\`,`?`,`<`,`>`,`|`,`“`,`:`,`"`].map(encodeURIComponent),bt=[`\\.`,`\\*`],xt=`_`;function St(e,t){let n=/\/(.*?)$/,r=/\.([^.]*)$/,i=RegExp(`(${yt.concat(bt).join(`|`)})`,`g`);if(t&&t.length){let e=t,n=t.match(r);return n&&ot.includes(n[1])&&(e=t.replace(r,``)),encodeURIComponent(e).replace(i,xt)}let a=e.match(n);return(a?a[1]:e).replace(r,``)}function Ct(e){return pt(e)?M.JPG:mt(e)?M.PNG:P(e)?M.WEBP:ht(e)?M.GIF:F(e)?M.AVIF:M.UNRECOGNIZED}function I(e){return(/[.]([^.]+)$/.exec(e)&&/[.]([^.]+)$/.exec(e)[1]||``).toLowerCase()}function wt(e,t,n,r){return Math.min(n/e,r/t)}function Tt(e,t,n,r){return Math.max(n/e,r/t)}function Et(e,t,n,r,i){let a;return a=i===D.FILL?Tt(e,t,n,r):i===D.FIT?wt(e,t,n,r):1,a}function Dt(e,t,n,r,i){let a,o=n,s=r;if(a=Et(e,t,n,r,i),i===D.FIT&&(o=e*a,s=t*a),o&&s&&o*s>25e6){let n=Math.sqrt(nt/(o*s));o*=n,s*=n,a=Et(e,t,o,s,i)}return{scaleFactor:a,width:o,height:s}}function Ot(e,t,n,r,i,a){e||=r.width,t||=r.height;let{scaleFactor:o,width:s,height:c}=Dt(e,t,r.width*i,r.height*i,n);return Bt(e,t,s,c,a,o,n)}function kt(e=O.CENTER){return Xe[e]}function At(e,t,n,r){let i=Pt(n)||kt(r);return{x:Math.max(0,Math.min(e.width-t.width,i.x*e.width-t.width/2)),y:Math.max(0,Math.min(e.height-t.height,i.y*e.height-t.height/2)),width:Math.min(e.width,t.width),height:Math.min(e.height,t.height)}}function jt(e,t){let n=Math.max(0,Math.min(e.width,t.x+t.width)-Math.max(0,t.x)),r=Math.max(0,Math.min(e.height,t.y+t.height)-Math.max(0,t.y));return n&&r&&(e.width!==n||e.height!==r)?{x:Math.max(0,t.x),y:Math.max(0,t.y),width:n,height:r}:null}function Mt(e){return Math.min(e.pixelAspectRatio||1,2)}function Nt(e){return e.alignment&&Ze[e.alignment]||Ze[O.CENTER]}function Pt(e){let t;return e&&typeof e.x==`number`&&!isNaN(e.x)&&typeof e.y==`number`&&!isNaN(e.y)&&(t={x:L(Math.max(0,Math.min(100,e.x))/100,2),y:L(Math.max(0,Math.min(100,e.y))/100,2)}),t}function Ft(e,t){return k[Vt(e,t)].quality}function It(e,t){return{optimizedScaleFactor:k[Vt(e,t)].maxUpscale,upscaleMethodValue:et.classic,forceUSM:!1}}function Lt(e,t){return{optimizedScaleFactor:k[Vt(e,t)].maxUpscale,upscaleMethodValue:et.classic,forceUSM:!1}}function Rt(e){return{optimizedScaleFactor:at(rt),upscaleMethodValue:et.super,forceUSM:!(rt.includes(e)||e>at(rt))}}function zt(e,t,n,r){return r===`auto`?Lt(e,t):r===`super`?Rt(n):It(e,t)}function Bt(e,t,n,r,i,a,o){let{optimizedScaleFactor:s,upscaleMethodValue:c,forceUSM:l}=zt(e,t,a,i),u=n,d=r;if(a<=s)return{width:u,height:d,scaleFactor:a,upscaleMethodValue:c,forceUSM:l,cssUpscaleNeeded:!1};switch(o){case D.FILL:u=s/a*n,d=s/a*r;break;case D.FIT:u=e*s,d=t*s}return{width:u,height:d,scaleFactor:s,upscaleMethodValue:c,forceUSM:l,cssUpscaleNeeded:!0}}function Vt(e,t){let n=e*t;return n>k[A.HIGH].size?A.HIGH:n>k[A.MEDIUM].size?A.MEDIUM:n>k[A.LOW].size?A.LOW:A.TINY}function L(e,t){let n=10**(t||0);return(e*n/n).toFixed(t)}function Ht(e){return!e||!e.upscaleMethod?$e.AUTO:$e[e.upscaleMethod.toUpperCase()]||$e.AUTO}function Ut(e,t){let n=P(e)||F(e);return I(e)===M.GIF||n&&t}var Wt={isMobile:!1},Gt=function(e){return Wt[e]},Kt=function(e,t){Wt[e]=t};function qt(){if(typeof window<`u`&&typeof navigator<`u`){let e=window.matchMedia&&window.matchMedia(`(max-width: 767px)`).matches,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);Kt(`isMobile`,e&&t)}}O.CENTER,O.TOP,O.TOP_LEFT,O.TOP_RIGHT,O.BOTTOM,O.BOTTOM_LEFT,O.BOTTOM_RIGHT,O.LEFT,O.RIGHT;function Jt(){return Gt(`isMobile`)}function Yt(e,t,n){let r;switch(t.crop&&(r=jt(t,t.crop),r&&(e.src.width=r.width,e.src.height=r.height,e.src.isCropped=!0,e.parts.push($t(r)))),e.fittingType){case E.SCALE_TO_FIT:case E.LEGACY_FIT_WIDTH:case E.LEGACY_FIT_HEIGHT:case E.LEGACY_FULL:case E.FIT_AND_TILE:case E.LEGACY_BG_FIT_AND_TILE:case E.LEGACY_BG_FIT_AND_TILE_HORIZONTAL:case E.LEGACY_BG_FIT_AND_TILE_VERTICAL:case E.LEGACY_BG_NORMAL:e.parts.push(Xt(e,n));break;case E.SCALE_TO_FILL:e.parts.push(Zt(e,n));break;case E.STRETCH:e.parts.push(Qt(e,n));break;case E.TILE_HORIZONTAL:case E.TILE_VERTICAL:case E.TILE:case E.LEGACY_ORIGINAL_SIZE:case E.ORIGINAL_SIZE:r=At(e.src,n,e.focalPoint,n.alignment),e.src.isCropped?(Object.assign(e.parts[0],r),e.src.width=r.width,e.src.height=r.height):e.parts.push($t(r));break;case E.LEGACY_STRIP_TILE_HORIZONTAL:case E.LEGACY_STRIP_TILE_VERTICAL:case E.LEGACY_STRIP_TILE:case E.LEGACY_STRIP_ORIGINAL_SIZE:e.parts.push(nn(n));break;case E.LEGACY_STRIP_SCALE_TO_FIT:case E.LEGACY_STRIP_FIT_AND_TILE:e.parts.push(en(n));break;case E.LEGACY_STRIP_SCALE_TO_FILL:e.parts.push(tn(n))}}function Xt(e,t){let n=Ot(e.src.width,e.src.height,D.FIT,t,e.devicePixelRatio,e.upscaleMethod);return{transformType:!e.src.width||!e.src.height?D.FIT:D.FILL,width:Math.round(n.width),height:Math.round(n.height),alignment:Ze.center,upscale:n.scaleFactor>1,forceUSM:n.forceUSM,scaleFactor:n.scaleFactor,cssUpscaleNeeded:n.cssUpscaleNeeded,upscaleMethodValue:n.upscaleMethodValue}}function Zt(e,t){let n=Ot(e.src.width,e.src.height,D.FILL,t,e.devicePixelRatio,e.upscaleMethod),r=Pt(e.focalPoint);return{transformType:r?D.FILL_FOCAL:D.FILL,width:Math.round(n.width),height:Math.round(n.height),alignment:Nt(t),focalPointX:r&&r.x,focalPointY:r&&r.y,upscale:n.scaleFactor>1,forceUSM:n.forceUSM,scaleFactor:n.scaleFactor,cssUpscaleNeeded:n.cssUpscaleNeeded,upscaleMethodValue:n.upscaleMethodValue}}function Qt(e,t){let n=Et(e.src.width,e.src.height,t.width,t.height,D.FILL),r={...t};return r.width=e.src.width*n,r.height=e.src.height*n,Xt(e,r)}function $t(e){return{transformType:D.CROP,x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height),upscale:!1,forceUSM:!1,scaleFactor:1,cssUpscaleNeeded:!1}}function en(e){return{transformType:D.FIT,width:Math.round(e.width),height:Math.round(e.height),upscale:!1,forceUSM:!0,scaleFactor:1,cssUpscaleNeeded:!1}}function tn(e){return{transformType:D.LEGACY_FILL,width:Math.round(e.width),height:Math.round(e.height),alignment:Nt(e),upscale:!1,forceUSM:!0,scaleFactor:1,cssUpscaleNeeded:!1}}function nn(e){return{transformType:D.LEGACY_CROP,width:Math.round(e.width),height:Math.round(e.height),alignment:Nt(e),upscale:!1,forceUSM:!1,scaleFactor:1,cssUpscaleNeeded:!1}}function rn(e,t){t||={},e.quality=sn(e,t),e.progressive=on(t),e.watermark=an(t),e.autoEncode=t.autoEncode??!0,e.encoding=t?.encoding,e.unsharpMask=ln(e,t),e.filters=cn(t)}function an(e){return e.watermark}function on(e){return e.progressive!==!1}function sn(e,t){let n=e.fileType===M.PNG,r=e.fileType===M.JPG,i=e.fileType===M.WEBP,a=e.fileType===M.AVIF;if(r||n||i||a){let r=at(e.parts),i=Ft(r.width,r.height),a=t.quality&&t.quality>=5&&t.quality<=90?t.quality:i;return a=n?a+5:a,a}return 0}function cn(e){let t=e.filters||{},n={};return R(t[j.CONTRAST],-100,100)&&(n[j.CONTRAST]=t[j.CONTRAST]),R(t[j.BRIGHTNESS],-100,100)&&(n[j.BRIGHTNESS]=t[j.BRIGHTNESS]),R(t[j.SATURATION],-100,100)&&(n[j.SATURATION]=t[j.SATURATION]),R(t[j.HUE],-180,180)&&(n[j.HUE]=t[j.HUE]),R(t[j.BLUR],0,100)&&(n[j.BLUR]=t[j.BLUR]),n}function R(e,t,n){return typeof e==`number`&&!isNaN(e)&&e!==0&&e>=t&&e<=n}function ln(e,t){if(dn(t.unsharpMask))return{radius:L(t.unsharpMask?.radius,2),amount:L(t.unsharpMask?.amount,2),threshold:L(t.unsharpMask?.threshold,2)};if(!fn(t.unsharpMask)&&un(e))return tt}function un(e){let t=at(e.parts);return!(t.scaleFactor>=1)||t.forceUSM||t.transformType===D.FIT}function dn(e){e||={};let t=typeof e.radius==`number`&&!isNaN(e.radius)&&e.radius>=.1&&e.radius<=500,n=typeof e.amount==`number`&&!isNaN(e.amount)&&e.amount>=0&&e.amount<=10,r=typeof e.threshold==`number`&&!isNaN(e.threshold)&&e.threshold>=0&&e.threshold<=255;return t&&n&&r}function fn(e){return e||={},typeof e.radius==`number`&&!isNaN(e.radius)&&e.radius===0&&typeof e.amount==`number`&&!isNaN(e.amount)&&e.amount===0&&typeof e.threshold==`number`&&!isNaN(e.threshold)&&e.threshold===0}function pn(e,t,n,r){let i=vt(r),a=Ct(t.id),o=St(t.id,t.name),s=i?1:Mt(n),c=I(t.id),l=c,u=ft(t.id,r?.hasAnimation,r?.allowAnimatedTransform,r?.allowFullGIFTransformation),d={fileName:o,fileExtension:c,fileType:a,fittingType:e,preferredExtension:l,src:{id:t.id,width:t.width,height:t.height,isCropped:!1,isAnimated:Ut(t.id,r?.hasAnimation)},focalPoint:{x:t.focalPoint&&t.focalPoint.x,y:t.focalPoint&&t.focalPoint.y},parts:[],devicePixelRatio:s,quality:0,upscaleMethod:Ht(r),progressive:!0,watermark:``,unsharpMask:{},filters:{},transformed:u,allowFullGIFTransformation:r?.allowFullGIFTransformation,isPlaceholderFlow:r?.isPlaceholderFlow};return u&&(Yt(d,t,n),rn(d,r)),d}function mn(e,t,n){let r={...n},i=Jt();switch(e){case E.LEGACY_BG_FIT_AND_TILE:case E.LEGACY_BG_FIT_AND_TILE_HORIZONTAL:case E.LEGACY_BG_FIT_AND_TILE_VERTICAL:case E.LEGACY_BG_NORMAL:let e=i?Je:Ke,n=i?Ye:qe;r.width=Math.min(e,t.width),r.height=Math.min(n,Math.round(r.width/(t.width/t.height))),r.pixelAspectRatio=1}return r}var hn=N`fit/w_${`width`},h_${`height`}`,gn=N`fill/w_${`width`},h_${`height`},al_${`alignment`}`,_n=N`fill/w_${`width`},h_${`height`},fp_${`focalPointX`}_${`focalPointY`}`,vn=N`crop/x_${`x`},y_${`y`},w_${`width`},h_${`height`}`,yn=N`crop/w_${`width`},h_${`height`},al_${`alignment`}`,bn=N`fill/w_${`width`},h_${`height`},al_${`alignment`}`,z=N`,lg_${`upscaleMethodValue`}`,xn=N`,q_${`quality`}`,Sn=N`,quality_auto`,Cn=N`,usm_${`radius`}_${`amount`}_${`threshold`}`,wn=N`,bl`,Tn=N`,wm_${`watermark`}`,En={[j.CONTRAST]:N`,con_${`contrast`}`,[j.BRIGHTNESS]:N`,br_${`brightness`}`,[j.SATURATION]:N`,sat_${`saturation`}`,[j.HUE]:N`,hue_${`hue`}`,[j.BLUR]:N`,blur_${`blur`}`},Dn=N`,enc_auto`,On=N`,enc_avif`,kn=N`,enc_pavif`,An=N`,pstr`,jn=N`,anm_all`;function Mn(e){if(e.parts.some(({width:e,height:t})=>!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0))return e.src.id;let t=[];e.parts.forEach(e=>{switch(e.transformType){case D.CROP:t.push(vn(e));break;case D.LEGACY_CROP:t.push(yn(e));break;case D.LEGACY_FILL:let n=bn(e);e.upscale&&(n+=z(e)),t.push(n);break;case D.FIT:let r=hn(e);e.upscale&&(r+=z(e)),t.push(r);break;case D.FILL:let i=gn(e);e.upscale&&(i+=z(e)),t.push(i);break;case D.FILL_FOCAL:let a=_n(e);e.upscale&&(a+=z(e)),t.push(a)}});let n=t.join(`/`);if(e.quality&&(n+=xn(e)),e.unsharpMask&&(n+=Cn(e.unsharpMask)),e.progressive||(n+=wn(e)),e.watermark&&(n+=Tn(e)),e.filters&&(n+=Object.keys(e.filters).map(t=>En[t](e.filters)).join(``)),e.fileType!==M.GIF&&(e.encoding===it.AVIF?(n+=On(e),n+=Sn(e)):e.encoding===it.PAVIF?(n+=kn(e),n+=Sn(e)):e.autoEncode&&(n+=Dn(e))),e.src?.isAnimated&&e.transformed){let t=ht(e.src.id),r=e.isPlaceholderFlow===!0,i=e.allowFullGIFTransformation===!0;r?n+=An(e):t&&i&&(n+=jn(e))}return`${e.src.id}/v1/${n}/${e.fileName}.${e.preferredExtension}`}function Nn(e,t,n,r={},i){if(ft(t.id,r?.hasAnimation,r?.allowAnimatedTransform,r?.allowFullGIFTransformation)){if((P(t.id)||F(t.id))&&!r.allowWebpAvifTransforms){let{alignment:a,...o}=n;t.focalPoint={x:void 0,y:void 0},delete t?.crop,i=pn(e,t,o,r)}else i||=pn(e,t,n,r);return Mn(i)}return t.id}var Pn={[O.CENTER]:`50% 50%`,[O.TOP_LEFT]:`0% 0%`,[O.TOP_RIGHT]:`100% 0%`,[O.TOP]:`50% 0%`,[O.BOTTOM_LEFT]:`0% 100%`,[O.BOTTOM_RIGHT]:`100% 100%`,[O.BOTTOM]:`50% 100%`,[O.RIGHT]:`100% 50%`,[O.LEFT]:`0% 50%`};Object.entries(Pn).reduce((e,[t,n])=>(e[n]=t,e),{}),E.TILE,E.TILE_HORIZONTAL,E.TILE_VERTICAL,E.LEGACY_BG_FIT_AND_TILE,E.LEGACY_BG_FIT_AND_TILE_HORIZONTAL,E.LEGACY_BG_FIT_AND_TILE_VERTICAL,E.LEGACY_ORIGINAL_SIZE,E.ORIGINAL_SIZE,E.LEGACY_BG_NORMAL;function Fn(e,t,n,r){if(lt(e,t,n)){let i=mn(e,t,n),a=pn(e,t,i,r);return{uri:Nn(e,t,i,r||{},a)}}return{uri:``}}var In=`https://static.wixstatic.com/`,Ln=`https://static.wixstatic.com/media/`,Rn=/^media\//i,zn=typeof window<`u`?window.devicePixelRatio:1,Bn=e=>Rn.test(e)?`${In}${e}`:`${Ln}${e}`,Vn=(e,t)=>{let n=t&&t.baseHostURL;return n?`${n}${e}`:Bn(e)};function Hn(e,t,n,r,i,a){return Vn(Fn(E.SCALE_TO_FIT,{id:e,width:t,height:n,name:a&&a.name},{width:r,height:i,htmlTag:Qe.IMG,alignment:O.CENTER,pixelAspectRatio:a?.devicePixelRatio??zn},a).uri,a)}function Un(e,t,n,r,i,a){return Vn(Fn(E.SCALE_TO_FILL,{id:e,width:t,height:n,name:a&&a.name,focalPoint:{x:a&&a.focalPoint&&a.focalPoint.x,y:a&&a.focalPoint&&a.focalPoint.y}},{width:r,height:i,htmlTag:Qe.IMG,alignment:O.CENTER,pixelAspectRatio:a?.devicePixelRatio??zn},a).uri,a)}function Wn(e,t,n,r,i,a,o,s,c,l){return Vn(Fn(E.SCALE_TO_FILL,{id:e,width:t,height:n,name:l&&l.name,crop:{x:r,y:i,width:a,height:o}},{width:s,height:c,htmlTag:Qe.IMG,alignment:O.CENTER,pixelAspectRatio:l?.devicePixelRatio??zn},l).uri,l)}qt(),qt();var Gn={getScaleToFitImageURL:Hn,getScaleToFillImageURL:Un,getCropImageURL:Wn},Kn=`wix:`,qn=`image`,Jn=`video`,Yn=`audio`,Xn=`document`,Zn=`https://static.wixstatic.com/media/`,Qn=`https://static.wixstatic.com/shapes/`,$n=`https://video.wixstatic.com/video/`,er=`https://static.wixstatic.com/mp3/`,tr=`https://d945e594-8657-47e2-9cd9-e9033c3d8da0.usrfiles.com/`;function nr(e,t,n,r){let i=ar(e);return Gn.getScaleToFillImageURL(i.id,i.height,i.width,t,n,r)}function rr(e,t,n,r){let i=ar(e);return Gn.getScaleToFitImageURL(i.id,i.height,i.width,t,n,r)}function ir(e,t,n,r,i,a,o,s){let c=ar(e);return Gn.getCropImageURL(c.id,c.height,c.width,t,n,r,i,a,o,s)}function ar(e){return sr(e,Zn)}function or(e){return sr(e,Qn)}function sr(e,t=Zn){let n,r,i,a;if(e.startsWith(t))n=e.split(t).pop().split(`/`)[0],a=e.split(`/w_`).pop().split(`,`)[0],i=e.split(`,h_`).pop().split(`,`)[0];else{let t=fr(e,qn),{hash:o,pathname:s}=new URL(t),c=new URLSearchParams(o.replace(`#`,``));i=c.get(`originHeight`),a=c.get(`originWidth`),[n,r]=s.replace(`${qn}://v1/`,``).split(`/`)}let o=dr(r),s={id:n,url:`${t}${n}`,height:Number(i),width:Number(a)};return o?{...s,altText:o,filename:o}:s}function cr(e,t){let n,r,i,a,o=``;if(e.startsWith($n))n=e.split($n).pop().split(`/`)[0],r=`${n}.jpg`,i=`50`,a=`50`;else{let t=fr(e,Jn),{pathname:s,hash:c}=new URL(t),l=new URLSearchParams(c.replace(`#`,``)),[u,d]=s.replace(`${Jn}://v1/`,``).split(`/`);n=u,r=l.get(`posterUri`)||`${n}.jpg`,i=l.get(`posterWidth`)||`50`,a=l.get(`posterHeight`)||`50`,o=dr(d)}let s={id:n,url:`${$n}${n}/${t?`${t}/mp4/file.mp4`:`file`}`,thumbnail:`${Kn}${qn}://v1/${r}#originWidth=${i}&originHeight=${a}`};return o?{...s,filename:o}:s}function lr(e){let t=fr(e,Yn),{pathname:n,hash:r}=new URL(t),[i,a]=n.replace(`${Yn}://v1/`,``).split(`/`),o=dr(a),s=new URLSearchParams(r.replace(`#`,``)),c={id:i,duration:Number(s.get(`duration`)||``),url:`${er}${i}`};return o?{...c,filename:o}:c}function ur(e){let t=fr(e,Xn),{pathname:n}=new URL(t),r=n.replace(`${Xn}://v1/`,``).split(`/`),i=r[0]===`ugd`||r[0]===`archives`?r.shift():`ugd`,[a,o]=r,s=dr(o),c={id:a,url:`${tr}${i}/${a}`};return s?{...c,filename:s}:c}function dr(e){return e&&decodeURIComponent(e)}function fr(e,t){let{protocol:n}=new URL(e);return n===`${t}:`?`${Kn}${e}`:e}var pr;(function(e){e.MOBILE=`360p`,e.LOW=`480p`,e.MID=`720p`,e.HIGH=`1080p`})(pr||={});var mr={getCroppedImageUrl:ir,getScaledToFillImageUrl:nr,getScaledToFitImageUrl:rr,getImageUrl:ar,getVideoUrl:cr,getAudioUrl:lr,getDocumentUrl:ur,getShapeUrl:or},hr={_id:`id`,_createdDate:`createdDate`,_updatedDate:`updatedDate`},gr={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function _r(e,t){return e?.split(`.`).map(e=>t?.[e]??e).join(`.`)}var vr=`sort.fieldName`;function yr(e,t,n){return(e===vr||e.endsWith(`.${vr}`))&&typeof t==`string`?_r(t,n):t}function br(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=xr(e,t);s!==e&&!(s in a)&&(a[s]=a[e],delete a[e]),a[s]=yr(o,a[s],t),i(a[s],o)})}};return i(e,``),e}function xr(e,t){let n;return n=e.includes(`.`)?e.split(`.`).map(e=>t[e]??e).join(`.`):t[e]??e,n}function Sr(e,t=[]){return br(e,hr,t)}function Cr(e,t=[]){return br(e,gr,t)}function wr(e){return e?new Date(e):void 0}var Tr=new WeakMap;function Er(){return{leaves:void 0,fields:void 0,mapFields:void 0,anyField:void 0}}function Dr(e,t){let n=e.get(t);return n||(n=Er(),e.set(t,n)),n}function Or(e,t){return t===`*`?(e.anyField??=Er(),e.anyField):t.endsWith(`{}`)?(e.mapFields??=new Map,Dr(e.mapFields,t.slice(0,-2))):(e.fields??=new Map,Dr(e.fields,t))}function kr(e){let t=Er();for(let n of e){let e=n.path.split(`.`).reduce(Or,t);e.leaves??=[],e.leaves.push(n)}return t}function Ar(e){let t=Tr.get(e);return t||(t=kr(e),Tr.set(e,t)),t}function jr(e){return typeof e==`object`&&!!e}function Mr(e,{isRepeated:t,isMap:n},r){return t?Array.isArray(e)?e.map(r):e:n?jr(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r(t)])):e:r(e)}function Nr(e,t,n){jr(e)&&Ir(e,t,n)}function Pr(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]=Mr(e[r],t,n);let t=e[r];Array.isArray(t)?t.forEach(e=>Nr(e,i,n)):Nr(t,i,n)}}function Fr(e,t,n){for(let[r,i]of t){let t=e[r];jr(t)&&Object.values(t).forEach(e=>Nr(e,i,n))}}function Ir(e,{fields:t,mapFields:n,anyField:r},i){t&&Pr(e,t,i),n&&Fr(e,n,i),r&&Object.values(e).forEach(e=>Nr(e,r,i))}function Lr(e,t){if(!jr(e))return e;for(let{paths:n,transformFn:r}of t)Ir(e,Ar(n),r);return e}function Rr(e){return Ur(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var zr=/([\p{Ll}\d])(\p{Lu})/gu,Br=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,Vr=`$1\0$2`,Hr=/[^\p{L}\d]+/giu;function Ur(e){let t=e.trim();t=t.replace(zr,Vr).replace(Br,Vr),t=t.replace(Hr,`\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 Wr=e=>`validationError`in(e.response?.data?.details??{}),Gr=e=>`applicationError`in(e.response?.data?.details??{}),Kr=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function qr(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(Wr(e))return Jr(e,t,n);if(Gr(e))return Xr(e);if(Kr(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:Rr(n),data:{}},requestId:e.requestId};return Yr(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return Zr(e)}var Jr=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=Qr(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 Yr(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},Yr=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),Xr=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??Rr(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 Yr(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},Zr=e=>Yr(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:Rr(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),Qr=({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:$r(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,$r(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},$r=(e,t)=>{let n=ei(e);return n==null?e:e.replace(`$[${n}]`,t[n])},ei=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function ti(){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 ni(()=>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:m.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:m.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:m.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:m.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 ni(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return ni(()=>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 ni(e){let t=globalThis.__wix_context__,n={client:m.client,elevatedClient:m.elevatedClient},r;globalThis.__wix_context__=void 0,m.client=void 0,m.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,m.client=n.client,m.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function ri(e,t){return((...n)=>{let r=ti();return r?r.initWixModules(e,t).apply(void 0,n):e.apply(void 0,n)})}function ii(e,t=!1){return ri(e,t)}function ai(e){let t=vi(gi(e.host),e.domainToMappings);return Di(wi(e.protoPath,e.data||{}),t)}var oi=[`wix.com`,`editorx.com`],si=`_`,ci=`*.`,li=RegExp(`\\.(${oi.join(`|`)})$`),ui=[`42.wixprod.net`,`uw2-edt-1.wixprod.net`,`virginia-edt.wixprod.net`],di={"payments.base44.com":`manage.wix.com`,"create.editorx.com":`editor.editorx.com`},fi=`dev.wix-code.com`,pi=/{(.*)}/,mi=RegExp(`\\.(${ui.join(`|`)})$`),hi=RegExp(`.*\\.${fi}$`);function gi(e){return _i(e).replace(li,`._base_domain_`).replace(mi,`._api_base_domain_`).replace(hi,`*.dev.wix-code.com`)}function _i(e){return di[e]??e}function vi(e,t){let n=t[e];if(n)return n;let r=yi(e,t)??bi(e,t);if(!r){if(Si(e)){let e=t[Ci];if(e)return e}let n=t[si];if(n)return n}return r??[]}function yi(e,t){return Object.entries(t).find(([t])=>{let[,...n]=e.split(`.`);return n.join(`.`)===t})?.[1]}function bi(e,t){let[n]=Object.entries(t).filter(([t])=>xi(e,t)).sort(([e],[t])=>t.length-e.length);if(!n)return;let[,r]=n;return r}function xi(e,t){if(!t.startsWith(ci))return!1;let n=t.slice(1);return e.length>n.length&&e.endsWith(n)}function Si(e){return!!e.match(/\._base_domain_$/)}var Ci=`www._base_domain_`;function wi(e,t){return e.split(`/`).map(e=>Ti(e,t)).join(`/`)}function Ti(e,t){let n=e.match(pi)||[],r=n[1];return r?Ei(t,r,e,e.replace(n[0],``)):e}function Ei(e,t,n,r){let i=e;for(let e of t.split(`.`)){if(!i)return n;i=i[e]}return`${i}${r}`}function Di(e,t){let n=t?.find(t=>e.startsWith(t.destPath));return n?n.srcPath+e.slice(n.destPath.length):e}var Oi;(function(e){e.QUERY_PARAM=`QUERY_PARAM`,e.SUBDOMAIN=`SUBDOMAIN`,e.SUBDIRECTORY=`SUBDIRECTORY`})(Oi||={});var ki={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ŋƅ`},Ai=(e,t)=>{e.searchParams.set(`lang`,t)},ji=(e,t)=>{let n=e.hostname.split(`.`);n[0]===`www`&&(n=n.slice(1)),n=[t,...n],e.hostname=n.join(`.`)},Mi=(e,t)=>{e.pathname=`/${t}${e.pathname}`},Ni=(e,t)=>{if(!t.languageCode||!t?.resolutionMethod)return e;let n=new URL(e);return(t?.resolutionMethod===`QUERY_PARAM`?Ai:t?.resolutionMethod===`SUBDOMAIN`?ji:Mi)(n,t.languageCode),n.href},Pi=(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 Fi(){let e=Ii();return e?Li(e):[]}function Ii(){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 Li(e){try{if(e?.supportedLanguages?.length){let t=e.supportedLanguages,n=t.map(e=>e.languageCode).filter(Boolean),r=e.cleanUrl??Vi(n);return t.map(e=>({id:e.languageCode,displayName:Ri(e),regionalFormat:[e.locale?.languageCode,e.locale?.country].filter(Boolean).join(`-`),url:zi(e,r),primary:e.isPrimary,resolutionMethod:e.resolutionMethod}))}if(e?.siteLanguages?.length){let t=e.siteLanguages,n=Vi(t.map(e=>e.languageCode).filter(Boolean));return t.map(e=>({id:e.languageCode,displayName:Ri(e),regionalFormat:e.locale,url:zi(e,n),primary:e.isPrimaryLanguage,resolutionMethod:e.resolutionMethod?Bi(e.resolutionMethod):void 0}))}}catch(e){return console.warn(`[Multilingual Manager] listSupportedLanguages failed`,e),[]}return console.warn(`[Multilingual Manager] listSupportedLanguages is not available`),[]}function Ri(e){let t=ki[e.languageCode];if(t)return t;let n=e.name??e.countryCode;if(n)return n}function zi(e,t){if(e.url||!t||!e.resolutionMethod)return e.url;if(e.languageCode)try{return Ni(t,{languageCode:e.languageCode,countryCode:e.countryCode,resolutionMethod:Bi(e.resolutionMethod),locale:{languageCode:e.languageCode,country:e.countryCode}})}catch(e){console.warn(`[Multilingual Manager] buildUrlForLanguage failed`,e);return}}function Bi(e){switch(e){case`QUERY_PARAM`:case`QueryParam`:return Oi.QUERY_PARAM;case`SUBDOMAIN`:case`Subdomain`:return Oi.SUBDOMAIN;case`SUBDIRECTORY`:case`Subdirectory`:return Oi.SUBDIRECTORY;default:return}}function Vi(e){let t=typeof window<`u`&&window.location?.href?window.location.href:``;try{return Pi(t,e)}catch(e){return console.warn(`[Multilingual Manager] cleanCurrentUrl failed`,e),t}}var Hi=`x-wix-currency`,Ui=()=>{let e=B(`currency`);if(e)return{[Hi]:e}},Wi=`x-wix-linguist`,Gi=`00000000-0000-0000-0000-000000000000`,Ki=`false`,qi=()=>{let e=B(`language`),t=B(`locale`);if(e)return{[Wi]:[e,t||e,Ki,Gi].join(`|`)}};function Ji(){let e=null,t=null;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var Yi=()=>(typeof window<`u`?window.commonConfig:void 0)??globalThis.commonConfig,B=e=>Yi()?.[e],Xi=({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=Qi();return{...a,apiBaseUrl:o,getMonitoringClient:i?.getMonitoringClientFunction?.(n,r),essentials:{language:B(`language`),locale:B(`locale`),get passThroughHeaders(){let e={...qi(),...Ui()};return Object.keys(e).length>0?e:void 0}}}},auth:e=>{let t=typeof window<`u`?window.wixEmbedsAPI:void 0;!e&&Zi()&&(e=t?.getAccessTokenFunction?.());let n=!1,{resolve:r,promise:i}=Ji();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 Zi(){return typeof document<`u`&&document.currentScript?.tagName===`SCRIPT`}function Qi(){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 $i=({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:()=>{}})}),ea=Xi({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:$i({clientSdk:t,applicationId:n}),close:()=>{}}}}),ta=(e,t)=>{let n=ea.host({applicationId:e,componentId:t}),r=ea.auth();return We({auth:r,host:n}).enableContext(`module`),r.getAccessTokenInjector()},na=e=>ta(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`,e);function V(e,t){for(let n of e){let e=n.addOns.find(e=>e.addOnId===t);if(e)return{group:n,addOn:e}}return null}function ra(e,t){return V(e,t)?.addOn??null}function H(e,t){return t.filter(t=>V(e,t.id)!==null)}function ia(e,t,n){return n.filter(n=>V(e,n.id)?.group===t).length}function aa(e,t){return!e.maxNumberOfAddOns||t<e.maxNumberOfAddOns}function oa(e,t){return e.map(n=>{let r=ia(e,n,t);return{...n,addOns:n.addOns.map(e=>{let n=t.find(t=>t.id===e.addOnId)?.quantity??0;return{...e,isSelected:n>0,selectedQuantity:n}}),selectedCount:r,canSelectMore:aa(n,r)}})}function sa(e,t,n){let r=V(e,n);return r?t.some(e=>e.id===n)?!0:aa(r.group,ia(e,r.group,t)):!1}function ca(e,t){let n=e.maxQuantity??1;return Number.isFinite(t)?Math.min(Math.max(Math.trunc(t),0),n):0}var la={category:`category`,location:`location`,page:`page`,blob:`bookingSelection`,legacyBlob:`b`,resource:`resource`,referral:`referral`,timezone:`timezone`,bookingId:`bookingId`,token:`token`,rescheduleRedirectUrl:`rescheduleRedirectUrl`};function U(e){return e.addOns??[]}function ua(e,t){let n={...e};return t.length?n.addOns=t:delete n.addOns,n}function da(e,t){let n=U(e);return ua(e,n.some(e=>e.id===t)?n.filter(e=>e.id!==t):[...n,{id:t,quantity:1}])}function fa(e,t,n){let r=U(e);return n<=0?ua(e,r.filter(e=>e.id!==t)):ua(e,r.some(e=>e.id===t)?r.map(e=>e.id===t?{...e,quantity:n}:e):[...r,{id:t,quantity:n}])}function pa(){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 ma(()=>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:m.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:m.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:m.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:m.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 ma(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return ma(()=>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 ma(e){let t=globalThis.__wix_context__,n={client:m.client,elevatedClient:m.elevatedClient},r;globalThis.__wix_context__=void 0,m.client=void 0,m.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,m.client=n.client,m.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function ha(e,t){return{...e,...Object.fromEntries(t.map(t=>[t,(...n)=>{let r=pa();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 ga(e){return ha({__type:`host`,create:t=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:r(t)}),{})},Object.keys(e))}var W=e=>typeof e==`string`,G=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},_a=e=>e==null?``:``+e,va=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},ya=/###/g,ba=e=>e&&e.indexOf(`###`)>-1?e.replace(ya,`.`):e,xa=e=>!e||W(e),K=(e,t,n)=>{let r=W(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(xa(e))return{};let t=ba(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return xa(e)?{}:{obj:e,k:ba(r[i])}},Sa=(e,t,n)=>{let{obj:r,k:i}=K(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=K(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=K(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Ca=(e,t,n,r)=>{let{obj:i,k:a}=K(e,t,Object);i[a]=i[a]||[],i[a].push(n)},q=(e,t)=>{let{obj:n,k:r}=K(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},wa=(e,t,n)=>{let r=q(e,n);return r===void 0?q(t,n):r},Ta=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?W(e[r])||e[r]instanceof String||W(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Ta(e[r],t[r],n):e[r]=t[r]);return e},J=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Ea={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},Da=e=>W(e)?e.replace(/[&<>"'\/]/g,e=>Ea[e]):e,Oa=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}},ka=[` `,`,`,`?`,`!`,`;`],Aa=new Oa(20),ja=(e,t,n)=>{t||=``,n||=``;let r=ka.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Aa.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},Ma=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},Y=e=>e?.replace(/_/g,`-`),Na={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},X=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Na,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:(W(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)}},Pa=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])})}},Fa=class extends Pa{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):W(n)&&i?o.push(...n.split(i)):o.push(n)));let s=q(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!W(n)?s:Ma(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),Sa(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)(W(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=q(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Ta(s,n,i):s={...s,...n},Sa(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}},Ia={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}},La=Symbol(`i18next/PATH_KEY`);function Ra(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===La?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Z(e,t){let{[La]:n}=e(Ra()),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 za={},Ba=e=>!W(e)&&typeof e!=`boolean`&&typeof e!=`number`,Va=class e extends Pa{constructor(e,t={}){super(),va([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=X.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=Ba(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&&!ja(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:W(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:W(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=Z(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?Z(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!W(i.count),x=e.hasDefaultValue(i),ee=b?this.pluralResolver.getSuffix(d,i.count,i):``,te=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,ne=b&&!i.ordinal&&i.count===0,S=ne&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${ee}`]||i[`defaultValue${te}`]||i.defaultValue,C=m;y&&!m&&x&&(C=S);let re=Ba(C),ie=Object.prototype.toString.apply(C);if(y&&C&&re&&_.indexOf(ie)<0&&!(W(v)&&Array.isArray(C))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,C,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(C),t=e?[]:{},n=e?g:h;for(let e in C)if(Object.prototype.hasOwnProperty.call(C,e)){let r=`${n}${o}${e}`;t[e]=x&&!m?this.translate(r,{...i,defaultValue:Ba(S)?S[e]:void 0,joinArrays:!1,ns:c}):this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=C[e])}m=t}}else if(y&&W(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=S),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&S!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?S:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);ne&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||S)})}):n(e,s,S))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=W(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&&!W(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=W(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=Ia.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 W(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?Z(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!W(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(W(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,!za[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(za[`${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&&!W(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}},Ha=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=X.create(`languageUtils`)}getScriptPartFromCode(e){if(e=Y(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=Y(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(W(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)),W(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 W(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))):W(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},Ua={zero:0,one:1,two:2,few:3,many:4,other:5},Wa={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},Ga=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=X.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=Y(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),Wa;if(!e.match(/-|_/))return Wa;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)=>Ua[e]-Ua[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))}},Ka=(e,t,n,r=`.`,i=!0)=>{let a=wa(e,t,n);return!a&&i&&W(n)&&(a=Ma(e,n,r),a===void 0&&(a=Ma(t,n,r))),a},qa=e=>e.replace(/\$/g,`$$$$`),Ja=class{constructor(e={}){this.logger=X.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Da:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?J(i):a||`{{`,this.suffix=o?J(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?J(d):f||J(`$t(`),this.nestingSuffix=p?J(p):m||J(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=Ka(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(Ka(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=>qa(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?qa(this.escape(e)):qa(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=W(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!W(a)&&!this.useRawValueToEscape&&(a=_a(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${J(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!W(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&&!W(i))return i;W(i)||(i=_a(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}},Ya=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}},Xa=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(Y(r),i),t[o]=s),s(n)}},Za=e=>(t,n,r)=>e(Y(n),r)(t),Qa=class{constructor(e={}){this.logger=X.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?Xa:Za;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()]=Xa(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}=Ya(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)}},$a=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},eo=class extends Pa{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=X.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{Ca(n.loaded,[i],a),$a(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();W(e)&&(e=this.languageUtils.toResolveHierarchy(e)),W(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)}}},to=()=>({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]),W(e[1])&&(t.defaultValue=e[1]),W(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}),no=e=>(W(e.ns)&&(e.ns=[e.ns]),W(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),W(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),ro=()=>{},io=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},ao=`__i18next_supportNoticeShown`,oo=()=>!!(typeof globalThis<`u`&&globalThis[ao]||typeof process<`u`&&{}.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`),so=()=>{typeof globalThis<`u`&&(globalThis[ao]=!0)},co=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),Q=class e extends Pa{constructor(e={},t){if(super(),this.options=no(e),this.services={},this.logger=X,this.modules={external:[]},io(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&&(W(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=to();this.options={...n,...this.options,...no(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&&!co(this)&&!oo()&&(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 💙`),so());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?X.init(r(this.modules.logger),this.options):X.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Qa;let t=new Ha(this.options);this.store=new Fa(this.options.resources,this.options);let i=this.services;i.logger=X,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new Ga(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 Ja(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new eo(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 Va(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||=ro,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=G(),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=ro){let n=t,r=W(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=G();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||=ro,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`&&Ia.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=G();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=W(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(W(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=Z(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=Z(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=Z(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return W(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=G();return this.options.ns?(W(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=G();W(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 Ha(to());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=ro){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 Fa(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={...to().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new Ja(n)}return a.translator=new Va(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();Q.createInstance,Q.dir,Q.init,Q.loadResources,Q.reloadResources,Q.use,Q.changeLanguage,Q.getFixedT,Q.t,Q.exists,Q.setDefaultNamespace,Q.hasLoadedNamespace,Q.loadNamespaces,Q.loadLanguages;var lo=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,uo={"&amp;":`&`,"&#38;":`&`,"&lt;":`<`,"&#60;":`<`,"&gt;":`>`,"&#62;":`>`,"&apos;":`'`,"&#39;":`'`,"&quot;":`"`,"&#34;":`"`,"&nbsp;":` `,"&#160;":` `,"&copy;":`©`,"&#169;":`©`,"&reg;":`®`,"&#174;":`®`,"&hellip;":`…`,"&#8230;":`…`,"&#x2F;":`/`,"&#47;":`/`},fo=e=>uo[e],po={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(lo,fo),transDefaultProps:void 0},mo=(e={})=>{po={...po,...e}},ho={type:`3rdParty`,init(e){mo(e.options.react)}},go=new Map,_o=500,vo;function yo(){if(vo===void 0)try{vo=new Intl.NumberFormat(`en-US`,{useGrouping:!1,maximumFractionDigits:0}).format(`9007199254740993`)===`9007199254740993`}catch{vo=!1}return vo}var bo=15;function xo(e){if(!(typeof e!=`string`||yo())&&e.replace(/[^0-9]/g,``).replace(/^0+/,``).length>bo)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 So(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 Co(e,t,n){let r=So(e,t,n),i=go.get(r);return i||(i=new Intl.NumberFormat(e,{...n,style:`currency`,currency:t}),go.size>=_o&&go.clear(),go.set(r,i)),i}function wo(e,{value:t,currency:n},r={}){return xo(t),Co(e,n,r).format(t)}function To(e,{value:t,currency:n},r={}){return xo(t),Co(e,n,r).formatToParts(t)}function Eo(e){return Fi().find(e=>e.primary)?.id??e}function Do(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 Oo=ga({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}=Do(e,n);return wo(r,t,i)},formatCurrencyToParts:e=>(t,n)=>{let{locale:r,formatOptions:i}=Do(e,n);return To(r,t,i)},getTranslationFunction:e=>()=>{let t=e.translations?.();if(!t)throw Error(`Host translation resources are not available.`);let n=Q.createInstance(),r=Eo(e.essentials?.language)||`en`,i={lng:e.essentials?.language||r,fallbackLng:r,resources:t};return n.use(ho).init(i,e=>{if(e)throw e}),n.t.bind(n)}}),ko=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)}}},Ao=e=>new ko(e),jo=ga({getMonitoringClient:e=>()=>e.getMonitoringClient?e.getMonitoringClient():Ao(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`)}),Mo={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 No(e){try{let t=jo.getMonitoringClient?.();return t&&typeof t[e]==`function`?t:null}catch{return null}}function Po(e,{feature:t,action:n,level:r=`error`,contexts:i}){let a=No(`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 Fo(e,{feature:t,tags:n},r){let i=No(`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 Io=class extends e{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){Po(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 Lo(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 Ro(e){let t=Lo(e);if(t.status===`fulfilled`)return t.value;throw t.status===`rejected`?t.reason:e}function zo(e){let t=Promise.resolve(e);return t.__state={status:`fulfilled`,value:e},t}var Bo=new WeakMap;function Vo(e,t,n){let r=Bo.get(e);r||(r=new WeakMap,Bo.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`?zo(t(r.__state.value)):r.__state?.status===`rejected`?zo(n(r.__state.reason)):e.then(t,n),i.set(n,a)}return a}function $(e){return e}var Ho=$(`@wix/site-service-warmup-data`);function Uo(){try{return d()}catch{return null}}function Wo(e){try{return e?e(Ho):null}catch{return null}}function Go(){let e=Wo(Uo()),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 Po(e,{feature:Mo.warmup,action:`read`,level:`warning`,contexts:{warmup:{key:n}}}),null}},set:(n,r)=>{if(t&&e)try{e.set(n,r)}catch{}}}}var Ko=$(`@wix/site-service-locale`),qo=$,Jo=qo(`@wix/viewer-service-multilingual`);function Yo(){try{return Oo.getLanguage()??`en`}catch{return`en`}}function Xo(e){try{return f(e)}catch{return null}}function Zo(){let e=Xo(Ko),t=Xo(Jo);return t?.multilingualEnabled&&t.currentLocale?.languageCode||e?.language||Yo()}var Qo=$(`@wix/site-service-renderer-configuration`);function $o(){return f(Qo).currency}function es(){return globalThis.commonConfig?.currency}function ts(e){let t=globalThis.window;if(!t)return()=>{};let n=t.navigation,r=!0,i=()=>queueMicrotask(()=>{r&&e()});return n?.addEventListener(`currententrychange`,i),t.addEventListener(`popstate`,e),()=>{r=!1,n?.removeEventListener(`currententrychange`,i),t.removeEventListener(`popstate`,e)}}var ns=/^[A-Z]{3}$/;function rs(e){return ns.test(e)?typeof Intl.supportedValuesOf!=`function`||Intl.supportedValuesOf(`currency`).includes(e):!1}function is(e){let t=e?.toUpperCase();return t&&rs(t)?t:null}function as(e,t){let n=is(e);return n&&n!==is(t)?n:null}function os(){let e=l(ts,es,es),t=$o();return a(as(e,t))}var ss=[],cs=[],ls=`useServiceAddOnsContext must be used within ServiceAddOnsContextProvider`;function us({isLoading:e,hasError:t,children:n}){let r={addOnGroups:ss,selected:cs,isLoading:e,hasError:t,toggleAddOn:()=>{},setAddOnQuantity:()=>{}};return p(uc.Provider,{value:r,children:n})}function ds({children:e}){return p(us,{isLoading:!0,hasError:!1,children:e})}function fs({children:e}){return p(us,{isLoading:!1,hasError:!0,children:e})}function ps(e){if(!e)return;let t=``;return(e.filename||e.altText)&&(t=`/${encodeURIComponent(e.filename||e.altText)}`),e.id?`wix:image://v1/${e.id}${t}#originWidth=${e.width}&originHeight=${e.height}`:e.url}var ms=[{path:`addOnGroupsDetails.addOns.mainMedia.image.urlExpirationDate`}];function hs(e){return ai(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 gs=`@wix/auto_sdk_bookings_services`;function _s(e){function t({host:t}){return{entityFqdn:`wix.bookings.services.v2.service`,method:`POST`,methodFqn:`wix.bookings.services.v2.AddOnGroupsService.ListAddOnGroupsByServiceId`,packageName:gs,migrationOptions:{optInTransformResponse:!0},url:hs({protoPath:`/v2/services/add-on-groups/list-add-on-groups-by-service-id`,data:e,host:t}),data:e,transformResponse:e=>Lr(e,[{transformFn:wr,paths:ms}])}}return t}var vs=[{path:`addOnGroupsDetails.addOns.mainMedia.image`}];async function ys(e,t){let{httpClient:n,sideEffects:r}=arguments[2],i=_s(Sr({serviceId:e,groupIds:t?.groupIds}));r?.onSiteCall?.();try{let e=await n.request(i);return r?.onSuccess?.(e),Cr(Lr(e.data,[{transformFn:ps,paths:vs}]))}catch(e){let t=qr(e,{spreadPathsToArguments:{},explicitPathsToArguments:{serviceId:`$[0]`,groupIds:`$[1].groupIds`},singleArgumentUnchanged:!1},[`serviceId`,`options`]);throw r?.onError?.(e),t}}function bs(e){return(t,n)=>ys(t,n,{httpClient:e})}var xs=ii(bs);function Ss(e,t){let n=e?.value,r=e?.currency;if(n==null||!r)return null;let i=Number(n);if(!Number.isFinite(i))return null;let a=i%1==0?0:2;return new Intl.NumberFormat(t,{style:`currency`,currency:r,currencyDisplay:`symbol`,maximumFractionDigits:a,minimumFractionDigits:a}).format(i).replace(/\p{Zs}/gu,`\xA0`)}async function Cs(e){return(await xs(e)).addOnGroupsDetails??[]}function ws(e){if(!e)return null;try{let{id:t,url:n,width:r,height:i}=mr.getImageUrl(e);return t&&n?{uri:t,url:n,width:r,height:i}:null}catch{return null}}function Ts(e,t){let n=e.price?.value==null?null:Number(e.price.value);return{addOnId:e.addOnId??null,addOnName:e.nameTranslated??e.name??null,addOnPrice:Ss(e.price,t),addOnPriceValue:n!=null&&Number.isFinite(n)?n:null,addOnCurrency:e.price?.currency??null,durationInMinutes:e.durationInMinutes??null,maxQuantity:e.maxQuantity??null,addOnImage:ws(e.mainMedia?.image),isSelected:!1,selectedQuantity:0}}function Es(e,t){return e.map(e=>({groupId:e.groupId??null,groupName:e.groupNameTranslated??e.groupName??null,prompt:e.promptTranslated??e.prompt??null,maxNumberOfAddOns:e.maxNumberOfAddOns??null,addOns:(e.addOns??[]).map(e=>Ts(e,t)),selectedCount:0,canSelectMore:!0}))}var Ds=`bookings-uou`;function Os(e){return e?`:currency-${e}`:``}function ks(e,t,n,r){return`${Ds}:${e}:addons:${n}:${r}${Os(t)}`}var As=5e3,js=100,Ms=`wix-warmup-data`,Ns=null;function Ps(e){if(typeof document<`u`)try{let t=document.getElementById(Ms)?.textContent;return t?(Ns?.text!==t&&(Ns={text:t,data:JSON.parse(t).builderComponentsWarmupData??{}}),Ns.data[e]??void 0):void 0}catch{return}}var Fs=()=>({promises:new Map,invalidatedWarmup:new Set}),Is=Fs(),Ls=new WeakMap,Rs=new WeakMap;function zs(e){if(!e)return Is;let t=Ls.get(e);return t||(t=Fs(),Ls.set(e,t)),t}function Bs({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=Rs.get(i);a||(a=new Map,Rs.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=zs(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=Ps(e);if(t!==void 0){let n=zo(t);return i.promises.set(e,{promise:n,expiresAt:a+As}),n}}let c=(async()=>{if(s){let n=await t.get(e);if(n!=null)return n}return n()})();i.promises.size>=js&&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()+As},()=>{i.promises.get(e)===l&&i.promises.delete(e)}),c}function Vs(e,t){return Fo(`service-addons-context-load`,{feature:Mo.serviceAddOns,tags:{serviceId:e}},Cs(e)).then(e=>Es(e,t),t=>{throw Po(t,{feature:Mo.serviceAddOns,action:`fetch-add-on-groups`,level:`warning`,contexts:{service:{serviceId:e}}}),t})}function Hs({serviceId:e,locale:t,language:n,currency:r,warmupData:i}){return Bs({key:ks(n,r,e,t),warmupData:i,fetchData:()=>Vs(e,t)})}var Us=qo(`@wix/site-service-business-logger`);function Ws(e){return{evid:32,src:16,endpoint:``,params:e}}var Gs=$(`@wix/site-service-url`),Ks=`appSectionParams`;function qs(e){let t=e.searchParams.get(Ks);if(t===null)return e;let n=new URL(e);n.searchParams.delete(Ks);for(let[e,r]of Object.entries(Js(t)))typeof r==`string`&&!n.searchParams.has(e)&&n.searchParams.set(e,r);return n}function Js(e){try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}var Ys=`bookings-uou:url-change`,Xs=e=>{let t=new URL(e);return t.searchParams.sort(),t.href};function Zs(e,{disableScrollToTop:t,skipHistory:n}={}){let r=globalThis.window;if(!r?.history)return;let i=new URL(r.location.href);if(Xs(i)===Xs(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(Ys))}function Qs(e){let t=globalThis.window;return t?(t.addEventListener(Ys,e),t.addEventListener(`popstate`,e),()=>{t.removeEventListener(Ys,e),t.removeEventListener(`popstate`,e)}):()=>{}}var $s=e=>{try{return decodeURIComponent(e)}catch{return e}};function ec(e,t){let n=t?new URL(t).pathname:`/`;return`./${$s(new URL(e).pathname.replace(n,``).replace(/^\/|\/$/g,``))}`}function tc(){let e=f(Gs),t=r(()=>e.currentUrl,[e]),n=l(Qs,t,t),i=s(()=>qs(new URL(n)),[n]),a=e.siteUrl.replace(/\/$/,``);return{pathname:i.pathname,search:i.search,searchParams:i.searchParams,href:i.href,getParsedUrl:()=>qs(new URL(e.currentUrl)),getRelativeUrl:()=>ec(e.currentUrl,a),getExternalBaseUrl:()=>a,pushUrl:Zs}}var nc=function(e){return e.BOOK_ONLINE=`bookingsBookOnline`,e.SERVICE_PAGE=`bookingsServicePage`,e.CALENDAR_PAGE=`bookingsCalendar`,e.FORM_PAGE=`bookingsForm`,e}({}),rc={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`};nc.BOOK_ONLINE;var ic=`new_bookings_server`,ac=e=>{let{reportBi:t}=f(Us);return r(n=>{t({widget_name:e,bookingsPlatform:ic,is_over_editor:!1,...n.params,src:n.src,evid:n.evid},{endpoint:n.endpoint})},[t,e])},oc=(e,t=!0)=>{let n=ac(e),{getParsedUrl:r}=tc(),i=c(!1);o(()=>{t&&!i.current&&(i.current=!0,n(Ws({referralInfo:r().searchParams.get(la.referral)??void 0})))},[t,n,r])},sc=zo({addOnGroups:ss,hasError:!1}),cc=e=>({addOnGroups:e,hasError:!1}),lc=()=>({addOnGroups:ss,hasError:!0}),uc=n(null);function dc(){let e=i(uc);if(!e)throw Error(ls);return e}function fc({addOnsPromise:e,isLoading:t,pickedAddOns:n,forwardToggleAddOn:i,forwardSetAddOnQuantity:a,children:o}){let{addOnGroups:l,hasError:u}=Ro(e),d=s(()=>H(l,n),[l,n]),f=s(()=>oa(l,d),[l,d]),m=c({source:n,picks:n});m.current.source!==n&&(m.current={source:n,picks:n});let h=e=>{let t=m.current;t.picks=U(e({serviceId:``,addOns:t.picks}))},g=r(()=>{let e=m.current,t=H(l,e.picks);return e.picks.filter(e=>!t.includes(e)).forEach(e=>a(e.id,0)),e.picks=t,t},[l,a]),_=r(e=>{let n=H(l,m.current.picks);!t&&sa(l,n,e)&&(g(),i(e),h(t=>da(t,e)))},[t,l,g,i]),v=r((e,n)=>{let r=t?null:ra(l,e);if(!r)return;let i=H(l,m.current.picks),o=i.find(t=>t.id===e)?.quantity??0,s=ca(r,n);s===o||o===0&&!sa(l,i,e)||(g(),a(e,s),h(t=>fa(t,e,s)))},[t,l,g,a]),y=s(()=>({addOnGroups:f,selected:d,isLoading:t,hasError:u,toggleAddOn:_,setAddOnQuantity:v}),[f,d,t,u,_,v]);return p(uc.Provider,{value:y,children:o})}function pc({children:e}){let{service:n,serviceId:r,hasAddOns:i,locale:a,isLoading:o,bookingsSettingsLoading:c,selection:l,toggleAddOn:d,setAddOnQuantity:f}=u();oc(rc.SERVICE_ADD_ONS,!o&&!c);let m=s(()=>U(l),[l]),h=Go(),g=Zo(),_=os(),v=n&&i&&r?r:null,y=s(()=>v?Vo(Hs({serviceId:v,locale:a,language:g,currency:_,warmupData:h}),cc,lc):sc,[v,a,g,_]),b=!v&&!!o;return p(Io,{fallback:p(fs,{children:e}),feature:Mo.serviceAddOns,children:p(t,{fallback:p(ds,{children:e}),children:p(fc,{addOnsPromise:y,isLoading:b,pickedAddOns:m,forwardToggleAddOn:d,forwardSetAddOnQuantity:f,children:e})})})}var mc=na(`bcc1b809-bde5-4d7d-a7bb-89831fe5ccb8`);export{pc as default,mc as injectAccessTokenGetter,uc as serviceAddOnsContext,dc as useServiceAddOnsContext};
2
- //# sourceMappingURL=context-provider-bcc1b809-bde5-4d7d-a7bb-89831fe5ccb8-BW0YqbZL.js.map
1
+ import{Component as e,Suspense as t,createContext as n,useCallback as r,useContext as i,useDeferredValue as a,useEffect as o,useMemo as s,useRef as c,useSyncExternalStore as l}from"react";import{useServiceContext as u}from"@wix/bookings/context/service";import{useGetService as d,useService as f}from"@wix/services-manager-react";import{jsx as p}from"react/jsx-runtime";var m={};function h(e,t=!1,n=e=>e){return()=>({__type:`event-definition`,type:e,isDomainEvent:t,transformations:n})}var g=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}`)}},_=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:g(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}},v=e=>e.__isAmbassador?!0:!!e().__isAmbassador,y=`__metadata`,b=`edge.wixapis.com`,x=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 ee(this.response.status,e?.message,e?.details,{requestId:this.response.headers.get(`X-Wix-Request-Id`),details:e})}},ee=(e,t,n,r)=>({details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t,requestId:r?.requestId}),te=e=>e?.method&&[`post`,`put`,`patch`].includes(e.method.toLocaleLowerCase())&&e.body?{"Content-Type":`application/json`}:{},ne=e=>e&&typeof e==`object`&&!Array.isArray(e),S=e=>e.__type===`host`;function C(e,t){return e.create(t)}var re=`x-wix-bi-gateway`;function ie(e,t,n){return{[re]:ae({environment:`js-sdk${n?`-${n}`:``}`,"package-name":e.packageName??t?.PACKAGE_NAME,"method-fqn":e.methodFqn,entity:e.entityFqdn})}}function ae(e){return Object.entries(e).filter(([e,t])=>!!t).map(([e,t])=>`${e}=${t}`).join(`,`)}function oe(e){let t=globalThis.__wix_context__,n={client:m.client,elevatedClient:m.elevatedClient},r;globalThis.__wix_context__=void 0,m.client=void 0,m.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,m.client=n.client,m.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}var se={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function ce(e){return pe(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var le=/([\p{Ll}\d])(\p{Lu})/gu,ue=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,de=`$1\0$2`,fe=/[^\p{L}\d]+/giu;function pe(e){let t=e.trim();t=t.replace(le,de).replace(ue,de),t=t.replace(fe,`\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 me=e=>`validationError`in(e.response?.data?.details??{}),he=e=>`applicationError`in(e.response?.data?.details??{}),ge=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function _e(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(me(e))return ve(e,t,n);if(he(e))return ye(e);if(ge(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:ce(n),data:{}},requestId:e.requestId};return w(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return be(e)}var ve=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=xe(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return w(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},w=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),ye=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??ce(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return w(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},be=e=>w(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:ce(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),xe=({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:Se(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,Se(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},Se=(e,t)=>{let n=Ce(e);return n==null?e:e.replace(`$[${n}]`,t[n])},Ce=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function we(e,t,n,r,i,a,o,s,c,l,u){return oe(()=>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?b:o}${a.url}`;a.params&&a.params.toString()&&(u+=`?${a.params.toString()}`);try{let e=ie(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=Ee(s.status,e?.message??s.statusText,e?.details,{requestId:s.headers.get(`X-Wix-Request-Id`),details:e}),n=_e(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 Te=class extends Error{response;requestId;constructor(e){super(),this.response=e.response,this.requestId=e.requestId}},Ee=(e,t,n,r)=>new Te({response:{data:{details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t},status:e},requestId:r?.requestId}),De=`.`;function Oe(e,t,n){if(e==null)throw Error(`Cannot set value on null or undefined`);let r=ke(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 ke(e){return Array.isArray(e)?e:e.split(De).map(e=>Ae(e)?Number(e):e)}function Ae(e){return/^\d+$/.test(e)}function je(e){let t={};for(let[n,r]of Object.entries(e))Me(n)||Oe(t,ke(n),r);return t}function Me(e){return e===`__proto__`||e===`constructor`||e===`prototype`}var Ne=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])),je(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 se?se[e]:void 0;if(i&&i in t){r.push(i),n=t[i];return}let a=Le(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 Pe(e,t){let n=e?.modifiedFields;if(!n)return null;let r=Fe(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=Ie(s,a);return c===null?null:(o.modifiedFields=c,o)}function Fe(e){if(typeof e==`object`&&e&&!Array.isArray(e))try{let t=new Ne(e);return{unflattenedModifiedFields:t.unflatten(),modifiedFieldsManipulator:t}}catch{return null}return null}function Ie(e,t){if(typeof e==`object`&&e&&!Array.isArray(e))try{return t.flatten(e)}catch{return null}return null}function Le(e){return e.replace(/[-_\s]+(.)?/g,(e,t)=>t?t.toUpperCase():``).replace(/^./,e=>e.toLowerCase())}function Re(){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 ze=e=>e.__type===`event-definition`;function Be(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=Pe(s,a);if(e)return t(e)}}return t(a(o))}function Ve(e){let t=new Map,n=Re();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})=>Be(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})=>Be(t,n,e.payload,{instanceId:e.instanceId,identity:e.identity})))},apps:{AppInstalled:h(`AppInstalled`)(),AppRemoved:h(`AppRemoved`)()}}}}var He=e=>e.__type===`service-plugin-definition`;function Ue(e){let t=new Map,n=Re();return{initModule(e){return r=>{let i=t.get(e.componentType.toLowerCase())??[];i.push({servicePluginDefinition:e,implementation:r}),t.set(e.componentType.toLowerCase(),i),n.emit(`registered`,e)}},client:{...n,getRegisteredServicePlugins:()=>t,async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t,!0);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`object`||r.data===null||!(`metadata`in r.data)||typeof r.data.metadata!=`object`||r.data.metadata===null||!(`appExtensionType`in r.data.metadata)||typeof r.data.metadata.appExtensionType!=`string`)throw Error(`Unexpected JWT data: expected object with metadata.appExtensionType string`);return r.data},async process(e){let t=await this.parseJWT(e.body);return this.executeHandler(t,e.url)},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async processRequest(e){let t=await this.parseRequest(e);return this.processParsedRequest(t,e.url)},async processParsedRequest(e,t){try{let n=await this.executeHandler(e,t);return Response.json(n)}catch(e){if(e.errorType===`SPI`&&e.applicationCode&&e.httpCode)return Response.json({applicationError:{code:e.applicationCode,data:e.data}},{status:e.httpCode});throw e}},async executeHandler(e,n){let r=e.metadata.appExtensionType.toLowerCase(),i=t.get(r)??[];if(i.length===0)throw Error(`No service plugin implementations found for component type ${r}`);if(i.length>1)throw Error(`Multiple service plugin implementations found for component type ${r}. This is currently not supported`);let{implementation:a,servicePluginDefinition:o}=i[0],s=o.methods.find(e=>n.endsWith(e.primaryHttpMappingPath));if(!s)throw Error(`Unexpect request: request url did not match any method: `+n);let c=a[s.name];if(!c)throw Error(`Got request for service plugin method ${s.name} but no implementation was provided. Available methods: ${Object.keys(a).join(`, `)}`);return s.transformations.toREST(await c(s.transformations.fromREST(e)))}}}}var T=`X-Wix-Consistent`;function We(e){let t=e.headers||{Authorization:``},n={getAuthHeaders:e=>Promise.resolve({headers:{}})},r=e.auth,i=typeof r==`function`?r:()=>r??n,a=()=>i().getAuthHeaders(e.host),o=()=>e.fetch??fetch,s=async(n,r)=>{let i=o(),s=await a(),c={...r?.headers??{},...s.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[T]:t[T]}:{}},l=e.host?.getErrorHandler?.();try{if(typeof n==`string`||n instanceof URL){let e=await i(n,{...r,headers:c});l?.handleError(e,{requestOptions:{url:n.toString(),method:r?.method}});let a=Ge(e);return a&&(t[T]=a),e}{for(let[e,t]of Object.entries(c))typeof t==`string`&&n.headers.set(e,t);let e=await i(n,r);l?.handleError(e,{requestOptions:{url:n.url,method:r?.method}});let a=Ge(e);return a&&(t[T]=a),e}}catch(e){throw l?.handleError(e,{requestOptions:{url:typeof n==`string`||n instanceof URL?n.toString():n.url,method:r?.method}}),e}},{client:c,initModule:l}=Ue(i),{client:u,initModule:d}=Ve(i),f=async(n,r)=>{let i=o(),s=await a(),c=te(r),l=await i(n,{...r,headers:{...c,...t,...s?.headers,...r?.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[T]:t[T]}:{}}}),u=Ge(l);return u&&(t[T]=u),l},p=(t,n)=>{if(ze(t))return d(t);if(He(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 we(oe(()=>v(t))?_(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 ne(t)?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,p(n,t[y])])):t},h=e=>{for(let n in e)t[n]=e[n]};return{...e.modules?p(e.modules):{},get auth(){let t=i();return t.getAuthHeaders=t.getAuthHeaders.bind(void 0,e.host),t},setHeaders:h,use:p,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?m.elevatedClient=this:m.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 x(`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 Ge(e){return e.headers?.get(`X-Wix-Consistent`)??e.headers?.get(`x-wix-consistent`)}var Ke=1920,qe=1920,Je=1e3,Ye=1e3,E={SCALE_TO_FILL:`fill`,SCALE_TO_FIT:`fit`,STRETCH:`stretch`,ORIGINAL_SIZE:`original_size`,TILE:`tile`,TILE_HORIZONTAL:`tile_horizontal`,TILE_VERTICAL:`tile_vertical`,FIT_AND_TILE:`fit_and_tile`,LEGACY_STRIP_TILE:`legacy_strip_tile`,LEGACY_STRIP_TILE_HORIZONTAL:`legacy_strip_tile_horizontal`,LEGACY_STRIP_TILE_VERTICAL:`legacy_strip_tile_vertical`,LEGACY_STRIP_SCALE_TO_FILL:`legacy_strip_fill`,LEGACY_STRIP_SCALE_TO_FIT:`legacy_strip_fit`,LEGACY_STRIP_FIT_AND_TILE:`legacy_strip_fit_and_tile`,LEGACY_STRIP_ORIGINAL_SIZE:`legacy_strip_original_size`,LEGACY_ORIGINAL_SIZE:`actual_size`,LEGACY_FIT_WIDTH:`fitWidth`,LEGACY_FIT_HEIGHT:`fitHeight`,LEGACY_FULL:`full`,LEGACY_BG_FIT_AND_TILE:`legacy_tile`,LEGACY_BG_FIT_AND_TILE_HORIZONTAL:`legacy_tile_horizontal`,LEGACY_BG_FIT_AND_TILE_VERTICAL:`legacy_tile_vertical`,LEGACY_BG_NORMAL:`legacy_normal`},D={FIT:`fit`,FILL:`fill`,FILL_FOCAL:`fill_focal`,CROP:`crop`,LEGACY_CROP:`legacy_crop`,LEGACY_FILL:`legacy_fill`},O={CENTER:`center`,TOP:`top`,TOP_LEFT:`top_left`,TOP_RIGHT:`top_right`,BOTTOM:`bottom`,BOTTOM_LEFT:`bottom_left`,BOTTOM_RIGHT:`bottom_right`,LEFT:`left`,RIGHT:`right`},Xe={[O.CENTER]:{x:.5,y:.5},[O.TOP_LEFT]:{x:0,y:0},[O.TOP_RIGHT]:{x:1,y:0},[O.TOP]:{x:.5,y:0},[O.BOTTOM_LEFT]:{x:0,y:1},[O.BOTTOM_RIGHT]:{x:1,y:1},[O.BOTTOM]:{x:.5,y:1},[O.RIGHT]:{x:1,y:.5},[O.LEFT]:{x:0,y:.5}},Ze={center:`c`,top:`t`,top_left:`tl`,top_right:`tr`,bottom:`b`,bottom_left:`bl`,bottom_right:`br`,left:`l`,right:`r`},Qe={BG:`bg`,IMG:`img`,SVG:`svg`},$e={AUTO:`auto`,CLASSIC:`classic`,SUPER:`super`},et={classic:1,super:2},tt={radius:`0.66`,amount:`1.00`,threshold:`0.01`},nt=25e6,rt=[1.5,2,4],k={HIGH:{size:196e4,quality:90,maxUpscale:1},MEDIUM:{size:36e4,quality:85,maxUpscale:1},LOW:{size:16e4,quality:80,maxUpscale:1.2},TINY:{size:0,quality:80,maxUpscale:1.4}},A={HIGH:`HIGH`,MEDIUM:`MEDIUM`,LOW:`LOW`,TINY:`TINY`},j={CONTRAST:`contrast`,BRIGHTNESS:`brightness`,SATURATION:`saturation`,HUE:`hue`,BLUR:`blur`},M={JPG:`jpg`,JPEG:`jpeg`,JPE:`jpe`,PNG:`png`,WEBP:`webp`,WIX_ICO_MP:`wix_ico_mp`,WIX_MP:`wix_mp`,GIF:`gif`,SVG:`svg`,AVIF:`avif`,UNRECOGNIZED:`unrecognized`},it={AVIF:`AVIF`,PAVIF:`PAVIF`};M.JPG,M.JPEG,M.JPE,M.PNG,M.GIF,M.WEBP;function N(e,...t){return function(...n){let r=n[n.length-1]||{},i=[e[0]];return t.forEach(function(t,a){let o=Number.isInteger(t)?n[t]:r[t];i.push(o,e[a+1])}),i.join(``)}}function at(e){return e[e.length-1]}var ot=[M.PNG,M.JPEG,M.JPG,M.JPE,M.WIX_ICO_MP,M.WIX_MP,M.WEBP,M.AVIF],st=[M.JPEG,M.JPG,M.JPE];function ct(e){return ot.includes(I(e))}function lt(e,t,n){return n&&t&&!_t(t.id)&&Object.values(E).includes(e)}function ut(e,t,n){return!(P(e)||F(e))||!t||n}function dt(e,t,n){return ht(e)?!!(t||n):!1}function ft(e,t,n,r){if(gt(e)||!ut(e,t,n))return!1;let i=ct(e),a=dt(e,n,r);return i||a}function pt(e){return st.includes(I(e))}function mt(e){return I(e)===M.PNG}function P(e){return I(e)===M.WEBP}function ht(e){return I(e)===M.GIF}function F(e){return I(e)===M.AVIF}function gt(e){return/(^https?)|(^data)|(^\/\/)/.test(e)}function _t(e){return!e||!e.trim()||e.toLowerCase()===`none`}function vt(e){return e?.isSEOBot??!1}var yt=[`/`,`\\`,`?`,`<`,`>`,`|`,`“`,`:`,`"`].map(encodeURIComponent),bt=[`\\.`,`\\*`],xt=`_`;function St(e,t){let n=/\/(.*?)$/,r=/\.([^.]*)$/,i=RegExp(`(${yt.concat(bt).join(`|`)})`,`g`);if(t&&t.length){let e=t,n=t.match(r);return n&&ot.includes(n[1])&&(e=t.replace(r,``)),encodeURIComponent(e).replace(i,xt)}let a=e.match(n);return(a?a[1]:e).replace(r,``)}function Ct(e){return pt(e)?M.JPG:mt(e)?M.PNG:P(e)?M.WEBP:ht(e)?M.GIF:F(e)?M.AVIF:M.UNRECOGNIZED}function I(e){return(/[.]([^.]+)$/.exec(e)&&/[.]([^.]+)$/.exec(e)[1]||``).toLowerCase()}function wt(e,t,n,r){return Math.min(n/e,r/t)}function Tt(e,t,n,r){return Math.max(n/e,r/t)}function Et(e,t,n,r,i){let a;return a=i===D.FILL?Tt(e,t,n,r):i===D.FIT?wt(e,t,n,r):1,a}function Dt(e,t,n,r,i){let a,o=n,s=r;if(a=Et(e,t,n,r,i),i===D.FIT&&(o=e*a,s=t*a),o&&s&&o*s>25e6){let n=Math.sqrt(nt/(o*s));o*=n,s*=n,a=Et(e,t,o,s,i)}return{scaleFactor:a,width:o,height:s}}function Ot(e,t,n,r,i,a){e||=r.width,t||=r.height;let{scaleFactor:o,width:s,height:c}=Dt(e,t,r.width*i,r.height*i,n);return Bt(e,t,s,c,a,o,n)}function kt(e=O.CENTER){return Xe[e]}function At(e,t,n,r){let i=Pt(n)||kt(r);return{x:Math.max(0,Math.min(e.width-t.width,i.x*e.width-t.width/2)),y:Math.max(0,Math.min(e.height-t.height,i.y*e.height-t.height/2)),width:Math.min(e.width,t.width),height:Math.min(e.height,t.height)}}function jt(e,t){let n=Math.max(0,Math.min(e.width,t.x+t.width)-Math.max(0,t.x)),r=Math.max(0,Math.min(e.height,t.y+t.height)-Math.max(0,t.y));return n&&r&&(e.width!==n||e.height!==r)?{x:Math.max(0,t.x),y:Math.max(0,t.y),width:n,height:r}:null}function Mt(e){return Math.min(e.pixelAspectRatio||1,2)}function Nt(e){return e.alignment&&Ze[e.alignment]||Ze[O.CENTER]}function Pt(e){let t;return e&&typeof e.x==`number`&&!isNaN(e.x)&&typeof e.y==`number`&&!isNaN(e.y)&&(t={x:L(Math.max(0,Math.min(100,e.x))/100,2),y:L(Math.max(0,Math.min(100,e.y))/100,2)}),t}function Ft(e,t){return k[Vt(e,t)].quality}function It(e,t){return{optimizedScaleFactor:k[Vt(e,t)].maxUpscale,upscaleMethodValue:et.classic,forceUSM:!1}}function Lt(e,t){return{optimizedScaleFactor:k[Vt(e,t)].maxUpscale,upscaleMethodValue:et.classic,forceUSM:!1}}function Rt(e){return{optimizedScaleFactor:at(rt),upscaleMethodValue:et.super,forceUSM:!(rt.includes(e)||e>at(rt))}}function zt(e,t,n,r){return r===`auto`?Lt(e,t):r===`super`?Rt(n):It(e,t)}function Bt(e,t,n,r,i,a,o){let{optimizedScaleFactor:s,upscaleMethodValue:c,forceUSM:l}=zt(e,t,a,i),u=n,d=r;if(a<=s)return{width:u,height:d,scaleFactor:a,upscaleMethodValue:c,forceUSM:l,cssUpscaleNeeded:!1};switch(o){case D.FILL:u=s/a*n,d=s/a*r;break;case D.FIT:u=e*s,d=t*s}return{width:u,height:d,scaleFactor:s,upscaleMethodValue:c,forceUSM:l,cssUpscaleNeeded:!0}}function Vt(e,t){let n=e*t;return n>k[A.HIGH].size?A.HIGH:n>k[A.MEDIUM].size?A.MEDIUM:n>k[A.LOW].size?A.LOW:A.TINY}function L(e,t){let n=10**(t||0);return(e*n/n).toFixed(t)}function Ht(e){return!e||!e.upscaleMethod?$e.AUTO:$e[e.upscaleMethod.toUpperCase()]||$e.AUTO}function Ut(e,t){let n=P(e)||F(e);return I(e)===M.GIF||n&&t}var Wt={isMobile:!1},Gt=function(e){return Wt[e]},Kt=function(e,t){Wt[e]=t};function qt(){if(typeof window<`u`&&typeof navigator<`u`){let e=window.matchMedia&&window.matchMedia(`(max-width: 767px)`).matches,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);Kt(`isMobile`,e&&t)}}O.CENTER,O.TOP,O.TOP_LEFT,O.TOP_RIGHT,O.BOTTOM,O.BOTTOM_LEFT,O.BOTTOM_RIGHT,O.LEFT,O.RIGHT;function Jt(){return Gt(`isMobile`)}function Yt(e,t,n){let r;switch(t.crop&&(r=jt(t,t.crop),r&&(e.src.width=r.width,e.src.height=r.height,e.src.isCropped=!0,e.parts.push($t(r)))),e.fittingType){case E.SCALE_TO_FIT:case E.LEGACY_FIT_WIDTH:case E.LEGACY_FIT_HEIGHT:case E.LEGACY_FULL:case E.FIT_AND_TILE:case E.LEGACY_BG_FIT_AND_TILE:case E.LEGACY_BG_FIT_AND_TILE_HORIZONTAL:case E.LEGACY_BG_FIT_AND_TILE_VERTICAL:case E.LEGACY_BG_NORMAL:e.parts.push(Xt(e,n));break;case E.SCALE_TO_FILL:e.parts.push(Zt(e,n));break;case E.STRETCH:e.parts.push(Qt(e,n));break;case E.TILE_HORIZONTAL:case E.TILE_VERTICAL:case E.TILE:case E.LEGACY_ORIGINAL_SIZE:case E.ORIGINAL_SIZE:r=At(e.src,n,e.focalPoint,n.alignment),e.src.isCropped?(Object.assign(e.parts[0],r),e.src.width=r.width,e.src.height=r.height):e.parts.push($t(r));break;case E.LEGACY_STRIP_TILE_HORIZONTAL:case E.LEGACY_STRIP_TILE_VERTICAL:case E.LEGACY_STRIP_TILE:case E.LEGACY_STRIP_ORIGINAL_SIZE:e.parts.push(nn(n));break;case E.LEGACY_STRIP_SCALE_TO_FIT:case E.LEGACY_STRIP_FIT_AND_TILE:e.parts.push(en(n));break;case E.LEGACY_STRIP_SCALE_TO_FILL:e.parts.push(tn(n))}}function Xt(e,t){let n=Ot(e.src.width,e.src.height,D.FIT,t,e.devicePixelRatio,e.upscaleMethod);return{transformType:!e.src.width||!e.src.height?D.FIT:D.FILL,width:Math.round(n.width),height:Math.round(n.height),alignment:Ze.center,upscale:n.scaleFactor>1,forceUSM:n.forceUSM,scaleFactor:n.scaleFactor,cssUpscaleNeeded:n.cssUpscaleNeeded,upscaleMethodValue:n.upscaleMethodValue}}function Zt(e,t){let n=Ot(e.src.width,e.src.height,D.FILL,t,e.devicePixelRatio,e.upscaleMethod),r=Pt(e.focalPoint);return{transformType:r?D.FILL_FOCAL:D.FILL,width:Math.round(n.width),height:Math.round(n.height),alignment:Nt(t),focalPointX:r&&r.x,focalPointY:r&&r.y,upscale:n.scaleFactor>1,forceUSM:n.forceUSM,scaleFactor:n.scaleFactor,cssUpscaleNeeded:n.cssUpscaleNeeded,upscaleMethodValue:n.upscaleMethodValue}}function Qt(e,t){let n=Et(e.src.width,e.src.height,t.width,t.height,D.FILL),r={...t};return r.width=e.src.width*n,r.height=e.src.height*n,Xt(e,r)}function $t(e){return{transformType:D.CROP,x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height),upscale:!1,forceUSM:!1,scaleFactor:1,cssUpscaleNeeded:!1}}function en(e){return{transformType:D.FIT,width:Math.round(e.width),height:Math.round(e.height),upscale:!1,forceUSM:!0,scaleFactor:1,cssUpscaleNeeded:!1}}function tn(e){return{transformType:D.LEGACY_FILL,width:Math.round(e.width),height:Math.round(e.height),alignment:Nt(e),upscale:!1,forceUSM:!0,scaleFactor:1,cssUpscaleNeeded:!1}}function nn(e){return{transformType:D.LEGACY_CROP,width:Math.round(e.width),height:Math.round(e.height),alignment:Nt(e),upscale:!1,forceUSM:!1,scaleFactor:1,cssUpscaleNeeded:!1}}function rn(e,t){t||={},e.quality=sn(e,t),e.progressive=on(t),e.watermark=an(t),e.autoEncode=t.autoEncode??!0,e.encoding=t?.encoding,e.unsharpMask=ln(e,t),e.filters=cn(t)}function an(e){return e.watermark}function on(e){return e.progressive!==!1}function sn(e,t){let n=e.fileType===M.PNG,r=e.fileType===M.JPG,i=e.fileType===M.WEBP,a=e.fileType===M.AVIF;if(r||n||i||a){let r=at(e.parts),i=Ft(r.width,r.height),a=t.quality&&t.quality>=5&&t.quality<=90?t.quality:i;return a=n?a+5:a,a}return 0}function cn(e){let t=e.filters||{},n={};return R(t[j.CONTRAST],-100,100)&&(n[j.CONTRAST]=t[j.CONTRAST]),R(t[j.BRIGHTNESS],-100,100)&&(n[j.BRIGHTNESS]=t[j.BRIGHTNESS]),R(t[j.SATURATION],-100,100)&&(n[j.SATURATION]=t[j.SATURATION]),R(t[j.HUE],-180,180)&&(n[j.HUE]=t[j.HUE]),R(t[j.BLUR],0,100)&&(n[j.BLUR]=t[j.BLUR]),n}function R(e,t,n){return typeof e==`number`&&!isNaN(e)&&e!==0&&e>=t&&e<=n}function ln(e,t){if(dn(t.unsharpMask))return{radius:L(t.unsharpMask?.radius,2),amount:L(t.unsharpMask?.amount,2),threshold:L(t.unsharpMask?.threshold,2)};if(!fn(t.unsharpMask)&&un(e))return tt}function un(e){let t=at(e.parts);return!(t.scaleFactor>=1)||t.forceUSM||t.transformType===D.FIT}function dn(e){e||={};let t=typeof e.radius==`number`&&!isNaN(e.radius)&&e.radius>=.1&&e.radius<=500,n=typeof e.amount==`number`&&!isNaN(e.amount)&&e.amount>=0&&e.amount<=10,r=typeof e.threshold==`number`&&!isNaN(e.threshold)&&e.threshold>=0&&e.threshold<=255;return t&&n&&r}function fn(e){return e||={},typeof e.radius==`number`&&!isNaN(e.radius)&&e.radius===0&&typeof e.amount==`number`&&!isNaN(e.amount)&&e.amount===0&&typeof e.threshold==`number`&&!isNaN(e.threshold)&&e.threshold===0}function pn(e,t,n,r){let i=vt(r),a=Ct(t.id),o=St(t.id,t.name),s=i?1:Mt(n),c=I(t.id),l=c,u=ft(t.id,r?.hasAnimation,r?.allowAnimatedTransform,r?.allowFullGIFTransformation),d={fileName:o,fileExtension:c,fileType:a,fittingType:e,preferredExtension:l,src:{id:t.id,width:t.width,height:t.height,isCropped:!1,isAnimated:Ut(t.id,r?.hasAnimation)},focalPoint:{x:t.focalPoint&&t.focalPoint.x,y:t.focalPoint&&t.focalPoint.y},parts:[],devicePixelRatio:s,quality:0,upscaleMethod:Ht(r),progressive:!0,watermark:``,unsharpMask:{},filters:{},transformed:u,allowFullGIFTransformation:r?.allowFullGIFTransformation,isPlaceholderFlow:r?.isPlaceholderFlow};return u&&(Yt(d,t,n),rn(d,r)),d}function mn(e,t,n){let r={...n},i=Jt();switch(e){case E.LEGACY_BG_FIT_AND_TILE:case E.LEGACY_BG_FIT_AND_TILE_HORIZONTAL:case E.LEGACY_BG_FIT_AND_TILE_VERTICAL:case E.LEGACY_BG_NORMAL:let e=i?Je:Ke,n=i?Ye:qe;r.width=Math.min(e,t.width),r.height=Math.min(n,Math.round(r.width/(t.width/t.height))),r.pixelAspectRatio=1}return r}var hn=N`fit/w_${`width`},h_${`height`}`,gn=N`fill/w_${`width`},h_${`height`},al_${`alignment`}`,_n=N`fill/w_${`width`},h_${`height`},fp_${`focalPointX`}_${`focalPointY`}`,vn=N`crop/x_${`x`},y_${`y`},w_${`width`},h_${`height`}`,yn=N`crop/w_${`width`},h_${`height`},al_${`alignment`}`,bn=N`fill/w_${`width`},h_${`height`},al_${`alignment`}`,z=N`,lg_${`upscaleMethodValue`}`,xn=N`,q_${`quality`}`,Sn=N`,quality_auto`,Cn=N`,usm_${`radius`}_${`amount`}_${`threshold`}`,wn=N`,bl`,Tn=N`,wm_${`watermark`}`,En={[j.CONTRAST]:N`,con_${`contrast`}`,[j.BRIGHTNESS]:N`,br_${`brightness`}`,[j.SATURATION]:N`,sat_${`saturation`}`,[j.HUE]:N`,hue_${`hue`}`,[j.BLUR]:N`,blur_${`blur`}`},Dn=N`,enc_auto`,On=N`,enc_avif`,kn=N`,enc_pavif`,An=N`,pstr`,jn=N`,anm_all`;function Mn(e){if(e.parts.some(({width:e,height:t})=>!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0))return e.src.id;let t=[];e.parts.forEach(e=>{switch(e.transformType){case D.CROP:t.push(vn(e));break;case D.LEGACY_CROP:t.push(yn(e));break;case D.LEGACY_FILL:let n=bn(e);e.upscale&&(n+=z(e)),t.push(n);break;case D.FIT:let r=hn(e);e.upscale&&(r+=z(e)),t.push(r);break;case D.FILL:let i=gn(e);e.upscale&&(i+=z(e)),t.push(i);break;case D.FILL_FOCAL:let a=_n(e);e.upscale&&(a+=z(e)),t.push(a)}});let n=t.join(`/`);if(e.quality&&(n+=xn(e)),e.unsharpMask&&(n+=Cn(e.unsharpMask)),e.progressive||(n+=wn(e)),e.watermark&&(n+=Tn(e)),e.filters&&(n+=Object.keys(e.filters).map(t=>En[t](e.filters)).join(``)),e.fileType!==M.GIF&&(e.encoding===it.AVIF?(n+=On(e),n+=Sn(e)):e.encoding===it.PAVIF?(n+=kn(e),n+=Sn(e)):e.autoEncode&&(n+=Dn(e))),e.src?.isAnimated&&e.transformed){let t=ht(e.src.id),r=e.isPlaceholderFlow===!0,i=e.allowFullGIFTransformation===!0;r?n+=An(e):t&&i&&(n+=jn(e))}return`${e.src.id}/v1/${n}/${e.fileName}.${e.preferredExtension}`}function Nn(e,t,n,r={},i){if(ft(t.id,r?.hasAnimation,r?.allowAnimatedTransform,r?.allowFullGIFTransformation)){if((P(t.id)||F(t.id))&&!r.allowWebpAvifTransforms){let{alignment:a,...o}=n;t.focalPoint={x:void 0,y:void 0},delete t?.crop,i=pn(e,t,o,r)}else i||=pn(e,t,n,r);return Mn(i)}return t.id}var Pn={[O.CENTER]:`50% 50%`,[O.TOP_LEFT]:`0% 0%`,[O.TOP_RIGHT]:`100% 0%`,[O.TOP]:`50% 0%`,[O.BOTTOM_LEFT]:`0% 100%`,[O.BOTTOM_RIGHT]:`100% 100%`,[O.BOTTOM]:`50% 100%`,[O.RIGHT]:`100% 50%`,[O.LEFT]:`0% 50%`};Object.entries(Pn).reduce((e,[t,n])=>(e[n]=t,e),{}),E.TILE,E.TILE_HORIZONTAL,E.TILE_VERTICAL,E.LEGACY_BG_FIT_AND_TILE,E.LEGACY_BG_FIT_AND_TILE_HORIZONTAL,E.LEGACY_BG_FIT_AND_TILE_VERTICAL,E.LEGACY_ORIGINAL_SIZE,E.ORIGINAL_SIZE,E.LEGACY_BG_NORMAL;function Fn(e,t,n,r){if(lt(e,t,n)){let i=mn(e,t,n),a=pn(e,t,i,r);return{uri:Nn(e,t,i,r||{},a)}}return{uri:``}}var In=`https://static.wixstatic.com/`,Ln=`https://static.wixstatic.com/media/`,Rn=/^media\//i,zn=typeof window<`u`?window.devicePixelRatio:1,Bn=e=>Rn.test(e)?`${In}${e}`:`${Ln}${e}`,Vn=(e,t)=>{let n=t&&t.baseHostURL;return n?`${n}${e}`:Bn(e)};function Hn(e,t,n,r,i,a){return Vn(Fn(E.SCALE_TO_FIT,{id:e,width:t,height:n,name:a&&a.name},{width:r,height:i,htmlTag:Qe.IMG,alignment:O.CENTER,pixelAspectRatio:a?.devicePixelRatio??zn},a).uri,a)}function Un(e,t,n,r,i,a){return Vn(Fn(E.SCALE_TO_FILL,{id:e,width:t,height:n,name:a&&a.name,focalPoint:{x:a&&a.focalPoint&&a.focalPoint.x,y:a&&a.focalPoint&&a.focalPoint.y}},{width:r,height:i,htmlTag:Qe.IMG,alignment:O.CENTER,pixelAspectRatio:a?.devicePixelRatio??zn},a).uri,a)}function Wn(e,t,n,r,i,a,o,s,c,l){return Vn(Fn(E.SCALE_TO_FILL,{id:e,width:t,height:n,name:l&&l.name,crop:{x:r,y:i,width:a,height:o}},{width:s,height:c,htmlTag:Qe.IMG,alignment:O.CENTER,pixelAspectRatio:l?.devicePixelRatio??zn},l).uri,l)}qt(),qt();var Gn={getScaleToFitImageURL:Hn,getScaleToFillImageURL:Un,getCropImageURL:Wn},Kn=`wix:`,qn=`image`,Jn=`video`,Yn=`audio`,Xn=`document`,Zn=`https://static.wixstatic.com/media/`,Qn=`https://static.wixstatic.com/shapes/`,$n=`https://video.wixstatic.com/video/`,er=`https://static.wixstatic.com/mp3/`,tr=`https://d945e594-8657-47e2-9cd9-e9033c3d8da0.usrfiles.com/`;function nr(e,t,n,r){let i=ar(e);return Gn.getScaleToFillImageURL(i.id,i.height,i.width,t,n,r)}function rr(e,t,n,r){let i=ar(e);return Gn.getScaleToFitImageURL(i.id,i.height,i.width,t,n,r)}function ir(e,t,n,r,i,a,o,s){let c=ar(e);return Gn.getCropImageURL(c.id,c.height,c.width,t,n,r,i,a,o,s)}function ar(e){return sr(e,Zn)}function or(e){return sr(e,Qn)}function sr(e,t=Zn){let n,r,i,a;if(e.startsWith(t))n=e.split(t).pop().split(`/`)[0],a=e.split(`/w_`).pop().split(`,`)[0],i=e.split(`,h_`).pop().split(`,`)[0];else{let t=fr(e,qn),{hash:o,pathname:s}=new URL(t),c=new URLSearchParams(o.replace(`#`,``));i=c.get(`originHeight`),a=c.get(`originWidth`),[n,r]=s.replace(`${qn}://v1/`,``).split(`/`)}let o=dr(r),s={id:n,url:`${t}${n}`,height:Number(i),width:Number(a)};return o?{...s,altText:o,filename:o}:s}function cr(e,t){let n,r,i,a,o=``;if(e.startsWith($n))n=e.split($n).pop().split(`/`)[0],r=`${n}.jpg`,i=`50`,a=`50`;else{let t=fr(e,Jn),{pathname:s,hash:c}=new URL(t),l=new URLSearchParams(c.replace(`#`,``)),[u,d]=s.replace(`${Jn}://v1/`,``).split(`/`);n=u,r=l.get(`posterUri`)||`${n}.jpg`,i=l.get(`posterWidth`)||`50`,a=l.get(`posterHeight`)||`50`,o=dr(d)}let s={id:n,url:`${$n}${n}/${t?`${t}/mp4/file.mp4`:`file`}`,thumbnail:`${Kn}${qn}://v1/${r}#originWidth=${i}&originHeight=${a}`};return o?{...s,filename:o}:s}function lr(e){let t=fr(e,Yn),{pathname:n,hash:r}=new URL(t),[i,a]=n.replace(`${Yn}://v1/`,``).split(`/`),o=dr(a),s=new URLSearchParams(r.replace(`#`,``)),c={id:i,duration:Number(s.get(`duration`)||``),url:`${er}${i}`};return o?{...c,filename:o}:c}function ur(e){let t=fr(e,Xn),{pathname:n}=new URL(t),r=n.replace(`${Xn}://v1/`,``).split(`/`),i=r[0]===`ugd`||r[0]===`archives`?r.shift():`ugd`,[a,o]=r,s=dr(o),c={id:a,url:`${tr}${i}/${a}`};return s?{...c,filename:s}:c}function dr(e){return e&&decodeURIComponent(e)}function fr(e,t){let{protocol:n}=new URL(e);return n===`${t}:`?`${Kn}${e}`:e}var pr;(function(e){e.MOBILE=`360p`,e.LOW=`480p`,e.MID=`720p`,e.HIGH=`1080p`})(pr||={});var mr={getCroppedImageUrl:ir,getScaledToFillImageUrl:nr,getScaledToFitImageUrl:rr,getImageUrl:ar,getVideoUrl:cr,getAudioUrl:lr,getDocumentUrl:ur,getShapeUrl:or},hr={_id:`id`,_createdDate:`createdDate`,_updatedDate:`updatedDate`},gr={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function _r(e,t){return e?.split(`.`).map(e=>t?.[e]??e).join(`.`)}var vr=`sort.fieldName`;function yr(e,t,n){return(e===vr||e.endsWith(`.${vr}`))&&typeof t==`string`?_r(t,n):t}function br(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=xr(e,t);s!==e&&!(s in a)&&(a[s]=a[e],delete a[e]),a[s]=yr(o,a[s],t),i(a[s],o)})}};return i(e,``),e}function xr(e,t){let n;return n=e.includes(`.`)?e.split(`.`).map(e=>t[e]??e).join(`.`):t[e]??e,n}function Sr(e,t=[]){return br(e,hr,t)}function Cr(e,t=[]){return br(e,gr,t)}function wr(e){return e?new Date(e):void 0}var Tr=new WeakMap;function Er(){return{leaves:void 0,fields:void 0,mapFields:void 0,anyField:void 0}}function Dr(e,t){let n=e.get(t);return n||(n=Er(),e.set(t,n)),n}function Or(e,t){return t===`*`?(e.anyField??=Er(),e.anyField):t.endsWith(`{}`)?(e.mapFields??=new Map,Dr(e.mapFields,t.slice(0,-2))):(e.fields??=new Map,Dr(e.fields,t))}function kr(e){let t=Er();for(let n of e){let e=n.path.split(`.`).reduce(Or,t);e.leaves??=[],e.leaves.push(n)}return t}function Ar(e){let t=Tr.get(e);return t||(t=kr(e),Tr.set(e,t)),t}function jr(e){return typeof e==`object`&&!!e}function Mr(e,{isRepeated:t,isMap:n},r){return t?Array.isArray(e)?e.map(r):e:n?jr(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r(t)])):e:r(e)}function Nr(e,t,n){jr(e)&&Ir(e,t,n)}function Pr(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]=Mr(e[r],t,n);let t=e[r];Array.isArray(t)?t.forEach(e=>Nr(e,i,n)):Nr(t,i,n)}}function Fr(e,t,n){for(let[r,i]of t){let t=e[r];jr(t)&&Object.values(t).forEach(e=>Nr(e,i,n))}}function Ir(e,{fields:t,mapFields:n,anyField:r},i){t&&Pr(e,t,i),n&&Fr(e,n,i),r&&Object.values(e).forEach(e=>Nr(e,r,i))}function Lr(e,t){if(!jr(e))return e;for(let{paths:n,transformFn:r}of t)Ir(e,Ar(n),r);return e}function Rr(e){return Ur(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var zr=/([\p{Ll}\d])(\p{Lu})/gu,Br=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,Vr=`$1\0$2`,Hr=/[^\p{L}\d]+/giu;function Ur(e){let t=e.trim();t=t.replace(zr,Vr).replace(Br,Vr),t=t.replace(Hr,`\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 Wr=e=>`validationError`in(e.response?.data?.details??{}),Gr=e=>`applicationError`in(e.response?.data?.details??{}),Kr=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function qr(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(Wr(e))return Jr(e,t,n);if(Gr(e))return Xr(e);if(Kr(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:Rr(n),data:{}},requestId:e.requestId};return Yr(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return Zr(e)}var Jr=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=Qr(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 Yr(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},Yr=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),Xr=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??Rr(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 Yr(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},Zr=e=>Yr(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:Rr(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),Qr=({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:$r(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,$r(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},$r=(e,t)=>{let n=ei(e);return n==null?e:e.replace(`$[${n}]`,t[n])},ei=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function ti(){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 ni(()=>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:m.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:m.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:m.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:m.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 ni(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return ni(()=>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 ni(e){let t=globalThis.__wix_context__,n={client:m.client,elevatedClient:m.elevatedClient},r;globalThis.__wix_context__=void 0,m.client=void 0,m.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,m.client=n.client,m.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function ri(e,t){return((...n)=>{let r=ti();return r?r.initWixModules(e,t).apply(void 0,n):e.apply(void 0,n)})}function ii(e,t=!1){return ri(e,t)}function ai(e){let t=vi(gi(e.host),e.domainToMappings);return Di(wi(e.protoPath,e.data||{}),t)}var oi=[`wix.com`,`editorx.com`],si=`_`,ci=`*.`,li=RegExp(`\\.(${oi.join(`|`)})$`),ui=[`42.wixprod.net`,`uw2-edt-1.wixprod.net`,`virginia-edt.wixprod.net`],di={"payments.base44.com":`manage.wix.com`,"create.editorx.com":`editor.editorx.com`},fi=`dev.wix-code.com`,pi=/{(.*)}/,mi=RegExp(`\\.(${ui.join(`|`)})$`),hi=RegExp(`.*\\.${fi}$`);function gi(e){return _i(e).replace(li,`._base_domain_`).replace(mi,`._api_base_domain_`).replace(hi,`*.dev.wix-code.com`)}function _i(e){return di[e]??e}function vi(e,t){let n=t[e];if(n)return n;let r=yi(e,t)??bi(e,t);if(!r){if(Si(e)){let e=t[Ci];if(e)return e}let n=t[si];if(n)return n}return r??[]}function yi(e,t){return Object.entries(t).find(([t])=>{let[,...n]=e.split(`.`);return n.join(`.`)===t})?.[1]}function bi(e,t){let[n]=Object.entries(t).filter(([t])=>xi(e,t)).sort(([e],[t])=>t.length-e.length);if(!n)return;let[,r]=n;return r}function xi(e,t){if(!t.startsWith(ci))return!1;let n=t.slice(1);return e.length>n.length&&e.endsWith(n)}function Si(e){return!!e.match(/\._base_domain_$/)}var Ci=`www._base_domain_`;function wi(e,t){return e.split(`/`).map(e=>Ti(e,t)).join(`/`)}function Ti(e,t){let n=e.match(pi)||[],r=n[1];return r?Ei(t,r,e,e.replace(n[0],``)):e}function Ei(e,t,n,r){let i=e;for(let e of t.split(`.`)){if(!i)return n;i=i[e]}return`${i}${r}`}function Di(e,t){let n=t?.find(t=>e.startsWith(t.destPath));return n?n.srcPath+e.slice(n.destPath.length):e}var Oi;(function(e){e.QUERY_PARAM=`QUERY_PARAM`,e.SUBDOMAIN=`SUBDOMAIN`,e.SUBDIRECTORY=`SUBDIRECTORY`})(Oi||={});var ki={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ŋƅ`},Ai=(e,t)=>{e.searchParams.set(`lang`,t)},ji=(e,t)=>{let n=e.hostname.split(`.`);n[0]===`www`&&(n=n.slice(1)),n=[t,...n],e.hostname=n.join(`.`)},Mi=(e,t)=>{e.pathname=`/${t}${e.pathname}`},Ni=(e,t)=>{if(!t.languageCode||!t?.resolutionMethod)return e;let n=new URL(e);return(t?.resolutionMethod===`QUERY_PARAM`?Ai:t?.resolutionMethod===`SUBDOMAIN`?ji:Mi)(n,t.languageCode),n.href},Pi=(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 Fi(){let e=Ii();return e?Li(e):[]}function Ii(){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 Li(e){try{if(e?.supportedLanguages?.length){let t=e.supportedLanguages,n=t.map(e=>e.languageCode).filter(Boolean),r=e.cleanUrl??Vi(n);return t.map(e=>({id:e.languageCode,displayName:Ri(e),regionalFormat:[e.locale?.languageCode,e.locale?.country].filter(Boolean).join(`-`),url:zi(e,r),primary:e.isPrimary,resolutionMethod:e.resolutionMethod}))}if(e?.siteLanguages?.length){let t=e.siteLanguages,n=Vi(t.map(e=>e.languageCode).filter(Boolean));return t.map(e=>({id:e.languageCode,displayName:Ri(e),regionalFormat:e.locale,url:zi(e,n),primary:e.isPrimaryLanguage,resolutionMethod:e.resolutionMethod?Bi(e.resolutionMethod):void 0}))}}catch(e){return console.warn(`[Multilingual Manager] listSupportedLanguages failed`,e),[]}return console.warn(`[Multilingual Manager] listSupportedLanguages is not available`),[]}function Ri(e){let t=ki[e.languageCode];if(t)return t;let n=e.name??e.countryCode;if(n)return n}function zi(e,t){if(e.url||!t||!e.resolutionMethod)return e.url;if(e.languageCode)try{return Ni(t,{languageCode:e.languageCode,countryCode:e.countryCode,resolutionMethod:Bi(e.resolutionMethod),locale:{languageCode:e.languageCode,country:e.countryCode}})}catch(e){console.warn(`[Multilingual Manager] buildUrlForLanguage failed`,e);return}}function Bi(e){switch(e){case`QUERY_PARAM`:case`QueryParam`:return Oi.QUERY_PARAM;case`SUBDOMAIN`:case`Subdomain`:return Oi.SUBDOMAIN;case`SUBDIRECTORY`:case`Subdirectory`:return Oi.SUBDIRECTORY;default:return}}function Vi(e){let t=typeof window<`u`&&window.location?.href?window.location.href:``;try{return Pi(t,e)}catch(e){return console.warn(`[Multilingual Manager] cleanCurrentUrl failed`,e),t}}var Hi=`x-wix-currency`,Ui=()=>{let e=B(`currency`);if(e)return{[Hi]:e}},Wi=`x-wix-linguist`,Gi=`00000000-0000-0000-0000-000000000000`,Ki=`false`,qi=()=>{let e=B(`language`),t=B(`locale`);if(e)return{[Wi]:[e,t||e,Ki,Gi].join(`|`)}};function Ji(){let e=null,t=null;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var Yi=()=>(typeof window<`u`?window.commonConfig:void 0)??globalThis.commonConfig,B=e=>Yi()?.[e],Xi=({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=Qi();return{...a,apiBaseUrl:o,getMonitoringClient:i?.getMonitoringClientFunction?.(n,r),essentials:{language:B(`language`),locale:B(`locale`),get passThroughHeaders(){let e={...qi(),...Ui()};return Object.keys(e).length>0?e:void 0}}}},auth:e=>{let t=typeof window<`u`?window.wixEmbedsAPI:void 0;!e&&Zi()&&(e=t?.getAccessTokenFunction?.());let n=!1,{resolve:r,promise:i}=Ji();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 Zi(){return typeof document<`u`&&document.currentScript?.tagName===`SCRIPT`}function Qi(){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 $i=({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:()=>{}})}),ea=Xi({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:$i({clientSdk:t,applicationId:n}),close:()=>{}}}}),ta=(e,t)=>{let n=ea.host({applicationId:e,componentId:t}),r=ea.auth();return We({auth:r,host:n}).enableContext(`module`),r.getAccessTokenInjector()},na=e=>ta(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`,e);function V(e,t){for(let n of e){let e=n.addOns.find(e=>e.addOnId===t);if(e)return{group:n,addOn:e}}return null}function ra(e,t){return V(e,t)?.addOn??null}function H(e,t){return t.filter(t=>V(e,t.id)!==null)}function ia(e,t,n){return n.filter(n=>V(e,n.id)?.group===t).length}function aa(e,t){return!e.maxNumberOfAddOns||t<e.maxNumberOfAddOns}function oa(e,t){return e.map(n=>{let r=ia(e,n,t);return{...n,addOns:n.addOns.map(e=>{let n=t.find(t=>t.id===e.addOnId)?.quantity??0;return{...e,isSelected:n>0,selectedQuantity:n}}),selectedCount:r,canSelectMore:aa(n,r)}})}function sa(e,t,n){let r=V(e,n);return r?t.some(e=>e.id===n)?!0:aa(r.group,ia(e,r.group,t)):!1}function ca(e,t){let n=e.maxQuantity??1;return Number.isFinite(t)?Math.min(Math.max(Math.trunc(t),0),n):0}var la={category:`category`,location:`location`,page:`page`,blob:`bookingSelection`,legacyBlob:`b`,resource:`resource`,referral:`referral`,timezone:`timezone`,bookingId:`bookingId`,token:`token`,rescheduleRedirectUrl:`rescheduleRedirectUrl`};function U(e){return e.addOns??[]}function ua(e,t){let n={...e};return t.length?n.addOns=t:delete n.addOns,n}function da(e,t){let n=U(e);return ua(e,n.some(e=>e.id===t)?n.filter(e=>e.id!==t):[...n,{id:t,quantity:1}])}function fa(e,t,n){let r=U(e);return n<=0?ua(e,r.filter(e=>e.id!==t)):ua(e,r.some(e=>e.id===t)?r.map(e=>e.id===t?{...e,quantity:n}:e):[...r,{id:t,quantity:n}])}function pa(){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 ma(()=>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:m.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:m.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:m.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:m.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 ma(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return ma(()=>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 ma(e){let t=globalThis.__wix_context__,n={client:m.client,elevatedClient:m.elevatedClient},r;globalThis.__wix_context__=void 0,m.client=void 0,m.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,m.client=n.client,m.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function ha(e,t){return{...e,...Object.fromEntries(t.map(t=>[t,(...n)=>{let r=pa();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 ga(e){return ha({__type:`host`,create:t=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:r(t)}),{})},Object.keys(e))}var W=e=>typeof e==`string`,G=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},_a=e=>e==null?``:``+e,va=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},ya=/###/g,ba=e=>e&&e.indexOf(`###`)>-1?e.replace(ya,`.`):e,xa=e=>!e||W(e),K=(e,t,n)=>{let r=W(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(xa(e))return{};let t=ba(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return xa(e)?{}:{obj:e,k:ba(r[i])}},Sa=(e,t,n)=>{let{obj:r,k:i}=K(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=K(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=K(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Ca=(e,t,n,r)=>{let{obj:i,k:a}=K(e,t,Object);i[a]=i[a]||[],i[a].push(n)},q=(e,t)=>{let{obj:n,k:r}=K(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},wa=(e,t,n)=>{let r=q(e,n);return r===void 0?q(t,n):r},Ta=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?W(e[r])||e[r]instanceof String||W(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Ta(e[r],t[r],n):e[r]=t[r]);return e},J=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Ea={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},Da=e=>W(e)?e.replace(/[&<>"'\/]/g,e=>Ea[e]):e,Oa=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}},ka=[` `,`,`,`?`,`!`,`;`],Aa=new Oa(20),ja=(e,t,n)=>{t||=``,n||=``;let r=ka.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Aa.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},Ma=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},Y=e=>e?.replace(/_/g,`-`),Na={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},X=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Na,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:(W(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)}},Pa=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])})}},Fa=class extends Pa{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):W(n)&&i?o.push(...n.split(i)):o.push(n)));let s=q(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!W(n)?s:Ma(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),Sa(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)(W(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=q(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Ta(s,n,i):s={...s,...n},Sa(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}},Ia={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}},La=Symbol(`i18next/PATH_KEY`);function Ra(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===La?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Z(e,t){let{[La]:n}=e(Ra()),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 za={},Ba=e=>!W(e)&&typeof e!=`boolean`&&typeof e!=`number`,Va=class e extends Pa{constructor(e,t={}){super(),va([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=X.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=Ba(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&&!ja(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:W(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:W(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=Z(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?Z(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!W(i.count),x=e.hasDefaultValue(i),ee=b?this.pluralResolver.getSuffix(d,i.count,i):``,te=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,ne=b&&!i.ordinal&&i.count===0,S=ne&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${ee}`]||i[`defaultValue${te}`]||i.defaultValue,C=m;y&&!m&&x&&(C=S);let re=Ba(C),ie=Object.prototype.toString.apply(C);if(y&&C&&re&&_.indexOf(ie)<0&&!(W(v)&&Array.isArray(C))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,C,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(C),t=e?[]:{},n=e?g:h;for(let e in C)if(Object.prototype.hasOwnProperty.call(C,e)){let r=`${n}${o}${e}`;t[e]=x&&!m?this.translate(r,{...i,defaultValue:Ba(S)?S[e]:void 0,joinArrays:!1,ns:c}):this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=C[e])}m=t}}else if(y&&W(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=S),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&S!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?S:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);ne&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||S)})}):n(e,s,S))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=W(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&&!W(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=W(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=Ia.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 W(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?Z(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!W(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(W(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,!za[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(za[`${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&&!W(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}},Ha=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=X.create(`languageUtils`)}getScriptPartFromCode(e){if(e=Y(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=Y(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(W(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)),W(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 W(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))):W(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},Ua={zero:0,one:1,two:2,few:3,many:4,other:5},Wa={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},Ga=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=X.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=Y(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),Wa;if(!e.match(/-|_/))return Wa;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)=>Ua[e]-Ua[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))}},Ka=(e,t,n,r=`.`,i=!0)=>{let a=wa(e,t,n);return!a&&i&&W(n)&&(a=Ma(e,n,r),a===void 0&&(a=Ma(t,n,r))),a},qa=e=>e.replace(/\$/g,`$$$$`),Ja=class{constructor(e={}){this.logger=X.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Da:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?J(i):a||`{{`,this.suffix=o?J(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?J(d):f||J(`$t(`),this.nestingSuffix=p?J(p):m||J(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=Ka(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(Ka(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=>qa(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?qa(this.escape(e)):qa(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=W(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!W(a)&&!this.useRawValueToEscape&&(a=_a(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${J(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!W(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&&!W(i))return i;W(i)||(i=_a(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}},Ya=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}},Xa=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(Y(r),i),t[o]=s),s(n)}},Za=e=>(t,n,r)=>e(Y(n),r)(t),Qa=class{constructor(e={}){this.logger=X.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?Xa:Za;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()]=Xa(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}=Ya(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)}},$a=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},eo=class extends Pa{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=X.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{Ca(n.loaded,[i],a),$a(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();W(e)&&(e=this.languageUtils.toResolveHierarchy(e)),W(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)}}},to=()=>({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]),W(e[1])&&(t.defaultValue=e[1]),W(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}),no=e=>(W(e.ns)&&(e.ns=[e.ns]),W(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),W(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),ro=()=>{},io=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},ao=`__i18next_supportNoticeShown`,oo=()=>!!(typeof globalThis<`u`&&globalThis[ao]||typeof process<`u`&&{}.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`),so=()=>{typeof globalThis<`u`&&(globalThis[ao]=!0)},co=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),Q=class e extends Pa{constructor(e={},t){if(super(),this.options=no(e),this.services={},this.logger=X,this.modules={external:[]},io(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&&(W(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=to();this.options={...n,...this.options,...no(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&&!co(this)&&!oo()&&(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 💙`),so());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?X.init(r(this.modules.logger),this.options):X.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Qa;let t=new Ha(this.options);this.store=new Fa(this.options.resources,this.options);let i=this.services;i.logger=X,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new Ga(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 Ja(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new eo(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 Va(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||=ro,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=G(),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=ro){let n=t,r=W(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=G();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||=ro,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`&&Ia.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=G();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=W(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(W(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=Z(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=Z(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=Z(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return W(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=G();return this.options.ns?(W(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=G();W(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 Ha(to());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=ro){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 Fa(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={...to().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new Ja(n)}return a.translator=new Va(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();Q.createInstance,Q.dir,Q.init,Q.loadResources,Q.reloadResources,Q.use,Q.changeLanguage,Q.getFixedT,Q.t,Q.exists,Q.setDefaultNamespace,Q.hasLoadedNamespace,Q.loadNamespaces,Q.loadLanguages;var lo=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,uo={"&amp;":`&`,"&#38;":`&`,"&lt;":`<`,"&#60;":`<`,"&gt;":`>`,"&#62;":`>`,"&apos;":`'`,"&#39;":`'`,"&quot;":`"`,"&#34;":`"`,"&nbsp;":` `,"&#160;":` `,"&copy;":`©`,"&#169;":`©`,"&reg;":`®`,"&#174;":`®`,"&hellip;":`…`,"&#8230;":`…`,"&#x2F;":`/`,"&#47;":`/`},fo=e=>uo[e],po={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(lo,fo),transDefaultProps:void 0},mo=(e={})=>{po={...po,...e}},ho={type:`3rdParty`,init(e){mo(e.options.react)}},go=new Map,_o=500,vo;function yo(){if(vo===void 0)try{vo=new Intl.NumberFormat(`en-US`,{useGrouping:!1,maximumFractionDigits:0}).format(`9007199254740993`)===`9007199254740993`}catch{vo=!1}return vo}var bo=15;function xo(e){if(!(typeof e!=`string`||yo())&&e.replace(/[^0-9]/g,``).replace(/^0+/,``).length>bo)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 So(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 Co(e,t,n){let r=So(e,t,n),i=go.get(r);return i||(i=new Intl.NumberFormat(e,{...n,style:`currency`,currency:t}),go.size>=_o&&go.clear(),go.set(r,i)),i}function wo(e,{value:t,currency:n},r={}){return xo(t),Co(e,n,r).format(t)}function To(e,{value:t,currency:n},r={}){return xo(t),Co(e,n,r).formatToParts(t)}function Eo(e){return Fi().find(e=>e.primary)?.id??e}function Do(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 Oo=ga({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}=Do(e,n);return wo(r,t,i)},formatCurrencyToParts:e=>(t,n)=>{let{locale:r,formatOptions:i}=Do(e,n);return To(r,t,i)},getTranslationFunction:e=>()=>{let t=e.translations?.();if(!t)throw Error(`Host translation resources are not available.`);let n=Q.createInstance(),r=Eo(e.essentials?.language)||`en`,i={lng:e.essentials?.language||r,fallbackLng:r,resources:t};return n.use(ho).init(i,e=>{if(e)throw e}),n.t.bind(n)}}),ko=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)}}},Ao=e=>new ko(e),jo=ga({getMonitoringClient:e=>()=>e.getMonitoringClient?e.getMonitoringClient():Ao(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`)}),Mo={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 No(e){try{let t=jo.getMonitoringClient?.();return t&&typeof t[e]==`function`?t:null}catch{return null}}function Po(e,{feature:t,action:n,level:r=`error`,contexts:i}){let a=No(`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 Fo(e,{feature:t,tags:n},r){let i=No(`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 Io=class extends e{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){Po(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 Lo(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 Ro(e){let t=Lo(e);if(t.status===`fulfilled`)return t.value;throw t.status===`rejected`?t.reason:e}function zo(e){let t=Promise.resolve(e);return t.__state={status:`fulfilled`,value:e},t}var Bo=new WeakMap;function Vo(e,t,n){let r=Bo.get(e);r||(r=new WeakMap,Bo.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`?zo(t(r.__state.value)):r.__state?.status===`rejected`?zo(n(r.__state.reason)):e.then(t,n),i.set(n,a)}return a}function $(e){return e}var Ho=$(`@wix/site-service-warmup-data`);function Uo(){try{return d()}catch{return null}}function Wo(e){try{return e?e(Ho):null}catch{return null}}function Go(){let e=Wo(Uo()),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 Po(e,{feature:Mo.warmup,action:`read`,level:`warning`,contexts:{warmup:{key:n}}}),null}},set:(n,r)=>{if(t&&e)try{e.set(n,r)}catch{}}}}var Ko=$(`@wix/site-service-locale`),qo=$,Jo=qo(`@wix/viewer-service-multilingual`);function Yo(){try{return Oo.getLanguage()??`en`}catch{return`en`}}function Xo(e){try{return f(e)}catch{return null}}function Zo(){let e=Xo(Ko),t=Xo(Jo);return t?.multilingualEnabled&&t.currentLocale?.languageCode||e?.language||Yo()}var Qo=$(`@wix/site-service-renderer-configuration`);function $o(){return f(Qo).currency}function es(){return Xo(Ko)?.currency}var ts=/^[A-Z]{3}$/;function ns(e){return ts.test(e)?typeof Intl.supportedValuesOf!=`function`||Intl.supportedValuesOf(`currency`).includes(e):!1}function rs(e){let t=e?.toUpperCase();return t&&ns(t)?t:null}function is(e,t){let n=rs(e);return n&&n!==rs(t)?n:null}function as(){let e=es(),t=$o();return a(is(e,t))}var os=[],ss=[],cs=`useServiceAddOnsContext must be used within ServiceAddOnsContextProvider`;function ls({isLoading:e,hasError:t,children:n}){let r={addOnGroups:os,selected:ss,isLoading:e,hasError:t,toggleAddOn:()=>{},setAddOnQuantity:()=>{}};return p(lc.Provider,{value:r,children:n})}function us({children:e}){return p(ls,{isLoading:!0,hasError:!1,children:e})}function ds({children:e}){return p(ls,{isLoading:!1,hasError:!0,children:e})}function fs(e){if(!e)return;let t=``;return(e.filename||e.altText)&&(t=`/${encodeURIComponent(e.filename||e.altText)}`),e.id?`wix:image://v1/${e.id}${t}#originWidth=${e.width}&originHeight=${e.height}`:e.url}var ps=[{path:`addOnGroupsDetails.addOns.mainMedia.image.urlExpirationDate`}];function ms(e){return ai(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 hs=`@wix/auto_sdk_bookings_services`;function gs(e){function t({host:t}){return{entityFqdn:`wix.bookings.services.v2.service`,method:`POST`,methodFqn:`wix.bookings.services.v2.AddOnGroupsService.ListAddOnGroupsByServiceId`,packageName:hs,migrationOptions:{optInTransformResponse:!0},url:ms({protoPath:`/v2/services/add-on-groups/list-add-on-groups-by-service-id`,data:e,host:t}),data:e,transformResponse:e=>Lr(e,[{transformFn:wr,paths:ps}])}}return t}var _s=[{path:`addOnGroupsDetails.addOns.mainMedia.image`}];async function vs(e,t){let{httpClient:n,sideEffects:r}=arguments[2],i=gs(Sr({serviceId:e,groupIds:t?.groupIds}));r?.onSiteCall?.();try{let e=await n.request(i);return r?.onSuccess?.(e),Cr(Lr(e.data,[{transformFn:fs,paths:_s}]))}catch(e){let t=qr(e,{spreadPathsToArguments:{},explicitPathsToArguments:{serviceId:`$[0]`,groupIds:`$[1].groupIds`},singleArgumentUnchanged:!1},[`serviceId`,`options`]);throw r?.onError?.(e),t}}function ys(e){return(t,n)=>vs(t,n,{httpClient:e})}var bs=ii(ys);function xs(e,t){let n=e?.value,r=e?.currency;if(n==null||!r)return null;let i=Number(n);if(!Number.isFinite(i))return null;let a=i%1==0?0:2;return new Intl.NumberFormat(t,{style:`currency`,currency:r,currencyDisplay:`symbol`,maximumFractionDigits:a,minimumFractionDigits:a}).format(i).replace(/\p{Zs}/gu,`\xA0`)}async function Ss(e){return(await bs(e)).addOnGroupsDetails??[]}function Cs(e){if(!e)return null;try{let{id:t,url:n,width:r,height:i}=mr.getImageUrl(e);return t&&n?{uri:t,url:n,width:r,height:i}:null}catch{return null}}function ws(e,t){let n=e.price?.value==null?null:Number(e.price.value);return{addOnId:e.addOnId??null,addOnName:e.nameTranslated??e.name??null,addOnPrice:xs(e.price,t),addOnPriceValue:n!=null&&Number.isFinite(n)?n:null,addOnCurrency:e.price?.currency??null,durationInMinutes:e.durationInMinutes??null,maxQuantity:e.maxQuantity??null,addOnImage:Cs(e.mainMedia?.image),isSelected:!1,selectedQuantity:0}}function Ts(e,t){return e.map(e=>({groupId:e.groupId??null,groupName:e.groupNameTranslated??e.groupName??null,prompt:e.promptTranslated??e.prompt??null,maxNumberOfAddOns:e.maxNumberOfAddOns??null,addOns:(e.addOns??[]).map(e=>ws(e,t)),selectedCount:0,canSelectMore:!0}))}var Es=`bookings-uou`;function Ds(e){return e?`:currency-${e}`:``}function Os(e,t,n,r){return`${Es}:${e}:addons:${n}:${r}${Ds(t)}`}var ks=5e3,As=100,js=`wix-warmup-data`,Ms=null;function Ns(e){if(typeof document<`u`)try{let t=document.getElementById(js)?.textContent;return t?(Ms?.text!==t&&(Ms={text:t,data:JSON.parse(t).builderComponentsWarmupData??{}}),Ms.data[e]??void 0):void 0}catch{return}}var Ps=()=>({promises:new Map,invalidatedWarmup:new Set}),Fs=Ps(),Is=new WeakMap,Ls=new WeakMap;function Rs(e){if(!e)return Fs;let t=Is.get(e);return t||(t=Ps(),Is.set(e,t)),t}function zs({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=Ls.get(i);a||(a=new Map,Ls.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=Rs(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=Ns(e);if(t!==void 0){let n=zo(t);return i.promises.set(e,{promise:n,expiresAt:a+ks}),n}}let c=(async()=>{if(s){let n=await t.get(e);if(n!=null)return n}return n()})();i.promises.size>=As&&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()+ks},()=>{i.promises.get(e)===l&&i.promises.delete(e)}),c}function Bs(e,t){return Fo(`service-addons-context-load`,{feature:Mo.serviceAddOns,tags:{serviceId:e}},Ss(e)).then(e=>Ts(e,t),t=>{throw Po(t,{feature:Mo.serviceAddOns,action:`fetch-add-on-groups`,level:`warning`,contexts:{service:{serviceId:e}}}),t})}function Vs({serviceId:e,locale:t,language:n,currency:r,warmupData:i}){return zs({key:Os(n,r,e,t),warmupData:i,fetchData:()=>Bs(e,t)})}var Hs=qo(`@wix/site-service-business-logger`);function Us(e){return{evid:32,src:16,endpoint:``,params:e}}var Ws=$(`@wix/site-service-url`),Gs=`appSectionParams`;function Ks(e){let t=e.searchParams.get(Gs);if(t===null)return e;let n=new URL(e);n.searchParams.delete(Gs);for(let[e,r]of Object.entries(qs(t)))typeof r==`string`&&!n.searchParams.has(e)&&n.searchParams.set(e,r);return n}function qs(e){try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}var Js=`bookings-uou:url-change`,Ys=e=>{let t=new URL(e);return t.searchParams.sort(),t.href};function Xs(e,{disableScrollToTop:t,skipHistory:n}={}){let r=globalThis.window;if(!r?.history)return;let i=new URL(r.location.href);if(Ys(i)===Ys(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(Js))}function Zs(e){let t=globalThis.window;return t?(t.addEventListener(Js,e),t.addEventListener(`popstate`,e),()=>{t.removeEventListener(Js,e),t.removeEventListener(`popstate`,e)}):()=>{}}var Qs=e=>{try{return decodeURIComponent(e)}catch{return e}};function $s(e,t){let n=t?new URL(t).pathname:`/`;return`./${Qs(new URL(e).pathname.replace(n,``).replace(/^\/|\/$/g,``))}`}function ec(){let e=f(Ws),t=r(()=>e.currentUrl,[e]),n=l(Zs,t,t),i=s(()=>Ks(new URL(n)),[n]),a=e.siteUrl.replace(/\/$/,``);return{pathname:i.pathname,search:i.search,searchParams:i.searchParams,href:i.href,getParsedUrl:()=>Ks(new URL(e.currentUrl)),getRelativeUrl:()=>$s(e.currentUrl,a),getExternalBaseUrl:()=>a,pushUrl:Xs}}var tc=function(e){return e.BOOK_ONLINE=`bookingsBookOnline`,e.SERVICE_PAGE=`bookingsServicePage`,e.CALENDAR_PAGE=`bookingsCalendar`,e.FORM_PAGE=`bookingsForm`,e}({}),nc={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`};tc.BOOK_ONLINE;var rc=`new_bookings_server`,ic=e=>{let{reportBi:t}=f(Hs);return r(n=>{t({widget_name:e,bookingsPlatform:rc,is_over_editor:!1,...n.params,src:n.src,evid:n.evid},{endpoint:n.endpoint})},[t,e])},ac=(e,t=!0)=>{let n=ic(e),{getParsedUrl:r}=ec(),i=c(!1);o(()=>{t&&!i.current&&(i.current=!0,n(Us({referralInfo:r().searchParams.get(la.referral)??void 0})))},[t,n,r])},oc=zo({addOnGroups:os,hasError:!1}),sc=e=>({addOnGroups:e,hasError:!1}),cc=()=>({addOnGroups:os,hasError:!0}),lc=n(null);function uc(){let e=i(lc);if(!e)throw Error(cs);return e}function dc({addOnsPromise:e,isLoading:t,pickedAddOns:n,forwardToggleAddOn:i,forwardSetAddOnQuantity:a,children:o}){let{addOnGroups:l,hasError:u}=Ro(e),d=s(()=>H(l,n),[l,n]),f=s(()=>oa(l,d),[l,d]),m=c({source:n,picks:n});m.current.source!==n&&(m.current={source:n,picks:n});let h=e=>{let t=m.current;t.picks=U(e({serviceId:``,addOns:t.picks}))},g=r(()=>{let e=m.current,t=H(l,e.picks);return e.picks.filter(e=>!t.includes(e)).forEach(e=>a(e.id,0)),e.picks=t,t},[l,a]),_=r(e=>{let n=H(l,m.current.picks);!t&&sa(l,n,e)&&(g(),i(e),h(t=>da(t,e)))},[t,l,g,i]),v=r((e,n)=>{let r=t?null:ra(l,e);if(!r)return;let i=H(l,m.current.picks),o=i.find(t=>t.id===e)?.quantity??0,s=ca(r,n);s===o||o===0&&!sa(l,i,e)||(g(),a(e,s),h(t=>fa(t,e,s)))},[t,l,g,a]),y=s(()=>({addOnGroups:f,selected:d,isLoading:t,hasError:u,toggleAddOn:_,setAddOnQuantity:v}),[f,d,t,u,_,v]);return p(lc.Provider,{value:y,children:o})}function fc({children:e}){let{service:n,serviceId:r,hasAddOns:i,locale:a,isLoading:o,bookingsSettingsLoading:c,selection:l,toggleAddOn:d,setAddOnQuantity:f}=u();ac(nc.SERVICE_ADD_ONS,!o&&!c);let m=s(()=>U(l),[l]),h=Go(),g=Zo(),_=as(),v=n&&i&&r?r:null,y=s(()=>v?Vo(Vs({serviceId:v,locale:a,language:g,currency:_,warmupData:h}),sc,cc):oc,[v,a,g,_]),b=!v&&!!o;return p(Io,{fallback:p(ds,{children:e}),feature:Mo.serviceAddOns,children:p(t,{fallback:p(us,{children:e}),children:p(dc,{addOnsPromise:y,isLoading:b,pickedAddOns:m,forwardToggleAddOn:d,forwardSetAddOnQuantity:f,children:e})})})}var pc=na(`bcc1b809-bde5-4d7d-a7bb-89831fe5ccb8`);export{fc as default,pc as injectAccessTokenGetter,lc as serviceAddOnsContext,uc as useServiceAddOnsContext};
2
+ //# sourceMappingURL=context-provider-bcc1b809-bde5-4d7d-a7bb-89831fe5ccb8-DmYGXrEE.js.map